Bewerken

Delen via


CcFlushCache function (ntifs.h)

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

Syntax

void CcFlushCache(
  [in]            PSECTION_OBJECT_POINTERS SectionObjectPointer,
  [in, optional]  PLARGE_INTEGER           FileOffset,
  [in]            ULONG                    Length,
  [out, optional] PIO_STATUS_BLOCK         IoStatus
);

Parameters

[in] SectionObjectPointer

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

[in, optional] 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.

[in] Length

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

[out, optional] 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

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

See also

CcCopyWrite

CcInitializeCacheMap

CcIsFileCached

CcPurgeCacheSection