Howto programatically unmount a device

Hi,

i need to implement a simple “hot-swap” like software to allow a
custom hardware flash disk to be swapped while running the
system (win2000/xp).
The problem: I do not have the source code of the driver used to
access the disk (SCSI miniport) and it registers itself as
“hard disk drive”. I know, it should somehow be possible to unmount
the drive, stop the driver, swap the disk and start the driver again
(like SwapManager, www.softhelp.com, it obviously uses some setupapi.dll
functions).

Does anybody has a hint on how to do this programatically?

Thanks for your help,

Holger

Check out knowledge base article Q165721. Htat should help.

Swapping flash media that is on the ATA bus and not bridged through the
PC card interface is almost impossible. I have a driver I wrote to
replace ATAPI.SYS that has special support for flash media removal. It
is a bit archaic. I implemented the eject and load commands. When eject
is pressed, I reset the controller and set a flag to return “No Media in
Device”. I then put the new disk in and send a load command. This resets
the bus again.

I have a small shell extension that added the eject and load items to
the context menu.

The code is for NT 4.0. I never ported to w2k or XP. I can email you the
code if you are interested.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Thursday, April 04, 2002 9:20 AM
To: NT Developers Interest List
Subject: [ntdev] Howto programatically unmount a device

Hi,

i need to implement a simple “hot-swap” like software to allow a
custom hardware flash disk to be swapped while running the
system (win2000/xp).
The problem: I do not have the source code of the driver used to
access the disk (SCSI miniport) and it registers itself as
“hard disk drive”. I know, it should somehow be possible to unmount
the drive, stop the driver, swap the disk and start the driver again
(like SwapManager, www.softhelp.com, it obviously uses some setupapi.dll
functions).

Does anybody has a hint on how to do this programatically?

Thanks for your help,

Holger


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

FSCTL_LOCK/DISMOUNT/UNLOCK_VOLUME for dismount.
SetupDiRemoveDevice to stop the driver.

Max

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Thursday, April 04, 2002 9:20 PM
Subject: [ntdev] Howto programatically unmount a device

> Hi,
>
> i need to implement a simple “hot-swap” like software to allow a
> custom hardware flash disk to be swapped while running the
> system (win2000/xp).
> The problem: I do not have the source code of the driver used to
> access the disk (SCSI miniport) and it registers itself as
> “hard disk drive”. I know, it should somehow be possible to unmount
> the drive, stop the driver, swap the disk and start the driver again
> (like SwapManager, www.softhelp.com, it obviously uses some setupapi.dll
> functions).
>
> Does anybody has a hint on how to do this programatically?
>
> Thanks for your help,
>
> Holger
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>