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