2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

More patches from Bronek

[SVN r34724]
This commit is contained in:
Vladimir Prus
2006-07-25 05:50:44 +00:00
parent 7115edc2ba
commit 81d4ce4fbe

View File

@@ -1010,7 +1010,9 @@ kill_all(DWORD pid, HANDLE process)
}
/* Recursive check if first process is parent (directly or indirectly) of
the second one. Both processes are passed as process ids, not handles */
the second one. Both processes are passed as process ids, not handles.
Special return value 2 means that the second process is smss.exe and its
parent process is System (first argument is ignored) */
static int
is_parent_child(DWORD parent, DWORD child)
{
@@ -1065,10 +1067,14 @@ is_parent_child(DWORD parent, DWORD child)
This check must be performed before comparison of process
creation time */
if (stricmp(pinfo.szExeFile, "csrss.exe") == 0
|| stricmp(pinfo.szExeFile, "smss.exe") == 0)
&& is_parent_child(parent, pinfo.th32ParentProcessID) == 2)
{
if (is_parent_child(4, pinfo.th32ParentProcessID))
return 1;
return 1;
}
else if (stricmp(pinfo.szExeFile, "smss.exe") == 0
&& pinfo.th32ParentProcessID == 4)
{
return 2;
}
if (hchild != 0)
@@ -1090,7 +1096,7 @@ is_parent_child(DWORD parent, DWORD child)
if (tchild == 0.0 || tparent == 0.0 || tchild < tparent)
return 0;
return is_parent_child(parent, pinfo.th32ParentProcessID);
return is_parent_child(parent, pinfo.th32ParentProcessID) & 1;
}
}