who might set DO_DEVICE_INITIALIZING on a disk partition FiDO?

Hi all,

I’m working with a FiDO for a disk driver, under Windows XP, and I see something strange. When I IoCreateDevice and initialize it, I clear DO_DEVICE_INITIALIZING at the end of the creation routine. I’ve printed out the FiDO->Flags at this point, and I see it set to 0x2050.

I then see 2 IRP_MN_STARTs directed to the FiDO, and I print FiDO->Flags at the begininning and end of these, and it is 0x2050.

Then I see a device usage notification for a pagefile, I print Flags, it’s 0x2050, I clear the “DO_POWER_PAGABLE” bit, so the Flags changes to 0x50, and I print it again (so far so good). I actually clear the flag in the completion routine for the dev_usage notification, but I print it both on the IRP’s way down, and back up again.

Then I get another IRP_MN_DEVICE_USAGE_NOTIFICATION, at the beginining of this routine, the Flags for the DeviceObject is 0xd0, so the DO_DEVICE_INITIALIZING flag has been set again.

Is this the side-effect of some routine that I wasn’t aware of, is some other entity setting the flag to prevent filters from attaching above me, or have I got a code problem somewhere?

Any help greatly appreciated.

The partition manager filter sets this bit during query device relations
processing so that no one can open up the partition PDOs.

-scott


Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

<john.robinson> wrote in message news:xxxxx@ntfsd…
> Hi all,
>
> I’m working with a FiDO for a disk driver, under Windows XP, and I see
> something strange. When I IoCreateDevice and initialize it, I clear
> DO_DEVICE_INITIALIZING at the end of the creation routine. I’ve printed
> out the FiDO->Flags at this point, and I see it set to 0x2050.
>
> I then see 2 IRP_MN_STARTs directed to the FiDO, and I print FiDO->Flags
> at the begininning and end of these, and it is 0x2050.
>
> Then I see a device usage notification for a pagefile, I print Flags, it’s
> 0x2050, I clear the “DO_POWER_PAGABLE” bit, so the Flags changes to 0x50,
> and I print it again (so far so good). I actually clear the flag in the
> completion routine for the dev_usage notification, but I print it both on
> the IRP’s way down, and back up again.
>
> Then I get another IRP_MN_DEVICE_USAGE_NOTIFICATION, at the beginining of
> this routine, the Flags for the DeviceObject is 0xd0, so the
> DO_DEVICE_INITIALIZING flag has been set again.
>
> Is this the side-effect of some routine that I wasn’t aware of, is some
> other entity setting the flag to prevent filters from attaching above me,
> or have I got a code problem somewhere?
>
> Any help greatly appreciated.
></john.robinson>

Thanks, Scott. I’m just glad it’s not a fault with my code.