Hi,
I’m developing a driver that enumerates virtual disks. The driver creates the main bus extender device and listed under SCSI devices (at least under xp, in w7 is inside another subtree).
The the device receives a custom IOCTL, it creates a disk device that handles IRP_MN_QUERY_CAPABILITIES, IRP_MN_QUERY_DEVICE_RELATIONS, SCSI ioctl’s and, i think, almost all kind of messages.
The enumerator device, after receiving IRP_MN_QUERY_DEVICE_RELATIONS to enumerate child devices (checked I add the disk device to the list) and some scsi requests, it receives a IRP_MN_QUERY_DEVICE_REMOVE and because there is no paging file active, it returns STATUS_SUCCESS so the device is destroyed in the IRP_MN_REMOVE_DEVICE and Windows informs that there was an error installing the device (code 9)
After a half day, i changed the IRP_MN_QUERY_DEVICE_REMOVE to always return STATUS_UNSUCCEEDED so the remove query is cancelled, device setup continues ok and also the disk manager recognizes the new volume (ask me to partition and format if the “virtual” image is new) and works perfectly.
I cannot understand why the pdo receives the IRP_MN_QUERY_DEVICE_REMOVE in the middle of the device recognition by the o.s.
Another question is that I testes the driver in Windows 7 but when I create a virtual disk, w7 asks me for restart (in xp it is not necessary).
Best regards, Mauro.