Merge pull request #505 from FantasyZhou/main

fix:修正GetPIDForProcess获取不到进程ID的bug
This commit is contained in:
ttttupup 2025-01-20 08:41:25 +08:00 committed by GitHub
commit 24bb7212fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -526,7 +526,7 @@ DWORD GetPIDForProcess(wchar_t* process)
if (!hSnapshot) { if (!hSnapshot) {
return 0; return 0;
} }
pe32.dwSize = sizeof(PROCESSENTRY32); pe32.dwSize = sizeof(PROCESSENTRY32W);
for (working = Process32FirstW(hSnapshot, &pe32); working; working = Process32NextW(hSnapshot, &pe32)) for (working = Process32FirstW(hSnapshot, &pe32); working; working = Process32NextW(hSnapshot, &pe32))
{ {
if (!wcscmp(pe32.szExeFile, process)) if (!wcscmp(pe32.szExeFile, process))