-1

So, yesterday I asked how mount point detection is done, I managed to get it running somewhat, but some messages don't seem to get through.

By using the code found in this question (click here) written by the user Aid Vllasaliu (me) my application is notified by Windows whenever a specified a mount point (in this case "E:") is mounted... sometimes...

Mount point "E:" in my case is a SD card inserted to a USB SD Card reader.

Problem aproach:

  1. Inserting USB SD Card Reader WITHOUT the SD Card inserted gives a GUID_IO_VOLUME_MOUNT notification, and it does so every minute or two

  2. As the USB SD Card Reader is inserted, I insert the SD Card in it and get the following notifications GUID_IO_VOLUME_PHYSICAL_CONFIGURATION_CHANGE, GUID_IO_VOLUME_FVE_STATUS_CHANGE and GUID_IO_VOLUME_MOUNT and the 1-minute-GUID_IO_VOLUME_MOUNT-update stops. This seems right.

  3. When I go eject the SD Card I get the GUID_IO_VOLUME_LOCK and GUID_IO_VOLUME_UNLOCK notifications. Hmmmm... shouldn't I also get a GUID_IO_VOLUME_DISMOUNT notification as well? Or something that indicates that the mount point has been dismounted? Also the 1-minute-GUID_IO_VOLUME_MOUNT-update starts again.

  4. When the SD Card is removed from the USB SD Card Reader and inserted again while keeping the SD Card Reader itself plugged in, No notification regarding the mount point is received again. I have to physically disconnect the SD Card Reader and reconnect it again. Why?

Problem

How come that no notification is sent by Windows when the volume is dismounted, ejected or anything in that fashion?

What I've done so far

I have read, re-read, and re-re-read the MSDN Article regarding Device Events, as well searched for sample code online, and articles regarding Device Events, and even looked at C++ code in order to fully understand what might cause the issues I am having.

1 Answer 1

0

I am working on this exact issue also. My reading (and experimenting) seems to indicate that you can only receive a GUID_IO_VOLUME_DISMOUNT notification mounted devices. In other words, you can only request that notification for a specific volume that has been mounted. It isn't a general notification all devices.

I am thinking that to make it work for your situation, you would register it for your mount point, your USB SD Card, once it has been mounted. I still have more experimenting to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.