CreateThreadpoolIo function (threadpoolapiset.h)
Creates a new I/O completion object.
PTP_IO CreateThreadpoolIo( HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, PTP_CALLBACK_ENVIRON pcbe );
The file handle to bind to this I/O completion object.
The callback function to be called each time an overlapped I/O operation completes on the file. For details, see IoCompletionCallback.
Optional application-defined data to pass to the callback function.
A pointer to a TP_CALLBACK_ENVIRON structure that defines the environment in which to execute the callback. Use the InitializeThreadpoolEnvironment function to initialize the structure before calling this function.
If this parameter is NULL, the callback executes in the default callback environment. For more information, see InitializeThreadpoolEnvironment.
If the function succeeds, it returns a pointer to a TP_IO structure that defines the I/O object. Applications do not modify the members of this structure.
If the function fails, it returns NULL. To retrieve extended error information, call GetLastError.
To begin receiving overlapped I/O completion callbacks, call the StartThreadpoolIo function.
If the file handle bound to the I/O completion object has the notification mode FILE_SKIP_COMPLETION_PORT_ON_SUCCESS and an asychronous 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]|
|Header||threadpoolapiset.h (include Windows 7, Windows Server 2008 Windows Server 2008 R2, Windows.h)|