MmCanFileBeTruncated - NtDoc

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

BOOLEAN MmCanFileBeTruncated(
  [in]           PSECTION_OBJECT_POINTERS SectionPointer,
  [in, optional] PLARGE_INTEGER           NewFileSize
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

MmCanFileBeTruncated function

Description

The MmCanFileBeTruncated routine checks whether a file can be truncated.

Parameters

SectionPointer [in]

Pointer to a structure that contains the file object's section object pointers.

NewFileSize [in, optional]

Pointer to a variable that specifies the size in bytes to which the file is to be truncated. If this parameter is NULL, then a length of zero is assumed and MmCanFileBeTruncated checks whether the entire file can be truncated.

Return value

MmCanFileBeTruncated returns TRUE if the file can be truncated; FALSE otherwise.

Remarks

MmCanFileBeTruncated must always be called before a file is truncated.

A file cannot be truncated (and MmCanFileBeTruncated will return FALSE) if any of the following are true:

See also

CcCoherencyFlushAndPurge

CcPurgeCacheSection

CcSetFileSizesEx

MmFlushImageSection