diff --git a/ntoskrnl/ps/debug.c b/ntoskrnl/ps/debug.c index b7ea2db32eb..0a2f3e05517 100644 --- a/ntoskrnl/ps/debug.c +++ b/ntoskrnl/ps/debug.c @@ -70,9 +70,24 @@ PspDumpThreads(BOOLEAN IncludeSystem) /* Walk it */ while(Ebp != 0 && Ebp >= (PULONG)Thread->Tcb.StackLimit) { - /* Print what's on the stack */ - DbgPrint("%.8X %.8X%s", Ebp[0], Ebp[1], (i % 8) == 7 ? "\n" : " "); - Ebp = (PULONG)Ebp[0]; + ULONG EbpContent[2]; + ULONG MemoryCopied; + 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++; }