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