source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/nspapi.h@ 1181

Last change on this file since 1181 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 11.3 KB
Line 
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef _NSPAPI_INCLUDED
7#define _NSPAPI_INCLUDED
8
9#include <_mingw_unicode.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#ifndef _tagBLOB_DEFINED
16#define _tagBLOB_DEFINED
17#define _BLOB_DEFINED
18#define _LPBLOB_DEFINED
19 typedef struct _BLOB {
20 ULONG cbSize;
21 BYTE *pBlobData;
22 } BLOB,*LPBLOB;
23#endif
24
25#ifndef GUID_DEFINED
26#define GUID_DEFINED
27 typedef struct _GUID {
28 unsigned __LONG32 Data1;
29 unsigned short Data2;
30 unsigned short Data3;
31 unsigned char Data4[8];
32 } GUID;
33#endif
34
35#ifndef __LPGUID_DEFINED__
36#define __LPGUID_DEFINED__
37 typedef GUID *LPGUID;
38#endif
39
40#define SERVICE_RESOURCE (0x00000001)
41#define SERVICE_SERVICE (0x00000002)
42#define SERVICE_LOCAL (0x00000004)
43
44#define SERVICE_REGISTER (0x00000001)
45#define SERVICE_DEREGISTER (0x00000002)
46#define SERVICE_FLUSH (0x00000003)
47#define SERVICE_ADD_TYPE (0x00000004)
48#define SERVICE_DELETE_TYPE (0x00000005)
49
50#define SERVICE_FLAG_DEFER (0x00000001)
51#define SERVICE_FLAG_HARD (0x00000002)
52
53#define PROP_COMMENT (0x00000001)
54#define PROP_LOCALE (0x00000002)
55#define PROP_DISPLAY_HINT (0x00000004)
56#define PROP_VERSION (0x00000008)
57#define PROP_START_TIME (0x00000010)
58#define PROP_MACHINE (0x00000020)
59#define PROP_ADDRESSES (0x00000100)
60#define PROP_SD (0x00000200)
61#define PROP_ALL (0x80000000)
62
63#define SERVICE_ADDRESS_FLAG_RPC_CN (0x00000001)
64#define SERVICE_ADDRESS_FLAG_RPC_DG (0x00000002)
65#define SERVICE_ADDRESS_FLAG_RPC_NB (0x00000004)
66
67#define NS_DEFAULT (0)
68
69#define NS_SAP (1)
70#define NS_NDS (2)
71#define NS_PEER_BROWSE (3)
72
73#define NS_TCPIP_LOCAL (10)
74#define NS_TCPIP_HOSTS (11)
75#define NS_DNS (12)
76#define NS_NETBT (13)
77#define NS_WINS (14)
78#define NS_NLA (15)
79#if (_WIN32_WINNT >= 0x0600)
80#define NS_BTH (16)
81#endif
82
83#define NS_NBP (20)
84
85#define NS_MS (30)
86#define NS_STDA (31)
87#define NS_NTDS (32)
88
89#if (_WIN32_WINNT >= 0x0600)
90#define NS_EMAIL (37)
91#define NS_PNRPNAME (38)
92#define NS_PNRPCLOUD (39)
93#endif
94
95#define NS_X500 (40)
96#define NS_NIS (41)
97
98#define NS_VNS (50)
99
100#define NSTYPE_HIERARCHICAL (0x00000001)
101#define NSTYPE_DYNAMIC (0x00000002)
102#define NSTYPE_ENUMERABLE (0x00000004)
103#define NSTYPE_WORKGROUP (0x00000008)
104
105#define XP_CONNECTIONLESS (0x00000001)
106#define XP_GUARANTEED_DELIVERY (0x00000002)
107#define XP_GUARANTEED_ORDER (0x00000004)
108#define XP_MESSAGE_ORIENTED (0x00000008)
109#define XP_PSEUDO_STREAM (0x00000010)
110#define XP_GRACEFUL_CLOSE (0x00000020)
111#define XP_EXPEDITED_DATA (0x00000040)
112#define XP_CONNECT_DATA (0x00000080)
113#define XP_DISCONNECT_DATA (0x00000100)
114#define XP_SUPPORTS_BROADCAST (0x00000200)
115#define XP_SUPPORTS_MULTICAST (0x00000400)
116#define XP_BANDWIDTH_ALLOCATION (0x00000800)
117#define XP_FRAGMENTATION (0x00001000)
118#define XP_ENCRYPTS (0x00002000)
119
120#define RES_SOFT_SEARCH (0x00000001)
121#define RES_FIND_MULTIPLE (0x00000002)
122#define RES_SERVICE (0x00000004)
123
124#define SERVICE_TYPE_VALUE_SAPIDA "SapId"
125#define SERVICE_TYPE_VALUE_SAPIDW L"SapId"
126
127#define SERVICE_TYPE_VALUE_CONNA "ConnectionOriented"
128#define SERVICE_TYPE_VALUE_CONNW L"ConnectionOriented"
129
130#define SERVICE_TYPE_VALUE_TCPPORTA "TcpPort"
131#define SERVICE_TYPE_VALUE_TCPPORTW L"TcpPort"
132
133#define SERVICE_TYPE_VALUE_UDPPORTA "UdpPort"
134#define SERVICE_TYPE_VALUE_UDPPORTW L"UdpPort"
135
136#define SERVICE_TYPE_VALUE_SAPID __MINGW_NAME_AW(SERVICE_TYPE_VALUE_SAPID)
137#define SERVICE_TYPE_VALUE_CONN __MINGW_NAME_AW(SERVICE_TYPE_VALUE_CONN)
138#define SERVICE_TYPE_VALUE_TCPPORT __MINGW_NAME_AW(SERVICE_TYPE_VALUE_TCPPORT)
139#define SERVICE_TYPE_VALUE_UDPPORT __MINGW_NAME_AW(SERVICE_TYPE_VALUE_UDPPORT)
140
141#define SET_SERVICE_PARTIAL_SUCCESS (0x00000001)
142
143 typedef struct _NS_INFOA {
144 DWORD dwNameSpace;
145 DWORD dwNameSpaceFlags;
146 LPSTR lpNameSpace;
147 } NS_INFOA,*PNS_INFOA,*LPNS_INFOA;
148
149 typedef struct _NS_INFOW {
150 DWORD dwNameSpace;
151 DWORD dwNameSpaceFlags;
152 LPWSTR lpNameSpace;
153 } NS_INFOW,*PNS_INFOW,*LPNS_INFOW;
154
155 __MINGW_TYPEDEF_AW(NS_INFO)
156 __MINGW_TYPEDEF_AW(PNS_INFO)
157 __MINGW_TYPEDEF_AW(LPNS_INFO)
158
159 typedef struct _SERVICE_TYPE_VALUE {
160 DWORD dwNameSpace;
161 DWORD dwValueType;
162 DWORD dwValueSize;
163 DWORD dwValueNameOffset;
164 DWORD dwValueOffset;
165 } SERVICE_TYPE_VALUE,*PSERVICE_TYPE_VALUE,*LPSERVICE_TYPE_VALUE;
166
167 typedef struct _SERVICE_TYPE_VALUE_ABSA {
168 DWORD dwNameSpace;
169 DWORD dwValueType;
170 DWORD dwValueSize;
171 LPSTR lpValueName;
172 PVOID lpValue;
173 } SERVICE_TYPE_VALUE_ABSA,*PSERVICE_TYPE_VALUE_ABSA,*LPSERVICE_TYPE_VALUE_ABSA;
174
175 typedef struct _SERVICE_TYPE_VALUE_ABSW {
176 DWORD dwNameSpace;
177 DWORD dwValueType;
178 DWORD dwValueSize;
179 LPWSTR lpValueName;
180 PVOID lpValue;
181 } SERVICE_TYPE_VALUE_ABSW,*PSERVICE_TYPE_VALUE_ABSW,*LPSERVICE_TYPE_VALUE_ABSW;
182
183 __MINGW_TYPEDEF_AW(SERVICE_TYPE_VALUE_ABS)
184 __MINGW_TYPEDEF_AW(PSERVICE_TYPE_VALUE_ABS)
185 __MINGW_TYPEDEF_AW(LPSERVICE_TYPE_VALUE_ABS)
186
187 typedef struct _SERVICE_TYPE_INFO {
188 DWORD dwTypeNameOffset;
189 DWORD dwValueCount;
190 SERVICE_TYPE_VALUE Values[1];
191 } SERVICE_TYPE_INFO,*PSERVICE_TYPE_INFO,*LPSERVICE_TYPE_INFO;
192
193 typedef struct _SERVICE_TYPE_INFO_ABSA {
194 LPSTR lpTypeName;
195 DWORD dwValueCount;
196 SERVICE_TYPE_VALUE_ABSA Values[1];
197 } SERVICE_TYPE_INFO_ABSA,*PSERVICE_TYPE_INFO_ABSA,*LPSERVICE_TYPE_INFO_ABSA;
198 typedef struct _SERVICE_TYPE_INFO_ABSW {
199 LPWSTR lpTypeName;
200 DWORD dwValueCount;
201 SERVICE_TYPE_VALUE_ABSW Values[1];
202 } SERVICE_TYPE_INFO_ABSW,*PSERVICE_TYPE_INFO_ABSW,*LPSERVICE_TYPE_INFO_ABSW;
203
204 __MINGW_TYPEDEF_AW(SERVICE_TYPE_INFO_ABS)
205 __MINGW_TYPEDEF_AW(PSERVICE_TYPE_INFO_ABS)
206 __MINGW_TYPEDEF_AW(LPSERVICE_TYPE_INFO_ABS)
207
208 typedef struct _SERVICE_ADDRESS {
209 DWORD dwAddressType;
210 DWORD dwAddressFlags;
211 DWORD dwAddressLength;
212 DWORD dwPrincipalLength;
213 BYTE *lpAddress;
214 BYTE *lpPrincipal;
215 } SERVICE_ADDRESS,*PSERVICE_ADDRESS,*LPSERVICE_ADDRESS;
216
217 typedef struct _SERVICE_ADDRESSES {
218 DWORD dwAddressCount;
219 SERVICE_ADDRESS Addresses[1];
220 } SERVICE_ADDRESSES,*PSERVICE_ADDRESSES,*LPSERVICE_ADDRESSES;
221
222 typedef struct _SERVICE_INFOA {
223 LPGUID lpServiceType;
224 LPSTR lpServiceName;
225 LPSTR lpComment;
226 LPSTR lpLocale;
227 DWORD dwDisplayHint;
228 DWORD dwVersion;
229 DWORD dwTime;
230 LPSTR lpMachineName;
231 LPSERVICE_ADDRESSES lpServiceAddress;
232 BLOB ServiceSpecificInfo;
233 } SERVICE_INFOA,*PSERVICE_INFOA,*LPSERVICE_INFOA;
234
235 typedef struct _SERVICE_INFOW {
236 LPGUID lpServiceType;
237 LPWSTR lpServiceName;
238 LPWSTR lpComment;
239 LPWSTR lpLocale;
240 DWORD dwDisplayHint;
241 DWORD dwVersion;
242 DWORD dwTime;
243 LPWSTR lpMachineName;
244 LPSERVICE_ADDRESSES lpServiceAddress;
245 BLOB ServiceSpecificInfo;
246 } SERVICE_INFOW,*PSERVICE_INFOW,*LPSERVICE_INFOW;
247
248 __MINGW_TYPEDEF_AW(SERVICE_INFO)
249 __MINGW_TYPEDEF_AW(PSERVICE_INFO)
250 __MINGW_TYPEDEF_AW(LPSERVICE_INFO)
251
252 typedef struct _NS_SERVICE_INFOA {
253 DWORD dwNameSpace;
254 SERVICE_INFOA ServiceInfo;
255 } NS_SERVICE_INFOA,*PNS_SERVICE_INFOA,*LPNS_SERVICE_INFOA;
256
257 typedef struct _NS_SERVICE_INFOW {
258 DWORD dwNameSpace;
259 SERVICE_INFOW ServiceInfo;
260 } NS_SERVICE_INFOW,*PNS_SERVICE_INFOW,*LPNS_SERVICE_INFOW;
261
262 __MINGW_TYPEDEF_AW(NS_SERVICE_INFO)
263 __MINGW_TYPEDEF_AW(PNS_SERVICE_INFO)
264 __MINGW_TYPEDEF_AW(LPNS_SERVICE_INFO)
265
266#ifndef __CSADDR_DEFINED__
267#define __CSADDR_DEFINED__
268
269 typedef struct _SOCKET_ADDRESS {
270 LPSOCKADDR lpSockaddr;
271 INT iSockaddrLength;
272 } SOCKET_ADDRESS,*PSOCKET_ADDRESS,*LPSOCKET_ADDRESS;
273
274 typedef struct _CSADDR_INFO {
275 SOCKET_ADDRESS LocalAddr;
276 SOCKET_ADDRESS RemoteAddr;
277 INT iSocketType;
278 INT iProtocol;
279 } CSADDR_INFO,*PCSADDR_INFO,*LPCSADDR_INFO;
280#endif
281
282 typedef struct _PROTOCOL_INFOA {
283 DWORD dwServiceFlags;
284 INT iAddressFamily;
285 INT iMaxSockAddr;
286 INT iMinSockAddr;
287 INT iSocketType;
288 INT iProtocol;
289 DWORD dwMessageSize;
290 LPSTR lpProtocol;
291 } PROTOCOL_INFOA,*PPROTOCOL_INFOA,*LPPROTOCOL_INFOA;
292
293 typedef struct _PROTOCOL_INFOW {
294 DWORD dwServiceFlags;
295 INT iAddressFamily;
296 INT iMaxSockAddr;
297 INT iMinSockAddr;
298 INT iSocketType;
299 INT iProtocol;
300 DWORD dwMessageSize;
301 LPWSTR lpProtocol;
302 } PROTOCOL_INFOW,*PPROTOCOL_INFOW,*LPPROTOCOL_INFOW;
303
304 __MINGW_TYPEDEF_AW(PROTOCOL_INFO)
305 __MINGW_TYPEDEF_AW(PPROTOCOL_INFO)
306 __MINGW_TYPEDEF_AW(LPPROTOCOL_INFO)
307
308 typedef struct _NETRESOURCE2A {
309 DWORD dwScope;
310 DWORD dwType;
311 DWORD dwUsage;
312 DWORD dwDisplayType;
313 LPSTR lpLocalName;
314 LPSTR lpRemoteName;
315 LPSTR lpComment;
316 NS_INFO ns_info;
317 GUID ServiceType;
318 DWORD dwProtocols;
319 LPINT lpiProtocols;
320 } NETRESOURCE2A,*PNETRESOURCE2A,*LPNETRESOURCE2A;
321
322 typedef struct _NETRESOURCE2W {
323 DWORD dwScope;
324 DWORD dwType;
325 DWORD dwUsage;
326 DWORD dwDisplayType;
327 LPWSTR lpLocalName;
328 LPWSTR lpRemoteName;
329 LPWSTR lpComment;
330 NS_INFO ns_info;
331 GUID ServiceType;
332 DWORD dwProtocols;
333 LPINT lpiProtocols;
334 } NETRESOURCE2W,*PNETRESOURCE2W,*LPNETRESOURCE2W;
335
336 __MINGW_TYPEDEF_AW(NETRESOURCE2)
337 __MINGW_TYPEDEF_AW(PNETRESOURCE2)
338 __MINGW_TYPEDEF_AW(LPNETRESOURCE2)
339
340 typedef DWORD (*LPFN_NSPAPI)(VOID);
341
342 typedef VOID (*LPSERVICE_CALLBACK_PROC)(LPARAM lParam,HANDLE hAsyncTaskHandle);
343 typedef struct _SERVICE_ASYNC_INFO {
344 LPSERVICE_CALLBACK_PROC lpServiceCallbackProc;
345 LPARAM lParam;
346 HANDLE hAsyncTaskHandle;
347 } SERVICE_ASYNC_INFO,*PSERVICE_ASYNC_INFO,*LPSERVICE_ASYNC_INFO;
348
349#define EnumProtocols __MINGW_NAME_AW(EnumProtocols)
350#define GetAddressByName __MINGW_NAME_AW(GetAddressByName)
351#define GetTypeByName __MINGW_NAME_AW(GetTypeByName)
352#define GetNameByType __MINGW_NAME_AW(GetNameByType)
353#define SetService __MINGW_NAME_AW(SetService)
354#define GetService __MINGW_NAME_AW(GetService)
355
356 INT WINAPI EnumProtocolsA(LPINT lpiProtocols,LPVOID lpProtocolBuffer,LPDWORD lpdwBufferLength);
357 INT WINAPI EnumProtocolsW(LPINT lpiProtocols,LPVOID lpProtocolBuffer,LPDWORD lpdwBufferLength);
358 INT WINAPI GetAddressByNameA(DWORD dwNameSpace,LPGUID lpServiceType,LPSTR lpServiceName,LPINT lpiProtocols,DWORD dwResolution,LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,LPVOID lpCsaddrBuffer,LPDWORD lpdwBufferLength,LPSTR lpAliasBuffer,LPDWORD lpdwAliasBufferLength);
359 INT WINAPI GetAddressByNameW(DWORD dwNameSpace,LPGUID lpServiceType,LPWSTR lpServiceName,LPINT lpiProtocols,DWORD dwResolution,LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,LPVOID lpCsaddrBuffer,LPDWORD lpdwBufferLength,LPWSTR lpAliasBuffer,LPDWORD lpdwAliasBufferLength);
360 INT WINAPI GetTypeByNameA(LPSTR lpServiceName,LPGUID lpServiceType);
361 INT WINAPI GetTypeByNameW(LPWSTR lpServiceName,LPGUID lpServiceType);
362 INT WINAPI GetNameByTypeA(LPGUID lpServiceType,LPSTR lpServiceName,DWORD dwNameLength);
363 INT WINAPI GetNameByTypeW(LPGUID lpServiceType,LPWSTR lpServiceName,DWORD dwNameLength);
364 INT WINAPI SetServiceA(DWORD dwNameSpace,DWORD dwOperation,DWORD dwFlags,LPSERVICE_INFOA lpServiceInfo,LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,LPDWORD lpdwStatusFlags);
365 INT WINAPI SetServiceW(DWORD dwNameSpace,DWORD dwOperation,DWORD dwFlags,LPSERVICE_INFOW lpServiceInfo,LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,LPDWORD lpdwStatusFlags);
366 INT WINAPI GetServiceA(DWORD dwNameSpace,LPGUID lpGuid,LPSTR lpServiceName,DWORD dwProperties,LPVOID lpBuffer,LPDWORD lpdwBufferSize,LPSERVICE_ASYNC_INFO lpServiceAsyncInfo);
367 INT WINAPI GetServiceW(DWORD dwNameSpace,LPGUID lpGuid,LPWSTR lpServiceName,DWORD dwProperties,LPVOID lpBuffer,LPDWORD lpdwBufferSize,LPSERVICE_ASYNC_INFO lpServiceAsyncInfo);
368
369#ifdef __cplusplus
370}
371#endif
372#endif
Note: See TracBrowser for help on using the repository browser.