Author: fireball
Date: Fri Apr 25 21:36:32 2014
New Revision: 62970
URL: 
http://svn.reactos.org/svn/reactos?rev=62970&view=rev
Log:
[WIN32K]
- Indeed Win32kProcessCallout may be called for a process with an already created Win32
Process Info. Handle it like in trunk. Found and fixed by Kamil Hornicek.
Modified:
    branches/arwinss/arwinss/server/main/init.c
Modified: branches/arwinss/arwinss/server/main/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/ini…
==============================================================================
--- branches/arwinss/arwinss/server/main/init.c [iso-8859-1] (original)
+++ branches/arwinss/arwinss/server/main/init.c [iso-8859-1] Fri Apr 25 21:36:32 2014
@@ -113,14 +113,20 @@
     PPROCESSINFO Win32Process;
     NTSTATUS Status;
-    DPRINT("Enter Win32kProcessCallback\n");
-
     /* Get the Win32 Process */
     Win32Process = PsGetProcessWin32Process(Process);
-    DPRINT("Win32Process %p, Create %d\n", Win32Process, Create);
-    if (Create && !Win32Process)
+    DPRINT("Win32kProcessCallback(): Win32Process %p, Create %d\n",
Win32Process, Create);
+    if (Create)
     {
         DPRINT("Creating W32 process PID:%d at IRQ level: %lu\n",
Process->UniqueProcessId, KeGetCurrentIrql());
+
+        /* We might be called with an already allocated win32 process */
+        if (Win32Process)
+        {
+            /* There is no more to do for us (this is a success code!) */
+            Status = STATUS_ALREADY_WIN32;
+            return Status;
+        }
         /* Allocate one if needed */
         /* FIXME - lock the process */
@@ -189,7 +195,6 @@
         UserLeave();
     }
-    DPRINT("Leave Win32kProcessCallback\n");
     return STATUS_SUCCESS;
 }