CcSetCacheFileSizes - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntifs.h

NTSTATUS CcSetCacheFileSizes(
  [in] PSECTION_OBJECT_POINTERS SectionObjectPointer,
  [in] PCC_FILE_SIZES           FileSizes
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ntifs-ccsetcachefilesizes)

Description

The CcSetCacheFileSizes function sets the cache manager file sizes by section object pointers.

Parameters

SectionObjectPointer [in]

Pointer to a SECTION_OBJECT_POINTERS structure that contains the section object information.

FileSizes [in]

Pointer to a CC_FILE_SIZES structure that specifies the file size to set.

Return value

CcSetCacheFileSizes returns STATUS_SUCCESS if the file size was successfully changed, and, if a purge was needed that the purge was successful. Otherwise it returns a non-success NSTATUS code such as STATUS_INSUFFICIENT_RESOURCES, and might raise a status exception.

Regarding raising a status exception on error:

Remarks

If the operation causes CcSetCacheFileSizes to extend the section and a failure occurs, CcSetCacheFileSizes raises a status exception for that particular failure. For example, if a pool allocation failure occurs, CcSetCacheFileSizes raises a STATUS_INSUFFICIENT_RESOURCES exception. Therefore, to gain control if a failure occurs, the driver should wrap the call to CcSetCacheFileSizes in a try-except or try-finally statement.

The file system must ensure that the cache map is valid and will remain so for the duration of this call.

To get the size of the cached file, pass SectionObjectPointer to CcGetCacheFileSize.

See also

CcGetCacheFileSize

CcSetFileSizesEx