Question about FastIoDetachDevice

Hi,
while i was doing some testing for a WDM mouse filter code, i have
stumbled into this :

Let’s state first that i was using a skeletone code of one of my other
drivers, which implemented fast-io (and,indeed, fastiodetachdevice).

In fastiodetach device, i usually IoDetachDevice/IoDeleteDevice.

The problem arises when i had to support IRP_MN_REMOVE_DEVICE for the
mouse filter. As soon as i detach the device (using the standard code
IoSkipCurrentIrpStackLocation,IoCallDriver,IoDetachDevice,IoDeleteDevice),
the thing crashes.
And i found out that it’s because the fast-io routine trapped the remove
first (at IoCallDriver time) and detach/delete the device first. Of
course, when i try to detach/delete it in the irp handler, boom…

I’ve easily solved this. But anyway, is this by design ? I know that
fast-io is nonsense in a WDM mouse filter code, but well… again, i’ve
stumbled into this since this was only a test, and i was using that
skeleton code including fast-io support without noticing :slight_smile:

regards,
valerio