https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7caf9e9d48ca37d30f9d9d89475b0275b4ebb638

commit 7caf9e9d48ca37d30f9d9d89475b0275b4ebb638
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Fri Feb 26 08:44:51 2021 +0100
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Fri Feb 26 08:46:53 2021 +0100

    [NTOS:KD] Use Zw* syscall variants
    
    The log file can be (re-)initialized when previous mode is User-Mode,
    thus the calls fail on probing input parameters
---
 ntoskrnl/kd/kdio.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c
index 288977bebbc..4ada3609a89 100644
--- a/ntoskrnl/kd/kdio.c
+++ b/ntoskrnl/kd/kdio.c
@@ -253,7 +253,7 @@ KdpDebugLogInit(PKD_DISPATCH_TABLE DispatchTable,
                                    NULL);
 
         /* Create the log file */
-        Status = NtCreateFile(&KdpLogFileHandle,
+        Status = ZwCreateFile(&KdpLogFileHandle,
                               FILE_APPEND_DATA | SYNCHRONIZE,
                               &ObjectAttributes,
                               &Iosb,
@@ -268,7 +268,10 @@ KdpDebugLogInit(PKD_DISPATCH_TABLE DispatchTable,
         RtlFreeUnicodeString(&FileName);
 
         if (!NT_SUCCESS(Status))
+        {
+            DPRINT1("Failed to open log file: 0x%08x\n", Status);
             return;
+        }
 
         KeInitializeEvent(&KdpLoggerThreadEvent, SynchronizationEvent, TRUE);
 
@@ -282,12 +285,12 @@ KdpDebugLogInit(PKD_DISPATCH_TABLE DispatchTable,
                                       NULL);
         if (!NT_SUCCESS(Status))
         {
-            NtClose(KdpLogFileHandle);
+            ZwClose(KdpLogFileHandle);
             return;
         }
 
         Priority = 7;
-        NtSetInformationThread(ThreadHandle,
+        ZwSetInformationThread(ThreadHandle,
                                ThreadPriority,
                                &Priority,
                                sizeof(Priority));

Reply via email to