Prev: Writing File System Driver & Creating Virtual Disk Drive in Windows XP [Question by a Novice]
Next: Taking over a session..
From: Echo on 11 Jan 2007 05:25 As far as I know, any kind. Regards, Echo "Arkady Frenkel" wrote: > What I meant to ask is what kind of USB device can be ejected, I just don't > know such. Give me example? > TIA > Arkady > > "Echo" <Echo(a)discussions.microsoft.com> wrote in message > news:4BA702DB-4EB7-48BF-AE12-B8633B0699C7(a)microsoft.com... > > Sorry, I can't get yout idea. > > > > What I mean in last post is, Both Remove and Disable utility of devcon > > can't > > eject removable devices from system. > > > > Removable devices (not only use devices) surely can be disable, eject and > > uninstall. > > Other replies to this post have given solutions to eject these devices. > > > > Thanks & Regards, > > Echo > > > > "Arkady Frenkel" wrote: > > > >> But how you can eject USB device , that only can be disable ? > >> Arkady > >> > >> "Echo" <Echo(a)discussions.microsoft.com> wrote in message > >> news:3BE15709-8142-4A29-A815-66C3F4BE6605(a)microsoft.com... > >> > Disable is just disable like what Device Manager does, not ejecting > >> > device > >> > from system. > >> > > >> > Thanks anyway. :-) > >> > > >> > Regards, > >> > Echo > >> > > >> > > >> > > >> > "Arkady Frenkel" wrote: > >> > > >> >> Don't remove but disable > >> >> Arkady > >> >> > >> >> "Echo" <Echo(a)discussions.microsoft.com> wrote in message > >> >> news:142F7F15-F4B1-4ACA-92A7-C8BEEDAF460C(a)microsoft.com... > >> >> > Hi, Arkady Frenkel, > >> >> > > >> >> > I tried devcon, but the result is not as I expected. > >> >> > > >> >> > Remove utility of devcon will uninstall the device, instead of > >> >> > ejecting > >> >> > device only. > >> >> > And the source code uses > >> >> > SetupDiCallClassInstaller(DIF_REMOVE,Devs,DevInfo) > >> >> > to realize this utility, which causes the uninstallation. > >> >> > > >> >> > Regards, > >> >> > Echo > >> >> > > >> >> > "Arkady Frenkel" wrote: > >> >> > > >> >> >> Look at devcon ( enable/disable ) which do it using SetupDi... set > >> >> >> of > >> >> >> functions. > >> >> >> You have it in ddk examples or separately on > >> >> >> http://support.microsoft.com/kb/311272 > >> >> >> > >> >> >> Arkady > >> >> >> > >> >> >> "Echo" <Echo(a)discussions.microsoft.com> wrote in message > >> >> >> news:B9E80084-F577-4894-AF03-64CD32494A0D(a)microsoft.com... > >> >> >> > Removable devices, such as usb devices, flashmedia card, can only > >> >> >> > be > >> >> >> > safely > >> >> >> > removed by clicking the icon in system tray in WinXP. But how to > >> >> >> > make > >> >> >> > it > >> >> >> > programmatically? > >> >> >> > > >> >> >> > I tried IOCTL_STORAGE_EJECT_MEDIA, FSCTL_DISMOUNT_VOLUME, but > >> >> >> > only > >> >> >> > have > >> >> >> > effect in several special cases. > >> >> >> > > >> >> >> > Any advice be appreciated! > >> >> >> > > >> >> >> > > >> >> >> > >> >> >> > >> >> >> > >> >> > >> >> > >> >> > >> > >> > >> > > >
From: Uwe Sieber on 11 Jan 2007 05:44 Some are a bit hidden in too much text... If you want to program it yourself, here is my demo project: http://www.codeproject.com/system/RemoveDriveByLetter.asp It uses CM_Query_And_Remove_SubTree to remove the USB device. But this function requires admin previleges while CM_Request_Device_Eject works without. No idea why. Uwe Echo wrote: > Thanks a lot! > > I got what I want! And many useful tools! > > Regards, > Echo > > > "Pavel A." wrote: > >> Look at http://www.uwe-sieber.de/ >> >> Regards, >> --PA >> >> "Echo" wrote: >>> Removable devices, such as usb devices, flashmedia card, can only be safely >>> removed by clicking the icon in system tray in WinXP. But how to make it >>> programmatically? >>> >>> I tried IOCTL_STORAGE_EJECT_MEDIA, FSCTL_DISMOUNT_VOLUME, but only have >>> effect in several special cases. >>> >>> Any advice be appreciated! >>> >>>
From: Arkady Frenkel on 11 Jan 2007 06:55 I see, you talk about logical eject, and I thought about physical Arkady "Echo" <Echo(a)discussions.microsoft.com> wrote in message news:E7CE069E-6D38-4591-84A3-CFCFB42D88B2(a)microsoft.com... > As far as I know, any kind. > > Regards, > Echo > > "Arkady Frenkel" wrote: > >> What I meant to ask is what kind of USB device can be ejected, I just >> don't >> know such. Give me example? >> TIA >> Arkady >> >> "Echo" <Echo(a)discussions.microsoft.com> wrote in message >> news:4BA702DB-4EB7-48BF-AE12-B8633B0699C7(a)microsoft.com... >> > Sorry, I can't get yout idea. >> > >> > What I mean in last post is, Both Remove and Disable utility of devcon >> > can't >> > eject removable devices from system. >> > >> > Removable devices (not only use devices) surely can be disable, eject >> > and >> > uninstall. >> > Other replies to this post have given solutions to eject these devices. >> > >> > Thanks & Regards, >> > Echo >> > >> > "Arkady Frenkel" wrote: >> > >> >> But how you can eject USB device , that only can be disable ? >> >> Arkady >> >> >> >> "Echo" <Echo(a)discussions.microsoft.com> wrote in message >> >> news:3BE15709-8142-4A29-A815-66C3F4BE6605(a)microsoft.com... >> >> > Disable is just disable like what Device Manager does, not ejecting >> >> > device >> >> > from system. >> >> > >> >> > Thanks anyway. :-) >> >> > >> >> > Regards, >> >> > Echo >> >> > >> >> > >> >> > >> >> > "Arkady Frenkel" wrote: >> >> > >> >> >> Don't remove but disable >> >> >> Arkady >> >> >> >> >> >> "Echo" <Echo(a)discussions.microsoft.com> wrote in message >> >> >> news:142F7F15-F4B1-4ACA-92A7-C8BEEDAF460C(a)microsoft.com... >> >> >> > Hi, Arkady Frenkel, >> >> >> > >> >> >> > I tried devcon, but the result is not as I expected. >> >> >> > >> >> >> > Remove utility of devcon will uninstall the device, instead of >> >> >> > ejecting >> >> >> > device only. >> >> >> > And the source code uses >> >> >> > SetupDiCallClassInstaller(DIF_REMOVE,Devs,DevInfo) >> >> >> > to realize this utility, which causes the uninstallation. >> >> >> > >> >> >> > Regards, >> >> >> > Echo >> >> >> > >> >> >> > "Arkady Frenkel" wrote: >> >> >> > >> >> >> >> Look at devcon ( enable/disable ) which do it using SetupDi... >> >> >> >> set >> >> >> >> of >> >> >> >> functions. >> >> >> >> You have it in ddk examples or separately on >> >> >> >> http://support.microsoft.com/kb/311272 >> >> >> >> >> >> >> >> Arkady >> >> >> >> >> >> >> >> "Echo" <Echo(a)discussions.microsoft.com> wrote in message >> >> >> >> news:B9E80084-F577-4894-AF03-64CD32494A0D(a)microsoft.com... >> >> >> >> > Removable devices, such as usb devices, flashmedia card, can >> >> >> >> > only >> >> >> >> > be >> >> >> >> > safely >> >> >> >> > removed by clicking the icon in system tray in WinXP. But how >> >> >> >> > to >> >> >> >> > make >> >> >> >> > it >> >> >> >> > programmatically? >> >> >> >> > >> >> >> >> > I tried IOCTL_STORAGE_EJECT_MEDIA, FSCTL_DISMOUNT_VOLUME, but >> >> >> >> > only >> >> >> >> > have >> >> >> >> > effect in several special cases. >> >> >> >> > >> >> >> >> > Any advice be appreciated! >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
From: Echo on 11 Jan 2007 20:59 I tried the project, it works well with usb devices (calling CM_Request_Device_Eject), but has problem with fixed drive such as SdCard (calling CM_Query_And_Remove_SubTree). SdCard can be ejected, but can't be recognized after reinsertion. I have to "Scan for hardware changes" in Control Panel to force system to find the device. Thanks & Regards, Echo "Uwe Sieber" wrote: > > Some are a bit hidden in too much text... > If you want to program it yourself, here is my demo project: > http://www.codeproject.com/system/RemoveDriveByLetter.asp > > > It uses CM_Query_And_Remove_SubTree to remove the USB device. > But this function requires admin previleges while > CM_Request_Device_Eject works without. No idea why. > > > Uwe > > > > > > Echo wrote: > > Thanks a lot! > > > > I got what I want! And many useful tools! > > > > Regards, > > Echo > > > > > > "Pavel A." wrote: > > > >> Look at http://www.uwe-sieber.de/ > >> > >> Regards, > >> --PA > >> > >> "Echo" wrote: > >>> Removable devices, such as usb devices, flashmedia card, can only be safely > >>> removed by clicking the icon in system tray in WinXP. But how to make it > >>> programmatically? > >>> > >>> I tried IOCTL_STORAGE_EJECT_MEDIA, FSCTL_DISMOUNT_VOLUME, but only have > >>> effect in several special cases. > >>> > >>> Any advice be appreciated! > >>> > >>> >
From: Uwe Sieber on 12 Jan 2007 03:08
With 'SdCard' you mean a PCI attached SD card reader? Then you have luck to get it back by means of "Scan for hardware changes". It would not work that way with an internal USB card reader. Here the right way is to eject the media using IOCTL_STORAGE_EJECT_MEDIA. Uwe Echo wrote: > I tried the project, it works well with usb devices (calling > CM_Request_Device_Eject), but has problem with fixed drive such as SdCard > (calling CM_Query_And_Remove_SubTree). SdCard can be ejected, but can't be > recognized after reinsertion. I have to "Scan for hardware changes" in > Control Panel to force system to find the device. > > Thanks & Regards, > Echo > > "Uwe Sieber" wrote: > >> Some are a bit hidden in too much text... >> If you want to program it yourself, here is my demo project: >> http://www.codeproject.com/system/RemoveDriveByLetter.asp >> >> >> It uses CM_Query_And_Remove_SubTree to remove the USB device. >> But this function requires admin previleges while >> CM_Request_Device_Eject works without. No idea why. >> >> >> Uwe >> >> >> >> >> >> Echo wrote: >>> Thanks a lot! >>> >>> I got what I want! And many useful tools! >>> >>> Regards, >>> Echo >>> >>> >>> "Pavel A." wrote: >>> >>>> Look at http://www.uwe-sieber.de/ >>>> >>>> Regards, >>>> --PA >>>> >>>> "Echo" wrote: >>>>> Removable devices, such as usb devices, flashmedia card, can only be safely >>>>> removed by clicking the icon in system tray in WinXP. But how to make it >>>>> programmatically? >>>>> >>>>> I tried IOCTL_STORAGE_EJECT_MEDIA, FSCTL_DISMOUNT_VOLUME, but only have >>>>> effect in several special cases. >>>>> >>>>> Any advice be appreciated! >>>>> >>>>> |