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 範例中使用這個例程的方式。
要求
要求 | 價值 |
---|---|
目標平臺 | 普遍 |
標頭 | ntifs.h (include Ntifs.h) |
連結庫 | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | < DISPATCH_LEVEL |