Export (0) Print
Expand All

MmFlushImageSection routine

The MmFlushImageSection routine flushes the image section for a file.

Syntax


BOOLEAN MmFlushImageSection(
  _In_  PSECTION_OBJECT_POINTERS SectionPointer,
  _In_  MMFLUSH_TYPE             FlushType
);

Parameters

SectionPointer [in]

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

FlushType [in]

Specifies the reason for the flush operation. It can be one of the values listed in the following table.

FlushType ValueMeaning

MmFlushForDelete

The file is being deleted.

MmFlushForWrite

The file is being opened for write access.

 

Return value

MmFlushImageSection returns TRUE if the flush operation is successful, or if no image section exists for the file; otherwise MmFlushImageSection returns FALSE.

Note  If the FlushType MmFlushForDelete value is specified and there are one or more outstanding write probes on the file's data section, MmFlushImageSection returns FALSE.

Remarks

A file system must call the MmFlushImageSection routine before deleting a file or opening a file for write access.

Before deleting a file, the file system should call MmFlushImageSection from its IRP_MJ_SET_INFORMATION or IRP_MJ_CLEANUP dispatch routine, passing MmFlushForDelete for the FlushType parameter.

When opening a file for write access, the file system should call MmFlushImageSection from its IRP_MJ_CREATE dispatch routine, passing MmFlushForWrite for the FlushType parameter.

If there are no mapped views of the image section, MmFlushImageSection destroys the image section and returns any used pages to the free list.

Before using MmFlushImageSection, file system writers are strongly encouraged to study the way this routine is used in the FASTFAT sample.

Requirements

Target platform

Universal

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

IRQL

< DISPATCH_LEVEL

See also

CcPurgeCacheSection

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft