mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:45:42 +00:00
[NTOS:PS] Use KD routine to safely read memory from thread stack
Should fix a crash when hitting TAB+(Whatever I typed that triggerred this)
This commit is contained in:
parent
0fb3c1e91e
commit
04e9251612
1 changed files with 18 additions and 3 deletions
|
@ -70,9 +70,24 @@ PspDumpThreads(BOOLEAN IncludeSystem)
|
||||||
/* Walk it */
|
/* Walk it */
|
||||||
while(Ebp != 0 && Ebp >= (PULONG)Thread->Tcb.StackLimit)
|
while(Ebp != 0 && Ebp >= (PULONG)Thread->Tcb.StackLimit)
|
||||||
{
|
{
|
||||||
/* Print what's on the stack */
|
ULONG EbpContent[2];
|
||||||
DbgPrint("%.8X %.8X%s", Ebp[0], Ebp[1], (i % 8) == 7 ? "\n" : " ");
|
ULONG MemoryCopied;
|
||||||
Ebp = (PULONG)Ebp[0];
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
/* Get stack frame content */
|
||||||
|
Status = KdpCopyMemoryChunks((ULONG64)(ULONG_PTR)Ebp,
|
||||||
|
EbpContent,
|
||||||
|
sizeof(EbpContent),
|
||||||
|
sizeof(EbpContent),
|
||||||
|
MMDBG_COPY_UNSAFE,
|
||||||
|
&MemoryCopied);
|
||||||
|
if (!NT_SUCCESS(Status) || (MemoryCopied < sizeof(EbpContent)))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DbgPrint("%.8X %.8X%s", EbpContent[0], EbpContent[1], (i % 8) == 7 ? "\n" : " ");
|
||||||
|
Ebp = (PULONG)EbpContent[0];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue