mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 04:20:46 +00:00
Yuriy Sidorov <jura@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. svn path=/trunk/; revision=34628
This commit is contained in:
parent
1b7106dee1
commit
e52a7ae321
2 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue