ReactOS  0.4.15-dev-1171-gab82533
ws2_32.h
Go to the documentation of this file.
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 #include <ntstatus.h>
13 #include <stdio.h>
14 
15 #define WIN32_NO_STATUS
16 #define _INC_WINDOWS
17 #define COM_NO_WINDOWS_H
18 
19 #include <apitest.h>
20 #include <ws2tcpip.h>
21 #include <ndk/rtlfuncs.h>
22 #include <ndk/mmfuncs.h>
23 
24 /* Simple macro for executing a socket command and doing cleanup operations in case of a failure */
25 #define SCKTEST(_cmd_) \
26  iResult = _cmd_; \
27  ok(iResult != SOCKET_ERROR, "iResult = %d\n", iResult); \
28  if(iResult == SOCKET_ERROR) \
29  { \
30  printf("Winsock error code is %u\n", WSAGetLastError()); \
31  closesocket(sck); \
32  WSACleanup(); \
33  return 0; \
34  }
35 
36 /* helpers.c */
37 int CreateSocket(SOCKET* sck);
39 int GetRequestAndWait(SOCKET sck);
40 
41 /* ws2_32.c */
42 extern HANDLE g_hHeap;
43 
44 #endif /* !_WS2_32_APITESTS_H */
int ConnectToReactOSWebsite(SOCKET sck)
Definition: helpers.c:27
int GetRequestAndWait(SOCKET sck)
Definition: helpers.c:45
int CreateSocket(SOCKET *sck)
Definition: helpers.c:11
HANDLE g_hHeap
Definition: globals.c:52
UINT_PTR SOCKET
Definition: winsock.h:47