CVS: winex/dlls/psapi psapi_main.c,1.5,1.6

[email protected] 31 Jul 2007 19:42:50 -0000
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/dlls/psapi psapi_main.c,1.5,1.6Update of /var/lib/cvsd/cvsroot/winex/dlls/psapi
In directory agravaine:/tmp/cvs-serv31999/dlls/psapi

Modified Files:
	psapi_main.c 
Log Message:

- add special case to GetModuleFileNameExA() to forward to GetModuleFileNameA() if the process is the current process


Index: psapi_main.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/psapi/psapi_main.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- psapi_main.c	28 Mar 2007 14:23:33 -0000	1.5
+++ psapi_main.c	31 Jul 2007 19:42:48 -0000	1.6
@@ -273,11 +273,15 @@
   if(lpFilename&&nSize)
     lpFilename[0]='\0'; 
 
+  pid = MapProcessHandle( hProcess );  /* FIXME: use GetProcessId if we implement it */
+  TRACE("using pid=%ld\n", pid);
+
+  if (pid == GetCurrentProcessId ())
+     return GetModuleFileNameA (hModule, lpFilename, nSize);
+
   if( !hModule ) 
     FIXME("get EXE name of hProcess\n");
 
-  pid = MapProcessHandle( hProcess );  /* FIXME: use GetProcessId if we implement it */
-  TRACE("using pid=%ld\n", pid);
   snapshot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, pid);
   if( snapshot == INVALID_HANDLE_VALUE ) return FALSE;