From d67835f9dc6b04af69964f1cb9e30dabde72b6ee Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Fri, 1 Dec 2006 08:20:37 +0000 Subject: [PATCH] - Kill some debug prints. - Remove debug-test infinite loop from DbgkForwardException - Fix missing "break" statement in DbgkFreeDebugEvent, causing a handle leak, and in DbgkpOpenHandles, causing user-mode to get a kernel-mode handle for DLL images instead of the correct duplicated one. - Currently struggling with the fact that ArbitraryUserPointer seems to be reset to zero before it's read for the debug event, so DLL names don't come through. svn path=/trunk/; revision=25011 --- reactos/dll/ntdll/dbg/dbgui.c | 1 - reactos/dll/ntdll/ldr/utils.c | 2 -- reactos/ntoskrnl/dbgk/debug.c | 3 ++- reactos/ntoskrnl/ke/i386/exp.c | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/reactos/dll/ntdll/dbg/dbgui.c b/reactos/dll/ntdll/dbg/dbgui.c index ede05bff817..e3e3a1a96c2 100644 --- a/reactos/dll/ntdll/dbg/dbgui.c +++ b/reactos/dll/ntdll/dbg/dbgui.c @@ -282,7 +282,6 @@ DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, DebugEvent->u.LoadDll.lpImageName = ((PTEB)ThreadBasicInfo.TebBaseAddress)-> Tib.ArbitraryUserPointer; - DPRINT1("Image name: %p\n", DebugEvent->u.LoadDll.lpImageName); } else { diff --git a/reactos/dll/ntdll/ldr/utils.c b/reactos/dll/ntdll/ldr/utils.c index ce03c96c43f..bf542c86b77 100644 --- a/reactos/dll/ntdll/ldr/utils.c +++ b/reactos/dll/ntdll/ldr/utils.c @@ -2030,7 +2030,6 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL, ImageBase = 0; ArbitraryUserPointer = NtCurrentTeb()->Tib.ArbitraryUserPointer; NtCurrentTeb()->Tib.ArbitraryUserPointer = FullDosName.Buffer; - DPRINT1("POI. DAT: %p %S\n", NtCurrentTeb()->Tib.ArbitraryUserPointer, FullDosName.Buffer); Status = NtMapViewOfSection(SectionHandle, NtCurrentProcess(), &ImageBase, @@ -2042,7 +2041,6 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL, MEM_COMMIT, PAGE_READONLY); NtCurrentTeb()->Tib.ArbitraryUserPointer = ArbitraryUserPointer; - DPRINT1("Poi gone!\n"); if (!NT_SUCCESS(Status)) { DPRINT1("map view of section failed (Status 0x%08lx)\n", Status); diff --git a/reactos/ntoskrnl/dbgk/debug.c b/reactos/ntoskrnl/dbgk/debug.c index 6e67f4d232b..14253e710e8 100644 --- a/reactos/ntoskrnl/dbgk/debug.c +++ b/reactos/ntoskrnl/dbgk/debug.c @@ -329,7 +329,6 @@ DbgkForwardException(IN PEXCEPTION_RECORD ExceptionRecord, PAGED_CODE(); DBGKTRACE(DBGK_EXCEPTION_DEBUG, "ExceptionRecord: %p Port: %p\n", ExceptionRecord, DebugPort); - while (TRUE); /* Setup the API Message */ ApiMessage.h.u1.Length = sizeof(DBGKM_MSG) << 16 | @@ -401,6 +400,7 @@ DbgkpFreeDebugEvent(IN PDEBUG_EVENT DebugEvent) /* Get the pointer */ Handle = &DebugEvent->ApiMsg.CreateProcess.FileHandle; + break; /* As does DLL load */ case DbgKmLoadDllApi: @@ -1021,6 +1021,7 @@ DbgkpOpenHandles(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, /* Fall through to duplicate file handle */ DupHandle = &WaitStateChange->StateInfo.LoadDll.FileHandle; + break; /* Anything else has no handles */ default: diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index c5599f59520..d7b54625967 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -693,7 +693,7 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, if (PsGetCurrentProcess()->DebugPort) { /* FIXME : TODO */ - ASSERT(FALSE); + //KEBUGCHECK(0); } else if (KiDebugRoutine(TrapFrame, ExceptionFrame,