Safely remove a USB drive using the Win32 API?

You can use the CM_Request_Device_Eject() function as well as some other possibilities.
Consult the following projects and articles:

DevEject: Straightforward.
http://www.withopf.com/tools/deveject/

A useful CodeProject article:
http://www.codeproject.com/KB/system/RemoveDriveByLetter.aspx

Leave a Comment