2

I'm writing a windows filter driver which needs to block all write operations on portable devices, I got the blocking part, but struggle to determine the device type. What I have is an Irp and a DeviceObject for every write operation attempted on the PC. I tried getting bit flags from DeviceObject like this DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA for all the possible flags described on microsoft, but it is always set at FILE_REMOTE_DEVICE and FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL, whether the usb flash drive is installed or not. What is the correct way to check for it?

0 Answers0