surpriseremove test error

  • Thread starter Thread starter steven
  • Start date Start date
S

steven

My driver is for usb device. I try to test
surpriseremove. HCT simulates unpluging device. My driver
steps into PnpSurpriseRemove, PnpRemove and Unload
routine. Whwn HCT try to "insert" device, the device
manager shows :"Windows cannot load the device driver for
this hardware because a previous instance of the device
driver is still in memory. (Code 38)". Why?
 
-----Original Message-----
My driver is for usb device. I try to test
surpriseremove. HCT simulates unpluging device. My driver
steps into PnpSurpriseRemove, PnpRemove and Unload
routine. Whwn HCT try to "insert" device, the device
manager shows :"Windows cannot load the device driver for
this hardware because a previous instance of the device
driver is still in memory. (Code 38)". Why?

.

After I restart computer and restart HCT, every thing is
OK! But it's not acceptable. It must work normally on the
first run of HCT. Help me!
 
This could due to improper reference count or an race between load and
unload operations. Or the driver was referenced multiple time by the device.
 
Or, it could also be because your driver is not unloading properly during
the Surprise Removal, and therefore it can't load again when it's
reconnected.

Thanks,
Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top