lmshare.d revision 1.1.1.1
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/_lmshare.d) 8 */ 9module core.sys.windows.lmshare; 10version (Windows): 11@system: 12pragma(lib, "netapi32"); 13 14import core.sys.windows.lmcons; 15import core.sys.windows.w32api, core.sys.windows.windef; 16 17 18enum SHARE_NETNAME_PARMNUM = 1; 19enum SHARE_TYPE_PARMNUM = 3; 20enum SHARE_REMARK_PARMNUM = 4; 21enum SHARE_PERMISSIONS_PARMNUM = 5; 22enum SHARE_MAX_USES_PARMNUM = 6; 23enum SHARE_CURRENT_USES_PARMNUM = 7; 24enum SHARE_PATH_PARMNUM = 8; 25enum SHARE_PASSWD_PARMNUM = 9; 26enum SHARE_FILE_SD_PARMNUM = 501; 27enum SHARE_REMARK_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + SHARE_REMARK_PARMNUM; 28enum SHARE_MAX_USES_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + SHARE_MAX_USES_PARMNUM; 29enum SHARE_FILE_SD_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + SHARE_FILE_SD_PARMNUM; 30 31enum SHI1_NUM_ELEMENTS = 4; 32enum SHI2_NUM_ELEMENTS = 10; 33 34enum STYPE_DISKTREE = 0; 35enum STYPE_PRINTQ = 1; 36enum STYPE_DEVICE = 2; 37enum STYPE_IPC = 3; 38enum STYPE_DFS = 100; 39enum STYPE_SPECIAL = 0x80000000; 40 41enum DWORD SHI_USES_UNLIMITED = -1; 42 43enum SESS_GUEST = 1; 44enum SESS_NOENCRYPTION = 2; 45enum SESI1_NUM_ELEMENTS = 8; 46enum SESI2_NUM_ELEMENTS = 9; 47 48enum PERM_FILE_READ = 1; 49enum PERM_FILE_WRITE = 2; 50enum PERM_FILE_CREATE = 4; 51 52struct FILE_INFO_2 { 53 DWORD fi2_id; 54} 55alias FILE_INFO_2* PFILE_INFO_2, LPFILE_INFO_2; 56 57struct FILE_INFO_3 { 58 DWORD fi3_id; 59 DWORD fi3_permissions; 60 DWORD fi3_num_locks; 61 LPTSTR fi3_pathname; 62 LPTSTR fi3_username; 63} 64alias FILE_INFO_3* PFILE_INFO_3, LPFILE_INFO_3; 65 66struct SHARE_INFO_0 { 67 LPTSTR shi0_netname; 68} 69alias SHARE_INFO_0* PSHARE_INFO_0, LPSHARE_INFO_0; 70 71struct SHARE_INFO_1 { 72 LPTSTR shi1_netname; 73 DWORD shi1_type; 74 LPTSTR shi1_remark; 75} 76alias SHARE_INFO_1* PSHARE_INFO_1, LPSHARE_INFO_1; 77 78struct SHARE_INFO_2 { 79 LPTSTR shi2_netname; 80 DWORD shi2_type; 81 LPTSTR shi2_remark; 82 DWORD shi2_permissions; 83 DWORD shi2_max_uses; 84 DWORD shi2_current_uses; 85 LPTSTR shi2_path; 86 LPTSTR shi2_passwd; 87} 88alias SHARE_INFO_2* PSHARE_INFO_2, LPSHARE_INFO_2; 89 90struct SHARE_INFO_502 { 91 LPTSTR shi502_netname; 92 DWORD shi502_type; 93 LPTSTR shi502_remark; 94 DWORD shi502_permissions; 95 DWORD shi502_max_uses; 96 DWORD shi502_current_uses; 97 LPTSTR shi502_path; 98 LPTSTR shi502_passwd; 99 DWORD shi502_reserved; 100 PSECURITY_DESCRIPTOR shi502_security_descriptor; 101} 102alias SHARE_INFO_502* PSHARE_INFO_502, LPSHARE_INFO_502; 103 104struct SHARE_INFO_1004 { 105 LPTSTR shi1004_remark; 106} 107alias SHARE_INFO_1004* PSHARE_INFO_1004, LPSHARE_INFO_1004; 108 109struct SHARE_INFO_1006 { 110 DWORD shi1006_max_uses; 111} 112alias SHARE_INFO_1006* PSHARE_INFO_1006, LPSHARE_INFO_1006; 113 114struct SHARE_INFO_1501 { 115 DWORD shi1501_reserved; 116 PSECURITY_DESCRIPTOR shi1501_security_descriptor; 117} 118alias SHARE_INFO_1501* PSHARE_INFO_1501, LPSHARE_INFO_1501; 119 120struct SESSION_INFO_0 { 121 LPWSTR sesi0_cname; 122} 123alias SESSION_INFO_0* PSESSION_INFO_0, LPSESSION_INFO_0; 124 125struct SESSION_INFO_1 { 126 LPTSTR sesi1_cname; 127 LPTSTR sesi1_username; 128 DWORD sesi1_num_opens; 129 DWORD sesi1_time; 130 DWORD sesi1_idle_time; 131 DWORD sesi1_user_flags; 132} 133alias SESSION_INFO_1* PSESSION_INFO_1, LPSESSION_INFO_1; 134 135struct SESSION_INFO_2 { 136 LPTSTR sesi2_cname; 137 LPTSTR sesi2_username; 138 DWORD sesi2_num_opens; 139 DWORD sesi2_time; 140 DWORD sesi2_idle_time; 141 DWORD sesi2_user_flags; 142 LPWSTR sesi2_cltype_name; 143} 144alias SESSION_INFO_2* PSESSION_INFO_2, LPSESSION_INFO_2; 145 146struct SESSION_INFO_10 { 147 LPWSTR sesi10_cname; 148 LPWSTR sesi10_username; 149 DWORD sesi10_time; 150 DWORD sesi10_idle_time; 151} 152alias SESSION_INFO_10* PSESSION_INFO_10, LPSESSION_INFO_10; 153 154struct SESSION_INFO_502 { 155 LPWSTR sesi502_cname; 156 LPWSTR sesi502_username; 157 DWORD sesi502_num_opens; 158 DWORD sesi502_time; 159 DWORD sesi502_idle_time; 160 DWORD sesi502_user_flags; 161 LPWSTR sesi502_cltype_name; 162 LPWSTR sesi502_transport; 163} 164alias SESSION_INFO_502* PSESSION_INFO_502, LPSESSION_INFO_502; 165 166struct CONNECTION_INFO_0 { 167 DWORD coni0_id; 168} 169alias CONNECTION_INFO_0* PCONNECTION_INFO_0, LPCONNECTION_INFO_0; 170 171struct CONNECTION_INFO_1 { 172 DWORD coni1_id; 173 DWORD coni1_type; 174 DWORD coni1_num_opens; 175 DWORD coni1_num_users; 176 DWORD coni1_time; 177 LPWSTR coni1_username; 178 LPWSTR coni1_netname; 179} 180alias CONNECTION_INFO_1* PCONNECTION_INFO_1, LPCONNECTION_INFO_1; 181 182extern (Windows) { 183NET_API_STATUS NetShareAdd(LPWSTR,DWORD,PBYTE,PDWORD); 184NET_API_STATUS NetShareEnum(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 185NET_API_STATUS NetShareEnumSticky(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD resume_handle); 186NET_API_STATUS NetShareGetInfo(LPWSTR,LPWSTR,DWORD,PBYTE*); 187NET_API_STATUS NetShareSetInfo(LPWSTR,LPWSTR,DWORD,PBYTE,PDWORD); 188NET_API_STATUS NetShareDel(LPWSTR,LPWSTR,DWORD); 189NET_API_STATUS NetShareDelSticky(LPWSTR,LPWSTR,DWORD); 190NET_API_STATUS NetShareCheck(LPWSTR,LPWSTR,PDWORD); 191NET_API_STATUS NetSessionEnum(LPWSTR,LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 192NET_API_STATUS NetSessionDel(LPWSTR,LPWSTR,LPWSTR); 193NET_API_STATUS NetSessionGetInfo(LPWSTR,LPWSTR,LPWSTR,DWORD,PBYTE*); 194NET_API_STATUS NetConnectionEnum(LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 195NET_API_STATUS NetFileClose(LPWSTR,DWORD); 196NET_API_STATUS NetFileEnum(LPWSTR,LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 197NET_API_STATUS NetFileGetInfo(LPWSTR,DWORD,DWORD,PBYTE*); 198} 199