[Coop] Convert System.CLRConfig to coop. (#8606)
[mono-project.git] / mono / utils / w32api.h
blob45544c78fcdd156ac6588ef7bd327b31fac628f3
1 /**
2 * \file
3 */
5 #ifndef __MONO_UTILS_W32API_H__
6 #define __MONO_UTILS_W32API_H__
8 #include <glib.h>
10 G_BEGIN_DECLS
12 #ifndef HOST_WIN32
14 #define WAIT_FAILED ((gint) 0xFFFFFFFF)
15 #define WAIT_OBJECT_0 ((gint) 0x00000000)
16 #define WAIT_ABANDONED_0 ((gint) 0x00000080)
17 #define WAIT_TIMEOUT ((gint) 0x00000102)
18 #define WAIT_IO_COMPLETION ((gint) 0x000000C0)
20 #define WINAPI
22 typedef guint32 DWORD;
23 typedef gboolean BOOL;
24 typedef gint32 LONG;
25 typedef guint32 ULONG;
26 typedef guint UINT;
28 typedef gpointer HANDLE;
29 typedef gpointer HMODULE;
31 #else
33 #define __USE_W32_SOCKETS
34 #include <winsock2.h>
35 #include <windows.h>
36 #include <winbase.h>
37 /* The mingw version says: /usr/i686-pc-mingw32/sys-root/mingw/include/ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead." */
38 #ifdef _MSC_VER
39 #include <ws2tcpip.h>
40 #endif
41 #include <psapi.h>
43 /* Workaround for missing WSAPOLLFD typedef in mingw's winsock2.h
44 * that is required for mswsock.h below. Remove once
45 * http://sourceforge.net/p/mingw/bugs/1980/ is fixed. */
46 #if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4
47 typedef struct pollfd {
48 SOCKET fd;
49 short events;
50 short revents;
51 } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
52 #endif
54 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
55 #include <mswsock.h>
56 #endif
58 #endif /* HOST_WIN32 */
60 G_END_DECLS
62 #endif /* __MONO_UTILS_W32API_H__ */