WPUCloseThread

The WPUCloseThread function closes a thread opened with a call to WPUOpenCurrentThread.

INT WSPAPI WPUCloseThread (
  LPWSATHREADID lpThreadId,   
  LPINT lpErrno               
);
 

Parameters

lpThreadId
[in] A pointer to a WSATHREADID structure that identifies the thread context. This structure must have been initialized by a previous call to WPUOpenCurrentThread.
lpErrno
[out] A pointer to the error code.

Remarks

The WPUCloseThread function is used in a layered service provider to deallocate the resources that were initiated in a call by the WPUOpenCurrentThread function. The WSATHREADID structure in the lpThreadId is the thread to deallocate.

Every call to WPUOpenCurrentThread must have a call to WPUCloseThread. These two functions are used when the overlapped functions, such as WSPSend, are called in a lower layer of the service provider than the current thread.

Return Values

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

Error Codes

WSANOTINITIALISED A successful WSPStartup must occur before using this function.

QuickInfo

  Windows NT: Yes
  Windows: Yes
  Windows CE: Unsupported.
  Header: Declared in ws2spi.h.

See Also

WPUCloseThread, WPUOpenCurrentThread