如果我使用 Process Explorer 在我的 64 位 Windows 10 系统上查看 32 位进程的调用堆栈,Process Explorer 只显示调用堆栈的 64 位(上)部分,而不是更有趣(下)的 32-位部分。例如,一个 32 位 wmplayer.exe 进程的主线程的调用堆栈显示:
ntoskrnl.exe!KiSwapContext+0x76
ntoskrnl.exe!KiSwapThread+0x2c6
ntoskrnl.exe!KiCommitThreadWait+0x13b
ntoskrnl.exe!KeWaitForSingleObject+0x1ff
ntoskrnl.exe!KiSchedulerApc+0x30a
ntoskrnl.exe!KiDeliverApc+0x27b
ntoskrnl.exe!KiSwapThread+0x501
ntoskrnl.exe!KiCommitThreadWait+0x13b
ntoskrnl.exe!KeWaitForSingleObject+0x1ff
ntoskrnl.exe!KeWaitForMultipleObjects+0x4b5
win32kfull.sys!xxxRealSleepThread+0x32a
win32kfull.sys!xxxSleepThread2+0xa0
win32kfull.sys!xxxRealInternalGetMessage+0xf19
win32kfull.sys!NtUserGetMessage+0x8c
ntoskrnl.exe!KiSystemServiceCopyEnd+0x13
wow64win.dll!NtUserGetMessage+0x14
wow64win.dll!whNtUserGetMessage+0x30
wow64.dll!Wow64SystemServiceEx+0x153
wow64cpu.dll!ServiceNoTurbo+0xb
wow64cpu.dll!BTCpuSimulate+0x9
wow64.dll!RunCpuSimulation+0xa
wow64.dll!Wow64LdrpInitialize+0x120
ntdll.dll!LdrpInitializeProcess+0x1887
ntdll.dll!_LdrpInitialize+0x4aa45
ntdll.dll!LdrpInitialize+0x3b
ntdll.dll!LdrInitializeThunk+0xe
0x0000000000000000
而 64 位 wmplayer.exe 进程 (C:\Program Files\Windows Media Player\wmplayer.exe) 的调用堆栈是完整的,并且还包含应用程序代码中的调用:
ntoskrnl.exe!KiSwapContext+0x76
ntoskrnl.exe!KiSwapThread+0x2c6
ntoskrnl.exe!KiCommitThreadWait+0x13b
ntoskrnl.exe!KeWaitForSingleObject+0x1ff
ntoskrnl.exe!KiSchedulerApc+0x30a
ntoskrnl.exe!KiDeliverApc+0x27b
ntoskrnl.exe!KiSwapThread+0x501
ntoskrnl.exe!KiCommitThreadWait+0x13b
ntoskrnl.exe!KeWaitForSingleObject+0x1ff
ntoskrnl.exe!KeWaitForMultipleObjects+0x4b5
win32kfull.sys!xxxRealSleepThread+0x32a
win32kfull.sys!xxxSleepThread2+0xa0
win32kfull.sys!xxxRealInternalGetMessage+0xf19
win32kfull.sys!NtUserGetMessage+0x8c
ntoskrnl.exe!KiSystemServiceCopyEnd+0x13
win32u.dll!NtUserGetMessage+0x14
USER32.dll!GetMessageW+0x2b
wmp.dll!Ordinal3002+0x731
wmp.dll!Ordinal3002+0x65f
wmp.dll!Ordinal3000+0x12e
wmplayer.exe!_PlayerEntry+0x747
KERNEL32.DLL!BaseThreadInitThunk+0x14
ntdll.dll!RtlUserThreadStart+0x21
如果我不得不猜测,我会说是第一个堆栈中的 0x0000000000000000 地址阻止了 Process Explorer 进一步深入 32 位部分,但我不能 100% 确定这一点。如何让 Process Explorer 显示 32 位进程的 32 位堆栈?
有关我的设置的更多信息:
Windows 10 version 1803 build 17134.556
Windows SDK 10.0.17763.132 installed
Process Explorer version 16.22
Symbol configuration:
Dbghelp.dll path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll
Symbols path: symsrv*symsrv.dll*C:\LocalSymbols*http://msdl.microsoft.com/download/symbols
更新:当使用 Process Hacker 而不是 Process Explorer 查看 32 位进程的调用堆栈时,会显示预期的 32 位堆栈。对于 32 位 wmplayer.exe 的主线程,Process Hacker 显示:
0, wow64win.dll!NtUserGetMessage+0x14
1, wow64win.dll!whNtUserGetMessage+0x30
2, wow64.dll!Wow64SystemServiceEx+0x153
3, wow64cpu.dll!ServiceNoTurbo+0xb
4, wow64cpu.dll!BTCpuSimulate+0x9
5, wow64.dll!RunCpuSimulation+0xa
6, wow64.dll!Wow64LdrpInitialize+0x120
7, ntdll.dll!LdrpInitializeProcess+0x1887
8, ntdll.dll!_LdrpInitialize+0x4aa45
9, ntdll.dll!LdrpInitialize+0x3b
10, ntdll.dll!LdrInitializeThunk+0xe
11, win32u.dll!NtUserGetMessage+0xc
12, user32.dll!GetMessageW+0x30
13, wmp.dll!DllGetClassObject+0x1bf48 (No unwind info)
14, wmp.dll!DllGetClassObject+0x1bccb (No unwind info)
15, wmp.dll!Ordinal3000+0x75 (No unwind info)
16, wmplayer.exe!_PlayerEntry+0x4ff
17, kernel32.dll!BaseThreadInitThunk+0x24
18, ntdll.dll!__RtlUserThreadStart+0x2f
19, ntdll.dll!_RtlUserThreadStart+0x1b
更新 2:问题仅在 64 位进程资源管理器 (procexp64.exe) 中表现出来。当强制 Process Explorer 以 32 位运行时,它会显示 32 位堆栈:
0x00000000
win32u.dll!NtUserGetMessage+0xc
USER32.dll!GetMessageW+0x30
wmp.dll!DllGetClassObject+0x1bf48
wmp.dll!DllGetClassObject+0x1bccb
wmp.dll!Ordinal3000+0x75
wmplayer.exe!_PlayerEntry+0x4ff
KERNEL32.DLL!BaseThreadInitThunk+0x24
ntdll.dll!__RtlUserThreadStart+0x2f
ntdll.dll!_RtlUserThreadStart+0x1b
更新 3:与此同时,我已经能够确认在全新安装 Windows 10 x64 时会出现同样的问题。这排除了与我系统上现有驱动程序或软件的冲突,并且使这种理论成为 Process Explorer 中的错误的可能性越来越大。但是,似乎没有任何迹象表明这将很快得到解决。由于我确实需要能够查看 32 位调用堆栈并且 Process Hacker 仍然可以正确执行此操作,因此我没有其他选择,只能停止使用 Process Explorer 来支持 Process Hacker。