The OpenD Programming Language

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