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 pragma(lib, "netapi32.lib"); 12 13 import win32.lmuseflg; 14 private import win32.lmcons, win32.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 const 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 }