I kind of posted this in another thread yesterday on NTDEV, but didn’t really get an answer.
I have a minifilter that is attempting to only filter USB devices. WPD devices, such as my iPhone connected via USB, count.
So, normally in my minifilter’s InstanceSetup, (or a work item, haven’t figured out if that is necessary yet?) I can get the disk device object via FltGetDiskDeviceObject, and usually I can send an IOCTL_STORAGE_QUERY_PROPERTY IRP to that device and get the bus type as USB (haven’t been sure if that is dependable – apparently it isn’t). The WPD storage device reports its bus type as Scsi.
So, no problem, I can also send an IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS request to this same disk device to get the VolumeExt->Extents[0].DiskNumber and use that to create a name and thus open the real disk device by name. That device, or it’s PDO, can be used to query all kinds of USB info. However, the WPD volume’s disk device apparently doesn’t support IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS (returns STATUS_INVALID_DEVICE_REQUEST).
So, is there a way to determine if a WPD storage device is USB connected?
I suppose I could try creating a disk filter and see if I can correlate something I do from the minifilter with a specific instance of my disk filter, but yucky!
Has anyone noticed this weirdness with WPD?
Thanks for any help!
-Fred