Prev: SetWindowsHookEx and WH_MOUSE behavior in W7 64-Bit
Next: Retrieving mapped drives from USB MSC device
From: MetaJack on 9 Jun 2010 10:33 I am trying to find a way to remove a drive from the system on the basis of selecting the associated Drive Letter. The routines CM_Query_And_Remove_SubTree() and SetupDiRemoveDevice() will do the job, but operate in one of several physical drive name spaces. I have tried following threads that talk about bridging from logical drive name spaces to physical drive name spaces, but none of them seem to reach the space that these two routines use. I know this has to be possible since I see other programs doing it. What did I miss?
From: Uwe Sieber on 10 Jun 2010 03:06 MetaJack wrote: > I am trying to find a way to remove a drive from the system on the basis of > selecting the associated Drive Letter. The routines > CM_Query_And_Remove_SubTree() and SetupDiRemoveDevice() will do the job, but > operate in one of several physical drive name spaces. I have tried following > threads that talk about bridging from logical drive name spaces to physical > drive name spaces, but none of them seem to reach the space that these two > routines use. I know this has to be possible since I see other programs doing > it. What did I miss? Drive letters which point to physical drives are global objects. Drive letter which exist in the user's namespace are subst, network or TrueCrypt like drives. Nothing to prepare for safe removal. Why you start a new thread? In m.p.d.device.drivers I had pointed to my sample: http://www.codeproject.com/system/RemoveDriveByLetter.asp Do you have a drive which it cannot prepare for safe removal? Uwe
From: MetaJack on 10 Jun 2010 10:11
Sorry for the double post. The post at device.drivers never showed back up on my web-based news reader until today. I concluded that device.drivers must be one of the news groups that Microsoft was shutting down and tried again in a group that was talking about the same group of functions. Your sample code at codeproject looks like exactly what I have been searching for. Thanks a million. "Uwe Sieber" wrote: > MetaJack wrote: > > I am trying to find a way to remove a drive from the system on the basis of > > selecting the associated Drive Letter. The routines > > CM_Query_And_Remove_SubTree() and SetupDiRemoveDevice() will do the job, but > > operate in one of several physical drive name spaces. I have tried following > > threads that talk about bridging from logical drive name spaces to physical > > drive name spaces, but none of them seem to reach the space that these two > > routines use. I know this has to be possible since I see other programs doing > > it. What did I miss? > > Drive letters which point to physical drives are > global objects. Drive letter which exist in the > user's namespace are subst, network or TrueCrypt > like drives. Nothing to prepare for safe removal. > > Why you start a new thread? In m.p.d.device.drivers > I had pointed to my sample: > http://www.codeproject.com/system/RemoveDriveByLetter.asp > Do you have a drive which it cannot prepare for safe > removal? > > > Uwe > > > . > |