2008-06-01 22:08:45 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ws2_32.dll API tests
|
|
|
|
* LICENSE: GPLv2 or any later version
|
|
|
|
* FILE: apitests/ws2_32/ws2_32.h
|
|
|
|
* PURPOSE: Main header file
|
|
|
|
* COPYRIGHT: Copyright 2008 Colin Finck <mail@colinfinck.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _WS2_32_APITESTS_H
|
|
|
|
#define _WS2_32_APITESTS_H
|
|
|
|
|
2013-02-05 17:54:22 +00:00
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#define _INC_WINDOWS
|
|
|
|
#define COM_NO_WINDOWS_H
|
2008-06-01 22:08:45 +00:00
|
|
|
#include <winsock2.h>
|
|
|
|
|
|
|
|
/* Simple macro for executing a socket command and doing cleanup operations in case of a failure */
|
|
|
|
#define SCKTEST(_cmd_) \
|
|
|
|
iResult = _cmd_; \
|
2010-08-25 08:48:55 +00:00
|
|
|
ok(iResult != SOCKET_ERROR, "iResult = %d\n", iResult); \
|
2008-06-01 22:08:45 +00:00
|
|
|
if(iResult == SOCKET_ERROR) \
|
|
|
|
{ \
|
|
|
|
printf("Winsock error code is %u\n", WSAGetLastError()); \
|
|
|
|
closesocket(sck); \
|
|
|
|
WSACleanup(); \
|
2010-08-25 08:48:55 +00:00
|
|
|
return 0; \
|
2008-06-01 22:08:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* helpers.c */
|
2010-08-25 08:48:55 +00:00
|
|
|
int CreateSocket(SOCKET* sck);
|
|
|
|
int ConnectToReactOSWebsite(SOCKET sck);
|
|
|
|
int GetRequestAndWait(SOCKET sck);
|
2008-06-01 22:08:45 +00:00
|
|
|
|
|
|
|
/* ws2_32.c */
|
|
|
|
extern HANDLE g_hHeap;
|
|
|
|
|
|
|
|
#endif
|