r15837: starting sync up for 3.0.23rc1 (in sync with SAMBA_3_0 r15822)
[Samba.git] / source / include / rpc_samr.h
blob49ea36f364c1750166b748ffe939845f49958c66
1 /*
2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Andrew Tridgell 1992-2000
5 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
6 Copyright (C) Paul Ashton 1997-2000
7 Copyright (C) Jean François Micouleau 1998-2001
8 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
27 #define _RPC_SAMR_H
29 /*******************************************************************
30 the following information comes from a QuickView on samsrv.dll,
31 and gives an idea of exactly what is needed:
33 x SamrAddMemberToAlias
34 x SamrAddMemberToGroup
35 SamrAddMultipleMembersToAlias
36 x SamrChangePasswordUser
37 x SamrCloseHandle
38 x SamrConnect
39 x SamrCreateAliasInDomain
40 x SamrCreateGroupInDomain
41 x SamrCreateUserInDomain
42 ? SamrDeleteAlias
43 SamrDeleteGroup
44 x SamrDeleteUser
45 x SamrEnumerateAliasesInDomain
46 SamrEnumerateDomainsInSamServer
47 x SamrEnumerateGroupsInDomain
48 x SamrEnumerateUsersInDomain
49 SamrGetUserDomainPasswordInformation
50 SamrLookupDomainInSamServer
51 ? SamrLookupIdsInDomain
52 x SamrLookupNamesInDomain
53 x SamrOpenAlias
54 x SamrOpenDomain
55 x SamrOpenGroup
56 x SamrOpenUser
57 x SamrQueryDisplayInformation
58 x SamrQueryInformationAlias
59 SamrQueryInformationDomain
60 ? SamrQueryInformationUser
61 x SamrQuerySecurityObject
62 SamrRemoveMemberFromAlias
63 SamrRemoveMemberFromForiegnDomain
64 SamrRemoveMemberFromGroup
65 SamrRemoveMultipleMembersFromAlias
66 x SamrSetInformationAlias
67 SamrSetInformationDomain
68 x SamrSetInformationGroup
69 x SamrSetInformationUser
70 SamrSetMemberAttributesOfGroup
71 SamrSetSecurityObject
72 SamrShutdownSamServer
73 SamrTestPrivateFunctionsDomain
74 SamrTestPrivateFunctionsUser
76 ********************************************************************/
78 #define SAMR_CONNECT_ANON 0x00
79 #define SAMR_CLOSE_HND 0x01
80 #define SAMR_SET_SEC_OBJECT 0x02
81 #define SAMR_QUERY_SEC_OBJECT 0x03
83 #define SAMR_UNKNOWN_4 0x04 /* profile info? */
84 #define SAMR_LOOKUP_DOMAIN 0x05
85 #define SAMR_ENUM_DOMAINS 0x06
86 #define SAMR_OPEN_DOMAIN 0x07
87 #define SAMR_QUERY_DOMAIN_INFO 0x08
88 #define SAMR_SET_DOMAIN_INFO 0x09
90 #define SAMR_CREATE_DOM_GROUP 0x0a
91 #define SAMR_ENUM_DOM_GROUPS 0x0b
92 #define SAMR_ENUM_DOM_USERS 0x0d
93 #define SAMR_CREATE_DOM_ALIAS 0x0e
94 #define SAMR_ENUM_DOM_ALIASES 0x0f
95 #define SAMR_QUERY_USERALIASES 0x10
97 #define SAMR_LOOKUP_NAMES 0x11
98 #define SAMR_LOOKUP_RIDS 0x12
100 #define SAMR_OPEN_GROUP 0x13
101 #define SAMR_QUERY_GROUPINFO 0x14
102 #define SAMR_SET_GROUPINFO 0x15
103 #define SAMR_ADD_GROUPMEM 0x16
104 #define SAMR_DELETE_DOM_GROUP 0x17
105 #define SAMR_DEL_GROUPMEM 0x18
106 #define SAMR_QUERY_GROUPMEM 0x19
107 #define SAMR_UNKNOWN_1A 0x1a
109 #define SAMR_OPEN_ALIAS 0x1b
110 #define SAMR_QUERY_ALIASINFO 0x1c
111 #define SAMR_SET_ALIASINFO 0x1d
112 #define SAMR_DELETE_DOM_ALIAS 0x1e
113 #define SAMR_ADD_ALIASMEM 0x1f
114 #define SAMR_DEL_ALIASMEM 0x20
115 #define SAMR_QUERY_ALIASMEM 0x21
117 #define SAMR_OPEN_USER 0x22
118 #define SAMR_DELETE_DOM_USER 0x23
119 #define SAMR_QUERY_USERINFO 0x24
120 #define SAMR_SET_USERINFO2 0x25
121 #define SAMR_QUERY_USERGROUPS 0x27
123 #define SAMR_QUERY_DISPINFO 0x28
124 #define SAMR_UNKNOWN_29 0x29
125 #define SAMR_UNKNOWN_2a 0x2a
126 #define SAMR_UNKNOWN_2b 0x2b
127 #define SAMR_GET_USRDOM_PWINFO 0x2c
128 #define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d
129 #define SAMR_QUERY_DOMAIN_INFO2 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
130 #define SAMR_UNKNOWN_2f 0x2f
131 #define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO
132 with info level 3 */
133 #define SAMR_UNKNOWN_31 0x31
134 #define SAMR_CREATE_USER 0x32
135 #define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO
136 with info level 4 */
137 #define SAMR_ADDMULTI_ALIASMEM 0x34
139 #define SAMR_UNKNOWN_35 0x35
140 #define SAMR_UNKNOWN_36 0x36
141 #define SAMR_CHGPASSWD_USER 0x37
142 #define SAMR_GET_DOM_PWINFO 0x38
143 #define SAMR_CONNECT 0x39
144 #define SAMR_SET_USERINFO 0x3A
145 #define SAMR_CONNECT4 0x3E
146 #define SAMR_CHGPASSWD_USER3 0x3F
147 #define SAMR_CONNECT5 0x40
149 typedef struct logon_hours_info
151 uint32 max_len; /* normally 1260 bytes */
152 uint32 offset;
153 uint32 len; /* normally 21 bytes */
154 uint8 hours[32];
156 } LOGON_HRS;
158 /* SAM_USER_INFO_23 */
159 typedef struct sam_user_info_23
161 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
162 NTTIME logon_time; /* logon time */
163 NTTIME logoff_time; /* logoff time */
164 NTTIME kickoff_time; /* kickoff time */
165 NTTIME pass_last_set_time; /* password last set time */
166 NTTIME pass_can_change_time; /* password can change time */
167 NTTIME pass_must_change_time; /* password must change time */
169 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
170 UNIHDR hdr_full_name; /* user's full name unicode string header */
171 UNIHDR hdr_home_dir; /* home directory unicode string header */
172 UNIHDR hdr_dir_drive; /* home drive unicode string header */
173 UNIHDR hdr_logon_script; /* logon script unicode string header */
174 UNIHDR hdr_profile_path; /* profile path unicode string header */
175 UNIHDR hdr_acct_desc ; /* user description */
176 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
177 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
178 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
180 uint8 lm_pwd[16]; /* lm user passwords */
181 uint8 nt_pwd[16]; /* nt user passwords */
183 uint32 user_rid; /* Primary User ID */
184 uint32 group_rid; /* Primary Group ID */
186 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
188 uint32 fields_present; /* 0x09f8 27fa */
190 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
191 /* uint8 pad[2] */
192 uint32 ptr_logon_hrs; /* pointer to logon hours */
194 /* Was unknown_5. */
195 uint16 bad_password_count;
196 uint16 logon_count;
198 uint8 padding1[6];
200 uint8 passmustchange; /* 0x00 must change = 0x01 */
202 uint8 padding2;
204 uint8 pass[516];
206 UNISTR2 uni_user_name; /* NULL - username unicode string */
207 UNISTR2 uni_full_name; /* user's full name unicode string */
208 UNISTR2 uni_home_dir; /* home directory unicode string */
209 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
210 UNISTR2 uni_logon_script; /* logon script unicode string */
211 UNISTR2 uni_profile_path; /* profile path unicode string */
212 UNISTR2 uni_acct_desc ; /* user description unicode string */
213 UNISTR2 uni_workstations; /* login from workstations unicode string */
214 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
215 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
217 LOGON_HRS logon_hrs;
219 } SAM_USER_INFO_23;
221 /* SAM_USER_INFO_24 */
222 typedef struct sam_user_info_24
224 uint8 pass[516];
225 uint16 pw_len;
226 } SAM_USER_INFO_24;
229 * NB. This structure is *definately* incorrect. It's my best guess
230 * currently for W2K SP2. The password field is encrypted in a different
231 * way than normal... And there are definately other problems. JRA.
234 /* SAM_USER_INFO_25 */
235 typedef struct sam_user_info_25
237 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
238 NTTIME logon_time; /* logon time */
239 NTTIME logoff_time; /* logoff time */
240 NTTIME kickoff_time; /* kickoff time */
241 NTTIME pass_last_set_time; /* password last set time */
242 NTTIME pass_can_change_time; /* password can change time */
243 NTTIME pass_must_change_time; /* password must change time */
245 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
246 UNIHDR hdr_full_name; /* user's full name unicode string header */
247 UNIHDR hdr_home_dir; /* home directory unicode string header */
248 UNIHDR hdr_dir_drive; /* home drive unicode string header */
249 UNIHDR hdr_logon_script; /* logon script unicode string header */
250 UNIHDR hdr_profile_path; /* profile path unicode string header */
251 UNIHDR hdr_acct_desc ; /* user description */
252 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
253 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
254 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
256 uint8 lm_pwd[16]; /* lm user passwords */
257 uint8 nt_pwd[16]; /* nt user passwords */
259 uint32 user_rid; /* Primary User ID */
260 uint32 group_rid; /* Primary Group ID */
262 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
264 uint32 unknown_6[6];
266 uint8 pass[532];
268 UNISTR2 uni_user_name; /* NULL - username unicode string */
269 UNISTR2 uni_full_name; /* user's full name unicode string */
270 UNISTR2 uni_home_dir; /* home directory unicode string */
271 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
272 UNISTR2 uni_logon_script; /* logon script unicode string */
273 UNISTR2 uni_profile_path; /* profile path unicode string */
274 UNISTR2 uni_acct_desc ; /* user description unicode string */
275 UNISTR2 uni_workstations; /* login from workstations unicode string */
276 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
277 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
278 } SAM_USER_INFO_25;
280 /* SAM_USER_INFO_26 */
281 typedef struct sam_user_info_26
283 uint8 pass[532];
284 uint8 pw_len;
285 } SAM_USER_INFO_26;
288 /* SAM_USER_INFO_21 */
289 typedef struct sam_user_info_21
291 NTTIME logon_time; /* logon time */
292 NTTIME logoff_time; /* logoff time */
293 NTTIME kickoff_time; /* kickoff time */
294 NTTIME pass_last_set_time; /* password last set time */
295 NTTIME pass_can_change_time; /* password can change time */
296 NTTIME pass_must_change_time; /* password must change time */
298 UNIHDR hdr_user_name; /* username unicode string header */
299 UNIHDR hdr_full_name; /* user's full name unicode string header */
300 UNIHDR hdr_home_dir; /* home directory unicode string header */
301 UNIHDR hdr_dir_drive; /* home drive unicode string header */
302 UNIHDR hdr_logon_script; /* logon script unicode string header */
303 UNIHDR hdr_profile_path; /* profile path unicode string header */
304 UNIHDR hdr_acct_desc ; /* user description */
305 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
306 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
307 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
309 uint8 lm_pwd[16]; /* lm user passwords */
310 uint8 nt_pwd[16]; /* nt user passwords */
312 uint32 user_rid; /* Primary User ID */
313 uint32 group_rid; /* Primary Group ID */
315 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
317 /* Was unknown_3 */
318 uint32 fields_present; /* 0x00ff ffff */
320 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
321 /* uint8 pad[2] */
322 uint32 ptr_logon_hrs; /* unknown pointer */
324 /* Was unknown_5. */
325 uint16 bad_password_count;
326 uint16 logon_count;
328 uint8 padding1[6];
330 uint8 passmustchange; /* 0x00 must change = 0x01 */
332 uint8 padding2;
334 UNISTR2 uni_user_name; /* username unicode string */
335 UNISTR2 uni_full_name; /* user's full name unicode string */
336 UNISTR2 uni_home_dir; /* home directory unicode string */
337 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
338 UNISTR2 uni_logon_script; /* logon script unicode string */
339 UNISTR2 uni_profile_path; /* profile path unicode string */
340 UNISTR2 uni_acct_desc ; /* user description unicode string */
341 UNISTR2 uni_workstations; /* login from workstations unicode string */
342 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
343 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
345 LOGON_HRS logon_hrs;
347 } SAM_USER_INFO_21;
349 #define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
350 #define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
352 /* SAM_USER_INFO_20 */
353 typedef struct sam_user_info_20
355 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
357 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
359 } SAM_USER_INFO_20;
361 /* SAM_USER_INFO_18 */
362 typedef struct sam_user_info_18
364 uint8 lm_pwd[16]; /* lm user passwords */
365 uint8 nt_pwd[16]; /* nt user passwords */
367 uint8 lm_pwd_active;
368 uint8 nt_pwd_active;
370 } SAM_USER_INFO_18;
372 /* SAM_USER_INFO_17 */
373 typedef struct sam_user_info_17
375 uint8 padding_0[16]; /* 0 - padding 16 bytes */
376 NTTIME expiry; /* expiry time or something? */
377 uint8 padding_1[24]; /* 0 - padding 24 bytes */
379 UNIHDR hdr_mach_acct; /* unicode header for machine account */
380 uint32 padding_2; /* 0 - padding 4 bytes */
382 uint32 ptr_1; /* pointer */
383 uint8 padding_3[32]; /* 0 - padding 32 bytes */
384 uint32 padding_4; /* 0 - padding 4 bytes */
386 uint32 ptr_2; /* pointer */
387 uint32 padding_5; /* 0 - padding 4 bytes */
389 uint32 ptr_3; /* pointer */
390 uint8 padding_6[32]; /* 0 - padding 32 bytes */
392 uint32 rid_user; /* user RID */
393 uint32 rid_group; /* group RID */
395 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
396 uint16 unknown_3; /* 16 bit padding */
398 uint16 unknown_4; /* 0x003f - 16 bit unknown */
399 uint16 unknown_5; /* 0x003c - 16 bit unknown */
401 uint8 padding_7[16]; /* 0 - padding 16 bytes */
402 uint32 padding_8; /* 0 - padding 4 bytes */
404 UNISTR2 uni_mach_acct; /* unicode string for machine account */
406 uint8 padding_9[48]; /* 0 - padding 48 bytes */
408 } SAM_USER_INFO_17;
411 /* SAM_USER_INFO_16 */
412 typedef struct sam_user_info_16
414 uint32 acb_info;
416 } SAM_USER_INFO_16;
419 /* SAM_USER_INFO_7 */
420 typedef struct sam_user_info_7
422 UNIHDR hdr_name; /* unicode header for name */
423 UNISTR2 uni_name; /* unicode string for name */
425 } SAM_USER_INFO_7;
428 /* SAM_USER_INFO_9 */
429 typedef struct sam_user_info_9
431 uint32 rid_group; /* Primary Group RID */
432 } SAM_USER_INFO_9;
435 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
436 typedef struct q_samr_close_hnd_info
438 POLICY_HND pol; /* policy handle */
440 } SAMR_Q_CLOSE_HND;
443 /* SAMR_R_CLOSE_HND - probably a policy handle close */
444 typedef struct r_samr_close_hnd_info
446 POLICY_HND pol; /* policy handle */
447 NTSTATUS status; /* return status */
449 } SAMR_R_CLOSE_HND;
452 /****************************************************************************
453 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
454 *****************************************************************************/
456 /* SAMR_Q_GET_USRDOM_PWINFO */
457 typedef struct q_samr_usrdom_pwinfo_info
459 POLICY_HND user_pol; /* policy handle */
461 } SAMR_Q_GET_USRDOM_PWINFO;
464 /****************************************************************************
465 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
466 *****************************************************************************/
468 /* SAMR_R_GET_USRDOM_PWINFO */
469 typedef struct r_samr_usrdom_pwinfo_info
471 uint16 min_pwd_length;
472 uint16 unknown_1; /* 0x0016 or 0x0015 */
473 uint32 password_properties;
474 NTSTATUS status;
476 } SAMR_R_GET_USRDOM_PWINFO;
478 /****************************************************************************
479 SAMR_Q_SET_SEC_OBJ - info level 4.
480 *****************************************************************************/
482 /* SAMR_Q_SET_SEC_OBJ - */
483 typedef struct q_samr_set_sec_obj_info
485 POLICY_HND pol; /* policy handle */
486 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
487 SEC_DESC_BUF *buf;
489 } SAMR_Q_SET_SEC_OBJ;
491 /* SAMR_R_SET_SEC_OBJ - */
492 typedef struct r_samr_set_sec_obj_info
494 NTSTATUS status; /* return status */
496 } SAMR_R_SET_SEC_OBJ;
499 /****************************************************************************
500 SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
501 *****************************************************************************/
503 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
504 typedef struct q_samr_query_sec_obj_info
506 POLICY_HND user_pol; /* policy handle */
507 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
509 } SAMR_Q_QUERY_SEC_OBJ;
511 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
512 typedef struct r_samr_query_sec_obj_info
514 uint32 ptr;
515 SEC_DESC_BUF *buf;
517 NTSTATUS status; /* return status */
519 } SAMR_R_QUERY_SEC_OBJ;
522 /****************************************************************************
523 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
524 *****************************************************************************/
526 /* SAMR_Q_QUERY_DOMAIN_INFO - */
527 typedef struct q_samr_query_domain_info
529 POLICY_HND domain_pol; /* policy handle */
530 uint16 switch_value; /* 0x0002, 0x0001 */
532 } SAMR_Q_QUERY_DOMAIN_INFO;
534 typedef struct sam_unknown_info_1_inf
536 uint16 min_length_password;
537 uint16 password_history;
538 uint32 password_properties;
539 NTTIME expire;
540 NTTIME min_passwordage;
542 } SAM_UNK_INFO_1;
544 typedef struct sam_unknown_info_2_inf
546 NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */
547 UNIHDR hdr_comment; /* comment according to samba4 idl */
548 UNIHDR hdr_domain; /* domain name unicode header */
549 UNIHDR hdr_server; /* server name unicode header */
551 /* put all the data in here, at the moment, including what the above
552 pointer is referring to
555 UINT64_S seq_num;
557 uint32 unknown_4; /* 0x0000 0001 */
558 uint32 server_role;
559 uint32 unknown_6; /* 0x0000 0001 */
560 uint32 num_domain_usrs; /* number of users in domain */
561 uint32 num_domain_grps; /* number of domain groups in domain */
562 uint32 num_local_grps; /* number of local groups in domain */
564 UNISTR2 uni_comment; /* comment unicode string */
565 UNISTR2 uni_domain; /* domain name unicode string */
566 UNISTR2 uni_server; /* server name unicode string */
568 } SAM_UNK_INFO_2;
570 typedef struct sam_unknown_info_3_info
572 NTTIME logout;
573 /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
574 /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
576 } SAM_UNK_INFO_3;
578 typedef struct sam_unknown_info_4_inf
580 UNIHDR hdr_comment; /* comment according to samba4 idl */
581 UNISTR2 uni_comment; /* comment unicode string */
583 } SAM_UNK_INFO_4;
585 typedef struct sam_unknown_info_5_inf
587 UNIHDR hdr_domain; /* domain name unicode header */
588 UNISTR2 uni_domain; /* domain name unicode string */
590 } SAM_UNK_INFO_5;
592 typedef struct sam_unknown_info_6_info
594 UNIHDR hdr_server; /* server name unicode header */
595 UNISTR2 uni_server; /* server name unicode string */
597 } SAM_UNK_INFO_6;
599 typedef struct sam_unknown_info_7_info
601 uint16 server_role;
603 } SAM_UNK_INFO_7;
605 typedef struct sam_unknown_info_8_info
607 UINT64_S seq_num;
608 NTTIME domain_create_time;
610 } SAM_UNK_INFO_8;
612 typedef struct sam_unknown_info_9_info
614 uint32 unknown;
616 } SAM_UNK_INFO_9;
618 typedef struct sam_unknown_info_12_inf
620 NTTIME duration;
621 NTTIME reset_count;
622 uint16 bad_attempt_lockout;
624 } SAM_UNK_INFO_12;
626 typedef struct sam_unknown_info_13_info
628 UINT64_S seq_num;
629 NTTIME domain_create_time;
630 uint32 unknown1;
631 uint32 unknown2;
633 } SAM_UNK_INFO_13;
635 typedef struct sam_unknown_ctr_info
637 union
639 SAM_UNK_INFO_1 inf1;
640 SAM_UNK_INFO_2 inf2;
641 SAM_UNK_INFO_3 inf3;
642 SAM_UNK_INFO_4 inf4;
643 SAM_UNK_INFO_5 inf5;
644 SAM_UNK_INFO_6 inf6;
645 SAM_UNK_INFO_7 inf7;
646 SAM_UNK_INFO_8 inf8;
647 SAM_UNK_INFO_9 inf9;
648 SAM_UNK_INFO_12 inf12;
649 SAM_UNK_INFO_13 inf13;
651 } info;
653 } SAM_UNK_CTR;
656 /* SAMR_R_QUERY_DOMAIN_INFO - */
657 typedef struct r_samr_query_domain_info
659 uint32 ptr_0;
660 uint16 switch_value; /* same as in query */
662 SAM_UNK_CTR *ctr;
664 NTSTATUS status; /* return status */
666 } SAMR_R_QUERY_DOMAIN_INFO;
669 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
670 typedef struct q_samr_lookup_domain_info
672 POLICY_HND connect_pol;
674 UNIHDR hdr_domain;
675 UNISTR2 uni_domain;
677 } SAMR_Q_LOOKUP_DOMAIN;
680 /* SAMR_R_LOOKUP_DOMAIN */
681 typedef struct r_samr_lookup_domain_info
683 uint32 ptr_sid;
684 DOM_SID2 dom_sid;
686 NTSTATUS status;
688 } SAMR_R_LOOKUP_DOMAIN;
691 /****************************************************************************
692 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
694 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
695 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
696 *****************************************************************************/
698 /* SAMR_Q_OPEN_DOMAIN */
699 typedef struct q_samr_open_domain_info
701 POLICY_HND pol; /* policy handle */
702 uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
703 DOM_SID2 dom_sid; /* domain SID */
705 } SAMR_Q_OPEN_DOMAIN;
708 /* SAMR_R_OPEN_DOMAIN - probably an open */
709 typedef struct r_samr_open_domain_info
711 POLICY_HND domain_pol; /* policy handle associated with the SID */
712 NTSTATUS status; /* return status */
714 } SAMR_R_OPEN_DOMAIN;
716 #define MAX_SAM_ENTRIES_W2K 0x400
717 #define MAX_SAM_ENTRIES_W95 50
718 /* The following should be the greater of the preceeding two. */
719 #define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
721 typedef struct samr_entry_info
723 uint32 rid;
724 UNIHDR hdr_name;
726 } SAM_ENTRY;
729 /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
730 typedef struct q_samr_enum_domains_info
732 POLICY_HND pol; /* policy handle */
734 uint32 start_idx; /* enumeration handle */
735 uint32 max_size; /* 0x0000 ffff */
737 } SAMR_Q_ENUM_DOMAINS;
739 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
740 typedef struct r_samr_enum_domains_info
742 uint32 next_idx; /* next starting index required for enum */
743 uint32 ptr_entries1;
745 uint32 num_entries2;
746 uint32 ptr_entries2;
748 uint32 num_entries3;
750 SAM_ENTRY *sam;
751 UNISTR2 *uni_dom_name;
753 uint32 num_entries4;
755 NTSTATUS status;
757 } SAMR_R_ENUM_DOMAINS;
759 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
760 typedef struct q_samr_enum_dom_users_info
762 POLICY_HND pol; /* policy handle */
764 uint32 start_idx; /* number of values (0 indicates unlimited?) */
765 uint32 acb_mask; /* 0x0000 indicates all */
767 uint32 max_size; /* 0x0000 ffff */
769 } SAMR_Q_ENUM_DOM_USERS;
772 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
773 typedef struct r_samr_enum_dom_users_info
775 uint32 next_idx; /* next starting index required for enum */
776 uint32 ptr_entries1;
778 uint32 num_entries2;
779 uint32 ptr_entries2;
781 uint32 num_entries3;
783 SAM_ENTRY *sam;
784 UNISTR2 *uni_acct_name;
786 uint32 num_entries4;
788 NTSTATUS status;
790 } SAMR_R_ENUM_DOM_USERS;
793 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
794 typedef struct q_samr_enum_dom_groups_info
796 POLICY_HND pol; /* policy handle */
798 /* this is possibly an enumeration context handle... */
799 uint32 start_idx; /* 0x0000 0000 */
801 uint32 max_size; /* 0x0000 ffff */
803 } SAMR_Q_ENUM_DOM_GROUPS;
806 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
807 typedef struct r_samr_enum_dom_groups_info
809 uint32 next_idx;
810 uint32 ptr_entries1;
812 uint32 num_entries2;
813 uint32 ptr_entries2;
815 uint32 num_entries3;
817 SAM_ENTRY *sam;
818 UNISTR2 *uni_grp_name;
820 uint32 num_entries4;
822 NTSTATUS status;
824 } SAMR_R_ENUM_DOM_GROUPS;
827 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
828 typedef struct q_samr_enum_dom_aliases_info
830 POLICY_HND pol; /* policy handle */
832 /* this is possibly an enumeration context handle... */
833 uint32 start_idx; /* 0x0000 0000 */
835 uint32 max_size; /* 0x0000 ffff */
837 } SAMR_Q_ENUM_DOM_ALIASES;
840 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
841 typedef struct r_samr_enum_dom_aliases_info
843 uint32 next_idx;
844 uint32 ptr_entries1;
846 uint32 num_entries2;
847 uint32 ptr_entries2;
849 uint32 num_entries3;
851 SAM_ENTRY *sam;
852 UNISTR2 *uni_grp_name;
854 uint32 num_entries4;
856 NTSTATUS status;
858 } SAMR_R_ENUM_DOM_ALIASES;
861 /* -- Level 1 Display Info - User Information -- */
863 typedef struct samr_entry_info1
865 uint32 user_idx;
867 uint32 rid_user;
868 uint32 acb_info;
870 UNIHDR hdr_acct_name;
871 UNIHDR hdr_user_name;
872 UNIHDR hdr_user_desc;
874 } SAM_ENTRY1;
876 typedef struct samr_str_entry_info1
878 UNISTR2 uni_acct_name;
879 UNISTR2 uni_full_name;
880 UNISTR2 uni_acct_desc;
882 } SAM_STR1;
884 typedef struct sam_entry_info_1
886 SAM_ENTRY1 *sam;
887 SAM_STR1 *str;
889 } SAM_DISPINFO_1;
892 /* -- Level 2 Display Info - Trust Account Information -- */
894 typedef struct samr_entry_info2
896 uint32 user_idx;
898 uint32 rid_user;
899 uint32 acb_info;
901 UNIHDR hdr_srv_name;
902 UNIHDR hdr_srv_desc;
904 } SAM_ENTRY2;
906 typedef struct samr_str_entry_info2
908 UNISTR2 uni_srv_name;
909 UNISTR2 uni_srv_desc;
911 } SAM_STR2;
913 typedef struct sam_entry_info_2
915 SAM_ENTRY2 *sam;
916 SAM_STR2 *str;
918 } SAM_DISPINFO_2;
921 /* -- Level 3 Display Info - Domain Group Information -- */
923 typedef struct samr_entry_info3
925 uint32 grp_idx;
927 uint32 rid_grp;
928 uint32 attr; /* SE_GROUP_xxx, usually 7 */
930 UNIHDR hdr_grp_name;
931 UNIHDR hdr_grp_desc;
933 } SAM_ENTRY3;
935 typedef struct samr_str_entry_info3
937 UNISTR2 uni_grp_name;
938 UNISTR2 uni_grp_desc;
940 } SAM_STR3;
942 typedef struct sam_entry_info_3
944 SAM_ENTRY3 *sam;
945 SAM_STR3 *str;
947 } SAM_DISPINFO_3;
950 /* -- Level 4 Display Info - User List (ASCII) -- */
952 typedef struct samr_entry_info4
954 uint32 user_idx;
955 STRHDR hdr_acct_name;
957 } SAM_ENTRY4;
959 typedef struct samr_str_entry_info4
961 STRING2 acct_name;
963 } SAM_STR4;
965 typedef struct sam_entry_info_4
967 SAM_ENTRY4 *sam;
968 SAM_STR4 *str;
970 } SAM_DISPINFO_4;
973 /* -- Level 5 Display Info - Group List (ASCII) -- */
975 typedef struct samr_entry_info5
977 uint32 grp_idx;
978 STRHDR hdr_grp_name;
980 } SAM_ENTRY5;
982 typedef struct samr_str_entry_info5
984 STRING2 grp_name;
986 } SAM_STR5;
988 typedef struct sam_entry_info_5
990 SAM_ENTRY5 *sam;
991 SAM_STR5 *str;
993 } SAM_DISPINFO_5;
996 typedef struct sam_dispinfo_ctr_info
998 union
1000 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
1001 SAM_DISPINFO_2 *info2; /* trust accounts */
1002 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
1003 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
1004 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
1005 void *info; /* allows assignment without typecasting, */
1007 } sam;
1009 } SAM_DISPINFO_CTR;
1012 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
1013 typedef struct q_samr_query_disp_info
1015 POLICY_HND domain_pol;
1017 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1018 /* align */
1020 uint32 start_idx; /* start enumeration index */
1021 uint32 max_entries; /* maximum number of entries to return */
1022 uint32 max_size; /* recommended data size; if exceeded server
1023 should return STATUS_MORE_ENTRIES */
1025 } SAMR_Q_QUERY_DISPINFO;
1028 /* SAMR_R_QUERY_DISPINFO */
1029 typedef struct r_samr_query_dispinfo_info
1031 uint32 total_size; /* total data size for all matching entries
1032 (0 = uncalculated) */
1033 uint32 data_size; /* actual data size returned = size of SAM_ENTRY
1034 structures + total length of strings */
1036 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1037 /* align */
1039 uint32 num_entries; /* number of entries returned */
1040 uint32 ptr_entries;
1041 uint32 num_entries2;
1043 SAM_DISPINFO_CTR *ctr;
1045 NTSTATUS status;
1047 } SAMR_R_QUERY_DISPINFO;
1050 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
1051 typedef struct q_samr_delete_dom_group_info
1053 POLICY_HND group_pol; /* policy handle */
1055 } SAMR_Q_DELETE_DOM_GROUP;
1058 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
1059 typedef struct r_samr_delete_dom_group_info
1061 POLICY_HND pol; /* policy handle */
1062 NTSTATUS status; /* return status */
1064 } SAMR_R_DELETE_DOM_GROUP;
1067 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
1068 typedef struct q_samr_create_dom_group_info
1070 POLICY_HND pol; /* policy handle */
1072 UNIHDR hdr_acct_desc;
1073 UNISTR2 uni_acct_desc;
1075 uint32 access_mask;
1077 } SAMR_Q_CREATE_DOM_GROUP;
1079 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
1080 typedef struct r_samr_create_dom_group_info
1082 POLICY_HND pol; /* policy handle */
1084 uint32 rid;
1085 NTSTATUS status;
1087 } SAMR_R_CREATE_DOM_GROUP;
1089 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
1090 typedef struct q_samr_query_group_info
1092 POLICY_HND pol; /* policy handle */
1094 uint16 switch_level; /* 0x0001 seen */
1096 } SAMR_Q_QUERY_GROUPINFO;
1098 typedef struct samr_group_info1
1100 UNIHDR hdr_acct_name;
1102 uint32 group_attr; /* 0x0000 0003 - group attribute */
1103 uint32 num_members; /* 0x0000 0001 - number of group members? */
1105 UNIHDR hdr_acct_desc;
1107 UNISTR2 uni_acct_name;
1108 UNISTR2 uni_acct_desc;
1110 } GROUP_INFO1;
1112 typedef struct samr_group_info2
1114 uint16 level;
1115 UNIHDR hdr_acct_name;
1116 UNISTR2 uni_acct_name;
1118 } GROUP_INFO2;
1120 typedef struct samr_group_info3
1122 uint32 group_attr; /* 0x0000 0003 - group attribute */
1124 } GROUP_INFO3;
1126 typedef struct samr_group_info4
1128 uint16 level;
1129 UNIHDR hdr_acct_desc;
1130 UNISTR2 uni_acct_desc;
1132 } GROUP_INFO4;
1134 typedef struct samr_group_info5
1136 UNIHDR hdr_acct_name;
1138 uint32 group_attr; /* 0x0000 0003 - group attribute */
1139 uint32 num_members; /* 0x0000 0001 - number of group members? */
1141 UNIHDR hdr_acct_desc;
1143 UNISTR2 uni_acct_name;
1144 UNISTR2 uni_acct_desc;
1146 } GROUP_INFO5;
1149 /* GROUP_INFO_CTR */
1150 typedef struct group_info_ctr
1152 uint16 switch_value1;
1154 union
1156 GROUP_INFO1 info1;
1157 GROUP_INFO2 info2;
1158 GROUP_INFO3 info3;
1159 GROUP_INFO4 info4;
1160 GROUP_INFO5 info5;
1161 } group;
1163 } GROUP_INFO_CTR;
1165 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
1166 typedef struct r_samr_query_groupinfo_info
1168 uint32 ptr;
1169 GROUP_INFO_CTR *ctr;
1171 NTSTATUS status;
1173 } SAMR_R_QUERY_GROUPINFO;
1176 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
1177 typedef struct q_samr_set_group_info
1179 POLICY_HND pol; /* policy handle */
1180 GROUP_INFO_CTR *ctr;
1182 } SAMR_Q_SET_GROUPINFO;
1184 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
1185 typedef struct r_samr_set_group_info
1187 NTSTATUS status;
1189 } SAMR_R_SET_GROUPINFO;
1192 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1193 typedef struct q_samr_delete_dom_alias_info
1195 POLICY_HND alias_pol; /* policy handle */
1197 } SAMR_Q_DELETE_DOM_ALIAS;
1200 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1201 typedef struct r_samr_delete_dom_alias_info
1203 POLICY_HND pol; /* policy handle */
1204 NTSTATUS status; /* return status */
1206 } SAMR_R_DELETE_DOM_ALIAS;
1209 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1210 typedef struct q_samr_create_dom_alias_info
1212 POLICY_HND dom_pol; /* policy handle */
1214 UNIHDR hdr_acct_desc;
1215 UNISTR2 uni_acct_desc;
1217 uint32 access_mask; /* 0x001f000f */
1219 } SAMR_Q_CREATE_DOM_ALIAS;
1221 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1222 typedef struct r_samr_create_dom_alias_info
1224 POLICY_HND alias_pol; /* policy handle */
1226 uint32 rid;
1227 NTSTATUS status;
1229 } SAMR_R_CREATE_DOM_ALIAS;
1232 /********************************************************/
1234 typedef struct {
1235 UNISTR4 name;
1236 UNISTR4 description;
1237 uint32 num_member;
1238 } ALIAS_INFO1;
1240 typedef struct {
1241 UNISTR4 name;
1242 } ALIAS_INFO2;
1244 typedef struct {
1245 UNISTR4 description;
1246 } ALIAS_INFO3;
1248 typedef struct {
1249 POLICY_HND pol; /* policy handle */
1250 uint16 level; /* 0x0003 seen */
1251 } SAMR_Q_QUERY_ALIASINFO;
1253 typedef struct {
1254 uint16 level;
1255 union {
1256 ALIAS_INFO1 info1;
1257 ALIAS_INFO2 info2;
1258 ALIAS_INFO3 info3;
1259 } alias;
1260 } ALIAS_INFO_CTR;
1262 typedef struct {
1263 ALIAS_INFO_CTR *ctr;
1264 NTSTATUS status;
1265 } SAMR_R_QUERY_ALIASINFO;
1268 /********************************************************/
1270 typedef struct {
1271 POLICY_HND alias_pol; /* policy handle */
1272 ALIAS_INFO_CTR ctr;
1273 } SAMR_Q_SET_ALIASINFO;
1275 typedef struct {
1276 NTSTATUS status;
1277 } SAMR_R_SET_ALIASINFO;
1280 /********************************************************/
1282 /* SAMR_Q_QUERY_USERGROUPS - */
1283 typedef struct q_samr_query_usergroup_info
1285 POLICY_HND pol; /* policy handle associated with unknown id */
1287 } SAMR_Q_QUERY_USERGROUPS;
1289 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1290 typedef struct r_samr_query_usergroup_info
1292 uint32 ptr_0; /* pointer */
1293 uint32 num_entries; /* number of RID groups */
1294 uint32 ptr_1; /* pointer */
1295 uint32 num_entries2; /* number of RID groups */
1297 DOM_GID *gid; /* group info */
1299 NTSTATUS status; /* return status */
1301 } SAMR_R_QUERY_USERGROUPS;
1303 /* SAM_USERINFO_CTR - sam user info */
1304 typedef struct sam_userinfo_ctr_info
1306 uint16 switch_value;
1308 union
1310 SAM_USER_INFO_7 *id7;
1311 SAM_USER_INFO_9 *id9;
1312 SAM_USER_INFO_16 *id16;
1313 SAM_USER_INFO_17 *id17;
1314 SAM_USER_INFO_18 *id18;
1315 SAM_USER_INFO_20 *id20;
1316 SAM_USER_INFO_21 *id21;
1317 SAM_USER_INFO_23 *id23;
1318 SAM_USER_INFO_24 *id24;
1319 SAM_USER_INFO_25 *id25;
1320 SAM_USER_INFO_26 *id26;
1321 void* id; /* to make typecasting easy */
1323 } info;
1325 } SAM_USERINFO_CTR;
1328 /* SAMR_Q_SET_USERINFO2 - set sam info */
1329 typedef struct q_samr_set_user_info2
1331 POLICY_HND pol; /* policy handle associated with user */
1332 uint16 switch_value; /* 0x0010 */
1334 SAM_USERINFO_CTR *ctr;
1336 } SAMR_Q_SET_USERINFO2;
1338 /* SAMR_R_SET_USERINFO2 - set sam info */
1339 typedef struct r_samr_set_user_info2
1341 NTSTATUS status; /* return status */
1343 } SAMR_R_SET_USERINFO2;
1345 /* SAMR_Q_SET_USERINFO - set sam info */
1346 typedef struct q_samr_set_user_info
1348 POLICY_HND pol; /* policy handle associated with user */
1349 uint16 switch_value;
1350 SAM_USERINFO_CTR *ctr;
1352 } SAMR_Q_SET_USERINFO;
1354 /* SAMR_R_SET_USERINFO - set sam info */
1355 typedef struct r_samr_set_user_info
1357 NTSTATUS status; /* return status */
1359 } SAMR_R_SET_USERINFO;
1362 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1363 typedef struct q_samr_query_user_info
1365 POLICY_HND pol; /* policy handle associated with unknown id */
1366 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1368 } SAMR_Q_QUERY_USERINFO;
1370 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1371 typedef struct r_samr_query_user_info
1373 uint32 ptr; /* pointer */
1374 SAM_USERINFO_CTR *ctr;
1376 NTSTATUS status; /* return status */
1378 } SAMR_R_QUERY_USERINFO;
1381 /****************************************************************************
1382 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1384 the policy handle allocated by an "samr open secret" call is associated
1385 with a SID. this policy handle is what is queried here, *not* the SID
1386 itself. the response to the lookup rids is relative to this SID.
1387 *****************************************************************************/
1388 /* SAMR_Q_QUERY_USERALIASES */
1389 typedef struct q_samr_query_useraliases_info
1391 POLICY_HND pol; /* policy handle */
1393 uint32 num_sids1; /* number of rids being looked up */
1394 uint32 ptr; /* buffer pointer */
1395 uint32 num_sids2; /* number of rids being looked up */
1397 uint32 *ptr_sid; /* pointers to sids to be looked up */
1398 DOM_SID2 *sid ; /* sids to be looked up. */
1400 } SAMR_Q_QUERY_USERALIASES;
1403 /* SAMR_R_QUERY_USERALIASES */
1404 typedef struct r_samr_query_useraliases_info
1406 uint32 num_entries;
1407 uint32 ptr; /* undocumented buffer pointer */
1409 uint32 num_entries2;
1410 uint32 *rid; /* domain RIDs being looked up */
1412 NTSTATUS status; /* return code */
1414 } SAMR_R_QUERY_USERALIASES;
1417 /****************************************************************************
1418 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1419 *****************************************************************************/
1420 /* SAMR_Q_LOOKUP_NAMES */
1421 typedef struct q_samr_lookup_names_info
1423 POLICY_HND pol; /* policy handle */
1425 uint32 num_names1; /* number of names being looked up */
1426 uint32 flags; /* 0x0000 03e8 - unknown */
1427 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1428 uint32 num_names2; /* number of names being looked up */
1430 UNIHDR *hdr_name; /* unicode account name header */
1431 UNISTR2 *uni_name; /* unicode account name string */
1433 } SAMR_Q_LOOKUP_NAMES;
1436 /* SAMR_R_LOOKUP_NAMES */
1437 typedef struct r_samr_lookup_names_info
1439 uint32 num_rids1; /* number of aliases being looked up */
1440 uint32 ptr_rids; /* pointer to aliases */
1441 uint32 num_rids2; /* number of aliases being looked up */
1443 uint32 *rids; /* rids */
1445 uint32 num_types1; /* number of users in aliases being looked up */
1446 uint32 ptr_types; /* pointer to users in aliases */
1447 uint32 num_types2; /* number of users in aliases being looked up */
1449 uint32 *types; /* SID_ENUM type */
1451 NTSTATUS status; /* return code */
1453 } SAMR_R_LOOKUP_NAMES;
1456 /****************************************************************************
1457 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1459 called to resolve domain RID groups.
1460 *****************************************************************************/
1461 /* SAMR_Q_LOOKUP_RIDS */
1462 typedef struct q_samr_lookup_rids_info
1464 POLICY_HND pol; /* policy handle */
1466 uint32 num_rids1; /* number of rids being looked up */
1467 uint32 flags; /* 0x0000 03e8 - unknown */
1468 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1469 uint32 num_rids2; /* number of rids being looked up */
1471 uint32 *rid; /* domain RIDs being looked up */
1473 } SAMR_Q_LOOKUP_RIDS;
1476 /****************************************************************************
1477 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1479 *****************************************************************************/
1480 /* SAMR_R_LOOKUP_RIDS */
1481 typedef struct r_samr_lookup_rids_info
1483 uint32 num_names1; /* number of aliases being looked up */
1484 uint32 ptr_names; /* pointer to aliases */
1485 uint32 num_names2; /* number of aliases being looked up */
1487 UNIHDR *hdr_name; /* unicode account name header */
1488 UNISTR2 *uni_name; /* unicode account name string */
1490 uint32 num_types1; /* number of users in aliases being looked up */
1491 uint32 ptr_types; /* pointer to users in aliases */
1492 uint32 num_types2; /* number of users in aliases being looked up */
1494 uint32 *type; /* SID_ENUM type */
1496 NTSTATUS status;
1498 } SAMR_R_LOOKUP_RIDS;
1501 /* SAMR_Q_OPEN_USER - probably an open */
1502 typedef struct q_samr_open_user_info
1504 POLICY_HND domain_pol; /* policy handle */
1505 uint32 access_mask; /* 32 bit unknown - 0x02011b */
1506 uint32 user_rid; /* user RID */
1508 } SAMR_Q_OPEN_USER;
1511 /* SAMR_R_OPEN_USER - probably an open */
1512 typedef struct r_samr_open_user_info
1514 POLICY_HND user_pol; /* policy handle associated with unknown id */
1515 NTSTATUS status; /* return status */
1517 } SAMR_R_OPEN_USER;
1520 /* SAMR_Q_CREATE_USER - probably a create */
1521 typedef struct q_samr_create_user_info
1523 POLICY_HND domain_pol; /* policy handle */
1525 UNIHDR hdr_name; /* unicode account name header */
1526 UNISTR2 uni_name; /* unicode account name */
1528 uint32 acb_info; /* account control info */
1529 uint32 access_mask; /* 0xe005 00b0 */
1531 } SAMR_Q_CREATE_USER;
1534 /* SAMR_R_CREATE_USER - probably a create */
1535 typedef struct r_samr_create_user_info
1537 POLICY_HND user_pol; /* policy handle associated with user */
1539 uint32 access_granted;
1540 uint32 user_rid; /* user RID */
1541 NTSTATUS status; /* return status */
1543 } SAMR_R_CREATE_USER;
1546 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
1547 typedef struct q_samr_delete_dom_user_info
1549 POLICY_HND user_pol; /* policy handle */
1551 } SAMR_Q_DELETE_DOM_USER;
1554 /* SAMR_R_DELETE_DOM_USER - delete domain user */
1555 typedef struct r_samr_delete_dom_user_info
1557 POLICY_HND pol; /* policy handle */
1558 NTSTATUS status; /* return status */
1560 } SAMR_R_DELETE_DOM_USER;
1563 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1564 typedef struct q_samr_query_groupmem_info
1566 POLICY_HND group_pol; /* policy handle */
1568 } SAMR_Q_QUERY_GROUPMEM;
1571 /* SAMR_R_QUERY_GROUPMEM - query group members */
1572 typedef struct r_samr_query_groupmem_info
1574 uint32 ptr;
1575 uint32 num_entries;
1577 uint32 ptr_rids;
1578 uint32 ptr_attrs;
1580 uint32 num_rids;
1581 uint32 *rid;
1583 uint32 num_attrs;
1584 uint32 *attr;
1586 NTSTATUS status;
1588 } SAMR_R_QUERY_GROUPMEM;
1591 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1592 typedef struct q_samr_del_group_mem_info
1594 POLICY_HND pol; /* policy handle */
1595 uint32 rid; /* rid */
1597 } SAMR_Q_DEL_GROUPMEM;
1600 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1601 typedef struct r_samr_del_group_mem_info
1603 NTSTATUS status; /* return status */
1605 } SAMR_R_DEL_GROUPMEM;
1608 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1609 typedef struct q_samr_add_group_mem_info
1611 POLICY_HND pol; /* policy handle */
1613 uint32 rid; /* rid */
1614 uint32 unknown; /* 0x0000 0005 */
1616 } SAMR_Q_ADD_GROUPMEM;
1619 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1620 typedef struct r_samr_add_group_mem_info
1622 NTSTATUS status; /* return status */
1624 } SAMR_R_ADD_GROUPMEM;
1627 /* SAMR_Q_OPEN_GROUP - probably an open */
1628 typedef struct q_samr_open_group_info
1630 POLICY_HND domain_pol; /* policy handle */
1631 uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1632 uint32 rid_group; /* rid */
1634 } SAMR_Q_OPEN_GROUP;
1637 /* SAMR_R_OPEN_GROUP - probably an open */
1638 typedef struct r_samr_open_group_info
1640 POLICY_HND pol; /* policy handle */
1641 NTSTATUS status; /* return status */
1643 } SAMR_R_OPEN_GROUP;
1646 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1647 typedef struct q_samr_query_aliasmem_info
1649 POLICY_HND alias_pol; /* policy handle */
1651 } SAMR_Q_QUERY_ALIASMEM;
1654 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1655 typedef struct r_samr_query_aliasmem_info
1657 uint32 num_sids;
1658 uint32 ptr;
1659 uint32 num_sids1;
1661 DOM_SID2 *sid;
1663 NTSTATUS status;
1665 } SAMR_R_QUERY_ALIASMEM;
1668 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1669 typedef struct q_samr_add_alias_mem_info
1671 POLICY_HND alias_pol; /* policy handle */
1673 DOM_SID2 sid; /* member sid to be added to the alias */
1675 } SAMR_Q_ADD_ALIASMEM;
1678 /* SAMR_R_ADD_ALIASMEM - add alias member */
1679 typedef struct r_samr_add_alias_mem_info
1681 NTSTATUS status; /* return status */
1683 } SAMR_R_ADD_ALIASMEM;
1686 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1687 typedef struct q_samr_del_alias_mem_info
1689 POLICY_HND alias_pol; /* policy handle */
1691 DOM_SID2 sid; /* member sid to be added to alias */
1693 } SAMR_Q_DEL_ALIASMEM;
1696 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1697 typedef struct r_samr_del_alias_mem_info
1699 NTSTATUS status; /* return status */
1701 } SAMR_R_DEL_ALIASMEM;
1705 /* SAMR_Q_OPEN_ALIAS - probably an open */
1706 typedef struct q_samr_open_alias_info
1708 POLICY_HND dom_pol;
1710 uint32 access_mask;
1711 uint32 rid_alias;
1713 } SAMR_Q_OPEN_ALIAS;
1716 /* SAMR_R_OPEN_ALIAS - probably an open */
1717 typedef struct r_samr_open_alias_info
1719 POLICY_HND pol; /* policy handle */
1720 NTSTATUS status; /* return status */
1722 } SAMR_R_OPEN_ALIAS;
1725 /* SAMR_Q_CONNECT_ANON - probably an open */
1726 typedef struct q_samr_connect_anon_info {
1727 uint32 ptr; /* ptr? */
1728 uint16 unknown_0; /* Only pushed if ptr is non-zero. */
1729 uint32 access_mask;
1730 } SAMR_Q_CONNECT_ANON;
1732 /* SAMR_R_CONNECT_ANON - probably an open */
1733 typedef struct r_samr_connect_anon_info
1735 POLICY_HND connect_pol; /* policy handle */
1736 NTSTATUS status; /* return status */
1738 } SAMR_R_CONNECT_ANON;
1740 /* SAMR_Q_CONNECT - probably an open */
1741 typedef struct q_samr_connect_info
1743 uint32 ptr_srv_name; /* pointer (to server name?) */
1744 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1746 uint32 access_mask;
1748 } SAMR_Q_CONNECT;
1751 /* SAMR_R_CONNECT - probably an open */
1752 typedef struct r_samr_connect_info
1754 POLICY_HND connect_pol; /* policy handle */
1755 NTSTATUS status; /* return status */
1757 } SAMR_R_CONNECT;
1759 /* SAMR_Q_CONNECT4 */
1760 typedef struct q_samr_connect4_info
1762 uint32 ptr_srv_name; /* pointer to server name */
1763 UNISTR2 uni_srv_name;
1765 uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */
1766 uint32 access_mask;
1767 } SAMR_Q_CONNECT4;
1769 /* SAMR_R_CONNECT4 - same format as connect */
1770 typedef struct r_samr_connect_info SAMR_R_CONNECT4;
1772 /* SAMR_Q_CONNECT5 */
1773 typedef struct q_samr_connect5_info
1775 uint32 ptr_srv_name; /* pointer to server name */
1776 UNISTR2 uni_srv_name;
1777 uint32 access_mask;
1778 uint32 level;
1779 /* These following are acutally a level dependent
1780 value. Fudge it for now. JRA */
1781 uint32 info1_unk1;
1782 uint32 info1_unk2;
1783 } SAMR_Q_CONNECT5;
1785 /* SAMR_R_CONNECT5 */
1786 typedef struct r_samr_connect_info5
1788 uint32 level;
1789 uint32 info1_unk1;
1790 uint32 info1_unk2;
1791 POLICY_HND connect_pol; /* policy handle */
1792 NTSTATUS status; /* return status */
1794 } SAMR_R_CONNECT5;
1797 /* SAMR_Q_GET_DOM_PWINFO */
1798 typedef struct q_samr_get_dom_pwinfo
1800 uint32 ptr;
1801 UNIHDR hdr_srv_name;
1802 UNISTR2 uni_srv_name;
1804 } SAMR_Q_GET_DOM_PWINFO;
1806 #define DOMAIN_PASSWORD_COMPLEX 0x00000001
1807 #define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002
1808 #define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004
1809 #define DOMAIN_LOCKOUT_ADMINS 0x00000008
1810 #define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010
1811 #define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020
1813 /* SAMR_R_GET_DOM_PWINFO */
1814 typedef struct r_samr_get_dom_pwinfo
1816 uint16 min_pwd_length;
1817 uint32 password_properties;
1818 NTSTATUS status;
1820 } SAMR_R_GET_DOM_PWINFO;
1822 /* SAMR_ENC_PASSWD */
1823 typedef struct enc_passwd_info
1825 uint32 ptr;
1826 uint8 pass[516];
1828 } SAMR_ENC_PASSWD;
1830 /* SAMR_ENC_HASH */
1831 typedef struct enc_hash_info
1833 uint32 ptr;
1834 uint8 hash[16];
1836 } SAMR_ENC_HASH;
1838 /* SAMR_Q_CHGPASSWD_USER */
1839 typedef struct q_samr_chgpasswd_user_info
1841 uint32 ptr_0;
1843 UNIHDR hdr_dest_host; /* server name unicode header */
1844 UNISTR2 uni_dest_host; /* server name unicode string */
1846 UNIHDR hdr_user_name; /* username unicode string header */
1847 UNISTR2 uni_user_name; /* username unicode string */
1849 SAMR_ENC_PASSWD nt_newpass;
1850 SAMR_ENC_HASH nt_oldhash;
1852 uint32 unknown; /* 0x0000 0001 */
1854 SAMR_ENC_PASSWD lm_newpass;
1855 SAMR_ENC_HASH lm_oldhash;
1857 } SAMR_Q_CHGPASSWD_USER;
1859 /* SAMR_R_CHGPASSWD_USER */
1860 typedef struct r_samr_chgpasswd_user_info
1862 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1864 } SAMR_R_CHGPASSWD_USER;
1866 /* SAMR_Q_CHGPASSWD3 */
1867 typedef struct q_samr_chgpasswd_user3
1869 uint32 ptr_0;
1871 UNIHDR hdr_dest_host; /* server name unicode header */
1872 UNISTR2 uni_dest_host; /* server name unicode string */
1874 UNIHDR hdr_user_name; /* username unicode string header */
1875 UNISTR2 uni_user_name; /* username unicode string */
1877 SAMR_ENC_PASSWD nt_newpass;
1878 SAMR_ENC_HASH nt_oldhash;
1880 uint32 lm_change; /* 0x0000 0001 */
1882 SAMR_ENC_PASSWD lm_newpass;
1883 SAMR_ENC_HASH lm_oldhash;
1885 SAMR_ENC_PASSWD password3;
1887 } SAMR_Q_CHGPASSWD_USER3;
1889 #define REJECT_REASON_OTHER 0x00000000
1890 #define REJECT_REASON_TOO_SHORT 0x00000001
1891 #define REJECT_REASON_IN_HISTORY 0x00000002
1892 #define REJECT_REASON_NOT_COMPLEX 0x00000005
1894 /* SAMR_CHANGE_REJECT */
1895 typedef struct samr_change_reject
1897 uint32 reject_reason;
1898 uint32 unknown1;
1899 uint32 unknown2;
1901 } SAMR_CHANGE_REJECT;
1903 /* SAMR_R_CHGPASSWD3 */
1904 typedef struct r_samr_chgpasswd_user3
1906 uint32 ptr_info;
1907 uint32 ptr_reject;
1908 SAM_UNK_INFO_1 *info;
1909 SAMR_CHANGE_REJECT *reject;
1910 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1912 } SAMR_R_CHGPASSWD_USER3;
1916 /* SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN */
1917 typedef struct q_samr_remove_sid_foreign_domain_info
1919 POLICY_HND dom_pol; /* policy handle */
1920 DOM_SID2 sid; /* SID */
1922 } SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN;
1925 /* SAMR_R_REMOVE_SID_FOREIGN_DOMAIN */
1926 typedef struct r_samr_remove_sid_foreign_domain_info
1928 NTSTATUS status; /* return status */
1930 } SAMR_R_REMOVE_SID_FOREIGN_DOMAIN;
1934 /* these are from the old rpc_samr.h - they are needed while the merge
1935 is still going on */
1936 #define MAX_SAM_SIDS 15
1938 /* DOM_SID3 - security id */
1939 typedef struct sid_info_3
1941 uint16 len; /* length, bytes, including length of len :-) */
1942 /* uint8 pad[2]; */
1944 DOM_SID sid;
1946 } DOM_SID3;
1948 /* SAMR_Q_QUERY_DOMAIN_INFO2 */
1949 typedef struct q_samr_query_domain_info2
1951 POLICY_HND domain_pol; /* policy handle */
1952 uint16 switch_value;
1954 } SAMR_Q_QUERY_DOMAIN_INFO2;
1956 /* SAMR_R_QUERY_DOMAIN_INFO2 */
1957 typedef struct r_samr_query_domain_info2
1959 uint32 ptr_0;
1960 uint16 switch_value;
1961 SAM_UNK_CTR *ctr;
1962 NTSTATUS status; /* return status */
1964 } SAMR_R_QUERY_DOMAIN_INFO2;
1966 /* SAMR_Q_SET_DOMAIN_INFO */
1967 typedef struct q_samr_set_domain_info
1969 POLICY_HND domain_pol; /* policy handle */
1970 uint16 switch_value0;
1971 uint16 switch_value;
1972 SAM_UNK_CTR *ctr;
1974 } SAMR_Q_SET_DOMAIN_INFO;
1976 /* SAMR_R_SET_DOMAIN_INFO */
1977 typedef struct r_samr_set_domain_info
1979 NTSTATUS status; /* return status */
1981 } SAMR_R_SET_DOMAIN_INFO;
1983 #endif /* _RPC_SAMR_H */