diff --git a/reactos/dll/ntdll/dbg/dbgui.c b/reactos/dll/ntdll/dbg/dbgui.c index 3a20789ecee..af18286de52 100644 --- a/reactos/dll/ntdll/dbg/dbgui.c +++ b/reactos/dll/ntdll/dbg/dbgui.c @@ -243,7 +243,7 @@ DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, break; /* DLL Load */ - case DbgLoadDllStateChange : + case DbgLoadDllStateChange: /* Set the Win32 debug code */ DebugEvent->dwDebugEventCode = LOAD_DLL_DEBUG_EVENT; @@ -261,9 +261,9 @@ DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, /* Open the thread */ InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); Status = NtOpenThread(&ThreadHandle, - THREAD_QUERY_INFORMATION, - &ObjectAttributes, - &WaitStateChange->AppClientId); + THREAD_QUERY_INFORMATION, + &ObjectAttributes, + &WaitStateChange->AppClientId); if (NT_SUCCESS(Status)) { /* Query thread information */ diff --git a/reactos/ntoskrnl/dbgk/dbgkutil.c b/reactos/ntoskrnl/dbgk/dbgkutil.c index 5476c14e33a..21452190eac 100644 --- a/reactos/ntoskrnl/dbgk/dbgkutil.c +++ b/reactos/ntoskrnl/dbgk/dbgkutil.c @@ -39,14 +39,12 @@ DbgkpSectionToFileHandle(IN PVOID Section) NULL); /* Open the file */ - DPRINT1("Trying to open: %wZ\n", &FileName->Name); Status = ZwOpenFile(&Handle, GENERIC_READ | SYNCHRONIZE, &ObjectAttributes, &IoStatusBlock, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SYNCHRONOUS_IO_NONALERT); - DPRINT1("Status: %lx\n", Status); /* Free the name and return the handle if we succeeded */ ExFreePool(FileName); diff --git a/reactos/ntoskrnl/dbgk/debug.c b/reactos/ntoskrnl/dbgk/debug.c index ce276aa75ce..48de669db82 100644 --- a/reactos/ntoskrnl/dbgk/debug.c +++ b/reactos/ntoskrnl/dbgk/debug.c @@ -51,7 +51,6 @@ DbgkpQueueMessage(IN PEPROCESS Process, DBGKTRACE(DBGK_MESSAGE_DEBUG, "Process: %p Thread: %p Message: %p Flags: %lx\n", Process, Thread, Message, Flags); - DBGKTRACE(DBGK_MESSAGE_DEBUG, "MessageType: %lx\n", Message->ApiNumber); /* Check if we have to allocate a debug event */ NewEvent = (Flags & 2) ? TRUE : FALSE; @@ -134,6 +133,8 @@ DbgkpQueueMessage(IN PEPROCESS Process, if (!DebugObject->DebuggerInactive) { /* Add the event into the object's list */ + DBGKTRACE(DBGK_MESSAGE_DEBUG, "Inserting: %lx %p\n", + DebugEvent, Message->ApiNumber); InsertTailList(&DebugObject->EventList, &DebugEvent->EventList); /* Check if we have to signal it */ @@ -653,17 +654,14 @@ DbgkpPostFakeThreadMessages(IN PEPROCESS Process, if (First) { /* So we'll start with the create process message */ - DPRINT1("new proces!\n"); ApiMessage.ApiNumber = DbgKmCreateProcessApi; /* Get the file handle */ - DPRINT1("section object: %p\n", Process->SectionObject); if (Process->SectionObject) { /* Use the section object */ CreateProcess->FileHandle = DbgkpSectionToFileHandle(Process->SectionObject); - DPRINT1("FileHandle: %p\n", CreateProcess->FileHandle); } else { @@ -672,9 +670,7 @@ DbgkpPostFakeThreadMessages(IN PEPROCESS Process, } /* Set the base address */ - DPRINT1("SectionBaseAddress: %p\n", Process->SectionBaseAddress); CreateProcess->BaseOfImage = Process->SectionBaseAddress; - KEBUGCHECK(0); /* Get the NT Header */ NtHeader = RtlImageNtHeader(Process->SectionBaseAddress); @@ -803,6 +799,8 @@ NTAPI DbgkpConvertKernelToUserStateChange(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, IN PDEBUG_EVENT DebugEvent) { + DBGKTRACE(DBGK_OBJECT_DEBUG, "DebugEvent: %p\n", DebugEvent); + /* Start by copying the client ID */ WaitStateChange->AppClientId = DebugEvent->ClientId; @@ -954,8 +952,8 @@ DbgkpOpenHandles(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, HANDLE Handle; PHANDLE DupHandle; PAGED_CODE(); - DBGKTRACE(DBGK_OBJECT_DEBUG, "Process: %p Thread: %p\n", - Process, Thread); + DBGKTRACE(DBGK_OBJECT_DEBUG, "Process: %p Thread: %p State: %lx\n", + Process, Thread, WaitStateChange->NewState); /* Check which state this is */ switch (WaitStateChange->NewState) @@ -1272,11 +1270,12 @@ ThreadScan: { /* Get the debug event */ DebugEvent = CONTAINING_RECORD(NextEntry, DEBUG_EVENT, EventList); - DBGKTRACE(DBGK_PROCESS_DEBUG, "DebugEvent: %p Flags: %lx\n", - DebugEvent, DebugEvent->Flags); + DBGKTRACE(DBGK_PROCESS_DEBUG, "DebugEvent: %p Flags: %lx TH: %p/%p\n", + DebugEvent, DebugEvent->Flags, + DebugEvent->BackoutThread, PsGetCurrentThread()); /* Check for if the debug event queue needs flushing */ - if ((DebugEvent->Flags & 4) & + if ((DebugEvent->Flags & 4) && (DebugEvent->BackoutThread == PsGetCurrentThread())) { /* Get the event's thread */ @@ -1905,6 +1904,8 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle, DebugEvent = CONTAINING_RECORD(NextEntry, DEBUG_EVENT, EventList); + DBGKTRACE(DBGK_PROCESS_DEBUG, "DebugEvent: %p Flags: %lx\n", + DebugEvent, DebugEvent->Flags); /* Check flags */ if (!(DebugEvent->Flags & (4 | 1))) @@ -1973,7 +1974,7 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle, if (!NT_SUCCESS(Status)) break; /* Check if we got an event */ - if (GotEvent) + if (!GotEvent) { /* Check if we can wait again */ if (!SafeTimeOut.QuadPart) diff --git a/reactos/ntoskrnl/io/iomgr/file.c b/reactos/ntoskrnl/io/iomgr/file.c index f1f15c27792..210c0a6a633 100644 --- a/reactos/ntoskrnl/io/iomgr/file.c +++ b/reactos/ntoskrnl/io/iomgr/file.c @@ -929,6 +929,10 @@ IopQueryNameFile(IN PVOID ObjectBody, if (!LocalInfo) return STATUS_INSUFFICIENT_RESOURCES; /* Query the name */ + DPRINT("Do. Drv, DrvName: %p %p %wZ\n", + FileObject->DeviceObject, + FileObject->DeviceObject->DriverObject, + &FileObject->DeviceObject->DriverObject->DriverName); Status = ObQueryNameString(FileObject->DeviceObject, LocalInfo, Length, @@ -943,7 +947,7 @@ IopQueryNameFile(IN PVOID ObjectBody, /* Copy the information */ RtlCopyMemory(ObjectNameInfo, LocalInfo, - LocalReturnLength > Length ? + (LocalReturnLength > Length) ? Length : LocalReturnLength); /* Set buffer pointer */