Platform SDK: Windows Sockets

WSPGetQOSByName

The WSPGetQOSByName function initializes a QOS structure based on a named template, or retrieves an enumeration of the available template names.

BOOL WSPGetQOSByName (
  SOCKET     s,             
  LPWSABUF   lpQOSName,   
  LPQOS      lpQOS,          
  LPINT      lpErrno         
);

Parameters

s
[in] Descriptor identifying a socket.
lpQOSName
[in out] Specifies the QOS template name, or supplies a buffer to retrieve an enumeration of the available template names.
lpQOS
[out] Pointer to the QOS structure to be filled.
lpErrno
[out] A pointer to the error code.

Return Values

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE, and a specific error code is available in lpErrno.

Remarks

Clients can use WSPGetQOSByName to initialize a QOS structure to a set of known values appropriate for a particular service class or media type. These values are stored in a template that is referenced by a well-known name. The client may retrieve these values by setting the buf member of the WSABUF indicated by lpQOSName to point to a Unicode string of nonzero length specifying a template name. In this case the usage of lpQOSName is IN only, and results are returned through lpQOS.

Alternatively, the client may use WSPGetQOSByName to retrieve an enumeration of available template names. The client may do this by setting the buf member of the WSABUF indicated by lpQOSName to a zero-length null-terminated Unicode string. In this case, the buffer indicated by buf is overwritten with a sequence of as many null-terminated Unicode template name strings as are available up to the number of bytes available in buf as indicated by the len member of the WSABUF indicated by lpQOSName. The list of names itself is terminated by a zero-length Unicode name string. When WSPGetQOSByName is used to retrieve template names, the lpQOS parameter is ignored.

Error Codes

Error code Meaning
WSAENETDOWN Network subsystem has failed.
WSAENOTSOCK Descriptor is not a socket.
WSAEFAULT The lpQOS argument is not a valid part of the user address space, or the buffer length for lpQOS is too small.
WSAEINVAL Specified QOS template name is invalid.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in Ws2spi.h.

See Also

WSPConnect, WSPAccept, WSPGetSockOpt