• The move is TARGETED for 19 September 2018
  • The new URL for the community will be community.osr.com
  • There will be a new email address for those who contribute via email
  • More detailed information, and updates, can be found at the OSR Developer's Blog
Questions/problems/issues may be addressed to the CommunityMove alias at OSR.COM.

OSR Seminars


Go Back   OSR Online Lists > ntfsd
Welcome, Guest
Posting to the list has been temporarily disabled
  Message 1 of 3  
01 Mar 18 16:31
Juan Antonio Barrigas
xxxxxx@yahoo.es
Join Date: 21 Mar 2017
Posts To This List: 18
Cache Manager file reference + directory renaming

Hi, If I open a file with FltCreateFile and then close the handle, just holding the reference to FILE_OBJECT, I can rename the directory in which the file name resides. But if I try to use this FO to FltReadFile, the operation fails with STATUS_FILE_CLOSED. If I mantain the handle opened, I can issue the read, but renaming the directory fails... That said, my question is about how CC or MM deal with this situation. They might hold a reference to a FO, even when all handles to it have been closed. They can issue IO operations (IE: lazy writer) and at the same time, renaming the directory won't cause any issues. I've been googling and found some info about IoCreateStreamFileObject, which seems to be used by the CC. This function closes internally the created handle and the FO is marked with FO_STREAM_FILE... So, a FO opened this way can be used for IO as if it had been created with FltCreateFile? Is that the "trick" of CC?
  Message 2 of 3  
05 Mar 18 11:32
Peter Scott
xxxxxx@KernelDrivers.com
Join Date: 17 Feb 2012
Posts To This List: 687
Cache Manager file reference + directory renaming

The FltReadFile fails as expected since the handle is closed. If you were to issue the read using the PAGING bit, then it would succeed, ignoring that you need to hold the correct locks, etc. Paging IO can come in after the handle is closed, that is after the cleanup is processed on the file object but not top level, non-paging IO. Think memory mapped IO; you can open a file, memory map it, close the file handle but still perform memory mapped access on the file. The flushes will occur after the handle has been closed but they will be all paging. Pete -- Kernel Drivers Windows File System and Device Driver Consulting www.KernelDrivers.com 866.263.9295 ------ Original Message ------ From: "xxxxx@yahoo.es" <xxxxx@lists.osr.com> To: "Windows File Systems Devs Interest List" <xxxxx@lists.osr.com> Sent: 3/1/2018 2:31:00 PM Subject: [ntfsd] Cache Manager file reference + directory renaming >Hi, > >If I open a file with FltCreateFile and then close the handle, just >holding the reference to FILE_OBJECT, I can rename the directory in >which the file name resides. But if I try to use this FO to >FltReadFile, the operation fails with STATUS_FILE_CLOSED. If I mantain >the handle opened, I can issue the read, but renaming the directory >fails... > >That said, my question is about how CC or MM deal with this situation. <...excess quoted lines suppressed...>
  Message 3 of 3  
06 Mar 18 04:31
Juan Antonio Barrigas
xxxxxx@yahoo.es
Join Date: 21 Mar 2017
Posts To This List: 18
Cache Manager file reference + directory renaming

Hi Pete, Yes, doing some aditional research I found that using the paging flag the read success. Thx for your answer.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
Posting to the list has been temporarily disabled.

All times are GMT -5. The time now is 16:35.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license