- New winsock (part 4 of x)
[reactos.git] / dll / win32 / ws2_32 / src / qos.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WinSock 2 API
4 * FILE: qos.c
5 * PURPOSE: QoS Support
6 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
7 */
8
9 /* INCLUDES ******************************************************************/
10 #include "ws2_32.h"
11
12 //#define NDEBUG
13 #include <debug.h>
14
15 /* DATA **********************************************************************/
16
17 /* FUNCTIONS *****************************************************************/
18
19 /*
20 * @implemented
21 */
22 BOOL
23 WSAAPI
24 WSAGetQOSByName(IN SOCKET s,
25 IN OUT LPWSABUF lpQOSName,
26 OUT LPQOS lpQOS)
27 {
28 PWSSOCKET Socket;
29 INT Status;
30 INT ErrorCode;
31 DPRINT("WSAGetQOSByName: %lx, %p\n", s, lpQOSName);
32
33 /* Check for WSAStartup */
34 if ((ErrorCode = WsQuickProlog()) == ERROR_SUCCESS)
35 {
36 /* Get the Socket Context */
37 if ((Socket = WsSockGetSocket(s)))
38 {
39 /* Make the call */
40 Status = Socket->Provider->Service.lpWSPGetQOSByName(s,
41 lpQOSName,
42 lpQOS,
43 &ErrorCode);
44
45 /* Deference the Socket Context */
46 WsSockDereference(Socket);
47
48 /* Return Provider Value */
49 if (Status == ERROR_SUCCESS) return Status;
50
51 /* If everything seemed fine, then the WSP call failed itself */
52 if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
53 }
54 else
55 {
56 /* No Socket Context Found */
57 ErrorCode = WSAENOTSOCK;
58 }
59 }
60
61 /* Return with an Error */
62 SetLastError(ErrorCode);
63 return FALSE;
64 }