summaryrefslogtreecommitdiffstats
path: root/vendor/winapi/src/um/winnetwk.rs
blob: 5680da12492467feb41f7adf078f641a50d325d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
//! Standard WINNET Header File for WIN32
use shared::basetsd::ULONG_PTR;
use shared::minwindef::{BOOL, DWORD, LPDWORD, LPHANDLE, LPVOID, WORD};
use shared::windef::HWND;
use shared::winerror::{
    ERROR_ACCESS_DENIED, ERROR_ALREADY_ASSIGNED, ERROR_ALREADY_INITIALIZED, ERROR_BAD_DEVICE,
    ERROR_BAD_DEV_TYPE, ERROR_BAD_NET_NAME, ERROR_BAD_PROFILE, ERROR_BAD_PROVIDER,
    ERROR_BAD_USERNAME, ERROR_BUSY, ERROR_CANCELLED, ERROR_CANNOT_OPEN_PROFILE,
    ERROR_CONNECTED_OTHER_PASSWORD, ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT,
    ERROR_CONNECTION_UNAVAIL, ERROR_DEVICE_ALREADY_REMEMBERED, ERROR_DEVICE_IN_USE,
    ERROR_EXTENDED_ERROR, ERROR_GEN_FAILURE, ERROR_INVALID_ADDRESS, ERROR_INVALID_HANDLE,
    ERROR_INVALID_LEVEL, ERROR_INVALID_PARAMETER, ERROR_INVALID_PASSWORD, ERROR_MORE_DATA,
    ERROR_NOT_AUTHENTICATED, ERROR_NOT_CONNECTED, ERROR_NOT_CONTAINER, ERROR_NOT_ENOUGH_MEMORY,
    ERROR_NOT_LOGGED_ON, ERROR_NOT_SUPPORTED, ERROR_NO_LOGON_SERVERS, ERROR_NO_MORE_DEVICES,
    ERROR_NO_MORE_ITEMS, ERROR_NO_NETWORK, ERROR_NO_NET_OR_BAD_PATH, ERROR_OPEN_FILES, ERROR_RETRY,
    ERROR_UNEXP_NET_ERR, NO_ERROR
};
use um::winnt::{HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR};
pub const RESOURCE_CONNECTED: DWORD = 0x00000001;
pub const RESOURCE_GLOBALNET: DWORD = 0x00000002;
pub const RESOURCE_REMEMBERED: DWORD = 0x00000003;
pub const RESOURCE_RECENT: DWORD = 0x00000004;
pub const RESOURCE_CONTEXT: DWORD = 0x00000005;
pub const RESOURCETYPE_ANY: DWORD = 0x00000000;
pub const RESOURCETYPE_DISK: DWORD = 0x00000001;
pub const RESOURCETYPE_PRINT: DWORD = 0x00000002;
pub const RESOURCETYPE_RESERVED: DWORD = 0x00000008;
pub const RESOURCETYPE_UNKNOWN: DWORD = 0xFFFFFFFF;
pub const RESOURCEUSAGE_CONNECTABLE: DWORD = 0x00000001;
pub const RESOURCEUSAGE_CONTAINER: DWORD = 0x00000002;
pub const RESOURCEUSAGE_NOLOCALDEVICE: DWORD = 0x00000004;
pub const RESOURCEUSAGE_SIBLING: DWORD = 0x00000008;
pub const RESOURCEUSAGE_ATTACHED: DWORD = 0x00000010;
pub const RESOURCEUSAGE_ALL: DWORD = RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER
    | RESOURCEUSAGE_ATTACHED;
