BOOL FlushViewOfFile(lpvBase, cbFlush) | |||||
LPVOID lpvBase; | /* start address of byte range to flush | */ | |||
DWORD cbFlush; | /* number of bytes in range | */ |
The FlushViewOfFile function writes a byte range within a mapped view of a file to the disk.
lpvBase
Specifies the base address of the byte range that is be flushed to the disk representation of the mapped file.
cbFlush
Specifies the number of bytes to flush.
The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.
Flushing a range of a mapped view causes any dirty pages within that range to be written to the disk. This happens automatically whenever a view is unmapped (either explicitly, with the UnmapViewOfFile function, or as a result of process termination). Dirty pages are those whose content has changed since the file view was mapped.
MapViewOfFile, UnmapViewOfFile