[KERNEL32][BASESRV]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 3 May 2014 02:34:40 +0000 (02:34 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 3 May 2014 02:34:40 +0000 (02:34 +0000)
Move the console/ID checking code from kernel32 to basesrv.

svn path=/branches/ntvdm/; revision=63125

dll/win32/kernel32/client/vdm.c
subsystems/win/basesrv/vdm.c

index 07f65a3..c37a3cf 100644 (file)
@@ -401,17 +401,8 @@ BaseCheckVDM(IN ULONG BinaryType,
                                  CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepCheckVDM),
                                  sizeof(BASE_CHECK_VDM));
 
-    /* Check if there is no console */
-    if (CheckVdm->ConsoleHandle == NULL)
-    {
-        /* Write back the task ID */
-        *iTask = CheckVdm->iTask;
-    }
-    else
-    {
-        /* Otherwise, iTask should be zero */
-        *iTask = 0;
-    }
+    /* Write back the task ID */
+    *iTask = CheckVdm->iTask;
 
 Cleanup:
 
index 4f6aad3..4156620 100644 (file)
@@ -665,7 +665,13 @@ CSR_API(BaseSrvCheckVDM)
             InsertTailList(&VDMConsoleListHead, &ConsoleRecord->Entry);
         }
 
-        CheckVdmRequest->iTask = ConsoleRecord->SessionId;
+        if (ConsoleRecord->ConsoleHandle == NULL)
+        {
+            /* The parent doesn't have a console, so return the session ID */
+            CheckVdmRequest->iTask = ConsoleRecord->SessionId;
+        }
+        else CheckVdmRequest->iTask = 0;
+
         CheckVdmRequest->VDMState = NewConsoleRecord ? VDM_NOT_LOADED : VDM_READY;
         Status = STATUS_SUCCESS;
     }