Author: fireball
Date: Mon Jul 21 04:22:28 2008
New Revision: 34628
URL:
http://svn.reactos.org/svn/reactos?rev=34628&view=rev
Log:
Yuriy Sidorov <jura(a)cp-lab.com>
- Call DbgBreakPoint() only for main thread. It fixes debugging of multithreaded apps.
- Prevent BSOD if ObReferenceObjectByHandle failed in NtGetContextThread and
NtSetContextThread.
See issue #3535 for more details.
Modified:
trunk/reactos/dll/ntdll/ldr/startup.c
trunk/reactos/ntoskrnl/ps/debug.c
Modified: trunk/reactos/dll/ntdll/ldr/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/startup.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] Mon Jul 21 04:22:28 2008
@@ -489,10 +489,10 @@
DPRINT1("Failed to initialize image\n");
ZwTerminateProcess(NtCurrentProcess(), STATUS_INVALID_IMAGE_FORMAT);
}
+
+ /* Break into debugger */
+ if (Peb->BeingDebugged) DbgBreakPoint();
}
-
- /* Break into debugger */
- if (Peb->BeingDebugged) DbgBreakPoint();
/* attach the thread */
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
Modified: trunk/reactos/ntoskrnl/ps/debug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/debug.c?rev=34…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/debug.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/debug.c [iso-8859-1] Mon Jul 21 04:22:28 2008
@@ -342,6 +342,8 @@
(PVOID*)&Thread,
NULL);
+ if (!NT_SUCCESS(Status)) return Status;
+
/* Make sure it's not a system thread */
if (Thread->SystemThread)
{
@@ -377,6 +379,8 @@
(PVOID*)&Thread,
NULL);
+ if (!NT_SUCCESS(Status)) return Status;
+
/* Make sure it's not a system thread */
if (Thread->SystemThread)
{