1 /***********************************************************************\
2 * lmuse.d *
3 * *
4 * Windows API header module *
5 * *
6 * Translated from MinGW Windows headers *
7 * *
8 * Placed into public domain *
9 \***********************************************************************/
10 module win32.lmuse;
11 version(Windows):
12 pragma(lib, "netapi32");
13
14 import win32.lmuseflg;
15 private import win32.lmcons, win32.windef;
16
17 enum {
18 USE_LOCAL_PARMNUM = 1,
19 USE_REMOTE_PARMNUM,
20 USE_PASSWORD_PARMNUM,
21 USE_ASGTYPE_PARMNUM,
22 USE_USERNAME_PARMNUM,
23 USE_DOMAINNAME_PARMNUM
24 }
25
26 enum {
27 USE_OK,
28 USE_PAUSED,
29 USE_SESSLOST,
30 USE_DISCONN = USE_SESSLOST,
31 USE_NETERR,
32 USE_CONN,
33 USE_RECONN
34 }
35
36 const DWORD USE_WILDCARD = -1;
37
38 enum {
39 USE_DISKDEV,
40 USE_SPOOLDEV,
41 USE_CHARDEV,
42 USE_IPC
43 }
44
45 struct USE_INFO_0 {
46 LPWSTR ui0_local;
47 LPWSTR ui0_remote;
48 }
49 alias USE_INFO_0* PUSE_INFO_0, LPUSE_INFO_0;
50
51 struct USE_INFO_1 {
52 LPWSTR ui1_local;
53 LPWSTR ui1_remote;
54 LPWSTR ui1_password;
55 DWORD ui1_status;
56 DWORD ui1_asg_type;
57 DWORD ui1_refcount;
58 DWORD ui1_usecount;
59 }
60 alias USE_INFO_1* PUSE_INFO_1, LPUSE_INFO_1;
61
62 struct USE_INFO_2 {
63 LPWSTR ui2_local;
64 LPWSTR ui2_remote;
65 LPWSTR ui2_password;
66 DWORD ui2_status;
67 DWORD ui2_asg_type;
68 DWORD ui2_refcount;
69 DWORD ui2_usecount;
70 LPWSTR ui2_username;
71 LPWSTR ui2_domainname;
72 }
73 alias USE_INFO_2* PUSE_INFO_2, LPUSE_INFO_2;
74
75 extern (Windows) {
76 NET_API_STATUS NetUseAdd(LPWSTR, DWORD, PBYTE, PDWORD);
77 NET_API_STATUS NetUseDel(LPWSTR, LPWSTR, DWORD);
78 NET_API_STATUS NetUseEnum(LPWSTR, DWORD, PBYTE*, DWORD, PDWORD, PDWORD,
79 PDWORD);
80 NET_API_STATUS NetUseGetInfo(LPWSTR, LPWSTR, DWORD, PBYTE*);
81 }