source: Daodan/MinGW/include/ws2spi.h@ 1063

Last change on this file since 1063 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 8.8 KB
Line 
1/*
2 * ws2spi.h
3 *
4 * Winsock 2 Service Provider Interface.
5 *
6 *
7 * THIS SOFTWARE IS NOT COPYRIGHTED
8 *
9 * This source code is offered for use in the public domain. You may
10 * use, modify or distribute it freely.
11 *
12 * This code is distributed in the hope that it will be useful but
13 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
14 * DISCLAIMED. This includes but is not limited to warranties of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 *
17 */
18#ifndef _WS2SPI_H
19#define _WS2SPI_H
20#if __GNUC__ >= 3
21#pragma GCC system_header
22#endif
23
24#include <winsock2.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif /* __cplusplus */
29
30#define WSPAPI WSAAPI
31#define WSPDESCRIPTION_LEN 255
32
33#ifndef RC_INVOKED
34
35typedef struct WSPData {
36 WORD wVersion;
37 WORD wHighVersion;
38 WCHAR szDescription[WSPDESCRIPTION_LEN+1];
39} WSPDATA, FAR *LPWSPDATA;
40typedef struct _WSATHREADID {
41 HANDLE ThreadHandle;
42 DWORD Reserved;
43} WSATHREADID, FAR *LPWSATHREADID;
44
45typedef BOOL (CALLBACK FAR *LPBLOCKINGCALLBACK)(DWORD);
46typedef VOID (CALLBACK FAR *LPWSAUSERAPC)(DWORD);
47
48/* Prototypes for service provider procedure table */
49typedef SOCKET (WSPAPI *LPWSPACCEPT)(SOCKET,LPSOCKADDR,LPINT,LPCONDITIONPROC,DWORD,LPINT);
50typedef INT (WSPAPI *LPWSPADDRESSTOSTRING)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD,LPINT);
51typedef INT (WSPAPI *LPWSPASYNCSELECT)(SOCKET,HWND,UINT,LONG,LPINT);
52typedef INT (WSPAPI *LPWSPBIND)(SOCKET,const struct sockaddr*,INT,LPINT);
53typedef INT (WSPAPI *LPWSPCANCELBLOCKINGCALL)(LPINT);
54typedef INT (WSPAPI *LPWSPCLEANUP)(LPINT);
55typedef INT (WSPAPI *LPWSPCLOSESOCKET)(SOCKET,LPINT);
56typedef INT (WSPAPI *LPWSPCONNECT)(SOCKET,const struct sockaddr*,INT,LPWSABUF,LPWSABUF,LPQOS,LPQOS,LPINT);
57typedef INT (WSPAPI *LPWSPDUPLICATESOCKET)(SOCKET,DWORD,LPWSAPROTOCOL_INFOW,LPINT);
58typedef INT (WSPAPI *LPWSPENUMNETWORKEVENTS)(SOCKET,WSAEVENT,LPWSANETWORKEVENTS,LPINT);
59typedef INT (WSPAPI *LPWSPEVENTSELECT)(SOCKET,WSAEVENT,LONG,LPINT);
60typedef BOOL (WSPAPI *LPWSPGETOVERLAPPEDRESULT)(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD,LPINT);
61typedef INT (WSPAPI *LPWSPGETPEERNAME)(SOCKET,LPSOCKADDR,LPINT,LPINT);
62typedef BOOL (WSPAPI *LPWSPGETQOSBYNAME)(SOCKET,LPWSABUF,LPQOS,LPINT);
63typedef INT (WSPAPI *LPWSPGETSOCKNAME)(SOCKET,LPSOCKADDR,LPINT,LPINT);
64typedef INT (WSPAPI *LPWSPGETSOCKOPT)(SOCKET,INT,INT,CHAR FAR*,LPINT,LPINT);
65typedef INT (WSPAPI *LPWSPIOCTL)(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,
66 LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
67typedef SOCKET (WSPAPI *LPWSPJOINLEAF)(SOCKET,const struct sockaddr*,INT,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD,LPINT);
68typedef INT (WSPAPI *LPWSPLISTEN)(SOCKET,INT,LPINT);
69typedef INT (WSPAPI *LPWSPRECV)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,
70LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
71typedef INT (WSPAPI *LPWSPRECVDISCONNECT)(SOCKET,LPWSABUF,LPINT);
72typedef INT (WSPAPI *LPWSPRECVFROM)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPSOCKADDR,
73LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
74typedef INT (WSPAPI *LPWSPSELECT)(INT,LPFD_SET,LPFD_SET,LPFD_SET,CONST TIMEVAL*,LPINT);
75typedef INT (WSPAPI *LPWSPSEND)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,
76LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
77typedef INT (WSPAPI *LPWSPSENDDISCONNECT)(SOCKET,LPWSABUF,LPINT);
78typedef INT (WSPAPI *LPWSPSENDTO)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct sockaddr*,
79 INT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
80typedef INT (WSPAPI *LPWSPSETSOCKOPT)(SOCKET,INT,INT,CONST CHAR FAR*,INT,LPINT);
81typedef INT (WSPAPI *LPWSPSHUTDOWN)(SOCKET,INT,LPINT);
82typedef SOCKET (WSPAPI *LPWSPSOCKET)(INT,INT,INT,LPWSAPROTOCOL_INFOW,GROUP,DWORD,LPINT);
83typedef INT (WSPAPI *LPWSPSTRINGTOADDRESS)(LPWSTR,INT,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPINT,LPINT);
84
85/* Service provider procedure table */
86typedef struct _WSPPROC_TABLE {
87 LPWSPACCEPT lpWSPAccept;
88 LPWSPADDRESSTOSTRING lpWSPAddressToString;
89 LPWSPASYNCSELECT lpWSPAsyncSelect;
90 LPWSPBIND lpWSPBind;
91 LPWSPCANCELBLOCKINGCALL lpWSPCancelBlockingCall;
92 LPWSPCLEANUP lpWSPCleanup;
93 LPWSPCLOSESOCKET lpWSPCloseSocket;
94 LPWSPCONNECT lpWSPConnect;
95 LPWSPDUPLICATESOCKET lpWSPDuplicateSocket;
96 LPWSPENUMNETWORKEVENTS lpWSPEnumNetworkEvents;
97 LPWSPEVENTSELECT lpWSPEventSelect;
98 LPWSPGETOVERLAPPEDRESULT lpWSPGetOverlappedResult;
99 LPWSPGETPEERNAME lpWSPGetPeerName;
100 LPWSPGETSOCKNAME lpWSPGetSockName;
101 LPWSPGETSOCKOPT lpWSPGetSockOpt;
102 LPWSPGETQOSBYNAME lpWSPGetQOSByName;
103 LPWSPIOCTL lpWSPIoctl;
104 LPWSPJOINLEAF lpWSPJoinLeaf;
105 LPWSPLISTEN lpWSPListen;
106 LPWSPRECV lpWSPRecv;
107 LPWSPRECVDISCONNECT lpWSPRecvDisconnect;
108 LPWSPRECVFROM lpWSPRecvFrom;
109 LPWSPSELECT lpWSPSelect;
110 LPWSPSEND lpWSPSend;
111 LPWSPSENDDISCONNECT lpWSPSendDisconnect;
112 LPWSPSENDTO lpWSPSendTo;
113 LPWSPSETSOCKOPT lpWSPSetSockOpt;
114 LPWSPSHUTDOWN lpWSPShutdown;
115 LPWSPSOCKET lpWSPSocket;
116 LPWSPSTRINGTOADDRESS lpWSPStringToAddress;
117} WSPPROC_TABLE, FAR* LPWSPPROC_TABLE;
118
119/* Prototypes for service provider upcall procedure table */
120typedef BOOL (WSPAPI *LPWPUCLOSEEVENT)(WSAEVENT,LPINT);
121typedef INT (WSPAPI *LPWPUCLOSESOCKETHANDLE)(SOCKET,LPINT);
122typedef INT (WSPAPI *LPWPUCLOSETHREAD)(LPWSATHREADID,LPINT);
123typedef WSAEVENT (WSPAPI *LPWPUCREATEEVENT)(LPINT);
124typedef SOCKET (WSPAPI *LPWPUCREATESOCKETHANDLE)(DWORD,DWORD,LPINT);
125typedef SOCKET (WSPAPI *LPWPUFDISSET)(SOCKET,LPFD_SET);
126typedef INT (WSPAPI *LPWPUGETPROVIDERPATH)(LPGUID,LPWSTR,LPINT,LPINT);
127typedef SOCKET (WSPAPI *LPWPUMODIFYIFSHANDLE)(DWORD,SOCKET,LPINT);
128typedef INT (WSPAPI *LPWPUOPENCURRENTTHREAD)(LPWSATHREADID,LPINT);
129typedef BOOL (WSPAPI *LPWPUPOSTMESSAGE)(HWND,UINT,WPARAM,LPARAM);
130typedef INT (WSPAPI *LPWPUQUERYBLOCKINGCALLBACK)(DWORD,LPBLOCKINGCALLBACK FAR*,LPDWORD,LPINT);
131typedef INT (WSPAPI *LPWPUQUERYSOCKETHANDLECONTEXT)(SOCKET,LPDWORD,LPINT);
132typedef INT (WSPAPI *LPWPUQUEUEAPC)(LPWSATHREADID,LPWSAUSERAPC,DWORD,LPINT);
133typedef BOOL (WSPAPI *LPWPURESETEVENT)(WSAEVENT,LPINT);
134typedef BOOL (WSPAPI *LPWPUSETEVENT)(WSAEVENT,LPINT);
135/* Available only directly from the DLL */
136typedef INT (WSPAPI *LPWPUCOMPLETEOVERLAPPEDREQUEST)(SOCKET,LPWSAOVERLAPPED,DWORD,DWORD,LPINT);
137
138/* Service Provider upcall table */
139typedef struct _WSPUPCALLTABLE {
140 LPWPUCLOSEEVENT lpWPUCloseEvent;
141 LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle;
142 LPWPUCREATEEVENT lpWPUCreateEvent;
143 LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle;
144 LPWPUFDISSET lpWPUFDIsSet;
145 LPWPUGETPROVIDERPATH lpWPUGetProviderPath;
146 LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle;
147 LPWPUPOSTMESSAGE lpWPUPostMessage;
148 LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback;
149 LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext;
150 LPWPUQUEUEAPC lpWPUQueueApc;
151 LPWPURESETEVENT lpWPUResetEvent;
152 LPWPUSETEVENT lpWPUSetEvent;
153 LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread;
154 LPWPUCLOSETHREAD lpWPUCloseThread;
155} WSPUPCALLTABLE, FAR* LPWSPUPCALLTABLE;
156
157typedef INT (WSPAPI *LPWSPSTARTUP)(WORD,LPWSPDATA,LPWSAPROTOCOL_INFOW,WSPUPCALLTABLE,LPWSPPROC_TABLE);
158
159/* Prototypes for service provider namespace procedure table */
160typedef INT (WSPAPI *LPNSPCLEANUP)(LPGUID);
161typedef INT (WSPAPI *LPNSPGETSERVICECLASSINFO)(LPGUID,LPDWORD,LPWSASERVICECLASSINFOW);
162typedef INT (WSPAPI *LPNSPINSTALLSERVICECLASS)(LPGUID,LPWSASERVICECLASSINFOW);
163typedef INT (WSPAPI *LPNSPLOOKUPSERVICEBEGIN)(LPGUID,LPWSAQUERYSETW,LPWSASERVICECLASSINFOW,DWORD,LPHANDLE);
164typedef INT (WSPAPI *LPNSPLOOKUPSERVICEEND)(HANDLE);
165typedef INT (WSPAPI *LPNSPLOOKUPSERVICENEXT)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSET);
166typedef INT (WSPAPI *LPNSPREMOVESERVICECLASS)(LPGUID,LPGUID);
167typedef INT (WSPAPI *LPNSPSETSERVICE)(LPGUID,LPWSASERVICECLASSINFOW,LPWSAQUERYSETW,WSAESETSERVICEOP,DWORD);
168
169typedef struct _NSP_ROUTINE {
170 DWORD cbSize;
171 DWORD dwMajorVersion;
172 DWORD dwMinorVersion;
173 LPNSPCLEANUP NSPCleanup;
174 LPNSPLOOKUPSERVICEBEGIN NSPLookupServiceBegin;
175 LPNSPLOOKUPSERVICENEXT NSPLookupServiceNext;
176 LPNSPLOOKUPSERVICEEND NSPLookupServiceEnd;
177 LPNSPSETSERVICE NSPSetService;
178 LPNSPINSTALLSERVICECLASS NSPInstallServiceClass;
179 LPNSPREMOVESERVICECLASS NSPRemoveServiceClass;
180 LPNSPGETSERVICECLASSINFO NSPGetServiceClassInfo;
181} NSP_ROUTINE, *PNSP_ROUTINE, *LPNSP_ROUTINE;
182
183INT WSPAPI NSPStartup(LPGUID,LPNSP_ROUTINE);
184
185/* WinSock 2 DLL function prototypes */
186INT WSPAPI WPUCompleteOverlappedRequest(SOCKET,LPWSAOVERLAPPED,DWORD,DWORD,LPINT);
187INT WSPAPI WSPStartup(WORD,LPWSPDATA,LPWSAPROTOCOL_INFOW,WSPUPCALLTABLE,LPWSPPROC_TABLE);
188INT WSPAPI WSCDeinstallProvider(LPGUID,LPINT);
189INT WSPAPI WSCEnumProtocols(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD,LPINT);
190INT WSPAPI WSCGetProviderPath(LPGUID,LPWSTR,LPINT,LPINT);
191INT WSPAPI WSCInstallProvider(CONST LPGUID,CONST LPWSTR,CONST LPWSAPROTOCOL_INFOW,DWORD,LPINT);
192INT WSPAPI WSCEnableNSProvider(LPGUID,BOOL);
193INT WSPAPI WSCInstallNameSpace(LPWSTR,LPWSTR,DWORD,DWORD,LPGUID);
194INT WSPAPI WSCUnInstallNameSpace(LPGUID);
195INT WSPAPI WSCWriteProviderOrder(LPDWORD,DWORD);
196
197#endif /* RC_INVOKED */
198
199#ifdef __cplusplus
200}
201#endif /* __cplusplus */
202#endif
Note: See TracBrowser for help on using the repository browser.