Expand Minimize

WPUOpenCurrentThread function

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 I/O from nonapplication threads.

Syntax


INT WPUOpenCurrentThread(
  _Out_  LPWSATHREADID lpThreadId,
  _Out_  LPINT lpErrno
);

Parameters

lpThreadId [out]

Pointer to a WSATHREADID structure that can then be passed to an overlapped function.

lpErrno [out]

Pointer to the error code.

Return value

If no error occurs, WPUOpenCurrentThread returns the zero. Otherwise, it returns SOCKET_ERROR, and a specific error code is available in lpErrno.

Error codeMeaning
WSANOTINITIALISED

A successful WSPStartup call must occur before using this function.

 

Remarks

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 using 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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ws2spi.h

See also

WSPRecv
WSPSend
WPUCloseThread

 

 

Community Additions

ADD
Show:
© 2014 Microsoft