tags:

views:

44

answers:

1

I have a custom developed USB card reader. I am using the following code to interact and iterrate over the device:

http://www.codeproject.com/KB/system/usbeject.aspx

The code above provides an 'eject' method using the following line:

Native.CM_Request_Device_Eject_NoUi(device.InstanceHandle, IntPtr.Zero, null, 0, 0);

However this 'eject' method unmounts the entire drive instead of simply ejecting the media card.

Why this is a problem is because I want to 'eject' the media card, then put in a different one. However when the whole reader is ejected i have to unplug/replug the device for it to show back up.

In windows explorer when I right click 'eject' it operates as I am imagining, where it safely removes the memory card but not the card reader.

How can I go about impelmenting this different type of eject in c#?

Thanks, Stephanie