1 | /* NSPAPI.H -- winsock 1.1
|
---|
2 | * not supported on win95
|
---|
3 | *
|
---|
4 | * Copyright (C) 2001 Stefan Leichter
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef _WINE_NSPAPI_
|
---|
31 | #define _WINE_NSPAPI_
|
---|
32 |
|
---|
33 | #ifdef __cplusplus
|
---|
34 | extern "C" {
|
---|
35 | #endif /* defined(__cplusplus) */
|
---|
36 | /*
|
---|
37 | * constants
|
---|
38 | */
|
---|
39 | #define XP_CONNECTIONLESS 0x00000001
|
---|
40 | #define XP_GUARANTEED_DELIVERY 0x00000002
|
---|
41 | #define XP_GUARANTEED_ORDER 0x00000004
|
---|
42 | #define XP_MESSAGE_ORIENTED 0x00000008
|
---|
43 | #define XP_PSEUDO_STREAM 0x00000010
|
---|
44 | #define XP_GRACEFUL_CLOSE 0x00000020
|
---|
45 | #define XP_EXPEDITED_DATA 0x00000040
|
---|
46 | #define XP_CONNECT_DATA 0x00000080
|
---|
47 | #define XP_DISCONNECT_DATA 0x00000100
|
---|
48 | #define XP_SUPPORTS_BROADCAST 0x00000200
|
---|
49 | #define XP_SUPPORTS_MULTICAST 0x00000400
|
---|
50 | #define XP_BANDWITH_ALLOCATION 0x00000800
|
---|
51 | #define XP_FRAGMENTATION 0x00001000
|
---|
52 | #define XP_ENCRYPTS 0x00002000
|
---|
53 |
|
---|
54 | /*
|
---|
55 | * structures
|
---|
56 | */
|
---|
57 | typedef struct _PROTOCOL_INFOA
|
---|
58 | {
|
---|
59 | DWORD dwServiceFlags;
|
---|
60 | INT iAddressFamily;
|
---|
61 | INT iMaxSockAddr;
|
---|
62 | INT iMinSockAddr;
|
---|
63 | INT iSocketType;
|
---|
64 | INT iProtocol;
|
---|
65 | DWORD dwMessageSize;
|
---|
66 | LPSTR lpProtocol;
|
---|
67 | } PROTOCOL_INFOA, *PPROTOCOL_INFOA, *LPPROTOCOL_INFOA;
|
---|
68 |
|
---|
69 | typedef struct _PROTOCOL_INFOW
|
---|
70 | {
|
---|
71 | DWORD dwServiceFlags;
|
---|
72 | INT iAddressFamily;
|
---|
73 | INT iMaxSockAddr;
|
---|
74 | INT iMinSockAddr;
|
---|
75 | INT iSocketType;
|
---|
76 | INT iProtocol;
|
---|
77 | DWORD dwMessageSize;
|
---|
78 | LPWSTR lpProtocol;
|
---|
79 | } PROTOCOL_INFOW, *PPROTOCOL_INFOW, *LPPROTOCOL_INFOW;
|
---|
80 |
|
---|
81 | DECL_WINELIB_TYPE_AW(PROTOCOL_INFO)
|
---|
82 | DECL_WINELIB_TYPE_AW(PPROTOCOL_INFO)
|
---|
83 | DECL_WINELIB_TYPE_AW(LPPROTOCOL_INFO)
|
---|
84 |
|
---|
85 | typedef struct _SERVICE_ADDRESS
|
---|
86 | {
|
---|
87 | DWORD dwAddressType;
|
---|
88 | DWORD dwAddressFlags;
|
---|
89 | DWORD dwAddressLength;
|
---|
90 | DWORD dwPrincipalLength;
|
---|
91 | BYTE* lpAddress;
|
---|
92 | BYTE* lpPrincipal;
|
---|
93 | } SERVICE_ADDRESS, *PSERVICE_ADDRESS, *LPSERVICE_ADDRESS;
|
---|
94 |
|
---|
95 | typedef struct _SERVICE_ADDRESSES
|
---|
96 | {
|
---|
97 | DWORD dwAddressCount;
|
---|
98 | SERVICE_ADDRESS Addresses[1];
|
---|
99 | } SERVICE_ADDRESSES, *PSERVICE_ADDRESSES, *LPSERVICE_ADDRESSES;
|
---|
100 |
|
---|
101 | typedef struct _SERVICE_INFOA
|
---|
102 | {
|
---|
103 | LPGUID lpServiceType;
|
---|
104 | LPSTR lpServiceName;
|
---|
105 | LPSTR lpComment;
|
---|
106 | LPSTR lpLocale;
|
---|
107 | DWORD dwDisplayHint;
|
---|
108 | DWORD dwVersion;
|
---|
109 | DWORD dwTime;
|
---|
110 | LPSTR lpMachineName;
|
---|
111 | LPSERVICE_ADDRESSES lpServiceAddress;
|
---|
112 | BLOB ServiceSpecificInfo;
|
---|
113 | } SERVICE_INFOA, *PSERVICE_INFOA, *LPSERVICE_INFOA;
|
---|
114 |
|
---|
115 | typedef struct _SERVICE_INFOW
|
---|
116 | {
|
---|
117 | LPGUID lpServiceType;
|
---|
118 | LPWSTR lpServiceName;
|
---|
119 | LPWSTR lpComment;
|
---|
120 | LPWSTR lpLocale;
|
---|
121 | DWORD dwDisplayHint;
|
---|
122 | DWORD dwVersion;
|
---|
123 | DWORD dwTime;
|
---|
124 | LPSTR lpMachineName;
|
---|
125 | LPSERVICE_ADDRESSES lpServiceAddress;
|
---|
126 | BLOB ServiceSpecificInfo; /* May point to SERVICE_TYPE_INFO_ABS */
|
---|
127 | } SERVICE_INFOW, *PSERVICE_INFOW, *LPSERVICE_INFOW;
|
---|
128 |
|
---|
129 | DECL_WINELIB_TYPE_AW(SERVICE_INFO)
|
---|
130 | DECL_WINELIB_TYPE_AW(PSERVICE_INFO)
|
---|
131 | DECL_WINELIB_TYPE_AW(LPSERVICE_INFO)
|
---|
132 |
|
---|
133 | typedef struct _SERVICE_TYPE_VALUE_ABSA
|
---|
134 | {
|
---|
135 | DWORD dwNameSpace; /* Name space or set of name spaces */
|
---|
136 | DWORD dwValueType; /* Type of the value data */
|
---|
137 | DWORD dwValueSize; /* Size of the value data */
|
---|
138 | LPSTR lpValueName; /* Name of the value */
|
---|
139 | PVOID lpValue; /* Pointer to the value data */
|
---|
140 | } SERVICE_TYPE_VALUE_ABSA, *PSERVICE_TYPE_VALUE_ABSA, *LPSERVICE_TYPE_VALUE_ABSA;
|
---|
141 |
|
---|
142 | typedef struct _SERVICE_TYPE_VALUE_ABSW
|
---|
143 | {
|
---|
144 | DWORD dwNameSpace; /* Name space or set of name spaces */
|
---|
145 | DWORD dwValueType; /* Type of the value data */
|
---|
146 | DWORD dwValueSize; /* Size of the value data */
|
---|
147 | LPWSTR lpValueName; /* Name of the value */
|
---|
148 | PVOID lpValue; /* Pointer to the value data */
|
---|
149 | } SERVICE_TYPE_VALUE_ABSW, *PSERVICE_TYPE_VALUE_ABSW, *LPSERVICE_TYPE_VALUE_ABSW;
|
---|
150 |
|
---|
151 | DECL_WINELIB_TYPE_AW(SERVICE_TYPE_VALUE_ABS)
|
---|
152 | DECL_WINELIB_TYPE_AW(PSERVICE_TYPE_VALUE_ABS)
|
---|
153 | DECL_WINELIB_TYPE_AW(LPSERVICE_TYPE_VALUE_ABS)
|
---|
154 |
|
---|
155 | typedef struct _SERVICE_TYPE_INFO_ABSA
|
---|
156 | {
|
---|
157 | LPSTR lpTypeName; /* Name of the network service type */
|
---|
158 | DWORD dwValueCount; /* Number of SERVICE_TYPE_VALUE_ABS structures */
|
---|
159 | SERVICE_TYPE_VALUE_ABSA Values[1]; /* Array of SERVICE_TYPE_VALUE_ABS structures */
|
---|
160 | } SERVICE_TYPE_INFO_ABSA, *PSERVICE_TYPE_INFO_ABSA, *LPSERVICE_TYPE_INFO_ABSA;
|
---|
161 |
|
---|
162 | typedef struct _SERVICE_TYPE_INFO_ABSW
|
---|
163 | {
|
---|
164 | LPWSTR lpTypeName; /* Name of the network service type */
|
---|
165 | DWORD dwValueCount; /* Number of SERVICE_TYPE_VALUE_ABS structures */
|
---|
166 | SERVICE_TYPE_VALUE_ABSW Values[1]; /* Array of SERVICE_TYPE_VALUE_ABS structures */
|
---|
167 | } SERVICE_TYPE_INFO_ABSW, *PSERVICE_TYPE_INFO_ABSW, *LPSERVICE_TYPE_INFO_ABSW;
|
---|
168 |
|
---|
169 | DECL_WINELIB_TYPE_AW(SERVICE_TYPE_INFO_ABS)
|
---|
170 | DECL_WINELIB_TYPE_AW(PSERVICE_TYPE_INFO_ABS)
|
---|
171 | DECL_WINELIB_TYPE_AW(LPSERVICE_TYPE_INFO_ABS)
|
---|
172 |
|
---|
173 | typedef void (*LPSERVICE_CALLBACK_PROC)(LPARAM lParam, HANDLE hAsyncTaskHandle);
|
---|
174 |
|
---|
175 | typedef struct _SERVICE_ASYNC_INFO
|
---|
176 | {
|
---|
177 | LPSERVICE_CALLBACK_PROC lpServiceCallbackProc;
|
---|
178 | LPARAM lParam;
|
---|
179 | HANDLE hAsyncTaskHandle;
|
---|
180 | } SERVICE_ASYNC_INFO, *PSERVICE_ASYNC_INFO, *LPSERVICE_ASYNC_INFO;
|
---|
181 |
|
---|
182 | /*
|
---|
183 | * function prototypes
|
---|
184 | */
|
---|
185 | INT WINAPI GetAddressByNameA(DWORD dwNameSpace, LPGUID lpServiceType, LPSTR lpServiceName,
|
---|
186 | LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
|
---|
187 | LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPSTR lpAliasBuffer,
|
---|
188 | LPDWORD lpdwAliasBufferLength);
|
---|
189 | INT WINAPI GetAddressByNameW(DWORD dwNameSpace, LPGUID lpServiceType, LPWSTR lpServiceName,
|
---|
190 | LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
|
---|
191 | LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPWSTR lpAliasBuffer,
|
---|
192 | LPDWORD lpdwAliasBufferLength);
|
---|
193 | #define GetAddressByName WINELIB_NAME_AW(GetAddressByName)
|
---|
194 | INT WINAPI GetTypeByNameA(LPSTR lpServiceName, LPGUID lpServiceType);
|
---|
195 | INT WINAPI GetTypeByNameW(LPWSTR lpServiceName, LPGUID lpServiceType);
|
---|
196 | #define GetTypeByName WINELIB_NAME_AW(GetTypeByName)
|
---|
197 | INT WINAPI SetServiceA(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOA lpServiceInfo,
|
---|
198 | LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags);
|
---|
199 | INT WINAPI SetServiceW(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOW lpServiceInfo,
|
---|
200 | LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags);
|
---|
201 | #define SetService WINELIB_NAME_AW(SetService)
|
---|
202 | INT WINAPI GetServiceA(DWORD dwNameSpace, LPGUID lpGuid, LPSTR lpServiceName,
|
---|
203 | DWORD dwProperties, LPVOID lpBuffer, LPDWORD lpdwBufferSize,
|
---|
204 | LPSERVICE_ASYNC_INFO lpServiceAsyncInfo);
|
---|
205 | INT WINAPI GetServiceW(DWORD dwNameSpace, LPGUID lpGuid, LPSTR lpServiceName,
|
---|
206 | DWORD dwProperties, LPVOID lpBuffer, LPDWORD lpdwBufferSize,
|
---|
207 | LPSERVICE_ASYNC_INFO lpServiceAsyncInfo);
|
---|
208 | #define GetService WINELIB_NAME_AW(GetService)
|
---|
209 |
|
---|
210 | #ifdef __cplusplus
|
---|
211 | } /* extern "C" */
|
---|
212 | #endif /* defined(__cplusplus) */
|
---|
213 |
|
---|
214 | #endif /* _WINE_NSPAPI_ */
|
---|