CcFlushCache function

The CcFlushCache routine flushes all or a portion of a cached file to disk.

Syntax

NTKERNELAPI VOID CcFlushCache(
  PSECTION_OBJECT_POINTERS SectionObjectPointer,
  PLARGE_INTEGER           FileOffset,
  ULONG                    Length,
  PIO_STATUS_BLOCK         IoStatus
);

Parameters

SectionObjectPointer

Pointer to a SECTION_OBJECT_POINTERS structure containing the file object's section object pointers.

FileOffset

Pointer to a variable that specifies the starting byte offset within the cached file where the data is to be flushed.

If FileOffset is NULL, the entire file is flushed from the cache.

If FileOffset is not NULL, only the byte range specified by FileOffset and Length is flushed.

Length

Length of the byte range to flush, starting at FileOffset. If FileOffset is NULL, Length is ignored.

IoStatus

Pointer to a structure that receives the final completion status and information about the flush operation. If the data is flushed successfully, IoStatus.Status contains STATUS_SUCCESS. If not all of the data is flushed successfully, IoStatus.Information contains the actual number of bytes that were flushed. Otherwise, IoStatus.Information contains the value given in Length.

Return Value

None

Remarks

CcFlushCache has no Wait parameter. Thus the caller must be able to enter a wait state until all the data has been flushed.

To cache a file, use CcInitializeCacheMap.

Requirements

   
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe

See Also

CcCopyWrite

CcInitializeCacheMap

CcIsFileCached

CcPurgeCacheSection