The WPUOpenCurrentThread function opens a handle to the current thread that can be used with overlapped functions in a layered service provider. This is intended to be used by layered service providers that wish to initiate overlapped IO from non-application threads.
INT WPUOpenCurrentThread (
LPWSATHREADID lpThreadId,
LPINT lpErrno
);
The WPUOpenCurrentThread function provides a pointer to a WSATHREADID structure that can then be passed to an overlapped function such as WSPSend or WSPRecv. Layered service providers that use a private thread in one of the upper layers will use WPUOpenCurrentThread to pass a WSATHREADID pointer to the lower layer that is administering overlapped functions.
Overlapped functions such as WSPSend and WSPRecv can then be used in the same way as a regular service provider.
Every call to WPUOpenCurrentThread must have a corresponding call to WPUCloseThread.
If no error occurs, WPUOpenCurrentThread returns the zero. Otherwise, it returns SOCKET_ERROR, and a specific error code is available in lpErrno.
WSANOTINITIALISED | A successful WSPStartup must occur before using this function. |
Windows NT: Yes
Windows: Yes
Windows CE: Unsupported.
Header: Declared in ws2spi.h.
WPUCloseThread, WSPSend, WSPRecv, WPUOpenCurrentThread