1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef _LMUSER_ 7 #define _LMUSER_ 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 #include <lmcons.h> 14 15 NET_API_STATUS WINAPI NetUserAdd(LPCWSTR servername,DWORD level,LPBYTE buf,LPDWORD parm_err); 16 NET_API_STATUS WINAPI NetUserEnum(LPCWSTR servername,DWORD level,DWORD filter,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries,LPDWORD resume_handle); 17 NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername,LPCWSTR username,DWORD level,LPBYTE *bufptr); 18 NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername,LPCWSTR username,DWORD level,LPBYTE buf,LPDWORD parm_err); 19 NET_API_STATUS WINAPI NetUserDel(LPCWSTR servername,LPCWSTR username); 20 NET_API_STATUS WINAPI NetUserGetGroups(LPCWSTR servername,LPCWSTR username,DWORD level,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries); 21 NET_API_STATUS WINAPI NetUserSetGroups(LPCWSTR servername,LPCWSTR username,DWORD level,LPBYTE buf,DWORD num_entries); 22 NET_API_STATUS WINAPI NetUserGetLocalGroups(LPCWSTR servername,LPCWSTR username,DWORD level,DWORD flags,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries); 23 NET_API_STATUS WINAPI NetUserModalsGet(LPCWSTR servername,DWORD level,LPBYTE *bufptr); 24 NET_API_STATUS WINAPI NetUserModalsSet(LPCWSTR servername,DWORD level,LPBYTE buf,LPDWORD parm_err); 25 NET_API_STATUS WINAPI NetUserChangePassword(LPCWSTR domainname,LPCWSTR username,LPCWSTR oldpassword,LPCWSTR newpassword); 26 27 typedef struct _USER_INFO_0 { 28 LPWSTR usri0_name; 29 } USER_INFO_0,*PUSER_INFO_0,*LPUSER_INFO_0; 30 31 typedef struct _USER_INFO_1 { 32 LPWSTR usri1_name; 33 LPWSTR usri1_password; 34 DWORD usri1_password_age; 35 DWORD usri1_priv; 36 LPWSTR usri1_home_dir; 37 LPWSTR usri1_comment; 38 DWORD usri1_flags; 39 LPWSTR usri1_script_path; 40 } USER_INFO_1,*PUSER_INFO_1,*LPUSER_INFO_1; 41 42 typedef struct _USER_INFO_2 { 43 LPWSTR usri2_name; 44 LPWSTR usri2_password; 45 DWORD usri2_password_age; 46 DWORD usri2_priv; 47 LPWSTR usri2_home_dir; 48 LPWSTR usri2_comment; 49 DWORD usri2_flags; 50 LPWSTR usri2_script_path; 51 DWORD usri2_auth_flags; 52 LPWSTR usri2_full_name; 53 LPWSTR usri2_usr_comment; 54 LPWSTR usri2_parms; 55 LPWSTR usri2_workstations; 56 DWORD usri2_last_logon; 57 DWORD usri2_last_logoff; 58 DWORD usri2_acct_expires; 59 DWORD usri2_max_storage; 60 DWORD usri2_units_per_week; 61 PBYTE usri2_logon_hours; 62 DWORD usri2_bad_pw_count; 63 DWORD usri2_num_logons; 64 LPWSTR usri2_logon_server; 65 DWORD usri2_country_code; 66 DWORD usri2_code_page; 67 } USER_INFO_2,*PUSER_INFO_2,*LPUSER_INFO_2; 68 69 typedef struct _USER_INFO_3 { 70 LPWSTR usri3_name; 71 LPWSTR usri3_password; 72 DWORD usri3_password_age; 73 DWORD usri3_priv; 74 LPWSTR usri3_home_dir; 75 LPWSTR usri3_comment; 76 DWORD usri3_flags; 77 LPWSTR usri3_script_path; 78 DWORD usri3_auth_flags; 79 LPWSTR usri3_full_name; 80 LPWSTR usri3_usr_comment; 81 LPWSTR usri3_parms; 82 LPWSTR usri3_workstations; 83 DWORD usri3_last_logon; 84 DWORD usri3_last_logoff; 85 DWORD usri3_acct_expires; 86 DWORD usri3_max_storage; 87 DWORD usri3_units_per_week; 88 PBYTE usri3_logon_hours; 89 DWORD usri3_bad_pw_count; 90 DWORD usri3_num_logons; 91 LPWSTR usri3_logon_server; 92 DWORD usri3_country_code; 93 DWORD usri3_code_page; 94 DWORD usri3_user_id; 95 DWORD usri3_primary_group_id; 96 LPWSTR usri3_profile; 97 LPWSTR usri3_home_dir_drive; 98 DWORD usri3_password_expired; 99 } USER_INFO_3,*PUSER_INFO_3,*LPUSER_INFO_3; 100 101 typedef struct _USER_INFO_4 { 102 LPWSTR usri4_name; 103 LPWSTR usri4_password; 104 DWORD usri4_password_age; 105 DWORD usri4_priv; 106 LPWSTR usri4_home_dir; 107 LPWSTR usri4_comment; 108 DWORD usri4_flags; 109 LPWSTR usri4_script_path; 110 DWORD usri4_auth_flags; 111 LPWSTR usri4_full_name; 112 LPWSTR usri4_usr_comment; 113 LPWSTR usri4_parms; 114 LPWSTR usri4_workstations; 115 DWORD usri4_last_logon; 116 DWORD usri4_last_logoff; 117 DWORD usri4_acct_expires; 118 DWORD usri4_max_storage; 119 DWORD usri4_units_per_week; 120 PBYTE usri4_logon_hours; 121 DWORD usri4_bad_pw_count; 122 DWORD usri4_num_logons; 123 LPWSTR usri4_logon_server; 124 DWORD usri4_country_code; 125 DWORD usri4_code_page; 126 PSID usri4_user_sid; 127 DWORD usri4_primary_group_id; 128 LPWSTR usri4_profile; 129 LPWSTR usri4_home_dir_drive; 130 DWORD usri4_password_expired; 131 } USER_INFO_4,*PUSER_INFO_4,*LPUSER_INFO_4; 132 133 typedef struct _USER_INFO_10 { 134 LPWSTR usri10_name; 135 LPWSTR usri10_comment; 136 LPWSTR usri10_usr_comment; 137 LPWSTR usri10_full_name; 138 }USER_INFO_10,*PUSER_INFO_10,*LPUSER_INFO_10; 139 140 typedef struct _USER_INFO_11 { 141 LPWSTR usri11_name; 142 LPWSTR usri11_comment; 143 LPWSTR usri11_usr_comment; 144 LPWSTR usri11_full_name; 145 DWORD usri11_priv; 146 DWORD usri11_auth_flags; 147 DWORD usri11_password_age; 148 LPWSTR usri11_home_dir; 149 LPWSTR usri11_parms; 150 DWORD usri11_last_logon; 151 DWORD usri11_last_logoff; 152 DWORD usri11_bad_pw_count; 153 DWORD usri11_num_logons; 154 LPWSTR usri11_logon_server; 155 DWORD usri11_country_code; 156 LPWSTR usri11_workstations; 157 DWORD usri11_max_storage; 158 DWORD usri11_units_per_week; 159 PBYTE usri11_logon_hours; 160 DWORD usri11_code_page; 161 } USER_INFO_11,*PUSER_INFO_11,*LPUSER_INFO_11; 162 163 typedef struct _USER_INFO_20 { 164 LPWSTR usri20_name; 165 LPWSTR usri20_full_name; 166 LPWSTR usri20_comment; 167 DWORD usri20_flags; 168 DWORD usri20_user_id; 169 } USER_INFO_20,*PUSER_INFO_20,*LPUSER_INFO_20; 170 171 typedef struct _USER_INFO_21 { 172 BYTE usri21_password[ENCRYPTED_PWLEN]; 173 } USER_INFO_21,*PUSER_INFO_21,*LPUSER_INFO_21; 174 175 typedef struct _USER_INFO_22 { 176 LPWSTR usri22_name; 177 BYTE usri22_password[ENCRYPTED_PWLEN]; 178 DWORD usri22_password_age; 179 DWORD usri22_priv; 180 LPWSTR usri22_home_dir; 181 LPWSTR usri22_comment; 182 DWORD usri22_flags; 183 LPWSTR usri22_script_path; 184 DWORD usri22_auth_flags; 185 LPWSTR usri22_full_name; 186 LPWSTR usri22_usr_comment; 187 LPWSTR usri22_parms; 188 LPWSTR usri22_workstations; 189 DWORD usri22_last_logon; 190 DWORD usri22_last_logoff; 191 DWORD usri22_acct_expires; 192 DWORD usri22_max_storage; 193 DWORD usri22_units_per_week; 194 PBYTE usri22_logon_hours; 195 DWORD usri22_bad_pw_count; 196 DWORD usri22_num_logons; 197 LPWSTR usri22_logon_server; 198 DWORD usri22_country_code; 199 DWORD usri22_code_page; 200 } USER_INFO_22,*PUSER_INFO_22,*LPUSER_INFO_22; 201 202 typedef struct _USER_INFO_23 { 203 LPWSTR usri23_name; 204 LPWSTR usri23_full_name; 205 LPWSTR usri23_comment; 206 DWORD usri23_flags; 207 PSID usri23_user_sid; 208 } USER_INFO_23,*PUSER_INFO_23,*LPUSER_INFO_23; 209 210 typedef struct _USER_INFO_1003 { 211 LPWSTR usri1003_password; 212 } USER_INFO_1003,*PUSER_INFO_1003,*LPUSER_INFO_1003; 213 214 typedef struct _USER_INFO_1005 { 215 DWORD usri1005_priv; 216 } USER_INFO_1005,*PUSER_INFO_1005,*LPUSER_INFO_1005; 217 218 typedef struct _USER_INFO_1006 { 219 LPWSTR usri1006_home_dir; 220 } USER_INFO_1006,*PUSER_INFO_1006,*LPUSER_INFO_1006; 221 222 typedef struct _USER_INFO_1007 { 223 LPWSTR usri1007_comment; 224 } USER_INFO_1007,*PUSER_INFO_1007,*LPUSER_INFO_1007; 225 226 typedef struct _USER_INFO_1008 { 227 DWORD usri1008_flags; 228 } USER_INFO_1008,*PUSER_INFO_1008,*LPUSER_INFO_1008; 229 230 typedef struct _USER_INFO_1009 { 231 LPWSTR usri1009_script_path; 232 } USER_INFO_1009,*PUSER_INFO_1009,*LPUSER_INFO_1009; 233 234 typedef struct _USER_INFO_1010 { 235 DWORD usri1010_auth_flags; 236 } USER_INFO_1010,*PUSER_INFO_1010,*LPUSER_INFO_1010; 237 238 typedef struct _USER_INFO_1011 { 239 LPWSTR usri1011_full_name; 240 } USER_INFO_1011,*PUSER_INFO_1011,*LPUSER_INFO_1011; 241 242 typedef struct _USER_INFO_1012 { 243 LPWSTR usri1012_usr_comment; 244 } USER_INFO_1012,*PUSER_INFO_1012,*LPUSER_INFO_1012; 245 246 typedef struct _USER_INFO_1013 { 247 LPWSTR usri1013_parms; 248 } USER_INFO_1013,*PUSER_INFO_1013,*LPUSER_INFO_1013; 249 250 typedef struct _USER_INFO_1014 { 251 LPWSTR usri1014_workstations; 252 } USER_INFO_1014,*PUSER_INFO_1014,*LPUSER_INFO_1014; 253 254 typedef struct _USER_INFO_1017 { 255 DWORD usri1017_acct_expires; 256 } USER_INFO_1017,*PUSER_INFO_1017,*LPUSER_INFO_1017; 257 258 typedef struct _USER_INFO_1018 { 259 DWORD usri1018_max_storage; 260 } USER_INFO_1018,*PUSER_INFO_1018,*LPUSER_INFO_1018; 261 262 typedef struct _USER_INFO_1020 { 263 DWORD usri1020_units_per_week; 264 LPBYTE usri1020_logon_hours; 265 } USER_INFO_1020,*PUSER_INFO_1020,*LPUSER_INFO_1020; 266 267 typedef struct _USER_INFO_1023 { 268 LPWSTR usri1023_logon_server; 269 } USER_INFO_1023,*PUSER_INFO_1023,*LPUSER_INFO_1023; 270 271 typedef struct _USER_INFO_1024 { 272 DWORD usri1024_country_code; 273 } USER_INFO_1024,*PUSER_INFO_1024,*LPUSER_INFO_1024; 274 275 typedef struct _USER_INFO_1025 { 276 DWORD usri1025_code_page; 277 } USER_INFO_1025,*PUSER_INFO_1025,*LPUSER_INFO_1025; 278 279 typedef struct _USER_INFO_1051 { 280 DWORD usri1051_primary_group_id; 281 } USER_INFO_1051,*PUSER_INFO_1051,*LPUSER_INFO_1051; 282 283 typedef struct _USER_INFO_1052 { 284 LPWSTR usri1052_profile; 285 } USER_INFO_1052,*PUSER_INFO_1052,*LPUSER_INFO_1052; 286 287 typedef struct _USER_INFO_1053 { 288 LPWSTR usri1053_home_dir_drive; 289 } USER_INFO_1053,*PUSER_INFO_1053,*LPUSER_INFO_1053; 290 291 typedef struct _USER_MODALS_INFO_0 { 292 DWORD usrmod0_min_passwd_len; 293 DWORD usrmod0_max_passwd_age; 294 DWORD usrmod0_min_passwd_age; 295 DWORD usrmod0_force_logoff; 296 DWORD usrmod0_password_hist_len; 297 } USER_MODALS_INFO_0,*PUSER_MODALS_INFO_0,*LPUSER_MODALS_INFO_0; 298 299 typedef struct _USER_MODALS_INFO_1 { 300 DWORD usrmod1_role; 301 LPWSTR usrmod1_primary; 302 } USER_MODALS_INFO_1,*PUSER_MODALS_INFO_1,*LPUSER_MODALS_INFO_1; 303 304 typedef struct _USER_MODALS_INFO_2 { 305 LPWSTR usrmod2_domain_name; 306 PSID usrmod2_domain_id; 307 } USER_MODALS_INFO_2,*PUSER_MODALS_INFO_2,*LPUSER_MODALS_INFO_2; 308 309 typedef struct _USER_MODALS_INFO_3 { 310 DWORD usrmod3_lockout_duration; 311 DWORD usrmod3_lockout_observation_window; 312 DWORD usrmod3_lockout_threshold; 313 } USER_MODALS_INFO_3,*PUSER_MODALS_INFO_3,*LPUSER_MODALS_INFO_3; 314 315 typedef struct _USER_MODALS_INFO_1001 { 316 DWORD usrmod1001_min_passwd_len; 317 } USER_MODALS_INFO_1001,*PUSER_MODALS_INFO_1001,*LPUSER_MODALS_INFO_1001; 318 319 typedef struct _USER_MODALS_INFO_1002 { 320 DWORD usrmod1002_max_passwd_age; 321 } USER_MODALS_INFO_1002,*PUSER_MODALS_INFO_1002,*LPUSER_MODALS_INFO_1002; 322 323 typedef struct _USER_MODALS_INFO_1003 { 324 DWORD usrmod1003_min_passwd_age; 325 } USER_MODALS_INFO_1003,*PUSER_MODALS_INFO_1003,*LPUSER_MODALS_INFO_1003; 326 327 typedef struct _USER_MODALS_INFO_1004 { 328 DWORD usrmod1004_force_logoff; 329 } USER_MODALS_INFO_1004,*PUSER_MODALS_INFO_1004,*LPUSER_MODALS_INFO_1004; 330 331 typedef struct _USER_MODALS_INFO_1005 { 332 DWORD usrmod1005_password_hist_len; 333 } USER_MODALS_INFO_1005,*PUSER_MODALS_INFO_1005,*LPUSER_MODALS_INFO_1005; 334 335 typedef struct _USER_MODALS_INFO_1006 { 336 DWORD usrmod1006_role; 337 } USER_MODALS_INFO_1006,*PUSER_MODALS_INFO_1006,*LPUSER_MODALS_INFO_1006; 338 339 typedef struct _USER_MODALS_INFO_1007 { 340 LPWSTR usrmod1007_primary; 341 } USER_MODALS_INFO_1007,*PUSER_MODALS_INFO_1007,*LPUSER_MODALS_INFO_1007; 342 343 #define UF_SCRIPT 0x0001 344 #define UF_ACCOUNTDISABLE 0x0002 345 #define UF_HOMEDIR_REQUIRED 0x0008 346 #define UF_LOCKOUT 0x0010 347 #define UF_PASSWD_NOTREQD 0x0020 348 #define UF_PASSWD_CANT_CHANGE 0x0040 349 #define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED 0x0080 350 351 #define UF_TEMP_DUPLICATE_ACCOUNT 0x0100 352 #define UF_NORMAL_ACCOUNT 0x0200 353 #define UF_INTERDOMAIN_TRUST_ACCOUNT 0x0800 354 #define UF_WORKSTATION_TRUST_ACCOUNT 0x1000 355 #define UF_SERVER_TRUST_ACCOUNT 0x2000 356 357 #define UF_MACHINE_ACCOUNT_MASK (UF_INTERDOMAIN_TRUST_ACCOUNT | UF_WORKSTATION_TRUST_ACCOUNT | UF_SERVER_TRUST_ACCOUNT) 358 #define UF_ACCOUNT_TYPE_MASK (UF_TEMP_DUPLICATE_ACCOUNT | UF_NORMAL_ACCOUNT | UF_INTERDOMAIN_TRUST_ACCOUNT | UF_WORKSTATION_TRUST_ACCOUNT | UF_SERVER_TRUST_ACCOUNT) 359 360 #define UF_DONT_EXPIRE_PASSWD 0x10000 361 #define UF_MNS_LOGON_ACCOUNT 0x20000 362 #define UF_SMARTCARD_REQUIRED 0x40000 363 #define UF_TRUSTED_FOR_DELEGATION 0x80000 364 #define UF_NOT_DELEGATED 0x100000 365 #define UF_USE_DES_KEY_ONLY 0x200000 366 #define UF_DONT_REQUIRE_PREAUTH 0x400000 367 #define UF_PASSWORD_EXPIRED 0x800000 368 #define UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION 0x1000000 369 #define UF_NO_AUTH_DATA_REQUIRED 0x2000000 370 371 #define 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 | UF_MNS_LOGON_ACCOUNT | UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED | UF_SMARTCARD_REQUIRED | UF_TRUSTED_FOR_DELEGATION | UF_NOT_DELEGATED | UF_USE_DES_KEY_ONLY | UF_DONT_REQUIRE_PREAUTH | UF_PASSWORD_EXPIRED | UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION | UF_NO_AUTH_DATA_REQUIRED) 372 373 #define FILTER_TEMP_DUPLICATE_ACCOUNT (0x0001) 374 #define FILTER_NORMAL_ACCOUNT (0x0002) 375 376 #define FILTER_INTERDOMAIN_TRUST_ACCOUNT (0x0008) 377 #define FILTER_WORKSTATION_TRUST_ACCOUNT (0x0010) 378 #define FILTER_SERVER_TRUST_ACCOUNT (0x0020) 379 380 #define LG_INCLUDE_INDIRECT (0x0001) 381 382 #define AF_OP_PRINT 0x1 383 #define AF_OP_COMM 0x2 384 #define AF_OP_SERVER 0x4 385 #define AF_OP_ACCOUNTS 0x8 386 #define AF_SETTABLE_BITS (AF_OP_PRINT | AF_OP_COMM | AF_OP_SERVER | AF_OP_ACCOUNTS) 387 388 #define UAS_ROLE_STANDALONE 0 389 #define UAS_ROLE_MEMBER 1 390 #define UAS_ROLE_BACKUP 2 391 #define UAS_ROLE_PRIMARY 3 392 393 #define USER_NAME_PARMNUM 1 394 #define USER_PASSWORD_PARMNUM 3 395 #define USER_PASSWORD_AGE_PARMNUM 4 396 #define USER_PRIV_PARMNUM 5 397 #define USER_HOME_DIR_PARMNUM 6 398 #define USER_COMMENT_PARMNUM 7 399 #define USER_FLAGS_PARMNUM 8 400 #define USER_SCRIPT_PATH_PARMNUM 9 401 #define USER_AUTH_FLAGS_PARMNUM 10 402 #define USER_FULL_NAME_PARMNUM 11 403 #define USER_USR_COMMENT_PARMNUM 12 404 #define USER_PARMS_PARMNUM 13 405 #define USER_WORKSTATIONS_PARMNUM 14 406 #define USER_LAST_LOGON_PARMNUM 15 407 #define USER_LAST_LOGOFF_PARMNUM 16 408 #define USER_ACCT_EXPIRES_PARMNUM 17 409 #define USER_MAX_STORAGE_PARMNUM 18 410 #define USER_UNITS_PER_WEEK_PARMNUM 19 411 #define USER_LOGON_HOURS_PARMNUM 20 412 #define USER_PAD_PW_COUNT_PARMNUM 21 413 #define USER_NUM_LOGONS_PARMNUM 22 414 #define USER_LOGON_SERVER_PARMNUM 23 415 #define USER_COUNTRY_CODE_PARMNUM 24 416 #define USER_CODE_PAGE_PARMNUM 25 417 #define USER_PRIMARY_GROUP_PARMNUM 51 418 #define USER_PROFILE 52 419 #define USER_PROFILE_PARMNUM 52 420 #define USER_HOME_DIR_DRIVE_PARMNUM 53 421 422 #define USER_NAME_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_NAME_PARMNUM) 423 #define USER_PASSWORD_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_PARMNUM) 424 #define USER_PASSWORD_AGE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_AGE_PARMNUM) 425 #define USER_PRIV_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_PRIV_PARMNUM) 426 #define USER_HOME_DIR_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_PARMNUM) 427 #define USER_COMMENT_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_COMMENT_PARMNUM) 428 #define USER_FLAGS_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_FLAGS_PARMNUM) 429 #define USER_SCRIPT_PATH_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_SCRIPT_PATH_PARMNUM) 430 #define USER_AUTH_FLAGS_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_AUTH_FLAGS_PARMNUM) 431 #define USER_FULL_NAME_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_FULL_NAME_PARMNUM) 432 #define USER_USR_COMMENT_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_USR_COMMENT_PARMNUM) 433 #define USER_PARMS_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_PARMS_PARMNUM) 434 #define USER_WORKSTATIONS_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_WORKSTATIONS_PARMNUM) 435 #define USER_LAST_LOGON_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGON_PARMNUM) 436 #define USER_LAST_LOGOFF_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGOFF_PARMNUM) 437 #define USER_ACCT_EXPIRES_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_ACCT_EXPIRES_PARMNUM) 438 #define USER_MAX_STORAGE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_MAX_STORAGE_PARMNUM) 439 #define USER_UNITS_PER_WEEK_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_UNITS_PER_WEEK_PARMNUM) 440 #define USER_LOGON_HOURS_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_LOGON_HOURS_PARMNUM) 441 #define USER_PAD_PW_COUNT_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_PAD_PW_COUNT_PARMNUM) 442 #define USER_NUM_LOGONS_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_NUM_LOGONS_PARMNUM) 443 #define USER_LOGON_SERVER_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_LOGON_SERVER_PARMNUM) 444 #define USER_COUNTRY_CODE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_COUNTRY_CODE_PARMNUM) 445 #define USER_CODE_PAGE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_CODE_PAGE_PARMNUM) 446 #define USER_PRIMARY_GROUP_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_PRIMARY_GROUP_PARMNUM) 447 #define USER_POSIX_ID_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_POSIX_ID_PARMNUM) 448 #define USER_HOME_DIR_DRIVE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_DRIVE_PARMNUM) 449 450 #define NULL_USERSETINFO_PASSWD " " 451 452 #define TIMEQ_FOREVER ((unsigned __LONG32) -1) 453 #define USER_MAXSTORAGE_UNLIMITED ((unsigned __LONG32) -1) 454 #define USER_NO_LOGOFF ((unsigned __LONG32) -1) 455 #define UNITS_PER_DAY 24 456 #define UNITS_PER_WEEK UNITS_PER_DAY *7 457 458 #define USER_PRIV_MASK 0x3 459 #define USER_PRIV_GUEST 0 460 #define USER_PRIV_USER 1 461 #define USER_PRIV_ADMIN 2 462 463 #define MAX_PASSWD_LEN PWLEN 464 #define DEF_MIN_PWLEN 6 465 #define DEF_PWUNIQUENESS 5 466 #define DEF_MAX_PWHIST 8 467 468 #define DEF_MAX_PWAGE TIMEQ_FOREVER 469 #define DEF_MIN_PWAGE (unsigned __LONG32) 0 470 #define DEF_FORCE_LOGOFF (unsigned __LONG32) 0xffffffff 471 #define DEF_MAX_BADPW 0 472 #define ONE_DAY (unsigned __LONG32) 01*24*3600 473 474 #define VALIDATED_LOGON 0 475 #define PASSWORD_EXPIRED 2 476 #define NON_VALIDATED_LOGON 3 477 478 #define VALID_LOGOFF 1 479 480 #define MODALS_MIN_PASSWD_LEN_PARMNUM 1 481 #define MODALS_MAX_PASSWD_AGE_PARMNUM 2 482 #define MODALS_MIN_PASSWD_AGE_PARMNUM 3 483 #define MODALS_FORCE_LOGOFF_PARMNUM 4 484 #define MODALS_PASSWD_HIST_LEN_PARMNUM 5 485 #define MODALS_ROLE_PARMNUM 6 486 #define MODALS_PRIMARY_PARMNUM 7 487 #define MODALS_DOMAIN_NAME_PARMNUM 8 488 #define MODALS_DOMAIN_ID_PARMNUM 9 489 #define MODALS_LOCKOUT_DURATION_PARMNUM 10 490 #define MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM 11 491 #define MODALS_LOCKOUT_THRESHOLD_PARMNUM 12 492 493 #define MODALS_MIN_PASSWD_LEN_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_LEN_PARMNUM) 494 #define MODALS_MAX_PASSWD_AGE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_MAX_PASSWD_AGE_PARMNUM) 495 #define MODALS_MIN_PASSWD_AGE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_AGE_PARMNUM) 496 #define MODALS_FORCE_LOGOFF_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_FORCE_LOGOFF_PARMNUM) 497 #define MODALS_PASSWD_HIST_LEN_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_PASSWD_HIST_LEN_PARMNUM) 498 #define MODALS_ROLE_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_ROLE_PARMNUM) 499 #define MODALS_PRIMARY_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_PRIMARY_PARMNUM) 500 #define MODALS_DOMAIN_NAME_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_NAME_PARMNUM) 501 #define MODALS_DOMAIN_ID_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_ID_PARMNUM) 502 #endif 503 504 #ifndef _LMGROUP_ 505 #define _LMGROUP_ 506 507 NET_API_STATUS WINAPI NetGroupAdd(LPCWSTR servername,DWORD level,LPBYTE buf,LPDWORD parm_err); 508 NET_API_STATUS WINAPI NetGroupAddUser(LPCWSTR servername,LPCWSTR GroupName,LPCWSTR username); 509 NET_API_STATUS WINAPI NetGroupEnum(LPCWSTR servername,DWORD level,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries,PDWORD_PTR resume_handle); 510 NET_API_STATUS WINAPI NetGroupGetInfo(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE *bufptr); 511 NET_API_STATUS WINAPI NetGroupSetInfo(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE buf,LPDWORD parm_err); 512 NET_API_STATUS WINAPI NetGroupDel(LPCWSTR servername,LPCWSTR groupname); 513 NET_API_STATUS WINAPI NetGroupDelUser(LPCWSTR servername,LPCWSTR GroupName,LPCWSTR Username); 514 NET_API_STATUS WINAPI NetGroupGetUsers(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries,PDWORD_PTR ResumeHandle); 515 NET_API_STATUS WINAPI NetGroupSetUsers(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE buf,DWORD totalentries); 516 517 typedef struct _GROUP_INFO_0 { 518 LPWSTR grpi0_name; 519 } GROUP_INFO_0,*PGROUP_INFO_0,*LPGROUP_INFO_0; 520 521 typedef struct _GROUP_INFO_1 { 522 LPWSTR grpi1_name; 523 LPWSTR grpi1_comment; 524 } GROUP_INFO_1,*PGROUP_INFO_1,*LPGROUP_INFO_1; 525 526 typedef struct _GROUP_INFO_2 { 527 LPWSTR grpi2_name; 528 LPWSTR grpi2_comment; 529 DWORD grpi2_group_id; 530 DWORD grpi2_attributes; 531 } GROUP_INFO_2,*PGROUP_INFO_2; 532 533 typedef struct _GROUP_INFO_3 { 534 LPWSTR grpi3_name; 535 LPWSTR grpi3_comment; 536 PSID grpi3_group_sid; 537 DWORD grpi3_attributes; 538 } GROUP_INFO_3,*PGROUP_INFO_3; 539 540 typedef struct _GROUP_INFO_1002 { 541 LPWSTR grpi1002_comment; 542 } GROUP_INFO_1002,*PGROUP_INFO_1002,*LPGROUP_INFO_1002; 543 544 typedef struct _GROUP_INFO_1005 { 545 DWORD grpi1005_attributes; 546 } GROUP_INFO_1005,*PGROUP_INFO_1005,*LPGROUP_INFO_1005; 547 548 typedef struct _GROUP_USERS_INFO_0 { 549 LPWSTR grui0_name; 550 } GROUP_USERS_INFO_0,*PGROUP_USERS_INFO_0,*LPGROUP_USERS_INFO_0; 551 552 typedef struct _GROUP_USERS_INFO_1 { 553 LPWSTR grui1_name; 554 DWORD grui1_attributes; 555 } GROUP_USERS_INFO_1,*PGROUP_USERS_INFO_1,*LPGROUP_USERS_INFO_1; 556 557 #define GROUPIDMASK 0x8000 558 559 #define GROUP_SPECIALGRP_USERS L"USERS" 560 #define GROUP_SPECIALGRP_ADMINS L"ADMINS" 561 #define GROUP_SPECIALGRP_GUESTS L"GUESTS" 562 #define GROUP_SPECIALGRP_LOCAL L"LOCAL" 563 564 #define GROUP_ALL_PARMNUM 0 565 #define GROUP_NAME_PARMNUM 1 566 #define GROUP_COMMENT_PARMNUM 2 567 #define GROUP_ATTRIBUTES_PARMNUM 3 568 569 #define GROUP_ALL_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + GROUP_ALL_PARMNUM) 570 #define GROUP_NAME_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + GROUP_NAME_PARMNUM) 571 #define GROUP_COMMENT_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + GROUP_COMMENT_PARMNUM) 572 #define GROUP_ATTRIBUTES_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + GROUP_ATTRIBUTES_PARMNUM) 573 #define GROUP_POSIX_ID_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + GROUP_POSIX_ID_PARMNUM) 574 #endif 575 576 #ifndef _LMLOCALGROUP_ 577 #define _LMLOCALGROUP_ 578 NET_API_STATUS WINAPI NetLocalGroupAdd(LPCWSTR servername,DWORD level,LPBYTE buf,LPDWORD parm_err); 579 NET_API_STATUS WINAPI NetLocalGroupAddMember(LPCWSTR servername,LPCWSTR groupname,PSID membersid); 580 NET_API_STATUS WINAPI NetLocalGroupEnum(LPCWSTR servername,DWORD level,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries,PDWORD_PTR resumehandle); 581 NET_API_STATUS WINAPI NetLocalGroupGetInfo(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE *bufptr); 582 NET_API_STATUS WINAPI NetLocalGroupSetInfo(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE buf,LPDWORD parm_err); 583 NET_API_STATUS WINAPI NetLocalGroupDel(LPCWSTR servername,LPCWSTR groupname); 584 NET_API_STATUS WINAPI NetLocalGroupDelMember(LPCWSTR servername,LPCWSTR groupname,PSID membersid); 585 NET_API_STATUS WINAPI NetLocalGroupGetMembers(LPCWSTR servername,LPCWSTR localgroupname,DWORD level,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries,PDWORD_PTR resumehandle); 586 NET_API_STATUS WINAPI NetLocalGroupSetMembers(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE buf,DWORD totalentries); 587 NET_API_STATUS WINAPI NetLocalGroupAddMembers(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE buf,DWORD totalentries); 588 NET_API_STATUS WINAPI NetLocalGroupDelMembers(LPCWSTR servername,LPCWSTR groupname,DWORD level,LPBYTE buf,DWORD totalentries); 589 590 typedef struct _LOCALGROUP_INFO_0 { 591 LPWSTR lgrpi0_name; 592 } LOCALGROUP_INFO_0,*PLOCALGROUP_INFO_0,*LPLOCALGROUP_INFO_0; 593 594 typedef struct _LOCALGROUP_INFO_1 { 595 LPWSTR lgrpi1_name; 596 LPWSTR lgrpi1_comment; 597 } LOCALGROUP_INFO_1,*PLOCALGROUP_INFO_1,*LPLOCALGROUP_INFO_1; 598 599 typedef struct _LOCALGROUP_INFO_1002 { 600 LPWSTR lgrpi1002_comment; 601 } LOCALGROUP_INFO_1002,*PLOCALGROUP_INFO_1002,*LPLOCALGROUP_INFO_1002; 602 603 typedef struct _LOCALGROUP_MEMBERS_INFO_0 { 604 PSID lgrmi0_sid; 605 } LOCALGROUP_MEMBERS_INFO_0,*PLOCALGROUP_MEMBERS_INFO_0,*LPLOCALGROUP_MEMBERS_INFO_0; 606 607 typedef struct _LOCALGROUP_MEMBERS_INFO_1 { 608 PSID lgrmi1_sid; 609 SID_NAME_USE lgrmi1_sidusage; 610 LPWSTR lgrmi1_name; 611 } LOCALGROUP_MEMBERS_INFO_1,*PLOCALGROUP_MEMBERS_INFO_1,*LPLOCALGROUP_MEMBERS_INFO_1; 612 613 typedef struct _LOCALGROUP_MEMBERS_INFO_2 { 614 PSID lgrmi2_sid; 615 SID_NAME_USE lgrmi2_sidusage; 616 LPWSTR lgrmi2_domainandname; 617 } LOCALGROUP_MEMBERS_INFO_2,*PLOCALGROUP_MEMBERS_INFO_2,*LPLOCALGROUP_MEMBERS_INFO_2; 618 619 typedef struct _LOCALGROUP_MEMBERS_INFO_3 { 620 LPWSTR lgrmi3_domainandname; 621 } LOCALGROUP_MEMBERS_INFO_3,*PLOCALGROUP_MEMBERS_INFO_3,*LPLOCALGROUP_MEMBERS_INFO_3; 622 623 typedef struct _LOCALGROUP_USERS_INFO_0 { 624 LPWSTR lgrui0_name; 625 } LOCALGROUP_USERS_INFO_0,*PLOCALGROUP_USERS_INFO_0,*LPLOCALGROUP_USERS_INFO_0; 626 627 #define LOCALGROUP_NAME_PARMNUM 1 628 #define LOCALGROUP_COMMENT_PARMNUM 2 629 630 NET_API_STATUS WINAPI NetQueryDisplayInformation(LPCWSTR ServerName,DWORD Level,DWORD Index,DWORD EntriesRequested,DWORD PreferredMaximumLength,LPDWORD ReturnedEntryCount,PVOID *SortedBuffer); 631 NET_API_STATUS WINAPI NetGetDisplayInformationIndex(LPCWSTR ServerName,DWORD Level,LPCWSTR Prefix,LPDWORD Index); 632 633 typedef struct _NET_DISPLAY_USER { 634 LPWSTR usri1_name; 635 LPWSTR usri1_comment; 636 DWORD usri1_flags; 637 LPWSTR usri1_full_name; 638 DWORD usri1_user_id; 639 DWORD usri1_next_index; 640 } NET_DISPLAY_USER,*PNET_DISPLAY_USER; 641 642 typedef struct _NET_DISPLAY_MACHINE { 643 LPWSTR usri2_name; 644 LPWSTR usri2_comment; 645 DWORD usri2_flags; 646 DWORD usri2_user_id; 647 DWORD usri2_next_index; 648 } NET_DISPLAY_MACHINE,*PNET_DISPLAY_MACHINE; 649 650 typedef struct _NET_DISPLAY_GROUP { 651 LPWSTR grpi3_name; 652 LPWSTR grpi3_comment; 653 DWORD grpi3_group_id; 654 DWORD grpi3_attributes; 655 DWORD grpi3_next_index; 656 } NET_DISPLAY_GROUP,*PNET_DISPLAY_GROUP; 657 #endif 658 659 #ifndef _LMACCESS_ 660 #define _LMACCESS_ 661 662 #define NetAccessAdd RxNetAccessAdd 663 #define NetAccessEnum RxNetAccessEnum 664 #define NetAccessGetInfo RxNetAccessGetInfo 665 #define NetAccessSetInfo RxNetAccessSetInfo 666 #define NetAccessDel RxNetAccessDel 667 #define NetAccessGetUserPerms RxNetAccessGetUserPerms 668 669 NET_API_STATUS WINAPI NetAccessAdd(LPCWSTR servername,DWORD level,LPBYTE buf,LPDWORD parm_err); 670 NET_API_STATUS WINAPI NetAccessEnum(LPCWSTR servername,LPCWSTR BasePath,DWORD Recursive,DWORD level,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries,LPDWORD resume_handle); 671 NET_API_STATUS WINAPI NetAccessGetInfo(LPCWSTR servername,LPCWSTR resource,DWORD level,LPBYTE *bufptr); 672 NET_API_STATUS WINAPI NetAccessSetInfo(LPCWSTR servername,LPCWSTR resource,DWORD level,LPBYTE buf,LPDWORD parm_err); 673 NET_API_STATUS WINAPI NetAccessDel(LPCWSTR servername,LPCWSTR resource); 674 NET_API_STATUS WINAPI NetAccessGetUserPerms(LPCWSTR servername,LPCWSTR UGname,LPCWSTR resource,LPDWORD Perms); 675 676 typedef struct _ACCESS_INFO_0 { 677 LPWSTR acc0_resource_name; 678 } ACCESS_INFO_0,*PACCESS_INFO_0,*LPACCESS_INFO_0; 679 680 typedef struct _ACCESS_INFO_1 { 681 LPWSTR acc1_resource_name; 682 DWORD acc1_attr; 683 DWORD acc1_count; 684 } ACCESS_INFO_1,*PACCESS_INFO_1,*LPACCESS_INFO_1; 685 686 typedef struct _ACCESS_INFO_1002 { 687 DWORD acc1002_attr; 688 } ACCESS_INFO_1002,*PACCESS_INFO_1002,*LPACCESS_INFO_1002; 689 690 typedef struct _ACCESS_LIST { 691 LPWSTR acl_ugname; 692 DWORD acl_access; 693 } ACCESS_LIST,*PACCESS_LIST,*LPACCESS_LIST; 694 695 #define MAXPERMENTRIES 64 696 697 #define ACCESS_NONE 0 698 #define ACCESS_ALL (ACCESS_READ | ACCESS_WRITE | ACCESS_CREATE | ACCESS_EXEC | ACCESS_DELETE | ACCESS_ATRIB | ACCESS_PERM) 699 700 #define ACCESS_READ 0x01 701 #define ACCESS_WRITE 0x02 702 #define ACCESS_CREATE 0x04 703 #define ACCESS_EXEC 0x08 704 #define ACCESS_DELETE 0x10 705 #define ACCESS_ATRIB 0x20 706 #define ACCESS_PERM 0x40 707 #define ACCESS_GROUP 0x8000 708 #define ACCESS_AUDIT 0x1 709 #define ACCESS_SUCCESS_OPEN 0x10 710 #define ACCESS_SUCCESS_WRITE 0x20 711 #define ACCESS_SUCCESS_DELETE 0x40 712 #define ACCESS_SUCCESS_ACL 0x80 713 #define ACCESS_SUCCESS_MASK 0xF0 714 715 #define ACCESS_FAIL_OPEN 0x100 716 #define ACCESS_FAIL_WRITE 0x200 717 #define ACCESS_FAIL_DELETE 0x400 718 #define ACCESS_FAIL_ACL 0x800 719 #define ACCESS_FAIL_MASK 0xF00 720 721 #define ACCESS_FAIL_SHIFT 4 722 723 #define ACCESS_RESOURCE_NAME_PARMNUM 1 724 #define ACCESS_ATTR_PARMNUM 2 725 #define ACCESS_COUNT_PARMNUM 3 726 #define ACCESS_ACCESS_LIST_PARMNUM 4 727 728 #define ACCESS_RESOURCE_NAME_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + ACCESS_RESOURCE_NAME_PARMNUM) 729 #define ACCESS_ATTR_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + ACCESS_ATTR_PARMNUM) 730 #define ACCESS_COUNT_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + ACCESS_COUNT_PARMNUM) 731 #define ACCESS_ACCESS_LIST_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + ACCESS_ACCESS_LIST_PARMNUM) 732 733 #define ACCESS_LETTERS "RWCXDAP " 734 735 typedef enum _NET_VALIDATE_PASSWORD_TYPE { 736 NetValidateAuthentication = 1,NetValidatePasswordChange,NetValidatePasswordReset 737 } NET_VALIDATE_PASSWORD_TYPE,*PNET_VALIDATE_PASSWORD_TYPE; 738 739 typedef struct _NET_VALIDATE_PASSWORD_HASH{ 740 ULONG Length; 741 LPBYTE Hash; 742 } NET_VALIDATE_PASSWORD_HASH,*PNET_VALIDATE_PASSWORD_HASH; 743 744 #define NET_VALIDATE_PASSWORD_LAST_SET 0x00000001 745 #define NET_VALIDATE_BAD_PASSWORD_TIME 0x00000002 746 #define NET_VALIDATE_LOCKOUT_TIME 0x00000004 747 #define NET_VALIDATE_BAD_PASSWORD_COUNT 0x00000008 748 #define NET_VALIDATE_PASSWORD_HISTORY_LENGTH 0x00000010 749 #define NET_VALIDATE_PASSWORD_HISTORY 0x00000020 750 751 #if !defined(_WINBASE_) && !defined(_FILETIME_) 752 #define _FILETIME_ 753 typedef struct _FILETIME { 754 DWORD dwLowDateTime; 755 DWORD dwHighDateTime; 756 } FILETIME,*LPFILETIME,*PFILETIME; 757 #endif 758 759 typedef struct _NET_VALIDATE_PERSISTED_FIELDS { 760 ULONG PresentFields; 761 FILETIME PasswordLastSet; 762 FILETIME BadPasswordTime; 763 FILETIME LockoutTime; 764 ULONG BadPasswordCount; 765 ULONG PasswordHistoryLength; 766 PNET_VALIDATE_PASSWORD_HASH PasswordHistory; 767 } NET_VALIDATE_PERSISTED_FIELDS,*PNET_VALIDATE_PERSISTED_FIELDS; 768 769 typedef struct _NET_VALIDATE_OUTPUT_ARG { 770 NET_VALIDATE_PERSISTED_FIELDS ChangedPersistedFields; 771 NET_API_STATUS ValidationStatus; 772 } NET_VALIDATE_OUTPUT_ARG,*PNET_VALIDATE_OUTPUT_ARG; 773 774 typedef struct _NET_VALIDATE_AUTHENTICATION_INPUT_ARG { 775 NET_VALIDATE_PERSISTED_FIELDS InputPersistedFields; 776 BOOLEAN PasswordMatched; 777 } NET_VALIDATE_AUTHENTICATION_INPUT_ARG,*PNET_VALIDATE_AUTHENTICATION_INPUT_ARG; 778 779 typedef struct _NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG { 780 NET_VALIDATE_PERSISTED_FIELDS InputPersistedFields; 781 LPWSTR ClearPassword; 782 LPWSTR UserAccountName; 783 NET_VALIDATE_PASSWORD_HASH HashedPassword; 784 BOOLEAN PasswordMatch; 785 } NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG,*PNET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG; 786 787 typedef struct _NET_VALIDATE_PASSWORD_RESET_INPUT_ARG { 788 NET_VALIDATE_PERSISTED_FIELDS InputPersistedFields; 789 LPWSTR ClearPassword; 790 LPWSTR UserAccountName; 791 NET_VALIDATE_PASSWORD_HASH HashedPassword; 792 BOOLEAN PasswordMustChangeAtNextLogon; 793 BOOLEAN ClearLockout; 794 } NET_VALIDATE_PASSWORD_RESET_INPUT_ARG,*PNET_VALIDATE_PASSWORD_RESET_INPUT_ARG; 795 796 NET_API_STATUS WINAPI NetValidatePasswordPolicy(LPCWSTR ServerName,LPVOID Qualifier,NET_VALIDATE_PASSWORD_TYPE ValidationType,LPVOID InputArg,LPVOID *OutputArg); 797 NET_API_STATUS WINAPI NetValidatePasswordPolicyFree(LPVOID *OutputArg); 798 #endif 799 800 #ifndef _LMDOMAIN_ 801 #define _LMDOMAIN_ 802 NET_API_STATUS WINAPI NetGetDCName(LPCWSTR servername,LPCWSTR domainname,LPBYTE *bufptr); 803 NET_API_STATUS WINAPI NetGetAnyDCName(LPCWSTR servername,LPCWSTR domainname,LPBYTE *bufptr); 804 NET_API_STATUS WINAPI I_NetLogonControl(LPCWSTR ServerName,DWORD FunctionCode,DWORD QueryLevel,LPBYTE *Buffer); 805 NET_API_STATUS WINAPI I_NetLogonControl2(LPCWSTR ServerName,DWORD FunctionCode,DWORD QueryLevel,LPBYTE Data,LPBYTE *Buffer); 806 807 #if !defined (_NTDEF_) && !defined (_NTSTATUS_PSDK) 808 #define _NTSTATUS_PSDK 809 typedef LONG NTSTATUS,*PNTSTATUS; 810 #endif 811 812 NTSTATUS WINAPI NetEnumerateTrustedDomains (LPWSTR ServerName,LPWSTR *DomainNames); 813 814 #define NETLOGON_CONTROL_QUERY 1 815 #define NETLOGON_CONTROL_REPLICATE 2 816 #define NETLOGON_CONTROL_SYNCHRONIZE 3 817 #define NETLOGON_CONTROL_PDC_REPLICATE 4 818 #define NETLOGON_CONTROL_REDISCOVER 5 819 #define NETLOGON_CONTROL_TC_QUERY 6 820 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 7 821 #define NETLOGON_CONTROL_FIND_USER 8 822 #define NETLOGON_CONTROL_CHANGE_PASSWORD 9 823 #define NETLOGON_CONTROL_TC_VERIFY 10 824 #define NETLOGON_CONTROL_FORCE_DNS_REG 11 825 #define NETLOGON_CONTROL_QUERY_DNS_REG 12 826 827 #define NETLOGON_CONTROL_UNLOAD_NETLOGON_DLL 0xFFFB 828 #define NETLOGON_CONTROL_BACKUP_CHANGE_LOG 0xFFFC 829 #define NETLOGON_CONTROL_TRUNCATE_LOG 0xFFFD 830 #define NETLOGON_CONTROL_SET_DBFLAG 0xFFFE 831 #define NETLOGON_CONTROL_BREAKPOINT 0xFFFF 832 833 typedef struct _NETLOGON_INFO_1 { 834 DWORD netlog1_flags; 835 NET_API_STATUS netlog1_pdc_connection_status; 836 } NETLOGON_INFO_1,*PNETLOGON_INFO_1; 837 838 typedef struct _NETLOGON_INFO_2 { 839 DWORD netlog2_flags; 840 841 NET_API_STATUS netlog2_pdc_connection_status; 842 LPWSTR netlog2_trusted_dc_name; 843 NET_API_STATUS netlog2_tc_connection_status; 844 } NETLOGON_INFO_2,*PNETLOGON_INFO_2; 845 846 typedef struct _NETLOGON_INFO_3 { 847 DWORD netlog3_flags; 848 DWORD netlog3_logon_attempts; 849 DWORD netlog3_reserved1; 850 DWORD netlog3_reserved2; 851 DWORD netlog3_reserved3; 852 DWORD netlog3_reserved4; 853 DWORD netlog3_reserved5; 854 } NETLOGON_INFO_3,*PNETLOGON_INFO_3; 855 856 typedef struct _NETLOGON_INFO_4 { 857 LPWSTR netlog4_trusted_dc_name; 858 LPWSTR netlog4_trusted_domain_name; 859 } NETLOGON_INFO_4,*PNETLOGON_INFO_4; 860 861 #define NETLOGON_REPLICATION_NEEDED 0x01 862 #define NETLOGON_REPLICATION_IN_PROGRESS 0x02 863 #define NETLOGON_FULL_SYNC_REPLICATION 0x04 864 #define NETLOGON_REDO_NEEDED 0x08 865 #define NETLOGON_HAS_IP 0x10 866 #define NETLOGON_HAS_TIMESERV 0x20 867 #define NETLOGON_DNS_UPDATE_FAILURE 0x40 868 #define NETLOGON_VERIFY_STATUS_RETURNED 0x80 869 870 #if (_WIN32_WINNT >= 0x0601) 871 872 typedef enum _MSA_INFO_STATE { 873 MsaInfoNotExist = 1, 874 MsaInfoNotService, 875 MsaInfoCannotInstall, 876 MsaInfoCanInstall, 877 MsaInfoInstalled 878 } MSA_INFO_STATE; 879 880 typedef struct _MSA_INFO_0 { 881 MSA_INFO_STATE State; 882 } MSA_INFO_0, *PMSA_INFO_0; 883 884 #define SERVICE_ACCOUNT_FLAG_LINK_TO_HOST_ONLY 0x00000001 885 886 NTSTATUS WINAPI NetAddServiceAccount (LPWSTR ServerName,LPWSTR AccountName,LPWSTR Reserved,DWORD Flags); 887 NTSTATUS WINAPI NetRemoveServiceAccount (LPWSTR ServerName,LPWSTR AccountName,DWORD Flags); 888 NTSTATUS WINAPI NetIsServiceAccount (LPWSTR ServerName,LPWSTR AccountName,BOOL *IsService); 889 NTSTATUS WINAPI NetEnumerateServiceAccounts (LPWSTR ServerName,DWORD Flags,DWORD *AccountsCount, PZPWSTR *Accounts); 890 891 #endif /*(_WIN32_WINNT >= 0x0601)*/ 892 893 #ifdef __cplusplus 894 } 895 #endif 896 #endif 897