Author: sginsberg
Date: Wed Jul 15 16:01:15 2009
New Revision: 41969
URL:
http://svn.reactos.org/svn/reactos?rev=41969&view=rev
Log:
- The 4th parameter of NtCreateDebugObject is not a BOOLEAN -- it is a ULONG, meaning it
could contain several flags (but only 0x1 seems to be valid). Add
DBGK_KILL_PROCESS_ON_EXIT as this flag and use it.
Modified:
trunk/reactos/dll/ntdll/dbg/dbgui.c
trunk/reactos/include/ndk/dbgkfuncs.h
trunk/reactos/include/ndk/dbgktypes.h
trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dbg/dbgui.c?rev=…
==============================================================================
--- trunk/reactos/dll/ntdll/dbg/dbgui.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/dbg/dbgui.c [iso-8859-1] Wed Jul 15 16:01:15 2009
@@ -33,7 +33,7 @@
return ZwCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[1],
DEBUG_OBJECT_ALL_ACCESS,
&ObjectAttributes,
- TRUE);
+ DBGK_KILL_PROCESS_ON_EXIT);
}
/*
Modified: trunk/reactos/include/ndk/dbgkfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/dbgkfuncs.h?re…
==============================================================================
--- trunk/reactos/include/ndk/dbgkfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/dbgkfuncs.h [iso-8859-1] Wed Jul 15 16:01:15 2009
@@ -43,7 +43,7 @@
OUT PHANDLE DebugHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
- IN BOOLEAN KillProcessOnExit
+ IN ULONG Flags
);
NTSYSCALLAPI
Modified: trunk/reactos/include/ndk/dbgktypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/dbgktypes.h?re…
==============================================================================
--- trunk/reactos/include/ndk/dbgktypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/dbgktypes.h [iso-8859-1] Wed Jul 15 16:01:15 2009
@@ -42,6 +42,12 @@
#define DEBUG_EVENT_RELEASE (0x08)
#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
Modified: trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/dbgk/dbgkobj.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] Wed Jul 15 16:01:15 2009
@@ -1512,7 +1512,7 @@
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;
@@ -1536,6 +1536,9 @@
} _SEH2_END;
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,
@@ -1561,7 +1564,7 @@
FALSE);
/* Set the Flags */
- DebugObject->KillProcessOnExit = KillProcessOnExit;
+ DebugObject->Flags = Flags;
/* Insert it */
Status = ObInsertObject((PVOID)DebugObject,