Update of /cvsroot/boost/boost/tools/jam/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8371

Modified Files:
        execnt.c 
Log Message:
More patches from Bronek

Index: execnt.c
===================================================================
RCS file: /cvsroot/boost/boost/tools/jam/src/execnt.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- execnt.c    22 Jul 2006 06:12:42 -0000      1.29
+++ execnt.c    25 Jul 2006 05:49:50 -0000      1.30
@@ -1010,7 +1010,9 @@
 }
 
 /* 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 @@
                 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 @@
                 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;
             }
         }
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to