1

I'm working on a KMDF pcie driver. Currently if I disconnect/reconnect the device, windows does not recognize that the device was disconnected, does not re-enumerate the node, and does not release the driver.

Currently the best way is to disable/enable the driver manually through device manager, which causes a reload. When I try to do this manually through SetupAPI.h, by using SetupDiSetClassInstallParams and SetupDiCallClassInstaller, I get an 0xe0000219 error on SetupDiCallClassInstaller, which corresponds to NO_ASSOCIATED_SERVICE, and I have no idea how to deal with this. Is there a better way to programmatically force a restart?

Alternatively, is there a way to get the translated resource list WDFCMRESLIST, normally provided by the plug-n-play EvtDevicePrepareHardware callback? This way I could reconfigure my driver.

aah
  • 81
  • 6
  • I have the same situation. If you found the solution or you know the proper way of doing that please share it with the community. – Alex D Jul 13 '17 at 19:22
  • 1
    It's been a while, but if I remember right, the NO_ASSOCIATED_SERVICE issue can be fixed by first using a global invocation of SetupDiSetClassInstallParams, and then trying a local one. This is done by changing SP_PROPCHANGE_PARAMS. However, the driver restart issue described in my post can more simply be fixed by calling SetupDiRestartDevices. Note that this also requires administrator access, just like the enumeration. – aah Jul 14 '17 at 21:29

0 Answers0