1 /***********************************************************************\ 2 * lmaccess.d * 3 * * 4 * Windows API header module * 5 * * 6 * Translated from MinGW Windows headers * 7 * * 8 * Placed into public domain * 9 \***********************************************************************/ 10 module windows.lmaccess; 11 pragma(lib, "netapi32"); 12 nothrow: 13 /** 14 Changes relative to MinGW: 15 USER_POSIX_ID_PARMNUM and GROUP_POSIX_ID_PARMNUM aren't in MinGW or in 16 the Platform SDK docs, so they have been dropped from this file. 17 */ 18 19 private import windows.lmcons, windows.windef; 20 21 const wchar[] 22 GROUP_SPECIALGRP_USERS = "USERS", 23 GROUP_SPECIALGRP_ADMINS = "ADMINS", 24 GROUP_SPECIALGRP_GUESTS = "GUESTS", 25 GROUP_SPECIALGRP_LOCAL = "LOCAL"; 26 27 const ACCESS_LETTERS = "RWCXDAP "; 28 29 const NETLOGON_CONTROL_QUERY=1; 30 const NETLOGON_CONTROL_REPLICATE=2; 31 const NETLOGON_CONTROL_SYNCHRONIZE=3; 32 const NETLOGON_CONTROL_PDC_REPLICATE=4; 33 const NETLOGON_CONTROL_REDISCOVER=5; 34 const NETLOGON_CONTROL_TC_QUERY=6; 35 const NETLOGON_CONTROL_BACKUP_CHANGE_LOG=65532; 36 const NETLOGON_CONTROL_TRUNCATE_LOG=65533; 37 const NETLOGON_CONTROL_SET_DBFLAG=65534; 38 const NETLOGON_CONTROL_BREAKPOINT=65535; 39 40 const UF_SCRIPT=1; 41 const UF_ACCOUNTDISABLE=2; 42 const UF_HOMEDIR_REQUIRED=8; 43 const UF_LOCKOUT=16; 44 const UF_PASSWD_NOTREQD=32; 45 const UF_PASSWD_CANT_CHANGE=64; 46 const UF_TEMP_DUPLICATE_ACCOUNT=256; 47 const UF_NORMAL_ACCOUNT=512; 48 const UF_INTERDOMAIN_TRUST_ACCOUNT=2048; 49 const UF_WORKSTATION_TRUST_ACCOUNT=4096; 50 const UF_SERVER_TRUST_ACCOUNT=8192; 51 const UF_MNS_LOGON_ACCOUNT=131072; 52 const UF_MACHINE_ACCOUNT_MASK=UF_INTERDOMAIN_TRUST_ACCOUNT|UF_WORKSTATION_TRUST_ACCOUNT|UF_SERVER_TRUST_ACCOUNT; 53 const UF_ACCOUNT_TYPE_MASK=UF_TEMP_DUPLICATE_ACCOUNT|UF_NORMAL_ACCOUNT|UF_INTERDOMAIN_TRUST_ACCOUNT|UF_WORKSTATION_TRUST_ACCOUNT|UF_SERVER_TRUST_ACCOUNT; 54 const UF_DONT_EXPIRE_PASSWD=65536; 55 const UF_SETTABLE_BITS=UF_SCRIPT|UF_ACCOUNTDISABLE|UF_LOCKOUT|UF_HOMEDIR_REQUIRED|UF_PASSWD_NOTREQD|UF_PASSWD_CANT_CHANGE|UF_ACCOUNT_TYPE_MASK|UF_DONT_EXPIRE_PASSWD; 56 57 const FILTER_TEMP_DUPLICATE_ACCOUNT=1; 58 const FILTER_NORMAL_ACCOUNT=2; 59 const FILTER_INTERDOMAIN_TRUST_ACCOUNT=8; 60 const FILTER_WORKSTATION_TRUST_ACCOUNT=16; 61 const FILTER_SERVER_TRUST_ACCOUNT=32; 62 63 const LG_INCLUDE_INDIRECT=1; 64 65 const AF_OP_PRINT=1; 66 const AF_OP_COMM=2; 67 const AF_OP_SERVER=4; 68 const AF_OP_ACCOUNTS=8; 69 const AF_SETTABLE_BITS=(AF_OP_PRINT|AF_OP_COMM|AF_OP_SERVER|AF_OP_ACCOUNTS); 70 71 const UAS_ROLE_STANDALONE=0; 72 const UAS_ROLE_MEMBER=1; 73 const UAS_ROLE_BACKUP=2; 74 const UAS_ROLE_PRIMARY=3; 75 76 const USER_NAME_PARMNUM=1; 77 const USER_PASSWORD_PARMNUM=3; 78 const USER_PASSWORD_AGE_PARMNUM=4; 79 const USER_PRIV_PARMNUM=5; 80 const USER_HOME_DIR_PARMNUM=6; 81 const USER_COMMENT_PARMNUM=7; 82 const USER_FLAGS_PARMNUM=8; 83 const USER_SCRIPT_PATH_PARMNUM=9; 84 const USER_AUTH_FLAGS_PARMNUM=10; 85 const USER_FULL_NAME_PARMNUM=11; 86 const USER_USR_COMMENT_PARMNUM=12; 87 const USER_PARMS_PARMNUM=13; 88 const USER_WORKSTATIONS_PARMNUM=14; 89 const USER_LAST_LOGON_PARMNUM=15; 90 const USER_LAST_LOGOFF_PARMNUM=16; 91 const USER_ACCT_EXPIRES_PARMNUM=17; 92 const USER_MAX_STORAGE_PARMNUM=18; 93 const USER_UNITS_PER_WEEK_PARMNUM=19; 94 const USER_LOGON_HOURS_PARMNUM=20; 95 const USER_PAD_PW_COUNT_PARMNUM=21; 96 const USER_NUM_LOGONS_PARMNUM=22; 97 const USER_LOGON_SERVER_PARMNUM=23; 98 const USER_COUNTRY_CODE_PARMNUM=24; 99 const USER_CODE_PAGE_PARMNUM=25; 100 const USER_PRIMARY_GROUP_PARMNUM=51; 101 const USER_PROFILE=52; 102 const USER_PROFILE_PARMNUM=52; 103 const USER_HOME_DIR_DRIVE_PARMNUM=53; 104 105 const USER_NAME_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_NAME_PARMNUM; 106 const USER_PASSWORD_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_PASSWORD_PARMNUM; 107 const USER_PASSWORD_AGE_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_PASSWORD_AGE_PARMNUM; 108 const USER_PRIV_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_PRIV_PARMNUM; 109 const USER_HOME_DIR_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_HOME_DIR_PARMNUM; 110 const USER_COMMENT_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_COMMENT_PARMNUM; 111 const USER_FLAGS_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_FLAGS_PARMNUM; 112 const USER_SCRIPT_PATH_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_SCRIPT_PATH_PARMNUM; 113 const USER_AUTH_FLAGS_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_AUTH_FLAGS_PARMNUM; 114 const USER_FULL_NAME_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_FULL_NAME_PARMNUM; 115 const USER_USR_COMMENT_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_USR_COMMENT_PARMNUM; 116 const USER_PARMS_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_PARMS_PARMNUM; 117 const USER_WORKSTATIONS_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_WORKSTATIONS_PARMNUM; 118 const USER_LAST_LOGON_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_LAST_LOGON_PARMNUM; 119 const USER_LAST_LOGOFF_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_LAST_LOGOFF_PARMNUM; 120 const USER_ACCT_EXPIRES_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_ACCT_EXPIRES_PARMNUM; 121 const USER_MAX_STORAGE_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_MAX_STORAGE_PARMNUM; 122 const USER_UNITS_PER_WEEK_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_UNITS_PER_WEEK_PARMNUM; 123 const USER_LOGON_HOURS_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_LOGON_HOURS_PARMNUM; 124 const USER_PAD_PW_COUNT_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_PAD_PW_COUNT_PARMNUM; 125 const USER_NUM_LOGONS_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_NUM_LOGONS_PARMNUM; 126 const USER_LOGON_SERVER_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_LOGON_SERVER_PARMNUM; 127 const USER_COUNTRY_CODE_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_COUNTRY_CODE_PARMNUM; 128 const USER_CODE_PAGE_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_CODE_PAGE_PARMNUM; 129 const USER_PRIMARY_GROUP_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_PRIMARY_GROUP_PARMNUM; 130 // USER_POSIX_ID_PARMNUM isn't in MinGW or in the Platform SDK docs. 131 //const USER_POSIX_ID_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_POSIX_ID_PARMNUM; 132 const USER_HOME_DIR_DRIVE_INFOLEVEL = PARMNUM_BASE_INFOLEVEL+USER_HOME_DIR_DRIVE_PARMNUM; 133 134 const NULL_USERSETINFO_PASSWD=" "; 135 const ULONG TIMEQ_FOREVER=-1; 136 const ULONG USER_MAXSTORAGE_UNLIMITED=-1; 137 const ULONG USER_NO_LOGOFF=-1; 138 const UNITS_PER_DAY=24; 139 const UNITS_PER_WEEK=168; 140 const USER_PRIV_MASK=3; 141 const USER_PRIV_GUEST=0; 142 const USER_PRIV_USER=1; 143 const USER_PRIV_ADMIN=2; 144 const MAX_PASSWD_LEN=PWLEN; 145 const DEF_MIN_PWLEN=6; 146 const DEF_PWUNIQUENESS=5; 147 const DEF_MAX_PWHIST=8; 148 const DEF_MAX_PWAGE=TIMEQ_FOREVER; 149 const DEF_MIN_PWAGE=0; 150 const ULONG DEF_FORCE_LOGOFF=0xffffffff; 151 const DEF_MAX_BADPW=0; 152 const ONE_DAY=86400; 153 const VALIDATED_LOGON=0; 154 const PASSWORD_EXPIRED=2; 155 const NON_VALIDATED_LOGON=3; 156 const VALID_LOGOFF=1; 157 158 const MODALS_MIN_PASSWD_LEN_PARMNUM=1; 159 const MODALS_MAX_PASSWD_AGE_PARMNUM=2; 160 const MODALS_MIN_PASSWD_AGE_PARMNUM=3; 161 const MODALS_FORCE_LOGOFF_PARMNUM=4; 162 const MODALS_PASSWD_HIST_LEN_PARMNUM=5; 163 const MODALS_ROLE_PARMNUM=6; 164 const MODALS_PRIMARY_PARMNUM=7; 165 const MODALS_DOMAIN_NAME_PARMNUM=8; 166 const MODALS_DOMAIN_ID_PARMNUM=9; 167 const MODALS_LOCKOUT_DURATION_PARMNUM=10; 168 const MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM=11; 169 const MODALS_LOCKOUT_THRESHOLD_PARMNUM=12; 170 171 const MODALS_MIN_PASSWD_LEN_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_MIN_PASSWD_LEN_PARMNUM); 172 const MODALS_MAX_PASSWD_AGE_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_MAX_PASSWD_AGE_PARMNUM); 173 const MODALS_MIN_PASSWD_AGE_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_MIN_PASSWD_AGE_PARMNUM); 174 const MODALS_FORCE_LOGOFF_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_FORCE_LOGOFF_PARMNUM); 175 const MODALS_PASSWD_HIST_LEN_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_PASSWD_HIST_LEN_PARMNUM); 176 const MODALS_ROLE_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_ROLE_PARMNUM); 177 const MODALS_PRIMARY_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_PRIMARY_PARMNUM); 178 const MODALS_DOMAIN_NAME_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_DOMAIN_NAME_PARMNUM); 179 const MODALS_DOMAIN_ID_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+MODALS_DOMAIN_ID_PARMNUM); 180 181 const GROUPIDMASK=0x8000; 182 const GROUP_ALL_PARMNUM=0; 183 const GROUP_NAME_PARMNUM=1; 184 const GROUP_COMMENT_PARMNUM=2; 185 const GROUP_ATTRIBUTES_PARMNUM=3; 186 187 const GROUP_ALL_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + GROUP_ALL_PARMNUM; 188 const GROUP_NAME_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + GROUP_NAME_PARMNUM; 189 const GROUP_COMMENT_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + GROUP_COMMENT_PARMNUM; 190 const GROUP_ATTRIBUTES_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + GROUP_ATTRIBUTES_PARMNUM; 191 // GROUP_POSIX_ID_PARMNUM isn't in MinGW or in the Platform SDK docs. 192 //const GROUP_POSIX_ID_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + GROUP_POSIX_ID_PARMNUM; 193 194 const LOCALGROUP_NAME_PARMNUM=1; 195 const LOCALGROUP_COMMENT_PARMNUM=2; 196 const MAXPERMENTRIES=64; 197 const ACCESS_NONE=0; 198 const ACCESS_READ=1; 199 const ACCESS_WRITE=2; 200 const ACCESS_CREATE=4; 201 const ACCESS_EXEC=8; 202 const ACCESS_DELETE=16; 203 const ACCESS_ATRIB=32; 204 const ACCESS_PERM=64; 205 const ACCESS_ALL = ACCESS_READ|ACCESS_WRITE|ACCESS_CREATE|ACCESS_EXEC|ACCESS_DELETE|ACCESS_ATRIB|ACCESS_PERM; 206 const ACCESS_GROUP=0x8000; 207 const ACCESS_AUDIT=1; 208 const ACCESS_SUCCESS_OPEN=16; 209 const ACCESS_SUCCESS_WRITE=32; 210 const ACCESS_SUCCESS_DELETE=64; 211 const ACCESS_SUCCESS_ACL=128; 212 const ACCESS_SUCCESS_MASK=240; 213 const ACCESS_FAIL_OPEN=256; 214 const ACCESS_FAIL_WRITE=512; 215 const ACCESS_FAIL_DELETE=1024; 216 const ACCESS_FAIL_ACL=2048; 217 const ACCESS_FAIL_MASK=3840; 218 const ACCESS_FAIL_SHIFT=4; 219 const ACCESS_RESOURCE_NAME_PARMNUM=1; 220 const ACCESS_ATTR_PARMNUM=2; 221 const ACCESS_COUNT_PARMNUM=3; 222 const ACCESS_ACCESS_LIST_PARMNUM=4; 223 224 const ACCESS_RESOURCE_NAME_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+ACCESS_RESOURCE_NAME_PARMNUM); 225 const ACCESS_ATTR_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+ACCESS_ATTR_PARMNUM); 226 const ACCESS_COUNT_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+ACCESS_COUNT_PARMNUM); 227 const ACCESS_ACCESS_LIST_INFOLEVEL=(PARMNUM_BASE_INFOLEVEL+ACCESS_ACCESS_LIST_PARMNUM); 228 229 const NETLOGON_REPLICATION_NEEDED=1; 230 const NETLOGON_REPLICATION_IN_PROGRESS=2; 231 const NETLOGON_FULL_SYNC_REPLICATION=4; 232 const NETLOGON_REDO_NEEDED=8; 233 234 struct USER_INFO_0 { 235 LPWSTR usri0_name; 236 } 237 alias USER_INFO_0* PUSER_INFO_0, LPUSER_INFO_0; 238 239 struct USER_INFO_1{ 240 LPWSTR usri1_name; 241 LPWSTR usri1_password; 242 DWORD usri1_password_age; 243 DWORD usri1_priv; 244 LPWSTR usri1_home_dir; 245 LPWSTR usri1_comment; 246 DWORD usri1_flags; 247 LPWSTR usri1_script_path; 248 } 249 alias USER_INFO_1* PUSER_INFO_1, LPUSER_INFO_1; 250 251 struct USER_INFO_2{ 252 LPWSTR usri2_name; 253 LPWSTR usri2_password; 254 DWORD usri2_password_age; 255 DWORD usri2_priv; 256 LPWSTR usri2_home_dir; 257 LPWSTR usri2_comment; 258 DWORD usri2_flags; 259 LPWSTR usri2_script_path; 260 DWORD usri2_auth_flags; 261 LPWSTR usri2_full_name; 262 LPWSTR usri2_usr_comment; 263 LPWSTR usri2_parms; 264 LPWSTR usri2_workstations; 265 DWORD usri2_last_logon; 266 DWORD usri2_last_logoff; 267 DWORD usri2_acct_expires; 268 DWORD usri2_max_storage; 269 DWORD usri2_units_per_week; 270 PBYTE usri2_logon_hours; 271 DWORD usri2_bad_pw_count; 272 DWORD usri2_num_logons; 273 LPWSTR usri2_logon_server; 274 DWORD usri2_country_code; 275 DWORD usri2_code_page; 276 } 277 alias USER_INFO_2* PUSER_INFO_2, LPUSER_INFO_2; 278 279 struct USER_INFO_3{ 280 LPWSTR usri3_name; 281 LPWSTR usri3_password; 282 DWORD usri3_password_age; 283 DWORD usri3_priv; 284 LPWSTR usri3_home_dir; 285 LPWSTR usri3_comment; 286 DWORD usri3_flags; 287 LPWSTR usri3_script_path; 288 DWORD usri3_auth_flags; 289 LPWSTR usri3_full_name; 290 LPWSTR usri3_usr_comment; 291 LPWSTR usri3_parms; 292 LPWSTR usri3_workstations; 293 DWORD usri3_last_logon; 294 DWORD usri3_last_logoff; 295 DWORD usri3_acct_expires; 296 DWORD usri3_max_storage; 297 DWORD usri3_units_per_week; 298 PBYTE usri3_logon_hours; 299 DWORD usri3_bad_pw_count; 300 DWORD usri3_num_logons; 301 LPWSTR usri3_logon_server; 302 DWORD usri3_country_code; 303 DWORD usri3_code_page; 304 DWORD usri3_user_id; 305 DWORD usri3_primary_group_id; 306 LPWSTR usri3_profile; 307 LPWSTR usri3_home_dir_drive; 308 DWORD usri3_password_expired; 309 } 310 alias USER_INFO_3* PUSER_INFO_3, LPUSER_INFO_3; 311 312 struct USER_INFO_4 { 313 LPWSTR usri4_name; 314 LPWSTR usri4_password; 315 DWORD usri4_password_age; 316 DWORD usri4_priv; 317 LPWSTR usri4_home_dir; 318 LPWSTR usri4_comment; 319 DWORD usri4_flags; 320 LPWSTR usri4_script_path; 321 DWORD usri4_auth_flags; 322 LPWSTR usri4_full_name; 323 LPWSTR usri4_usr_comment; 324 LPWSTR usri4_parms; 325 LPWSTR usri4_workstations; 326 DWORD usri4_last_logon; 327 DWORD usri4_last_logoff; 328 DWORD usri4_acct_expires; 329 DWORD usri4_max_storage; 330 DWORD usri4_units_per_week; 331 PBYTE usri4_logon_hours; 332 DWORD usri4_bad_pw_count; 333 DWORD usri4_num_logons; 334 LPWSTR usri4_logon_server; 335 DWORD usri4_country_code; 336 DWORD usri4_code_page; 337 PSID usri4_user_sid; 338 DWORD usri4_primary_group_id; 339 LPWSTR usri4_profile; 340 LPWSTR usri4_home_dir_drive; 341 DWORD usri4_password_expired; 342 } 343 alias USER_INFO_4* PUSER_INFO_4, LPUSER_INFO_4; 344 345 346 struct USER_INFO_10{ 347 LPWSTR usri10_name; 348 LPWSTR usri10_comment; 349 LPWSTR usri10_usr_comment; 350 LPWSTR usri10_full_name; 351 } 352 alias USER_INFO_10* PUSER_INFO_10, LPUSER_INFO_10; 353 354 struct USER_INFO_11{ 355 LPWSTR usri11_name; 356 LPWSTR usri11_comment; 357 LPWSTR usri11_usr_comment; 358 LPWSTR usri11_full_name; 359 DWORD usri11_priv; 360 DWORD usri11_auth_flags; 361 DWORD usri11_password_age; 362 LPWSTR usri11_home_dir; 363 LPWSTR usri11_parms; 364 DWORD usri11_last_logon; 365 DWORD usri11_last_logoff; 366 DWORD usri11_bad_pw_count; 367 DWORD usri11_num_logons; 368 LPWSTR usri11_logon_server; 369 DWORD usri11_country_code; 370 LPWSTR usri11_workstations; 371 DWORD usri11_max_storage; 372 DWORD usri11_units_per_week; 373 PBYTE usri11_logon_hours; 374 DWORD usri11_code_page; 375 } 376 alias USER_INFO_11* PUSER_INFO_11, LPUSER_INFO_11; 377 378 struct USER_INFO_20 { 379 LPWSTR usri20_name; 380 LPWSTR usri20_full_name; 381 LPWSTR usri20_comment; 382 DWORD usri20_flags; 383 DWORD usri20_user_id; 384 } 385 alias USER_INFO_20* PUSER_INFO_20, LPUSER_INFO_20; 386 387 struct USER_INFO_21 { 388 BYTE[ENCRYPTED_PWLEN] usri21_password; 389 } 390 alias USER_INFO_21* PUSER_INFO_21, LPUSER_INFO_21; 391 392 struct USER_INFO_22{ 393 LPWSTR usri22_name; 394 BYTE[ENCRYPTED_PWLEN] usri22_password; 395 DWORD usri22_password_age; 396 DWORD usri22_priv; 397 LPWSTR usri22_home_dir; 398 LPWSTR usri22_comment; 399 DWORD usri22_flags; 400 LPWSTR usri22_script_path; 401 DWORD usri22_auth_flags; 402 LPWSTR usri22_full_name; 403 LPWSTR usri22_usr_comment; 404 LPWSTR usri22_parms; 405 LPWSTR usri22_workstations; 406 DWORD usri22_last_logon; 407 DWORD usri22_last_logoff; 408 DWORD usri22_acct_expires; 409 DWORD usri22_max_storage; 410 DWORD usri22_units_per_week; 411 PBYTE usri22_logon_hours; 412 DWORD usri22_bad_pw_count; 413 DWORD usri22_num_logons; 414 LPWSTR usri22_logon_server; 415 DWORD usri22_country_code; 416 DWORD usri22_code_page; 417 } 418 alias USER_INFO_22* PUSER_INFO_22, LPUSER_INFO_22; 419 420 struct USER_INFO_1003{ 421 LPWSTR usri1003_password; 422 } 423 alias USER_INFO_1003* PUSER_INFO_1003, LPUSER_INFO_1003; 424 425 struct USER_INFO_1005{ 426 DWORD usri1005_priv; 427 } 428 alias USER_INFO_1005* PUSER_INFO_1005, LPUSER_INFO_1005; 429 430 struct USER_INFO_1006{ 431 LPWSTR usri1006_home_dir; 432 } 433 alias USER_INFO_1006* PUSER_INFO_1006, LPUSER_INFO_1006; 434 435 struct USER_INFO_1007{ 436 LPWSTR usri1007_comment; 437 } 438 alias USER_INFO_1007* PUSER_INFO_1007, LPUSER_INFO_1007; 439 440 struct USER_INFO_1008{ 441 DWORD usri1008_flags; 442 } 443 alias USER_INFO_1008* PUSER_INFO_1008, LPUSER_INFO_1008; 444 445 struct USER_INFO_1009{ 446 LPWSTR usri1009_script_path; 447 } 448 alias USER_INFO_1009* PUSER_INFO_1009, LPUSER_INFO_1009; 449 450 struct USER_INFO_1010{ 451 DWORD usri1010_auth_flags; 452 } 453 alias USER_INFO_1010* PUSER_INFO_1010, LPUSER_INFO_1010; 454 455 struct USER_INFO_1011{ 456 LPWSTR usri1011_full_name; 457 } 458 alias USER_INFO_1011* PUSER_INFO_1011, LPUSER_INFO_1011; 459 460 struct USER_INFO_1012{ 461 LPWSTR usri1012_usr_comment; 462 } 463 alias USER_INFO_1012* PUSER_INFO_1012, LPUSER_INFO_1012; 464 465 struct USER_INFO_1013{ 466 LPWSTR usri1013_parms; 467 } 468 alias USER_INFO_1013* PUSER_INFO_1013, LPUSER_INFO_1013; 469 470 struct USER_INFO_1014{ 471 LPWSTR usri1014_workstations; 472 } 473 alias USER_INFO_1014* PUSER_INFO_1014, LPUSER_INFO_1014; 474 475 struct USER_INFO_1017{ 476 DWORD usri1017_acct_expires; 477 } 478 alias USER_INFO_1017* PUSER_INFO_1017, LPUSER_INFO_1017; 479 480 struct USER_INFO_1018{ 481 DWORD usri1018_max_storage; 482 } 483 alias USER_INFO_1018* PUSER_INFO_1018, LPUSER_INFO_1018; 484 485 struct USER_INFO_1020{ 486 DWORD usri1020_units_per_week; 487 PBYTE usri1020_logon_hours; 488 } 489 alias USER_INFO_1020* PUSER_INFO_1020, LPUSER_INFO_1020; 490 491 struct USER_INFO_1023{ 492 LPWSTR usri1023_logon_server; 493 } 494 alias USER_INFO_1023* PUSER_INFO_1023, LPUSER_INFO_1023; 495 496 struct USER_INFO_1024{ 497 DWORD usri1024_country_code; 498 } 499 alias USER_INFO_1024* PUSER_INFO_1024, LPUSER_INFO_1024; 500 501 struct USER_INFO_1025{ 502 DWORD usri1025_code_page; 503 } 504 alias USER_INFO_1025* PUSER_INFO_1025, LPUSER_INFO_1025; 505 506 struct USER_INFO_1051{ 507 DWORD usri1051_primary_group_id; 508 } 509 alias USER_INFO_1051* PUSER_INFO_1051, LPUSER_INFO_1051; 510 511 struct USER_INFO_1052{ 512 LPWSTR usri1052_profile; 513 } 514 alias USER_INFO_1052* PUSER_INFO_1052, LPUSER_INFO_1052; 515 516 struct USER_INFO_1053{ 517 LPWSTR usri1053_home_dir_drive; 518 } 519 alias USER_INFO_1053* PUSER_INFO_1053, LPUSER_INFO_1053; 520 521 struct USER_MODALS_INFO_0{ 522 DWORD usrmod0_min_passwd_len; 523 DWORD usrmod0_max_passwd_age; 524 DWORD usrmod0_min_passwd_age; 525 DWORD usrmod0_force_logoff; 526 DWORD usrmod0_password_hist_len; 527 } 528 alias USER_MODALS_INFO_0* PUSER_MODALS_INFO_0, LPUSER_MODALS_INFO_0; 529 530 struct USER_MODALS_INFO_1{ 531 DWORD usrmod1_role; 532 LPWSTR usrmod1_primary; 533 } 534 alias USER_MODALS_INFO_1* PUSER_MODALS_INFO_1, LPUSER_MODALS_INFO_1; 535 536 struct USER_MODALS_INFO_2{ 537 LPWSTR usrmod2_domain_name; 538 PSID usrmod2_domain_id; 539 } 540 alias USER_MODALS_INFO_2* PUSER_MODALS_INFO_2, LPUSER_MODALS_INFO_2; 541 542 struct USER_MODALS_INFO_3{ 543 DWORD usrmod3_lockout_duration; 544 DWORD usrmod3_lockout_observation_window; 545 DWORD usrmod3_lockout_threshold; 546 } 547 alias USER_MODALS_INFO_3* PUSER_MODALS_INFO_3, LPUSER_MODALS_INFO_3; 548 549 struct USER_MODALS_INFO_1001{ 550 DWORD usrmod1001_min_passwd_len; 551 } 552 alias USER_MODALS_INFO_1001* PUSER_MODALS_INFO_1001, LPUSER_MODALS_INFO_1001; 553 554 struct USER_MODALS_INFO_1002{ 555 DWORD usrmod1002_max_passwd_age; 556 } 557 alias USER_MODALS_INFO_1002* PUSER_MODALS_INFO_1002, LPUSER_MODALS_INFO_1002; 558 559 struct USER_MODALS_INFO_1003{ 560 DWORD usrmod1003_min_passwd_age; 561 } 562 alias USER_MODALS_INFO_1003* PUSER_MODALS_INFO_1003, LPUSER_MODALS_INFO_1003; 563 564 struct USER_MODALS_INFO_1004{ 565 DWORD usrmod1004_force_logoff; 566 } 567 alias USER_MODALS_INFO_1004* PUSER_MODALS_INFO_1004, LPUSER_MODALS_INFO_1004; 568 569 struct USER_MODALS_INFO_1005{ 570 DWORD usrmod1005_password_hist_len; 571 } 572 alias USER_MODALS_INFO_1005* PUSER_MODALS_INFO_1005, LPUSER_MODALS_INFO_1005; 573 574 struct USER_MODALS_INFO_1006{ 575 DWORD usrmod1006_role; 576 } 577 alias USER_MODALS_INFO_1006* PUSER_MODALS_INFO_1006, LPUSER_MODALS_INFO_1006; 578 579 struct USER_MODALS_INFO_1007{ 580 LPWSTR usrmod1007_primary; 581 } 582 alias USER_MODALS_INFO_1007* PUSER_MODALS_INFO_1007, LPUSER_MODALS_INFO_1007; 583 584 struct GROUP_INFO_0{ 585 LPWSTR grpi0_name; 586 } 587 alias GROUP_INFO_0* PGROUP_INFO_0, LPGROUP_INFO_0; 588 589 struct GROUP_INFO_1{ 590 LPWSTR grpi1_name; 591 LPWSTR grpi1_comment; 592 } 593 alias GROUP_INFO_1* PGROUP_INFO_1, LPGROUP_INFO_1; 594 595 struct GROUP_INFO_2{ 596 LPWSTR grpi2_name; 597 LPWSTR grpi2_comment; 598 DWORD grpi2_group_id; 599 DWORD grpi2_attributes; 600 } 601 alias GROUP_INFO_2* PGROUP_INFO_2; 602 603 struct GROUP_INFO_1002{ 604 LPWSTR grpi1002_comment; 605 } 606 alias GROUP_INFO_1002* PGROUP_INFO_1002, LPGROUP_INFO_1002; 607 608 struct GROUP_INFO_1005{ 609 DWORD grpi1005_attributes; 610 } 611 alias GROUP_INFO_1005* PGROUP_INFO_1005, LPGROUP_INFO_1005; 612 613 struct GROUP_USERS_INFO_0{ 614 LPWSTR grui0_name; 615 } 616 alias GROUP_USERS_INFO_0* PGROUP_USERS_INFO_0, LPGROUP_USERS_INFO_0; 617 618 struct GROUP_USERS_INFO_1{ 619 LPWSTR grui1_name; 620 DWORD grui1_attributes; 621 } 622 alias GROUP_USERS_INFO_1* PGROUP_USERS_INFO_1, LPGROUP_USERS_INFO_1; 623 624 struct LOCALGROUP_INFO_0{ 625 LPWSTR lgrpi0_name; 626 } 627 alias LOCALGROUP_INFO_0* PLOCALGROUP_INFO_0, LPLOCALGROUP_INFO_0; 628 629 struct LOCALGROUP_INFO_1{ 630 LPWSTR lgrpi1_name; 631 LPWSTR lgrpi1_comment; 632 } 633 alias LOCALGROUP_INFO_1* PLOCALGROUP_INFO_1, LPLOCALGROUP_INFO_1; 634 635 struct LOCALGROUP_INFO_1002{ 636 LPWSTR lgrpi1002_comment; 637 } 638 alias LOCALGROUP_INFO_1002* PLOCALGROUP_INFO_1002, LPLOCALGROUP_INFO_1002; 639 640 struct LOCALGROUP_MEMBERS_INFO_0{ 641 PSID lgrmi0_sid; 642 } 643 alias LOCALGROUP_MEMBERS_INFO_0* PLOCALGROUP_MEMBERS_INFO_0, LPLOCALGROUP_MEMBERS_INFO_0; 644 645 struct LOCALGROUP_MEMBERS_INFO_1{ 646 PSID lgrmi1_sid; 647 SID_NAME_USE lgrmi1_sidusage; 648 LPWSTR lgrmi1_name; 649 } 650 alias LOCALGROUP_MEMBERS_INFO_1* PLOCALGROUP_MEMBERS_INFO_1, LPLOCALGROUP_MEMBERS_INFO_1; 651 652 struct LOCALGROUP_MEMBERS_INFO_2{ 653 PSID lgrmi2_sid; 654 SID_NAME_USE lgrmi2_sidusage; 655 LPWSTR lgrmi2_domainandname; 656 } 657 alias LOCALGROUP_MEMBERS_INFO_2* PLOCALGROUP_MEMBERS_INFO_2, LPLOCALGROUP_MEMBERS_INFO_2; 658 659 struct LOCALGROUP_MEMBERS_INFO_3{ 660 LPWSTR lgrmi3_domainandname; 661 } 662 alias LOCALGROUP_MEMBERS_INFO_3* PLOCALGROUP_MEMBERS_INFO_3, LPLOCALGROUP_MEMBERS_INFO_3; 663 664 struct LOCALGROUP_USERS_INFO_0{ 665 LPWSTR lgrui0_name; 666 } 667 alias LOCALGROUP_USERS_INFO_0* PLOCALGROUP_USERS_INFO_0, LPLOCALGROUP_USERS_INFO_0; 668 669 struct NET_DISPLAY_USER{ 670 LPWSTR usri1_name; 671 LPWSTR usri1_comment; 672 DWORD usri1_flags; 673 LPWSTR usri1_full_name; 674 DWORD usri1_user_id; 675 DWORD usri1_next_index; 676 } 677 alias NET_DISPLAY_USER* PNET_DISPLAY_USER; 678 679 struct NET_DISPLAY_MACHINE{ 680 LPWSTR usri2_name; 681 LPWSTR usri2_comment; 682 DWORD usri2_flags; 683 DWORD usri2_user_id; 684 DWORD usri2_next_index; 685 } 686 alias NET_DISPLAY_MACHINE* PNET_DISPLAY_MACHINE; 687 688 struct NET_DISPLAY_GROUP{ 689 LPWSTR grpi3_name; 690 LPWSTR grpi3_comment; 691 DWORD grpi3_group_id; 692 DWORD grpi3_attributes; 693 DWORD grpi3_next_index; 694 } 695 alias NET_DISPLAY_GROUP* PNET_DISPLAY_GROUP; 696 697 struct ACCESS_INFO_0{ 698 LPTSTR acc0_resource_name; 699 } 700 alias ACCESS_INFO_0* PACCESS_INFO_0, LPACCESS_INFO_0; 701 702 struct ACCESS_INFO_1{ 703 LPTSTR acc1_resource_name; 704 DWORD acc1_attr; 705 DWORD acc1_count; 706 } 707 alias ACCESS_INFO_1* PACCESS_INFO_1, LPACCESS_INFO_1; 708 709 struct ACCESS_INFO_1002{ 710 DWORD acc1002_attr; 711 } 712 alias ACCESS_INFO_1002* PACCESS_INFO_1002, LPACCESS_INFO_1002; 713 714 struct ACCESS_LIST{ 715 LPTSTR acl_ugname; 716 DWORD acl_access; 717 } 718 alias ACCESS_LIST* PACCESS_LIST, LPACCESS_LIST; 719 720 struct NETLOGON_INFO_1{ 721 DWORD netlog1_flags; 722 NET_API_STATUS netlog1_pdc_connection_status; 723 } 724 alias NETLOGON_INFO_1* PNETLOGON_INFO_1; 725 726 struct NETLOGON_INFO_2{ 727 DWORD netlog2_flags; 728 NET_API_STATUS netlog2_pdc_connection_status; 729 LPWSTR netlog2_trusted_dc_name; 730 NET_API_STATUS netlog2_tc_connection_status; 731 } 732 alias NETLOGON_INFO_2* PNETLOGON_INFO_2; 733 734 struct NETLOGON_INFO_3{ 735 DWORD netlog3_flags; 736 DWORD netlog3_logon_attempts; 737 DWORD netlog3_reserved1; 738 DWORD netlog3_reserved2; 739 DWORD netlog3_reserved3; 740 DWORD netlog3_reserved4; 741 DWORD netlog3_reserved5; 742 } 743 alias NETLOGON_INFO_3* PNETLOGON_INFO_3; 744 745 extern (Windows) { 746 deprecated { 747 /* These are obsolete */ 748 NET_API_STATUS NetAccessAdd(LPCWSTR,DWORD,PBYTE,PDWORD); 749 NET_API_STATUS NetAccessEnum(LPCWSTR,LPCWSTR,DWORD,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 750 NET_API_STATUS NetAccessGetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE*); 751 NET_API_STATUS NetAccessSetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE,PDWORD); 752 NET_API_STATUS NetAccessDel(LPCWSTR,LPCWSTR); 753 NET_API_STATUS NetAccessGetUserPerms(LPCWSTR,LPCWSTR,LPCWSTR,PDWORD); 754 } 755 NET_API_STATUS NetUserAdd(LPCWSTR,DWORD,PBYTE,PDWORD); 756 NET_API_STATUS NetUserEnum(LPCWSTR,DWORD,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 757 NET_API_STATUS NetUserGetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE*); 758 NET_API_STATUS NetUserSetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE,PDWORD); 759 NET_API_STATUS NetUserDel(LPCWSTR,LPCWSTR); 760 NET_API_STATUS NetUserGetGroups(LPCWSTR,LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD); 761 NET_API_STATUS NetUserSetGroups(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); 762 NET_API_STATUS NetUserGetLocalGroups(LPCWSTR,LPCWSTR,DWORD,DWORD,PBYTE*,DWORD,PDWORD,PDWORD); 763 NET_API_STATUS NetUserModalsGet(LPCWSTR,DWORD,PBYTE*); 764 NET_API_STATUS NetUserModalsSet(LPCWSTR,DWORD,PBYTE,PDWORD); 765 NET_API_STATUS NetUserChangePassword(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR); 766 NET_API_STATUS NetGroupAdd(LPCWSTR,DWORD,PBYTE,PDWORD); 767 NET_API_STATUS NetGroupAddUser(LPCWSTR,LPCWSTR,LPCWSTR); 768 NET_API_STATUS NetGroupEnum(LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 769 NET_API_STATUS NetGroupGetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE*); 770 NET_API_STATUS NetGroupSetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE,PDWORD); 771 NET_API_STATUS NetGroupDel(LPCWSTR,LPCWSTR); 772 NET_API_STATUS NetGroupDelUser(LPCWSTR,LPCWSTR,LPCWSTR); 773 NET_API_STATUS NetGroupGetUsers(LPCWSTR,LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 774 NET_API_STATUS NetGroupSetUsers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); 775 NET_API_STATUS NetLocalGroupAdd(LPCWSTR,DWORD,PBYTE,PDWORD); 776 NET_API_STATUS NetLocalGroupAddMember(LPCWSTR,LPCWSTR,PSID); 777 NET_API_STATUS NetLocalGroupEnum(LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); 778 NET_API_STATUS NetLocalGroupGetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE*); 779 NET_API_STATUS NetLocalGroupSetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE,PDWORD); 780 NET_API_STATUS NetLocalGroupDel(LPCWSTR,LPCWSTR); 781 NET_API_STATUS NetLocalGroupDelMember(LPCWSTR,LPCWSTR,PSID); 782 NET_API_STATUS NetLocalGroupGetMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE*,DWORD, 783 PDWORD,PDWORD,PDWORD); 784 NET_API_STATUS NetLocalGroupSetMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); 785 NET_API_STATUS NetLocalGroupAddMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); 786 NET_API_STATUS NetLocalGroupDelMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); 787 NET_API_STATUS NetQueryDisplayInformation(LPCWSTR,DWORD,DWORD,DWORD,DWORD,PDWORD,PVOID*); 788 NET_API_STATUS NetGetDisplayInformationIndex(LPCWSTR,DWORD,LPCWSTR,PDWORD); 789 NET_API_STATUS NetGetDCName(LPCWSTR,LPCWSTR,PBYTE*); 790 NET_API_STATUS NetGetAnyDCName(LPCWSTR,LPCWSTR,PBYTE*); 791 NET_API_STATUS I_NetLogonControl(LPCWSTR,DWORD,DWORD,PBYTE*); 792 NET_API_STATUS I_NetLogonControl2(LPCWSTR,DWORD,DWORD,PBYTE,PBYTE*); 793 }