FastIoRead and STATUS_END_OF_FILE

Hi:

I’m replacing some file’s content on the fly.

  • I prepare a special folder (let’s call it “Virtual” folder) where I add
    “Virtual” files (“Test1.txt”, “Test2.txt”, etc.)
  • When one of this files is read or query information, I replace the
    original information with my own.

The “Virtual” files are very small ones, so in the FastIoRead function,
after calling deviceObject->DriverObject->FastIoDispatch’s FastIoRead I get
a STATUS_END_OF_FILE Status.

When I get this STATUS_END_OF_FILE status and I replace the Buffer content
with my own and change the IoStatus information to Status = STATUS_SUCCESS
and Information = MyLength, the FastIoRead is called again and again
endlessly.

Does anybody have and idea of how to solve this?

Thanks in advance.

Best regards.

Pablo Frank

You need to increment FileObject->CurrentByteOffset when you pretend that
read completed successfully. Then subsequent request to read data will
contain new starting offset. Eventually when starting offset becomes bigger
then your “virtual” information length you need to return
STATUS_END_OF_FILE. This will terminate the loop in an application which is
reading the file.

Alexei.

“Pablo G. Frank” wrote in message news:xxxxx@ntfsd…
>
> Hi:
>
> I’m replacing some file’s content on the fly.
>
> - I prepare a special folder (let’s call it “Virtual” folder) where I add
> “Virtual” files (“Test1.txt”, “Test2.txt”, etc.)
> - When one of this files is read or query information, I replace the
> original information with my own.
>
> The “Virtual” files are very small ones, so in the FastIoRead function,
> after calling deviceObject->DriverObject->FastIoDispatch’s FastIoRead I
get
> a STATUS_END_OF_FILE Status.
>
> When I get this STATUS_END_OF_FILE status and I replace the Buffer content
> with my own and change the IoStatus information to Status = STATUS_SUCCESS
> and Information = MyLength, the FastIoRead is called again and again
> endlessly.
>
> Does anybody have and idea of how to solve this?
>
> Thanks in advance.
>
> Best regards.
>
> Pablo Frank
>
>
>
>

Oh!. I should know that.

Thanks a lot!. It was very helpful.

I should ask a few days ago!.

Best regards.

Pablo Frank

“Alexei Jelvis” escribió en el mensaje
news:xxxxx@ntfsd…
>
> You need to increment FileObject->CurrentByteOffset when you pretend that
> read completed successfully. Then subsequent request to read data will
> contain new starting offset. Eventually when starting offset becomes
bigger
> then your “virtual” information length you need to return
> STATUS_END_OF_FILE. This will terminate the loop in an application which
is
> reading the file.
>
> Alexei.
>
> “Pablo G. Frank” wrote in message
news:xxxxx@ntfsd…
> >
> > Hi:
> >
> > I’m replacing some file’s content on the fly.
> >
> > - I prepare a special folder (let’s call it “Virtual” folder) where I
add
> > “Virtual” files (“Test1.txt”, “Test2.txt”, etc.)
> > - When one of this files is read or query information, I replace the
> > original information with my own.
> >
> > The “Virtual” files are very small ones, so in the FastIoRead function,
> > after calling deviceObject->DriverObject->FastIoDispatch’s FastIoRead I
> get
> > a STATUS_END_OF_FILE Status.
> >
> > When I get this STATUS_END_OF_FILE status and I replace the Buffer
content
> > with my own and change the IoStatus information to Status =
STATUS_SUCCESS
> > and Information = MyLength, the FastIoRead is called again and again
> > endlessly.
> >
> > Does anybody have and idea of how to solve this?
> >
> > Thanks in advance.
> >
> > Best regards.
> >
> > Pablo Frank
> >
> >
> >
> >
>
>
>
>