IoCompletionCallback callback function

Applications implement this callback if they call the StartThreadpoolIo function to start a worker thread for the I/O completion object.

The PTP_WIN32_IO_CALLBACK type defines a pointer to this callback function. IoCompletionCallback is a placeholder for the application-defined function name.


VOID CALLBACK IoCompletionCallback(
  _Inout_     PTP_CALLBACK_INSTANCE Instance,
  _Inout_opt_ PVOID                 Context,
  _Inout_opt_ PVOID                 Overlapped,
  _In_        ULONG                 IoResult,
  _In_        ULONG_PTR             NumberOfBytesTransferred,
  _Inout_     PTP_IO                Io


Return value

This function does not return a value.


If the file handle bound to the I/O completion object has the notification mode FILE_SKIP_COMPLETION_PORT_ON_SUCCESS and an asynchronous I/O operation returns immediately with success, the I/O completion callback function is not called and threadpool I/O notifications must be canceled. For more information, see CancelThreadpoolIo.

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher.


Minimum supported client

Windows Vista [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008 [desktop apps | UWP apps]


WinBase.h on Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2 (include Windows.h); Threadpoolapiset.h on Windows 8 and Windows Server 2012

See also


Thread Pools