[CSRSS]: Differentiate between first-try and second-try shutdown. In the first try...
authorSir Richard <sir_richard@svn.reactos.org>
Wed, 10 Mar 2010 03:35:18 +0000 (03:35 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Wed, 10 Mar 2010 03:35:18 +0000 (03:35 +0000)
svn path=/trunk/; revision=46048

reactos/subsystems/win32/csrss/api/process.c

index 1be6bdc..9bd3cd6 100644 (file)
@@ -696,7 +696,7 @@ CsrEnumProcesses(IN CSRSS_ENUM_PROCESS_PROC EnumProc,
     PLUID CallerLuid = RealContext[0];
     PCSRSS_PROCESS_DATA CsrProcess = NULL;
     NTSTATUS Status = STATUS_UNSUCCESSFUL;
-    BOOLEAN FirstTry = TRUE;
+    BOOLEAN FirstTry;
     ULONG Result = 0;
     ULONG Hash;
 
@@ -729,6 +729,7 @@ CsrEnumProcesses(IN CSRSS_ENUM_PROCESS_PROC EnumProc,
     while (TRUE)
     {
         /* Find the next process to shutdown */
+        FirstTry = TRUE;
         if (!(CsrProcess = FindProcessForShutdown(CallerLuid)))
         {
             /* Done, quit */
@@ -741,7 +742,7 @@ LoopAgain:
         /* Release the lock, make the callback, and acquire it back */
         DPRINT1("Found process: %lx\n", CsrProcess->ProcessId);
         CsrReleaseProcessLock();
-        Result = (ULONG)EnumProc(CsrProcess, Context);
+        Result = (ULONG)EnumProc(CsrProcess, (PVOID)((ULONG_PTR)Context | FirstTry));
         CsrAcquireProcessLock();
 
         /* Check the result */
@@ -754,7 +755,7 @@ LoopAgain:
         else if (Result == CsrShutdownNonCsrProcess)
         {
             /* A non-CSR process, the callback didn't touch it */
-            continue;
+            //continue;
         }
         else if (Result == CsrShutdownCancelled)
         {