Platform SDK: DLLs, Processes, and Threads |
The BindIoCompletionCallback function binds the specified file handle to the thread pool's I/O completion port. On completion of the I/O request, a non-I/O worker thread will execute the callback function.
BOOL BindIoCompletionCallback( HANDLE FileHandle, // handle to file LPOVERLAPPED_COMPLETION_ROUTINE Function, // callback ULONG Flags // reserved );
For more information about the completion routine, see FileIOCompletionRoutine.
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.
Be sure that the thread that initiates the asynchronous I/O request does not terminate before the request is completed. Also, if a function in a DLL is queued to a worker thread, be sure that the function has completed execution before the DLL is unloaded.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Processes and Threads Overview, Process and Thread Functions, FileIOCompletionRoutine, Thread Pooling