Makefile: Added nttrans.o
[Samba/gebeck_regimport.git] / source / include / rpc_samr.h
blobbcce64b6bea5b16b4ef170ce6eba8dbc9b097dcf
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-1997
6 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7 Copyright (C) Paul Ashton 1997
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
25 #define _RPC_SAMR_H
28 #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 SamrAddMemberToAlias
36 SamrAddMemberToGroup
37 SamrAddMultipleMembersToAlias
38 SamrChangePasswordUser
39 x SamrCloseHandle
40 x SamrConnect
41 SamrCreateAliasInDomain
42 SamrCreateGroupInDomain
43 SamrCreateUserInDomain
44 SamrDeleteAlias
45 SamrDeleteGroup
46 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 SamrOpenGroup
58 x SamrOpenUser
59 x SamrQueryDisplayInformation
60 x SamrQueryInformationAlias
61 SamrQueryInformationDomain
62 ? SamrQueryInformationUser
63 SamrQuerySecurityObject
64 SamrRemoveMemberFromAlias
65 SamrRemoveMemberFromForiegnDomain
66 SamrRemoveMemberFromGroup
67 SamrRemoveMultipleMembersFromAlias
68 SamrSetInformationAlias
69 SamrSetInformationDomain
70 SamrSetInformationGroup
71 SamrSetInformationUser
72 SamrSetMemberAttributesOfGroup
73 SamrSetSecurityObject
74 SamrShutdownSamServer
75 SamrTestPrivateFunctionsDomain
76 SamrTestPrivateFunctionsUser
78 ********************************************************************/
80 #define SAMR_CLOSE_HND 0x01
81 #define SAMR_OPEN_DOMAIN 0x07
82 #define SAMR_UNKNOWN_8 0x08
83 #define SAMR_LOOKUP_IDS 0x10
84 #define SAMR_LOOKUP_NAMES 0x11
85 #define SAMR_UNKNOWN_3 0x03
86 #define SAMR_QUERY_DISPINFO 0x28
87 #define SAMR_OPEN_USER 0x22
88 #define SAMR_QUERY_USERINFO 0x24
89 #define SAMR_QUERY_USERGROUPS 0x27
90 #define SAMR_UNKNOWN_12 0x12
91 #define SAMR_UNKNOWN_21 0x21
92 #define SAMR_UNKNOWN_32 0x32
93 #define SAMR_UNKNOWN_34 0x34
94 #define SAMR_CONNECT 0x39
95 #define SAMR_OPEN_ALIAS 0x1b
96 #define SAMR_QUERY_ALIASINFO 0x1c
97 #define SAMR_ENUM_DOM_USERS 0x0d
98 #define SAMR_ENUM_DOM_ALIASES 0x0f
99 #define SAMR_ENUM_DOM_GROUPS 0x30
102 typedef struct logon_hours_info
104 uint32 len; /* normally 21 bytes */
105 uint8 hours[32];
107 } LOGON_HRS;
109 /* SAM_USER_INFO_21 */
110 typedef struct sam_user_info_21
112 NTTIME logon_time; /* logon time */
113 NTTIME logoff_time; /* logoff time */
114 NTTIME kickoff_time; /* kickoff time */
115 NTTIME pass_last_set_time; /* password last set time */
116 NTTIME pass_can_change_time; /* password can change time */
117 NTTIME pass_must_change_time; /* password must change time */
119 UNIHDR hdr_user_name; /* username unicode string header */
120 UNIHDR hdr_full_name; /* user's full name unicode string header */
121 UNIHDR hdr_home_dir; /* home directory unicode string header */
122 UNIHDR hdr_dir_drive; /* home drive unicode string header */
123 UNIHDR hdr_logon_script; /* logon script unicode string header */
124 UNIHDR hdr_profile_path; /* profile path unicode string header */
125 UNIHDR hdr_acct_desc ; /* user description */
126 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
127 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
128 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
130 uint8 lm_pwd[16]; /* lm user passwords */
131 uint8 nt_pwd[16]; /* nt user passwords */
133 uint32 user_rid; /* Primary User ID */
134 uint32 group_rid; /* Primary Group ID */
136 uint16 acb_info; /* account info (ACB_xxxx bit-mask) */
137 /* uint8 pad[2] */
139 uint32 unknown_3; /* 0x00ff ffff */
141 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
142 /* uint8 pad[2] */
143 uint32 ptr_logon_hrs; /* unknown pointer */
145 uint32 unknown_5; /* 0x0002 0000 */
147 uint8 padding1[8];
149 UNISTR2 uni_user_name; /* username unicode string */
150 UNISTR2 uni_full_name; /* user's full name unicode string */
151 UNISTR2 uni_home_dir; /* home directory unicode string */
152 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
153 UNISTR2 uni_logon_script; /* logon script unicode string */
154 UNISTR2 uni_profile_path; /* profile path unicode string */
155 UNISTR2 uni_acct_desc ; /* user description unicode string */
156 UNISTR2 uni_workstations; /* login from workstations unicode string */
157 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
158 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
160 uint32 unknown_6; /* 0x0000 04ec */
161 uint32 padding4;
163 LOGON_HRS logon_hrs;
165 } SAM_USER_INFO_21;
168 /* SAM_USER_INFO_11 */
169 typedef struct sam_user_info_11
171 uint8 padding_0[16]; /* 0 - padding 16 bytes */
172 NTTIME expiry; /* expiry time or something? */
173 uint8 padding_1[24]; /* 0 - padding 24 bytes */
175 UNIHDR hdr_mach_acct; /* unicode header for machine account */
176 uint32 padding_2; /* 0 - padding 4 bytes */
178 uint32 ptr_1; /* pointer */
179 uint8 padding_3[32]; /* 0 - padding 32 bytes */
180 uint32 padding_4; /* 0 - padding 4 bytes */
182 uint32 ptr_2; /* pointer */
183 uint32 padding_5; /* 0 - padding 4 bytes */
185 uint32 ptr_3; /* pointer */
186 uint8 padding_6[32]; /* 0 - padding 32 bytes */
188 uint32 rid_user; /* user RID */
189 uint32 rid_group; /* group RID */
191 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
192 uint16 unknown_3; /* 16 bit padding */
194 uint16 unknown_4; /* 0x003f - 16 bit unknown */
195 uint16 unknown_5; /* 0x003c - 16 bit unknown */
197 uint8 padding_7[16]; /* 0 - padding 16 bytes */
198 uint32 padding_8; /* 0 - padding 4 bytes */
200 UNISTR2 uni_mach_acct; /* unicode string for machine account */
202 uint8 padding_9[48]; /* 0 - padding 48 bytes */
204 } SAM_USER_INFO_11;
207 /* SAM_USER_INFO_10 */
208 typedef struct sam_user_info_10
210 uint32 rid_group;
212 } SAM_USER_INFO_10;
216 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
217 typedef struct q_samr_close_hnd_info
219 POLICY_HND pol; /* policy handle */
221 } SAMR_Q_CLOSE_HND;
224 /* SAMR_R_CLOSE_HND - probably a policy handle close */
225 typedef struct r_samr_close_hnd_info
227 POLICY_HND pol; /* policy handle */
228 uint32 status; /* return status */
230 } SAMR_R_CLOSE_HND;
233 /****************************************************************************
234 SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs.
235 *****************************************************************************/
237 /* SAMR_Q_UNKNOWN_3 - probably get domain info... */
238 typedef struct q_samr_unknown_3_info
240 POLICY_HND user_pol; /* policy handle */
241 uint16 switch_value; /* 0x0000 0004 */
242 /* uint8 pad[2] */
244 } SAMR_Q_UNKNOWN_3;
246 /* DOM_SID3 example:
247 0x14 0x035b 0x0002 S-1-1
248 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
249 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ACCOUNT_OPS
250 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03f1
253 /* DOM_SID3 example:
254 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03ee
255 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
256 0x14 0x035b 0x0002 S-1-1
259 /* DOM_SID3 - security id */
260 typedef struct sid_info_3
262 uint16 len; /* length, bytes, including length of len :-) */
263 /* uint8 pad[2]; */
265 DOM_SID sid;
267 } DOM_SID3;
270 #define MAX_SAM_SIDS 15
272 /* SAM_SID_STUFF */
273 typedef struct sid_stuff_info
275 uint16 unknown_2; /* 0x0001 */
276 uint16 unknown_3; /* 0x8004 */
278 uint8 padding1[8];
280 uint32 unknown_4; /* 0x0000 0014 */
281 uint32 unknown_5; /* 0x0000 0014 */
283 uint16 unknown_6; /* 0x0002 */
284 uint16 unknown_7; /* 0x5800 */
286 uint32 num_sids;
288 uint16 padding2;
290 DOM_SID3 sid[MAX_SAM_SIDS];
292 } SAM_SID_STUFF;
294 /* SAMR_R_UNKNOWN_3 - probably an open */
295 typedef struct r_samr_unknown_3_info
297 uint32 ptr_0;
298 uint32 sid_stuff_len0;
300 uint32 ptr_1;
301 uint32 sid_stuff_len1;
303 SAM_SID_STUFF sid_stuff;
305 uint32 status; /* return status */
307 } SAMR_R_UNKNOWN_3;
310 /****************************************************************************
311 SAMR_Q_UNKNOWN_8 - probably a query on domain group info.
312 *****************************************************************************/
314 /* SAMR_Q_UNKNOWN_8 - */
315 typedef struct q_samr_unknown_8_info
317 POLICY_HND domain_pol; /* policy handle */
318 uint16 switch_value; /* 0x0002 */
320 } SAMR_Q_UNKNOWN_8;
322 typedef struct sam_unkown_info_2_info
324 uint32 unknown_0; /* 0x0000 0000 */
325 uint32 unknown_1; /* 0x0000 0000 */
326 uint32 unknown_2; /* 0x8000 0000 */
327 uint32 unknown_3; /* 0x0000 0000 */
329 uint32 ptr_0; /* pointer to unknown structure */
330 UNIHDR hdr_domain; /* domain name unicode header */
331 UNIHDR hdr_server; /* server name unicode header */
333 /* put all the data in here, at the moment, including what the above
334 pointer is referring to
337 uint32 unknown_4; /* 0x0000 0099 */
338 uint32 unknown_5; /* 0x0000 0000 */
340 uint32 unknown_6 ; /* 0x0000 0001 */
341 uint32 unknown_7 ; /* 0x0000 0003 */
342 uint32 unknown_8 ; /* 0x0000 0001 */
343 uint32 unknown_9 ; /* 0x0000 0008 */
344 uint32 unknown_10; /* 0x0000 0003 */
346 uint8 padding[16]; /* 16 bytes zeros */
348 UNISTR2 uni_domain; /* domain name unicode string */
349 UNISTR2 uni_server; /* server name unicode string */
351 } SAM_UNK_INFO_2;
354 typedef struct sam_unknown_ctr_info
356 union
358 SAM_UNK_INFO_2 inf2;
360 } info;
362 } SAM_UNK_CTR;
365 /* SAMR_R_UNKNOWN_8 - */
366 typedef struct r_samr_unknown_8_info
368 uint32 ptr_1;
369 uint16 switch_value; /* same as in query */
371 SAM_UNK_CTR *ctr;
373 uint32 status; /* return status */
375 } SAMR_R_UNKNOWN_8;
378 /****************************************************************************
379 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
381 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
382 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
383 *****************************************************************************/
385 /* SAMR_Q_OPEN_DOMAIN */
386 typedef struct q_samr_open_domain_info
388 POLICY_HND connect_pol; /* policy handle */
389 uint32 rid; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - a RID? */
390 DOM_SID2 dom_sid; /* domain SID */
392 } SAMR_Q_OPEN_DOMAIN;
395 /* SAMR_R_OPEN_DOMAIN - probably an open */
396 typedef struct r_samr_open_domain_info
398 POLICY_HND domain_pol; /* policy handle associated with the SID */
399 uint32 status; /* return status */
401 } SAMR_R_OPEN_DOMAIN;
404 #define MAX_SAM_ENTRIES 250
406 typedef struct samr_entry_info
408 uint32 rid;
409 UNIHDR hdr_name;
411 } SAM_ENTRY;
413 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
414 typedef struct q_samr_enum_dom_users_info
416 POLICY_HND pol; /* policy handle */
418 uint16 req_num_entries; /* number of values (0 indicates unlimited?) */
419 uint16 unknown_0; /* enumeration context? */
420 uint16 acb_mask; /* 0x0000 indicates all */
421 uint16 unknown_1; /* 0x0000 */
423 uint32 max_size; /* 0x0000 ffff */
425 } SAMR_Q_ENUM_DOM_USERS;
428 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
429 typedef struct r_samr_enum_dom_users_info
431 uint16 total_num_entries; /* number of entries that match without the acb mask */
432 uint16 unknown_0; /* same as unknown_0 (enum context?) in request */
433 uint32 ptr_entries1; /* actual number of entries to follow, having masked some out */
435 uint32 num_entries2;
436 uint32 ptr_entries2;
438 uint32 num_entries3;
440 SAM_ENTRY sam[MAX_SAM_ENTRIES];
441 UNISTR2 uni_acct_name[MAX_SAM_ENTRIES];
443 uint32 num_entries4;
445 uint32 status;
447 } SAMR_R_ENUM_DOM_USERS;
450 typedef struct samr_entry_info3
452 uint32 grp_idx;
454 uint32 rid_grp;
455 uint32 attr;
457 UNIHDR hdr_grp_name;
458 UNIHDR hdr_grp_desc;
460 } SAM_ENTRY3;
462 typedef struct samr_str_entry_info3
464 UNISTR2 uni_grp_name;
465 UNISTR2 uni_grp_desc;
467 } SAM_STR3;
469 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
470 typedef struct q_samr_enum_dom_groups_info
472 POLICY_HND pol; /* policy handle */
474 /* these are possibly an enumeration context handle... */
475 uint16 switch_level; /* 0x0003 */
476 uint16 unknown_0; /* 0x0000 */
477 uint32 start_idx; /* presumably the start enumeration index */
478 uint32 unknown_1; /* 0x0000 07d0 */
480 uint32 max_size; /* 0x0000 7fff */
482 } SAMR_Q_ENUM_DOM_GROUPS;
485 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
486 typedef struct r_samr_enum_dom_groups_info
488 uint32 unknown_0; /* 0x0000 0492 or 0x0000 00be */
489 uint32 unknown_1; /* 0x0000 049a or 0x0000 00be */
490 uint32 switch_level; /* 0x0000 0003 */
492 uint32 num_entries;
493 uint32 ptr_entries;
495 uint32 num_entries2;
497 SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
498 SAM_STR3 str[MAX_SAM_ENTRIES];
500 uint32 status;
502 } SAMR_R_ENUM_DOM_GROUPS;
506 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
507 typedef struct q_samr_enum_dom_aliases_info
509 POLICY_HND pol; /* policy handle */
511 /* this is possibly an enumeration context handle... */
512 uint32 unknown_0; /* 0x0000 0000 */
514 uint32 max_size; /* 0x0000 ffff */
516 } SAMR_Q_ENUM_DOM_ALIASES;
518 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
519 typedef struct r_samr_enum_dom_aliases_info
521 uint32 num_entries;
522 uint32 ptr_entries;
524 uint32 num_entries2;
525 uint32 ptr_entries2;
527 uint32 num_entries3;
529 SAM_ENTRY sam[MAX_SAM_ENTRIES];
530 UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
532 uint32 num_entries4;
534 uint32 status;
536 } SAMR_R_ENUM_DOM_ALIASES;
540 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
541 typedef struct q_samr_query_disp_info
543 POLICY_HND pol; /* policy handle */
545 uint16 switch_level; /* 0x0001 and 0x0002 seen */
546 uint16 unknown_0; /* 0x0000 and 0x2000 seen */
547 uint32 start_idx; /* presumably the start enumeration index */
548 uint32 unknown_1; /* 0x0000 07d0, 0x0000 0400 and 0x0000 0200 seen */
550 uint32 max_size; /* 0x0000 7fff, 0x0000 7ffe and 0x0000 3fff seen*/
552 } SAMR_Q_QUERY_DISPINFO;
554 typedef struct samr_entry_info1
556 uint32 user_idx;
558 uint32 rid_user;
559 uint16 acb_info;
560 uint16 pad;
562 UNIHDR hdr_acct_name;
563 UNIHDR hdr_user_name;
564 UNIHDR hdr_user_desc;
566 } SAM_ENTRY1;
568 typedef struct samr_str_entry_info1
570 UNISTR2 uni_acct_name;
571 UNISTR2 uni_full_name;
572 UNISTR2 uni_acct_desc;
574 } SAM_STR1;
576 typedef struct sam_entry_info_1
578 uint32 num_entries;
579 uint32 ptr_entries;
580 uint32 num_entries2;
582 SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
583 SAM_STR1 str[MAX_SAM_ENTRIES];
586 } SAM_INFO_1;
588 typedef struct samr_entry_info2
590 uint32 user_idx;
592 uint32 rid_user;
593 uint16 acb_info;
594 uint16 pad;
596 UNIHDR hdr_srv_name;
597 UNIHDR hdr_srv_desc;
599 } SAM_ENTRY2;
601 typedef struct samr_str_entry_info2
603 UNISTR2 uni_srv_name;
604 UNISTR2 uni_srv_desc;
606 } SAM_STR2;
608 typedef struct sam_entry_info_2
610 uint32 num_entries;
611 uint32 ptr_entries;
612 uint32 num_entries2;
614 SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
615 SAM_STR2 str[MAX_SAM_ENTRIES];
617 } SAM_INFO_2;
619 typedef struct sam_info_ctr_info
621 union
623 SAM_INFO_1 *info1; /* server info */
624 SAM_INFO_2 *info2; /* user info */
625 void *info; /* allows assignment without typecasting, */
627 } sam;
629 } SAM_INFO_CTR;
631 /* SAMR_R_QUERY_DISPINFO - SAM rids, names and descriptions */
632 typedef struct r_samr_query_dispinfo_info
634 uint32 unknown_0; /* container length? 0x0000 0492 or 0x0000 00be */
635 uint32 unknown_1; /* container length? 0x0000 049a or 0x0000 00be */
636 uint16 switch_level; /* 0x0001 or 0x0002 */
637 /*uint8 pad[2] */
639 SAM_INFO_CTR *ctr;
641 uint32 status;
643 } SAMR_R_QUERY_DISPINFO;
647 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
648 typedef struct q_samr_enum_alias_info
650 POLICY_HND pol; /* policy handle */
652 uint16 switch_level; /* 0x0003 seen */
654 } SAMR_Q_QUERY_ALIASINFO;
656 typedef struct samr_alias_info3
658 UNIHDR hdr_acct_desc;
659 UNISTR2 uni_acct_desc;
661 } ALIAS_INFO3;
663 /* SAMR_R_QUERY_ALIASINFO - SAM rids, names and descriptions */
664 typedef struct r_samr_query_aliasinfo_info
666 uint32 ptr;
667 uint16 switch_value; /* 0x0003 */
668 /* uint8[2] padding */
670 union
672 ALIAS_INFO3 info3;
674 } alias;
676 uint32 status;
678 } SAMR_R_QUERY_ALIASINFO;
681 /* SAMR_Q_QUERY_USERGROUPS - */
682 typedef struct q_samr_query_usergroup_info
684 POLICY_HND pol; /* policy handle associated with unknown id */
686 } SAMR_Q_QUERY_USERGROUPS;
688 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
689 typedef struct r_samr_query_usergroup_info
691 uint32 ptr_0; /* pointer */
692 uint32 num_entries; /* number of RID groups */
693 uint32 ptr_1; /* pointer */
694 uint32 num_entries2; /* number of RID groups */
696 DOM_GID *gid; /* group info */
698 uint32 status; /* return status */
700 } SAMR_R_QUERY_USERGROUPS;
703 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
704 typedef struct q_samr_query_user_info
706 POLICY_HND pol; /* policy handle associated with unknown id */
707 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
709 } SAMR_Q_QUERY_USERINFO;
711 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
712 typedef struct r_samr_query_user_info
714 uint32 ptr; /* pointer */
715 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - same as in query */
716 /* uint8[2] padding. */
718 union
720 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
721 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
722 SAM_USER_INFO_21 *id21; /* auth-level 21 */
723 void* id; /* to make typecasting easy */
725 } info;
727 uint32 status; /* return status */
729 } SAMR_R_QUERY_USERINFO;
732 /****************************************************************************
733 SAMR_Q_LOOKUP_IDS - do a conversion from name to RID.
735 the policy handle allocated by an "samr open secret" call is associated
736 with a SID. this policy handle is what is queried here, *not* the SID
737 itself. the response to the lookup rids is relative to this SID.
738 *****************************************************************************/
739 /* SAMR_Q_LOOKUP_IDS */
740 typedef struct q_samr_lookup_ids_info
742 POLICY_HND pol; /* policy handle */
744 uint32 num_sids1; /* number of rids being looked up */
745 uint32 ptr; /* buffer pointer */
746 uint32 num_sids2; /* number of rids being looked up */
748 uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
749 DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
751 } SAMR_Q_LOOKUP_IDS;
754 /* SAMR_R_LOOKUP_IDS */
755 typedef struct r_samr_lookup_ids_info
757 uint32 num_entries;
758 uint32 ptr; /* undocumented buffer pointer */
760 uint32 num_entries2;
761 uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
763 uint32 status; /* return code */
765 } SAMR_R_LOOKUP_IDS;
768 /****************************************************************************
769 SAMR_Q_LOOKUP_NAMES - do a conversion from SID to RID.
771 the policy handle allocated by an "samr open secret" call is associated
772 with a SID. this policy handle is what is queried here, *not* the SID
773 itself. the response to the lookup rids is relative to this SID.
774 *****************************************************************************/
775 /* SAMR_Q_LOOKUP_NAMES */
776 typedef struct q_samr_lookup_names_info
778 POLICY_HND pol; /* policy handle */
780 uint32 num_rids1; /* number of rids being looked up */
781 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
782 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
783 uint32 num_rids2; /* number of rids being looked up */
785 UNIHDR hdr_user_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
786 UNISTR2 uni_user_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
788 } SAMR_Q_LOOKUP_NAMES;
791 /* SAMR_R_LOOKUP_NAMES */
792 typedef struct r_samr_lookup_names_info
794 uint32 num_entries;
795 uint32 undoc_buffer; /* undocumented buffer pointer */
797 uint32 num_entries2;
798 DOM_RID3 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
800 uint32 num_entries3;
802 uint32 status; /* return code */
804 } SAMR_R_LOOKUP_NAMES;
807 /****************************************************************************
808 SAMR_Q_UNKNOWN_12 - do a conversion from RID groups to something.
810 called to resolve domain RID groups.
811 *****************************************************************************/
812 /* SAMR_Q_UNKNOWN_12 */
813 typedef struct q_samr_unknown_12_info
815 POLICY_HND pol; /* policy handle */
817 uint32 num_gids1; /* number of rids being looked up */
818 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
819 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
820 uint32 num_gids2; /* number of rids being looked up */
822 uint32 gid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
824 } SAMR_Q_UNKNOWN_12;
827 /****************************************************************************
828 SAMR_R_UNKNOWN_12 - do a conversion from group RID to names
830 *****************************************************************************/
831 /* SAMR_R_UNKNOWN_12 */
832 typedef struct r_samr_unknown_12_info
834 POLICY_HND pol; /* policy handle */
836 uint32 num_aliases1; /* number of aliases being looked up */
837 uint32 ptr_aliases; /* pointer to aliases */
838 uint32 num_aliases2; /* number of aliases being looked up */
840 UNIHDR hdr_als_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
841 UNISTR2 uni_als_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
843 uint32 num_als_usrs1; /* number of users in aliases being looked up */
844 uint32 ptr_als_usrs; /* pointer to users in aliases */
845 uint32 num_als_usrs2; /* number of users in aliases being looked up */
847 uint32 num_als_usrs[MAX_LOOKUP_SIDS]; /* number of users per group */
849 uint32 status;
851 } SAMR_R_UNKNOWN_12;
854 /* SAMR_Q_OPEN_USER - probably an open */
855 typedef struct q_samr_open_user_info
857 POLICY_HND domain_pol; /* policy handle */
858 uint32 unknown_0; /* 32 bit unknown - 0x02011b */
859 uint32 user_rid; /* user RID */
861 } SAMR_Q_OPEN_USER;
864 /* SAMR_R_OPEN_USER - probably an open */
865 typedef struct r_samr_open_user_info
867 POLICY_HND user_pol; /* policy handle associated with unknown id */
868 uint32 status; /* return status */
870 } SAMR_R_OPEN_USER;
873 /* SAMR_Q_UNKNOWN_13 - probably an open alias in domain */
874 typedef struct q_samr_unknown_13_info
876 POLICY_HND alias_pol; /* policy handle */
878 uint16 unknown_1; /* 16 bit unknown - 0x0200 */
879 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
881 } SAMR_Q_UNKNOWN_13;
884 /* SAMR_Q_UNKNOWN_21 - probably an open group in domain */
885 typedef struct q_samr_unknown_21_info
887 POLICY_HND group_pol; /* policy handle */
889 uint16 unknown_1; /* 16 bit unknown - 0x0477 */
890 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
892 } SAMR_Q_UNKNOWN_21;
895 /* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */
896 typedef struct q_samr_unknown_32_info
898 POLICY_HND pol; /* policy handle */
900 UNIHDR hdr_mach_acct; /* unicode machine account name header */
901 UNISTR2 uni_mach_acct; /* unicode machine account name */
903 uint32 acct_ctrl; /* 32 bit ACB_XXXX */
904 uint16 unknown_1; /* 16 bit unknown - 0x00B0 */
905 uint16 unknown_2; /* 16 bit unknown - 0xe005 */
907 } SAMR_Q_UNKNOWN_32;
910 /* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */
911 typedef struct r_samr_unknown_32_info
913 POLICY_HND pol; /* policy handle */
915 /* rid4.unknown - fail: 0030 success: 0x03ff */
916 DOM_RID4 rid4; /* rid and attributes */
918 uint32 status; /* return status - fail: 0xC000 0099: user exists */
920 } SAMR_R_UNKNOWN_32;
923 /* SAMR_Q_OPEN_ALIAS - probably an open */
924 typedef struct q_samr_open_alias_info
926 uint32 unknown_0; /* 0x0000 0008 */
927 uint32 rid_alias; /* rid */
929 } SAMR_Q_OPEN_ALIAS;
932 /* SAMR_R_OPEN_ALIAS - probably an open */
933 typedef struct r_samr_open_alias_info
935 POLICY_HND pol; /* policy handle */
936 uint32 status; /* return status */
938 } SAMR_R_OPEN_ALIAS;
941 /* SAMR_Q_CONNECT - probably an open */
942 typedef struct q_samr_connect_info
944 uint32 ptr_srv_name; /* pointer (to server name?) */
945 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
947 uint32 unknown_0; /* 32 bit unknown */
949 } SAMR_Q_CONNECT;
952 /* SAMR_R_CONNECT - probably an open */
953 typedef struct r_samr_connect_info
955 POLICY_HND connect_pol; /* policy handle */
956 uint32 status; /* return status */
958 } SAMR_R_CONNECT;
960 /* SAMR_Q_UNKNOWN_38 */
961 typedef struct q_samr_unknown_38
963 uint32 ptr;
964 UNIHDR hdr_srv_name;
965 UNISTR2 uni_srv_name;
967 } SAMR_Q_UNKNOWN_38;
969 /* SAMR_R_UNKNOWN_38 */
970 typedef struct r_samr_unknown_38
972 LOOKUP_LEVEL level; /* 0x0006 */
973 uint32 ptr_0; /* 0x0000 0000 */
974 uint32 status;
976 } SAMR_R_UNKNOWN_38;
978 /* SAMR_ENC_PASSWD */
979 typedef struct enc_passwd_info
981 uint32 ptr;
982 uint8 pass[516];
984 } SAMR_ENC_PASSWD;
986 /* SAMR_ENC_HASH */
987 typedef struct enc_hash_info
989 uint32 ptr;
990 uint8 hash[16];
992 } SAMR_ENC_HASH;
994 /* SAMR_Q_CHGPASSWD_USER */
995 typedef struct q_samr_chgpasswd_user_info
997 uint32 ptr_0;
999 UNIHDR hdr_server; /* server name unicode header */
1000 UNISTR2 uni_server; /* server name unicode string */
1002 UNIHDR hdr_user_name; /* username unicode string header */
1003 UNISTR2 uni_user_name; /* username unicode string */
1005 SAMR_ENC_PASSWD nt_newpass;
1006 SAMR_ENC_HASH nt_oldhash;
1008 uint32 unknown_1; /* seems to always contain 0001 */
1010 SAMR_ENC_PASSWD lm_newpass;
1011 SAMR_ENC_HASH lm_oldhash;
1013 } SAMR_Q_CHGPASSWD_USER;
1015 /* SAMR_R_CHGPASSWD_USER */
1016 typedef struct r_samr_chgpasswd_user_info
1018 uint32 result; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1020 } SAMR_R_CHGPASSWD_USER;
1022 #endif /* _RPC_SAMR_H */