none
Difference between replacing driver files via windows debugging and using the device manager RRS feed

  • Question

  • Hi, 

    Wanted to ask, what is the benefit of replacing driver files using a Windows Debugger (for example WinDBG) 

    (like in the method mentioned here:

    https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/mapping-driver-files )

    As opposed to installing a new driver using the device manager?

    Thanks,

    Avihai.

    Tuesday, July 3, 2018 3:21 PM

Answers

  • Once configured, the .kdfiles thing is automatic.  It can always pick up the latest build from your development machine without requiring you to copy.  It can also allow you to fix a horribly broken driver without going into safe mode.

    However, it requires a kernel debugger connection.  You can replace using Device Manager even without a debugger.  And remember, if the driver file is the only change, you don't actually have to reinstall.  You can just copy the binary into place in \Windows\System32\Drivers and restart the device.  In Windows 10, you have to disable the device before doing the copy, but you can do that in a batch file:

        devcon disable "PCI\VEN_xxxx&DEV_xxxx"
        copy t:\dev\project\debug64\newdriver.sys C:\Windows\System32\Drivers
        devcon enable "PCI\VEN_xxxx&DEV_xxxx"


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Tuesday, July 3, 2018 4:55 PM
  • I discourage my students from using Device Manager for updating their driver during development because installation is a complicated and time-consuming process that, contrary to what Microsoft claims (although, it is has gotten better), cannot always recover after a crash - which happens frequently during driver development. So, it is better to install the driver once, and then copy the driver using either WinDBG or disabling the device and using the 'copy' command

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    • Marked as answer by Avi Rotenberg Wednesday, July 4, 2018 7:07 AM
    Tuesday, July 3, 2018 7:16 PM
    Moderator

All replies

  • Once configured, the .kdfiles thing is automatic.  It can always pick up the latest build from your development machine without requiring you to copy.  It can also allow you to fix a horribly broken driver without going into safe mode.

    However, it requires a kernel debugger connection.  You can replace using Device Manager even without a debugger.  And remember, if the driver file is the only change, you don't actually have to reinstall.  You can just copy the binary into place in \Windows\System32\Drivers and restart the device.  In Windows 10, you have to disable the device before doing the copy, but you can do that in a batch file:

        devcon disable "PCI\VEN_xxxx&DEV_xxxx"
        copy t:\dev\project\debug64\newdriver.sys C:\Windows\System32\Drivers
        devcon enable "PCI\VEN_xxxx&DEV_xxxx"


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Tuesday, July 3, 2018 4:55 PM
  • I discourage my students from using Device Manager for updating their driver during development because installation is a complicated and time-consuming process that, contrary to what Microsoft claims (although, it is has gotten better), cannot always recover after a crash - which happens frequently during driver development. So, it is better to install the driver once, and then copy the driver using either WinDBG or disabling the device and using the 'copy' command

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    • Marked as answer by Avi Rotenberg Wednesday, July 4, 2018 7:07 AM
    Tuesday, July 3, 2018 7:16 PM
    Moderator