FsRtlMdlWriteCompleteDev function (ntifs.h)

The FsRtlMdlWriteCompleteDev routine frees the resources that FsRtlPrepareMdlWriteDev allocated.

Syntax

BOOLEAN FsRtlMdlWriteCompleteDev(
  [in]             PFILE_OBJECT   FileObject,
  [in]             PLARGE_INTEGER FileOffset,
  [in]             PMDL           MdlChain,
  [ in, optional ] PDEVICE_OBJECT DeviceObject
);

Parameters

[in] FileObject

A pointer to the file object.

[in] FileOffset

A pointer to a value that specifies the starting byte offset within the cache that holds the data.

[in] MdlChain

A pointer to a linked list of memory descriptor lists (MDLs) that FsRtlPrepareMdlWriteDev allocated.

[ in, optional ] DeviceObject

A pointer to a device object on which the file is opened.

Return value

The FsRtlMdlWriteCompleteDev routine returns TRUE if the operation succeeds and FALSE if the operation fails or if the FO_WRITE_THROUGH flag is set in the file object.

Remarks

The FsRtlMdlWriteCompleteDev routine frees the memory descriptor lists (MDLs) that FsRtlPrepareMdlWriteDev allocated and unlocks the cache memory that FsRtlPrepareMdlWriteDev locked.

If the FO_WRITE_THROUGH flag is set on the file object pointed to by the FileObject parameter, FsRtlMdlWriteCompleteDev immediately flushes the cached memory to disk. This flush operation re-enters the file system and can cause FsRtlMdlWriteCompleteDev to raise an exception if the flush operation fails.

Each call to FsRtlPrepareMdlWriteDev must be followed by a call to FsRtlMdlWriteCompleteDev.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 8.
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport), PowerIrpDDis(wdm)

See also

FsRtlPrepareMdlWriteDev