Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The ZwFlushBuffersFileEx routine is called by a file system filter driver to send a flush request for a given file to the file system. An optional flush operation flag can be set to control how file data is written to storage.
Syntax
NTSYSAPI NTSTATUS ZwFlushBuffersFileEx(
[in] HANDLE FileHandle,
ULONG FLags,
PVOID Parameters,
ULONG ParametersSize,
[out] PIO_STATUS_BLOCK IoStatusBlock
);
Parameters
[in] FileHandle
Handle returned by ZwCreateFile or ZwOpenFile for the file whose buffers will be flushed. This parameter is required and cannot be NULL.
FLags
Flush operation flags. Flags can be 0 or one of the following values.
Parameters
Address of the caller's I/O status block. This parameter is required and cannot be NULL.
ParametersSize
The size, in bytes, of the parameters block.
[out] IoStatusBlock
Address of the caller's I/O status block. This parameter is required and cannot be NULL.
Return value
ZwFlushBuffersFileEx returns STATUS_SUCCESS or an appropriate NTSTATUS value, such as one of the following:
Return code | Description |
---|---|
|
The file resides on a write-protected volume; this is an error code. |
|
The file resides on a volume that is not currently mounted; this is an error code. |
|
The file does has neither write or append access. |
Remarks
A file system filter driver can call ZwFlushBuffersFileEx to issue an IRP_MJ_FLUSH_BUFFERS request to the file system for a given file. The flush operation is synchronous.
Minifilter drivers should call FltFlushBuffers instead of calling ZwFlushBuffersFileEx.
Callers of ZwFlushBuffersFileEx must be running at IRQL = PASSIVE_LEVEL and with special kernel APCs enabled.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8. |
Target Platform | Universal |
Header | ntifs.h (include Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | PASSIVE_LEVEL (See Remarks section.) |
See also
Using Nt and Zw Versions of the Native System Services Routines