r4904: sync up with 3.0 for 3.0.11pre2
[Samba.git] / source / include / rpc_samr.h
bloba007bcd2e578cb17eaab391e28fd835f90e35147
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 #include "rpc_misc.h"
31 /*******************************************************************
32 the following information comes from a QuickView on samsrv.dll,
33 and gives an idea of exactly what is needed:
35 x SamrAddMemberToAlias
36 x SamrAddMemberToGroup
37 SamrAddMultipleMembersToAlias
38 x SamrChangePasswordUser
39 x SamrCloseHandle
40 x SamrConnect
41 x SamrCreateAliasInDomain
42 x SamrCreateGroupInDomain
43 x SamrCreateUserInDomain
44 ? SamrDeleteAlias
45 SamrDeleteGroup
46 x SamrDeleteUser
47 x SamrEnumerateAliasesInDomain
48 SamrEnumerateDomainsInSamServer
49 x SamrEnumerateGroupsInDomain
50 x SamrEnumerateUsersInDomain
51 SamrGetUserDomainPasswordInformation
52 SamrLookupDomainInSamServer
53 ? SamrLookupIdsInDomain
54 x SamrLookupNamesInDomain
55 x SamrOpenAlias
56 x SamrOpenDomain
57 x SamrOpenGroup
58 x SamrOpenUser
59 x SamrQueryDisplayInformation
60 x SamrQueryInformationAlias
61 SamrQueryInformationDomain
62 ? SamrQueryInformationUser
63 x SamrQuerySecurityObject
64 SamrRemoveMemberFromAlias
65 SamrRemoveMemberFromForiegnDomain
66 SamrRemoveMemberFromGroup
67 SamrRemoveMultipleMembersFromAlias
68 x SamrSetInformationAlias
69 SamrSetInformationDomain
70 x SamrSetInformationGroup
71 x SamrSetInformationUser
72 SamrSetMemberAttributesOfGroup
73 SamrSetSecurityObject
74 SamrShutdownSamServer
75 SamrTestPrivateFunctionsDomain
76 SamrTestPrivateFunctionsUser
78 ********************************************************************/
80 #define SAMR_CONNECT_ANON 0x00
81 #define SAMR_CLOSE_HND 0x01
82 #define SAMR_SET_SEC_OBJECT 0x02
83 #define SAMR_QUERY_SEC_OBJECT 0x03
85 #define SAMR_UNKNOWN_4 0x04 /* profile info? */
86 #define SAMR_LOOKUP_DOMAIN 0x05
87 #define SAMR_ENUM_DOMAINS 0x06
88 #define SAMR_OPEN_DOMAIN 0x07
89 #define SAMR_QUERY_DOMAIN_INFO 0x08
90 #define SAMR_SET_DOMAIN_INFO 0x09
92 #define SAMR_CREATE_DOM_GROUP 0x0a
93 #define SAMR_ENUM_DOM_GROUPS 0x0b
94 #define SAMR_ENUM_DOM_USERS 0x0d
95 #define SAMR_CREATE_DOM_ALIAS 0x0e
96 #define SAMR_ENUM_DOM_ALIASES 0x0f
97 #define SAMR_QUERY_USERALIASES 0x10
99 #define SAMR_LOOKUP_NAMES 0x11
100 #define SAMR_LOOKUP_RIDS 0x12
102 #define SAMR_OPEN_GROUP 0x13
103 #define SAMR_QUERY_GROUPINFO 0x14
104 #define SAMR_SET_GROUPINFO 0x15
105 #define SAMR_ADD_GROUPMEM 0x16
106 #define SAMR_DELETE_DOM_GROUP 0x17
107 #define SAMR_DEL_GROUPMEM 0x18
108 #define SAMR_QUERY_GROUPMEM 0x19
109 #define SAMR_UNKNOWN_1A 0x1a
111 #define SAMR_OPEN_ALIAS 0x1b
112 #define SAMR_QUERY_ALIASINFO 0x1c
113 #define SAMR_SET_ALIASINFO 0x1d
114 #define SAMR_DELETE_DOM_ALIAS 0x1e
115 #define SAMR_ADD_ALIASMEM 0x1f
116 #define SAMR_DEL_ALIASMEM 0x20
117 #define SAMR_QUERY_ALIASMEM 0x21
119 #define SAMR_OPEN_USER 0x22
120 #define SAMR_DELETE_DOM_USER 0x23
121 #define SAMR_QUERY_USERINFO 0x24
122 #define SAMR_SET_USERINFO2 0x25
123 #define SAMR_QUERY_USERGROUPS 0x27
125 #define SAMR_QUERY_DISPINFO 0x28
126 #define SAMR_UNKNOWN_29 0x29
127 #define SAMR_UNKNOWN_2a 0x2a
128 #define SAMR_UNKNOWN_2b 0x2b
129 #define SAMR_GET_USRDOM_PWINFO 0x2c
130 #define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d
131 #define SAMR_UNKNOWN_2E 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
132 #define SAMR_UNKNOWN_2f 0x2f
133 #define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO
134 with info level 3 */
135 #define SAMR_UNKNOWN_31 0x31
136 #define SAMR_CREATE_USER 0x32
137 #define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO
138 with info level 4 */
139 #define SAMR_ADDMULTI_ALIASMEM 0x34
141 #define SAMR_UNKNOWN_35 0x35
142 #define SAMR_UNKNOWN_36 0x36
143 #define SAMR_CHGPASSWD_USER 0x37
144 #define SAMR_GET_DOM_PWINFO 0x38
145 #define SAMR_CONNECT 0x39
146 #define SAMR_SET_USERINFO 0x3A
147 #define SAMR_CONNECT4 0x3E
149 typedef struct logon_hours_info
151 uint32 len; /* normally 21 bytes */
152 uint8 hours[32];
154 } LOGON_HRS;
156 /* SAM_USER_INFO_23 */
157 typedef struct sam_user_info_23
159 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
160 NTTIME logon_time; /* logon time */
161 NTTIME logoff_time; /* logoff time */
162 NTTIME kickoff_time; /* kickoff time */
163 NTTIME pass_last_set_time; /* password last set time */
164 NTTIME pass_can_change_time; /* password can change time */
165 NTTIME pass_must_change_time; /* password must change time */
167 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
168 UNIHDR hdr_full_name; /* user's full name unicode string header */
169 UNIHDR hdr_home_dir; /* home directory unicode string header */
170 UNIHDR hdr_dir_drive; /* home drive unicode string header */
171 UNIHDR hdr_logon_script; /* logon script unicode string header */
172 UNIHDR hdr_profile_path; /* profile path unicode string header */
173 UNIHDR hdr_acct_desc ; /* user description */
174 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
175 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
176 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
178 uint8 lm_pwd[16]; /* lm user passwords */
179 uint8 nt_pwd[16]; /* nt user passwords */
181 uint32 user_rid; /* Primary User ID */
182 uint32 group_rid; /* Primary Group ID */
184 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
186 uint32 fields_present; /* 0x09f8 27fa */
188 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
189 /* uint8 pad[2] */
190 uint32 ptr_logon_hrs; /* pointer to logon hours */
192 /* Was unknown_5. */
193 uint16 bad_password_count;
194 uint16 logon_count;
196 uint8 padding1[6];
198 uint8 passmustchange; /* 0x00 must change = 0x01 */
200 uint8 padding2;
202 uint8 pass[516];
204 UNISTR2 uni_user_name; /* NULL - username unicode string */
205 UNISTR2 uni_full_name; /* user's full name unicode string */
206 UNISTR2 uni_home_dir; /* home directory unicode string */
207 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
208 UNISTR2 uni_logon_script; /* logon script unicode string */
209 UNISTR2 uni_profile_path; /* profile path unicode string */
210 UNISTR2 uni_acct_desc ; /* user description unicode string */
211 UNISTR2 uni_workstations; /* login from workstations unicode string */
212 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
213 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
215 uint32 unknown_6; /* 0x0000 04ec */
216 uint32 padding4;
218 LOGON_HRS logon_hrs;
220 } SAM_USER_INFO_23;
222 /* SAM_USER_INFO_24 */
223 typedef struct sam_user_info_24
225 uint8 pass[516];
226 uint16 pw_len;
227 } SAM_USER_INFO_24;
230 * NB. This structure is *definately* incorrect. It's my best guess
231 * currently for W2K SP2. The password field is encrypted in a different
232 * way than normal... And there are definately other problems. JRA.
235 /* SAM_USER_INFO_25 */
236 typedef struct sam_user_info_25
238 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
239 NTTIME logon_time; /* logon time */
240 NTTIME logoff_time; /* logoff time */
241 NTTIME kickoff_time; /* kickoff time */
242 NTTIME pass_last_set_time; /* password last set time */
243 NTTIME pass_can_change_time; /* password can change time */
244 NTTIME pass_must_change_time; /* password must change time */
246 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
247 UNIHDR hdr_full_name; /* user's full name unicode string header */
248 UNIHDR hdr_home_dir; /* home directory unicode string header */
249 UNIHDR hdr_dir_drive; /* home drive unicode string header */
250 UNIHDR hdr_logon_script; /* logon script unicode string header */
251 UNIHDR hdr_profile_path; /* profile path unicode string header */
252 UNIHDR hdr_acct_desc ; /* user description */
253 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
254 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
255 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
257 uint8 lm_pwd[16]; /* lm user passwords */
258 uint8 nt_pwd[16]; /* nt user passwords */
260 uint32 user_rid; /* Primary User ID */
261 uint32 group_rid; /* Primary Group ID */
263 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
265 uint32 unknown_6[6];
267 uint8 pass[532];
269 UNISTR2 uni_user_name; /* NULL - username unicode string */
270 UNISTR2 uni_full_name; /* user's full name unicode string */
271 UNISTR2 uni_home_dir; /* home directory unicode string */
272 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
273 UNISTR2 uni_logon_script; /* logon script unicode string */
274 UNISTR2 uni_profile_path; /* profile path unicode string */
275 UNISTR2 uni_acct_desc ; /* user description unicode string */
276 UNISTR2 uni_workstations; /* login from workstations unicode string */
277 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
278 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
279 } SAM_USER_INFO_25;
282 /* SAM_USER_INFO_21 */
283 typedef struct sam_user_info_21
285 NTTIME logon_time; /* logon time */
286 NTTIME logoff_time; /* logoff time */
287 NTTIME kickoff_time; /* kickoff time */
288 NTTIME pass_last_set_time; /* password last set time */
289 NTTIME pass_can_change_time; /* password can change time */
290 NTTIME pass_must_change_time; /* password must change time */
292 UNIHDR hdr_user_name; /* username unicode string header */
293 UNIHDR hdr_full_name; /* user's full name unicode string header */
294 UNIHDR hdr_home_dir; /* home directory unicode string header */
295 UNIHDR hdr_dir_drive; /* home drive unicode string header */
296 UNIHDR hdr_logon_script; /* logon script unicode string header */
297 UNIHDR hdr_profile_path; /* profile path unicode string header */
298 UNIHDR hdr_acct_desc ; /* user description */
299 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
300 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
301 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
303 uint8 lm_pwd[16]; /* lm user passwords */
304 uint8 nt_pwd[16]; /* nt user passwords */
306 uint32 user_rid; /* Primary User ID */
307 uint32 group_rid; /* Primary Group ID */
309 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
311 /* Was unknown_3 */
312 uint32 fields_present; /* 0x00ff ffff */
314 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
315 /* uint8 pad[2] */
316 uint32 ptr_logon_hrs; /* unknown pointer */
318 /* Was unknown_5. */
319 uint16 bad_password_count;
320 uint16 logon_count;
322 uint8 padding1[6];
324 uint8 passmustchange; /* 0x00 must change = 0x01 */
326 uint8 padding2;
328 UNISTR2 uni_user_name; /* username unicode string */
329 UNISTR2 uni_full_name; /* user's full name unicode string */
330 UNISTR2 uni_home_dir; /* home directory unicode string */
331 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
332 UNISTR2 uni_logon_script; /* logon script unicode string */
333 UNISTR2 uni_profile_path; /* profile path unicode string */
334 UNISTR2 uni_acct_desc ; /* user description unicode string */
335 UNISTR2 uni_workstations; /* login from workstations unicode string */
336 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
337 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
339 uint32 unknown_6; /* 0x0000 04ec */
340 uint32 padding4;
342 LOGON_HRS logon_hrs;
344 } SAM_USER_INFO_21;
346 #define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
347 #define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
349 /* SAM_USER_INFO_20 */
350 typedef struct sam_user_info_20
352 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
354 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
356 } SAM_USER_INFO_20;
358 /* SAM_USER_INFO_12 */
359 typedef struct sam_user_info_12
361 uint8 lm_pwd[16]; /* lm user passwords */
362 uint8 nt_pwd[16]; /* nt user passwords */
364 uint8 lm_pwd_active;
365 uint8 nt_pwd_active;
367 } SAM_USER_INFO_12;
369 /* SAM_USER_INFO_11 */
370 typedef struct sam_user_info_11
372 uint8 padding_0[16]; /* 0 - padding 16 bytes */
373 NTTIME expiry; /* expiry time or something? */
374 uint8 padding_1[24]; /* 0 - padding 24 bytes */
376 UNIHDR hdr_mach_acct; /* unicode header for machine account */
377 uint32 padding_2; /* 0 - padding 4 bytes */
379 uint32 ptr_1; /* pointer */
380 uint8 padding_3[32]; /* 0 - padding 32 bytes */
381 uint32 padding_4; /* 0 - padding 4 bytes */
383 uint32 ptr_2; /* pointer */
384 uint32 padding_5; /* 0 - padding 4 bytes */
386 uint32 ptr_3; /* pointer */
387 uint8 padding_6[32]; /* 0 - padding 32 bytes */
389 uint32 rid_user; /* user RID */
390 uint32 rid_group; /* group RID */
392 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
393 uint16 unknown_3; /* 16 bit padding */
395 uint16 unknown_4; /* 0x003f - 16 bit unknown */
396 uint16 unknown_5; /* 0x003c - 16 bit unknown */
398 uint8 padding_7[16]; /* 0 - padding 16 bytes */
399 uint32 padding_8; /* 0 - padding 4 bytes */
401 UNISTR2 uni_mach_acct; /* unicode string for machine account */
403 uint8 padding_9[48]; /* 0 - padding 48 bytes */
405 } SAM_USER_INFO_11;
408 /* SAM_USER_INFO_10 */
409 typedef struct sam_user_info_10
411 uint32 acb_info;
413 } SAM_USER_INFO_10;
415 /* SAM_USER_INFO_7 */
416 typedef struct sam_user_info_7
418 UNIHDR hdr_name; /* unicode header for name */
419 UNISTR2 uni_name; /* unicode string for name */
421 } SAM_USER_INFO_7;
424 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
425 typedef struct q_samr_close_hnd_info
427 POLICY_HND pol; /* policy handle */
429 } SAMR_Q_CLOSE_HND;
432 /* SAMR_R_CLOSE_HND - probably a policy handle close */
433 typedef struct r_samr_close_hnd_info
435 POLICY_HND pol; /* policy handle */
436 NTSTATUS status; /* return status */
438 } SAMR_R_CLOSE_HND;
441 /****************************************************************************
442 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
443 *****************************************************************************/
445 /* SAMR_Q_GET_USRDOM_PWINFO */
446 typedef struct q_samr_usrdom_pwinfo_info
448 POLICY_HND user_pol; /* policy handle */
450 } SAMR_Q_GET_USRDOM_PWINFO;
453 /****************************************************************************
454 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
455 *****************************************************************************/
457 /* SAMR_R_GET_USRDOM_PWINFO */
458 typedef struct r_samr_usrdom_pwinfo_info
460 uint16 unknown_0; /* 0000 */
461 uint16 unknown_1; /* 0x0016 or 0x0015 */
462 uint32 unknown_2; /* 0x0000 0000 */
463 NTSTATUS status;
465 } SAMR_R_GET_USRDOM_PWINFO;
467 /****************************************************************************
468 SAMR_Q_SET_SEC_OBJ - info level 4.
469 *****************************************************************************/
471 /* SAMR_Q_SET_SEC_OBJ - */
472 typedef struct q_samr_set_sec_obj_info
474 POLICY_HND pol; /* policy handle */
475 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
476 SEC_DESC_BUF *buf;
478 } SAMR_Q_SET_SEC_OBJ;
480 /* SAMR_R_SET_SEC_OBJ - */
481 typedef struct r_samr_set_sec_obj_info
483 NTSTATUS status; /* return status */
485 } SAMR_R_SET_SEC_OBJ;
488 /****************************************************************************
489 SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
490 *****************************************************************************/
492 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
493 typedef struct q_samr_query_sec_obj_info
495 POLICY_HND user_pol; /* policy handle */
496 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
498 } SAMR_Q_QUERY_SEC_OBJ;
500 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
501 typedef struct r_samr_query_sec_obj_info
503 uint32 ptr;
504 SEC_DESC_BUF *buf;
506 NTSTATUS status; /* return status */
508 } SAMR_R_QUERY_SEC_OBJ;
511 /****************************************************************************
512 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
513 *****************************************************************************/
515 /* SAMR_Q_QUERY_DOMAIN_INFO - */
516 typedef struct q_samr_query_domain_info
518 POLICY_HND domain_pol; /* policy handle */
519 uint16 switch_value; /* 0x0002, 0x0001 */
521 } SAMR_Q_QUERY_DOMAIN_INFO;
523 typedef struct sam_unknown_info_3_info
525 NTTIME logout;
526 /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
528 /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
530 } SAM_UNK_INFO_3;
532 typedef struct sam_unknown_info_6_info
534 uint32 unknown_0; /* 0x0000 0000 */
536 uint32 ptr_0; /* pointer to unknown structure */
537 uint8 padding[12]; /* 12 bytes zeros */
539 } SAM_UNK_INFO_6;
541 typedef struct sam_unknown_info_7_info
543 uint16 unknown_0; /* 0x0003 */
545 } SAM_UNK_INFO_7;
547 typedef struct sam_unknown_info_8_info
549 UINT64_S seq_num;
550 NTTIME domain_create_time;
552 } SAM_UNK_INFO_8;
554 typedef struct sam_unknown_info_12_inf
556 NTTIME duration;
557 NTTIME reset_count;
558 uint16 bad_attempt_lockout;
560 } SAM_UNK_INFO_12;
562 typedef struct sam_unknown_info_5_inf
564 UNIHDR hdr_server; /* server name unicode header */
565 UNISTR2 uni_server; /* server name unicode string */
567 } SAM_UNK_INFO_5;
569 typedef struct sam_unknown_info_2_inf
571 NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */
572 UNIHDR hdr_comment; /* comment according to samba4 idl */
573 UNIHDR hdr_domain; /* domain name unicode header */
574 UNIHDR hdr_server; /* server name unicode header */
576 /* put all the data in here, at the moment, including what the above
577 pointer is referring to
580 UINT64_S seq_num;
582 uint32 unknown_4; /* 0x0000 0001 */
583 uint32 unknown_5; /* 0x0000 0003 */
584 uint32 unknown_6; /* 0x0000 0001 */
585 uint32 num_domain_usrs; /* number of users in domain */
586 uint32 num_domain_grps; /* number of domain groups in domain */
587 uint32 num_local_grps; /* number of local groups in domain */
589 uint8 padding[12]; /* 12 bytes zeros */
591 UNISTR2 uni_comment; /* comment unicode string */
592 UNISTR2 uni_domain; /* domain name unicode string */
593 UNISTR2 uni_server; /* server name unicode string */
595 } SAM_UNK_INFO_2;
597 typedef struct sam_unknown_info_1_inf
599 uint16 min_length_password;
600 uint16 password_history;
601 uint32 flag;
602 NTTIME expire;
603 NTTIME min_passwordage;
605 } SAM_UNK_INFO_1;
608 typedef struct sam_unknown_ctr_info
610 union
612 SAM_UNK_INFO_1 inf1;
613 SAM_UNK_INFO_2 inf2;
614 SAM_UNK_INFO_3 inf3;
615 SAM_UNK_INFO_5 inf5;
616 SAM_UNK_INFO_6 inf6;
617 SAM_UNK_INFO_7 inf7;
618 SAM_UNK_INFO_8 inf8;
619 SAM_UNK_INFO_12 inf12;
621 } info;
623 } SAM_UNK_CTR;
626 /* SAMR_R_QUERY_DOMAIN_INFO - */
627 typedef struct r_samr_query_domain_info
629 uint32 ptr_0;
630 uint16 switch_value; /* same as in query */
632 SAM_UNK_CTR *ctr;
634 NTSTATUS status; /* return status */
636 } SAMR_R_QUERY_DOMAIN_INFO;
639 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
640 typedef struct q_samr_lookup_domain_info
642 POLICY_HND connect_pol;
644 UNIHDR hdr_domain;
645 UNISTR2 uni_domain;
647 } SAMR_Q_LOOKUP_DOMAIN;
650 /* SAMR_R_LOOKUP_DOMAIN */
651 typedef struct r_samr_lookup_domain_info
653 uint32 ptr_sid;
654 DOM_SID2 dom_sid;
656 NTSTATUS status;
658 } SAMR_R_LOOKUP_DOMAIN;
661 /****************************************************************************
662 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
664 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
665 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
666 *****************************************************************************/
668 /* SAMR_Q_OPEN_DOMAIN */
669 typedef struct q_samr_open_domain_info
671 POLICY_HND pol; /* policy handle */
672 uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
673 DOM_SID2 dom_sid; /* domain SID */
675 } SAMR_Q_OPEN_DOMAIN;
678 /* SAMR_R_OPEN_DOMAIN - probably an open */
679 typedef struct r_samr_open_domain_info
681 POLICY_HND domain_pol; /* policy handle associated with the SID */
682 NTSTATUS status; /* return status */
684 } SAMR_R_OPEN_DOMAIN;
686 #define MAX_SAM_ENTRIES_W2K 0x400
687 #define MAX_SAM_ENTRIES_W95 50
688 /* The following should be the greater of the preceeding two. */
689 #define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
691 typedef struct samr_entry_info
693 uint32 rid;
694 UNIHDR hdr_name;
696 } SAM_ENTRY;
699 /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
700 typedef struct q_samr_enum_domains_info
702 POLICY_HND pol; /* policy handle */
704 uint32 start_idx; /* enumeration handle */
705 uint32 max_size; /* 0x0000 ffff */
707 } SAMR_Q_ENUM_DOMAINS;
709 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
710 typedef struct r_samr_enum_domains_info
712 uint32 next_idx; /* next starting index required for enum */
713 uint32 ptr_entries1;
715 uint32 num_entries2;
716 uint32 ptr_entries2;
718 uint32 num_entries3;
720 SAM_ENTRY *sam;
721 UNISTR2 *uni_dom_name;
723 uint32 num_entries4;
725 NTSTATUS status;
727 } SAMR_R_ENUM_DOMAINS;
729 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
730 typedef struct q_samr_enum_dom_users_info
732 POLICY_HND pol; /* policy handle */
734 uint32 start_idx; /* number of values (0 indicates unlimited?) */
735 uint16 acb_mask; /* 0x0000 indicates all */
736 uint16 unknown_1; /* 0x0000 */
738 uint32 max_size; /* 0x0000 ffff */
740 } SAMR_Q_ENUM_DOM_USERS;
743 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
744 typedef struct r_samr_enum_dom_users_info
746 uint32 next_idx; /* next starting index required for enum */
747 uint32 ptr_entries1;
749 uint32 num_entries2;
750 uint32 ptr_entries2;
752 uint32 num_entries3;
754 SAM_ENTRY *sam;
755 UNISTR2 *uni_acct_name;
757 uint32 num_entries4;
759 NTSTATUS status;
761 } SAMR_R_ENUM_DOM_USERS;
764 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
765 typedef struct q_samr_enum_dom_groups_info
767 POLICY_HND pol; /* policy handle */
769 /* this is possibly an enumeration context handle... */
770 uint32 start_idx; /* 0x0000 0000 */
772 uint32 max_size; /* 0x0000 ffff */
774 } SAMR_Q_ENUM_DOM_GROUPS;
777 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
778 typedef struct r_samr_enum_dom_groups_info
780 uint32 next_idx;
781 uint32 ptr_entries1;
783 uint32 num_entries2;
784 uint32 ptr_entries2;
786 uint32 num_entries3;
788 SAM_ENTRY *sam;
789 UNISTR2 *uni_grp_name;
791 uint32 num_entries4;
793 NTSTATUS status;
795 } SAMR_R_ENUM_DOM_GROUPS;
798 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
799 typedef struct q_samr_enum_dom_aliases_info
801 POLICY_HND pol; /* policy handle */
803 /* this is possibly an enumeration context handle... */
804 uint32 start_idx; /* 0x0000 0000 */
806 uint32 max_size; /* 0x0000 ffff */
808 } SAMR_Q_ENUM_DOM_ALIASES;
811 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
812 typedef struct r_samr_enum_dom_aliases_info
814 uint32 next_idx;
815 uint32 ptr_entries1;
817 uint32 num_entries2;
818 uint32 ptr_entries2;
820 uint32 num_entries3;
822 SAM_ENTRY *sam;
823 UNISTR2 *uni_grp_name;
825 uint32 num_entries4;
827 NTSTATUS status;
829 } SAMR_R_ENUM_DOM_ALIASES;
832 /* -- Level 1 Display Info - User Information -- */
834 typedef struct samr_entry_info1
836 uint32 user_idx;
838 uint32 rid_user;
839 uint16 acb_info;
841 UNIHDR hdr_acct_name;
842 UNIHDR hdr_user_name;
843 UNIHDR hdr_user_desc;
845 } SAM_ENTRY1;
847 typedef struct samr_str_entry_info1
849 UNISTR2 uni_acct_name;
850 UNISTR2 uni_full_name;
851 UNISTR2 uni_acct_desc;
853 } SAM_STR1;
855 typedef struct sam_entry_info_1
857 SAM_ENTRY1 *sam;
858 SAM_STR1 *str;
860 } SAM_DISPINFO_1;
863 /* -- Level 2 Display Info - Trust Account Information -- */
865 typedef struct samr_entry_info2
867 uint32 user_idx;
869 uint32 rid_user;
870 uint16 acb_info;
872 UNIHDR hdr_srv_name;
873 UNIHDR hdr_srv_desc;
875 } SAM_ENTRY2;
877 typedef struct samr_str_entry_info2
879 UNISTR2 uni_srv_name;
880 UNISTR2 uni_srv_desc;
882 } SAM_STR2;
884 typedef struct sam_entry_info_2
886 SAM_ENTRY2 *sam;
887 SAM_STR2 *str;
889 } SAM_DISPINFO_2;
892 /* -- Level 3 Display Info - Domain Group Information -- */
894 typedef struct samr_entry_info3
896 uint32 grp_idx;
898 uint32 rid_grp;
899 uint32 attr; /* SE_GROUP_xxx, usually 7 */
901 UNIHDR hdr_grp_name;
902 UNIHDR hdr_grp_desc;
904 } SAM_ENTRY3;
906 typedef struct samr_str_entry_info3
908 UNISTR2 uni_grp_name;
909 UNISTR2 uni_grp_desc;
911 } SAM_STR3;
913 typedef struct sam_entry_info_3
915 SAM_ENTRY3 *sam;
916 SAM_STR3 *str;
918 } SAM_DISPINFO_3;
921 /* -- Level 4 Display Info - User List (ASCII) -- */
923 typedef struct samr_entry_info4
925 uint32 user_idx;
926 STRHDR hdr_acct_name;
928 } SAM_ENTRY4;
930 typedef struct samr_str_entry_info4
932 STRING2 acct_name;
934 } SAM_STR4;
936 typedef struct sam_entry_info_4
938 SAM_ENTRY4 *sam;
939 SAM_STR4 *str;
941 } SAM_DISPINFO_4;
944 /* -- Level 5 Display Info - Group List (ASCII) -- */
946 typedef struct samr_entry_info5
948 uint32 grp_idx;
949 STRHDR hdr_grp_name;
951 } SAM_ENTRY5;
953 typedef struct samr_str_entry_info5
955 STRING2 grp_name;
957 } SAM_STR5;
959 typedef struct sam_entry_info_5
961 SAM_ENTRY5 *sam;
962 SAM_STR5 *str;
964 } SAM_DISPINFO_5;
967 typedef struct sam_dispinfo_ctr_info
969 union
971 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
972 SAM_DISPINFO_2 *info2; /* trust accounts */
973 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
974 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
975 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
976 void *info; /* allows assignment without typecasting, */
978 } sam;
980 } SAM_DISPINFO_CTR;
983 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
984 typedef struct q_samr_query_disp_info
986 POLICY_HND domain_pol;
988 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
989 /* align */
991 uint32 start_idx; /* start enumeration index */
992 uint32 max_entries; /* maximum number of entries to return */
993 uint32 max_size; /* recommended data size; if exceeded server
994 should return STATUS_MORE_ENTRIES */
996 } SAMR_Q_QUERY_DISPINFO;
999 /* SAMR_R_QUERY_DISPINFO */
1000 typedef struct r_samr_query_dispinfo_info
1002 uint32 total_size; /* total data size for all matching entries
1003 (0 = uncalculated) */
1004 uint32 data_size; /* actual data size returned = size of SAM_ENTRY
1005 structures + total length of strings */
1007 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1008 /* align */
1010 uint32 num_entries; /* number of entries returned */
1011 uint32 ptr_entries;
1012 uint32 num_entries2;
1014 SAM_DISPINFO_CTR *ctr;
1016 NTSTATUS status;
1018 } SAMR_R_QUERY_DISPINFO;
1021 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
1022 typedef struct q_samr_delete_dom_group_info
1024 POLICY_HND group_pol; /* policy handle */
1026 } SAMR_Q_DELETE_DOM_GROUP;
1029 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
1030 typedef struct r_samr_delete_dom_group_info
1032 POLICY_HND pol; /* policy handle */
1033 NTSTATUS status; /* return status */
1035 } SAMR_R_DELETE_DOM_GROUP;
1038 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
1039 typedef struct q_samr_create_dom_group_info
1041 POLICY_HND pol; /* policy handle */
1043 UNIHDR hdr_acct_desc;
1044 UNISTR2 uni_acct_desc;
1046 uint32 access_mask;
1048 } SAMR_Q_CREATE_DOM_GROUP;
1050 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
1051 typedef struct r_samr_create_dom_group_info
1053 POLICY_HND pol; /* policy handle */
1055 uint32 rid;
1056 NTSTATUS status;
1058 } SAMR_R_CREATE_DOM_GROUP;
1060 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
1061 typedef struct q_samr_query_group_info
1063 POLICY_HND pol; /* policy handle */
1065 uint16 switch_level; /* 0x0001 seen */
1067 } SAMR_Q_QUERY_GROUPINFO;
1069 typedef struct samr_group_info1
1071 UNIHDR hdr_acct_name;
1073 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
1074 uint32 num_members; /* 0x0000 0001 - number of group members? */
1076 UNIHDR hdr_acct_desc;
1078 UNISTR2 uni_acct_name;
1079 UNISTR2 uni_acct_desc;
1081 } GROUP_INFO1;
1083 typedef struct samr_group_info2
1085 uint16 level;
1086 UNIHDR hdr_acct_name;
1087 UNISTR2 uni_acct_name;
1089 } GROUP_INFO2;
1091 typedef struct samr_group_info3
1093 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
1095 } GROUP_INFO3;
1097 typedef struct samr_group_info4
1099 uint16 level;
1100 UNIHDR hdr_acct_desc;
1101 UNISTR2 uni_acct_desc;
1103 } GROUP_INFO4;
1105 /* GROUP_INFO_CTR */
1106 typedef struct group_info_ctr
1108 uint16 switch_value1;
1110 union
1112 GROUP_INFO1 info1;
1113 GROUP_INFO2 info2;
1114 GROUP_INFO3 info3;
1115 GROUP_INFO4 info4;
1117 } group;
1119 } GROUP_INFO_CTR;
1121 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
1122 typedef struct r_samr_query_groupinfo_info
1124 uint32 ptr;
1125 GROUP_INFO_CTR *ctr;
1127 NTSTATUS status;
1129 } SAMR_R_QUERY_GROUPINFO;
1132 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
1133 typedef struct q_samr_set_group_info
1135 POLICY_HND pol; /* policy handle */
1136 GROUP_INFO_CTR *ctr;
1138 } SAMR_Q_SET_GROUPINFO;
1140 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
1141 typedef struct r_samr_set_group_info
1143 NTSTATUS status;
1145 } SAMR_R_SET_GROUPINFO;
1148 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1149 typedef struct q_samr_delete_dom_alias_info
1151 POLICY_HND alias_pol; /* policy handle */
1153 } SAMR_Q_DELETE_DOM_ALIAS;
1156 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1157 typedef struct r_samr_delete_dom_alias_info
1159 POLICY_HND pol; /* policy handle */
1160 NTSTATUS status; /* return status */
1162 } SAMR_R_DELETE_DOM_ALIAS;
1165 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1166 typedef struct q_samr_create_dom_alias_info
1168 POLICY_HND dom_pol; /* policy handle */
1170 UNIHDR hdr_acct_desc;
1171 UNISTR2 uni_acct_desc;
1173 uint32 access_mask; /* 0x001f000f */
1175 } SAMR_Q_CREATE_DOM_ALIAS;
1177 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1178 typedef struct r_samr_create_dom_alias_info
1180 POLICY_HND alias_pol; /* policy handle */
1182 uint32 rid;
1183 NTSTATUS status;
1185 } SAMR_R_CREATE_DOM_ALIAS;
1187 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
1188 typedef struct q_samr_query_alias_info
1190 POLICY_HND pol; /* policy handle */
1192 uint16 switch_level; /* 0x0003 seen */
1194 } SAMR_Q_QUERY_ALIASINFO;
1196 typedef struct samr_alias_info1
1198 UNIHDR hdr_acct_name;
1199 UNIHDR hdr_acct_desc;
1200 uint32 num_member;
1201 UNISTR2 uni_acct_name;
1202 UNISTR2 uni_acct_desc;
1204 } ALIAS_INFO1;
1206 typedef struct samr_alias_info3
1208 UNIHDR hdr_acct_desc;
1209 UNISTR2 uni_acct_desc;
1211 } ALIAS_INFO3;
1213 /* ALIAS_INFO_CTR */
1214 typedef struct alias_info_ctr
1216 uint16 switch_value1;
1217 uint16 switch_value2;
1219 union
1221 ALIAS_INFO1 info1;
1222 ALIAS_INFO3 info3;
1224 } alias;
1226 } ALIAS_INFO_CTR;
1228 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
1229 typedef struct r_samr_query_aliasinfo_info
1231 uint32 ptr;
1232 ALIAS_INFO_CTR ctr;
1234 NTSTATUS status;
1236 } SAMR_R_QUERY_ALIASINFO;
1239 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
1240 typedef struct q_samr_set_alias_info
1242 POLICY_HND alias_pol; /* policy handle */
1243 ALIAS_INFO_CTR ctr;
1245 } SAMR_Q_SET_ALIASINFO;
1247 /* SAMR_R_SET_ALIASINFO - SAM alias info */
1248 typedef struct r_samr_set_aliasinfo_info
1250 NTSTATUS status;
1252 } SAMR_R_SET_ALIASINFO;
1255 /* SAMR_Q_QUERY_USERGROUPS - */
1256 typedef struct q_samr_query_usergroup_info
1258 POLICY_HND pol; /* policy handle associated with unknown id */
1260 } SAMR_Q_QUERY_USERGROUPS;
1262 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1263 typedef struct r_samr_query_usergroup_info
1265 uint32 ptr_0; /* pointer */
1266 uint32 num_entries; /* number of RID groups */
1267 uint32 ptr_1; /* pointer */
1268 uint32 num_entries2; /* number of RID groups */
1270 DOM_GID *gid; /* group info */
1272 NTSTATUS status; /* return status */
1274 } SAMR_R_QUERY_USERGROUPS;
1276 /* SAM_USERINFO_CTR - sam user info */
1277 typedef struct sam_userinfo_ctr_info
1279 uint16 switch_value;
1281 union
1283 SAM_USER_INFO_7 *id7; /* auth-level 0x07 */
1284 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
1285 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
1286 SAM_USER_INFO_12 *id12; /* auth-level 0x12 */
1287 SAM_USER_INFO_20 *id20; /* auth-level 20 */
1288 SAM_USER_INFO_21 *id21; /* auth-level 21 */
1289 SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
1290 SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
1291 SAM_USER_INFO_25 *id25; /* auth-level 0x19 */
1292 void* id; /* to make typecasting easy */
1294 } info;
1296 } SAM_USERINFO_CTR;
1299 /* SAMR_Q_SET_USERINFO2 - set sam info */
1300 typedef struct q_samr_set_user_info2
1302 POLICY_HND pol; /* policy handle associated with user */
1303 uint16 switch_value; /* 0x0010 */
1305 SAM_USERINFO_CTR *ctr;
1307 } SAMR_Q_SET_USERINFO2;
1309 /* SAMR_R_SET_USERINFO2 - set sam info */
1310 typedef struct r_samr_set_user_info2
1312 NTSTATUS status; /* return status */
1314 } SAMR_R_SET_USERINFO2;
1316 /* SAMR_Q_SET_USERINFO - set sam info */
1317 typedef struct q_samr_set_user_info
1319 POLICY_HND pol; /* policy handle associated with user */
1320 uint16 switch_value;
1321 SAM_USERINFO_CTR *ctr;
1323 } SAMR_Q_SET_USERINFO;
1325 /* SAMR_R_SET_USERINFO - set sam info */
1326 typedef struct r_samr_set_user_info
1328 NTSTATUS status; /* return status */
1330 } SAMR_R_SET_USERINFO;
1333 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1334 typedef struct q_samr_query_user_info
1336 POLICY_HND pol; /* policy handle associated with unknown id */
1337 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1339 } SAMR_Q_QUERY_USERINFO;
1341 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1342 typedef struct r_samr_query_user_info
1344 uint32 ptr; /* pointer */
1345 SAM_USERINFO_CTR *ctr;
1347 NTSTATUS status; /* return status */
1349 } SAMR_R_QUERY_USERINFO;
1352 /****************************************************************************
1353 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1355 the policy handle allocated by an "samr open secret" call is associated
1356 with a SID. this policy handle is what is queried here, *not* the SID
1357 itself. the response to the lookup rids is relative to this SID.
1358 *****************************************************************************/
1359 /* SAMR_Q_QUERY_USERALIASES */
1360 typedef struct q_samr_query_useraliases_info
1362 POLICY_HND pol; /* policy handle */
1364 uint32 num_sids1; /* number of rids being looked up */
1365 uint32 ptr; /* buffer pointer */
1366 uint32 num_sids2; /* number of rids being looked up */
1368 uint32 *ptr_sid; /* pointers to sids to be looked up */
1369 DOM_SID2 *sid ; /* sids to be looked up. */
1371 } SAMR_Q_QUERY_USERALIASES;
1374 /* SAMR_R_QUERY_USERALIASES */
1375 typedef struct r_samr_query_useraliases_info
1377 uint32 num_entries;
1378 uint32 ptr; /* undocumented buffer pointer */
1380 uint32 num_entries2;
1381 uint32 *rid; /* domain RIDs being looked up */
1383 NTSTATUS status; /* return code */
1385 } SAMR_R_QUERY_USERALIASES;
1388 /****************************************************************************
1389 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1390 *****************************************************************************/
1391 /* SAMR_Q_LOOKUP_NAMES */
1392 typedef struct q_samr_lookup_names_info
1394 POLICY_HND pol; /* policy handle */
1396 uint32 num_names1; /* number of names being looked up */
1397 uint32 flags; /* 0x0000 03e8 - unknown */
1398 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1399 uint32 num_names2; /* number of names being looked up */
1401 UNIHDR *hdr_name; /* unicode account name header */
1402 UNISTR2 *uni_name; /* unicode account name string */
1404 } SAMR_Q_LOOKUP_NAMES;
1407 /* SAMR_R_LOOKUP_NAMES */
1408 typedef struct r_samr_lookup_names_info
1410 uint32 num_rids1; /* number of aliases being looked up */
1411 uint32 ptr_rids; /* pointer to aliases */
1412 uint32 num_rids2; /* number of aliases being looked up */
1414 uint32 *rids; /* rids */
1416 uint32 num_types1; /* number of users in aliases being looked up */
1417 uint32 ptr_types; /* pointer to users in aliases */
1418 uint32 num_types2; /* number of users in aliases being looked up */
1420 uint32 *types; /* SID_ENUM type */
1422 NTSTATUS status; /* return code */
1424 } SAMR_R_LOOKUP_NAMES;
1427 /****************************************************************************
1428 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1430 called to resolve domain RID groups.
1431 *****************************************************************************/
1432 /* SAMR_Q_LOOKUP_RIDS */
1433 typedef struct q_samr_lookup_rids_info
1435 POLICY_HND pol; /* policy handle */
1437 uint32 num_rids1; /* number of rids being looked up */
1438 uint32 flags; /* 0x0000 03e8 - unknown */
1439 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1440 uint32 num_rids2; /* number of rids being looked up */
1442 uint32 *rid; /* domain RIDs being looked up */
1444 } SAMR_Q_LOOKUP_RIDS;
1447 /****************************************************************************
1448 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1450 *****************************************************************************/
1451 /* SAMR_R_LOOKUP_RIDS */
1452 typedef struct r_samr_lookup_rids_info
1454 uint32 num_names1; /* number of aliases being looked up */
1455 uint32 ptr_names; /* pointer to aliases */
1456 uint32 num_names2; /* number of aliases being looked up */
1458 UNIHDR *hdr_name; /* unicode account name header */
1459 UNISTR2 *uni_name; /* unicode account name string */
1461 uint32 num_types1; /* number of users in aliases being looked up */
1462 uint32 ptr_types; /* pointer to users in aliases */
1463 uint32 num_types2; /* number of users in aliases being looked up */
1465 uint32 *type; /* SID_ENUM type */
1467 NTSTATUS status;
1469 } SAMR_R_LOOKUP_RIDS;
1472 /* SAMR_Q_OPEN_USER - probably an open */
1473 typedef struct q_samr_open_user_info
1475 POLICY_HND domain_pol; /* policy handle */
1476 uint32 access_mask; /* 32 bit unknown - 0x02011b */
1477 uint32 user_rid; /* user RID */
1479 } SAMR_Q_OPEN_USER;
1482 /* SAMR_R_OPEN_USER - probably an open */
1483 typedef struct r_samr_open_user_info
1485 POLICY_HND user_pol; /* policy handle associated with unknown id */
1486 NTSTATUS status; /* return status */
1488 } SAMR_R_OPEN_USER;
1491 /* SAMR_Q_CREATE_USER - probably a create */
1492 typedef struct q_samr_create_user_info
1494 POLICY_HND domain_pol; /* policy handle */
1496 UNIHDR hdr_name; /* unicode account name header */
1497 UNISTR2 uni_name; /* unicode account name */
1499 uint32 acb_info; /* account control info */
1500 uint32 access_mask; /* 0xe005 00b0 */
1502 } SAMR_Q_CREATE_USER;
1505 /* SAMR_R_CREATE_USER - probably a create */
1506 typedef struct r_samr_create_user_info
1508 POLICY_HND user_pol; /* policy handle associated with user */
1510 uint32 access_granted;
1511 uint32 user_rid; /* user RID */
1512 NTSTATUS status; /* return status */
1514 } SAMR_R_CREATE_USER;
1517 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
1518 typedef struct q_samr_delete_dom_user_info
1520 POLICY_HND user_pol; /* policy handle */
1522 } SAMR_Q_DELETE_DOM_USER;
1525 /* SAMR_R_DELETE_DOM_USER - delete domain user */
1526 typedef struct r_samr_delete_dom_user_info
1528 POLICY_HND pol; /* policy handle */
1529 NTSTATUS status; /* return status */
1531 } SAMR_R_DELETE_DOM_USER;
1534 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1535 typedef struct q_samr_query_groupmem_info
1537 POLICY_HND group_pol; /* policy handle */
1539 } SAMR_Q_QUERY_GROUPMEM;
1542 /* SAMR_R_QUERY_GROUPMEM - query group members */
1543 typedef struct r_samr_query_groupmem_info
1545 uint32 ptr;
1546 uint32 num_entries;
1548 uint32 ptr_rids;
1549 uint32 ptr_attrs;
1551 uint32 num_rids;
1552 uint32 *rid;
1554 uint32 num_attrs;
1555 uint32 *attr;
1557 NTSTATUS status;
1559 } SAMR_R_QUERY_GROUPMEM;
1562 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1563 typedef struct q_samr_del_group_mem_info
1565 POLICY_HND pol; /* policy handle */
1566 uint32 rid; /* rid */
1568 } SAMR_Q_DEL_GROUPMEM;
1571 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1572 typedef struct r_samr_del_group_mem_info
1574 NTSTATUS status; /* return status */
1576 } SAMR_R_DEL_GROUPMEM;
1579 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1580 typedef struct q_samr_add_group_mem_info
1582 POLICY_HND pol; /* policy handle */
1584 uint32 rid; /* rid */
1585 uint32 unknown; /* 0x0000 0005 */
1587 } SAMR_Q_ADD_GROUPMEM;
1590 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1591 typedef struct r_samr_add_group_mem_info
1593 NTSTATUS status; /* return status */
1595 } SAMR_R_ADD_GROUPMEM;
1598 /* SAMR_Q_OPEN_GROUP - probably an open */
1599 typedef struct q_samr_open_group_info
1601 POLICY_HND domain_pol; /* policy handle */
1602 uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1603 uint32 rid_group; /* rid */
1605 } SAMR_Q_OPEN_GROUP;
1608 /* SAMR_R_OPEN_GROUP - probably an open */
1609 typedef struct r_samr_open_group_info
1611 POLICY_HND pol; /* policy handle */
1612 NTSTATUS status; /* return status */
1614 } SAMR_R_OPEN_GROUP;
1617 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1618 typedef struct q_samr_query_aliasmem_info
1620 POLICY_HND alias_pol; /* policy handle */
1622 } SAMR_Q_QUERY_ALIASMEM;
1625 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1626 typedef struct r_samr_query_aliasmem_info
1628 uint32 num_sids;
1629 uint32 ptr;
1630 uint32 num_sids1;
1632 DOM_SID2 *sid;
1634 NTSTATUS status;
1636 } SAMR_R_QUERY_ALIASMEM;
1639 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1640 typedef struct q_samr_add_alias_mem_info
1642 POLICY_HND alias_pol; /* policy handle */
1644 DOM_SID2 sid; /* member sid to be added to the alias */
1646 } SAMR_Q_ADD_ALIASMEM;
1649 /* SAMR_R_ADD_ALIASMEM - add alias member */
1650 typedef struct r_samr_add_alias_mem_info
1652 NTSTATUS status; /* return status */
1654 } SAMR_R_ADD_ALIASMEM;
1657 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1658 typedef struct q_samr_del_alias_mem_info
1660 POLICY_HND alias_pol; /* policy handle */
1662 DOM_SID2 sid; /* member sid to be added to alias */
1664 } SAMR_Q_DEL_ALIASMEM;
1667 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1668 typedef struct r_samr_del_alias_mem_info
1670 NTSTATUS status; /* return status */
1672 } SAMR_R_DEL_ALIASMEM;
1676 /* SAMR_Q_OPEN_ALIAS - probably an open */
1677 typedef struct q_samr_open_alias_info
1679 POLICY_HND dom_pol;
1681 uint32 access_mask;
1682 uint32 rid_alias;
1684 } SAMR_Q_OPEN_ALIAS;
1687 /* SAMR_R_OPEN_ALIAS - probably an open */
1688 typedef struct r_samr_open_alias_info
1690 POLICY_HND pol; /* policy handle */
1691 NTSTATUS status; /* return status */
1693 } SAMR_R_OPEN_ALIAS;
1696 /* SAMR_Q_CONNECT_ANON - probably an open */
1697 typedef struct q_samr_connect_anon_info
1699 uint32 ptr; /* ptr? */
1700 uint16 unknown_0; /* 0x005c */
1701 uint16 unknown_1; /* 0x0001 */
1702 uint32 access_mask;
1704 } SAMR_Q_CONNECT_ANON;
1706 /* SAMR_R_CONNECT_ANON - probably an open */
1707 typedef struct r_samr_connect_anon_info
1709 POLICY_HND connect_pol; /* policy handle */
1710 NTSTATUS status; /* return status */
1712 } SAMR_R_CONNECT_ANON;
1714 /* SAMR_Q_CONNECT - probably an open */
1715 typedef struct q_samr_connect_info
1717 uint32 ptr_srv_name; /* pointer (to server name?) */
1718 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1720 uint32 access_mask;
1722 } SAMR_Q_CONNECT;
1725 /* SAMR_R_CONNECT - probably an open */
1726 typedef struct r_samr_connect_info
1728 POLICY_HND connect_pol; /* policy handle */
1729 NTSTATUS status; /* return status */
1731 } SAMR_R_CONNECT;
1733 /* SAMR_Q_CONNECT4 */
1734 typedef struct q_samr_connect4_info
1736 uint32 ptr_srv_name; /* pointer to server name */
1737 UNISTR2 uni_srv_name;
1739 uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */
1740 uint32 access_mask;
1741 } SAMR_Q_CONNECT4;
1743 /* SAMR_R_CONNECT4 - same format as connect */
1744 typedef struct r_samr_connect_info SAMR_R_CONNECT4;
1746 /* SAMR_Q_GET_DOM_PWINFO */
1747 typedef struct q_samr_get_dom_pwinfo
1749 uint32 ptr;
1750 UNIHDR hdr_srv_name;
1751 UNISTR2 uni_srv_name;
1753 } SAMR_Q_GET_DOM_PWINFO;
1755 /* SAMR_R_GET_DOM_PWINFO */
1756 typedef struct r_samr_get_dom_pwinfo
1759 * See Samba4 IDL
1761 uint16 unk_0;
1762 uint32 unk_1;
1763 NTSTATUS status;
1765 } SAMR_R_GET_DOM_PWINFO;
1767 /* SAMR_ENC_PASSWD */
1768 typedef struct enc_passwd_info
1770 uint32 ptr;
1771 uint8 pass[516];
1773 } SAMR_ENC_PASSWD;
1775 /* SAMR_ENC_HASH */
1776 typedef struct enc_hash_info
1778 uint32 ptr;
1779 uint8 hash[16];
1781 } SAMR_ENC_HASH;
1783 /* SAMR_Q_CHGPASSWD_USER */
1784 typedef struct q_samr_chgpasswd_user_info
1786 uint32 ptr_0;
1788 UNIHDR hdr_dest_host; /* server name unicode header */
1789 UNISTR2 uni_dest_host; /* server name unicode string */
1791 UNIHDR hdr_user_name; /* username unicode string header */
1792 UNISTR2 uni_user_name; /* username unicode string */
1794 SAMR_ENC_PASSWD nt_newpass;
1795 SAMR_ENC_HASH nt_oldhash;
1797 uint32 unknown; /* 0x0000 0001 */
1799 SAMR_ENC_PASSWD lm_newpass;
1800 SAMR_ENC_HASH lm_oldhash;
1802 } SAMR_Q_CHGPASSWD_USER;
1804 /* SAMR_R_CHGPASSWD_USER */
1805 typedef struct r_samr_chgpasswd_user_info
1807 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1809 } SAMR_R_CHGPASSWD_USER;
1812 /* SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN */
1813 typedef struct q_samr_remove_sid_foreign_domain_info
1815 POLICY_HND dom_pol; /* policy handle */
1816 DOM_SID2 sid; /* SID */
1818 } SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN;
1821 /* SAMR_R_REMOVE_SID_FOREIGN_DOMAIN */
1822 typedef struct r_samr_remove_sid_foreign_domain_info
1824 NTSTATUS status; /* return status */
1826 } SAMR_R_REMOVE_SID_FOREIGN_DOMAIN;
1830 /* these are from the old rpc_samr.h - they are needed while the merge
1831 is still going on */
1832 #define MAX_SAM_SIDS 15
1834 /* DOM_SID3 - security id */
1835 typedef struct sid_info_3
1837 uint16 len; /* length, bytes, including length of len :-) */
1838 /* uint8 pad[2]; */
1840 DOM_SID sid;
1842 } DOM_SID3;
1844 /* SAMR_Q_UNKNOWN_2E */
1845 typedef struct q_samr_unknown_2e_info
1847 POLICY_HND domain_pol; /* policy handle */
1848 uint16 switch_value;
1850 } SAMR_Q_UNKNOWN_2E;
1852 /* SAMR_R_UNKNOWN_2E */
1853 typedef struct r_samr_unknown_2e_info
1855 uint32 ptr_0;
1856 uint16 switch_value;
1857 SAM_UNK_CTR *ctr;
1858 NTSTATUS status; /* return status */
1860 } SAMR_R_UNKNOWN_2E;
1862 /* SAMR_Q_SET_DOMAIN_INFO */
1863 typedef struct q_samr_set_domain_info
1865 POLICY_HND domain_pol; /* policy handle */
1866 uint16 switch_value0;
1867 uint16 switch_value;
1868 SAM_UNK_CTR *ctr;
1870 } SAMR_Q_SET_DOMAIN_INFO;
1872 /* SAMR_R_SET_DOMAIN_INFO */
1873 typedef struct r_samr_set_domain_info
1875 NTSTATUS status; /* return status */
1877 } SAMR_R_SET_DOMAIN_INFO;
1879 #endif /* _RPC_SAMR_H */