mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:35:45 +00:00
[NTOS:DBGK]
- Add SEH in DbgkpPostFakeModuleMessages. Fixes crash in ntdll_winetest:info when trying to debug another process that was started suspended. CORE-13369 #resolve svn path=/trunk/; revision=74946
This commit is contained in:
parent
68dca562d7
commit
c2486683cc
1 changed files with 100 additions and 83 deletions
|
@ -470,6 +470,7 @@ DbgkpPostFakeModuleMessages(IN PEPROCESS Process,
|
|||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
NTSTATUS Status;
|
||||
UNICODE_STRING FullDllName;
|
||||
PAGED_CODE();
|
||||
DBGKTRACE(DBGK_PROCESS_DEBUG, "Process: %p Thread: %p DebugObject: %p\n",
|
||||
Process, Thread, DebugObject);
|
||||
|
@ -477,15 +478,22 @@ DbgkpPostFakeModuleMessages(IN PEPROCESS Process,
|
|||
/* Quit if there's no PEB */
|
||||
if (!Peb) return STATUS_SUCCESS;
|
||||
|
||||
/* Accessing user memory, need SEH */
|
||||
_SEH2_TRY
|
||||
{
|
||||
/* Get the Loader Data List */
|
||||
ProbeForRead(Peb, sizeof(*Peb), 1);
|
||||
LdrData = Peb->Ldr;
|
||||
ProbeForRead(LdrData, sizeof(*LdrData), 1);
|
||||
ListHead = &LdrData->InLoadOrderModuleList;
|
||||
ProbeForRead(ListHead, sizeof(*ListHead), 1);
|
||||
NextEntry = ListHead->Flink;
|
||||
|
||||
/* Loop the modules */
|
||||
i = 0;
|
||||
while ((NextEntry != ListHead) && (i < 500))
|
||||
{
|
||||
ProbeForRead(NextEntry, sizeof(*NextEntry), 1);
|
||||
/* Skip the first entry */
|
||||
if (!i)
|
||||
{
|
||||
|
@ -499,6 +507,7 @@ DbgkpPostFakeModuleMessages(IN PEPROCESS Process,
|
|||
LdrEntry = CONTAINING_RECORD(NextEntry,
|
||||
LDR_DATA_TABLE_ENTRY,
|
||||
InLoadOrderLinks);
|
||||
ProbeForRead(LdrEntry, sizeof(*LdrEntry), 1);
|
||||
|
||||
/* Setup the API Message */
|
||||
RtlZeroMemory(&ApiMessage, sizeof(DBGKM_MSG));
|
||||
|
@ -519,8 +528,10 @@ DbgkpPostFakeModuleMessages(IN PEPROCESS Process,
|
|||
}
|
||||
|
||||
/* Trace */
|
||||
FullDllName = LdrEntry->FullDllName;
|
||||
ProbeForRead(FullDllName.Buffer, FullDllName.MaximumLength, 1);
|
||||
DBGKTRACE(DBGK_PROCESS_DEBUG, "Name: %wZ. Base: %p\n",
|
||||
&LdrEntry->FullDllName, LdrEntry->DllBase);
|
||||
&FullDllName, LdrEntry->DllBase);
|
||||
|
||||
/* Get the name of the DLL */
|
||||
Status = MmGetFileNameForAddress(NtHeader, &ModuleName);
|
||||
|
@ -567,6 +578,12 @@ DbgkpPostFakeModuleMessages(IN PEPROCESS Process,
|
|||
NextEntry = NextEntry->Flink;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
NOTHING;
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
/* Return success */
|
||||
return STATUS_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue