more win32 recover
It turns out that the processentry32 structure contents are slightly different on 2000/XP than they are on 95/98/Me according to the docs. szExeFile Pointer to a null-terminated string that specifies the name of the executable file for the process. Windows 2000/XP: The file name does not include the path. Windows 95/98/Me: The file name includes the path. Ensure that we check for the target values at the end of the string.
This commit is contained in:
@@ -418,8 +418,10 @@ int pid;
|
||||
if (Process32First(hProcessSnap, &pe32)) {
|
||||
do {
|
||||
if (pe32.th32ProcessID == (unsigned)pid && pe32.szExeFile &&
|
||||
(!strcmpi(pe32.szExeFile, "nethack.exe") ||
|
||||
!strcmpi(pe32.szExeFile, "nethackw.exe")))
|
||||
((strlen(pe32.szExeFile) >= 12 &&
|
||||
!strcmpi(&pe32.szExeFile[strlen(pe32.szExeFile) - 12], "nethackw.exe")) ||
|
||||
(strlen(pe32.szExeFile) >= 11 &&
|
||||
!strcmpi(&pe32.szExeFile[strlen(pe32.szExeFile) - 11], "nethack.exe"))))
|
||||
bRet = TRUE;
|
||||
}
|
||||
while (Process32Next(hProcessSnap, &pe32));
|
||||
|
||||
Reference in New Issue
Block a user