WPUCloseThread function (ws2spi.h)

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

Syntax

int WPUCloseThread(
  [in]  LPWSATHREADID lpThreadId,
  [out] LPINT         lpErrno
);

Parameters

[in] lpThreadId

Pointer to a WSATHREADID structure that identifies the thread context. This structure must have been initialized by a previous call to WPUOpenCurrentThread.

[out] lpErrno

Pointer to the error code.

Return value

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

Error code Meaning
WSANOTINITIALISED
A successful WSPStartup call must occur before using this function.
 
 

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 LPWSPSend, are called in a lower layer of the service provider than the current thread.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ws2spi.h

See also

WPUOpenCurrentThread

WSATHREADID