pub const RESOURCEUSAGE_RESERVED: DWORD = 0x80000000;
pub const RESOURCEDISPLAYTYPE_GENERIC: DWORD = 0x00000000;
pub const RESOURCEDISPLAYTYPE_DOMAIN: DWORD = 0x00000001;
pub const RESOURCEDISPLAYTYPE_SERVER: DWORD = 0x00000002;
pub const RESOURCEDISPLAYTYPE_SHARE: DWORD = 0x00000003;
pub const RESOURCEDISPLAYTYPE_FILE: DWORD = 0x00000004;
pub const RESOURCEDISPLAYTYPE_GROUP: DWORD = 0x00000005;
pub const RESOURCEDISPLAYTYPE_NETWORK: DWORD = 0x00000006;
pub const RESOURCEDISPLAYTYPE_ROOT: DWORD = 0x00000007;
pub const RESOURCEDISPLAYTYPE_SHAREADMIN: DWORD = 0x00000008;
pub const RESOURCEDISPLAYTYPE_DIRECTORY: DWORD = 0x00000009;
pub const RESOURCEDISPLAYTYPE_TREE: DWORD = 0x0000000A;
pub const RESOURCEDISPLAYTYPE_NDSCONTAINER: DWORD = 0x0000000B;
STRUCT!{struct NETRESOURCEA {
    dwScope: DWORD,
    dwType: DWORD,
    dwDisplayType: DWORD,
    dwUsage: DWORD,
    lpLocalName: LPSTR,
    lpRemoteName: LPSTR,
    lpComment: LPSTR,
    lpProvider: LPSTR,
}}
pub type LPNETRESOURCEA = *mut NETRESOURCEA;
STRUCT!{struct NETRESOURCEW {
    dwScope: DWORD,
    dwType: DWORD,
    dwDisplayType: DWORD,
    dwUsage: DWORD,
    lpLocalName: LPWSTR,
    lpRemoteName: LPWSTR,
    lpComment: LPWSTR,
    lpProvider: LPWSTR,
}}
pub type LPNETRESOURCEW = *mut NETRESOURCEW;
pub const NETPROPERTY_PERSISTENT: DWORD = 1;
pub const CONNECT_UPDATE_PROFILE: DWORD = 0x00000001;
pub const CONNECT_UPDATE_RECENT: DWORD = 0x00000002;
pub const CONNECT_TEMPORARY: DWORD = 0x00000004;
pub const CONNECT_INTERACTIVE: DWORD = 0x00000008;
pub const CONNECT_PROMPT: DWORD = 0x00000010;
pub const CONNECT_NEED_DRIVE: DWORD = 0x00000020;
pub const CONNECT_REFCOUNT: DWORD = 0x00000040;
pub const CONNECT_REDIRECT: DWORD = 0x00000080;
pub const CONNECT_LOCALDRIVE: DWORD = 0x00000100;
pub const CONNECT_CURRENT_MEDIA: DWORD = 0x00000200;
pub const CONNECT_DEFERRED: DWORD = 0x00000400;
pub const CONNECT_RESERVED: DWORD = 0xFF000000;
pub const CONNECT_COMMANDLINE: DWORD = 0x00000800;
pub const CONNECT_CMD_SAVECRED: DWORD = 0x00001000;
pub const CONNECT_CRED_RESET: DWORD = 0x00002000;
extern "system" {
    pub fn WNetAddConnection2A(
        lpNetResource: LPNETRESOURCEA,
        lpPassword: LPCSTR,
        lpUsername: LPCSTR,
        dwFlags: DWORD,
    ) -> DWORD;
    pub fn WNetAddConnection2W(
        lpNetResource: LPNETRESOURCEW,
        lpPassword: LPCWSTR,
        lpUsername: LPCWSTR,
        dwFlags: DWORD,
    ) -> DWORD;
    pub fn WNetAddConnection3A(
        hwndOwner: HWND,
        lpNetResource: LPNETRESOURCEA,
        lpPassword: LPCSTR,
        lpUsername: LPCSTR,
        dwFlags: DWORD,
    ) -> DWORD;
    pub fn WNetAddConnection3W(
        hwndOwner: HWND,
        lpNetResource: LPNETRESOURCEW,
        lpPassword: LPCWSTR,
        lpUsername: LPCWSTR,
        dwFlags: DWORD,
    ) -> DWORD;
    pub fn WNetCancelConnectionA(
        lpName: LPCSTR,
        fForce: BOOL,
    ) -> DWORD;
    pub fn WNetCancelConnectionW(
        lpName: LPCWSTR,
        fForce: BOOL,
    ) -> DWORD;
    pub fn WNetCancelConnection2A(
        lpName: LPCSTR,
        dwFlags: DWORD,
        fForce: BOOL,
    ) -> DWORD;
    pub fn WNetCancelConnection2W(
        lpName: LPCWSTR,
        dwFlags: DWORD,
        fForce: BOOL,
    ) -> DWORD;
    pub fn WNetGetConnectionA(
        lpLocalName: LPCSTR,
        lpRemoteName: LPSTR,
        lpnLength: LPDWORD,
    ) -> DWORD;
    pub fn WNetGetConnectionW(
        lpLocalName: LPCWSTR,
        lpRemoteName: LPWSTR,
        lpnLength: LPDWORD,
    ) -> DWORD;
    pub fn WNetUseConnectionA(
        hwndOwner: HWND,
        lpNetResource: LPNETRESOURCEA,
        lpPassword: LPCSTR,
        lpUserId: LPCSTR,
        dwFlags: DWORD,
        lpAccessName: LPSTR,
        lpBufferSize: LPDWORD,
        lpResult: LPDWORD,
    ) -> DWORD;
    pub fn WNetUseConnectionW(
        hwndOwner: HWND,
        lpNetResource: LPNETRESOURCEW,
        lpPassword: LPCWSTR,
        lpUserId: LPCWSTR,
        dwFlags: DWORD,
        lpAccessName: LPWSTR,
        lpBufferSize: LPDWORD,
        lpResult: LPDWORD,
    ) -> DWORD;
    pub fn WNetConnectionDialog(
        hwnd: HWND,
        dwType: DWORD,
    ) -> DWORD;
    pub fn WNetDisconnectDialog(
        hwnd: HWND,
        dwType: DWORD,
    ) -> DWORD;
}
STRUCT!{struct CONNECTDLGSTRUCTA {
    cbStructure: DWORD,
    hwndOwner: HWND,
    lpConnRes: LPNETRESOURCEA,
    dwFlags: DWORD,
    dwDevNum: DWORD,
}}
pub type LPCONNECTDLGSTRUCTA = *mut CONNECTDLGSTRUCTA;
STRUCT!{struct CONNECTDLGSTRUCTW {
    cbStructure: DWORD,
    hwndOwner: HWND,
    lpConnRes: LPNETRESOURCEW,
    dwFlags: DWORD,
    dwDevNum: DWORD,
}}
pub type LPCONNECTDLGSTRUCTW = *mut CONNECTDLGSTRUCTW;
pub const CONNDLG_RO_PATH: DWORD = 0x00000001;
pub const CONNDLG_CONN_POINT: DWORD = 0x00000002;
pub const CONNDLG_USE_MRU: DWORD = 0x00000004;
pub const CONNDLG_HIDE_BOX: DWORD = 0x00000008;
pub const CONNDLG_PERSIST: DWORD = 0x00000010;
pub const CONNDLG_NOT_PERSIST: DWORD = 0x00000020;
extern "system" {
    pub fn WNetConnectionDialog1A(
        lpConnDlgStruct: LPCONNECTDLGSTRUCTA,
    ) -> DWORD;
    pub fn WNetConnectionDialog1W(
        lpConnDlgStruct: LPCONNECTDLGSTRUCTW,
    ) -> DWORD;
}
STRUCT!{struct DISCDLGSTRUCTA {
    cbStructure: DWORD,
    hwndOwner: HWND,
    lpLocalName: LPSTR,
    lpRemoteName: LPSTR,
    dwFlags: DWORD,
}}
pub type LPDISCDLGSTRUCTA = *mut DISCDLGSTRUCTA;
STRUCT!{struct DISCDLGSTRUCTW {
    cbStructure: DWORD,
    hwndOwner: HWND,
    lpLocalName: LPWSTR,
    lpRemoteName: LPWSTR,
    dwFlags: DWORD,
}}
pub type LPDISCDLGSTRUCTW = *mut DISCDLGSTRUCTW;
pub const DISC_UPDATE_PROFILE: DWORD = 0x00000001;
pub const DISC_NO_FORCE: DWORD = 0x00000040;
extern "system" {
    pub fn WNetDisconnectDialog1A(
        lpConnDlgStruct: LPDISCDLGSTRUCTA,
    ) -> DWORD;
    pub fn WNetDisconnectDialog1W(
        lpConnDlgStruct: LPDISCDLGSTRUCTW,
    ) -> DWORD;
    pub fn WNetOpenEnumA(
        dwScope: DWORD,
        dwType: DWORD,
        dwUsage: DWORD,
        lpNetResource: LPNETRESOURCEA,
        lphEnum: LPHANDLE,
    ) -> DWORD;
    pub fn WNetOpenEnumW(
        dwScope: DWORD,
        dwType: DWORD,
        dwUsage: DWORD,
        lpNetResource: LPNETRESOURCEW,
        lphEnum: LPHANDLE,
    ) -> DWORD;
    pub fn WNetEnumResourceA(
        hEnum: HANDLE,
        lpcCount: LPDWORD,
        lpBuffer: LPVOID,
        lpBufferSize: LPDWORD,
    ) -> DWORD;
    pub fn WNetEnumResourceW(
        hEnum: HANDLE,
        lpcCount: LPDWORD,
        lpBuffer: LPVOID,
        lpBufferSize: LPDWORD,
    ) -> DWORD;
    pub fn WNetCloseEnum(
        hEnum: HANDLE,
    ) -> DWORD;
    pub fn WNetGetResourceParentA(
        lpNetResource: LPNETRESOURCEA,
        lpBuffer: LPVOID,
        lpcbBuffer: LPDWORD,
    ) -> DWORD;
    pub fn WNetGetResourceParentW(
        lpNetResource: LPNETRESOURCEW,
        lpBuffer: LPVOID,
        lpcbBuffer: LPDWORD,
    ) -> DWORD;
    pub fn WNetGetResourceInformationA(
        lpNetResource: LPNETRESOURCEA,
        lpBuffer: LPVOID,
        lpcbBuffer: LPDWORD,
        lplpSystem: *mut LPSTR,
    ) -> DWORD;
    pub fn WNetGetResourceInformationW(
        lpNetResource: LPNETRESOURCEW,
        lpBuffer: LPVOID,
        lpcbBuffer: LPDWORD,
        lplpSystem: *mut LPWSTR,
    ) -> DWORD;
}
pub const UNIVERSAL_NAME_INFO_LEVEL: DWORD = 0x00000001;
pub const REMOTE_NAME_INFO_LEVEL: DWORD = 0x00000002;
STRUCT!{struct UNIVERSAL_NAME_INFOA {
    lpUniversalName: LPSTR,
}}
pub type LPUNIVERSAL_NAME_INFOA = *mut UNIVERSAL_NAME_INFOA;
STRUCT!{struct UNIVERSAL_NAME_INFOW {
    lpUniversalName: LPWSTR,
}}
pub type LPUNIVERSAL_NAME_INFOW = *mut UNIVERSAL_NAME_INFOW;
STRUCT!{struct REMOTE_NAME_INFOA {
    lpUniversalName: LPSTR,
    lpConnectionName: LPSTR,
    lpRemainingPath: LPSTR,
}}
pub type LPREMOTE_NAME_INFOA = *mut REMOTE_NAME_INFOA;
STRUCT!{struct REMOTE_NAME_INFOW {
    lpUniversalName: LPWSTR,
    lpConnectionName: LPWSTR,
    lpRemainingPath: LPWSTR,
}}
pub type LPREMOTE_NAME_INFOW = *mut REMOTE_NAME_INFOW;
extern "system" {
    pub fn WNetGetUniversalNameA(
        lpLocalPath: LPCSTR,
        dwInfoLevel: DWORD,
        lpBuffer: LPVOID,
        lpBufferSize: LPDWORD,
    ) -> DWORD;
    pub fn WNetGetUniversalNameW(
        lpLocalPath: LPCWSTR,
        dwInfoLevel: DWORD,
        lpBuffer: LPVOID,
        lpBufferSize: LPDWORD,
    ) -> DWORD;
    pub fn WNetGetUserA(
        lpName: LPCSTR,
        lpUserName: LPSTR,
        lpnLength: LPDWORD,
    ) -> DWORD;
    pub fn WNetGetUserW(
        lpName: LPCWSTR,
        lpUserName: LPWSTR,
        lpnLength: LPDWORD,
    ) -> DWORD;
}
pub const WNFMT_MULTILINE: DWORD = 0x01;
pub const WNFMT_ABBREVIATED: DWORD = 0x02;
pub const WNFMT_INENUM: DWORD = 0x10;
pub const WNFMT_CONNECTION: DWORD = 0x20;
extern "system" {
    pub fn WNetGetProviderNameA(
        dwNetType: DWORD,
        lpProviderName: LPSTR,
        lpBufferSize: LPDWORD,
    ) -> DWORD;
    pub fn WNetGetProviderNameW(
        dwNetType: DWORD,
        lpProviderName: LPWSTR,
        lpBufferSize: LPDWORD,
    ) -> DWORD;
}
STRUCT!{struct NETINFOSTRUCT {
    cbStructure: DWORD,
    dwProviderVersion: DWORD,
    dwStatus: DWORD,
    dwCharacteristics: DWORD,
    dwHandle: ULONG_PTR,
    wNetType: WORD,
    dwPrinters: DWORD,
    dwDrives: DWORD,
}}
pub type LPNETINFOSTRUCT = *mut NETINFOSTRUCT;
pub const NETINFO_DLL16: DWORD = 0x00000001;
pub const NETINFO_DISKRED: DWORD = 0x00000004;
pub const NETINFO_PRINTERRED: DWORD = 0x00000008;
extern "system" {
    pub fn WNetGetNetworkInformationA(
        lpProvider: LPCSTR,
        lpNetInfoStruct: LPNETINFOSTRUCT,
    ) -> DWORD;
    pub fn WNetGetNetworkInformationW(
        lpProvider: LPCWSTR,
        lpNetInfoStruct: LPNETINFOSTRUCT,
    ) -> DWORD;
    pub fn WNetGetLastErrorA(
        lpError: LPDWORD,
        lpErrorBuf: LPSTR,
        nErrorBufSize: DWORD,
        lpNameBuf: LPSTR,
        nNameBufSize: DWORD,
    ) -> DWORD;
    pub fn WNetGetLastErrorW(
        lpError: LPDWORD,
        lpErrorBuf: LPWSTR,
        nErrorBufSize: DWORD,
        lpNameBuf: LPWSTR,
        nNameBufSize: DWORD,
    ) -> DWORD;
}
pub const WN_SUCCESS: DWORD = NO_ERROR;
pub const WN_NO_ERROR: DWORD = NO_ERROR;
pub const WN_NOT_SUPPORTED: DWORD = ERROR_NOT_SUPPORTED;
pub const WN_CANCEL: DWORD = ERROR_CANCELLED;
pub const WN_RETRY: DWORD = ERROR_RETRY;
pub const WN_NET_ERROR: DWORD = ERROR_UNEXP_NET_ERR;
pub const WN_MORE_DATA: DWORD = ERROR_MORE_DATA;
pub const WN_BAD_POINTER: DWORD = ERROR_INVALID_ADDRESS;
pub const WN_BAD_VALUE: DWORD = ERROR_INVALID_PARAMETER;
pub const WN_BAD_USER: DWORD = ERROR_BAD_USERNAME;
pub const WN_BAD_PASSWORD: DWORD = ERROR_INVALID_PASSWORD;
pub const WN_ACCESS_DENIED: DWORD = ERROR_ACCESS_DENIED;
pub const WN_FUNCTION_BUSY: DWORD = ERROR_BUSY;
pub const WN_WINDOWS_ERROR: DWORD = ERROR_UNEXP_NET_ERR;
pub const WN_OUT_OF_MEMORY: DWORD = ERROR_NOT_ENOUGH_MEMORY;
pub const WN_NO_NETWORK: DWORD = ERROR_NO_NETWORK;
pub const WN_EXTENDED_ERROR: DWORD = ERROR_EXTENDED_ERROR;
pub const WN_BAD_LEVEL: DWORD = ERROR_INVALID_LEVEL;
pub const WN_BAD_HANDLE: DWORD = ERROR_INVALID_HANDLE;
pub const WN_NOT_INITIALIZING: DWORD = ERROR_ALREADY_INITIALIZED;
pub const WN_NO_MORE_DEVICES: DWORD = ERROR_NO_MORE_DEVICES;
pub const WN_NOT_CONNECTED: DWORD = ERROR_NOT_CONNECTED;
pub const WN_OPEN_FILES: DWORD = ERROR_OPEN_FILES;
pub const WN_DEVICE_IN_USE: DWORD = ERROR_DEVICE_IN_USE;
pub const WN_BAD_NETNAME: DWORD = ERROR_BAD_NET_NAME;
pub const WN_BAD_LOCALNAME: DWORD = ERROR_BAD_DEVICE;
pub const WN_ALREADY_CONNECTED: DWORD = ERROR_ALREADY_ASSIGNED;
pub const WN_DEVICE_ERROR: DWORD = ERROR_GEN_FAILURE;
pub const WN_CONNECTION_CLOSED: DWORD = ERROR_CONNECTION_UNAVAIL;
pub const WN_NO_NET_OR_BAD_PATH: DWORD = ERROR_NO_NET_OR_BAD_PATH;
pub const WN_BAD_PROVIDER: DWORD = ERROR_BAD_PROVIDER;
pub const WN_CANNOT_OPEN_PROFILE: DWORD = ERROR_CANNOT_OPEN_PROFILE;
pub const WN_BAD_PROFILE: DWORD = ERROR_BAD_PROFILE;
pub const WN_BAD_DEV_TYPE: DWORD = ERROR_BAD_DEV_TYPE;
pub const WN_DEVICE_ALREADY_REMEMBERED: DWORD = ERROR_DEVICE_ALREADY_REMEMBERED;
pub const WN_CONNECTED_OTHER_PASSWORD: DWORD = ERROR_CONNECTED_OTHER_PASSWORD;
pub const WN_CONNECTED_OTHER_PASSWORD_DEFAULT: DWORD = ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT;
pub const WN_NO_MORE_ENTRIES: DWORD = ERROR_NO_MORE_ITEMS;
pub const WN_NOT_CONTAINER: DWORD = ERROR_NOT_CONTAINER;
pub const WN_NOT_AUTHENTICATED: DWORD = ERROR_NOT_AUTHENTICATED;
pub const WN_NOT_LOGGED_ON: DWORD = ERROR_NOT_LOGGED_ON;
pub const WN_NOT_VALIDATED: DWORD = ERROR_NO_LOGON_SERVERS;
STRUCT!{struct NETCONNECTINFOSTRUCT {
    cbStructure: DWORD,
    dwFlags: DWORD,
    dwSpeed: DWORD,
    dwDelay: DWORD,
    dwOptDataSize: DWORD,
}}
pub type LPNETCONNECTINFOSTRUCT = *mut NETCONNECTINFOSTRUCT;
pub const WNCON_FORNETCARD: DWORD = 0x00000001;
pub const WNCON_NOTROUTED: DWORD = 0x00000002;
pub const WNCON_SLOWLINK: DWORD = 0x00000004;
pub const WNCON_DYNAMIC: DWORD = 0x00000008;
extern "system" {
    pub fn MultinetGetConnectionPerformanceA(
        lpNetResource: LPNETRESOURCEA,
        lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT,
    ) -> DWORD;
    pub fn MultinetGetConnectionPerformanceW(
        lpNetResource: LPNETRESOURCEW,
        lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT,
    ) -> DWORD;
}