Export (0) Print
Expand All

CcSetFileSizes routine

The CcSetFileSizes routine updates the cache maps and section object for a cached file whose size has changed.

Syntax


VOID CcSetFileSizes(
  _In_  PFILE_OBJECT FileObject,
  _In_  PCC_FILE_SIZES FileSizes
);

Parameters

FileObject [in]

Pointer to a file object for the cached file.

FileSizes [in]

Pointer to a CC_FILE_SIZES structure containing AllocationSize, FileSize and ValidDataLength for the file. This structure is defined as follows:


typedef struct _CC_FILE_SIZES {
    LARGE_INTEGER AllocationSize;
    LARGE_INTEGER FileSize;
    LARGE_INTEGER ValidDataLength;
} CC_FILE_SIZES, *PCC_FILE_SIZES;

MemberMeaning

AllocationSize

New section object size for the file.

FileSize

New file size for the file.

ValidDataLength

New valid data length for the file.

 

Return value

None

Remarks

File systems must call CcSetFileSizes to update the cache manager data structures whenever one of the following changes is made to a cached file:

  • Its allocation size is increased.

  • Its valid data length is decreased.

  • Its valid data length is increased by a non-cached I/O operation.

  • Its file size is increased or decreased.

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

To cache a file, use CcInitializeCacheMap.

Requirements

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

See also

CcInitializeCacheMap

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft