My problem is that: a user program can on longer access the device after a
surprise removal and re-plug-in
I'm writing a usb device driver of vendor type for windows 2000 and debug it
The problem is:
When I first plug-in the usb device after PC power up, everything is OK and
a test user program can access the device via "CeateFile()"
But after the program close the device handle, I did a surprise remove to
The driver handles IRP_MN_SURPRISE_REMOVE and then IRP_MN_REMOVE_DEVICE
successfully (interface disabled ,device object deleted).
Then when I plug-in the device again, the OS finds the device and call my
AddDevice routine and sends IRP to start the device.
Driver creates the device object, start and configure the device again. The
descriptors got seem OK , symbolic link is created, interfaces are register
However, I find the user program can no longer open the device!
Although it can get interface data and set proper device path, CreateFile()
The error code from getLasterror() is 2, means "ERROR_FILE_NOT_FOUND".
And from windbg, I found the driver routine to handle "IRP_MJ_CREATE" is not
The information in the registry seems OK. All driver routine succeeds during
I'm confused. Who can give me some idea? Thanks a lot!
Does the symbolic link not work?