Portability fixes.
[wine/wine-kai.git] / include / winnetwk.h
blob28ddf6ccef835299594940f429f7d5f5f3ffe7ec
1 /*
2 * Copyright (C) the Wine project
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef _WINNETWK_H_
21 #define _WINNETWK_H_
23 #include "windef.h"
24 #include "winerror.h"
27 * Network types
30 #define WNNC_NET_MSNET 0x00010000
31 #define WNNC_NET_LANMAN 0x00020000
32 #define WNNC_NET_NETWARE 0x00030000
33 #define WNNC_NET_VINES 0x00040000
34 #define WNNC_NET_10NET 0x00050000
35 #define WNNC_NET_LOCUS 0x00060000
36 #define WNNC_NET_SUN_PC_NFS 0x00070000
37 #define WNNC_NET_LANSTEP 0x00080000
38 #define WNNC_NET_9TILES 0x00090000
39 #define WNNC_NET_LANTASTIC 0x000A0000
40 #define WNNC_NET_AS400 0x000B0000
41 #define WNNC_NET_FTP_NFS 0x000C0000
42 #define WNNC_NET_PATHWORKS 0x000D0000
43 #define WNNC_NET_LIFENET 0x000E0000
44 #define WNNC_NET_POWERLAN 0x000F0000
45 #define WNNC_NET_BWNFS 0x00100000
46 #define WNNC_NET_COGENT 0x00110000
47 #define WNNC_NET_FARALLON 0x00120000
48 #define WNNC_NET_APPLETALK 0x00130000
49 #define WNNC_NET_INTERGRAPH 0x00140000
52 * Network resources
55 #define RESOURCE_CONNECTED 0x00000001
56 #define RESOURCE_GLOBALNET 0x00000002
57 #define RESOURCE_REMEMBERED 0x00000003
58 #define RESOURCE_RECENT 0x00000004
59 #define RESOURCE_CONTEXT 0x00000005
61 #define RESOURCETYPE_ANY 0x00000000
62 #define RESOURCETYPE_DISK 0x00000001
63 #define RESOURCETYPE_PRINT 0x00000002
64 #define RESOURCETYPE_RESERVED 0x00000008
65 #define RESOURCETYPE_UNKNOWN 0xFFFFFFFF
67 #define RESOURCEUSAGE_CONNECTABLE 0x00000001
68 #define RESOURCEUSAGE_CONTAINER 0x00000002
69 #define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
70 #define RESOURCEUSAGE_SIBLING 0x00000008
71 #define RESOURCEUSAGE_ATTACHED 0x00000010
72 #define RESOURCEUSAGE_ALL (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED)
73 #define RESOURCEUSAGE_RESERVED 0x80000000
75 #define RESOURCEDISPLAYTYPE_GENERIC 0x00000000
76 #define RESOURCEDISPLAYTYPE_DOMAIN 0x00000001
77 #define RESOURCEDISPLAYTYPE_SERVER 0x00000002
78 #define RESOURCEDISPLAYTYPE_SHARE 0x00000003
79 #define RESOURCEDISPLAYTYPE_FILE 0x00000004
80 #define RESOURCEDISPLAYTYPE_GROUP 0x00000005
81 #define RESOURCEDISPLAYTYPE_NETWORK 0x00000006
82 #define RESOURCEDISPLAYTYPE_ROOT 0x00000007
83 #define RESOURCEDISPLAYTYPE_SHAREADMIN 0x00000008
84 #define RESOURCEDISPLAYTYPE_DIRECTORY 0x00000009
85 #define RESOURCEDISPLAYTYPE_TREE 0x0000000A
87 typedef struct {
88 DWORD dwScope;
89 DWORD dwType;
90 DWORD dwDisplayType;
91 DWORD dwUsage;
92 LPSTR lpLocalName;
93 LPSTR lpRemoteName;
94 LPSTR lpComment ;
95 LPSTR lpProvider;
96 } NETRESOURCEA,*LPNETRESOURCEA;
98 typedef struct {
99 DWORD dwScope;
100 DWORD dwType;
101 DWORD dwDisplayType;
102 DWORD dwUsage;
103 LPWSTR lpLocalName;
104 LPWSTR lpRemoteName;
105 LPWSTR lpComment ;
106 LPWSTR lpProvider;
107 } NETRESOURCEW,*LPNETRESOURCEW;
109 DECL_WINELIB_TYPE_AW(NETRESOURCE)
110 DECL_WINELIB_TYPE_AW(LPNETRESOURCE)
114 * Network connections
117 #define NETPROPERTY_PERSISTENT 1
119 #define CONNECT_UPDATE_PROFILE 0x00000001
120 #define CONNECT_UPDATE_RECENT 0x00000002
121 #define CONNECT_TEMPORARY 0x00000004
122 #define CONNECT_INTERACTIVE 0x00000008
123 #define CONNECT_PROMPT 0x00000010
124 #define CONNECT_NEED_DRIVE 0x00000020
125 #define CONNECT_REFCOUNT 0x00000040
126 #define CONNECT_REDIRECT 0x00000080
127 #define CONNECT_LOCALDRIVE 0x00000100
128 #define CONNECT_CURRENT_MEDIA 0x00000200
130 DWORD WINAPI WNetAddConnectionA(LPCSTR,LPCSTR,LPCSTR);
131 DWORD WINAPI WNetAddConnectionW(LPCWSTR,LPCWSTR,LPCWSTR);
132 #define WNetAddConnection WINELIB_NAME_AW(WNetAddConnection)
133 DWORD WINAPI WNetAddConnection2A(LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
134 DWORD WINAPI WNetAddConnection2W(LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
135 #define WNetAddConnection2 WINELIB_NAME_AW(WNetAddConnection2)
136 DWORD WINAPI WNetAddConnection3A(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
137 DWORD WINAPI WNetAddConnection3W(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
138 #define WNetAddConnection3 WINELIB_NAME_AW(WNetAddConnection3)
139 DWORD WINAPI WNetCancelConnectionA(LPCSTR,BOOL);
140 DWORD WINAPI WNetCancelConnectionW(LPCWSTR,BOOL);
141 #define WNetCancelConnection WINELIB_NAME_AW(WNetCancelConnection)
142 DWORD WINAPI WNetCancelConnection2A(LPCSTR,DWORD,BOOL);
143 DWORD WINAPI WNetCancelConnection2W(LPCWSTR,DWORD,BOOL);
144 #define WNetCancelConnection2 WINELIB_NAME_AW(WNetCancelConnection2)
145 DWORD WINAPI WNetGetConnectionA(LPCSTR,LPSTR,LPDWORD);
146 DWORD WINAPI WNetGetConnectionW(LPCWSTR,LPWSTR,LPDWORD);
147 #define WNetGetConnection WINELIB_NAME_AW(WNetGetConnection)
148 DWORD WINAPI WNetUseConnectionA(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD,LPSTR,LPDWORD,LPDWORD);
149 DWORD WINAPI WNetUseConnectionW(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPDWORD,LPDWORD);
150 #define WNetUseConnection WINELIB_NAME_AW(WNetUseConnection)
151 DWORD WINAPI WNetSetConnectionA(LPCSTR,DWORD,LPVOID);
152 DWORD WINAPI WNetSetConnectionW(LPCWSTR,DWORD,LPVOID);
153 #define WNetSetConnection WINELIB_NAME_AW(WNetSetConnection)
156 * Network connection dialogs
159 typedef struct {
160 DWORD cbStructure; /* size of this structure in bytes */
161 HWND hwndOwner; /* owner window for the dialog */
162 LPNETRESOURCEA lpConnRes;/* Requested Resource info */
163 DWORD dwFlags; /* flags (see below) */
164 DWORD dwDevNum; /* number of devices connected to */
165 } CONNECTDLGSTRUCTA, *LPCONNECTDLGSTRUCTA;
166 typedef struct {
167 DWORD cbStructure; /* size of this structure in bytes */
168 HWND hwndOwner; /* owner window for the dialog */
169 LPNETRESOURCEW lpConnRes;/* Requested Resource info */
170 DWORD dwFlags; /* flags (see below) */
171 DWORD dwDevNum; /* number of devices connected to */
172 } CONNECTDLGSTRUCTW, *LPCONNECTDLGSTRUCTW;
174 DECL_WINELIB_TYPE_AW(CONNECTDLGSTRUCT)
175 DECL_WINELIB_TYPE_AW(LPCONNECTDLGSTRUCT)
177 #define CONNDLG_RO_PATH 0x00000001 /* Resource path should be read-only */
178 #define CONNDLG_CONN_POINT 0x00000002 /* Netware -style movable connection point enabled */
179 #define CONNDLG_USE_MRU 0x00000004 /* Use MRU combobox */
180 #define CONNDLG_HIDE_BOX 0x00000008 /* Hide persistent connect checkbox */
181 #define CONNDLG_PERSIST 0x00000010 /* Force persistent connection */
182 #define CONNDLG_NOT_PERSIST 0x00000020 /* Force connection NOT persistent */
184 typedef struct {
185 DWORD cbStructure; /* size of this structure in bytes */
186 HWND hwndOwner; /* owner window for the dialog */
187 LPSTR lpLocalName; /* local device name */
188 LPSTR lpRemoteName; /* network resource name */
189 DWORD dwFlags; /* flags */
190 } DISCDLGSTRUCTA, *LPDISCDLGSTRUCTA;
191 typedef struct {
192 DWORD cbStructure; /* size of this structure in bytes */
193 HWND hwndOwner; /* owner window for the dialog */
194 LPWSTR lpLocalName; /* local device name */
195 LPWSTR lpRemoteName; /* network resource name */
196 DWORD dwFlags; /* flags */
197 } DISCDLGSTRUCTW, *LPDISCDLGSTRUCTW;
199 DECL_WINELIB_TYPE_AW(DISCDLGSTRUCT)
200 DECL_WINELIB_TYPE_AW(LPDISCDLGSTRUCT)
202 #define DISC_UPDATE_PROFILE 0x00000001
203 #define DISC_NO_FORCE 0x00000040
205 DWORD WINAPI WNetConnectionDialog(HWND,DWORD);
206 DWORD WINAPI WNetDisconnectDialog(HWND,DWORD);
207 DWORD WINAPI WNetConnectionDialog1A(LPCONNECTDLGSTRUCTA);
208 DWORD WINAPI WNetConnectionDialog1W(LPCONNECTDLGSTRUCTW);
209 #define WNetConnectionDialog1 WINELIB_NAME_AW(WNetConnectionDialog1)
210 DWORD WINAPI WNetDisconnectDialog1A(LPDISCDLGSTRUCTA);
211 DWORD WINAPI WNetDisconnectDialog1W(LPDISCDLGSTRUCTW);
212 #define WNetDisconnectDialog1 WINELIB_NAME_AW(WNetDisconnectDialog1)
215 * Network browsing
218 DWORD WINAPI WNetOpenEnumA(DWORD,DWORD,DWORD,LPNETRESOURCEA,LPHANDLE);
219 DWORD WINAPI WNetOpenEnumW(DWORD,DWORD,DWORD,LPNETRESOURCEW,LPHANDLE);
220 #define WNetOpenEnum WINELIB_NAME_AW(WNetOpenEnum)
221 DWORD WINAPI WNetEnumResourceA(HANDLE,LPDWORD,LPVOID,LPDWORD);
222 DWORD WINAPI WNetEnumResourceW(HANDLE,LPDWORD,LPVOID,LPDWORD);
223 #define WNetEnumResource WINELIB_NAME_AW(WNetEnumResource)
224 DWORD WINAPI WNetCloseEnum(HANDLE);
227 * Universal naming
230 #define UNIVERSAL_NAME_INFO_LEVEL 0x00000001
231 #define REMOTE_NAME_INFO_LEVEL 0x00000002
233 typedef struct {
234 LPSTR lpUniversalName;
235 } UNIVERSAL_NAME_INFOA, *LPUNIVERSAL_NAME_INFOA;
236 typedef struct {
237 LPWSTR lpUniversalName;
238 } UNIVERSAL_NAME_INFOW, *LPUNIVERSAL_NAME_INFOW;
240 DECL_WINELIB_TYPE_AW(UNIVERSAL_NAME_INFO)
241 DECL_WINELIB_TYPE_AW(LPUNIVERSAL_NAME_INFO)
243 typedef struct {
244 LPSTR lpUniversalName;
245 LPSTR lpConnectionName;
246 LPSTR lpRemainingPath;
247 }REMOTE_NAME_INFOA, *LPREMOTE_NAME_INFOA;
248 typedef struct {
249 LPWSTR lpUniversalName;
250 LPWSTR lpConnectionName;
251 LPWSTR lpRemainingPath;
252 }REMOTE_NAME_INFOW, *LPREMOTE_NAME_INFOW;
254 DECL_WINELIB_TYPE_AW(REMOTE_NAME_INFO)
255 DECL_WINELIB_TYPE_AW(LPREMOTE_NAME_INFO)
257 DWORD WINAPI WNetGetUniversalNameA(LPCSTR,DWORD,LPVOID,LPDWORD);
258 DWORD WINAPI WNetGetUniversalNameW(LPCWSTR,DWORD,LPVOID,LPDWORD);
259 #define WNetGetUniversalName WINELIB_NAME_AW(WNetGetUniversalName)
262 * Other
265 DWORD WINAPI WNetGetUserA(LPCSTR,LPSTR,LPDWORD);
266 DWORD WINAPI WNetGetUserW(LPCWSTR,LPWSTR,LPDWORD);
267 #define WNetGetUser WINELIB_NAME_AW(WNetGetUser)
269 #define WNFMT_MULTILINE 0x01
270 #define WNFMT_ABBREVIATED 0x02
271 #define WNFMT_INENUM 0x10
272 #define WNFMT_CONNECTION 0x20
274 DWORD WINAPI WNetGetProviderNameA(DWORD,LPSTR,LPDWORD);
275 DWORD WINAPI WNetGetProviderNameW(DWORD,LPWSTR,LPDWORD);
276 #define WNetGetProviderName WINELIB_NAME_AW(WNetGetProviderName)
278 typedef struct {
279 DWORD cbStructure;
280 DWORD dwProviderVersion;
281 DWORD dwStatus;
282 DWORD dwCharacteristics;
283 DWORD dwHandle;
284 WORD wNetType;
285 DWORD dwPrinters;
286 DWORD dwDrives;
287 } NETINFOSTRUCT, *LPNETINFOSTRUCT;
289 #define NETINFO_DLL16 0x00000001
290 #define NETINFO_DISKRED 0x00000004
291 #define NETINFO_PRINTERRED 0x00000008
293 DWORD WINAPI WNetGetNetworkInformationA(LPCSTR,LPNETINFOSTRUCT);
294 DWORD WINAPI WNetGetNetworkInformationW(LPCWSTR,LPNETINFOSTRUCT);
295 #define WNetGetNetworkInformation WINELIB_NAME_AW(WNetGetNetworkInformation)
299 * Status codes
302 DWORD WINAPI WNetGetLastErrorA(LPDWORD,LPSTR,DWORD,LPSTR,DWORD);
303 DWORD WINAPI WNetGetLastErrorW(LPDWORD,LPWSTR,DWORD,LPWSTR,DWORD);
304 #define WNetGetLastError WINELIB_NAME_AW(WNetGetLastError)
306 #define WN_SUCCESS NO_ERROR
307 #define WN_NO_ERROR NO_ERROR
308 #define WN_NOT_SUPPORTED ERROR_NOT_SUPPORTED
309 #define WN_CANCEL ERROR_CANCELLED
310 #define WN_RETRY ERROR_RETRY
311 #define WN_NET_ERROR ERROR_UNEXP_NET_ERR
312 #define WN_MORE_DATA ERROR_MORE_DATA
313 #define WN_BAD_POINTER ERROR_INVALID_ADDRESS
314 #define WN_BAD_VALUE ERROR_INVALID_PARAMETER
315 #define WN_BAD_USER ERROR_BAD_USERNAME
316 #define WN_BAD_PASSWORD ERROR_INVALID_PASSWORD
317 #define WN_ACCESS_DENIED ERROR_ACCESS_DENIED
318 #define WN_FUNCTION_BUSY ERROR_BUSY
319 #define WN_WINDOWS_ERROR ERROR_UNEXP_NET_ERR
320 #define WN_OUT_OF_MEMORY ERROR_NOT_ENOUGH_MEMORY
321 #define WN_NO_NETWORK ERROR_NO_NETWORK
322 #define WN_EXTENDED_ERROR ERROR_EXTENDED_ERROR
323 #define WN_BAD_LEVEL ERROR_INVALID_LEVEL
324 #define WN_BAD_HANDLE ERROR_INVALID_HANDLE
325 #define WN_NOT_INITIALIZING ERROR_ALREADY_INITIALIZED
326 #define WN_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES
328 #define WN_NOT_CONNECTED ERROR_NOT_CONNECTED
329 #define WN_OPEN_FILES ERROR_OPEN_FILES
330 #define WN_DEVICE_IN_USE ERROR_DEVICE_IN_USE
331 #define WN_BAD_NETNAME ERROR_BAD_NET_NAME
332 #define WN_BAD_LOCALNAME ERROR_BAD_DEVICE
333 #define WN_ALREADY_CONNECTED ERROR_ALREADY_ASSIGNED
334 #define WN_DEVICE_ERROR ERROR_GEN_FAILURE
335 #define WN_CONNECTION_CLOSED ERROR_CONNECTION_UNAVAIL
336 #define WN_NO_NET_OR_BAD_PATH ERROR_NO_NET_OR_BAD_PATH
337 #define WN_BAD_PROVIDER ERROR_BAD_PROVIDER
338 #define WN_CANNOT_OPEN_PROFILE ERROR_CANNOT_OPEN_PROFILE
339 #define WN_BAD_PROFILE ERROR_BAD_PROFILE
340 #define WN_BAD_DEV_TYPE ERROR_BAD_DEV_TYPE
341 #define WN_DEVICE_ALREADY_REMEMBERED ERROR_DEVICE_ALREADY_REMEMBERED
343 #define WN_NO_MORE_ENTRIES ERROR_NO_MORE_ITEMS
344 #define WN_NOT_CONTAINER ERROR_NOT_CONTAINER
346 #define WN_NOT_AUTHENTICATED ERROR_NOT_AUTHENTICATED
347 #define WN_NOT_LOGGED_ON ERROR_NOT_LOGGED_ON
348 #define WN_NOT_VALIDATED ERROR_NO_LOGON_SERVERS
352 * Multinet (for Shell)
355 typedef struct {
356 DWORD cbStructure;
357 DWORD dwFlags;
358 DWORD dwSpeed;
359 DWORD dwDelay;
360 DWORD dwOptDataSize;
361 } NETCONNECTINFOSTRUCT,*LPNETCONNECTINFOSTRUCT;
363 #define WNCON_FORNETCARD 0x00000001
364 #define WNCON_NOTROUTED 0x00000002
365 #define WNCON_SLOWLINK 0x00000004
366 #define WNCON_DYNAMIC 0x00000008
368 DWORD WINAPI MultinetGetConnectionPerformanceA(LPNETRESOURCEA,LPNETCONNECTINFOSTRUCT);
369 DWORD WINAPI MultinetGetConnectionPerformanceW(LPNETRESOURCEW,LPNETCONNECTINFOSTRUCT);
370 #define MultinetGetConnectionPerformance WINELIB_NAME_AW(MultinetGetConnectionPerformance)
371 DWORD WINAPI MultinetGetErrorTextA(DWORD,DWORD,DWORD);
372 DWORD WINAPI MultinetGetErrorTextW(DWORD,DWORD,DWORD);
373 #define MultinetGetErrorText WINELIB_NAME_AW(MultinetGetErrorText)
376 * Password cache
379 /* WNetEnumCachedPasswords */
380 typedef struct tagPASSWORD_CACHE_ENTRY
382 WORD cbEntry;
383 WORD cbResource;
384 WORD cbPassword;
385 BYTE iEntry;
386 BYTE nType;
387 BYTE abResource[1];
388 } PASSWORD_CACHE_ENTRY;
390 typedef BOOL (CALLBACK *ENUMPASSWORDPROC)(PASSWORD_CACHE_ENTRY *, DWORD);
391 UINT WINAPI WNetEnumCachedPasswords( LPSTR, WORD, BYTE, ENUMPASSWORDPROC, DWORD);
392 DWORD WINAPI WNetGetCachedPassword( LPSTR, WORD, LPSTR, LPWORD, BYTE );
393 DWORD WINAPI WNetCachePassword( LPSTR, WORD, LPSTR, WORD, BYTE, WORD );
396 #endif /* _WINNETWK_H_ */