I am writing a USB driver for Windows 95 OSR21, using Driver::Works 2.0. When I unplug my device the Unload function of the driver is not called by Windows, so my driver stays in memory. This is a problem, because when I want to generate a new version of my driver, I am still debugging parts of it, I have to reboot my PC to get rid of the old driver in memory.
When I unplug my device from the USB bus, the destructor of my device class is called correctly and afterwards the destructor of the KPnPDevice and KDevice classes. But than the Unload function of the KDriver class is NOT called by Windows, so the driver stays in memory.
Could you provide me with some tips where to look at to fix this problem? What could be the cause of Windows NOT calling Unload()?
This is a problem with Windows 95 OSR 2.x. We have seen the identical behavior in the lab. Currently, there is no workaround. You may want to try using the Device Manager to remove the device. Other than that, this is the behavior that Windows 95 OSR 2.x gives.