Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function queries the context value associated with the specified socket handle.

Syntax

int WPUQuerySocketHandleContext(
  SOCKET
 s,
  PDWORD_PTR
 lpContext,
  LPINT
 lpErrno 
);

Parameters

s

[in] Description identifying the socket whose context is to be queried.

lpContext

[out] Pointer that will receive the context value.

lpErrno

[out] Pointer to the error code.

Return Value

If no error occurs, this function 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 following table shows the possible error code.

Error value Description

WSAENOTSOCK

Descriptor is not a socket created by WPUCreateSocketHandle.

Remarks

This 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 because IFS providers are not able to supply a context value.

Requirements

Header ws2spi.h
Library Ws2.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also