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] A 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] A pointer to the QOS structure to be filled.
lpErrno
[out] A pointer to the error code.

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 which 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 non-zero 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 over-written with a sequence of as many null-terminated Unicode template name strings 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.

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.

Error Codes

WSAENETDOWN The network subsystem has failed.
WSAENOTSOCK The 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 The specified QOS template name is invalid.

QuickInfo

  Windows NT: Yes
  Windows: Yes
  Windows CE: Unsupported.
  Header: Declared in ws2spi.h.

See Also

WSPConnect, WSPAccept, WSPGetSockOpt