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 */
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
39 x SamrCreateAliasInDomain
40 x SamrCreateGroupInDomain
41 x SamrCreateUserInDomain
45 x SamrEnumerateAliasesInDomain
46 SamrEnumerateDomainsInSamServer
47 x SamrEnumerateGroupsInDomain
48 x SamrEnumerateUsersInDomain
49 SamrGetUserDomainPasswordInformation
50 SamrLookupDomainInSamServer
51 ? SamrLookupIdsInDomain
52 x SamrLookupNamesInDomain
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
73 SamrTestPrivateFunctionsDomain
74 SamrTestPrivateFunctionsUser
76 ********************************************************************/
78 #define SAMR_CONNECT_ANON 0x00
79 #define SAMR_CLOSE_HND 0x01
80 #define SAMR_SET_SEC_OBJECT 0x02
81 #define SAMR_QUERY_SEC_OBJECT 0x03
83 #define SAMR_UNKNOWN_4 0x04 /* profile info? */
84 #define SAMR_LOOKUP_DOMAIN 0x05
85 #define SAMR_ENUM_DOMAINS 0x06
86 #define SAMR_OPEN_DOMAIN 0x07
87 #define SAMR_QUERY_DOMAIN_INFO 0x08
88 #define SAMR_SET_DOMAIN_INFO 0x09
90 #define SAMR_CREATE_DOM_GROUP 0x0a
91 #define SAMR_ENUM_DOM_GROUPS 0x0b
92 #define SAMR_ENUM_DOM_USERS 0x0d
93 #define SAMR_CREATE_DOM_ALIAS 0x0e
94 #define SAMR_ENUM_DOM_ALIASES 0x0f
95 #define SAMR_QUERY_USERALIASES 0x10
97 #define SAMR_LOOKUP_NAMES 0x11
98 #define SAMR_LOOKUP_RIDS 0x12
100 #define SAMR_OPEN_GROUP 0x13
101 #define SAMR_QUERY_GROUPINFO 0x14
102 #define SAMR_SET_GROUPINFO 0x15
103 #define SAMR_ADD_GROUPMEM 0x16
104 #define SAMR_DELETE_DOM_GROUP 0x17
105 #define SAMR_DEL_GROUPMEM 0x18
106 #define SAMR_QUERY_GROUPMEM 0x19
107 #define SAMR_UNKNOWN_1A 0x1a
109 #define SAMR_OPEN_ALIAS 0x1b
110 #define SAMR_QUERY_ALIASINFO 0x1c
111 #define SAMR_SET_ALIASINFO 0x1d
112 #define SAMR_DELETE_DOM_ALIAS 0x1e
113 #define SAMR_ADD_ALIASMEM 0x1f
114 #define SAMR_DEL_ALIASMEM 0x20
115 #define SAMR_QUERY_ALIASMEM 0x21
117 #define SAMR_OPEN_USER 0x22
118 #define SAMR_DELETE_DOM_USER 0x23
119 #define SAMR_QUERY_USERINFO 0x24
120 #define SAMR_SET_USERINFO2 0x25
121 #define SAMR_QUERY_USERGROUPS 0x27
123 #define SAMR_QUERY_DISPINFO 0x28
124 #define SAMR_UNKNOWN_29 0x29
125 #define SAMR_UNKNOWN_2a 0x2a
126 #define SAMR_UNKNOWN_2b 0x2b
127 #define SAMR_GET_USRDOM_PWINFO 0x2c
128 #define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d
129 #define SAMR_QUERY_DOMAIN_INFO2 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
130 #define SAMR_UNKNOWN_2f 0x2f
131 #define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO
133 #define SAMR_UNKNOWN_31 0x31
134 #define SAMR_CREATE_USER 0x32
135 #define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO
137 #define SAMR_ADDMULTI_ALIASMEM 0x34
139 #define SAMR_UNKNOWN_35 0x35
140 #define SAMR_UNKNOWN_36 0x36
141 #define SAMR_CHGPASSWD_USER 0x37
142 #define SAMR_GET_DOM_PWINFO 0x38
143 #define SAMR_CONNECT 0x39
144 #define SAMR_SET_USERINFO 0x3A
145 #define SAMR_CONNECT4 0x3E
146 #define SAMR_CHGPASSWD_USER3 0x3F
147 #define SAMR_CONNECT5 0x40
149 typedef struct logon_hours_info
151 uint32 max_len; /* normally 1260 bytes */
153 uint32 len; /* normally 21 bytes */
158 /* SAM_USER_INFO_23 */
159 typedef struct sam_user_info_23
161 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
162 NTTIME logon_time; /* logon time */
163 NTTIME logoff_time; /* logoff time */
164 NTTIME kickoff_time; /* kickoff time */
165 NTTIME pass_last_set_time; /* password last set time */
166 NTTIME pass_can_change_time; /* password can change time */
167 NTTIME pass_must_change_time; /* password must change time */
169 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
170 UNIHDR hdr_full_name; /* user's full name unicode string header */
171 UNIHDR hdr_home_dir; /* home directory unicode string header */
172 UNIHDR hdr_dir_drive; /* home drive unicode string header */
173 UNIHDR hdr_logon_script; /* logon script unicode string header */
174 UNIHDR hdr_profile_path; /* profile path unicode string header */
175 UNIHDR hdr_acct_desc ; /* user description */
176 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
177 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
178 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
180 uint8 lm_pwd[16]; /* lm user passwords */
181 uint8 nt_pwd[16]; /* nt user passwords */
183 uint32 user_rid; /* Primary User ID */
184 uint32 group_rid; /* Primary Group ID */
186 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
188 uint32 fields_present; /* 0x09f8 27fa */
190 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
192 uint32 ptr_logon_hrs; /* pointer to logon hours */
195 uint16 bad_password_count;
200 uint8 passmustchange; /* 0x00 must change = 0x01 */
206 UNISTR2 uni_user_name; /* NULL - username unicode string */
207 UNISTR2 uni_full_name; /* user's full name unicode string */
208 UNISTR2 uni_home_dir; /* home directory unicode string */
209 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
210 UNISTR2 uni_logon_script; /* logon script unicode string */
211 UNISTR2 uni_profile_path; /* profile path unicode string */
212 UNISTR2 uni_acct_desc ; /* user description unicode string */
213 UNISTR2 uni_workstations; /* login from workstations unicode string */
214 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
215 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
221 /* SAM_USER_INFO_24 */
222 typedef struct sam_user_info_24
229 * NB. This structure is *definately* incorrect. It's my best guess
230 * currently for W2K SP2. The password field is encrypted in a different
231 * way than normal... And there are definately other problems. JRA.
234 /* SAM_USER_INFO_25 */
235 typedef struct sam_user_info_25
237 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
238 NTTIME logon_time; /* logon time */
239 NTTIME logoff_time; /* logoff time */
240 NTTIME kickoff_time; /* kickoff time */
241 NTTIME pass_last_set_time; /* password last set time */
242 NTTIME pass_can_change_time; /* password can change time */
243 NTTIME pass_must_change_time; /* password must change time */
245 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
246 UNIHDR hdr_full_name; /* user's full name unicode string header */
247 UNIHDR hdr_home_dir; /* home directory unicode string header */
248 UNIHDR hdr_dir_drive; /* home drive unicode string header */
249 UNIHDR hdr_logon_script; /* logon script unicode string header */
250 UNIHDR hdr_profile_path; /* profile path unicode string header */
251 UNIHDR hdr_acct_desc ; /* user description */
252 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
253 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
254 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
256 uint8 lm_pwd[16]; /* lm user passwords */
257 uint8 nt_pwd[16]; /* nt user passwords */
259 uint32 user_rid; /* Primary User ID */
260 uint32 group_rid; /* Primary Group ID */
262 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
268 UNISTR2 uni_user_name; /* NULL - username unicode string */
269 UNISTR2 uni_full_name; /* user's full name unicode string */
270 UNISTR2 uni_home_dir; /* home directory unicode string */
271 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
272 UNISTR2 uni_logon_script; /* logon script unicode string */
273 UNISTR2 uni_profile_path; /* profile path unicode string */
274 UNISTR2 uni_acct_desc ; /* user description unicode string */
275 UNISTR2 uni_workstations; /* login from workstations unicode string */
276 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
277 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
280 /* SAM_USER_INFO_26 */
281 typedef struct sam_user_info_26
288 /* SAM_USER_INFO_21 */
289 typedef struct sam_user_info_21
291 NTTIME logon_time; /* logon time */
292 NTTIME logoff_time; /* logoff time */
293 NTTIME kickoff_time; /* kickoff time */
294 NTTIME pass_last_set_time; /* password last set time */
295 NTTIME pass_can_change_time; /* password can change time */
296 NTTIME pass_must_change_time; /* password must change time */
298 UNIHDR hdr_user_name; /* username unicode string header */
299 UNIHDR hdr_full_name; /* user's full name unicode string header */
300 UNIHDR hdr_home_dir; /* home directory unicode string header */
301 UNIHDR hdr_dir_drive; /* home drive unicode string header */
302 UNIHDR hdr_logon_script; /* logon script unicode string header */
303 UNIHDR hdr_profile_path; /* profile path unicode string header */
304 UNIHDR hdr_acct_desc ; /* user description */
305 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
306 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
307 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
309 uint8 lm_pwd[16]; /* lm user passwords */
310 uint8 nt_pwd[16]; /* nt user passwords */
312 uint32 user_rid; /* Primary User ID */
313 uint32 group_rid; /* Primary Group ID */
315 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
318 uint32 fields_present; /* 0x00ff ffff */
320 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
322 uint32 ptr_logon_hrs; /* unknown pointer */
325 uint16 bad_password_count;
330 uint8 passmustchange; /* 0x00 must change = 0x01 */
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 */
349 #define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
350 #define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
352 /* SAM_USER_INFO_20 */
353 typedef struct sam_user_info_20
355 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
357 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
361 /* SAM_USER_INFO_18 */
362 typedef struct sam_user_info_18
364 uint8 lm_pwd[16]; /* lm user passwords */
365 uint8 nt_pwd[16]; /* nt user passwords */
372 /* SAM_USER_INFO_17 */
373 typedef struct sam_user_info_17
375 uint8 padding_0[16]; /* 0 - padding 16 bytes */
376 NTTIME expiry; /* expiry time or something? */
377 uint8 padding_1[24]; /* 0 - padding 24 bytes */
379 UNIHDR hdr_mach_acct; /* unicode header for machine account */
380 uint32 padding_2; /* 0 - padding 4 bytes */
382 uint32 ptr_1; /* pointer */
383 uint8 padding_3[32]; /* 0 - padding 32 bytes */
384 uint32 padding_4; /* 0 - padding 4 bytes */
386 uint32 ptr_2; /* pointer */
387 uint32 padding_5; /* 0 - padding 4 bytes */
389 uint32 ptr_3; /* pointer */
390 uint8 padding_6[32]; /* 0 - padding 32 bytes */
392 uint32 rid_user; /* user RID */
393 uint32 rid_group; /* group RID */
395 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
396 uint16 unknown_3; /* 16 bit padding */
398 uint16 unknown_4; /* 0x003f - 16 bit unknown */
399 uint16 unknown_5; /* 0x003c - 16 bit unknown */
401 uint8 padding_7[16]; /* 0 - padding 16 bytes */
402 uint32 padding_8; /* 0 - padding 4 bytes */
404 UNISTR2 uni_mach_acct; /* unicode string for machine account */
406 uint8 padding_9[48]; /* 0 - padding 48 bytes */
411 /* SAM_USER_INFO_16 */
412 typedef struct sam_user_info_16
419 /* SAM_USER_INFO_7 */
420 typedef struct sam_user_info_7
422 UNIHDR hdr_name; /* unicode header for name */
423 UNISTR2 uni_name; /* unicode string for name */
428 /* SAM_USER_INFO_9 */
429 typedef struct sam_user_info_9
431 uint32 rid_group; /* Primary Group RID */
435 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
436 typedef struct q_samr_close_hnd_info
438 POLICY_HND pol; /* policy handle */
443 /* SAMR_R_CLOSE_HND - probably a policy handle close */
444 typedef struct r_samr_close_hnd_info
446 POLICY_HND pol; /* policy handle */
447 NTSTATUS status; /* return status */
452 /****************************************************************************
453 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
454 *****************************************************************************/
456 /* SAMR_Q_GET_USRDOM_PWINFO */
457 typedef struct q_samr_usrdom_pwinfo_info
459 POLICY_HND user_pol; /* policy handle */
461 } SAMR_Q_GET_USRDOM_PWINFO;
464 /****************************************************************************
465 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
466 *****************************************************************************/
468 /* SAMR_R_GET_USRDOM_PWINFO */
469 typedef struct r_samr_usrdom_pwinfo_info
471 uint16 min_pwd_length;
472 uint16 unknown_1; /* 0x0016 or 0x0015 */
473 uint32 password_properties;
476 } SAMR_R_GET_USRDOM_PWINFO;
478 /****************************************************************************
479 SAMR_Q_SET_SEC_OBJ - info level 4.
480 *****************************************************************************/
482 /* SAMR_Q_SET_SEC_OBJ - */
483 typedef struct q_samr_set_sec_obj_info
485 POLICY_HND pol; /* policy handle */
486 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
489 } SAMR_Q_SET_SEC_OBJ;
491 /* SAMR_R_SET_SEC_OBJ - */
492 typedef struct r_samr_set_sec_obj_info
494 NTSTATUS status; /* return status */
496 } SAMR_R_SET_SEC_OBJ;
499 /****************************************************************************
500 SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
501 *****************************************************************************/
503 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
504 typedef struct q_samr_query_sec_obj_info
506 POLICY_HND user_pol; /* policy handle */
507 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
509 } SAMR_Q_QUERY_SEC_OBJ;
511 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
512 typedef struct r_samr_query_sec_obj_info
517 NTSTATUS status; /* return status */
519 } SAMR_R_QUERY_SEC_OBJ;
522 /****************************************************************************
523 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
524 *****************************************************************************/
526 /* SAMR_Q_QUERY_DOMAIN_INFO - */
527 typedef struct q_samr_query_domain_info
529 POLICY_HND domain_pol; /* policy handle */
530 uint16 switch_value; /* 0x0002, 0x0001 */
532 } SAMR_Q_QUERY_DOMAIN_INFO;
534 typedef struct sam_unknown_info_3_info
537 /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
539 /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
543 typedef struct sam_unknown_info_6_info
545 uint32 unknown_0; /* 0x0000 0000 */
547 uint32 ptr_0; /* pointer to unknown structure */
548 uint8 padding[12]; /* 12 bytes zeros */
552 typedef struct sam_unknown_info_7_info
558 typedef struct sam_unknown_info_8_info
561 NTTIME domain_create_time;
565 typedef struct sam_unknown_info_12_inf
569 uint16 bad_attempt_lockout;
573 typedef struct sam_unknown_info_5_inf
575 UNIHDR hdr_server; /* server name unicode header */
576 UNISTR2 uni_server; /* server name unicode string */
580 typedef struct sam_unknown_info_2_inf
582 NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */
583 UNIHDR hdr_comment; /* comment according to samba4 idl */
584 UNIHDR hdr_domain; /* domain name unicode header */
585 UNIHDR hdr_server; /* server name unicode header */
587 /* put all the data in here, at the moment, including what the above
588 pointer is referring to
593 uint32 unknown_4; /* 0x0000 0001 */
595 uint32 unknown_6; /* 0x0000 0001 */
596 uint32 num_domain_usrs; /* number of users in domain */
597 uint32 num_domain_grps; /* number of domain groups in domain */
598 uint32 num_local_grps; /* number of local groups in domain */
600 uint8 padding[12]; /* 12 bytes zeros */
602 UNISTR2 uni_comment; /* comment unicode string */
603 UNISTR2 uni_domain; /* domain name unicode string */
604 UNISTR2 uni_server; /* server name unicode string */
608 typedef struct sam_unknown_info_1_inf
610 uint16 min_length_password;
611 uint16 password_history;
612 uint32 password_properties;
614 NTTIME min_passwordage;
619 typedef struct sam_unknown_ctr_info
630 SAM_UNK_INFO_12 inf12;
637 /* SAMR_R_QUERY_DOMAIN_INFO - */
638 typedef struct r_samr_query_domain_info
641 uint16 switch_value; /* same as in query */
645 NTSTATUS status; /* return status */
647 } SAMR_R_QUERY_DOMAIN_INFO;
650 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
651 typedef struct q_samr_lookup_domain_info
653 POLICY_HND connect_pol;
658 } SAMR_Q_LOOKUP_DOMAIN;
661 /* SAMR_R_LOOKUP_DOMAIN */
662 typedef struct r_samr_lookup_domain_info
669 } SAMR_R_LOOKUP_DOMAIN;
672 /****************************************************************************
673 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
675 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
676 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
677 *****************************************************************************/
679 /* SAMR_Q_OPEN_DOMAIN */
680 typedef struct q_samr_open_domain_info
682 POLICY_HND pol; /* policy handle */
683 uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
684 DOM_SID2 dom_sid; /* domain SID */
686 } SAMR_Q_OPEN_DOMAIN;
689 /* SAMR_R_OPEN_DOMAIN - probably an open */
690 typedef struct r_samr_open_domain_info
692 POLICY_HND domain_pol; /* policy handle associated with the SID */
693 NTSTATUS status; /* return status */
695 } SAMR_R_OPEN_DOMAIN;
697 #define MAX_SAM_ENTRIES_W2K 0x400
698 #define MAX_SAM_ENTRIES_W95 50
699 /* The following should be the greater of the preceeding two. */
700 #define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
702 typedef struct samr_entry_info
710 /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
711 typedef struct q_samr_enum_domains_info
713 POLICY_HND pol; /* policy handle */
715 uint32 start_idx; /* enumeration handle */
716 uint32 max_size; /* 0x0000 ffff */
718 } SAMR_Q_ENUM_DOMAINS;
720 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
721 typedef struct r_samr_enum_domains_info
723 uint32 next_idx; /* next starting index required for enum */
732 UNISTR2 *uni_dom_name;
738 } SAMR_R_ENUM_DOMAINS;
740 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
741 typedef struct q_samr_enum_dom_users_info
743 POLICY_HND pol; /* policy handle */
745 uint32 start_idx; /* number of values (0 indicates unlimited?) */
746 uint32 acb_mask; /* 0x0000 indicates all */
748 uint32 max_size; /* 0x0000 ffff */
750 } SAMR_Q_ENUM_DOM_USERS;
753 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
754 typedef struct r_samr_enum_dom_users_info
756 uint32 next_idx; /* next starting index required for enum */
765 UNISTR2 *uni_acct_name;
771 } SAMR_R_ENUM_DOM_USERS;
774 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
775 typedef struct q_samr_enum_dom_groups_info
777 POLICY_HND pol; /* policy handle */
779 /* this is possibly an enumeration context handle... */
780 uint32 start_idx; /* 0x0000 0000 */
782 uint32 max_size; /* 0x0000 ffff */
784 } SAMR_Q_ENUM_DOM_GROUPS;
787 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
788 typedef struct r_samr_enum_dom_groups_info
799 UNISTR2 *uni_grp_name;
805 } SAMR_R_ENUM_DOM_GROUPS;
808 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
809 typedef struct q_samr_enum_dom_aliases_info
811 POLICY_HND pol; /* policy handle */
813 /* this is possibly an enumeration context handle... */
814 uint32 start_idx; /* 0x0000 0000 */
816 uint32 max_size; /* 0x0000 ffff */
818 } SAMR_Q_ENUM_DOM_ALIASES;
821 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
822 typedef struct r_samr_enum_dom_aliases_info
833 UNISTR2 *uni_grp_name;
839 } SAMR_R_ENUM_DOM_ALIASES;
842 /* -- Level 1 Display Info - User Information -- */
844 typedef struct samr_entry_info1
851 UNIHDR hdr_acct_name;
852 UNIHDR hdr_user_name;
853 UNIHDR hdr_user_desc;
857 typedef struct samr_str_entry_info1
859 UNISTR2 uni_acct_name;
860 UNISTR2 uni_full_name;
861 UNISTR2 uni_acct_desc;
865 typedef struct sam_entry_info_1
873 /* -- Level 2 Display Info - Trust Account Information -- */
875 typedef struct samr_entry_info2
887 typedef struct samr_str_entry_info2
889 UNISTR2 uni_srv_name;
890 UNISTR2 uni_srv_desc;
894 typedef struct sam_entry_info_2
902 /* -- Level 3 Display Info - Domain Group Information -- */
904 typedef struct samr_entry_info3
909 uint32 attr; /* SE_GROUP_xxx, usually 7 */
916 typedef struct samr_str_entry_info3
918 UNISTR2 uni_grp_name;
919 UNISTR2 uni_grp_desc;
923 typedef struct sam_entry_info_3
931 /* -- Level 4 Display Info - User List (ASCII) -- */
933 typedef struct samr_entry_info4
936 STRHDR hdr_acct_name;
940 typedef struct samr_str_entry_info4
946 typedef struct sam_entry_info_4
954 /* -- Level 5 Display Info - Group List (ASCII) -- */
956 typedef struct samr_entry_info5
963 typedef struct samr_str_entry_info5
969 typedef struct sam_entry_info_5
977 typedef struct sam_dispinfo_ctr_info
981 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
982 SAM_DISPINFO_2 *info2; /* trust accounts */
983 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
984 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
985 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
986 void *info; /* allows assignment without typecasting, */
993 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
994 typedef struct q_samr_query_disp_info
996 POLICY_HND domain_pol;
998 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1001 uint32 start_idx; /* start enumeration index */
1002 uint32 max_entries; /* maximum number of entries to return */
1003 uint32 max_size; /* recommended data size; if exceeded server
1004 should return STATUS_MORE_ENTRIES */
1006 } SAMR_Q_QUERY_DISPINFO;
1009 /* SAMR_R_QUERY_DISPINFO */
1010 typedef struct r_samr_query_dispinfo_info
1012 uint32 total_size; /* total data size for all matching entries
1013 (0 = uncalculated) */
1014 uint32 data_size; /* actual data size returned = size of SAM_ENTRY
1015 structures + total length of strings */
1017 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1020 uint32 num_entries; /* number of entries returned */
1022 uint32 num_entries2;
1024 SAM_DISPINFO_CTR *ctr;
1028 } SAMR_R_QUERY_DISPINFO;
1031 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
1032 typedef struct q_samr_delete_dom_group_info
1034 POLICY_HND group_pol; /* policy handle */
1036 } SAMR_Q_DELETE_DOM_GROUP;
1039 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
1040 typedef struct r_samr_delete_dom_group_info
1042 POLICY_HND pol; /* policy handle */
1043 NTSTATUS status; /* return status */
1045 } SAMR_R_DELETE_DOM_GROUP;
1048 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
1049 typedef struct q_samr_create_dom_group_info
1051 POLICY_HND pol; /* policy handle */
1053 UNIHDR hdr_acct_desc;
1054 UNISTR2 uni_acct_desc;
1058 } SAMR_Q_CREATE_DOM_GROUP;
1060 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
1061 typedef struct r_samr_create_dom_group_info
1063 POLICY_HND pol; /* policy handle */
1068 } SAMR_R_CREATE_DOM_GROUP;
1070 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
1071 typedef struct q_samr_query_group_info
1073 POLICY_HND pol; /* policy handle */
1075 uint16 switch_level; /* 0x0001 seen */
1077 } SAMR_Q_QUERY_GROUPINFO;
1079 typedef struct samr_group_info1
1081 UNIHDR hdr_acct_name;
1083 uint32 group_attr; /* 0x0000 0003 - group attribute */
1084 uint32 num_members; /* 0x0000 0001 - number of group members? */
1086 UNIHDR hdr_acct_desc;
1088 UNISTR2 uni_acct_name;
1089 UNISTR2 uni_acct_desc;
1093 typedef struct samr_group_info2
1096 UNIHDR hdr_acct_name;
1097 UNISTR2 uni_acct_name;
1101 typedef struct samr_group_info3
1103 uint32 group_attr; /* 0x0000 0003 - group attribute */
1107 typedef struct samr_group_info4
1110 UNIHDR hdr_acct_desc;
1111 UNISTR2 uni_acct_desc;
1115 /* GROUP_INFO_CTR */
1116 typedef struct group_info_ctr
1118 uint16 switch_value1;
1131 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
1132 typedef struct r_samr_query_groupinfo_info
1135 GROUP_INFO_CTR *ctr;
1139 } SAMR_R_QUERY_GROUPINFO;
1142 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
1143 typedef struct q_samr_set_group_info
1145 POLICY_HND pol; /* policy handle */
1146 GROUP_INFO_CTR *ctr;
1148 } SAMR_Q_SET_GROUPINFO;
1150 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
1151 typedef struct r_samr_set_group_info
1155 } SAMR_R_SET_GROUPINFO;
1158 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1159 typedef struct q_samr_delete_dom_alias_info
1161 POLICY_HND alias_pol; /* policy handle */
1163 } SAMR_Q_DELETE_DOM_ALIAS;
1166 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1167 typedef struct r_samr_delete_dom_alias_info
1169 POLICY_HND pol; /* policy handle */
1170 NTSTATUS status; /* return status */
1172 } SAMR_R_DELETE_DOM_ALIAS;
1175 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1176 typedef struct q_samr_create_dom_alias_info
1178 POLICY_HND dom_pol; /* policy handle */
1180 UNIHDR hdr_acct_desc;
1181 UNISTR2 uni_acct_desc;
1183 uint32 access_mask; /* 0x001f000f */
1185 } SAMR_Q_CREATE_DOM_ALIAS;
1187 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1188 typedef struct r_samr_create_dom_alias_info
1190 POLICY_HND alias_pol; /* policy handle */
1195 } SAMR_R_CREATE_DOM_ALIAS;
1198 /********************************************************/
1202 UNISTR4 description;
1211 UNISTR4 description;
1215 POLICY_HND pol; /* policy handle */
1216 uint16 level; /* 0x0003 seen */
1217 } SAMR_Q_QUERY_ALIASINFO;
1229 ALIAS_INFO_CTR *ctr;
1231 } SAMR_R_QUERY_ALIASINFO;
1234 /********************************************************/
1237 POLICY_HND alias_pol; /* policy handle */
1239 } SAMR_Q_SET_ALIASINFO;
1243 } SAMR_R_SET_ALIASINFO;
1246 /********************************************************/
1248 /* SAMR_Q_QUERY_USERGROUPS - */
1249 typedef struct q_samr_query_usergroup_info
1251 POLICY_HND pol; /* policy handle associated with unknown id */
1253 } SAMR_Q_QUERY_USERGROUPS;
1255 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1256 typedef struct r_samr_query_usergroup_info
1258 uint32 ptr_0; /* pointer */
1259 uint32 num_entries; /* number of RID groups */
1260 uint32 ptr_1; /* pointer */
1261 uint32 num_entries2; /* number of RID groups */
1263 DOM_GID *gid; /* group info */
1265 NTSTATUS status; /* return status */
1267 } SAMR_R_QUERY_USERGROUPS;
1269 /* SAM_USERINFO_CTR - sam user info */
1270 typedef struct sam_userinfo_ctr_info
1272 uint16 switch_value;
1276 SAM_USER_INFO_7 *id7;
1277 SAM_USER_INFO_9 *id9;
1278 SAM_USER_INFO_16 *id16;
1279 SAM_USER_INFO_17 *id17;
1280 SAM_USER_INFO_18 *id18;
1281 SAM_USER_INFO_20 *id20;
1282 SAM_USER_INFO_21 *id21;
1283 SAM_USER_INFO_23 *id23;
1284 SAM_USER_INFO_24 *id24;
1285 SAM_USER_INFO_25 *id25;
1286 SAM_USER_INFO_26 *id26;
1287 void* id; /* to make typecasting easy */
1294 /* SAMR_Q_SET_USERINFO2 - set sam info */
1295 typedef struct q_samr_set_user_info2
1297 POLICY_HND pol; /* policy handle associated with user */
1298 uint16 switch_value; /* 0x0010 */
1300 SAM_USERINFO_CTR *ctr;
1302 } SAMR_Q_SET_USERINFO2;
1304 /* SAMR_R_SET_USERINFO2 - set sam info */
1305 typedef struct r_samr_set_user_info2
1307 NTSTATUS status; /* return status */
1309 } SAMR_R_SET_USERINFO2;
1311 /* SAMR_Q_SET_USERINFO - set sam info */
1312 typedef struct q_samr_set_user_info
1314 POLICY_HND pol; /* policy handle associated with user */
1315 uint16 switch_value;
1316 SAM_USERINFO_CTR *ctr;
1318 } SAMR_Q_SET_USERINFO;
1320 /* SAMR_R_SET_USERINFO - set sam info */
1321 typedef struct r_samr_set_user_info
1323 NTSTATUS status; /* return status */
1325 } SAMR_R_SET_USERINFO;
1328 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1329 typedef struct q_samr_query_user_info
1331 POLICY_HND pol; /* policy handle associated with unknown id */
1332 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1334 } SAMR_Q_QUERY_USERINFO;
1336 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1337 typedef struct r_samr_query_user_info
1339 uint32 ptr; /* pointer */
1340 SAM_USERINFO_CTR *ctr;
1342 NTSTATUS status; /* return status */
1344 } SAMR_R_QUERY_USERINFO;
1347 /****************************************************************************
1348 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1350 the policy handle allocated by an "samr open secret" call is associated
1351 with a SID. this policy handle is what is queried here, *not* the SID
1352 itself. the response to the lookup rids is relative to this SID.
1353 *****************************************************************************/
1354 /* SAMR_Q_QUERY_USERALIASES */
1355 typedef struct q_samr_query_useraliases_info
1357 POLICY_HND pol; /* policy handle */
1359 uint32 num_sids1; /* number of rids being looked up */
1360 uint32 ptr; /* buffer pointer */
1361 uint32 num_sids2; /* number of rids being looked up */
1363 uint32 *ptr_sid; /* pointers to sids to be looked up */
1364 DOM_SID2 *sid ; /* sids to be looked up. */
1366 } SAMR_Q_QUERY_USERALIASES;
1369 /* SAMR_R_QUERY_USERALIASES */
1370 typedef struct r_samr_query_useraliases_info
1373 uint32 ptr; /* undocumented buffer pointer */
1375 uint32 num_entries2;
1376 uint32 *rid; /* domain RIDs being looked up */
1378 NTSTATUS status; /* return code */
1380 } SAMR_R_QUERY_USERALIASES;
1383 /****************************************************************************
1384 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1385 *****************************************************************************/
1386 /* SAMR_Q_LOOKUP_NAMES */
1387 typedef struct q_samr_lookup_names_info
1389 POLICY_HND pol; /* policy handle */
1391 uint32 num_names1; /* number of names being looked up */
1392 uint32 flags; /* 0x0000 03e8 - unknown */
1393 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1394 uint32 num_names2; /* number of names being looked up */
1396 UNIHDR *hdr_name; /* unicode account name header */
1397 UNISTR2 *uni_name; /* unicode account name string */
1399 } SAMR_Q_LOOKUP_NAMES;
1402 /* SAMR_R_LOOKUP_NAMES */
1403 typedef struct r_samr_lookup_names_info
1405 uint32 num_rids1; /* number of aliases being looked up */
1406 uint32 ptr_rids; /* pointer to aliases */
1407 uint32 num_rids2; /* number of aliases being looked up */
1409 uint32 *rids; /* rids */
1411 uint32 num_types1; /* number of users in aliases being looked up */
1412 uint32 ptr_types; /* pointer to users in aliases */
1413 uint32 num_types2; /* number of users in aliases being looked up */
1415 uint32 *types; /* SID_ENUM type */
1417 NTSTATUS status; /* return code */
1419 } SAMR_R_LOOKUP_NAMES;
1422 /****************************************************************************
1423 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1425 called to resolve domain RID groups.
1426 *****************************************************************************/
1427 /* SAMR_Q_LOOKUP_RIDS */
1428 typedef struct q_samr_lookup_rids_info
1430 POLICY_HND pol; /* policy handle */
1432 uint32 num_rids1; /* number of rids being looked up */
1433 uint32 flags; /* 0x0000 03e8 - unknown */
1434 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1435 uint32 num_rids2; /* number of rids being looked up */
1437 uint32 *rid; /* domain RIDs being looked up */
1439 } SAMR_Q_LOOKUP_RIDS;
1442 /****************************************************************************
1443 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1445 *****************************************************************************/
1446 /* SAMR_R_LOOKUP_RIDS */
1447 typedef struct r_samr_lookup_rids_info
1449 uint32 num_names1; /* number of aliases being looked up */
1450 uint32 ptr_names; /* pointer to aliases */
1451 uint32 num_names2; /* number of aliases being looked up */
1453 UNIHDR *hdr_name; /* unicode account name header */
1454 UNISTR2 *uni_name; /* unicode account name string */
1456 uint32 num_types1; /* number of users in aliases being looked up */
1457 uint32 ptr_types; /* pointer to users in aliases */
1458 uint32 num_types2; /* number of users in aliases being looked up */
1460 uint32 *type; /* SID_ENUM type */
1464 } SAMR_R_LOOKUP_RIDS;
1467 /* SAMR_Q_OPEN_USER - probably an open */
1468 typedef struct q_samr_open_user_info
1470 POLICY_HND domain_pol; /* policy handle */
1471 uint32 access_mask; /* 32 bit unknown - 0x02011b */
1472 uint32 user_rid; /* user RID */
1477 /* SAMR_R_OPEN_USER - probably an open */
1478 typedef struct r_samr_open_user_info
1480 POLICY_HND user_pol; /* policy handle associated with unknown id */
1481 NTSTATUS status; /* return status */
1486 /* SAMR_Q_CREATE_USER - probably a create */
1487 typedef struct q_samr_create_user_info
1489 POLICY_HND domain_pol; /* policy handle */
1491 UNIHDR hdr_name; /* unicode account name header */
1492 UNISTR2 uni_name; /* unicode account name */
1494 uint32 acb_info; /* account control info */
1495 uint32 access_mask; /* 0xe005 00b0 */
1497 } SAMR_Q_CREATE_USER;
1500 /* SAMR_R_CREATE_USER - probably a create */
1501 typedef struct r_samr_create_user_info
1503 POLICY_HND user_pol; /* policy handle associated with user */
1505 uint32 access_granted;
1506 uint32 user_rid; /* user RID */
1507 NTSTATUS status; /* return status */
1509 } SAMR_R_CREATE_USER;
1512 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
1513 typedef struct q_samr_delete_dom_user_info
1515 POLICY_HND user_pol; /* policy handle */
1517 } SAMR_Q_DELETE_DOM_USER;
1520 /* SAMR_R_DELETE_DOM_USER - delete domain user */
1521 typedef struct r_samr_delete_dom_user_info
1523 POLICY_HND pol; /* policy handle */
1524 NTSTATUS status; /* return status */
1526 } SAMR_R_DELETE_DOM_USER;
1529 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1530 typedef struct q_samr_query_groupmem_info
1532 POLICY_HND group_pol; /* policy handle */
1534 } SAMR_Q_QUERY_GROUPMEM;
1537 /* SAMR_R_QUERY_GROUPMEM - query group members */
1538 typedef struct r_samr_query_groupmem_info
1554 } SAMR_R_QUERY_GROUPMEM;
1557 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1558 typedef struct q_samr_del_group_mem_info
1560 POLICY_HND pol; /* policy handle */
1561 uint32 rid; /* rid */
1563 } SAMR_Q_DEL_GROUPMEM;
1566 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1567 typedef struct r_samr_del_group_mem_info
1569 NTSTATUS status; /* return status */
1571 } SAMR_R_DEL_GROUPMEM;
1574 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1575 typedef struct q_samr_add_group_mem_info
1577 POLICY_HND pol; /* policy handle */
1579 uint32 rid; /* rid */
1580 uint32 unknown; /* 0x0000 0005 */
1582 } SAMR_Q_ADD_GROUPMEM;
1585 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1586 typedef struct r_samr_add_group_mem_info
1588 NTSTATUS status; /* return status */
1590 } SAMR_R_ADD_GROUPMEM;
1593 /* SAMR_Q_OPEN_GROUP - probably an open */
1594 typedef struct q_samr_open_group_info
1596 POLICY_HND domain_pol; /* policy handle */
1597 uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1598 uint32 rid_group; /* rid */
1600 } SAMR_Q_OPEN_GROUP;
1603 /* SAMR_R_OPEN_GROUP - probably an open */
1604 typedef struct r_samr_open_group_info
1606 POLICY_HND pol; /* policy handle */
1607 NTSTATUS status; /* return status */
1609 } SAMR_R_OPEN_GROUP;
1612 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1613 typedef struct q_samr_query_aliasmem_info
1615 POLICY_HND alias_pol; /* policy handle */
1617 } SAMR_Q_QUERY_ALIASMEM;
1620 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1621 typedef struct r_samr_query_aliasmem_info
1631 } SAMR_R_QUERY_ALIASMEM;
1634 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1635 typedef struct q_samr_add_alias_mem_info
1637 POLICY_HND alias_pol; /* policy handle */
1639 DOM_SID2 sid; /* member sid to be added to the alias */
1641 } SAMR_Q_ADD_ALIASMEM;
1644 /* SAMR_R_ADD_ALIASMEM - add alias member */
1645 typedef struct r_samr_add_alias_mem_info
1647 NTSTATUS status; /* return status */
1649 } SAMR_R_ADD_ALIASMEM;
1652 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1653 typedef struct q_samr_del_alias_mem_info
1655 POLICY_HND alias_pol; /* policy handle */
1657 DOM_SID2 sid; /* member sid to be added to alias */
1659 } SAMR_Q_DEL_ALIASMEM;
1662 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1663 typedef struct r_samr_del_alias_mem_info
1665 NTSTATUS status; /* return status */
1667 } SAMR_R_DEL_ALIASMEM;
1671 /* SAMR_Q_OPEN_ALIAS - probably an open */
1672 typedef struct q_samr_open_alias_info
1679 } SAMR_Q_OPEN_ALIAS;
1682 /* SAMR_R_OPEN_ALIAS - probably an open */
1683 typedef struct r_samr_open_alias_info
1685 POLICY_HND pol; /* policy handle */
1686 NTSTATUS status; /* return status */
1688 } SAMR_R_OPEN_ALIAS;
1691 /* SAMR_Q_CONNECT_ANON - probably an open */
1692 typedef struct q_samr_connect_anon_info {
1693 uint32 ptr; /* ptr? */
1694 uint16 unknown_0; /* Only pushed if ptr is non-zero. */
1696 } SAMR_Q_CONNECT_ANON;
1698 /* SAMR_R_CONNECT_ANON - probably an open */
1699 typedef struct r_samr_connect_anon_info
1701 POLICY_HND connect_pol; /* policy handle */
1702 NTSTATUS status; /* return status */
1704 } SAMR_R_CONNECT_ANON;
1706 /* SAMR_Q_CONNECT - probably an open */
1707 typedef struct q_samr_connect_info
1709 uint32 ptr_srv_name; /* pointer (to server name?) */
1710 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1717 /* SAMR_R_CONNECT - probably an open */
1718 typedef struct r_samr_connect_info
1720 POLICY_HND connect_pol; /* policy handle */
1721 NTSTATUS status; /* return status */
1725 /* SAMR_Q_CONNECT4 */
1726 typedef struct q_samr_connect4_info
1728 uint32 ptr_srv_name; /* pointer to server name */
1729 UNISTR2 uni_srv_name;
1731 uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */
1735 /* SAMR_R_CONNECT4 - same format as connect */
1736 typedef struct r_samr_connect_info SAMR_R_CONNECT4;
1738 /* SAMR_Q_CONNECT5 */
1739 typedef struct q_samr_connect5_info
1741 uint32 ptr_srv_name; /* pointer to server name */
1742 UNISTR2 uni_srv_name;
1745 /* These following are acutally a level dependent
1746 value. Fudge it for now. JRA */
1751 /* SAMR_R_CONNECT5 */
1752 typedef struct r_samr_connect_info5
1757 POLICY_HND connect_pol; /* policy handle */
1758 NTSTATUS status; /* return status */
1763 /* SAMR_Q_GET_DOM_PWINFO */
1764 typedef struct q_samr_get_dom_pwinfo
1767 UNIHDR hdr_srv_name;
1768 UNISTR2 uni_srv_name;
1770 } SAMR_Q_GET_DOM_PWINFO;
1772 #define DOMAIN_PASSWORD_COMPLEX 0x00000001
1773 #define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002
1774 #define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004
1775 #define DOMAIN_LOCKOUT_ADMINS 0x00000008
1776 #define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010
1777 #define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020
1779 /* SAMR_R_GET_DOM_PWINFO */
1780 typedef struct r_samr_get_dom_pwinfo
1782 uint16 min_pwd_length;
1783 uint32 password_properties;
1786 } SAMR_R_GET_DOM_PWINFO;
1788 /* SAMR_ENC_PASSWD */
1789 typedef struct enc_passwd_info
1797 typedef struct enc_hash_info
1804 /* SAMR_Q_CHGPASSWD_USER */
1805 typedef struct q_samr_chgpasswd_user_info
1809 UNIHDR hdr_dest_host; /* server name unicode header */
1810 UNISTR2 uni_dest_host; /* server name unicode string */
1812 UNIHDR hdr_user_name; /* username unicode string header */
1813 UNISTR2 uni_user_name; /* username unicode string */
1815 SAMR_ENC_PASSWD nt_newpass;
1816 SAMR_ENC_HASH nt_oldhash;
1818 uint32 unknown; /* 0x0000 0001 */
1820 SAMR_ENC_PASSWD lm_newpass;
1821 SAMR_ENC_HASH lm_oldhash;
1823 } SAMR_Q_CHGPASSWD_USER;
1825 /* SAMR_R_CHGPASSWD_USER */
1826 typedef struct r_samr_chgpasswd_user_info
1828 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1830 } SAMR_R_CHGPASSWD_USER;
1832 /* SAMR_Q_CHGPASSWD3 */
1833 typedef struct q_samr_chgpasswd_user3
1837 UNIHDR hdr_dest_host; /* server name unicode header */
1838 UNISTR2 uni_dest_host; /* server name unicode string */
1840 UNIHDR hdr_user_name; /* username unicode string header */
1841 UNISTR2 uni_user_name; /* username unicode string */
1843 SAMR_ENC_PASSWD nt_newpass;
1844 SAMR_ENC_HASH nt_oldhash;
1846 uint32 lm_change; /* 0x0000 0001 */
1848 SAMR_ENC_PASSWD lm_newpass;
1849 SAMR_ENC_HASH lm_oldhash;
1851 SAMR_ENC_PASSWD password3;
1853 } SAMR_Q_CHGPASSWD_USER3;
1855 #define REJECT_REASON_OTHER 0x00000000
1856 #define REJECT_REASON_TOO_SHORT 0x00000001
1857 #define REJECT_REASON_IN_HISTORY 0x00000002
1858 #define REJECT_REASON_NOT_COMPLEX 0x00000005
1860 /* SAMR_CHANGE_REJECT */
1861 typedef struct samr_change_reject
1863 uint32 reject_reason;
1867 } SAMR_CHANGE_REJECT;
1869 /* SAMR_R_CHGPASSWD3 */
1870 typedef struct r_samr_chgpasswd_user3
1874 SAM_UNK_INFO_1 *info;
1875 SAMR_CHANGE_REJECT *reject;
1876 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1878 } SAMR_R_CHGPASSWD_USER3;
1882 /* SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN */
1883 typedef struct q_samr_remove_sid_foreign_domain_info
1885 POLICY_HND dom_pol; /* policy handle */
1886 DOM_SID2 sid; /* SID */
1888 } SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN;
1891 /* SAMR_R_REMOVE_SID_FOREIGN_DOMAIN */
1892 typedef struct r_samr_remove_sid_foreign_domain_info
1894 NTSTATUS status; /* return status */
1896 } SAMR_R_REMOVE_SID_FOREIGN_DOMAIN;
1900 /* these are from the old rpc_samr.h - they are needed while the merge
1901 is still going on */
1902 #define MAX_SAM_SIDS 15
1904 /* DOM_SID3 - security id */
1905 typedef struct sid_info_3
1907 uint16 len; /* length, bytes, including length of len :-) */
1914 /* SAMR_Q_QUERY_DOMAIN_INFO2 */
1915 typedef struct q_samr_query_domain_info2
1917 POLICY_HND domain_pol; /* policy handle */
1918 uint16 switch_value;
1920 } SAMR_Q_QUERY_DOMAIN_INFO2;
1922 /* SAMR_R_QUERY_DOMAIN_INFO2 */
1923 typedef struct r_samr_query_domain_info2
1926 uint16 switch_value;
1928 NTSTATUS status; /* return status */
1930 } SAMR_R_QUERY_DOMAIN_INFO2;
1932 /* SAMR_Q_SET_DOMAIN_INFO */
1933 typedef struct q_samr_set_domain_info
1935 POLICY_HND domain_pol; /* policy handle */
1936 uint16 switch_value0;
1937 uint16 switch_value;
1940 } SAMR_Q_SET_DOMAIN_INFO;
1942 /* SAMR_R_SET_DOMAIN_INFO */
1943 typedef struct r_samr_set_domain_info
1945 NTSTATUS status; /* return status */
1947 } SAMR_R_SET_DOMAIN_INFO;
1949 #endif /* _RPC_SAMR_H */