lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 12/06/2011 13.18, KHMan wrote:
On 6/12/2011 5:52 PM, steve donovan wrote:
On Sun, Jun 12, 2011 at 11:06 AM, Lorenzo Donati wrote:
Add a method path() to return the actual process path in the file
system. I
don't know if this is easy to do (maybe not, since autoit doesn't
have it),
but it could be possible since Sysinternals' "ProcessExplorer" shows it.

Ah, I see what you mean: the existing get_process_name() method gives
the exe name but not the full path. I will investigate this further.


Are you sure?

From [1] it seems that GetModuleFileNameW is just the Unicode version of GetModuleFileName. Excerpt from [1] (emphasis mine):

"Retrieves the fully-qualified path for the file that contains the specified module. THE MODULE MUST HAVE BEEN LOADED BY THE CURRENT PROCESS."

The current process here is the lua interpreter running the script where winapi's get_processes() is called. So this shouldn't be able to return the path of an arbitrary process active on the system and whose pid is returned by get_processes().

Am I missing something?

-- Lorenzo