Search code examples
windowsdriverwindbgdpinst

How to automatically remove driver after crash?


I'm remote-debugging a Windows kernel-mode driver using WinDbg. The driver has issues in the initialization routine, leading to a bugcheck/crash when installing the device driver. When I detach the debugger, the target PC reboots and runs again into the same bugcheck.

In order to test a new version of the driver, I therefore have to boot into safe mode, uninstall the device using device manager and reboot into normal mode.

Is there any way to simplify this workflow so that the device driver is automatically removed upon rebooting after a bugcheck?

Additional infos:

  • I'm using dpinst to install the driver on the target PC

Solution

  • use .Kdfiles to pull a replacement driver during boot

    Documentation From MS

    Write Up in Nt Insider From Osr Online

    if you are using windows 10 then you can leverage the -m option to provide a partial name

    and forego the dospath C:\ NtPath \.\xx , %SystemRoot%

    1. confusions in the map file formats ,

    2. or as described here