- The 4th parameter of NtCreateDebugObject is not a BOOLEAN -- it is a ULONG, meaning...
authorStefan Ginsberg <stefanginsberg@gmail.com>
Wed, 15 Jul 2009 14:01:15 +0000 (14:01 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Wed, 15 Jul 2009 14:01:15 +0000 (14:01 +0000)
svn path=/trunk/; revision=41969

reactos/dll/ntdll/dbg/dbgui.c
reactos/include/ndk/dbgkfuncs.h
reactos/include/ndk/dbgktypes.h
reactos/ntoskrnl/dbgk/dbgkobj.c

index 376b09d..b27a5e2 100644 (file)
@@ -33,7 +33,7 @@ DbgUiConnectToDbg(VOID)
     return ZwCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[1],
                                DEBUG_OBJECT_ALL_ACCESS,
                                &ObjectAttributes,
-                               TRUE);
+                               DBGK_KILL_PROCESS_ON_EXIT);
 }
 
 /*
index a00efca..1e2b1bb 100644 (file)
@@ -43,7 +43,7 @@ NtCreateDebugObject(
     OUT PHANDLE DebugHandle,
     IN ACCESS_MASK DesiredAccess,
     IN POBJECT_ATTRIBUTES ObjectAttributes,
-    IN BOOLEAN KillProcessOnExit
+    IN ULONG Flags
 );
 
 NTSYSCALLAPI
index daf536b..0be007d 100644 (file)
@@ -43,6 +43,12 @@ Author:
 #define DEBUG_EVENT_PROTECT_FAILED        (0x10)
 #define DEBUG_EVENT_SUSPEND               (0x20)
 
+//
+// NtCreateDebugObject Flags
+//
+#define DBGK_KILL_PROCESS_ON_EXIT         (0x1)
+#define DBGK_ALL_FLAGS                    (DBGK_KILL_PROCESS_ON_EXIT)
+
 //
 // Debug Object Information Classes for NtQueryDebugObject
 //
index 528b9c9..1367688 100644 (file)
@@ -1512,7 +1512,7 @@ NTAPI
 NtCreateDebugObject(OUT PHANDLE DebugHandle,
                     IN ACCESS_MASK DesiredAccess,
                     IN POBJECT_ATTRIBUTES ObjectAttributes,
-                    IN BOOLEAN KillProcessOnExit)
+                    IN ULONG Flags)
 {
     KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
     PDEBUG_OBJECT DebugObject;
@@ -1537,6 +1537,9 @@ NtCreateDebugObject(OUT PHANDLE DebugHandle,
         if (!NT_SUCCESS(Status)) return Status;
     }
 
+    /* Check for invalid flags */
+    if (Flags & ~DBGK_ALL_FLAGS) return STATUS_INVALID_PARAMETER;
+
     /* Create the Object */
     Status = ObCreateObject(PreviousMode,
                             DbgkDebugObjectType,
@@ -1561,7 +1564,7 @@ NtCreateDebugObject(OUT PHANDLE DebugHandle,
                           FALSE);
 
         /* Set the Flags */
-        DebugObject->KillProcessOnExit = KillProcessOnExit;
+        DebugObject->Flags = Flags;
 
         /* Insert it */
         Status = ObInsertObject((PVOID)DebugObject,