IoReportDetectedDevice Issue

hello,

I am creating a PDO using IoReportDetectedDevice with all NULLs as
parameters to register MOUNTDEV_MOUNTED_DEVICE_GUID on it to support
volume mount points. I create this PDO in response to IOCTL request from
user mode app.

Whenever I delete my FDO, how do i tell PnP manager to delete the PDO? I
could see lot of PDOs floating around in DeviceTree under
\Driver\PnPManager. And now all calls to IoReportDetectedDevice are failing
with STATUS_NO_SUCH_DEVICE error.

Can someone please throw some light on this?

Thanks,
CPd


IUknown

The PDO you report will outlive your FDO on reboot if you create it this way. I don’t think that is what you want to happen. Instead, you should enumerate a PDO from your FDO (e.g. be a bus driver). This way when the FDO goes away, so do the PDOs (KMDF makes writing a bus driver rather trivial)

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of I Unknown
Sent: Tuesday, October 24, 2006 5:31 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] IoReportDetectedDevice Issue

hello,
?
I am creating a PDO using IoReportDetectedDevice with all NULLs as parameters to register MOUNTDEV_MOUNTED_DEVICE_GUID? on it to? support volume mount points. I create this PDO in response to IOCTL request from user mode app.
?
Whenever I delete my FDO, how do i tell PnP manager to delete the PDO? I could see lot of PDOs floating around in DeviceTree under \Driver\PnPManager. And now all calls to IoReportDetectedDevice are failing with?STATUS_NO_SUCH_DEVICE error.
?
Can someone please throw some light on this?
?
Thanks,
CPd


IUknown
— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Rather than directly deleting a FDO, if we delete the volume using say
diskpart, that should send PnP Removal IRPs to FDO and if we pass the same
IRP_MN_REMOVE_DEVICE request to PDO, Will PnP manager delete the PDO created
by IoReportDetectedDevice?

status = IoSetDeviceInterfaceState(…,FALSE);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoSkipCurrentIrpStackLocation(Irp);
status = IoCallDriver(pdo, Irp); //Will this help PnP Manager to
delete the PDO???
// Detach from the underlying devices.
IoDetachDevice(pdo);
IoDeleteDevice(fdo);

Regards,
CPd

On 10/24/06, Doron Holan wrote:
>
> The PDO you report will outlive your FDO on reboot if you create it this
> way. I don’t think that is what you want to happen. Instead, you should
> enumerate a PDO from your FDO (e.g. be a bus driver). This way when the
> FDO goes away, so do the PDOs (KMDF makes writing a bus driver rather
> trivial)
>
> d
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of I Unknown
> Sent: Tuesday, October 24, 2006 5:31 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] IoReportDetectedDevice Issue
>
> hello,
>
> I am creating a PDO using IoReportDetectedDevice with all NULLs as
> parameters to register MOUNTDEV_MOUNTED_DEVICE_GUID on it to support volume
> mount points. I create this PDO in response to IOCTL request from user mode
> app.
>
> Whenever I delete my FDO, how do i tell PnP manager to delete the PDO? I
> could see lot of PDOs floating around in DeviceTree under
> \Driver\PnPManager. And now all calls to IoReportDetectedDevice are failing
> withSTATUS_NO_SUCH_DEVICE error.
>
> Can someone please throw some light on this?
>
> Thanks,
> CPd
> –
> ------------
> IUknown
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


------------
IUknown

Nope. If you want the devnode removed you’ll need to go through SetupDI
calls to delete it.

-p

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of I Unknown
Sent: Tuesday, October 24, 2006 8:19 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] IoReportDetectedDevice Issue

Rather than directly deleting a FDO, if we delete the volume using say
diskpart, that should send PnP Removal IRPs to FDO and if we pass the
same IRP_MN_REMOVE_DEVICE request to PDO, Will PnP manager delete the
PDO created by IoReportDetectedDevice?

status = IoSetDeviceInterfaceState(…,FALSE);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoSkipCurrentIrpStackLocation(Irp);
status = IoCallDriver(pdo, Irp); //Will this help PnP Manager to
delete the PDO???
// Detach from the underlying devices.
IoDetachDevice(pdo);
IoDeleteDevice(fdo);

Regards,

CPd

On 10/24/06, Doron Holan wrote:

The PDO you report will outlive your FDO on reboot if you create it this
way. I don’t think that is what you want to happen. Instead, you
should enumerate a PDO from your FDO ( e.g. be a bus driver). This way
when the FDO goes away, so do the PDOs (KMDF makes writing a bus driver
rather trivial)

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of I Unknown
Sent: Tuesday, October 24, 2006 5:31 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] IoReportDetectedDevice Issue

hello,

I am creating a PDO using IoReportDetectedDevice with all NULLs as
parameters to register MOUNTDEV_MOUNTED_DEVICE_GUID on it to support
volume mount points. I create this PDO in response to IOCTL request from
user mode app.

Whenever I delete my FDO, how do i tell PnP manager to delete the PDO? I
could see lot of PDOs floating around in DeviceTree under
\Driver\PnPManager. And now all calls to IoReportDetectedDevice are
failing withSTATUS_NO_SUCH_DEVICE error.

Can someone please throw some light on this?

Thanks,
CPd

------------
IUknown
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


------------
IUknown — Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

The PDO created by IoReportDetectedDevice has all dispatch routines
belonging to the PnP itself. You must attach your own DO (a fake FDO) to it on
top for it to be able to handle IOCTLs.

To destroy the thing, call IoInvalidateDeviceState, and then respond to
MN_QUERY_DEVICE_STATE properly (one of the flags is - “yes”, I want to commit
suicide.)

Doron Holan’s blog explains MN_QUERY_DEVICE_STATE a lot.

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

----- Original Message -----
From: “I Unknown”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, October 25, 2006 3:31 AM
Subject: [ntdev] IoReportDetectedDevice Issue

> hello,
>
> I am creating a PDO using IoReportDetectedDevice with all NULLs as
> parameters to register MOUNTDEV_MOUNTED_DEVICE_GUID on it to support
> volume mount points. I create this PDO in response to IOCTL request from
> user mode app.
>
> Whenever I delete my FDO, how do i tell PnP manager to delete the PDO? I
> could see lot of PDOs floating around in DeviceTree under
> \Driver\PnPManager. And now all calls to IoReportDetectedDevice are failing
> with STATUS_NO_SUCH_DEVICE error.
>
> Can someone please throw some light on this?
>
> Thanks,
> CPd
> –
> ------------
> IUknown
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

>The PDO you report will outlive your FDO on reboot if you create it this way.

I think that the \Device\HarddiskVolume%d volume devices created by FtDisk are
the PnP children of exactly such PDO, which hardly outlives a reboot.

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