IoGetDeviceProperly causes BSOD

139 views Asked by At

I have written a filter driver for hard disks in Windows ( like DiskPerf of DDK ) and I need to get some information about device which my driver is attached to it, for example HardWareID. I use IoGetDeviceProperly inside my IRP_MJ_READ function. But this method causes BSOD and BSOD says problem is "IRQL_NO_LESS_OR_EQUAL". MSDN says DispatchRead and IoGetDeviceProperly, both run at PASSIVE_LEVEL. What is wrong? How can I get information about device that driver is attached to it?

1

There are 1 answers

0
Michael Kim On

The DispatchRead routine can be called at IRQL = APC_LEVEL.

See Dispatch Routines and IRQLs

Call IoGetDeviceProperty and save device information in DispatchCreate and Use it in DispatchRead.