none
Is it possible to write a coinstaller.dll that can root-enumerate it's own device driver? RRS feed

  • Question

  • Hello,

    Please forgive me if this is a silly question, but I was wondering if it is possible to write a coinstaller that root-enumerates a device just like the devcon.exe tool?  For example, many of the nonPNP samples in the Windows hardware development require the user to run devcon:   

    devcon.exe install KmdfSmall.inf Root\KmdfSmall

    Could one write a basic coinstaller that only adds/removes the root hardware id for the device driver?  Are there any examples of this?  I've been looking over the Toaster example, but I'm sure it is doing what I want.

    Thanks,

    Stephen

    Thursday, February 28, 2013 4:37 AM

Answers

  • technically yes, a coinstaller can create a root devnode just like devcon.  The problem is that to get the coinstaller to load and be in a state where it could create a devnode, you need a device that is currently installing that loads the coinstaller. Or you do so in a normal app just like devcon, but at that point, you don't need a coinstaller.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, February 28, 2013 5:13 AM

All replies

  • technically yes, a coinstaller can create a root devnode just like devcon.  The problem is that to get the coinstaller to load and be in a state where it could create a devnode, you need a device that is currently installing that loads the coinstaller. Or you do so in a normal app just like devcon, but at that point, you don't need a coinstaller.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, February 28, 2013 5:13 AM
  • Hi Doron,

    Thank you for the reply.   I was assuming that a coinstaller would be called when the user right clicked "Install" on the INF file, or when a WiX installer installed the driver.  Is this not the case?  Is a coinstaller only called after the PnP manager sees the actual hardware id?

    I currently have a WiX driver installer.  It installs the driver files, but the driver isn't loaded because there isn't a hardware id in the PnP manager.  My thought was to have a coinstaller slam the root hardware id (like devcon.exe) so the PnP manager would load the driver.

    Thanks again,

    Stephen

    Thursday, February 28, 2013 4:35 PM
  • A device co-installer provided with the driver package is meant to interact with operations performed on a device being installed with that driver package or a device currently installed with that driver package.  Thus a device needs to already exist before a device co-installer can be invoked. 

    Thursday, February 28, 2013 5:10 PM
  • a coinstaller is just a DLL with a very specific entry point that the pnp install process calls to participate in pnp.  it is not magical.  outside of the pnp install process, it is just a normal dll with other entry points.  you can create a custom WiX action that calls into your DLL via your own entry point and that can create a root enumerated device, but at that point, you can do this from any DLL and if that is the only point in having a coinstaller, there is no need for one.


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, February 28, 2013 5:29 PM