winapi_ui_automation/um/
lmuse.rs

1// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4// All files in the project carrying such notice may not be copied, modified, or distributed
5// except according to those terms
6//! This file contains structures, function prototypes, and definitions for the NetUse API
7use shared::lmcons::{LMSTR, NET_API_STATUS};
8use shared::minwindef::{DWORD, LPBYTE, LPDWORD, PBYTE, ULONG};
9use um::winnt::LPWSTR;
10extern "system" {
11    pub fn NetUseAdd(
12        servername: LPWSTR,
13        level: DWORD,
14        buf: LPBYTE,
15        parm_err: LPDWORD,
16    ) -> NET_API_STATUS;
17    pub fn NetUseDel(
18        UncServerName: LMSTR,
19        UseName: LMSTR,
20        ForceCond: DWORD,
21    ) -> NET_API_STATUS;
22    pub fn NetUseEnum(
23        UncServerName: LMSTR,
24        Level: DWORD,
25        BufPtr: *mut LPBYTE,
26        PreferedMaximumSize: DWORD,
27        EntriesRead: LPDWORD,
28        TotalEntries: LPDWORD,
29        ResumeHandle: LPDWORD,
30    ) -> NET_API_STATUS;
31    pub fn NetUseGetInfo(
32        UncServerName: LMSTR,
33        UseName: LMSTR,
34        level: DWORD,
35        bufptr: *mut LPBYTE,
36    ) -> NET_API_STATUS;
37}
38STRUCT!{struct USE_INFO_0 {
39    ui0_local: LMSTR,
40    ui0_remote: LMSTR,
41}}
42pub type PUSE_INFO_0 = *mut USE_INFO_0;
43pub type LPUSE_INFO_0 = *mut USE_INFO_0;
44STRUCT!{struct USE_INFO_1 {
45    ui1_local: LMSTR,
46    ui1_remote: LMSTR,
47    ui1_password: LMSTR,
48    ui1_status: DWORD,
49    ui1_asg_type: DWORD,
50    ui1_refcount: DWORD,
51    ui1_usecount: DWORD,
52}}
53pub type PUSE_INFO_1 = *mut USE_INFO_1;
54pub type LPUSE_INFO_1 = *mut USE_INFO_1;
55STRUCT!{struct USE_INFO_2 {
56    ui2_local: LMSTR,
57    ui2_remote: LMSTR,
58    ui2_password: LMSTR,
59    ui2_status: DWORD,
60    ui2_asg_type: DWORD,
61    ui2_refcount: DWORD,
62    ui2_usecount: DWORD,
63    ui2_username: LMSTR,
64    ui2_domainname: LMSTR,
65}}
66pub type PUSE_INFO_2 = *mut USE_INFO_2;
67pub type LPUSE_INFO_2 = *mut USE_INFO_2;
68STRUCT!{struct USE_INFO_3 {
69    ui3_ui2: USE_INFO_2,
70    ui3_flags: ULONG,
71}}
72pub type PUSE_INFO_3 = *mut USE_INFO_3;
73STRUCT!{struct USE_INFO_4 {
74    ui4_ui3: USE_INFO_3,
75    ui4_auth_identity_length: DWORD,
76    ui4_auth_identity: PBYTE,
77}}
78pub type PUSE_INFO_4 = *mut USE_INFO_4;
79pub type LPUSE_INFO_4 = *mut USE_INFO_4;
80pub const USE_LOCAL_PARMNUM: DWORD = 1;
81pub const USE_REMOTE_PARMNUM: DWORD = 2;
82pub const USE_PASSWORD_PARMNUM: DWORD = 3;
83pub const USE_ASGTYPE_PARMNUM: DWORD = 4;
84pub const USE_USERNAME_PARMNUM: DWORD = 5;
85pub const USE_DOMAINNAME_PARMNUM: DWORD = 6;
86pub const USE_OK: DWORD = 0;
87pub const USE_PAUSED: DWORD = 1;
88pub const USE_SESSLOST: DWORD = 2;
89pub const USE_DISCONN: DWORD = 2;
90pub const USE_NETERR: DWORD = 3;
91pub const USE_CONN: DWORD = 4;
92pub const USE_RECONN: DWORD = 5;
93pub const USE_WILDCARD: DWORD = -1i32 as u32;
94pub const USE_DISKDEV: DWORD = 0;
95pub const USE_SPOOLDEV: DWORD = 1;
96pub const USE_CHARDEV: DWORD = 2;
97pub const USE_IPC: DWORD = 3;
98pub const CREATE_NO_CONNECT: ULONG = 0x1;
99pub const CREATE_BYPASS_CSC: ULONG = 0x2;
100pub const CREATE_CRED_RESET: ULONG = 0x4;
101pub const USE_DEFAULT_CREDENTIALS: ULONG = 0x4;