MmFlushImageSection 函数 (ntifs.h)

mmFlushImageSection 例程刷新文件的映像部分。

语法

BOOLEAN MmFlushImageSection(
       PSECTION_OBJECT_POINTERS SectionObjectPointer,
  [in] MMFLUSH_TYPE             FlushType
);

参数

SectionObjectPointer

指向包含文件对象的节对象指针的结构的指针。

[in] FlushType

指定刷新作的原因。 它可以是下表中列出的值之一。

FlushType 值 意义
mmFlushFordelete 正在删除该文件。
mmFlushForWrite 正在打开该文件进行写入访问。

返回值

mmFlushImageSection 如果刷新作成功,或者文件不存在图像节,则返回 true;否则,mmFlushImageSection 返回 FALSE

注意 如果指定 FlushType MmFlushForDelete 值,并且文件的数据节上有一个或多个未完成的写入探测,MmFlushImageSection 返回 FALSE
 

言论

文件系统必须先调用 MmFlushImageSection 例程,然后才能删除文件或打开文件进行写入访问。

在删除文件之前,文件系统应从IRP_MJ_SET_INFORMATION或IRP_MJ_CLEANUP调度例程调用 MmFlushImageSection,为 FlushType 参数传递 MmFlushForDelete

打开文件进行写入访问时,文件系统应从其IRP_MJ_CREATE调度例程调用 mmFlushImageSection,并传递 FlushType 参数的 mmFlushForWrite

如果没有图像节的映射视图,MmFlushImageSection 销毁图像部分,并将任何已用页面返回到免费列表。

在使用 MmFlushImageSection之前,强烈建议文件系统编写器研究在 FASTFAT 示例中使用此例程的方式。

要求

要求 价值
目标平台 普遍
标头 ntifs.h (include Ntifs.h)
NtosKrnl.lib
DLL NtosKrnl.exe
IRQL < DISPATCH_LEVEL

另请参阅

CcPurgeCacheSection