mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 12:29:56 +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");
|
DPRINT1("Failed to initialize image\n");
|
||||||
ZwTerminateProcess(NtCurrentProcess(), STATUS_INVALID_IMAGE_FORMAT);
|
ZwTerminateProcess(NtCurrentProcess(), STATUS_INVALID_IMAGE_FORMAT);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Break into debugger */
|
/* Break into debugger */
|
||||||
if (Peb->BeingDebugged) DbgBreakPoint();
|
if (Peb->BeingDebugged) DbgBreakPoint();
|
||||||
|
}
|
||||||
|
|
||||||
/* attach the thread */
|
/* attach the thread */
|
||||||
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
|
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
|
||||||
|
|
|
@ -342,6 +342,8 @@ NtGetContextThread(IN HANDLE ThreadHandle,
|
||||||
(PVOID*)&Thread,
|
(PVOID*)&Thread,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* Make sure it's not a system thread */
|
/* Make sure it's not a system thread */
|
||||||
if (Thread->SystemThread)
|
if (Thread->SystemThread)
|
||||||
{
|
{
|
||||||
|
@ -377,6 +379,8 @@ NtSetContextThread(IN HANDLE ThreadHandle,
|
||||||
(PVOID*)&Thread,
|
(PVOID*)&Thread,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* Make sure it's not a system thread */
|
/* Make sure it's not a system thread */
|
||||||
if (Thread->SystemThread)
|
if (Thread->SystemThread)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue