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.