don't call a function error_message() as that conflicts with a
[Samba/gebeck_regimport.git] / source / include / rpc_samr.h
blobe1fa9c06bc7f30ceb07183fdffdf8ad91c112368
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) Anthony Liguori 2002
9 Copyright (C) Jim McDonough 2002
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
28 #define _RPC_SAMR_H
30 #include "rpc_misc.h"
32 /*******************************************************************
33 the following information comes from a QuickView on samsrv.dll,
34 and gives an idea of exactly what is needed:
36 x SamrAddMemberToAlias
37 x SamrAddMemberToGroup
38 SamrAddMultipleMembersToAlias
39 x SamrChangePasswordUser
40 x SamrCloseHandle
41 x SamrConnect
42 x SamrCreateAliasInDomain
43 x SamrCreateGroupInDomain
44 x SamrCreateUserInDomain
45 ? SamrDeleteAlias
46 SamrDeleteGroup
47 x SamrDeleteUser
48 x SamrEnumerateAliasesInDomain
49 SamrEnumerateDomainsInSamServer
50 x SamrEnumerateGroupsInDomain
51 x SamrEnumerateUsersInDomain
52 SamrGetUserDomainPasswordInformation
53 SamrLookupDomainInSamServer
54 ? SamrLookupIdsInDomain
55 x SamrLookupNamesInDomain
56 x SamrOpenAlias
57 x SamrOpenDomain
58 x SamrOpenGroup
59 x SamrOpenUser
60 x SamrQueryDisplayInformation
61 x SamrQueryInformationAlias
62 SamrQueryInformationDomain
63 ? SamrQueryInformationUser
64 x SamrQuerySecurityObject
65 SamrRemoveMemberFromAlias
66 SamrRemoveMemberFromForiegnDomain
67 SamrRemoveMemberFromGroup
68 SamrRemoveMultipleMembersFromAlias
69 x SamrSetInformationAlias
70 SamrSetInformationDomain
71 x SamrSetInformationGroup
72 x SamrSetInformationUser
73 SamrSetMemberAttributesOfGroup
74 SamrSetSecurityObject
75 SamrShutdownSamServer
76 SamrTestPrivateFunctionsDomain
77 SamrTestPrivateFunctionsUser
79 ********************************************************************/
81 #define SAMR_CONNECT_ANON 0x00
82 #define SAMR_CLOSE_HND 0x01
83 #define SAMR_SET_SEC_OBJECT 0x02
84 #define SAMR_QUERY_SEC_OBJECT 0x03
86 #define SAMR_UNKNOWN_4 0x04 /* profile info? */
87 #define SAMR_LOOKUP_DOMAIN 0x05
88 #define SAMR_ENUM_DOMAINS 0x06
89 #define SAMR_OPEN_DOMAIN 0x07
90 #define SAMR_QUERY_DOMAIN_INFO 0x08
91 #define SAMR_SET_DOMAIN_INFO 0x09
93 #define SAMR_CREATE_DOM_GROUP 0x0a
94 #define SAMR_ENUM_DOM_GROUPS 0x0b
95 #define SAMR_ENUM_DOM_USERS 0x0d
96 #define SAMR_CREATE_DOM_ALIAS 0x0e
97 #define SAMR_ENUM_DOM_ALIASES 0x0f
98 #define SAMR_QUERY_USERALIASES 0x10
100 #define SAMR_LOOKUP_NAMES 0x11
101 #define SAMR_LOOKUP_RIDS 0x12
103 #define SAMR_OPEN_GROUP 0x13
104 #define SAMR_QUERY_GROUPINFO 0x14
105 #define SAMR_SET_GROUPINFO 0x15
106 #define SAMR_ADD_GROUPMEM 0x16
107 #define SAMR_DELETE_DOM_GROUP 0x17
108 #define SAMR_DEL_GROUPMEM 0x18
109 #define SAMR_QUERY_GROUPMEM 0x19
110 #define SAMR_UNKNOWN_1A 0x1a
112 #define SAMR_OPEN_ALIAS 0x1b
113 #define SAMR_QUERY_ALIASINFO 0x1c
114 #define SAMR_SET_ALIASINFO 0x1d
115 #define SAMR_DELETE_DOM_ALIAS 0x1e
116 #define SAMR_ADD_ALIASMEM 0x1f
117 #define SAMR_DEL_ALIASMEM 0x20
118 #define SAMR_QUERY_ALIASMEM 0x21
120 #define SAMR_OPEN_USER 0x22
121 #define SAMR_DELETE_DOM_USER 0x23
122 #define SAMR_QUERY_USERINFO 0x24
123 #define SAMR_SET_USERINFO2 0x25
124 #define SAMR_QUERY_USERGROUPS 0x27
126 #define SAMR_QUERY_DISPINFO 0x28
127 #define SAMR_UNKNOWN_29 0x29
128 #define SAMR_UNKNOWN_2a 0x2a
129 #define SAMR_UNKNOWN_2b 0x2b
130 #define SAMR_GET_USRDOM_PWINFO 0x2c
131 #define SAMR_UNKNOWN_2D 0x2d
132 #define SAMR_UNKNOWN_2E 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
133 #define SAMR_UNKNOWN_2f 0x2f
134 #define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO
135 with info level 3 */
136 #define SAMR_UNKNOWN_31 0x31
137 #define SAMR_CREATE_USER 0x32
138 #define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO
139 with info level 4 */
140 #define SAMR_ADDMULTI_ALIASMEM 0x34
142 #define SAMR_UNKNOWN_35 0x35
143 #define SAMR_UNKNOWN_36 0x36
144 #define SAMR_CHGPASSWD_USER 0x37
145 #define SAMR_GET_DOM_PWINFO 0x38
146 #define SAMR_CONNECT 0x39
147 #define SAMR_SET_USERINFO 0x3A
148 #define SAMR_CONNECT4 0x3E
151 typedef struct _DISP_USER_INFO {
152 SAM_ACCOUNT *sam;
153 } DISP_USER_INFO;
155 typedef struct _DISP_GROUP_INFO {
156 DOMAIN_GRP *grp;
157 } DISP_GROUP_INFO;
160 typedef struct logon_hours_info
162 uint32 len; /* normally 21 bytes */
163 uint8 hours[32];
165 } LOGON_HRS;
167 /* SAM_USER_INFO_23 */
168 typedef struct sam_user_info_23
170 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
171 NTTIME logon_time; /* logon time */
172 NTTIME logoff_time; /* logoff time */
173 NTTIME kickoff_time; /* kickoff time */
174 NTTIME pass_last_set_time; /* password last set time */
175 NTTIME pass_can_change_time; /* password can change time */
176 NTTIME pass_must_change_time; /* password must change time */
178 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
179 UNIHDR hdr_full_name; /* user's full name unicode string header */
180 UNIHDR hdr_home_dir; /* home directory unicode string header */
181 UNIHDR hdr_dir_drive; /* home drive unicode string header */
182 UNIHDR hdr_logon_script; /* logon script unicode string header */
183 UNIHDR hdr_profile_path; /* profile path unicode string header */
184 UNIHDR hdr_acct_desc ; /* user description */
185 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
186 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
187 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
189 uint8 lm_pwd[16]; /* lm user passwords */
190 uint8 nt_pwd[16]; /* nt user passwords */
192 uint32 user_rid; /* Primary User ID */
193 uint32 group_rid; /* Primary Group ID */
195 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
197 uint32 unknown_3; /* 0x09f8 27fa */
199 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
200 /* uint8 pad[2] */
201 uint32 ptr_logon_hrs; /* pointer to logon hours */
203 uint32 unknown_5; /* 0x0001 0000 */
205 uint8 padding1[6];
207 uint8 passmustchange; /* 0x00 must change = 0x01 */
209 uint8 padding2;
211 uint8 pass[516];
213 UNISTR2 uni_user_name; /* NULL - username unicode string */
214 UNISTR2 uni_full_name; /* user's full name unicode string */
215 UNISTR2 uni_home_dir; /* home directory unicode string */
216 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
217 UNISTR2 uni_logon_script; /* logon script unicode string */
218 UNISTR2 uni_profile_path; /* profile path unicode string */
219 UNISTR2 uni_acct_desc ; /* user description unicode string */
220 UNISTR2 uni_workstations; /* login from workstations unicode string */
221 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
222 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
224 uint32 unknown_6; /* 0x0000 04ec */
225 uint32 padding4;
227 LOGON_HRS logon_hrs;
229 } SAM_USER_INFO_23;
231 /* SAM_USER_INFO_24 */
232 typedef struct sam_user_info_24
234 uint8 pass[516];
235 uint16 pw_len;
236 } SAM_USER_INFO_24;
239 * NB. This structure is *definately* incorrect. It's my best guess
240 * currently for W2K SP2. The password field is encrypted in a different
241 * way than normal... And there are definately other problems. JRA.
244 /* SAM_USER_INFO_25 */
245 typedef struct sam_user_info_25
247 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
248 NTTIME logon_time; /* logon time */
249 NTTIME logoff_time; /* logoff time */
250 NTTIME kickoff_time; /* kickoff time */
251 NTTIME pass_last_set_time; /* password last set time */
252 NTTIME pass_can_change_time; /* password can change time */
253 NTTIME pass_must_change_time; /* password must change time */
255 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
256 UNIHDR hdr_full_name; /* user's full name unicode string header */
257 UNIHDR hdr_home_dir; /* home directory unicode string header */
258 UNIHDR hdr_dir_drive; /* home drive unicode string header */
259 UNIHDR hdr_logon_script; /* logon script unicode string header */
260 UNIHDR hdr_profile_path; /* profile path unicode string header */
261 UNIHDR hdr_acct_desc ; /* user description */
262 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
263 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
264 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
266 uint8 lm_pwd[16]; /* lm user passwords */
267 uint8 nt_pwd[16]; /* nt user passwords */
269 uint32 user_rid; /* Primary User ID */
270 uint32 group_rid; /* Primary Group ID */
272 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
274 uint32 unknown_6[6];
276 uint8 pass[532];
278 UNISTR2 uni_user_name; /* NULL - username unicode string */
279 UNISTR2 uni_full_name; /* user's full name unicode string */
280 UNISTR2 uni_home_dir; /* home directory unicode string */
281 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
282 UNISTR2 uni_logon_script; /* logon script unicode string */
283 UNISTR2 uni_profile_path; /* profile path unicode string */
284 UNISTR2 uni_acct_desc ; /* user description unicode string */
285 UNISTR2 uni_workstations; /* login from workstations unicode string */
286 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
287 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
288 } SAM_USER_INFO_25;
291 /* SAM_USER_INFO_21 */
292 typedef struct sam_user_info_21
294 NTTIME logon_time; /* logon time */
295 NTTIME logoff_time; /* logoff time */
296 NTTIME kickoff_time; /* kickoff time */
297 NTTIME pass_last_set_time; /* password last set time */
298 NTTIME pass_can_change_time; /* password can change time */
299 NTTIME pass_must_change_time; /* password must change time */
301 UNIHDR hdr_user_name; /* username unicode string header */
302 UNIHDR hdr_full_name; /* user's full name unicode string header */
303 UNIHDR hdr_home_dir; /* home directory unicode string header */
304 UNIHDR hdr_dir_drive; /* home drive unicode string header */
305 UNIHDR hdr_logon_script; /* logon script unicode string header */
306 UNIHDR hdr_profile_path; /* profile path unicode string header */
307 UNIHDR hdr_acct_desc ; /* user description */
308 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
309 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
310 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
312 uint8 lm_pwd[16]; /* lm user passwords */
313 uint8 nt_pwd[16]; /* nt user passwords */
315 uint32 user_rid; /* Primary User ID */
316 uint32 group_rid; /* Primary Group ID */
318 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
320 uint32 unknown_3; /* 0x00ff ffff */
322 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
323 /* uint8 pad[2] */
324 uint32 ptr_logon_hrs; /* unknown pointer */
326 uint32 unknown_5; /* 0x0002 0000 */
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 uint32 unknown_6; /* 0x0000 04ec */
346 uint32 padding4;
348 LOGON_HRS logon_hrs;
350 } SAM_USER_INFO_21;
352 #define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
353 #define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
355 /* SAM_USER_INFO_20 */
356 typedef struct sam_user_info_20
358 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
360 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
362 } SAM_USER_INFO_20;
364 /* SAM_USER_INFO_12 */
365 typedef struct sam_user_info_12
367 uint8 lm_pwd[16]; /* lm user passwords */
368 uint8 nt_pwd[16]; /* nt user passwords */
370 uint8 lm_pwd_active;
371 uint8 nt_pwd_active;
373 } SAM_USER_INFO_12;
375 /* SAM_USER_INFO_11 */
376 typedef struct sam_user_info_11
378 uint8 padding_0[16]; /* 0 - padding 16 bytes */
379 NTTIME expiry; /* expiry time or something? */
380 uint8 padding_1[24]; /* 0 - padding 24 bytes */
382 UNIHDR hdr_mach_acct; /* unicode header for machine account */
383 uint32 padding_2; /* 0 - padding 4 bytes */
385 uint32 ptr_1; /* pointer */
386 uint8 padding_3[32]; /* 0 - padding 32 bytes */
387 uint32 padding_4; /* 0 - padding 4 bytes */
389 uint32 ptr_2; /* pointer */
390 uint32 padding_5; /* 0 - padding 4 bytes */
392 uint32 ptr_3; /* pointer */
393 uint8 padding_6[32]; /* 0 - padding 32 bytes */
395 uint32 rid_user; /* user RID */
396 uint32 rid_group; /* group RID */
398 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
399 uint16 unknown_3; /* 16 bit padding */
401 uint16 unknown_4; /* 0x003f - 16 bit unknown */
402 uint16 unknown_5; /* 0x003c - 16 bit unknown */
404 uint8 padding_7[16]; /* 0 - padding 16 bytes */
405 uint32 padding_8; /* 0 - padding 4 bytes */
407 UNISTR2 uni_mach_acct; /* unicode string for machine account */
409 uint8 padding_9[48]; /* 0 - padding 48 bytes */
411 } SAM_USER_INFO_11;
414 /* SAM_USER_INFO_10 */
415 typedef struct sam_user_info_10
417 uint32 acb_info;
419 } SAM_USER_INFO_10;
423 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
424 typedef struct q_samr_close_hnd_info
426 POLICY_HND pol; /* policy handle */
428 } SAMR_Q_CLOSE_HND;
431 /* SAMR_R_CLOSE_HND - probably a policy handle close */
432 typedef struct r_samr_close_hnd_info
434 POLICY_HND pol; /* policy handle */
435 NTSTATUS status; /* return status */
437 } SAMR_R_CLOSE_HND;
440 /****************************************************************************
441 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
442 *****************************************************************************/
444 /* SAMR_Q_GET_USRDOM_PWINFO */
445 typedef struct q_samr_usrdom_pwinfo_info
447 POLICY_HND user_pol; /* policy handle */
449 } SAMR_Q_GET_USRDOM_PWINFO;
452 /****************************************************************************
453 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
454 *****************************************************************************/
456 /* SAMR_R_GET_USRDOM_PWINFO */
457 typedef struct r_samr_usrdom_pwinfo_info
459 uint16 unknown_0; /* 0000 */
460 uint16 unknown_1; /* 0x0016 or 0x0015 */
461 uint32 unknown_2; /* 0x0000 0000 */
462 NTSTATUS status;
464 } SAMR_R_GET_USRDOM_PWINFO;
466 /****************************************************************************
467 SAMR_Q_SET_SEC_OBJ - info level 4.
468 *****************************************************************************/
470 /* SAMR_Q_SET_SEC_OBJ - */
471 typedef struct q_samr_set_sec_obj_info
473 POLICY_HND pol; /* policy handle */
474 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
475 SEC_DESC_BUF *buf;
477 } SAMR_Q_SET_SEC_OBJ;
479 /* SAMR_R_SET_SEC_OBJ - */
480 typedef struct r_samr_set_sec_obj_info
482 NTSTATUS status; /* return status */
484 } SAMR_R_SET_SEC_OBJ;
487 /****************************************************************************
488 SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
489 *****************************************************************************/
491 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
492 typedef struct q_samr_query_sec_obj_info
494 POLICY_HND user_pol; /* policy handle */
495 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
497 } SAMR_Q_QUERY_SEC_OBJ;
499 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
500 typedef struct r_samr_query_sec_obj_info
502 uint32 ptr;
503 SEC_DESC_BUF *buf;
505 NTSTATUS status; /* return status */
507 } SAMR_R_QUERY_SEC_OBJ;
510 /****************************************************************************
511 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
512 *****************************************************************************/
514 /* SAMR_Q_QUERY_DOMAIN_INFO - */
515 typedef struct q_samr_query_domain_info
517 POLICY_HND domain_pol; /* policy handle */
518 uint16 switch_value; /* 0x0002, 0x0001 */
520 } SAMR_Q_QUERY_DOMAIN_INFO;
522 typedef struct sam_unknown_info_3_info
524 NTTIME logout;
525 /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
527 /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
529 } SAM_UNK_INFO_3;
531 typedef struct sam_unknown_info_6_info
533 uint32 unknown_0; /* 0x0000 0000 */
535 uint32 ptr_0; /* pointer to unknown structure */
536 uint8 padding[12]; /* 12 bytes zeros */
538 } SAM_UNK_INFO_6;
540 typedef struct sam_unknown_info_7_info
542 uint16 unknown_0; /* 0x0003 */
544 } SAM_UNK_INFO_7;
546 typedef struct sam_unknown_info_12_inf
548 NTTIME duration;
549 NTTIME reset_count;
550 uint16 bad_attempt_lockout;
552 } SAM_UNK_INFO_12;
554 typedef struct sam_unknown_info_5_inf
556 UNIHDR hdr_server; /* server name unicode header */
557 UNISTR2 uni_server; /* server name unicode string */
559 } SAM_UNK_INFO_5;
561 typedef struct sam_unknown_info_2_inf
563 uint32 unknown_0; /* 0x0000 0000 */
564 uint32 unknown_1; /* 0x8000 0000 */
565 uint32 unknown_2; /* 0x0000 0000 */
567 uint32 ptr_0; /* pointer to unknown structure */
568 UNIHDR hdr_domain; /* domain name unicode header */
569 UNIHDR hdr_server; /* server name unicode header */
571 /* put all the data in here, at the moment, including what the above
572 pointer is referring to
575 uint32 seq_num; /* some sort of incrementing sequence number? */
576 uint32 unknown_3; /* 0x0000 0000 */
578 uint32 unknown_4; /* 0x0000 0001 */
579 uint32 unknown_5; /* 0x0000 0003 */
580 uint32 unknown_6; /* 0x0000 0001 */
581 uint32 num_domain_usrs; /* number of users in domain */
582 uint32 num_domain_grps; /* number of domain groups in domain */
583 uint32 num_local_grps; /* number of local groups in domain */
585 uint8 padding[12]; /* 12 bytes zeros */
587 UNISTR2 uni_domain; /* domain name unicode string */
588 UNISTR2 uni_server; /* server name unicode string */
590 } SAM_UNK_INFO_2;
592 typedef struct sam_unknown_info_1_inf
594 uint16 min_length_password;
595 uint16 password_history;
596 uint32 flag;
597 NTTIME expire;
598 NTTIME min_passwordage;
600 } SAM_UNK_INFO_1;
603 typedef struct sam_unknown_ctr_info
605 union
607 SAM_UNK_INFO_1 inf1;
608 SAM_UNK_INFO_2 inf2;
609 SAM_UNK_INFO_3 inf3;
610 SAM_UNK_INFO_5 inf5;
611 SAM_UNK_INFO_6 inf6;
612 SAM_UNK_INFO_7 inf7;
613 SAM_UNK_INFO_12 inf12;
615 } info;
617 } SAM_UNK_CTR;
620 /* SAMR_R_QUERY_DOMAIN_INFO - */
621 typedef struct r_samr_query_domain_info
623 uint32 ptr_0;
624 uint16 switch_value; /* same as in query */
626 SAM_UNK_CTR *ctr;
628 NTSTATUS status; /* return status */
630 } SAMR_R_QUERY_DOMAIN_INFO;
633 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
634 typedef struct q_samr_lookup_domain_info
636 POLICY_HND connect_pol;
638 UNIHDR hdr_domain;
639 UNISTR2 uni_domain;
641 } SAMR_Q_LOOKUP_DOMAIN;
644 /* SAMR_R_LOOKUP_DOMAIN */
645 typedef struct r_samr_lookup_domain_info
647 uint32 ptr_sid;
648 DOM_SID2 dom_sid;
650 NTSTATUS status;
652 } SAMR_R_LOOKUP_DOMAIN;
655 /****************************************************************************
656 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
658 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
659 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
660 *****************************************************************************/
662 /* SAMR_Q_OPEN_DOMAIN */
663 typedef struct q_samr_open_domain_info
665 POLICY_HND pol; /* policy handle */
666 uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
667 DOM_SID2 dom_sid; /* domain SID */
669 } SAMR_Q_OPEN_DOMAIN;
672 /* SAMR_R_OPEN_DOMAIN - probably an open */
673 typedef struct r_samr_open_domain_info
675 POLICY_HND domain_pol; /* policy handle associated with the SID */
676 NTSTATUS status; /* return status */
678 } SAMR_R_OPEN_DOMAIN;
680 #define MAX_SAM_ENTRIES_W2K 0x400
681 #define MAX_SAM_ENTRIES_W95 50
682 /* The following should be the greater of the preceeding two. */
683 #define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
685 typedef struct samr_entry_info
687 uint32 rid;
688 UNIHDR hdr_name;
690 } SAM_ENTRY;
693 /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
694 typedef struct q_samr_enum_domains_info
696 POLICY_HND pol; /* policy handle */
698 uint32 start_idx; /* enumeration handle */
699 uint32 max_size; /* 0x0000 ffff */
701 } SAMR_Q_ENUM_DOMAINS;
703 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
704 typedef struct r_samr_enum_domains_info
706 uint32 next_idx; /* next starting index required for enum */
707 uint32 ptr_entries1;
709 uint32 num_entries2;
710 uint32 ptr_entries2;
712 uint32 num_entries3;
714 SAM_ENTRY *sam;
715 UNISTR2 *uni_dom_name;
717 uint32 num_entries4;
719 NTSTATUS status;
721 } SAMR_R_ENUM_DOMAINS;
723 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
724 typedef struct q_samr_enum_dom_users_info
726 POLICY_HND pol; /* policy handle */
728 uint32 start_idx; /* number of values (0 indicates unlimited?) */
729 uint16 acb_mask; /* 0x0000 indicates all */
730 uint16 unknown_1; /* 0x0000 */
732 uint32 max_size; /* 0x0000 ffff */
734 } SAMR_Q_ENUM_DOM_USERS;
737 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
738 typedef struct r_samr_enum_dom_users_info
740 uint32 next_idx; /* next starting index required for enum */
741 uint32 ptr_entries1;
743 uint32 num_entries2;
744 uint32 ptr_entries2;
746 uint32 num_entries3;
748 SAM_ENTRY *sam;
749 UNISTR2 *uni_acct_name;
751 uint32 num_entries4;
753 NTSTATUS status;
755 } SAMR_R_ENUM_DOM_USERS;
758 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
759 typedef struct q_samr_enum_dom_groups_info
761 POLICY_HND pol; /* policy handle */
763 /* this is possibly an enumeration context handle... */
764 uint32 start_idx; /* 0x0000 0000 */
766 uint32 max_size; /* 0x0000 ffff */
768 } SAMR_Q_ENUM_DOM_GROUPS;
771 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
772 typedef struct r_samr_enum_dom_groups_info
774 uint32 next_idx;
775 uint32 ptr_entries1;
777 uint32 num_entries2;
778 uint32 ptr_entries2;
780 uint32 num_entries3;
782 SAM_ENTRY *sam;
783 UNISTR2 *uni_grp_name;
785 uint32 num_entries4;
787 NTSTATUS status;
789 } SAMR_R_ENUM_DOM_GROUPS;
792 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
793 typedef struct q_samr_enum_dom_aliases_info
795 POLICY_HND pol; /* policy handle */
797 /* this is possibly an enumeration context handle... */
798 uint32 start_idx; /* 0x0000 0000 */
800 uint32 max_size; /* 0x0000 ffff */
802 } SAMR_Q_ENUM_DOM_ALIASES;
805 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
806 typedef struct r_samr_enum_dom_aliases_info
808 uint32 next_idx;
809 uint32 ptr_entries1;
811 uint32 num_entries2;
812 uint32 ptr_entries2;
814 uint32 num_entries3;
816 SAM_ENTRY *sam;
817 UNISTR2 *uni_grp_name;
819 uint32 num_entries4;
821 NTSTATUS status;
823 } SAMR_R_ENUM_DOM_ALIASES;
826 /* -- Level 1 Display Info - User Information -- */
828 typedef struct samr_entry_info1
830 uint32 user_idx;
832 uint32 rid_user;
833 uint16 acb_info;
835 UNIHDR hdr_acct_name;
836 UNIHDR hdr_user_name;
837 UNIHDR hdr_user_desc;
839 } SAM_ENTRY1;
841 typedef struct samr_str_entry_info1
843 UNISTR2 uni_acct_name;
844 UNISTR2 uni_full_name;
845 UNISTR2 uni_acct_desc;
847 } SAM_STR1;
849 typedef struct sam_entry_info_1
851 SAM_ENTRY1 *sam;
852 SAM_STR1 *str;
854 } SAM_DISPINFO_1;
857 /* -- Level 2 Display Info - Trust Account Information -- */
859 typedef struct samr_entry_info2
861 uint32 user_idx;
863 uint32 rid_user;
864 uint16 acb_info;
866 UNIHDR hdr_srv_name;
867 UNIHDR hdr_srv_desc;
869 } SAM_ENTRY2;
871 typedef struct samr_str_entry_info2
873 UNISTR2 uni_srv_name;
874 UNISTR2 uni_srv_desc;
876 } SAM_STR2;
878 typedef struct sam_entry_info_2
880 SAM_ENTRY2 *sam;
881 SAM_STR2 *str;
883 } SAM_DISPINFO_2;
886 /* -- Level 3 Display Info - Domain Group Information -- */
888 typedef struct samr_entry_info3
890 uint32 grp_idx;
892 uint32 rid_grp;
893 uint32 attr; /* SE_GROUP_xxx, usually 7 */
895 UNIHDR hdr_grp_name;
896 UNIHDR hdr_grp_desc;
898 } SAM_ENTRY3;
900 typedef struct samr_str_entry_info3
902 UNISTR2 uni_grp_name;
903 UNISTR2 uni_grp_desc;
905 } SAM_STR3;
907 typedef struct sam_entry_info_3
909 SAM_ENTRY3 *sam;
910 SAM_STR3 *str;
912 } SAM_DISPINFO_3;
915 /* -- Level 4 Display Info - User List (ASCII) -- */
917 typedef struct samr_entry_info4
919 uint32 user_idx;
920 STRHDR hdr_acct_name;
922 } SAM_ENTRY4;
924 typedef struct samr_str_entry_info4
926 STRING2 acct_name;
928 } SAM_STR4;
930 typedef struct sam_entry_info_4
932 SAM_ENTRY4 *sam;
933 SAM_STR4 *str;
935 } SAM_DISPINFO_4;
938 /* -- Level 5 Display Info - Group List (ASCII) -- */
940 typedef struct samr_entry_info5
942 uint32 grp_idx;
943 STRHDR hdr_grp_name;
945 } SAM_ENTRY5;
947 typedef struct samr_str_entry_info5
949 STRING2 grp_name;
951 } SAM_STR5;
953 typedef struct sam_entry_info_5
955 SAM_ENTRY5 *sam;
956 SAM_STR5 *str;
958 } SAM_DISPINFO_5;
961 typedef struct sam_dispinfo_ctr_info
963 union
965 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
966 SAM_DISPINFO_2 *info2; /* trust accounts */
967 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
968 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
969 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
970 void *info; /* allows assignment without typecasting, */
972 } sam;
974 } SAM_DISPINFO_CTR;
977 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
978 typedef struct q_samr_query_disp_info
980 POLICY_HND domain_pol;
982 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
983 /* align */
985 uint32 start_idx; /* start enumeration index */
986 uint32 max_entries; /* maximum number of entries to return */
987 uint32 max_size; /* recommended data size; if exceeded server
988 should return STATUS_MORE_ENTRIES */
990 } SAMR_Q_QUERY_DISPINFO;
993 /* SAMR_R_QUERY_DISPINFO */
994 typedef struct r_samr_query_dispinfo_info
996 uint32 total_size; /* total data size for all matching entries
997 (0 = uncalculated) */
998 uint32 data_size; /* actual data size returned = size of SAM_ENTRY
999 structures + total length of strings */
1001 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1002 /* align */
1004 uint32 num_entries; /* number of entries returned */
1005 uint32 ptr_entries;
1006 uint32 num_entries2;
1008 SAM_DISPINFO_CTR *ctr;
1010 NTSTATUS status;
1012 } SAMR_R_QUERY_DISPINFO;
1015 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
1016 typedef struct q_samr_delete_dom_group_info
1018 POLICY_HND group_pol; /* policy handle */
1020 } SAMR_Q_DELETE_DOM_GROUP;
1023 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
1024 typedef struct r_samr_delete_dom_group_info
1026 POLICY_HND pol; /* policy handle */
1027 NTSTATUS status; /* return status */
1029 } SAMR_R_DELETE_DOM_GROUP;
1032 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
1033 typedef struct q_samr_create_dom_group_info
1035 POLICY_HND pol; /* policy handle */
1037 UNIHDR hdr_acct_desc;
1038 UNISTR2 uni_acct_desc;
1040 uint32 access_mask;
1042 } SAMR_Q_CREATE_DOM_GROUP;
1044 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
1045 typedef struct r_samr_create_dom_group_info
1047 POLICY_HND pol; /* policy handle */
1049 uint32 rid;
1050 NTSTATUS status;
1052 } SAMR_R_CREATE_DOM_GROUP;
1054 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
1055 typedef struct q_samr_query_group_info
1057 POLICY_HND pol; /* policy handle */
1059 uint16 switch_level; /* 0x0001 seen */
1061 } SAMR_Q_QUERY_GROUPINFO;
1063 typedef struct samr_group_info1
1065 UNIHDR hdr_acct_name;
1067 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
1068 uint32 num_members; /* 0x0000 0001 - number of group members? */
1070 UNIHDR hdr_acct_desc;
1072 UNISTR2 uni_acct_name;
1073 UNISTR2 uni_acct_desc;
1075 } GROUP_INFO1;
1077 typedef struct samr_group_info3
1079 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
1081 } GROUP_INFO3;
1083 typedef struct samr_group_info4
1085 UNIHDR hdr_acct_desc;
1086 UNISTR2 uni_acct_desc;
1088 } GROUP_INFO4;
1090 /* GROUP_INFO_CTR */
1091 typedef struct group_info_ctr
1093 uint16 switch_value1;
1095 union
1097 GROUP_INFO1 info1;
1098 GROUP_INFO3 info3;
1099 GROUP_INFO4 info4;
1101 } group;
1103 } GROUP_INFO_CTR;
1105 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
1106 typedef struct r_samr_query_groupinfo_info
1108 uint32 ptr;
1109 GROUP_INFO_CTR *ctr;
1111 NTSTATUS status;
1113 } SAMR_R_QUERY_GROUPINFO;
1116 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
1117 typedef struct q_samr_set_group_info
1119 POLICY_HND pol; /* policy handle */
1120 GROUP_INFO_CTR *ctr;
1122 } SAMR_Q_SET_GROUPINFO;
1124 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
1125 typedef struct r_samr_set_group_info
1127 NTSTATUS status;
1129 } SAMR_R_SET_GROUPINFO;
1132 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1133 typedef struct q_samr_delete_dom_alias_info
1135 POLICY_HND alias_pol; /* policy handle */
1137 } SAMR_Q_DELETE_DOM_ALIAS;
1140 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1141 typedef struct r_samr_delete_dom_alias_info
1143 POLICY_HND pol; /* policy handle */
1144 NTSTATUS status; /* return status */
1146 } SAMR_R_DELETE_DOM_ALIAS;
1149 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1150 typedef struct q_samr_create_dom_alias_info
1152 POLICY_HND dom_pol; /* policy handle */
1154 UNIHDR hdr_acct_desc;
1155 UNISTR2 uni_acct_desc;
1157 uint32 access_mask; /* 0x001f000f */
1159 } SAMR_Q_CREATE_DOM_ALIAS;
1161 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1162 typedef struct r_samr_create_dom_alias_info
1164 POLICY_HND alias_pol; /* policy handle */
1166 uint32 rid;
1167 NTSTATUS status;
1169 } SAMR_R_CREATE_DOM_ALIAS;
1171 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
1172 typedef struct q_samr_query_alias_info
1174 POLICY_HND pol; /* policy handle */
1176 uint16 switch_level; /* 0x0003 seen */
1178 } SAMR_Q_QUERY_ALIASINFO;
1180 typedef struct samr_alias_info1
1182 UNIHDR hdr_acct_name;
1183 UNIHDR hdr_acct_desc;
1184 uint32 num_member;
1185 UNISTR2 uni_acct_name;
1186 UNISTR2 uni_acct_desc;
1188 } ALIAS_INFO1;
1190 typedef struct samr_alias_info3
1192 UNIHDR hdr_acct_desc;
1193 UNISTR2 uni_acct_desc;
1195 } ALIAS_INFO3;
1197 /* ALIAS_INFO_CTR */
1198 typedef struct alias_info_ctr
1200 uint16 switch_value1;
1201 uint16 switch_value2;
1203 union
1205 ALIAS_INFO1 info1;
1206 ALIAS_INFO3 info3;
1208 } alias;
1210 } ALIAS_INFO_CTR;
1212 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
1213 typedef struct r_samr_query_aliasinfo_info
1215 uint32 ptr;
1216 ALIAS_INFO_CTR ctr;
1218 NTSTATUS status;
1220 } SAMR_R_QUERY_ALIASINFO;
1223 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
1224 typedef struct q_samr_set_alias_info
1226 POLICY_HND alias_pol; /* policy handle */
1227 ALIAS_INFO_CTR ctr;
1229 } SAMR_Q_SET_ALIASINFO;
1231 /* SAMR_R_SET_ALIASINFO - SAM alias info */
1232 typedef struct r_samr_set_aliasinfo_info
1234 NTSTATUS status;
1236 } SAMR_R_SET_ALIASINFO;
1239 /* SAMR_Q_QUERY_USERGROUPS - */
1240 typedef struct q_samr_query_usergroup_info
1242 POLICY_HND pol; /* policy handle associated with unknown id */
1244 } SAMR_Q_QUERY_USERGROUPS;
1246 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1247 typedef struct r_samr_query_usergroup_info
1249 uint32 ptr_0; /* pointer */
1250 uint32 num_entries; /* number of RID groups */
1251 uint32 ptr_1; /* pointer */
1252 uint32 num_entries2; /* number of RID groups */
1254 DOM_GID *gid; /* group info */
1256 NTSTATUS status; /* return status */
1258 } SAMR_R_QUERY_USERGROUPS;
1260 /* SAM_USERINFO_CTR - sam user info */
1261 typedef struct sam_userinfo_ctr_info
1263 uint16 switch_value;
1265 union
1267 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
1268 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
1269 SAM_USER_INFO_12 *id12; /* auth-level 0x12 */
1270 SAM_USER_INFO_20 *id20; /* auth-level 20 */
1271 SAM_USER_INFO_21 *id21; /* auth-level 21 */
1272 SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
1273 SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
1274 SAM_USER_INFO_25 *id25; /* auth-level 0x19 */
1275 void* id; /* to make typecasting easy */
1277 } info;
1279 } SAM_USERINFO_CTR;
1282 /* SAMR_Q_SET_USERINFO2 - set sam info */
1283 typedef struct q_samr_set_user_info2
1285 POLICY_HND pol; /* policy handle associated with user */
1286 uint16 switch_value; /* 0x0010 */
1288 SAM_USERINFO_CTR *ctr;
1290 } SAMR_Q_SET_USERINFO2;
1292 /* SAMR_R_SET_USERINFO2 - set sam info */
1293 typedef struct r_samr_set_user_info2
1295 NTSTATUS status; /* return status */
1297 } SAMR_R_SET_USERINFO2;
1299 /* SAMR_Q_SET_USERINFO - set sam info */
1300 typedef struct q_samr_set_user_info
1302 POLICY_HND pol; /* policy handle associated with user */
1303 uint16 switch_value;
1304 SAM_USERINFO_CTR *ctr;
1306 } SAMR_Q_SET_USERINFO;
1308 /* SAMR_R_SET_USERINFO - set sam info */
1309 typedef struct r_samr_set_user_info
1311 NTSTATUS status; /* return status */
1313 } SAMR_R_SET_USERINFO;
1316 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1317 typedef struct q_samr_query_user_info
1319 POLICY_HND pol; /* policy handle associated with unknown id */
1320 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1322 } SAMR_Q_QUERY_USERINFO;
1324 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1325 typedef struct r_samr_query_user_info
1327 uint32 ptr; /* pointer */
1328 SAM_USERINFO_CTR *ctr;
1330 NTSTATUS status; /* return status */
1332 } SAMR_R_QUERY_USERINFO;
1335 /****************************************************************************
1336 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1338 the policy handle allocated by an "samr open secret" call is associated
1339 with a SID. this policy handle is what is queried here, *not* the SID
1340 itself. the response to the lookup rids is relative to this SID.
1341 *****************************************************************************/
1342 /* SAMR_Q_QUERY_USERALIASES */
1343 typedef struct q_samr_query_useraliases_info
1345 POLICY_HND pol; /* policy handle */
1347 uint32 num_sids1; /* number of rids being looked up */
1348 uint32 ptr; /* buffer pointer */
1349 uint32 num_sids2; /* number of rids being looked up */
1351 uint32 *ptr_sid; /* pointers to sids to be looked up */
1352 DOM_SID2 *sid ; /* sids to be looked up. */
1354 } SAMR_Q_QUERY_USERALIASES;
1357 /* SAMR_R_QUERY_USERALIASES */
1358 typedef struct r_samr_query_useraliases_info
1360 uint32 num_entries;
1361 uint32 ptr; /* undocumented buffer pointer */
1363 uint32 num_entries2;
1364 uint32 *rid; /* domain RIDs being looked up */
1366 NTSTATUS status; /* return code */
1368 } SAMR_R_QUERY_USERALIASES;
1371 /****************************************************************************
1372 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1373 *****************************************************************************/
1374 /* SAMR_Q_LOOKUP_NAMES */
1375 typedef struct q_samr_lookup_names_info
1377 POLICY_HND pol; /* policy handle */
1379 uint32 num_names1; /* number of names being looked up */
1380 uint32 flags; /* 0x0000 03e8 - unknown */
1381 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1382 uint32 num_names2; /* number of names being looked up */
1384 UNIHDR *hdr_name; /* unicode account name header */
1385 UNISTR2 *uni_name; /* unicode account name string */
1387 } SAMR_Q_LOOKUP_NAMES;
1390 /* SAMR_R_LOOKUP_NAMES */
1391 typedef struct r_samr_lookup_names_info
1393 uint32 num_rids1; /* number of aliases being looked up */
1394 uint32 ptr_rids; /* pointer to aliases */
1395 uint32 num_rids2; /* number of aliases being looked up */
1397 uint32 *rids; /* rids */
1399 uint32 num_types1; /* number of users in aliases being looked up */
1400 uint32 ptr_types; /* pointer to users in aliases */
1401 uint32 num_types2; /* number of users in aliases being looked up */
1403 uint32 *types; /* SID_ENUM type */
1405 NTSTATUS status; /* return code */
1407 } SAMR_R_LOOKUP_NAMES;
1410 /****************************************************************************
1411 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1413 called to resolve domain RID groups.
1414 *****************************************************************************/
1415 /* SAMR_Q_LOOKUP_RIDS */
1416 typedef struct q_samr_lookup_rids_info
1418 POLICY_HND pol; /* policy handle */
1420 uint32 num_rids1; /* number of rids being looked up */
1421 uint32 flags; /* 0x0000 03e8 - unknown */
1422 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1423 uint32 num_rids2; /* number of rids being looked up */
1425 uint32 *rid; /* domain RIDs being looked up */
1427 } SAMR_Q_LOOKUP_RIDS;
1430 /****************************************************************************
1431 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1433 *****************************************************************************/
1434 /* SAMR_R_LOOKUP_RIDS */
1435 typedef struct r_samr_lookup_rids_info
1437 uint32 num_names1; /* number of aliases being looked up */
1438 uint32 ptr_names; /* pointer to aliases */
1439 uint32 num_names2; /* number of aliases being looked up */
1441 UNIHDR *hdr_name; /* unicode account name header */
1442 UNISTR2 *uni_name; /* unicode account name string */
1444 uint32 num_types1; /* number of users in aliases being looked up */
1445 uint32 ptr_types; /* pointer to users in aliases */
1446 uint32 num_types2; /* number of users in aliases being looked up */
1448 uint32 *type; /* SID_ENUM type */
1450 NTSTATUS status;
1452 } SAMR_R_LOOKUP_RIDS;
1455 /* SAMR_Q_OPEN_USER - probably an open */
1456 typedef struct q_samr_open_user_info
1458 POLICY_HND domain_pol; /* policy handle */
1459 uint32 access_mask; /* 32 bit unknown - 0x02011b */
1460 uint32 user_rid; /* user RID */
1462 } SAMR_Q_OPEN_USER;
1465 /* SAMR_R_OPEN_USER - probably an open */
1466 typedef struct r_samr_open_user_info
1468 POLICY_HND user_pol; /* policy handle associated with unknown id */
1469 NTSTATUS status; /* return status */
1471 } SAMR_R_OPEN_USER;
1474 /* SAMR_Q_CREATE_USER - probably a create */
1475 typedef struct q_samr_create_user_info
1477 POLICY_HND domain_pol; /* policy handle */
1479 UNIHDR hdr_name; /* unicode account name header */
1480 UNISTR2 uni_name; /* unicode account name */
1482 uint32 acb_info; /* account control info */
1483 uint32 access_mask; /* 0xe005 00b0 */
1485 } SAMR_Q_CREATE_USER;
1488 /* SAMR_R_CREATE_USER - probably a create */
1489 typedef struct r_samr_create_user_info
1491 POLICY_HND user_pol; /* policy handle associated with user */
1493 uint32 access_granted;
1494 uint32 user_rid; /* user RID */
1495 NTSTATUS status; /* return status */
1497 } SAMR_R_CREATE_USER;
1500 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
1501 typedef struct q_samr_delete_dom_user_info
1503 POLICY_HND user_pol; /* policy handle */
1505 } SAMR_Q_DELETE_DOM_USER;
1508 /* SAMR_R_DELETE_DOM_USER - delete domain user */
1509 typedef struct r_samr_delete_dom_user_info
1511 POLICY_HND pol; /* policy handle */
1512 NTSTATUS status; /* return status */
1514 } SAMR_R_DELETE_DOM_USER;
1517 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1518 typedef struct q_samr_query_groupmem_info
1520 POLICY_HND group_pol; /* policy handle */
1522 } SAMR_Q_QUERY_GROUPMEM;
1525 /* SAMR_R_QUERY_GROUPMEM - query group members */
1526 typedef struct r_samr_query_groupmem_info
1528 uint32 ptr;
1529 uint32 num_entries;
1531 uint32 ptr_rids;
1532 uint32 ptr_attrs;
1534 uint32 num_rids;
1535 uint32 *rid;
1537 uint32 num_attrs;
1538 uint32 *attr;
1540 NTSTATUS status;
1542 } SAMR_R_QUERY_GROUPMEM;
1545 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1546 typedef struct q_samr_del_group_mem_info
1548 POLICY_HND pol; /* policy handle */
1549 uint32 rid; /* rid */
1551 } SAMR_Q_DEL_GROUPMEM;
1554 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1555 typedef struct r_samr_del_group_mem_info
1557 NTSTATUS status; /* return status */
1559 } SAMR_R_DEL_GROUPMEM;
1562 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1563 typedef struct q_samr_add_group_mem_info
1565 POLICY_HND pol; /* policy handle */
1567 uint32 rid; /* rid */
1568 uint32 unknown; /* 0x0000 0005 */
1570 } SAMR_Q_ADD_GROUPMEM;
1573 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1574 typedef struct r_samr_add_group_mem_info
1576 NTSTATUS status; /* return status */
1578 } SAMR_R_ADD_GROUPMEM;
1581 /* SAMR_Q_OPEN_GROUP - probably an open */
1582 typedef struct q_samr_open_group_info
1584 POLICY_HND domain_pol; /* policy handle */
1585 uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1586 uint32 rid_group; /* rid */
1588 } SAMR_Q_OPEN_GROUP;
1591 /* SAMR_R_OPEN_GROUP - probably an open */
1592 typedef struct r_samr_open_group_info
1594 POLICY_HND pol; /* policy handle */
1595 NTSTATUS status; /* return status */
1597 } SAMR_R_OPEN_GROUP;
1600 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1601 typedef struct q_samr_query_aliasmem_info
1603 POLICY_HND alias_pol; /* policy handle */
1605 } SAMR_Q_QUERY_ALIASMEM;
1608 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1609 typedef struct r_samr_query_aliasmem_info
1611 uint32 num_sids;
1612 uint32 ptr;
1613 uint32 num_sids1;
1615 DOM_SID2 *sid;
1617 NTSTATUS status;
1619 } SAMR_R_QUERY_ALIASMEM;
1622 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1623 typedef struct q_samr_add_alias_mem_info
1625 POLICY_HND alias_pol; /* policy handle */
1627 DOM_SID2 sid; /* member sid to be added to the alias */
1629 } SAMR_Q_ADD_ALIASMEM;
1632 /* SAMR_R_ADD_ALIASMEM - add alias member */
1633 typedef struct r_samr_add_alias_mem_info
1635 NTSTATUS status; /* return status */
1637 } SAMR_R_ADD_ALIASMEM;
1640 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1641 typedef struct q_samr_del_alias_mem_info
1643 POLICY_HND alias_pol; /* policy handle */
1645 DOM_SID2 sid; /* member sid to be added to alias */
1647 } SAMR_Q_DEL_ALIASMEM;
1650 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1651 typedef struct r_samr_del_alias_mem_info
1653 NTSTATUS status; /* return status */
1655 } SAMR_R_DEL_ALIASMEM;
1659 /* SAMR_Q_OPEN_ALIAS - probably an open */
1660 typedef struct q_samr_open_alias_info
1662 POLICY_HND dom_pol;
1664 uint32 access_mask;
1665 uint32 rid_alias;
1667 } SAMR_Q_OPEN_ALIAS;
1670 /* SAMR_R_OPEN_ALIAS - probably an open */
1671 typedef struct r_samr_open_alias_info
1673 POLICY_HND pol; /* policy handle */
1674 NTSTATUS status; /* return status */
1676 } SAMR_R_OPEN_ALIAS;
1679 /* SAMR_Q_CONNECT_ANON - probably an open */
1680 typedef struct q_samr_connect_anon_info
1682 uint32 ptr; /* ptr? */
1683 uint16 unknown_0; /* 0x005c */
1684 uint16 unknown_1; /* 0x0001 */
1685 uint32 access_mask;
1687 } SAMR_Q_CONNECT_ANON;
1689 /* SAMR_R_CONNECT_ANON - probably an open */
1690 typedef struct r_samr_connect_anon_info
1692 POLICY_HND connect_pol; /* policy handle */
1693 NTSTATUS status; /* return status */
1695 } SAMR_R_CONNECT_ANON;
1697 /* SAMR_Q_CONNECT - probably an open */
1698 typedef struct q_samr_connect_info
1700 uint32 ptr_srv_name; /* pointer (to server name?) */
1701 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1703 uint32 access_mask;
1705 } SAMR_Q_CONNECT;
1708 /* SAMR_R_CONNECT - probably an open */
1709 typedef struct r_samr_connect_info
1711 POLICY_HND connect_pol; /* policy handle */
1712 NTSTATUS status; /* return status */
1714 } SAMR_R_CONNECT;
1716 /* SAMR_Q_CONNECT4 */
1717 typedef struct q_samr_connect4_info
1719 uint32 ptr_srv_name; /* pointer to server name */
1720 UNISTR2 uni_srv_name;
1722 uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */
1723 uint32 access_mask;
1724 } SAMR_Q_CONNECT4;
1726 /* SAMR_R_CONNECT4 - same format as connect */
1727 typedef struct r_samr_connect_info SAMR_R_CONNECT4;
1729 /* SAMR_Q_GET_DOM_PWINFO */
1730 typedef struct q_samr_get_dom_pwinfo
1732 uint32 ptr;
1733 UNIHDR hdr_srv_name;
1734 UNISTR2 uni_srv_name;
1736 } SAMR_Q_GET_DOM_PWINFO;
1738 /* SAMR_R_GET_DOM_PWINFO */
1739 typedef struct r_samr_get_dom_pwinfo
1742 * Previously this was 3 uint16's. However, after some tests
1743 * it appears that the data len for the signing needs to be 16.
1744 * Not sure how 3 unit16's ever worked since the length always
1745 * turned out to 12. 3 uint32's + NT_STATUS == 16 bytes. Tested
1746 * using NT and 2k. --jerry
1748 uint32 unk_0;
1749 uint32 unk_1;
1750 uint32 unk_2;
1751 NTSTATUS status;
1753 } SAMR_R_GET_DOM_PWINFO;
1755 /* SAMR_ENC_PASSWD */
1756 typedef struct enc_passwd_info
1758 uint32 ptr;
1759 uint8 pass[516];
1761 } SAMR_ENC_PASSWD;
1763 /* SAMR_ENC_HASH */
1764 typedef struct enc_hash_info
1766 uint32 ptr;
1767 uint8 hash[16];
1769 } SAMR_ENC_HASH;
1771 /* SAMR_Q_CHGPASSWD_USER */
1772 typedef struct q_samr_chgpasswd_user_info
1774 uint32 ptr_0;
1776 UNIHDR hdr_dest_host; /* server name unicode header */
1777 UNISTR2 uni_dest_host; /* server name unicode string */
1779 UNIHDR hdr_user_name; /* username unicode string header */
1780 UNISTR2 uni_user_name; /* username unicode string */
1782 SAMR_ENC_PASSWD nt_newpass;
1783 SAMR_ENC_HASH nt_oldhash;
1785 uint32 unknown; /* 0x0000 0001 */
1787 SAMR_ENC_PASSWD lm_newpass;
1788 SAMR_ENC_HASH lm_oldhash;
1790 } SAMR_Q_CHGPASSWD_USER;
1792 /* SAMR_R_CHGPASSWD_USER */
1793 typedef struct r_samr_chgpasswd_user_info
1795 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1797 } SAMR_R_CHGPASSWD_USER;
1800 /* SAMR_Q_UNKNOWN_2D */
1801 typedef struct q_samr_unknown_2d_info
1803 POLICY_HND dom_pol; /* policy handle */
1804 DOM_SID2 sid; /* SID */
1806 } SAMR_Q_UNKNOWN_2D;
1809 /* SAMR_R_UNKNOWN_2D - probably an open */
1810 typedef struct r_samr_unknown_2d_info
1812 NTSTATUS status; /* return status */
1814 } SAMR_R_UNKNOWN_2D;
1818 /* these are from the old rpc_samr.h - they are needed while the merge
1819 is still going on */
1820 #define MAX_SAM_SIDS 15
1822 /* DOM_SID3 - security id */
1823 typedef struct sid_info_3
1825 uint16 len; /* length, bytes, including length of len :-) */
1826 /* uint8 pad[2]; */
1828 DOM_SID sid;
1830 } DOM_SID3;
1832 /* SAMR_Q_UNKNOWN_2E */
1833 typedef struct q_samr_unknown_2e_info
1835 POLICY_HND domain_pol; /* policy handle */
1836 uint16 switch_value;
1838 } SAMR_Q_UNKNOWN_2E;
1840 /* SAMR_R_UNKNOWN_2E */
1841 typedef struct r_samr_unknown_2e_info
1843 uint32 ptr_0;
1844 uint16 switch_value;
1845 SAM_UNK_CTR *ctr;
1846 NTSTATUS status; /* return status */
1848 } SAMR_R_UNKNOWN_2E;
1850 /* SAMR_Q_SET_DOMAIN_INFO */
1851 typedef struct q_samr_set_domain_info
1853 POLICY_HND domain_pol; /* policy handle */
1854 uint16 switch_value0;
1855 uint16 switch_value;
1856 SAM_UNK_CTR *ctr;
1858 } SAMR_Q_SET_DOMAIN_INFO;
1860 /* SAMR_R_SET_DOMAIN_INFO */
1861 typedef struct r_samr_set_domain_info
1863 NTSTATUS status; /* return status */
1865 } SAMR_R_SET_DOMAIN_INFO;
1867 #endif /* _RPC_SAMR_H */