r10224: add {Unl,L}ockServiceDatabase() to get srvmgr.exe to work
[Samba.git] / source / include / rpc_samr.h
blob6067587654e123c202ed16809d45b39521739775
1 /*
2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Andrew Tridgell 1992-2000
5 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
6 Copyright (C) Paul Ashton 1997-2000
7 Copyright (C) Jean François Micouleau 1998-2001
8 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
27 #define _RPC_SAMR_H
29 /*******************************************************************
30 the following information comes from a QuickView on samsrv.dll,
31 and gives an idea of exactly what is needed:
33 x SamrAddMemberToAlias
34 x SamrAddMemberToGroup
35 SamrAddMultipleMembersToAlias
36 x SamrChangePasswordUser
37 x SamrCloseHandle
38 x SamrConnect
39 x SamrCreateAliasInDomain
40 x SamrCreateGroupInDomain
41 x SamrCreateUserInDomain
42 ? SamrDeleteAlias
43 SamrDeleteGroup
44 x SamrDeleteUser
45 x SamrEnumerateAliasesInDomain
46 SamrEnumerateDomainsInSamServer
47 x SamrEnumerateGroupsInDomain
48 x SamrEnumerateUsersInDomain
49 SamrGetUserDomainPasswordInformation
50 SamrLookupDomainInSamServer
51 ? SamrLookupIdsInDomain
52 x SamrLookupNamesInDomain
53 x SamrOpenAlias
54 x SamrOpenDomain
55 x SamrOpenGroup
56 x SamrOpenUser
57 x SamrQueryDisplayInformation
58 x SamrQueryInformationAlias
59 SamrQueryInformationDomain
60 ? SamrQueryInformationUser
61 x SamrQuerySecurityObject
62 SamrRemoveMemberFromAlias
63 SamrRemoveMemberFromForiegnDomain
64 SamrRemoveMemberFromGroup
65 SamrRemoveMultipleMembersFromAlias
66 x SamrSetInformationAlias
67 SamrSetInformationDomain
68 x SamrSetInformationGroup
69 x SamrSetInformationUser
70 SamrSetMemberAttributesOfGroup
71 SamrSetSecurityObject
72 SamrShutdownSamServer
73 SamrTestPrivateFunctionsDomain
74 SamrTestPrivateFunctionsUser
76 ********************************************************************/
78 #define SAMR_CONNECT_ANON 0x00
79 #define SAMR_CLOSE_HND 0x01
80 #define SAMR_SET_SEC_OBJECT 0x02
81 #define SAMR_QUERY_SEC_OBJECT 0x03
83 #define SAMR_UNKNOWN_4 0x04 /* profile info? */
84 #define SAMR_LOOKUP_DOMAIN 0x05
85 #define SAMR_ENUM_DOMAINS 0x06
86 #define SAMR_OPEN_DOMAIN 0x07
87 #define SAMR_QUERY_DOMAIN_INFO 0x08
88 #define SAMR_SET_DOMAIN_INFO 0x09
90 #define SAMR_CREATE_DOM_GROUP 0x0a
91 #define SAMR_ENUM_DOM_GROUPS 0x0b
92 #define SAMR_ENUM_DOM_USERS 0x0d
93 #define SAMR_CREATE_DOM_ALIAS 0x0e
94 #define SAMR_ENUM_DOM_ALIASES 0x0f
95 #define SAMR_QUERY_USERALIASES 0x10
97 #define SAMR_LOOKUP_NAMES 0x11
98 #define SAMR_LOOKUP_RIDS 0x12
100 #define SAMR_OPEN_GROUP 0x13
101 #define SAMR_QUERY_GROUPINFO 0x14
102 #define SAMR_SET_GROUPINFO 0x15
103 #define SAMR_ADD_GROUPMEM 0x16
104 #define SAMR_DELETE_DOM_GROUP 0x17
105 #define SAMR_DEL_GROUPMEM 0x18
106 #define SAMR_QUERY_GROUPMEM 0x19
107 #define SAMR_UNKNOWN_1A 0x1a
109 #define SAMR_OPEN_ALIAS 0x1b
110 #define SAMR_QUERY_ALIASINFO 0x1c
111 #define SAMR_SET_ALIASINFO 0x1d
112 #define SAMR_DELETE_DOM_ALIAS 0x1e
113 #define SAMR_ADD_ALIASMEM 0x1f
114 #define SAMR_DEL_ALIASMEM 0x20
115 #define SAMR_QUERY_ALIASMEM 0x21
117 #define SAMR_OPEN_USER 0x22
118 #define SAMR_DELETE_DOM_USER 0x23
119 #define SAMR_QUERY_USERINFO 0x24
120 #define SAMR_SET_USERINFO2 0x25
121 #define SAMR_QUERY_USERGROUPS 0x27
123 #define SAMR_QUERY_DISPINFO 0x28
124 #define SAMR_UNKNOWN_29 0x29
125 #define SAMR_UNKNOWN_2a 0x2a
126 #define SAMR_UNKNOWN_2b 0x2b
127 #define SAMR_GET_USRDOM_PWINFO 0x2c
128 #define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d
129 #define SAMR_UNKNOWN_2E 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
130 #define SAMR_UNKNOWN_2f 0x2f
131 #define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO
132 with info level 3 */
133 #define SAMR_UNKNOWN_31 0x31
134 #define SAMR_CREATE_USER 0x32
135 #define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO
136 with info level 4 */
137 #define SAMR_ADDMULTI_ALIASMEM 0x34
139 #define SAMR_UNKNOWN_35 0x35
140 #define SAMR_UNKNOWN_36 0x36
141 #define SAMR_CHGPASSWD_USER 0x37
142 #define SAMR_GET_DOM_PWINFO 0x38
143 #define SAMR_CONNECT 0x39
144 #define SAMR_SET_USERINFO 0x3A
145 #define SAMR_CONNECT4 0x3E
147 typedef struct logon_hours_info
149 uint32 max_len; /* normally 1260 bytes */
150 uint32 offset;
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 LOGON_HRS logon_hrs;
217 } SAM_USER_INFO_23;
219 /* SAM_USER_INFO_24 */
220 typedef struct sam_user_info_24
222 uint8 pass[516];
223 uint16 pw_len;
224 } SAM_USER_INFO_24;
227 * NB. This structure is *definately* incorrect. It's my best guess
228 * currently for W2K SP2. The password field is encrypted in a different
229 * way than normal... And there are definately other problems. JRA.
232 /* SAM_USER_INFO_25 */
233 typedef struct sam_user_info_25
235 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
236 NTTIME logon_time; /* logon time */
237 NTTIME logoff_time; /* logoff time */
238 NTTIME kickoff_time; /* kickoff time */
239 NTTIME pass_last_set_time; /* password last set time */
240 NTTIME pass_can_change_time; /* password can change time */
241 NTTIME pass_must_change_time; /* password must change time */
243 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
244 UNIHDR hdr_full_name; /* user's full name unicode string header */
245 UNIHDR hdr_home_dir; /* home directory unicode string header */
246 UNIHDR hdr_dir_drive; /* home drive unicode string header */
247 UNIHDR hdr_logon_script; /* logon script unicode string header */
248 UNIHDR hdr_profile_path; /* profile path unicode string header */
249 UNIHDR hdr_acct_desc ; /* user description */
250 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
251 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
252 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
254 uint8 lm_pwd[16]; /* lm user passwords */
255 uint8 nt_pwd[16]; /* nt user passwords */
257 uint32 user_rid; /* Primary User ID */
258 uint32 group_rid; /* Primary Group ID */
260 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
262 uint32 unknown_6[6];
264 uint8 pass[532];
266 UNISTR2 uni_user_name; /* NULL - username unicode string */
267 UNISTR2 uni_full_name; /* user's full name unicode string */
268 UNISTR2 uni_home_dir; /* home directory unicode string */
269 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
270 UNISTR2 uni_logon_script; /* logon script unicode string */
271 UNISTR2 uni_profile_path; /* profile path unicode string */
272 UNISTR2 uni_acct_desc ; /* user description unicode string */
273 UNISTR2 uni_workstations; /* login from workstations unicode string */
274 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
275 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
276 } SAM_USER_INFO_25;
279 /* SAM_USER_INFO_21 */
280 typedef struct sam_user_info_21
282 NTTIME logon_time; /* logon time */
283 NTTIME logoff_time; /* logoff time */
284 NTTIME kickoff_time; /* kickoff time */
285 NTTIME pass_last_set_time; /* password last set time */
286 NTTIME pass_can_change_time; /* password can change time */
287 NTTIME pass_must_change_time; /* password must change time */
289 UNIHDR hdr_user_name; /* username unicode string header */
290 UNIHDR hdr_full_name; /* user's full name unicode string header */
291 UNIHDR hdr_home_dir; /* home directory unicode string header */
292 UNIHDR hdr_dir_drive; /* home drive unicode string header */
293 UNIHDR hdr_logon_script; /* logon script unicode string header */
294 UNIHDR hdr_profile_path; /* profile path unicode string header */
295 UNIHDR hdr_acct_desc ; /* user description */
296 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
297 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
298 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
300 uint8 lm_pwd[16]; /* lm user passwords */
301 uint8 nt_pwd[16]; /* nt user passwords */
303 uint32 user_rid; /* Primary User ID */
304 uint32 group_rid; /* Primary Group ID */
306 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
308 /* Was unknown_3 */
309 uint32 fields_present; /* 0x00ff ffff */
311 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
312 /* uint8 pad[2] */
313 uint32 ptr_logon_hrs; /* unknown pointer */
315 /* Was unknown_5. */
316 uint16 bad_password_count;
317 uint16 logon_count;
319 uint8 padding1[6];
321 uint8 passmustchange; /* 0x00 must change = 0x01 */
323 uint8 padding2;
325 UNISTR2 uni_user_name; /* username unicode string */
326 UNISTR2 uni_full_name; /* user's full name unicode string */
327 UNISTR2 uni_home_dir; /* home directory unicode string */
328 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
329 UNISTR2 uni_logon_script; /* logon script unicode string */
330 UNISTR2 uni_profile_path; /* profile path unicode string */
331 UNISTR2 uni_acct_desc ; /* user description unicode string */
332 UNISTR2 uni_workstations; /* login from workstations unicode string */
333 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
334 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
336 LOGON_HRS logon_hrs;
338 } SAM_USER_INFO_21;
340 #define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
341 #define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
343 /* SAM_USER_INFO_20 */
344 typedef struct sam_user_info_20
346 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
348 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
350 } SAM_USER_INFO_20;
352 /* SAM_USER_INFO_18 */
353 typedef struct sam_user_info_18
355 uint8 lm_pwd[16]; /* lm user passwords */
356 uint8 nt_pwd[16]; /* nt user passwords */
358 uint8 lm_pwd_active;
359 uint8 nt_pwd_active;
361 } SAM_USER_INFO_18;
363 /* SAM_USER_INFO_17 */
364 typedef struct sam_user_info_17
366 uint8 padding_0[16]; /* 0 - padding 16 bytes */
367 NTTIME expiry; /* expiry time or something? */
368 uint8 padding_1[24]; /* 0 - padding 24 bytes */
370 UNIHDR hdr_mach_acct; /* unicode header for machine account */
371 uint32 padding_2; /* 0 - padding 4 bytes */
373 uint32 ptr_1; /* pointer */
374 uint8 padding_3[32]; /* 0 - padding 32 bytes */
375 uint32 padding_4; /* 0 - padding 4 bytes */
377 uint32 ptr_2; /* pointer */
378 uint32 padding_5; /* 0 - padding 4 bytes */
380 uint32 ptr_3; /* pointer */
381 uint8 padding_6[32]; /* 0 - padding 32 bytes */
383 uint32 rid_user; /* user RID */
384 uint32 rid_group; /* group RID */
386 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
387 uint16 unknown_3; /* 16 bit padding */
389 uint16 unknown_4; /* 0x003f - 16 bit unknown */
390 uint16 unknown_5; /* 0x003c - 16 bit unknown */
392 uint8 padding_7[16]; /* 0 - padding 16 bytes */
393 uint32 padding_8; /* 0 - padding 4 bytes */
395 UNISTR2 uni_mach_acct; /* unicode string for machine account */
397 uint8 padding_9[48]; /* 0 - padding 48 bytes */
399 } SAM_USER_INFO_17;
402 /* SAM_USER_INFO_16 */
403 typedef struct sam_user_info_16
405 uint32 acb_info;
407 } SAM_USER_INFO_16;
409 /* SAM_USER_INFO_7 */
410 typedef struct sam_user_info_7
412 UNIHDR hdr_name; /* unicode header for name */
413 UNISTR2 uni_name; /* unicode string for name */
415 } SAM_USER_INFO_7;
418 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
419 typedef struct q_samr_close_hnd_info
421 POLICY_HND pol; /* policy handle */
423 } SAMR_Q_CLOSE_HND;
426 /* SAMR_R_CLOSE_HND - probably a policy handle close */
427 typedef struct r_samr_close_hnd_info
429 POLICY_HND pol; /* policy handle */
430 NTSTATUS status; /* return status */
432 } SAMR_R_CLOSE_HND;
435 /****************************************************************************
436 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
437 *****************************************************************************/
439 /* SAMR_Q_GET_USRDOM_PWINFO */
440 typedef struct q_samr_usrdom_pwinfo_info
442 POLICY_HND user_pol; /* policy handle */
444 } SAMR_Q_GET_USRDOM_PWINFO;
447 /****************************************************************************
448 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
449 *****************************************************************************/
451 /* SAMR_R_GET_USRDOM_PWINFO */
452 typedef struct r_samr_usrdom_pwinfo_info
454 uint16 unknown_0; /* 0000 */
455 uint16 unknown_1; /* 0x0016 or 0x0015 */
456 uint32 unknown_2; /* 0x0000 0000 */
457 NTSTATUS status;
459 } SAMR_R_GET_USRDOM_PWINFO;
461 /****************************************************************************
462 SAMR_Q_SET_SEC_OBJ - info level 4.
463 *****************************************************************************/
465 /* SAMR_Q_SET_SEC_OBJ - */
466 typedef struct q_samr_set_sec_obj_info
468 POLICY_HND pol; /* policy handle */
469 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
470 SEC_DESC_BUF *buf;
472 } SAMR_Q_SET_SEC_OBJ;
474 /* SAMR_R_SET_SEC_OBJ - */
475 typedef struct r_samr_set_sec_obj_info
477 NTSTATUS status; /* return status */
479 } SAMR_R_SET_SEC_OBJ;
482 /****************************************************************************
483 SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
484 *****************************************************************************/
486 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
487 typedef struct q_samr_query_sec_obj_info
489 POLICY_HND user_pol; /* policy handle */
490 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
492 } SAMR_Q_QUERY_SEC_OBJ;
494 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
495 typedef struct r_samr_query_sec_obj_info
497 uint32 ptr;
498 SEC_DESC_BUF *buf;
500 NTSTATUS status; /* return status */
502 } SAMR_R_QUERY_SEC_OBJ;
505 /****************************************************************************
506 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
507 *****************************************************************************/
509 /* SAMR_Q_QUERY_DOMAIN_INFO - */
510 typedef struct q_samr_query_domain_info
512 POLICY_HND domain_pol; /* policy handle */
513 uint16 switch_value; /* 0x0002, 0x0001 */
515 } SAMR_Q_QUERY_DOMAIN_INFO;
517 typedef struct sam_unknown_info_3_info
519 NTTIME logout;
520 /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
522 /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
524 } SAM_UNK_INFO_3;
526 typedef struct sam_unknown_info_6_info
528 uint32 unknown_0; /* 0x0000 0000 */
530 uint32 ptr_0; /* pointer to unknown structure */
531 uint8 padding[12]; /* 12 bytes zeros */
533 } SAM_UNK_INFO_6;
535 typedef struct sam_unknown_info_7_info
537 uint16 server_role;
539 } SAM_UNK_INFO_7;
541 typedef struct sam_unknown_info_8_info
543 UINT64_S seq_num;
544 NTTIME domain_create_time;
546 } SAM_UNK_INFO_8;
548 typedef struct sam_unknown_info_12_inf
550 NTTIME duration;
551 NTTIME reset_count;
552 uint16 bad_attempt_lockout;
554 } SAM_UNK_INFO_12;
556 typedef struct sam_unknown_info_5_inf
558 UNIHDR hdr_server; /* server name unicode header */
559 UNISTR2 uni_server; /* server name unicode string */
561 } SAM_UNK_INFO_5;
563 typedef struct sam_unknown_info_2_inf
565 NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */
566 UNIHDR hdr_comment; /* comment according to samba4 idl */
567 UNIHDR hdr_domain; /* domain name unicode header */
568 UNIHDR hdr_server; /* server name unicode header */
570 /* put all the data in here, at the moment, including what the above
571 pointer is referring to
574 UINT64_S seq_num;
576 uint32 unknown_4; /* 0x0000 0001 */
577 uint32 server_role;
578 uint32 unknown_6; /* 0x0000 0001 */
579 uint32 num_domain_usrs; /* number of users in domain */
580 uint32 num_domain_grps; /* number of domain groups in domain */
581 uint32 num_local_grps; /* number of local groups in domain */
583 uint8 padding[12]; /* 12 bytes zeros */
585 UNISTR2 uni_comment; /* comment unicode string */
586 UNISTR2 uni_domain; /* domain name unicode string */
587 UNISTR2 uni_server; /* server name unicode string */
589 } SAM_UNK_INFO_2;
591 typedef struct sam_unknown_info_1_inf
593 uint16 min_length_password;
594 uint16 password_history;
595 uint32 flag;
596 NTTIME expire;
597 NTTIME min_passwordage;
599 } SAM_UNK_INFO_1;
602 typedef struct sam_unknown_ctr_info
604 union
606 SAM_UNK_INFO_1 inf1;
607 SAM_UNK_INFO_2 inf2;
608 SAM_UNK_INFO_3 inf3;
609 SAM_UNK_INFO_5 inf5;
610 SAM_UNK_INFO_6 inf6;
611 SAM_UNK_INFO_7 inf7;
612 SAM_UNK_INFO_8 inf8;
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_info2
1079 uint16 level;
1080 UNIHDR hdr_acct_name;
1081 UNISTR2 uni_acct_name;
1083 } GROUP_INFO2;
1085 typedef struct samr_group_info3
1087 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
1089 } GROUP_INFO3;
1091 typedef struct samr_group_info4
1093 uint16 level;
1094 UNIHDR hdr_acct_desc;
1095 UNISTR2 uni_acct_desc;
1097 } GROUP_INFO4;
1099 /* GROUP_INFO_CTR */
1100 typedef struct group_info_ctr
1102 uint16 switch_value1;
1104 union
1106 GROUP_INFO1 info1;
1107 GROUP_INFO2 info2;
1108 GROUP_INFO3 info3;
1109 GROUP_INFO4 info4;
1111 } group;
1113 } GROUP_INFO_CTR;
1115 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
1116 typedef struct r_samr_query_groupinfo_info
1118 uint32 ptr;
1119 GROUP_INFO_CTR *ctr;
1121 NTSTATUS status;
1123 } SAMR_R_QUERY_GROUPINFO;
1126 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
1127 typedef struct q_samr_set_group_info
1129 POLICY_HND pol; /* policy handle */
1130 GROUP_INFO_CTR *ctr;
1132 } SAMR_Q_SET_GROUPINFO;
1134 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
1135 typedef struct r_samr_set_group_info
1137 NTSTATUS status;
1139 } SAMR_R_SET_GROUPINFO;
1142 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1143 typedef struct q_samr_delete_dom_alias_info
1145 POLICY_HND alias_pol; /* policy handle */
1147 } SAMR_Q_DELETE_DOM_ALIAS;
1150 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1151 typedef struct r_samr_delete_dom_alias_info
1153 POLICY_HND pol; /* policy handle */
1154 NTSTATUS status; /* return status */
1156 } SAMR_R_DELETE_DOM_ALIAS;
1159 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1160 typedef struct q_samr_create_dom_alias_info
1162 POLICY_HND dom_pol; /* policy handle */
1164 UNIHDR hdr_acct_desc;
1165 UNISTR2 uni_acct_desc;
1167 uint32 access_mask; /* 0x001f000f */
1169 } SAMR_Q_CREATE_DOM_ALIAS;
1171 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1172 typedef struct r_samr_create_dom_alias_info
1174 POLICY_HND alias_pol; /* policy handle */
1176 uint32 rid;
1177 NTSTATUS status;
1179 } SAMR_R_CREATE_DOM_ALIAS;
1182 /********************************************************/
1184 typedef struct {
1185 UNISTR4 name;
1186 UNISTR4 description;
1187 uint32 num_member;
1188 } ALIAS_INFO1;
1190 typedef struct {
1191 UNISTR4 description;
1192 } ALIAS_INFO3;
1194 typedef struct {
1195 POLICY_HND pol; /* policy handle */
1196 uint16 level; /* 0x0003 seen */
1197 } SAMR_Q_QUERY_ALIASINFO;
1199 typedef struct {
1200 uint16 level;
1201 union {
1202 ALIAS_INFO1 info1;
1203 ALIAS_INFO3 info3;
1204 } alias;
1205 } ALIAS_INFO_CTR;
1207 typedef struct {
1208 ALIAS_INFO_CTR *ctr;
1209 NTSTATUS status;
1210 } SAMR_R_QUERY_ALIASINFO;
1213 /********************************************************/
1215 typedef struct {
1216 POLICY_HND alias_pol; /* policy handle */
1217 ALIAS_INFO_CTR ctr;
1218 } SAMR_Q_SET_ALIASINFO;
1220 typedef struct {
1221 NTSTATUS status;
1222 } SAMR_R_SET_ALIASINFO;
1225 /********************************************************/
1227 /* SAMR_Q_QUERY_USERGROUPS - */
1228 typedef struct q_samr_query_usergroup_info
1230 POLICY_HND pol; /* policy handle associated with unknown id */
1232 } SAMR_Q_QUERY_USERGROUPS;
1234 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1235 typedef struct r_samr_query_usergroup_info
1237 uint32 ptr_0; /* pointer */
1238 uint32 num_entries; /* number of RID groups */
1239 uint32 ptr_1; /* pointer */
1240 uint32 num_entries2; /* number of RID groups */
1242 DOM_GID *gid; /* group info */
1244 NTSTATUS status; /* return status */
1246 } SAMR_R_QUERY_USERGROUPS;
1248 /* SAM_USERINFO_CTR - sam user info */
1249 typedef struct sam_userinfo_ctr_info
1251 uint16 switch_value;
1253 union
1255 SAM_USER_INFO_7 *id7;
1256 SAM_USER_INFO_16 *id16;
1257 SAM_USER_INFO_17 *id17;
1258 SAM_USER_INFO_18 *id18;
1259 SAM_USER_INFO_20 *id20;
1260 SAM_USER_INFO_21 *id21;
1261 SAM_USER_INFO_23 *id23;
1262 SAM_USER_INFO_24 *id24;
1263 SAM_USER_INFO_25 *id25;
1264 void* id; /* to make typecasting easy */
1266 } info;
1268 } SAM_USERINFO_CTR;
1271 /* SAMR_Q_SET_USERINFO2 - set sam info */
1272 typedef struct q_samr_set_user_info2
1274 POLICY_HND pol; /* policy handle associated with user */
1275 uint16 switch_value; /* 0x0010 */
1277 SAM_USERINFO_CTR *ctr;
1279 } SAMR_Q_SET_USERINFO2;
1281 /* SAMR_R_SET_USERINFO2 - set sam info */
1282 typedef struct r_samr_set_user_info2
1284 NTSTATUS status; /* return status */
1286 } SAMR_R_SET_USERINFO2;
1288 /* SAMR_Q_SET_USERINFO - set sam info */
1289 typedef struct q_samr_set_user_info
1291 POLICY_HND pol; /* policy handle associated with user */
1292 uint16 switch_value;
1293 SAM_USERINFO_CTR *ctr;
1295 } SAMR_Q_SET_USERINFO;
1297 /* SAMR_R_SET_USERINFO - set sam info */
1298 typedef struct r_samr_set_user_info
1300 NTSTATUS status; /* return status */
1302 } SAMR_R_SET_USERINFO;
1305 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1306 typedef struct q_samr_query_user_info
1308 POLICY_HND pol; /* policy handle associated with unknown id */
1309 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1311 } SAMR_Q_QUERY_USERINFO;
1313 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1314 typedef struct r_samr_query_user_info
1316 uint32 ptr; /* pointer */
1317 SAM_USERINFO_CTR *ctr;
1319 NTSTATUS status; /* return status */
1321 } SAMR_R_QUERY_USERINFO;
1324 /****************************************************************************
1325 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1327 the policy handle allocated by an "samr open secret" call is associated
1328 with a SID. this policy handle is what is queried here, *not* the SID
1329 itself. the response to the lookup rids is relative to this SID.
1330 *****************************************************************************/
1331 /* SAMR_Q_QUERY_USERALIASES */
1332 typedef struct q_samr_query_useraliases_info
1334 POLICY_HND pol; /* policy handle */
1336 uint32 num_sids1; /* number of rids being looked up */
1337 uint32 ptr; /* buffer pointer */
1338 uint32 num_sids2; /* number of rids being looked up */
1340 uint32 *ptr_sid; /* pointers to sids to be looked up */
1341 DOM_SID2 *sid ; /* sids to be looked up. */
1343 } SAMR_Q_QUERY_USERALIASES;
1346 /* SAMR_R_QUERY_USERALIASES */
1347 typedef struct r_samr_query_useraliases_info
1349 uint32 num_entries;
1350 uint32 ptr; /* undocumented buffer pointer */
1352 uint32 num_entries2;
1353 uint32 *rid; /* domain RIDs being looked up */
1355 NTSTATUS status; /* return code */
1357 } SAMR_R_QUERY_USERALIASES;
1360 /****************************************************************************
1361 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1362 *****************************************************************************/
1363 /* SAMR_Q_LOOKUP_NAMES */
1364 typedef struct q_samr_lookup_names_info
1366 POLICY_HND pol; /* policy handle */
1368 uint32 num_names1; /* number of names being looked up */
1369 uint32 flags; /* 0x0000 03e8 - unknown */
1370 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1371 uint32 num_names2; /* number of names being looked up */
1373 UNIHDR *hdr_name; /* unicode account name header */
1374 UNISTR2 *uni_name; /* unicode account name string */
1376 } SAMR_Q_LOOKUP_NAMES;
1379 /* SAMR_R_LOOKUP_NAMES */
1380 typedef struct r_samr_lookup_names_info
1382 uint32 num_rids1; /* number of aliases being looked up */
1383 uint32 ptr_rids; /* pointer to aliases */
1384 uint32 num_rids2; /* number of aliases being looked up */
1386 uint32 *rids; /* rids */
1388 uint32 num_types1; /* number of users in aliases being looked up */
1389 uint32 ptr_types; /* pointer to users in aliases */
1390 uint32 num_types2; /* number of users in aliases being looked up */
1392 uint32 *types; /* SID_ENUM type */
1394 NTSTATUS status; /* return code */
1396 } SAMR_R_LOOKUP_NAMES;
1399 /****************************************************************************
1400 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1402 called to resolve domain RID groups.
1403 *****************************************************************************/
1404 /* SAMR_Q_LOOKUP_RIDS */
1405 typedef struct q_samr_lookup_rids_info
1407 POLICY_HND pol; /* policy handle */
1409 uint32 num_rids1; /* number of rids being looked up */
1410 uint32 flags; /* 0x0000 03e8 - unknown */
1411 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1412 uint32 num_rids2; /* number of rids being looked up */
1414 uint32 *rid; /* domain RIDs being looked up */
1416 } SAMR_Q_LOOKUP_RIDS;
1419 /****************************************************************************
1420 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1422 *****************************************************************************/
1423 /* SAMR_R_LOOKUP_RIDS */
1424 typedef struct r_samr_lookup_rids_info
1426 uint32 num_names1; /* number of aliases being looked up */
1427 uint32 ptr_names; /* pointer to aliases */
1428 uint32 num_names2; /* number of aliases being looked up */
1430 UNIHDR *hdr_name; /* unicode account name header */
1431 UNISTR2 *uni_name; /* unicode account name string */
1433 uint32 num_types1; /* number of users in aliases being looked up */
1434 uint32 ptr_types; /* pointer to users in aliases */
1435 uint32 num_types2; /* number of users in aliases being looked up */
1437 uint32 *type; /* SID_ENUM type */
1439 NTSTATUS status;
1441 } SAMR_R_LOOKUP_RIDS;
1444 /* SAMR_Q_OPEN_USER - probably an open */
1445 typedef struct q_samr_open_user_info
1447 POLICY_HND domain_pol; /* policy handle */
1448 uint32 access_mask; /* 32 bit unknown - 0x02011b */
1449 uint32 user_rid; /* user RID */
1451 } SAMR_Q_OPEN_USER;
1454 /* SAMR_R_OPEN_USER - probably an open */
1455 typedef struct r_samr_open_user_info
1457 POLICY_HND user_pol; /* policy handle associated with unknown id */
1458 NTSTATUS status; /* return status */
1460 } SAMR_R_OPEN_USER;
1463 /* SAMR_Q_CREATE_USER - probably a create */
1464 typedef struct q_samr_create_user_info
1466 POLICY_HND domain_pol; /* policy handle */
1468 UNIHDR hdr_name; /* unicode account name header */
1469 UNISTR2 uni_name; /* unicode account name */
1471 uint32 acb_info; /* account control info */
1472 uint32 access_mask; /* 0xe005 00b0 */
1474 } SAMR_Q_CREATE_USER;
1477 /* SAMR_R_CREATE_USER - probably a create */
1478 typedef struct r_samr_create_user_info
1480 POLICY_HND user_pol; /* policy handle associated with user */
1482 uint32 access_granted;
1483 uint32 user_rid; /* user RID */
1484 NTSTATUS status; /* return status */
1486 } SAMR_R_CREATE_USER;
1489 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
1490 typedef struct q_samr_delete_dom_user_info
1492 POLICY_HND user_pol; /* policy handle */
1494 } SAMR_Q_DELETE_DOM_USER;
1497 /* SAMR_R_DELETE_DOM_USER - delete domain user */
1498 typedef struct r_samr_delete_dom_user_info
1500 POLICY_HND pol; /* policy handle */
1501 NTSTATUS status; /* return status */
1503 } SAMR_R_DELETE_DOM_USER;
1506 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1507 typedef struct q_samr_query_groupmem_info
1509 POLICY_HND group_pol; /* policy handle */
1511 } SAMR_Q_QUERY_GROUPMEM;
1514 /* SAMR_R_QUERY_GROUPMEM - query group members */
1515 typedef struct r_samr_query_groupmem_info
1517 uint32 ptr;
1518 uint32 num_entries;
1520 uint32 ptr_rids;
1521 uint32 ptr_attrs;
1523 uint32 num_rids;
1524 uint32 *rid;
1526 uint32 num_attrs;
1527 uint32 *attr;
1529 NTSTATUS status;
1531 } SAMR_R_QUERY_GROUPMEM;
1534 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1535 typedef struct q_samr_del_group_mem_info
1537 POLICY_HND pol; /* policy handle */
1538 uint32 rid; /* rid */
1540 } SAMR_Q_DEL_GROUPMEM;
1543 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1544 typedef struct r_samr_del_group_mem_info
1546 NTSTATUS status; /* return status */
1548 } SAMR_R_DEL_GROUPMEM;
1551 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1552 typedef struct q_samr_add_group_mem_info
1554 POLICY_HND pol; /* policy handle */
1556 uint32 rid; /* rid */
1557 uint32 unknown; /* 0x0000 0005 */
1559 } SAMR_Q_ADD_GROUPMEM;
1562 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1563 typedef struct r_samr_add_group_mem_info
1565 NTSTATUS status; /* return status */
1567 } SAMR_R_ADD_GROUPMEM;
1570 /* SAMR_Q_OPEN_GROUP - probably an open */
1571 typedef struct q_samr_open_group_info
1573 POLICY_HND domain_pol; /* policy handle */
1574 uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1575 uint32 rid_group; /* rid */
1577 } SAMR_Q_OPEN_GROUP;
1580 /* SAMR_R_OPEN_GROUP - probably an open */
1581 typedef struct r_samr_open_group_info
1583 POLICY_HND pol; /* policy handle */
1584 NTSTATUS status; /* return status */
1586 } SAMR_R_OPEN_GROUP;
1589 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1590 typedef struct q_samr_query_aliasmem_info
1592 POLICY_HND alias_pol; /* policy handle */
1594 } SAMR_Q_QUERY_ALIASMEM;
1597 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1598 typedef struct r_samr_query_aliasmem_info
1600 uint32 num_sids;
1601 uint32 ptr;
1602 uint32 num_sids1;
1604 DOM_SID2 *sid;
1606 NTSTATUS status;
1608 } SAMR_R_QUERY_ALIASMEM;
1611 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1612 typedef struct q_samr_add_alias_mem_info
1614 POLICY_HND alias_pol; /* policy handle */
1616 DOM_SID2 sid; /* member sid to be added to the alias */
1618 } SAMR_Q_ADD_ALIASMEM;
1621 /* SAMR_R_ADD_ALIASMEM - add alias member */
1622 typedef struct r_samr_add_alias_mem_info
1624 NTSTATUS status; /* return status */
1626 } SAMR_R_ADD_ALIASMEM;
1629 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1630 typedef struct q_samr_del_alias_mem_info
1632 POLICY_HND alias_pol; /* policy handle */
1634 DOM_SID2 sid; /* member sid to be added to alias */
1636 } SAMR_Q_DEL_ALIASMEM;
1639 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1640 typedef struct r_samr_del_alias_mem_info
1642 NTSTATUS status; /* return status */
1644 } SAMR_R_DEL_ALIASMEM;
1648 /* SAMR_Q_OPEN_ALIAS - probably an open */
1649 typedef struct q_samr_open_alias_info
1651 POLICY_HND dom_pol;
1653 uint32 access_mask;
1654 uint32 rid_alias;
1656 } SAMR_Q_OPEN_ALIAS;
1659 /* SAMR_R_OPEN_ALIAS - probably an open */
1660 typedef struct r_samr_open_alias_info
1662 POLICY_HND pol; /* policy handle */
1663 NTSTATUS status; /* return status */
1665 } SAMR_R_OPEN_ALIAS;
1668 /* SAMR_Q_CONNECT_ANON - probably an open */
1669 typedef struct q_samr_connect_anon_info
1671 uint32 ptr; /* ptr? */
1672 uint16 unknown_0; /* 0x005c */
1673 uint16 unknown_1; /* 0x0001 */
1674 uint32 access_mask;
1676 } SAMR_Q_CONNECT_ANON;
1678 /* SAMR_R_CONNECT_ANON - probably an open */
1679 typedef struct r_samr_connect_anon_info
1681 POLICY_HND connect_pol; /* policy handle */
1682 NTSTATUS status; /* return status */
1684 } SAMR_R_CONNECT_ANON;
1686 /* SAMR_Q_CONNECT - probably an open */
1687 typedef struct q_samr_connect_info
1689 uint32 ptr_srv_name; /* pointer (to server name?) */
1690 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1692 uint32 access_mask;
1694 } SAMR_Q_CONNECT;
1697 /* SAMR_R_CONNECT - probably an open */
1698 typedef struct r_samr_connect_info
1700 POLICY_HND connect_pol; /* policy handle */
1701 NTSTATUS status; /* return status */
1703 } SAMR_R_CONNECT;
1705 /* SAMR_Q_CONNECT4 */
1706 typedef struct q_samr_connect4_info
1708 uint32 ptr_srv_name; /* pointer to server name */
1709 UNISTR2 uni_srv_name;
1711 uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */
1712 uint32 access_mask;
1713 } SAMR_Q_CONNECT4;
1715 /* SAMR_R_CONNECT4 - same format as connect */
1716 typedef struct r_samr_connect_info SAMR_R_CONNECT4;
1718 /* SAMR_Q_GET_DOM_PWINFO */
1719 typedef struct q_samr_get_dom_pwinfo
1721 uint32 ptr;
1722 UNIHDR hdr_srv_name;
1723 UNISTR2 uni_srv_name;
1725 } SAMR_Q_GET_DOM_PWINFO;
1727 /* SAMR_R_GET_DOM_PWINFO */
1728 typedef struct r_samr_get_dom_pwinfo
1731 * See Samba4 IDL
1733 uint16 unk_0;
1734 uint32 unk_1;
1735 NTSTATUS status;
1737 } SAMR_R_GET_DOM_PWINFO;
1739 /* SAMR_ENC_PASSWD */
1740 typedef struct enc_passwd_info
1742 uint32 ptr;
1743 uint8 pass[516];
1745 } SAMR_ENC_PASSWD;
1747 /* SAMR_ENC_HASH */
1748 typedef struct enc_hash_info
1750 uint32 ptr;
1751 uint8 hash[16];
1753 } SAMR_ENC_HASH;
1755 /* SAMR_Q_CHGPASSWD_USER */
1756 typedef struct q_samr_chgpasswd_user_info
1758 uint32 ptr_0;
1760 UNIHDR hdr_dest_host; /* server name unicode header */
1761 UNISTR2 uni_dest_host; /* server name unicode string */
1763 UNIHDR hdr_user_name; /* username unicode string header */
1764 UNISTR2 uni_user_name; /* username unicode string */
1766 SAMR_ENC_PASSWD nt_newpass;
1767 SAMR_ENC_HASH nt_oldhash;
1769 uint32 unknown; /* 0x0000 0001 */
1771 SAMR_ENC_PASSWD lm_newpass;
1772 SAMR_ENC_HASH lm_oldhash;
1774 } SAMR_Q_CHGPASSWD_USER;
1776 /* SAMR_R_CHGPASSWD_USER */
1777 typedef struct r_samr_chgpasswd_user_info
1779 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1781 } SAMR_R_CHGPASSWD_USER;
1784 /* SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN */
1785 typedef struct q_samr_remove_sid_foreign_domain_info
1787 POLICY_HND dom_pol; /* policy handle */
1788 DOM_SID2 sid; /* SID */
1790 } SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN;
1793 /* SAMR_R_REMOVE_SID_FOREIGN_DOMAIN */
1794 typedef struct r_samr_remove_sid_foreign_domain_info
1796 NTSTATUS status; /* return status */
1798 } SAMR_R_REMOVE_SID_FOREIGN_DOMAIN;
1802 /* these are from the old rpc_samr.h - they are needed while the merge
1803 is still going on */
1804 #define MAX_SAM_SIDS 15
1806 /* DOM_SID3 - security id */
1807 typedef struct sid_info_3
1809 uint16 len; /* length, bytes, including length of len :-) */
1810 /* uint8 pad[2]; */
1812 DOM_SID sid;
1814 } DOM_SID3;
1816 /* SAMR_Q_UNKNOWN_2E */
1817 typedef struct q_samr_unknown_2e_info
1819 POLICY_HND domain_pol; /* policy handle */
1820 uint16 switch_value;
1822 } SAMR_Q_UNKNOWN_2E;
1824 /* SAMR_R_UNKNOWN_2E */
1825 typedef struct r_samr_unknown_2e_info
1827 uint32 ptr_0;
1828 uint16 switch_value;
1829 SAM_UNK_CTR *ctr;
1830 NTSTATUS status; /* return status */
1832 } SAMR_R_UNKNOWN_2E;
1834 /* SAMR_Q_SET_DOMAIN_INFO */
1835 typedef struct q_samr_set_domain_info
1837 POLICY_HND domain_pol; /* policy handle */
1838 uint16 switch_value0;
1839 uint16 switch_value;
1840 SAM_UNK_CTR *ctr;
1842 } SAMR_Q_SET_DOMAIN_INFO;
1844 /* SAMR_R_SET_DOMAIN_INFO */
1845 typedef struct r_samr_set_domain_info
1847 NTSTATUS status; /* return status */
1849 } SAMR_R_SET_DOMAIN_INFO;
1851 #endif /* _RPC_SAMR_H */