The WSAGetQOSByName function initializes a QOS structure based on a named template, or it supplies a buffer to retrieve an enumeration of the available template names.
BOOL WSAGetQOSByName(
SOCKET s,
LPWSABUF lpQOSName,
LPQOS lpQOS
)
s
Type: SOCKET
[in] A descriptor identifying a socket.
lpQOSName
Type: LPWSABUF
[in] A pointer to a specific quality of service template.
lpQOS
Type: LPQOS
[out] A pointer to the QOS structure to be filled.
Type: BOOL
If WSAGetQOSByName succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call WSAGetLastError.
| Return code | Description |
|---|---|
| WSANOTINITIALISED | A successful WSAStartup call must occur before using this function. |
| WSAENETDOWN | The network subsystem has failed. |
| WSAENOTSOCK | The descriptor is not a socket. |
| WSAEFAULT | The lpQOSName or lpQOS parameter are not a valid part of the user address space, or the buffer length for lpQOS is too small. |
The WSAGetQOSByName function is used by applications 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 parameter of the WSABUF structure indicated by lpQOSName, which points to a 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 this function to retrieve an enumeration of available template names. The client may do this by setting the buf parameter of the WSABUF indicated by lpQOSName to a zero-length null-terminated string. In this case the buffer indicated by buf is overwritten with a sequence of as many available, null-terminated template names up to the number of bytes available in buf as indicated by the len parameter of the WSABUF indicated by lpQOSName. The list of names itself is terminated by a zero-length name. When the WSAGetQOSByName function is used to retrieve template names, the lpQOS parameter is ignored.
Header: Declared in winsock2.h.
Library: Use ws2_32.lib.