Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello,

My goal is to hook specific IRPs (like IRP_MJ_WRITE) with filter driver. I got a list of file names (saved in file) for which dirver should return IRP with STATUS_ACCESS_DENIED.
How can I call an application from driver to find out if the file is in the list or not? The application parse the file on the start so when the driver asks it should return TRUE or FALSE to block or no.
The point is that driver should start the communication with the app,send to app a string(DIR/FILENAME) and get TRUE or FALSE from it.
Is the inverted IOCTL the best solution?
Posted

1 solution

No, This is always a bad IDEA, for a alot of reasons that i wont go into here, the way to accompish something like this is to queue IRPS from the user mode application and complete them when the data becomes available.

(i suggest you use DeviceIoControl for greater flexibility)

in you user mode you would create a separate thread so you wont hang the application since the DeviceIoControl will keep waiting until it receives a response from the driver

Regards,

K,D.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900