POBJECT_TYPE DbgkDebugObjectType;
/* FUNCTIONS *****************************************************************/
-NTSTATUS
-STDCALL
+NTSTATUS
+STDCALL
NtCreateDebugObject(OUT PHANDLE DebugHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
PDBGK_DEBUG_OBJECT DebugObject;
HANDLE hDebug;
NTSTATUS Status = STATUS_SUCCESS;
-
+
PAGED_CODE();
- DPRINT("NtCreateDebugObject(0x%x, 0x%x, 0x%x)\n", DebugHandle, DesiredAccess, ObjectAttributes);
-
+ DPRINT("NtCreateDebugObject(0x%p, 0x%x, 0x%p)\n", DebugHandle, DesiredAccess, ObjectAttributes);
+
/* Check Output Safety */
if(PreviousMode != KernelMode) {
-
+
_SEH_TRY {
-
+
ProbeForWrite(DebugHandle,
sizeof(HANDLE),
sizeof(ULONG));
} _SEH_HANDLE {
-
+
Status = _SEH_GetExceptionCode();
-
+
} _SEH_END;
-
+
if(!NT_SUCCESS(Status)) return Status;
}
-
+
/* Create the Object */
Status = ObCreateObject(PreviousMode,
DbgkDebugObjectType,
0,
0,
(PVOID*)&DebugObject);
-
+
/* Check for Success */
if(NT_SUCCESS(Status)) {
-
+
/* Initialize the Debug Object's Fast Mutex */
ExInitializeFastMutex(&DebugObject->Mutex);
-
+
/* Initialize the State Event List */
InitializeListHead(&DebugObject->StateEventListEntry);
-
+
/* Initialize the Debug Object's Wait Event */
KeInitializeEvent(&DebugObject->Event, NotificationEvent, 0);
-
+
/* Set the Flags */
DebugObject->KillProcessOnExit = KillProcessOnExit;
-
+
/* Insert it */
Status = ObInsertObject((PVOID)DebugObject,
NULL,
NULL,
&hDebug);
ObDereferenceObject(DebugObject);
-
+
/* Check for success and return handle */
if(NT_SUCCESS(Status)) {
-
+
_SEH_TRY {
-
+
*DebugHandle = hDebug;
-
+
} _SEH_HANDLE {
-
+
Status = _SEH_GetExceptionCode();
-
+
} _SEH_END;
}
}
{
UNIMPLEMENTED;
-
+
return STATUS_NOT_IMPLEMENTED;
}
{
UNIMPLEMENTED;
-
+
return STATUS_NOT_IMPLEMENTED;
}
{
UNIMPLEMENTED;
-
+
return STATUS_NOT_IMPLEMENTED;
}
{
UNIMPLEMENTED;
-
+
return STATUS_NOT_IMPLEMENTED;
}
OUT PULONG ReturnLength OPTIONAL)
{
UNIMPLEMENTED;
-
+
return STATUS_NOT_IMPLEMENTED;
}
/* EOF */