All,
In the MiniFilter Driver, What is the best way to check if we can reuse the FO to read/write the data. Sometimes, SetEofInformation is called after cleanup and before closed. I want to access the file during this period.
What flags or functions can i use to find out if cleanup is not yet called on the files. If cleanup is not called then i don’t need to create another FO. I am using IoCheckShareAccess to check the share access.
thanks in advance.
> What flags or functions can i use to find out if cleanup is not
yet called on the files. If cleanup is not called then i don’t
need to create another FO. I am using IoCheckShareAccess to check
the share access.
Just track it in the stream handle context associated with that file object.
Another way might be to check the presence of FO_CLEANUP_COMPLETE flag in
the fileobject. But I really DON’T recommend this approach.
Regards,
Ayush Gupta
AI Consulting
> What flags or functions can i use to find out if cleanup is not yet called on the files.
FO_CLEANUP_COMPLETE
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
Thanks a lot guys for the quick response.
Ayush,
Why don’t you recommend the “FO_CLEANUP_COMPLETE” flag approach? What are the issues behind it?
Sometime back I had heard that MS had recommended NOT to rely on the
FO_FILE_MODIFIED flag. So, on similar lines I advised you not to use the
FO_CLEANUP_COMPLETE flag.
Regards,
Ayush Gupta
AI Consulting
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, January 27, 2010 8:40 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Reusing the FileObject for read/write data
Thanks a lot guys for the quick response.
Ayush,
Why don’t you recommend the “FO_CLEANUP_COMPLETE” flag approach? What are
the issues behind it?
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
The FSDs and the FsRtl rely on the FO_CLEANUP_COMPLETE bit to enforce
various rules at the FSD level (e.g. no non-paging I/O against FOs after
cleanup). So, it’s a much more reliable bit that FO_FILE_MODIFIED, which is
less useful for the FSD.
-scott
–
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
“Ayush Gupta” wrote in message news:xxxxx@ntfsd…
> Sometime back I had heard that MS had recommended NOT to rely on the
> FO_FILE_MODIFIED flag. So, on similar lines I advised you not to use the
> FO_CLEANUP_COMPLETE flag.
>
> Regards,
> Ayush Gupta
> AI Consulting
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
> Sent: Wednesday, January 27, 2010 8:40 PM
> To: Windows File Systems Devs Interest List
> Subject: RE:[ntfsd] Reusing the FileObject for read/write data
>
> Thanks a lot guys for the quick response.
>
> Ayush,
>
> Why don’t you recommend the “FO_CLEANUP_COMPLETE” flag approach? What are
> the issues behind it?
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
Thanks everyone.
Once the Clean Up is called on the File Object, is it possible to get the Sharing Violation?
For example, if the file is opened by application with NO_SHARING (No Read share or write share). If i will try to create the new FO, then i will get the SHARING_VIOLATION error code. If the cleanup is called on that FO (FO_CLEANUP_COMPLETE is set) and if i try to create new FO will i get the SHARING_VIOLATION error code or it will let me create the new FO without any error.
I have used IO_IGNORE_SHARE_ACCESS_CHECK, but it doesn’t work always.
What i want to do is, If FO_CLEANUP_COMPLETE is NOTset then i will use the same FO to do the IO. If FO_CLEANUP_COMPLETE is set then i will create the new FO and perform the IO.
thanks