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