2 * sockets.h: Socket handles
5 * Dick Porter (dick@ximian.com)
7 * (C) 2002 Ximian, Inc.
10 #ifndef _WAPI_SOCKETS_H_
11 #define _WAPI_SOCKETS_H_
13 #include "mono/io-layer/wapi.h"
17 #define WSADESCRIPTION_LEN 256
18 #define WSASYS_STATUS_LEN 128
24 char szDescription
[WSADESCRIPTION_LEN
+1];
25 char szSystemStatus
[WSASYS_STATUS_LEN
+1];
31 #define INVALID_SOCKET (guint32)(~0)
32 #define SOCKET_ERROR -1
34 #define WSAID_DISCONNECTEX {0x7fda2e11,0x8630,0x436f,{0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}
35 #define WSAID_TRANSMITFILE {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
51 } WapiTransmitFileBuffers
;
54 TF_USE_DEFAULT_WORKER
= 0,
56 TF_REUSE_SOCKET
= 0x02,
57 TF_WRITE_BEHIND
= 0x04,
58 TF_USE_SYSTEM_THREAD
= 0x10,
59 TF_USE_KERNEL_APC
= 0x20
60 } WapiTransmitFileFlags
;
68 /* If we need to support more WSAIoctl commands then define these
69 * using the bitfield flags method
71 #define SIO_GET_EXTENSION_FUNCTION_POINTER 0xC8000006
72 #define SIO_KEEPALIVE_VALS 0x98000004
74 typedef gboolean (*WapiDisconnectExFn
)(guint32
, WapiOverlapped
*, guint32
,
75 WapiTransmitFileFlags
);
76 typedef gboolean (*WapiTransmitFileFn
)(guint32
, gpointer
, guint32
, guint32
,
78 WapiTransmitFileBuffers
*,
79 WapiTransmitFileFlags
);
82 extern int WSAStartup(guint32 requested
, WapiWSAData
*data
);
83 extern int WSACleanup(void);
84 extern void WSASetLastError(int error
);
85 extern int WSAGetLastError(void);
86 extern int closesocket(guint32 handle
);
88 extern int ioctlsocket(guint32 handle
, gint32 command
, gpointer arg
);
89 extern int WSAIoctl (guint32 handle
, gint32 command
,
90 gchar
*input
, gint i_len
,
91 gchar
*output
, gint o_len
, glong
*written
,
92 void *unused1
, void *unused2
);
93 extern int WSARecv (guint32 handle
, WapiWSABuf
*buffers
, guint32 count
,
94 guint32
*received
, guint32
*flags
,
95 WapiOverlapped
*overlapped
, WapiOverlappedCB
*complete
);
96 extern int WSASend (guint32 handle
, WapiWSABuf
*buffers
, guint32 count
,
97 guint32
*sent
, guint32 flags
,
98 WapiOverlapped
*overlapped
, WapiOverlappedCB
*complete
);
100 gboolean
TransmitFile (guint32 socket
, gpointer file
, guint32 bytes_to_write
, guint32 bytes_per_send
, WapiOverlapped
*ol
,
101 WapiTransmitFileBuffers
*tb
, guint32 flags
);
103 #endif /* _WAPI_SOCKETS_H_ */