驱动程序删除后的BSoD

我使用WDK8.0 – MSVAD的样本编写了我的第一个audio驱动程序。 我没有任何安装和工作的问题,但当我尝试通过设备pipe理器卸载驱动程序时出现问题:

  • 如果驱动程序没有使用任何应用程序,那么我将其删除没有任何问题。
  • 但是,如果我将驱动程序连接到应用程序,则操作系统(Win10 x64)需要重新加载PC,然后通过消息 – SYSTEM_THREAD_EXCEPTION_NOT_HANDLED进入BSoD。 在重新加载电源后,尽pipe有这个消息,驱动程序仍被移除。

有任何想法吗。

内存转储在这里input链接描述

我发现WinDbg的错误。 MSVAD在PnpHandler()中有一个失败的代码

ext->m_pCommon->UninstantiateDevices(); ext->m_pCommon->Release(); ext->m_pCommon = NULL; 

一定是

  if (ext->m_pCommon != NULL) { ext->m_pCommon->UninstantiateDevices(); ext->m_pCommon->Release(); ext->m_pCommon = NULL; }