【发布时间】:2012-08-21 17:38:59
【问题描述】:
我之前在 Windows 7 64 位设备驱动程序中使用KeSaveExtendedProcessorState/KeRestoreExtendedProcessorState 来保存和恢复扩展处理器状态,我得到了带有 KeSaveExtendedProcessorState 的 BSOD,请您帮忙。
我使用RtlGetEnabledExtendedFeatures((ULONG64)(-1)) 获取启用的扩展功能(返回值为0x3),并将其用作KeSaveExtendedProcessorState的第一个参数,我使用MmAllocateContiguousMemory( sizeof(XSTATE_SAVE), highAddress) with highAddress = 0xbfffffff 分配用于保存扩展状态的非分页内存,并在 KeSaveExtendedProcessorState 之前将 IRQL 提升到 DISPATCH_LEVEL。我收到以下消息的 BSOD:
0: kd> !analyze -v
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
INVALID_EXTENDED_PROCESSOR_STATE (131)
Invalid combination of parameters was detected while saving or restoring
extended processor state.
Arguments:
Arg1: 0000000000000000, Invalid feature mask was passed or extended processor state is
not enabled.
Arg2: 0000000000800000, Nonzero if extended state is enabled.
Arg3: 0000000000000003, The low 32 bits of the feature mask.
Arg4: 0000000000000000, The high 32 bits of the feature mask.
我错过了什么?
谢谢。
问候, 大卫
【问题讨论】:
-
更多代码可能会有所帮助,但您是否确保遵守MSDN Docs 底部的规则?关于嵌套和 IRQL 的内容很有趣,堆栈上的存储也很有趣。无论如何,值得深思。
标签: windows device-driver