mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 19:26:05 +00:00
Yuriy Sidorov <[email protected]>
- 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. svn path=/trunk/; revision=34628
This commit is contained in:
@@ -489,10 +489,10 @@ LdrpInit(PCONTEXT Context,
|
||||
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);
|
||||
|
||||
@@ -342,6 +342,8 @@ NtGetContextThread(IN HANDLE ThreadHandle,
|
||||
(PVOID*)&Thread,
|
||||
NULL);
|
||||
|
||||
if (!NT_SUCCESS(Status)) return Status;
|
||||
|
||||
/* Make sure it's not a system thread */
|
||||
if (Thread->SystemThread)
|
||||
{
|
||||
@@ -377,6 +379,8 @@ NtSetContextThread(IN HANDLE ThreadHandle,
|
||||
(PVOID*)&Thread,
|
||||
NULL);
|
||||
|
||||
if (!NT_SUCCESS(Status)) return Status;
|
||||
|
||||
/* Make sure it's not a system thread */
|
||||
if (Thread->SystemThread)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user