PostQueuedCompletionStatus function

Posts an I/O completion packet to an I/O completion port.

Syntax

BOOL WINAPI PostQueuedCompletionStatus(
  _In_     HANDLE       CompletionPort,
  _In_     DWORD        dwNumberOfBytesTransferred,
  _In_     ULONG_PTR    dwCompletionKey,
  _In_opt_ LPOVERLAPPED lpOverlapped
);

Parameters

CompletionPort [in]

A handle to an I/O completion port to which the I/O completion packet is to be posted.

dwNumberOfBytesTransferred [in]

The value to be returned through the lpNumberOfBytesTransferred parameter of the GetQueuedCompletionStatus function.

dwCompletionKey [in]

The value to be returned through the lpCompletionKey parameter of the GetQueuedCompletionStatus function.

lpOverlapped [in, optional]

The value to be returned through the lpOverlapped parameter of the GetQueuedCompletionStatus function.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError .

Remarks

The I/O completion packet will satisfy an outstanding call to the GetQueuedCompletionStatus function. This function returns with the three values passed as the second, third, and fourth parameters of the call to PostQueuedCompletionStatus. The system does not use or validate these values. In particular, the lpOverlapped parameter need not point to an OVERLAPPED structure.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.0 protocol
Yes
SMB 3.0 Transparent Failover (TFO)
Yes
SMB 3.0 with Scale-out File Shares (SO)
Yes
Cluster Shared Volume File System (CsvFS)
Yes
Resilient File System (ReFS)
Yes

CsvFs will do redirected IO for compressed files.

Requirements

Requirement Value
Minimum supported client
Windows XP [desktop apps | UWP apps]
Minimum supported server
Windows Server 2003 [desktop apps | UWP apps]
Header
IoAPI.h (include Windows.h);
WinBase.h on Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP (include Windows.h)
Library
Kernel32.lib
DLL
Kernel32.dll

See also

CreateIoCompletionPort

File Management Functions

GetQueuedCompletionStatus

OVERLAPPED