* expand tabs.
This commit is contained in:
parent
09022b6d70
commit
ae3a986204
@ -6142,22 +6142,22 @@ rb_w32_getppid(void)
|
||||
|
||||
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||
if (hSnap != INVALID_HANDLE_VALUE) {
|
||||
BOOL ok;
|
||||
PROCESSENTRY32 pe;
|
||||
DWORD pid = GetCurrentProcessId();
|
||||
pe.dwSize = sizeof(pe);
|
||||
ok = Process32First(hSnap, &pe);
|
||||
while (ok) {
|
||||
if (pe.th32ProcessID == pid) {
|
||||
ppid = (rb_pid_t)pe.th32ParentProcessID;
|
||||
break;
|
||||
}
|
||||
ok = Process32Next(hSnap, &pe);
|
||||
}
|
||||
CloseHandle(hSnap);
|
||||
if (ppid != 0) {
|
||||
return ppid;
|
||||
}
|
||||
BOOL ok;
|
||||
PROCESSENTRY32 pe;
|
||||
DWORD pid = GetCurrentProcessId();
|
||||
pe.dwSize = sizeof(pe);
|
||||
ok = Process32First(hSnap, &pe);
|
||||
while (ok) {
|
||||
if (pe.th32ProcessID == pid) {
|
||||
ppid = (rb_pid_t)pe.th32ParentProcessID;
|
||||
break;
|
||||
}
|
||||
ok = Process32Next(hSnap, &pe);
|
||||
}
|
||||
CloseHandle(hSnap);
|
||||
if (ppid != 0) {
|
||||
return ppid;
|
||||
}
|
||||
}
|
||||
|
||||
if (pNtQueryInformationProcess == (query_func *)-1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user