Share via


WSHSetSocketInformation function

[ This function is obsolete for Windows Server 2003, Windows Vista, and later, and is no longer supported. ]

The WSHSetSocketInformation function is called by the Windows Sockets DLL whenever an application calls setsockopt with an option that Windows Sockets does not explicitly handle.

Syntax

INT WSHSetSocketInformation(
  _In_ PVOID  HelperDllSocketContext,
  _In_ SOCKET SocketHandle,
  _In_ HANDLE TdiAddressObjectHandle,
  _In_ HANDLE TdiConnectionObjectHandle,
  _In_ INT    Level,
  _In_ INT    OptionName,
  _In_ PCHAR  OptionValue,
  _In_ INT    OptionLength
);

Parameters

  • HelperDllSocketContext [in]
    Pointer to a per-socket context area, allocated and initialized by the WSH DLL WSHOpenSocket or WSHOpenSocket2 function.

  • SocketHandle [in]
    Specifies the handle of the socket returned by Socket or accept.

  • TdiAddressObjectHandle [in]
    Specifies the handle to a file object representing the open transport address for the socket. If the socket is not currently bound to an address, this parameter is NULL.

  • TdiConnectionObjectHandle [in]
    Specifies the handle to a file object representing the connection endpoint associated with the socket. If the socket is not currently connected, this parameter is NULL.

  • Level [in]
    Specifies the level passed in the setsockopt call.

  • OptionName [in]
    Specifies the optname passed in the setsockopt call.

  • OptionValue [in]
    Pointer to a buffer passed as the optval argument to setsockopt. This buffer contains caller-supplied data for the set operation.

  • OptionLength [in]
    Specifies the size in bytes of the buffer at OptionValue.

Return value

WSHSetSocketInformation returns zero if it successfully interprets the given option and carries out whatever operation it requires. Otherwise it returns a Windows Sockets error code. If the return value is nonzero, the setsockopt call fails and the error is set to the value returned by WSHSetSocketInformation.

Remarks

WSHSetSocketInformation can provide support for arbitrary options beyond those defined by Windows Sockets. Certain defined options also are passed to the helper DLL because of the different ways in which transport drivers provide support for these options, in particular for the SO_KEEPALIVE and SO_DONTROUTE options.

Any option passed in an application call to setsockopt that the Windows Sockets DLL does not explicitly support is forwarded to WSHSetSocketInformation. The Windows Sockets DLL relies on each helper DLL to fail calls for which the given option is invalid or unsupported by the helper DLL or underlying transport.

Requirements

Target platform

Desktop

Header

Wsahelp.h (include Wsahelp.h)

Library

Wshisotp.lib

See also

WSHGetSocketInformation

 

 

Send comments about this topic to Microsoft