CcMdlWriteComplete routine

The CcMdlWriteComplete routine frees the memory descriptor lists (MDL) created by CcPrepareMdlWrite for a cached file.

Syntax


VOID CcMdlWriteComplete(
  _In_ PFILE_OBJECT   FileObject,
  _In_ PLARGE_INTEGER FileOffset,
  _In_ PMDL           MdlChain
);

Parameters

FileObject [in]

File object pointer that was passed to CcPrepareMdlWrite.

FileOffset [in]

Value of FileOffset that was passed to CcPrepareMdlWrite.

MdlChain [in]

Address of the MDL chain returned by CcPrepareMdlWrite.

Return value

None

Remarks

File systems call CcMdlWriteComplete to free the memory descriptor lists (MDL) created by CcPrepareMdlWrite for a cached file and to mark the specified byte range for write. All physical pages that were locked down are unlocked. Any pages that were mapped are unmapped.

If the FO_WRITE_THROUGH flag is set on the file object pointed to by the FileObject parameter, the file data is immediately flushed to disk. This flush operation re-enters the file system and can cause CcMdlWriteComplete to raise an exception if the flush operation fails. In this case, the MDL has not been freed and the caller may re-try the operation.

After CcMdlWriteComplete is called successfully for an IRP_MN_COMPLETE operation, the caller must set the IRP's MdlAddress field to NULL.

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

Each call to CcPrepareMdlWrite must be followed by a call to CcMdlWriteComplete or CcMdlWriteAbort.

Requirements

Target platform

Universal

Header

Ntifs.h (include Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

PASSIVE_LEVEL

See also

CcMdlWriteAbort
CcPrepareMdlWrite

 

 

Send comments about this topic to Microsoft

Show: