Platform SDK: Windows Sockets |
The WPUQuerySocketHandleContext function queries the context value associated with the specified socket handle.
int WPUQuerySocketHandleContext ( SOCKET s, LPDWORD lpContext, LPINT lpErrno );
If no error occurs, WPUQuerySocketHandleContext returns zero and stores the current context value in lpContext. Otherwise, it returns SOCKET_ERROR, and a specific error code is available in lpErrno.
The WPUQuerySocketHandleContext function queries the current context value associated with the specified socket handle. Service providers typically use this function to retrieve a pointer to provider-specific data associated with the socket. For example, a service provider can use the socket context to store a pointer to a structure containing the socket's state, local and remote transport addresses, and event objects for signaling network events.
This function is only used by non-IFS providers since IFS providers are not able to supply a context value.
Error code | Meaning |
---|---|
WSAENOTSOCK | Descriptor is not a socket created by WPUCreateSocketHandle. |
Version: Requires Windows Sockets 2.0.
Header: Declared in Ws2spi.h.