Hi guys,
I wrote a FileSystem Driver for prevent USB Mass Storage. i need to get full information about attached device and then block this.
in this dispatch IRP_MJ_FILE_SYSTEM_CONTROL i handle IRP_MN_MOUNT_VOLUME with two purpose, first obtain little information with IOCTL_STORAGE_QUERY_PROPERTY and second block devices.
and also for achive more information about USB i add IoRegisterPlugPlayNotification to get USB VID and PID at GUID_DEVICE_INTERFACE_ARRIVAL Event.
My problem is once occured usb arrival event and IRP_MN_MOUNT_VOLUME occured any times to accessed device with BusTypeUsb.
Now for solve this my idea is create black and white List with recognize device volume name(e.g. C:\ allow and usb with VID and PID with drive name h:\ is usb blocked ) in PlugPlayNotification CallBack and IRP_MJ_FILE_SYSTEM_CONTROL dispatcher.
Please help me to solve this.
Thank you.