mmFlushImageSection 函式 (ntifs.h)

MmFlushImageSection 例程會排清檔案的 image 區段。

語法

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

參數

SectionObjectPointer

結構指標,其中包含檔案物件的區段對象指標。

[in] FlushType

指定排清作業的原因。 它可以是下表所列的其中一個值。

FlushType 值 意義
MmFlushForDelete 正在刪除檔案。
MmFlushForWrite 正在開啟檔案以供寫入存取。

傳回值

如果排清作業成功,則 MmFlushImageSection 會傳回 TRUE;如果檔案沒有影像區段,則傳回 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 範例中使用此例程的方式。

規格需求

需求
目標平台 Universal
標頭 ntifs.h (包含 Ntifs.h)
程式庫 NtosKrnl.lib
Dll NtosKrnl.exe
IRQL < DISPATCH_LEVEL

另請參閱

CcPurgeCacheSection