Message 1 of 3
20 Mar 17 15:39
Join Date: 17 Feb 2012
Posts To This List: 684
Re: How to flush memory mapped files?
In addition to these comments, check out the FAT source code to see how
it attempts to maintain data sync for the various write pathways. It
performs, or attempts to perform a flush, for example in the non-cached
(non-paging) path prior to allowing the IO through if there is a backing=20
section to the file.
Windows File System and Device Driver Consulting
------ Original Message ------
To: "Windows File Systems Devs Interest List"
Sent: 3/20/2017 1:08:55 PM
Subject: RE:[ntfsd] How to flush memory mapped files?
>If your driver maintains( i.e. initializes ) file objects then
>CcFlushCache is your friend as it calls MmFlushSection even for
>non-cached files ( i.e. mapped but not cached ), if the file is mapped
>and cached then the cache is supported by the same pages as the mapped
>virtual address range. Do not forget about proper synchronization
>before calling CcFlushCache.
>If your driver doesn't maintain file objects and uses file objects
>initialized by FSD(file system driver) it is attached to then there is
>no common way to do this. You can play with IRP_MJ_FLUSH_BUFFERS or you=20
<...excess quoted lines suppressed...>