how can I change the write offset?

Hi, everyone:
I want to change the write offset in write dispatch, so I do the following code:
if (MyFile)
{
LARGE_INTEGER Offset;
Offset.HighPart = 0;
Offset.LowPart = 512;
irpSp->Parameters.Write.ByteOffset = RtlLargeIntegerAdd(irpSp->Parameters.Write.ByteOffset, Offset);
}

and then I call IoCallDriver(…) to let the lower fsd process it. But when the operation complete, I got a STATUS_FILE_LOCK_CONFLICT error. and the write retry again and again, it seem never stop write…
Help me!

Hi,
It seems that there are requests from the lazy writer( because they are
repeated ) and you try to write beyond the valid data length that has been
set on previous request which you did not change and the Cache Manger uses
not modified valid data length when it extends the valid data length.

wrote in message news:xxxxx@ntfsd…
> Hi, everyone:
> I want to change the write offset in write dispatch, so I do the following
> code:
> if (MyFile)
> {
> LARGE_INTEGER Offset;
> Offset.HighPart = 0;
> Offset.LowPart = 512;
> irpSp->Parameters.Write.ByteOffset =
> RtlLargeIntegerAdd(irpSp->Parameters.Write.ByteOffset, Offset);
> }
>
> and then I call IoCallDriver(…) to let the lower fsd process it. But when
> the operation complete, I got a STATUS_FILE_LOCK_CONFLICT error. and the
> write retry again and again, it seem never stop write…
> Help me!
>
>

Hi Slava ,
Thanks for your reply.I have fix it!