0

WdfObjectDelete我在调用时在WDF 过滤器驱动程序中遇到 BSOD 问题Wdf01000!FxObject::CallCleanupCallbacks?大多数情况下它运行良好,但问题有时会在重新启动时发生。有人可以给我一些建议吗?谢谢。

堆栈如下

ffffaa8e`34afabf8 fffff801`6e8ff731 : 00000000`00000050 ffffaf01`48c9cff0 00000000`00000002 ffffaa8e`34afaee0 : nt!KeBugCheckEx
ffffaa8e`34afac00 fffff801`6e7702e7 : ffffaf01`48c9cc80 00000000`00000002 00000000`00000000 ffffaf01`48c9cff0 : nt!MiSystemFault+0x12ffa1
ffffaa8e`34afad40 fffff801`6e869ac9 : ffffaf01`48cb0e70 00000000`00000001 00000000`00000000 ffffaf01`48c9cd20 : nt!MmAccessFault+0x327
ffffaa8e`34afaee0 fffff801`7a061707 : 000050fe`b73632f8 fffff801`7a064526 ffffaf01`4567ef98 00000000`00000000 : nt!KiPageFault+0x349
ffffaa8e`34afb070 fffff801`7a0645b0 : ffffaf01`48c9cff0 000050fe`bc2df0b8 00000000`00000001 fffff801`7a062f3a : drvxxxx!ControlDevice::deleteDevice+0x47 [c:\works\src\drvxxxx\controldevice.cpp @ 68]
ffffaa8e`34afb0b0 fffff801`7a06297a : ffffaf01`4567ef10 ffffaf01`3dff0fd0 ffffaf01`439ece70 ffffaf01`439ece00 : drvxxxx!Driver::unregisterFilterDevice+0x80 [c:\works\src\drvxxxx\driver.cpp @ 117]
ffffaa8e`34afb100 fffff802`379cc026 : 000050fe`c200f318 ffffaf01`439ece00 00000000`00000000 ffffaa8e`34afb1a8 : drvxxxx!FilterDevice::onCleanup+0x2a [c:\works\src\drvxxxx\filterdevice.cpp @ 263]
ffffaa8e`34afb140 fffff802`379978aa : ffffaf01`3dff0ce0 ffffaa8e`34afb300 ffffaf01`3dff0d00 ffffaf01`3dff0ce0 : Wdf01000!FxObject::CallCleanupCallbacks+0x4e [minkernel\wdf\framework\shared\object\fxobject.cpp @ 353]
ffffaa8e`34afb170 fffff802`379cd7b1 : ffffaa8e`34afb300 ffffaf01`3dff0c01 ffffaf01`3dff0d00 ffff83fb`afa00000 : Wdf01000!FxObject::DisposeChildrenWorker+0x1edea 

我在函数中所做的是:

void ControlDevice::deleteDevice()
{
    PAGED_CODE();
    if (m_device)
    {
        WdfObjectDelete(m_device);
        m_device = nullptr;
    }
}

有谁知道为什么会这样?

4

1 回答 1

1

只需删除m_device = nullptr;不确定原因的代码即可解决此问题,但它可以工作。有人知道为什么吗?

于 2019-08-06T16:55:13.967 回答