usb connect disconnect problem

A

abhi

Hi,

I have an application for usb mass storage devices, which listens to
the WM_DEVICECHANGE notification and upon receiving DBT_DEVICEARRIVAL
does some processing and then soft eject the usb device thru
IOCTL_STORAGE_EJECT_MEDIA command.

I am observing that when the device is ejected at the same time the
explorer is trying to open the default window for the mass storage
device and hence I am gettting an error saying "drive letter:\\ is
inaccessible". Can someone give me an idea as to how to resolve this.
Also observed that the issue is resolved if I keep a delay of around
500 milliseconds before ejecting the device but I do not want to use
Sleep(...). I am working on Windows XP.

Thanks in advance.
Abhi
 
M

mlimber

abhi said:
I have an application for usb mass storage devices, which listens to
the WM_DEVICECHANGE notification and upon receiving DBT_DEVICEARRIVAL
does some processing and then soft eject the usb device thru
IOCTL_STORAGE_EJECT_MEDIA command.

I am observing that when the device is ejected at the same time the
explorer is trying to open the default window for the mass storage
device and hence I am gettting an error saying "drive letter:\\ is
inaccessible". Can someone give me an idea as to how to resolve this.
Also observed that the issue is resolved if I keep a delay of around
500 milliseconds before ejecting the device but I do not want to use
Sleep(...). I am working on Windows XP.

This is not a C++ language question (the topic of this group) but a
platform-specific question. Please see this FAQ for what is on-topic
here and for a list of ther places you might try:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

Cheers! --M
 

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

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top