Issuing an IRP_MJ_READ while processing an IRP_MJ_WRITE

Is it OK to issue an IRP_MJ_READ from within the filter driver’s IRP_MJ_WRITE routine, before the actual write has been sent ?

I build the IRP using IoBuildSynchronousFsdRequest and set OriginalFileObject and FileObject in the Irp and next IrpStack, create a buffer from NonPagedCacheAligned pool, use the same FileObject as passed in on the write, send it down to the attached device, but it either Page Faults or hangs.

What’s going on ?

Any help would be appreciated.

John

I would simply change the IRP MJ code to IRP_MJ_READ, update the buffer
and send the reques down. In the completion handle, signal and event. In
the main line reset the IRP tp IRP_MJ_WRITE, reset the buffer and send
the request down again.

John Tobin wrote:

Is it OK to issue an IRP_MJ_READ from within the filter driver’s
IRP_MJ_WRITE routine, before the actual write has been sent ? I build
the IRP using IoBuildSynchronousFsdRequest and set OriginalFileObject
and FileObject in the Irp and next IrpStack, create a buffer from
NonPagedCacheAligned pool, use the same FileObject as passed in on the
write, send it down to the attached device, but it either Page Faults
or hangs. What’s going on ? Any help would be appreciated. John

It worked ! But you did neglect to mention returning STATUS_MORE_PROCESSING_REQUIRED in the completion
routine to make sure that the IRP is not deallocated!!

Thanks for the help.

John
----- Original Message -----
From: Jamey Kikrby
To: File Systems Developers
Sent: Wednesday, August 16, 2000 10:02 PM
Subject: [ntfsd] Re: Issuing an IRP_MJ_READ while processing an IRP_MJ_WRITE

I would simply change the IRP MJ code to IRP_MJ_READ, update the buffer and send the reques down. In the completion handle, signal and event. In the main line reset the IRP tp IRP_MJ_WRITE, reset the buffer and send the request down again.

John Tobin wrote:

Is it OK to issue an IRP_MJ_READ from within the filter driver’s IRP_MJ_WRITE routine, before the actual write has been sent ? I build the IRP using IoBuildSynchronousFsdRequest and set OriginalFileObject and FileObject in the Irp and next IrpStack, create a buffer from NonPagedCacheAligned pool, use the same FileObject as passed in on the write, send it down to the attached device, but it either Page Faults or hangs. What’s going on ? Any help would be appreciated. John

Sorry, I was on the road when I wrote this and I had very little sleep. I
forgot to give all of the details :slight_smile:

Glad it worked.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of John Tobin
Sent: Monday, August 21, 2000 2:22 PM
To: File Systems Developers
Subject: [ntfsd] Re: Issuing an IRP_MJ_READ while processing an
IRP_MJ_WRITE

It worked ! But you did neglect to mention returning
STATUS_MORE_PROCESSING_REQUIRED in the completion
routine to make sure that the IRP is not deallocated!!

Thanks for the help.

John
----- Original Message -----
From: Jamey Kikrby
To: File Systems Developers
Sent: Wednesday, August 16, 2000 10:02 PM
Subject: [ntfsd] Re: Issuing an IRP_MJ_READ while processing an
IRP_MJ_WRITE

I would simply change the IRP MJ code to IRP_MJ_READ, update the buffer
and send the reques down. In the completion handle, signal and event. In the
main line reset the IRP tp IRP_MJ_WRITE, reset the buffer and send the
request down again.

John Tobin wrote:

Is it OK to issue an IRP_MJ_READ from within the filter driver’s
IRP_MJ_WRITE routine, before the actual write has been sent ? I build the
IRP using IoBuildSynchronousFsdRequest and set OriginalFileObject and
FileObject in the Irp and next IrpStack, create a buffer from
NonPagedCacheAligned pool, use the same FileObject as passed in on the
write, send it down to the attached device, but it either Page Faults or
hangs. What’s going on ? Any help would be appreciated. John