How can I build and send IRP_MJ_WRITE in my filter driver?

Hi, All!

For some special reasons, I have to write data onto a volume which my file system filter driver has already attached. And the flags of the device object for the volume has been set as DO_DIRECT_IO. I can not write data onto the volume by calling ZwWriteFile in my filter dirver. So, I have to build my own IRP ( IRP_MJ_WRITE) and pass it to the device object which my filter attached to. But I do not know how to do this. Can someone help me? Thanks!

Hi headium!
Please go through the article
" Rolling Your Own - Building IRPs to Perform I/O" on osronline.com.
It explains what u want!!
HAPPY ROLLING^^
Ayush Gupta
Calsoft Pvt. Ltd.

Thanks!

In fact, I tried to build my own IRP by calling BuildAsynchronousFsdRequest with major function IRP_MJ_WRITE and send it to the target device object. But I did not succed in writing data into the target device object. I sent the IRP by calling IoCallDriver and no error occured. But the data is not written into the target device object.

Why?