none
Add device call in software only driver RRS feed

  • Question

  • I am coding a software only driver that will add some details to crash dump.
    An user app contains some important details that has to be added to the crash dump.
    So the driver has to create a device object and expose a device interface so that the user mode application can connect with the driver . 
    This driver is not attached to any hardware.
    I see that device object can be created in Add device call.
    Wdfcreatedevice needs a parameter PWDFDEVICE_INIT which is passed as input to AddDevice callback.
    For a software only driver that will be started by StartService call in application , 
    will the AddDevice get invoked and when?


    Thursday, February 20, 2020 10:23 AM

Answers

  • Your pseudo-device driver will still have a DeviceAdd routine (and a .INF file), which is called by the PnP manager. One of the parameters to DeviceAdd is the device init structure that you'll pass to WdfDeviceCreate. Look at the Toaster sample in the WDK

     -Brian


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

    Thursday, February 20, 2020 6:43 PM
    Moderator

All replies

  • Your pseudo-device driver will still have a DeviceAdd routine (and a .INF file), which is called by the PnP manager. One of the parameters to DeviceAdd is the device init structure that you'll pass to WdfDeviceCreate. Look at the Toaster sample in the WDK

     -Brian


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

    Thursday, February 20, 2020 6:43 PM
    Moderator
  • Thanks Brian.
    I have worked on drivers for hardware devices and I install using New hardware wizard .
    Software only driver is new to me.
    Is there any tool for installing and starting the Windows 10 kmdf software only driver ?
    How do I install and start the driver  so that my user mode application interact with it ?
    Does executing the .inf install the driver ?
    When is the DriverEntry and AddDevice routine called for a software only driver ?


    Friday, February 21, 2020 7:28 AM
  • Depending on how you write your INF file, you can either use DevCon.exe, Add Hardware Wizard, or right-click on the .INF in Explorer and select Install

     -Brian


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

    Friday, February 21, 2020 8:58 PM
    Moderator