The Windows Sockets WSAGetQOSByName function initializes a QUALITYOFSERVICE 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
);
The WSAGetQOSByName function is used by applications to initialize a QUALITYOFSERVICE 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 indicated by lpQOSName, which points to a 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 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 over-written with a sequence of as many null-terminated template names that are available 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.
If WSAGetQOSByName succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call WSAGetLastError.
WSANOTINITIALISED | A successful WSAStartup 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. |
WSAENVAL | The specified quality of service template name is invalid. |
Windows NT: Yes
Windows: Yes
Windows CE: Unsupported.
Header: Declared in winsock2.h.
Import Library: Link with ws2_32.lib.
getsockopt, WSAAccept, WSAConnect