| 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 |
| 7 |
use shared::lmcons::{LMSTR, NET_API_STATUS}; |
| 8 |
use shared::minwindef::{DWORD, LPBYTE, LPDWORD, PBYTE, ULONG}; |
| 9 |
use um::winnt::LPWSTR; |
| 10 |
extern "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 |
} |
| 38 |
STRUCT!{struct USE_INFO_0 { |
| 39 |
ui0_local: LMSTR, |
| 40 |
ui0_remote: LMSTR, |
| 41 |
}} |
| 42 |
pub type PUSE_INFO_0 = *mut USE_INFO_0; |
| 43 |
pub type LPUSE_INFO_0 = *mut USE_INFO_0; |
| 44 |
STRUCT!{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 |
}} |
| 53 |
pub type PUSE_INFO_1 = *mut USE_INFO_1; |
| 54 |
pub type LPUSE_INFO_1 = *mut USE_INFO_1; |
| 55 |
STRUCT!{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 |
}} |
| 66 |
pub type PUSE_INFO_2 = *mut USE_INFO_2; |
| 67 |
pub type LPUSE_INFO_2 = *mut USE_INFO_2; |
| 68 |
STRUCT!{struct USE_INFO_3 { |
| 69 |
ui3_ui2: USE_INFO_2, |
| 70 |
ui3_flags: ULONG, |
| 71 |
}} |
| 72 |
pub type PUSE_INFO_3 = *mut USE_INFO_3; |
| 73 |
STRUCT!{struct USE_INFO_4 { |
| 74 |
ui4_ui3: USE_INFO_3, |
| 75 |
ui4_auth_identity_length: DWORD, |
| 76 |
ui4_auth_identity: PBYTE, |
| 77 |
}} |
| 78 |
pub type PUSE_INFO_4 = *mut USE_INFO_4; |
| 79 |
pub type LPUSE_INFO_4 = *mut USE_INFO_4; |
| 80 |
pub const USE_LOCAL_PARMNUM: DWORD = 1; |
| 81 |
pub const USE_REMOTE_PARMNUM: DWORD = 2; |
| 82 |
pub const USE_PASSWORD_PARMNUM: DWORD = 3; |
| 83 |
pub const USE_ASGTYPE_PARMNUM: DWORD = 4; |
| 84 |
pub const USE_USERNAME_PARMNUM: DWORD = 5; |
| 85 |
pub const USE_DOMAINNAME_PARMNUM: DWORD = 6; |
| 86 |
pub const USE_OK: DWORD = 0; |
| 87 |
pub const USE_PAUSED: DWORD = 1; |
| 88 |
pub const USE_SESSLOST: DWORD = 2; |
| 89 |
pub const USE_DISCONN: DWORD = 2; |
| 90 |
pub const USE_NETERR: DWORD = 3; |
| 91 |
pub const USE_CONN: DWORD = 4; |
| 92 |
pub const USE_RECONN: DWORD = 5; |
| 93 |
pub const USE_WILDCARD: DWORD = -1i32 as u32; |
| 94 |
pub const USE_DISKDEV: DWORD = 0; |
| 95 |
pub const USE_SPOOLDEV: DWORD = 1; |
| 96 |
pub const USE_CHARDEV: DWORD = 2; |
| 97 |
pub const USE_IPC: DWORD = 3; |
| 98 |
pub const CREATE_NO_CONNECT: ULONG = 0x1; |
| 99 |
pub const CREATE_BYPASS_CSC: ULONG = 0x2; |
| 100 |
pub const CREATE_CRED_RESET: ULONG = 0x4; |
| 101 |
pub const USE_DEFAULT_CREDENTIALS: ULONG = 0x4; |