1c2c66affSColin Finck /*
2c2c66affSColin Finck  * PROJECT:     ws2_32.dll API tests
3c2c66affSColin Finck  * LICENSE:     GPLv2 or any later version
4c2c66affSColin Finck  * FILE:        apitests/ws2_32/ws2_32.h
5c2c66affSColin Finck  * PURPOSE:     Main header file
6c2c66affSColin Finck  * COPYRIGHT:   Copyright 2008 Colin Finck <mail@colinfinck.de>
7c2c66affSColin Finck  */
8c2c66affSColin Finck 
9c2c66affSColin Finck #ifndef _WS2_32_APITESTS_H
10c2c66affSColin Finck #define _WS2_32_APITESTS_H
11c2c66affSColin Finck 
12*b09a6370SAmine Khaldi #include <ntstatus.h>
13*b09a6370SAmine Khaldi #include <stdio.h>
14*b09a6370SAmine Khaldi 
15c2c66affSColin Finck #define WIN32_NO_STATUS
16c2c66affSColin Finck #define _INC_WINDOWS
17c2c66affSColin Finck #define COM_NO_WINDOWS_H
18*b09a6370SAmine Khaldi 
19*b09a6370SAmine Khaldi #include <apitest.h>
20*b09a6370SAmine Khaldi #include <ws2tcpip.h>
21*b09a6370SAmine Khaldi #include <ndk/rtlfuncs.h>
22*b09a6370SAmine Khaldi #include <ndk/mmfuncs.h>
23c2c66affSColin Finck 
24c2c66affSColin Finck /* Simple macro for executing a socket command and doing cleanup operations in case of a failure */
25c2c66affSColin Finck #define SCKTEST(_cmd_) \
26c2c66affSColin Finck     iResult = _cmd_; \
27c2c66affSColin Finck     ok(iResult != SOCKET_ERROR, "iResult = %d\n", iResult); \
28c2c66affSColin Finck     if(iResult == SOCKET_ERROR) \
29c2c66affSColin Finck     { \
30c2c66affSColin Finck         printf("Winsock error code is %u\n", WSAGetLastError()); \
31c2c66affSColin Finck         closesocket(sck); \
32c2c66affSColin Finck         WSACleanup(); \
33c2c66affSColin Finck         return 0; \
34c2c66affSColin Finck     }
35c2c66affSColin Finck 
36c2c66affSColin Finck /* helpers.c */
37c2c66affSColin Finck int CreateSocket(SOCKET* sck);
38c2c66affSColin Finck int ConnectToReactOSWebsite(SOCKET sck);
39c2c66affSColin Finck int GetRequestAndWait(SOCKET sck);
40c2c66affSColin Finck 
41c2c66affSColin Finck /* ws2_32.c */
42c2c66affSColin Finck extern HANDLE g_hHeap;
43c2c66affSColin Finck 
44*b09a6370SAmine Khaldi #endif /* !_WS2_32_APITESTS_H */
45