views:

134

answers:

1

In user mode IOCTL calls can be made via DeviceIoControl function.
What can I use in kernel mode to issue IOCTL calls? I must use this inside a filesystem minifilter driver.

BACKGROUND
I am writing a filesystem minifilter driver, and I must issue IOCTL calls to storage devices to find out their serial number and capabilities (removable or not).

+1  A: 

You can use FltDeviceIoControlFile or build and send IRP manually with IoBuildDeviceIoControlRequest and IoCallDriver.

Sergius
Do I need to call `IoCompleteRequest` to free my IRP or the lower driver does it?
clyfe
No, IRP is completed by one of the lower devices. And don't forget to check your driver with driver verifier tool!
Sergius
Thank you for your assistance, this has been very helpful!
clyfe