1 /***********************************************************************\ 2 * lmwksta.d * 3 * * 4 * Windows API header module * 5 * * 6 * Translated from MinGW Windows headers * 7 * * 8 * Placed into public domain * 9 \***********************************************************************/ 10 module win32.lmwksta; 11 version(Windows): 12 pragma(lib, "netapi32"); 13 14 import win32.lmuseflg; 15 private import win32.lmcons, win32.windef; 16 17 pragma(lib, "Netapi32"); 18 19 enum { 20 WKSTA_COMPUTERNAME_PARMNUM = 1, 21 WKSTA_LANGROUP_PARMNUM, // = 2 22 WKSTA_VER_MAJOR_PARMNUM = 4, 23 WKSTA_VER_MINOR_PARMNUM, 24 WKSTA_LOGGED_ON_USERS_PARMNUM, 25 WKSTA_LANROOT_PARMNUM, 26 WKSTA_LOGON_DOMAIN_PARMNUM, 27 WKSTA_LOGON_SERVER_PARMNUM, 28 WKSTA_CHARWAIT_PARMNUM, 29 WKSTA_CHARTIME_PARMNUM, 30 WKSTA_CHARCOUNT_PARMNUM, 31 WKSTA_KEEPCONN_PARMNUM, 32 WKSTA_KEEPSEARCH_PARMNUM, 33 WKSTA_MAXCMDS_PARMNUM, 34 WKSTA_NUMWORKBUF_PARMNUM, 35 WKSTA_MAXWRKCACHE_PARMNUM, 36 WKSTA_SESSTIMEOUT_PARMNUM, 37 WKSTA_SIZERROR_PARMNUM, 38 WKSTA_NUMALERTS_PARMNUM, 39 WKSTA_NUMSERVICES_PARMNUM, 40 WKSTA_NUMCHARBUF_PARMNUM, 41 WKSTA_SIZCHARBUF_PARMNUM, // = 23 42 WKSTA_ERRLOGSZ_PARMNUM = 27, 43 WKSTA_PRINTBUFTIME_PARMNUM, 44 WKSTA_SIZWORKBUF_PARMNUM, 45 WKSTA_MAILSLOTS_PARMNUM, 46 WKSTA_NUMDGRAMBUF_PARMNUM, 47 WKSTA_WRKHEURISTICS_PARMNUM, 48 WKSTA_MAXTHREADS_PARMNUM, // = 33 49 WKSTA_LOCKQUOTA_PARMNUM = 41, 50 WKSTA_LOCKINCREMENT_PARMNUM, 51 WKSTA_LOCKMAXIMUM_PARMNUM, 52 WKSTA_PIPEINCREMENT_PARMNUM, 53 WKSTA_PIPEMAXIMUM_PARMNUM, 54 WKSTA_DORMANTFILELIMIT_PARMNUM, 55 WKSTA_CACHEFILETIMEOUT_PARMNUM, 56 WKSTA_USEOPPORTUNISTICLOCKING_PARMNUM, 57 WKSTA_USEUNLOCKBEHIND_PARMNUM, 58 WKSTA_USECLOSEBEHIND_PARMNUM, 59 WKSTA_BUFFERNAMEDPIPES_PARMNUM, 60 WKSTA_USELOCKANDREADANDUNLOCK_PARMNUM, 61 WKSTA_UTILIZENTCACHING_PARMNUM, 62 WKSTA_USERAWREAD_PARMNUM, 63 WKSTA_USERAWWRITE_PARMNUM, 64 WKSTA_USEWRITERAWWITHDATA_PARMNUM, 65 WKSTA_USEENCRYPTION_PARMNUM, 66 WKSTA_BUFFILESWITHDENYWRITE_PARMNUM, 67 WKSTA_BUFFERREADONLYFILES_PARMNUM, 68 WKSTA_FORCECORECREATEMODE_PARMNUM, 69 WKSTA_USE512BYTESMAXTRANSFER_PARMNUM, 70 WKSTA_READAHEADTHRUPUT_PARMNUM, // = 62 71 WKSTA_PLATFORM_ID_PARMNUM = 100, 72 WKSTA_OTH_DOMAINS_PARMNUM = 101, 73 TRANSPORT_QUALITYOFSERVICE_PARMNUM = 201, 74 TRANSPORT_NAME_PARMNUM = 202 75 } 76 77 struct WKSTA_INFO_100{ 78 DWORD wki100_platform_id; 79 LPWSTR wki100_computername; 80 LPWSTR wki100_langroup; 81 DWORD wki100_ver_major; 82 DWORD wki100_ver_minor; 83 } 84 alias WKSTA_INFO_100* PWKSTA_INFO_100, LPWKSTA_INFO_100; 85 86 struct WKSTA_INFO_101{ 87 DWORD wki101_platform_id; 88 LPWSTR wki101_computername; 89 LPWSTR wki101_langroup; 90 DWORD wki101_ver_major; 91 DWORD wki101_ver_minor; 92 LPWSTR wki101_lanroot; 93 } 94 alias WKSTA_INFO_101* PWKSTA_INFO_101, LPWKSTA_INFO_101; 95 96 struct WKSTA_INFO_102{ 97 DWORD wki102_platform_id; 98 LPWSTR wki102_computername; 99 LPWSTR wki102_langroup; 100 DWORD wki102_ver_major; 101 DWORD wki102_ver_minor; 102 LPWSTR wki102_lanroot; 103 DWORD wki102_logged_on_users; 104 } 105 alias WKSTA_INFO_102* PWKSTA_INFO_102, LPWKSTA_INFO_102; 106 107 struct WKSTA_INFO_302{ 108 DWORD wki302_char_wait; 109 DWORD wki302_collection_time; 110 DWORD wki302_maximum_collection_count; 111 DWORD wki302_keep_conn; 112 DWORD wki302_keep_search; 113 DWORD wki302_max_cmds; 114 DWORD wki302_num_work_buf; 115 DWORD wki302_siz_work_buf; 116 DWORD wki302_max_wrk_cache; 117 DWORD wki302_sess_timeout; 118 DWORD wki302_siz_error; 119 DWORD wki302_num_alerts; 120 DWORD wki302_num_services; 121 DWORD wki302_errlog_sz; 122 DWORD wki302_print_buf_time; 123 DWORD wki302_num_char_buf; 124 DWORD wki302_siz_char_buf; 125 LPWSTR wki302_wrk_heuristics; 126 DWORD wki302_mailslots; 127 DWORD wki302_num_dgram_buf; 128 } 129 alias WKSTA_INFO_302* PWKSTA_INFO_302, LPWKSTA_INFO_302; 130 131 struct WKSTA_INFO_402{ 132 DWORD wki402_char_wait; 133 DWORD wki402_collection_time; 134 DWORD wki402_maximum_collection_count; 135 DWORD wki402_keep_conn; 136 DWORD wki402_keep_search; 137 DWORD wki402_max_cmds; 138 DWORD wki402_num_work_buf; 139 DWORD wki402_siz_work_buf; 140 DWORD wki402_max_wrk_cache; 141 DWORD wki402_sess_timeout; 142 DWORD wki402_siz_error; 143 DWORD wki402_num_alerts; 144 DWORD wki402_num_services; 145 DWORD wki402_errlog_sz; 146 DWORD wki402_print_buf_time; 147 DWORD wki402_num_char_buf; 148 DWORD wki402_siz_char_buf; 149 LPWSTR wki402_wrk_heuristics; 150 DWORD wki402_mailslots; 151 DWORD wki402_num_dgram_buf; 152 DWORD wki402_max_threads; 153 } 154 alias WKSTA_INFO_402* PWKSTA_INFO_402, LPWKSTA_INFO_402; 155 156 struct WKSTA_INFO_502{ 157 DWORD wki502_char_wait; 158 DWORD wki502_collection_time; 159 DWORD wki502_maximum_collection_count; 160 DWORD wki502_keep_conn; 161 DWORD wki502_max_cmds; 162 DWORD wki502_sess_timeout; 163 DWORD wki502_siz_char_buf; 164 DWORD wki502_max_threads; 165 DWORD wki502_lock_quota; 166 DWORD wki502_lock_increment; 167 DWORD wki502_lock_maximum; 168 DWORD wki502_pipe_increment; 169 DWORD wki502_pipe_maximum; 170 DWORD wki502_cache_file_timeout; 171 DWORD wki502_dormant_file_limit; 172 DWORD wki502_read_ahead_throughput; 173 DWORD wki502_num_mailslot_buffers; 174 DWORD wki502_num_srv_announce_buffers; 175 DWORD wki502_max_illegal_datagram_events; 176 DWORD wki502_illegal_datagram_event_reset_frequency; 177 BOOL wki502_log_election_packets; 178 BOOL wki502_use_opportunistic_locking; 179 BOOL wki502_use_unlock_behind; 180 BOOL wki502_use_close_behind; 181 BOOL wki502_buf_named_pipes; 182 BOOL wki502_use_lock_read_unlock; 183 BOOL wki502_utilize_nt_caching; 184 BOOL wki502_use_raw_read; 185 BOOL wki502_use_raw_write; 186 BOOL wki502_use_write_raw_data; 187 BOOL wki502_use_encryption; 188 BOOL wki502_buf_files_deny_write; 189 BOOL wki502_buf_read_only_files; 190 BOOL wki502_force_core_create_mode; 191 BOOL wki502_use_512_byte_max_transfer; 192 } 193 alias WKSTA_INFO_502* PWKSTA_INFO_502, LPWKSTA_INFO_502; 194 195 struct WKSTA_INFO_1010 { 196 DWORD wki1010_char_wait; 197 } 198 alias WKSTA_INFO_1010* PWKSTA_INFO_1010, LPWKSTA_INFO_1010; 199 200 struct WKSTA_INFO_1011 { 201 DWORD wki1011_collection_time; 202 } 203 alias WKSTA_INFO_1011* PWKSTA_INFO_1011, LPWKSTA_INFO_1011; 204 205 struct WKSTA_INFO_1012 { 206 DWORD wki1012_maximum_collection_count; 207 } 208 alias WKSTA_INFO_1012* PWKSTA_INFO_1012, LPWKSTA_INFO_1012; 209 210 struct WKSTA_INFO_1027 { 211 DWORD wki1027_errlog_sz; 212 } 213 alias WKSTA_INFO_1027* PWKSTA_INFO_1027, LPWKSTA_INFO_1027; 214 215 struct WKSTA_INFO_1028 { 216 DWORD wki1028_print_buf_time; 217 } 218 alias WKSTA_INFO_1028* PWKSTA_INFO_1028, LPWKSTA_INFO_1028; 219 220 struct WKSTA_INFO_1032 { 221 DWORD wki1032_wrk_heuristics; 222 } 223 alias WKSTA_INFO_1032* PWKSTA_INFO_1032, LPWKSTA_INFO_1032; 224 225 struct WKSTA_INFO_1013 { 226 DWORD wki1013_keep_conn; 227 } 228 alias WKSTA_INFO_1013* PWKSTA_INFO_1013, LPWKSTA_INFO_1013; 229 230 struct WKSTA_INFO_1018 { 231 DWORD wki1018_sess_timeout; 232 } 233 alias WKSTA_INFO_1018* PWKSTA_INFO_1018, LPWKSTA_INFO_1018; 234 235 struct WKSTA_INFO_1023 { 236 DWORD wki1023_siz_char_buf; 237 } 238 alias WKSTA_INFO_1023* PWKSTA_INFO_1023, LPWKSTA_INFO_1023; 239 240 struct WKSTA_INFO_1033 { 241 DWORD wki1033_max_threads; 242 } 243 alias WKSTA_INFO_1033* PWKSTA_INFO_1033, LPWKSTA_INFO_1033; 244 245 struct WKSTA_INFO_1041 { 246 DWORD wki1041_lock_quota; 247 } 248 alias WKSTA_INFO_1041* PWKSTA_INFO_1041, LPWKSTA_INFO_1041; 249 250 struct WKSTA_INFO_1042 { 251 DWORD wki1042_lock_increment; 252 } 253 alias WKSTA_INFO_1042* PWKSTA_INFO_1042, LPWKSTA_INFO_1042; 254 255 struct WKSTA_INFO_1043 { 256 DWORD wki1043_lock_maximum; 257 } 258 alias WKSTA_INFO_1043* PWKSTA_INFO_1043, LPWKSTA_INFO_1043; 259 260 struct WKSTA_INFO_1044 { 261 DWORD wki1044_pipe_increment; 262 } 263 alias WKSTA_INFO_1044* PWKSTA_INFO_1044, LPWKSTA_INFO_1044; 264 265 struct WKSTA_INFO_1045 { 266 DWORD wki1045_pipe_maximum; 267 } 268 alias WKSTA_INFO_1045* PWKSTA_INFO_1045, LPWKSTA_INFO_1045; 269 270 struct WKSTA_INFO_1046 { 271 DWORD wki1046_dormant_file_limit; 272 } 273 alias WKSTA_INFO_1046* PWKSTA_INFO_1046, LPWKSTA_INFO_1046; 274 275 struct WKSTA_INFO_1047 { 276 DWORD wki1047_cache_file_timeout; 277 } 278 alias WKSTA_INFO_1047* PWKSTA_INFO_1047, LPWKSTA_INFO_1047; 279 280 struct WKSTA_INFO_1048 { 281 BOOL wki1048_use_opportunistic_locking; 282 } 283 alias WKSTA_INFO_1048* PWKSTA_INFO_1048, LPWKSTA_INFO_1048; 284 285 struct WKSTA_INFO_1049 { 286 BOOL wki1049_use_unlock_behind; 287 } 288 alias WKSTA_INFO_1049* PWKSTA_INFO_1049, LPWKSTA_INFO_1049; 289 290 struct WKSTA_INFO_1050 { 291 BOOL wki1050_use_close_behind; 292 } 293 alias WKSTA_INFO_1050* PWKSTA_INFO_1050, LPWKSTA_INFO_1050; 294 295 struct WKSTA_INFO_1051 { 296 BOOL wki1051_buf_named_pipes; 297 } 298 alias WKSTA_INFO_1051* PWKSTA_INFO_1051, LPWKSTA_INFO_1051; 299 300 struct WKSTA_INFO_1052 { 301 BOOL wki1052_use_lock_read_unlock; 302 } 303 alias WKSTA_INFO_1052* PWKSTA_INFO_1052, LPWKSTA_INFO_1052; 304 305 struct WKSTA_INFO_1053 { 306 BOOL wki1053_utilize_nt_caching; 307 } 308 alias WKSTA_INFO_1053* PWKSTA_INFO_1053, LPWKSTA_INFO_1053; 309 310 struct WKSTA_INFO_1054 { 311 BOOL wki1054_use_raw_read; 312 } 313 alias WKSTA_INFO_1054* PWKSTA_INFO_1054, LPWKSTA_INFO_1054; 314 315 struct WKSTA_INFO_1055 { 316 BOOL wki1055_use_raw_write; 317 } 318 alias WKSTA_INFO_1055* PWKSTA_INFO_1055, LPWKSTA_INFO_1055; 319 320 struct WKSTA_INFO_1056 { 321 BOOL wki1056_use_write_raw_data; 322 } 323 alias WKSTA_INFO_1056* PWKSTA_INFO_1056, LPWKSTA_INFO_1056; 324 325 struct WKSTA_INFO_1057 { 326 BOOL wki1057_use_encryption; 327 } 328 alias WKSTA_INFO_1057* PWKSTA_INFO_1057, LPWKSTA_INFO_1057; 329 330 struct WKSTA_INFO_1058 { 331 BOOL wki1058_buf_files_deny_write; 332 } 333 alias WKSTA_INFO_1058* PWKSTA_INFO_1058, LPWKSTA_INFO_1058; 334 335 struct WKSTA_INFO_1059 { 336 BOOL wki1059_buf_read_only_files; 337 } 338 alias WKSTA_INFO_1059* PWKSTA_INFO_1059, LPWKSTA_INFO_1059; 339 340 struct WKSTA_INFO_1060 { 341 BOOL wki1060_force_core_create_mode; 342 } 343 alias WKSTA_INFO_1060* PWKSTA_INFO_1060, LPWKSTA_INFO_1060; 344 345 struct WKSTA_INFO_1061 { 346 BOOL wki1061_use_512_byte_max_transfer; 347 } 348 alias WKSTA_INFO_1061* PWKSTA_INFO_1061, LPWKSTA_INFO_1061; 349 350 struct WKSTA_INFO_1062 { 351 DWORD wki1062_read_ahead_throughput; 352 } 353 alias WKSTA_INFO_1062* PWKSTA_INFO_1062, LPWKSTA_INFO_1062; 354 355 struct WKSTA_USER_INFO_0 { 356 LPWSTR wkui0_username; 357 } 358 alias WKSTA_USER_INFO_0* PWKSTA_USER_INFO_0, LPWKSTA_USER_INFO_0; 359 360 struct WKSTA_USER_INFO_1{ 361 LPWSTR wkui1_username; 362 LPWSTR wkui1_logon_domain; 363 LPWSTR wkui1_oth_domains; 364 LPWSTR wkui1_logon_server; 365 } 366 alias WKSTA_USER_INFO_1* PWKSTA_USER_INFO_1, LPWKSTA_USER_INFO_1; 367 368 struct WKSTA_USER_INFO_1101 { 369 LPWSTR wkui1101_oth_domains; 370 } 371 alias WKSTA_USER_INFO_1101* PWKSTA_USER_INFO_1101, LPWKSTA_USER_INFO_1101; 372 373 struct WKSTA_TRANSPORT_INFO_0{ 374 DWORD wkti0_quality_of_service; 375 DWORD wkti0_number_of_vcs; 376 LPWSTR wkti0_transport_name; 377 LPWSTR wkti0_transport_address; 378 BOOL wkti0_wan_ish; 379 } 380 alias WKSTA_TRANSPORT_INFO_0* PWKSTA_TRANSPORT_INFO_0, LPWKSTA_TRANSPORT_INFO_0; 381 382 extern (Windows) { 383 NET_API_STATUS NetWkstaGetInfo(LPWSTR,DWORD,PBYTE*); 384 NET_API_STATUS NetWkstaSetInfo(LPWSTR,DWORD,PBYTE,PDWORD); 385 NET_API_STATUS NetWkstaUserGetInfo(LPWSTR,DWORD,PBYTE*); 386 NET_API_STATUS NetWkstaUserSetInfo(LPWSTR,DWORD,PBYTE,PDWORD); 387 NET_API_STATUS NetWkstaUserEnum(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 388 NET_API_STATUS NetWkstaTransportAdd(LPWSTR,DWORD,PBYTE,PDWORD); 389 NET_API_STATUS NetWkstaTransportDel(LPWSTR,LPWSTR,DWORD); 390 NET_API_STATUS NetWkstaTransportEnum(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 391 }