[CONSRV] Use NtClearEvent() and NtClose() instead of the Win32 functions.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 29 Feb 2020 19:11:09 +0000 (20:11 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 2 Mar 2020 00:08:40 +0000 (01:08 +0100)
win32ss/user/winsrv/consrv/condrv/coninput.c
win32ss/user/winsrv/consrv/condrv/console.c
win32ss/user/winsrv/consrv/frontends/terminal.c

index a2041a0..63549ec 100644 (file)
@@ -185,7 +185,7 @@ PurgeInputBuffer(IN PCONSOLE_INPUT_BUFFER InputBuffer)
         ConsoleFreeHeap(Event);
     }
 
-    // CloseHandle(Console->InputBuffer.ActiveEvent);
+    // NtClose(Console->InputBuffer.ActiveEvent);
 }
 
 NTSTATUS NTAPI
@@ -221,7 +221,7 @@ VOID NTAPI
 ConDrvDeinitInputBuffer(IN PCONSOLE Console)
 {
     PurgeInputBuffer(&Console->InputBuffer);
-    CloseHandle(Console->InputBuffer.ActiveEvent);
+    NtClose(Console->InputBuffer.ActiveEvent);
 }
 
 
@@ -317,7 +317,7 @@ ConDrvGetConsoleInput(IN PCONSOLE Console,
 
     if (IsListEmpty(&InputBuffer->InputEvents))
     {
-        ResetEvent(InputBuffer->ActiveEvent);
+        NtClearEvent(InputBuffer->ActiveEvent);
     }
 
     // FIXME: If we add back UNICODE support, it's here that we need to do the translation.
@@ -365,7 +365,7 @@ ConDrvFlushConsoleInputBuffer(IN PCONSOLE Console,
 
     /* Discard all entries in the input event queue */
     PurgeInputBuffer(InputBuffer);
-    ResetEvent(InputBuffer->ActiveEvent);
+    NtClearEvent(InputBuffer->ActiveEvent);
 
     return STATUS_SUCCESS;
 }
index 50542ec..e763a81 100644 (file)
@@ -409,7 +409,7 @@ ConDrvDeleteConsole(IN PCONSOLE Console)
     /* Deinitialize the input buffer */
     ConDrvDeinitInputBuffer(Console);
 
-    if (Console->UnpauseEvent) CloseHandle(Console->UnpauseEvent);
+    if (Console->UnpauseEvent) NtClose(Console->UnpauseEvent);
 
     DPRINT("ConDrvDeleteConsole - Unlocking\n");
     LeaveCriticalSection(&Console->Lock);
index ece6bb2..7cb89e6 100644 (file)
@@ -365,7 +365,7 @@ ConSrvTermReadStream(IN OUT PTERMINAL This,
             CurrentEntry = RemoveHeadList(&InputBuffer->InputEvents);
             if (IsListEmpty(&InputBuffer->InputEvents))
             {
-                ResetEvent(InputBuffer->ActiveEvent);
+                NtClearEvent(InputBuffer->ActiveEvent);
             }
             Input = CONTAINING_RECORD(CurrentEntry, ConsoleInput, ListEntry);
 
@@ -430,7 +430,7 @@ ConSrvTermReadStream(IN OUT PTERMINAL This,
             CurrentEntry = RemoveHeadList(&InputBuffer->InputEvents);
             if (IsListEmpty(&InputBuffer->InputEvents))
             {
-                ResetEvent(InputBuffer->ActiveEvent);
+                NtClearEvent(InputBuffer->ActiveEvent);
             }
             Input = CONTAINING_RECORD(CurrentEntry, ConsoleInput, ListEntry);