I write an utility for my usb storage device.
The utility can configure the usb storage device as one or
two usb disks. After the disk number is changed, I need
to notify the system of this change so that the file explorer
can update the disk icon.

What should I do when the usb storage is configured from
one to two disks or from two to one disk?
I think it needs to notify the driver to reenumerate its child
PDO for usb storage. But how??

Best Regards

Jackal Huang

Re: How to notify the system of USB disk number change? by Kirk

Kirk
Wed Nov 19 01:53:04 CST 2003

"Jackal Huang" <huangjj@hotmail.com> wrote in message
news:%23$CZv%23jrDHA.2340@TK2MSFTNGP12.phx.gbl...
> What should I do when the usb storage is configured from
> one to two disks or from two to one disk?
> I think it needs to notify the driver to reenumerate its child
> PDO for usb storage. But how??

Well I guess you need to call IoInvalidateDeviceRelations ( pPDO,
BusRelations). I'm not sure what kind of driver you've developed (PDO, FDO,
filter, miniport, etc.) This might have some implications. You can also
report removal of the device by calling IoInvalidateDeviceState and then
returning from a dispatch routine with PNP_DEVICE_REMOVED.

-Kirk



Re: How to notify the system of USB disk number change? by Maxim

Maxim
Wed Nov 19 11:38:30 CST 2003

> report removal of the device by calling IoInvalidateDeviceState and then
> returning from a dispatch routine with PNP_DEVICE_REMOVED.

Yes, this is a known suicide thing :-)

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Re: How to notify the system of USB disk number change? by Jackal

Jackal
Wed Nov 19 20:04:49 CST 2003


"Kirk Ferdmann" <kirk_ferdmann@nospam.hotmail.com> ...
> "Jackal Huang" <huangjj@hotmail.com> wrote in message
> news:%23$CZv%23jrDHA.2340@TK2MSFTNGP12.phx.gbl...
> > What should I do when the usb storage is configured from
> > one to two disks or from two to one disk?
> > I think it needs to notify the driver to reenumerate its child
> > PDO for usb storage. But how??
>
> Well I guess you need to call IoInvalidateDeviceRelations ( pPDO,
> BusRelations). I'm not sure what kind of driver you've developed (PDO,
FDO,
> filter, miniport, etc.) This might have some implications. You can also
> report removal of the device by calling IoInvalidateDeviceState and then
> returning from a dispatch routine with PNP_DEVICE_REMOVED.
>
> -Kirk
>

Well, I think it's what I want to do.
My device is a standard usb storage device and it use Windows
build-in driver on Windows ME/2000/XP.

Is it possible to do so from AP?
or does Windows build-in usb storage driver support this behavior?

Best Regards

Jackal Huang