Click here to Skip to main content
15,888,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am following the CodeProject Tutorial to remove a USB drive in C#. the issue I am facing is the USB Pen Drive eject successfully but doesn't works on a portable hard drive. code is given below
int r = CM_Request_Device_Eject_NoUi(DevInstParent, IntPtr.Zero, null, 0, 0);
LogFile.Err("Eject Return value - " + r);

When a USB pen drive is forced to eject the integer r returns 0 and eject command is successful, but when a portable drive is forced to eject, it returns 23(CR_REMOVE_VETOED). How to tackle this issue?
Posted
Updated 21-Aug-15 19:40pm
v2

1 solution

Maybe that's because your HDD is formatted to NTFS or some application is using files from the harddrive.
 
Share this answer
 
Comments
WiXXeY 25-Aug-15 3:47am    
I am ejecting it without performing any action on it. Simply as soon as it is inserted, the eject command is issued

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900