[WIN32K:NTUSER]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 15 Oct 2015 09:50:12 +0000 (09:50 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 15 Oct 2015 09:50:12 +0000 (09:50 +0000)
- THREADINFO::hEventQueueClient is a user handle. Treat it as such.
CORE-10207

svn path=/trunk/; revision=69537

reactos/win32ss/user/ntuser/main.c

index 05fc831..b429b63 100644 (file)
@@ -508,12 +508,12 @@ InitThreadCallback(PETHREAD Thread)
         goto error;
     }
     Status = ObReferenceObjectByHandle(ptiCurrent->hEventQueueClient, 0,
         goto error;
     }
     Status = ObReferenceObjectByHandle(ptiCurrent->hEventQueueClient, 0,
-                                       *ExEventObjectType, KernelMode,
+                                       *ExEventObjectType, UserMode,
                                        (PVOID*)&ptiCurrent->pEventQueueServer, NULL);
     if (!NT_SUCCESS(Status))
     {
         ERR_CH(UserThread, "Failed referencing the event object, Status 0x%08x.\n", Status);
                                        (PVOID*)&ptiCurrent->pEventQueueServer, NULL);
     if (!NT_SUCCESS(Status))
     {
         ERR_CH(UserThread, "Failed referencing the event object, Status 0x%08x.\n", Status);
-        ZwClose(ptiCurrent->hEventQueueClient);
+        ObCloseHandle(ptiCurrent->hEventQueueClient, UserMode);
         ptiCurrent->hEventQueueClient = NULL;
         goto error;
     }
         ptiCurrent->hEventQueueClient = NULL;
         goto error;
     }
@@ -818,7 +818,7 @@ ExitThreadCallback(PETHREAD Thread)
 
     if (ptiCurrent->hEventQueueClient != NULL)
     {
 
     if (ptiCurrent->hEventQueueClient != NULL)
     {
-       ZwClose(ptiCurrent->hEventQueueClient);
+       ObCloseHandle(ptiCurrent->hEventQueueClient, UserMode);
        ObDereferenceObject(ptiCurrent->pEventQueueServer);
     }
     ptiCurrent->hEventQueueClient = NULL;
        ObDereferenceObject(ptiCurrent->pEventQueueServer);
     }
     ptiCurrent->hEventQueueClient = NULL;