ByteOffset not incremented

I’m completeing an IRP_MJ_WRITE in my minifilter PreWrite callback with the following code:

Data->IoStatus.Status = STATUS_SUCCESS;
Data->IoStatus.Information = reply->ReturnSize;
FltSetCallbackDataDirty( Data );
returnStatus = FLT_PREOP_COMPLETE;

Everything seems to go fine except in a copy and paste, if there are multiple writes (as in larger files) the Data->Iopb->Parameters.Write.ByteOffset is not incremented for the subsequent writes though the bytes and lengths coming in for the file are correct. Is there something else I need to set when completeing the PreWrite operation to let the next write know that the ByteOffset should be incremented?

I’m not sure from your question exactly whose perspective you’re trying
to maintain here. If you’re opening the file yourself and writing to
it, and you want the byte offset you’re seeing to change, it only does
so if you’ve opened the file for syncrhonous access.

MSDN for FltCreateFile explains this, As I recall, the same applies for
IoCreateFileSpecifyDeviceObjectHint:
http://msdn.microsoft.com/en-us/library/aa488411.aspx

If it’s the ByteOffset for the perspective of the caller, you probably
need to update it yourself, and probably only under certain
circumstances (the userland equivalent of synchronous access, however
that manifests itself in kernelmode). Don’t take my word on this point
though, I haven’t done anything that would require me to monkey with
this.

~Eric

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Monday, May 05, 2008 10:37 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ByteOffset not incremented

I’m completeing an IRP_MJ_WRITE in my minifilter PreWrite callback with
the following code:

Data->IoStatus.Status = STATUS_SUCCESS;
Data->IoStatus.Information = reply->ReturnSize;
FltSetCallbackDataDirty( Data );
returnStatus = FLT_PREOP_COMPLETE;

Everything seems to go fine except in a copy and paste, if there are
multiple writes (as in larger files) the
Data->Iopb->Parameters.Write.ByteOffset is not incremented for the
subsequent writes though the bytes and lengths coming in for the file
are correct. Is there something else I need to set when completeing the
PreWrite operation to let the next write know that the ByteOffset should
be incremented?


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars (including our new
fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: xxxxx@edsiohio.com To
unsubscribe send a blank email to xxxxx@lists.osr.com