What is the status of an Irp when it was written into File IO Buffer

If I write data into a file, an Irp will be created.
If it is write directly into file, the irp will go down directly to lower device stack until reach disk device.
But what if the data was written into file system buffer io? After writting into file system buffer, the status of that Irp is PENDING or COMPLETE?

When buffered file data was flush into disk, the data will go through file system again. Will a file system filter
driver get the Irp of these data?

After writing into file system buffer, the status of that Irp is PENDING or COMPLETE?

Complete. The data has been accepted by the operating system. The IO is done.

Some time later (which may be instantaneous if the file is write through) you’ll see another paging irp. When that IO is done the IRP will be marked COMPLETE.

@rod_widdowson said:

After writing into file system buffer, the status of that Irp is PENDING or COMPLETE?

Complete. The data has been accepted by the operating system. The IO is done.

Some time later (which may be instantaneous if the file is write through) you’ll see another paging irp. When that IO is done the IRP will be marked COMPLETE.

Thank you for your answer.
But will a file system filter driver get that paging irp?

But will a file system filter driver get that paging irp?

Oh yes.

I suggest you spend some time looking at file system operations using a combination of FileTest and procmon (in which the stack trace is particularly educational); it well help you a lot in understanding the flows

@rod_widdowson said:

But will a file system filter driver get that paging irp?

Oh yes.

I suggest you spend some time looking at file system operations using a combination of FileTest and procmon (in which the stack trace is particularly educational); it well help you a lot in understanding the flows

Thank you for your suggestion.
I’m not familiar with kernel operation.
But I think your advice will help me a lot.

the procmon’s results => STATUS_SUCCESS :slight_smile: