ctdb-scripts: Fix usage message
[samba4-gss.git] / librpc / idl / samr.idl
blob5da0fd75851561cd099a46d141c320b9fdf260f8
1 #include "idl_types.h"
3 /*
4 samr interface definition
5 */
6 import "misc.idl", "lsa.idl", "security.idl";
8 /*
9 Thanks to Todd Sabin for some information from his samr.idl in acltools
12 [ uuid("12345778-1234-abcd-ef00-0123456789ac"),
13 version(1.0),
14 endpoint("ncacn_np:[\\pipe\\samr]","ncacn_ip_tcp:", "ncalrpc:"),
15 pointer_default(unique)
16 ] interface samr
18 typedef bitmap security_secinfo security_secinfo;
19 typedef bitmap security_GroupAttrs security_GroupAttrs;
21 /* account control (acct_flags) bits */
22 typedef [public,bitmap32bit] bitmap {
23 ACB_DISABLED = 0x00000001, /* 1 = User account disabled */
24 ACB_HOMDIRREQ = 0x00000002, /* 1 = Home directory required */
25 ACB_PWNOTREQ = 0x00000004, /* 1 = User password not required */
26 ACB_TEMPDUP = 0x00000008, /* 1 = Temporary duplicate account */
27 ACB_NORMAL = 0x00000010, /* 1 = Normal user account */
28 ACB_MNS = 0x00000020, /* 1 = MNS logon user account */
29 ACB_DOMTRUST = 0x00000040, /* 1 = Interdomain trust account */
30 ACB_WSTRUST = 0x00000080, /* 1 = Workstation trust account */
31 ACB_SVRTRUST = 0x00000100, /* 1 = Server trust account */
32 ACB_PWNOEXP = 0x00000200, /* 1 = User password does not expire */
33 ACB_AUTOLOCK = 0x00000400, /* 1 = Account auto locked */
34 ACB_ENC_TXT_PWD_ALLOWED = 0x00000800, /* 1 = Encrypted text password is allowed */
35 ACB_SMARTCARD_REQUIRED = 0x00001000, /* 1 = Smart Card required */
36 ACB_TRUSTED_FOR_DELEGATION = 0x00002000, /* 1 = Trusted for Delegation */
37 ACB_NOT_DELEGATED = 0x00004000, /* 1 = Not delegated */
38 ACB_USE_DES_KEY_ONLY = 0x00008000, /* 1 = Use DES key only */
39 ACB_DONT_REQUIRE_PREAUTH = 0x00010000, /* 1 = Preauth not required */
40 ACB_PW_EXPIRED = 0x00020000, /* 1 = Password Expired */
41 ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = 0x00040000,
42 ACB_NO_AUTH_DATA_REQD = 0x00080000, /* 1 = No authorization data required */
43 ACB_PARTIAL_SECRETS_ACCOUNT = 0x00100000,
44 ACB_USE_AES_KEYS = 0x00200000
45 } samr_AcctFlags;
47 /* SAM server specific access rights */
49 typedef [bitmap32bit] bitmap {
50 SAMR_ACCESS_CONNECT_TO_SERVER = 0x00000001,
51 SAMR_ACCESS_SHUTDOWN_SERVER = 0x00000002,
52 SAMR_ACCESS_INITIALIZE_SERVER = 0x00000004,
53 SAMR_ACCESS_CREATE_DOMAIN = 0x00000008,
54 SAMR_ACCESS_ENUM_DOMAINS = 0x00000010,
55 SAMR_ACCESS_LOOKUP_DOMAIN = 0x00000020
56 } samr_ConnectAccessMask;
58 const int SAMR_ACCESS_ALL_ACCESS = 0x0000003F;
60 const int GENERIC_RIGHTS_SAM_ALL_ACCESS =
61 (STANDARD_RIGHTS_REQUIRED_ACCESS |
62 SAMR_ACCESS_ALL_ACCESS);
64 const int GENERIC_RIGHTS_SAM_READ =
65 (STANDARD_RIGHTS_READ_ACCESS |
66 SAMR_ACCESS_ENUM_DOMAINS);
68 const int GENERIC_RIGHTS_SAM_WRITE =
69 (STANDARD_RIGHTS_WRITE_ACCESS |
70 SAMR_ACCESS_CREATE_DOMAIN |
71 SAMR_ACCESS_INITIALIZE_SERVER |
72 SAMR_ACCESS_SHUTDOWN_SERVER);
74 const int GENERIC_RIGHTS_SAM_EXECUTE =
75 (STANDARD_RIGHTS_EXECUTE_ACCESS |
76 SAMR_ACCESS_LOOKUP_DOMAIN |
77 SAMR_ACCESS_CONNECT_TO_SERVER);
79 /* User Object specific access rights */
81 typedef [bitmap32bit] bitmap {
82 SAMR_USER_ACCESS_GET_NAME_ETC = 0x00000001,
83 SAMR_USER_ACCESS_GET_LOCALE = 0x00000002,
84 SAMR_USER_ACCESS_SET_LOC_COM = 0x00000004,
85 SAMR_USER_ACCESS_GET_LOGONINFO = 0x00000008,
86 SAMR_USER_ACCESS_GET_ATTRIBUTES = 0x00000010,
87 SAMR_USER_ACCESS_SET_ATTRIBUTES = 0x00000020,
88 SAMR_USER_ACCESS_CHANGE_PASSWORD = 0x00000040,
89 SAMR_USER_ACCESS_SET_PASSWORD = 0x00000080,
90 SAMR_USER_ACCESS_GET_GROUPS = 0x00000100,
91 SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP = 0x00000200,
92 SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP = 0x00000400
93 } samr_UserAccessMask;
95 const int SAMR_USER_ACCESS_ALL_ACCESS = 0x000007FF;
97 const int GENERIC_RIGHTS_USER_ALL_ACCESS =
98 (STANDARD_RIGHTS_REQUIRED_ACCESS |
99 SAMR_USER_ACCESS_ALL_ACCESS); /* 0x000f07ff */
101 const int GENERIC_RIGHTS_USER_READ =
102 (STANDARD_RIGHTS_READ_ACCESS |
103 SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP |
104 SAMR_USER_ACCESS_GET_GROUPS |
105 SAMR_USER_ACCESS_GET_ATTRIBUTES |
106 SAMR_USER_ACCESS_GET_LOGONINFO |
107 SAMR_USER_ACCESS_GET_LOCALE); /* 0x0002031a */
109 const int GENERIC_RIGHTS_USER_WRITE =
110 (STANDARD_RIGHTS_WRITE_ACCESS |
111 SAMR_USER_ACCESS_CHANGE_PASSWORD |
112 SAMR_USER_ACCESS_SET_LOC_COM |
113 SAMR_USER_ACCESS_SET_ATTRIBUTES |
114 SAMR_USER_ACCESS_SET_PASSWORD |
115 SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP); /* 0x000204e4 */
117 const int GENERIC_RIGHTS_USER_EXECUTE =
118 (STANDARD_RIGHTS_EXECUTE_ACCESS |
119 SAMR_USER_ACCESS_CHANGE_PASSWORD |
120 SAMR_USER_ACCESS_GET_NAME_ETC); /* 0x00020041 */
122 /* Domain Object specific access rights */
124 typedef [bitmap32bit] bitmap {
125 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 = 0x00000001,
126 SAMR_DOMAIN_ACCESS_SET_INFO_1 = 0x00000002,
127 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2 = 0x00000004,
128 SAMR_DOMAIN_ACCESS_SET_INFO_2 = 0x00000008,
129 SAMR_DOMAIN_ACCESS_CREATE_USER = 0x00000010,
130 SAMR_DOMAIN_ACCESS_CREATE_GROUP = 0x00000020,
131 SAMR_DOMAIN_ACCESS_CREATE_ALIAS = 0x00000040,
132 SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS = 0x00000080,
133 SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS = 0x00000100,
134 SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT = 0x00000200,
135 SAMR_DOMAIN_ACCESS_SET_INFO_3 = 0x00000400
136 } samr_DomainAccessMask;
138 const int SAMR_DOMAIN_ACCESS_ALL_ACCESS = 0x000007FF;
140 const int GENERIC_RIGHTS_DOMAIN_ALL_ACCESS =
141 (STANDARD_RIGHTS_REQUIRED_ACCESS |
142 SAMR_DOMAIN_ACCESS_ALL_ACCESS);
144 const int GENERIC_RIGHTS_DOMAIN_READ =
145 (STANDARD_RIGHTS_READ_ACCESS |
146 SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS |
147 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2);
149 const int GENERIC_RIGHTS_DOMAIN_WRITE =
150 (STANDARD_RIGHTS_WRITE_ACCESS |
151 SAMR_DOMAIN_ACCESS_SET_INFO_3 |
152 SAMR_DOMAIN_ACCESS_CREATE_ALIAS |
153 SAMR_DOMAIN_ACCESS_CREATE_GROUP |
154 SAMR_DOMAIN_ACCESS_CREATE_USER |
155 SAMR_DOMAIN_ACCESS_SET_INFO_2 |
156 SAMR_DOMAIN_ACCESS_SET_INFO_1);
158 const int GENERIC_RIGHTS_DOMAIN_EXECUTE =
159 (STANDARD_RIGHTS_EXECUTE_ACCESS |
160 SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT |
161 SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS |
162 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1);
164 /* Group Object specific access rights */
166 typedef [bitmap32bit] bitmap {
167 SAMR_GROUP_ACCESS_LOOKUP_INFO = 0x00000001,
168 SAMR_GROUP_ACCESS_SET_INFO = 0x00000002,
169 SAMR_GROUP_ACCESS_ADD_MEMBER = 0x00000004,
170 SAMR_GROUP_ACCESS_REMOVE_MEMBER = 0x00000008,
171 SAMR_GROUP_ACCESS_GET_MEMBERS = 0x00000010
172 } samr_GroupAccessMask;
174 const int SAMR_GROUP_ACCESS_ALL_ACCESS = 0x0000001F;
176 const int GENERIC_RIGHTS_GROUP_ALL_ACCESS =
177 (STANDARD_RIGHTS_REQUIRED_ACCESS |
178 SAMR_GROUP_ACCESS_ALL_ACCESS); /* 0x000f001f */
180 const int GENERIC_RIGHTS_GROUP_READ =
181 (STANDARD_RIGHTS_READ_ACCESS |
182 SAMR_GROUP_ACCESS_GET_MEMBERS); /* 0x00020010 */
184 const int GENERIC_RIGHTS_GROUP_WRITE =
185 (STANDARD_RIGHTS_WRITE_ACCESS |
186 SAMR_GROUP_ACCESS_REMOVE_MEMBER |
187 SAMR_GROUP_ACCESS_ADD_MEMBER |
188 SAMR_GROUP_ACCESS_SET_INFO); /* 0x0002000e */
190 const int GENERIC_RIGHTS_GROUP_EXECUTE =
191 (STANDARD_RIGHTS_EXECUTE_ACCESS |
192 SAMR_GROUP_ACCESS_LOOKUP_INFO); /* 0x00020001 */
194 /* Alias Object specific access rights */
196 typedef [bitmap32bit] bitmap {
197 SAMR_ALIAS_ACCESS_ADD_MEMBER = 0x00000001,
198 SAMR_ALIAS_ACCESS_REMOVE_MEMBER = 0x00000002,
199 SAMR_ALIAS_ACCESS_GET_MEMBERS = 0x00000004,
200 SAMR_ALIAS_ACCESS_LOOKUP_INFO = 0x00000008,
201 SAMR_ALIAS_ACCESS_SET_INFO = 0x00000010
202 } samr_AliasAccessMask;
204 const int SAMR_ALIAS_ACCESS_ALL_ACCESS = 0x0000001F;
206 const int GENERIC_RIGHTS_ALIAS_ALL_ACCESS =
207 (STANDARD_RIGHTS_REQUIRED_ACCESS |
208 SAMR_ALIAS_ACCESS_ALL_ACCESS); /* 0x000f001f */
210 const int GENERIC_RIGHTS_ALIAS_READ =
211 (STANDARD_RIGHTS_READ_ACCESS |
212 SAMR_ALIAS_ACCESS_GET_MEMBERS); /* 0x00020004 */
214 const int GENERIC_RIGHTS_ALIAS_WRITE =
215 (STANDARD_RIGHTS_WRITE_ACCESS |
216 SAMR_ALIAS_ACCESS_REMOVE_MEMBER |
217 SAMR_ALIAS_ACCESS_ADD_MEMBER |
218 SAMR_ALIAS_ACCESS_SET_INFO); /* 0x00020013 */
220 const int GENERIC_RIGHTS_ALIAS_EXECUTE =
221 (STANDARD_RIGHTS_EXECUTE_ACCESS |
222 SAMR_ALIAS_ACCESS_LOOKUP_INFO); /* 0x00020008 */
224 /******************/
225 /* Function: 0x00 */
226 NTSTATUS samr_Connect (
227 /* notice the lack of [string] */
228 [in,unique] uint16 *system_name,
229 [in] samr_ConnectAccessMask access_mask,
230 [out,ref] policy_handle *connect_handle
234 /******************/
235 /* Function: 0x01 */
236 [public] NTSTATUS samr_Close (
237 [in,out,ref] policy_handle *handle
240 /******************/
241 /* Function: 0x02 */
243 NTSTATUS samr_SetSecurity (
244 [in,ref] policy_handle *handle,
245 [in] security_secinfo sec_info,
246 [in,ref] sec_desc_buf *sdbuf
249 /******************/
250 /* Function: 0x03 */
252 NTSTATUS samr_QuerySecurity (
253 [in,ref] policy_handle *handle,
254 [in] security_secinfo sec_info,
255 [out,ref] sec_desc_buf **sdbuf
258 /******************/
259 /* Function: 0x04 */
262 shutdown the SAM - once you call this the SAM will be dead
264 NTSTATUS samr_Shutdown (
265 [in,ref] policy_handle *connect_handle
268 /******************/
269 /* Function: 0x05 */
270 NTSTATUS samr_LookupDomain (
271 [in,ref] policy_handle *connect_handle,
272 [in,ref] lsa_String *domain_name,
273 [out,ref] dom_sid2 **sid
277 /******************/
278 /* Function: 0x06 */
280 typedef struct {
281 uint32 idx;
282 lsa_String name;
283 } samr_SamEntry;
285 typedef struct {
286 uint32 count;
287 [size_is(count)] samr_SamEntry *entries;
288 } samr_SamArray;
290 NTSTATUS samr_EnumDomains (
291 [in,ref] policy_handle *connect_handle,
292 [in,out,ref] uint32 *resume_handle,
293 [out,ref] samr_SamArray **sam,
294 [in] uint32 buf_size,
295 [out,ref] uint32 *num_entries
299 /************************/
300 /* Function 0x07 */
301 [public] NTSTATUS samr_OpenDomain(
302 [in,ref] policy_handle *connect_handle,
303 [in] samr_DomainAccessMask access_mask,
304 [in,ref] dom_sid2 *sid,
305 [out,ref] policy_handle *domain_handle
308 /************************/
309 /* Function 0x08 */
311 typedef enum {
312 DomainPasswordInformation = 1,
313 DomainGeneralInformation = 2,
314 DomainLogoffInformation = 3,
315 DomainOemInformation = 4,
316 DomainNameInformation = 5,
317 DomainReplicationInformation = 6,
318 DomainServerRoleInformation = 7,
319 DomainModifiedInformation = 8,
320 DomainStateInformation = 9,
321 DomainUasInformation = 10,
322 DomainGeneralInformation2 = 11,
323 DomainLockoutInformation = 12,
324 DomainModifiedInformation2 = 13
325 } samr_DomainInfoClass;
327 /* server roles */
328 typedef [v1_enum] enum {
329 SAMR_ROLE_STANDALONE = 0,
330 SAMR_ROLE_DOMAIN_MEMBER = 1,
331 SAMR_ROLE_DOMAIN_BDC = 2,
332 SAMR_ROLE_DOMAIN_PDC = 3
333 } samr_Role;
335 /* password properties flags */
336 typedef [public,bitmap32bit] bitmap {
337 DOMAIN_PASSWORD_COMPLEX = 0x00000001,
338 DOMAIN_PASSWORD_NO_ANON_CHANGE = 0x00000002,
339 DOMAIN_PASSWORD_NO_CLEAR_CHANGE = 0x00000004,
340 DOMAIN_PASSWORD_LOCKOUT_ADMINS = 0x00000008,
341 DOMAIN_PASSWORD_STORE_CLEARTEXT = 0x00000010,
342 DOMAIN_REFUSE_PASSWORD_CHANGE = 0x00000020
343 } samr_PasswordProperties;
345 typedef [v1_enum] enum {
346 DOMAIN_SERVER_ENABLED = 1,
347 DOMAIN_SERVER_DISABLED = 2
348 } samr_DomainServerState;
350 typedef [public] struct {
351 uint16 min_password_length;
352 uint16 password_history_length;
353 samr_PasswordProperties password_properties;
354 /* yes, these are signed. They are in negative 100ns */
355 dlong max_password_age;
356 dlong min_password_age;
357 } samr_DomInfo1;
359 typedef struct {
360 NTTIME force_logoff_time;
361 lsa_String oem_information; /* comment */
362 lsa_String domain_name;
363 lsa_String primary; /* PDC name if this is a BDC */
364 udlong sequence_num;
365 samr_DomainServerState domain_server_state;
366 samr_Role role;
367 uint32 unknown3;
368 uint32 num_users;
369 uint32 num_groups;
370 uint32 num_aliases;
371 } samr_DomGeneralInformation;
373 typedef struct {
374 NTTIME force_logoff_time;
375 } samr_DomInfo3;
377 typedef struct {
378 lsa_String oem_information; /* comment */
379 } samr_DomOEMInformation;
381 typedef struct {
382 lsa_String domain_name;
383 } samr_DomInfo5;
385 typedef struct {
386 lsa_String primary;
387 } samr_DomInfo6;
389 typedef struct {
390 samr_Role role;
391 } samr_DomInfo7;
393 typedef struct {
394 hyper sequence_num;
395 NTTIME domain_create_time;
396 } samr_DomInfo8;
398 typedef struct {
399 samr_DomainServerState domain_server_state;
400 } samr_DomInfo9;
402 typedef struct {
403 samr_DomGeneralInformation general;
404 hyper lockout_duration;
405 hyper lockout_window;
406 uint16 lockout_threshold;
407 } samr_DomGeneralInformation2;
409 typedef struct {
410 hyper lockout_duration;
411 hyper lockout_window;
412 uint16 lockout_threshold;
413 } samr_DomInfo12;
415 typedef struct {
416 hyper sequence_num;
417 NTTIME domain_create_time;
418 hyper modified_count_at_last_promotion;
419 } samr_DomInfo13;
421 typedef [switch_type(uint16)] union {
422 [case(1)] samr_DomInfo1 info1;
423 [case(2)] samr_DomGeneralInformation general;
424 [case(3)] samr_DomInfo3 info3;
425 [case(4)] samr_DomOEMInformation oem;
426 [case(5)] samr_DomInfo5 info5;
427 [case(6)] samr_DomInfo6 info6;
428 [case(7)] samr_DomInfo7 info7;
429 [case(8)] samr_DomInfo8 info8;
430 [case(9)] samr_DomInfo9 info9;
431 [case(11)] samr_DomGeneralInformation2 general2;
432 [case(12)] samr_DomInfo12 info12;
433 [case(13)] samr_DomInfo13 info13;
434 } samr_DomainInfo;
436 NTSTATUS samr_QueryDomainInfo(
437 [in,ref] policy_handle *domain_handle,
438 [in] samr_DomainInfoClass level,
439 [out,ref,switch_is(level)] samr_DomainInfo **info
442 /************************/
443 /* Function 0x09 */
445 only levels 1, 3, 4, 6, 7, 9, 12 are valid for this
446 call in w2k3
448 NTSTATUS samr_SetDomainInfo(
449 [in,ref] policy_handle *domain_handle,
450 [in] samr_DomainInfoClass level,
451 [in,switch_is(level),ref] samr_DomainInfo *info
455 /************************/
456 /* Function 0x0a */
457 NTSTATUS samr_CreateDomainGroup(
458 [in,ref] policy_handle *domain_handle,
459 [in,ref] lsa_String *name,
460 [in] samr_GroupAccessMask access_mask,
461 [out,ref] policy_handle *group_handle,
462 [out,ref] uint32 *rid
466 /************************/
467 /* Function 0x0b */
468 NTSTATUS samr_EnumDomainGroups(
469 [in] policy_handle *domain_handle,
470 [in,out,ref] uint32 *resume_handle,
471 [out,ref] samr_SamArray **sam,
472 [in] uint32 max_size,
473 [out,ref] uint32 *num_entries
476 /************************/
477 /* Function 0x0c */
478 NTSTATUS samr_CreateUser(
479 [in,ref] policy_handle *domain_handle,
480 [in,ref] lsa_String *account_name,
481 [in] samr_UserAccessMask access_mask,
482 [out,ref] policy_handle *user_handle,
483 [out,ref] uint32 *rid
486 /************************/
487 /* Function 0x0d */
490 /* w2k3 treats max_size as max_users*54 and sets the
491 resume_handle as the rid of the last user sent
493 const int SAMR_ENUM_USERS_MULTIPLIER = 54;
495 NTSTATUS samr_EnumDomainUsers(
496 [in] policy_handle *domain_handle,
497 [in,out,ref] uint32 *resume_handle,
498 [in] samr_AcctFlags acct_flags,
499 [out,ref] samr_SamArray **sam,
500 [in] uint32 max_size,
501 [out,ref] uint32 *num_entries
504 /************************/
505 /* Function 0x0e */
506 NTSTATUS samr_CreateDomAlias(
507 [in,ref] policy_handle *domain_handle,
508 [in,ref] lsa_String *alias_name,
509 [in] samr_AliasAccessMask access_mask,
510 [out,ref] policy_handle *alias_handle,
511 [out,ref] uint32 *rid
514 /************************/
515 /* Function 0x0f */
516 NTSTATUS samr_EnumDomainAliases(
517 [in] policy_handle *domain_handle,
518 [in,out,ref] uint32 *resume_handle,
519 [out,ref] samr_SamArray **sam,
520 [in] uint32 max_size,
521 [out,ref] uint32 *num_entries
524 /************************/
525 /* Function 0x10 */
527 typedef struct {
528 [range(0,1024)] uint32 count;
529 [size_is(count)] uint32 *ids;
530 } samr_Ids;
532 NTSTATUS samr_GetAliasMembership(
533 [in,ref] policy_handle *domain_handle,
534 [in,ref] lsa_SidArray *sids,
535 [out,ref] samr_Ids *rids
538 /************************/
539 /* Function 0x11 */
541 [public] NTSTATUS samr_LookupNames(
542 [in,ref] policy_handle *domain_handle,
543 [in,range(0,1000)] uint32 num_names,
544 [in,size_is(1000),length_is(num_names)] lsa_String names[],
545 [out,ref] samr_Ids *rids,
546 [out,ref] samr_Ids *types
550 /************************/
551 /* Function 0x12 */
552 NTSTATUS samr_LookupRids(
553 [in,ref] policy_handle *domain_handle,
554 [in,range(0,1000)] uint32 num_rids,
555 [in,size_is(1000),length_is(num_rids)] uint32 rids[],
556 [out,ref] lsa_Strings *names,
557 [out,ref] samr_Ids *types
560 /************************/
561 /* Function 0x13 */
562 NTSTATUS samr_OpenGroup(
563 [in,ref] policy_handle *domain_handle,
564 [in] samr_GroupAccessMask access_mask,
565 [in] uint32 rid,
566 [out,ref] policy_handle *group_handle
569 /************************/
570 /* Function 0x14 */
572 typedef struct {
573 lsa_String name;
574 security_GroupAttrs attributes;
575 uint32 num_members;
576 lsa_String description;
577 } samr_GroupInfoAll;
579 typedef struct {
580 security_GroupAttrs attributes;
581 } samr_GroupInfoAttributes;
583 typedef struct {
584 lsa_String description;
585 } samr_GroupInfoDescription;
587 typedef enum {
588 GROUPINFOALL = 1,
589 GROUPINFONAME = 2,
590 GROUPINFOATTRIBUTES = 3,
591 GROUPINFODESCRIPTION = 4,
592 GROUPINFOALL2 = 5
593 } samr_GroupInfoEnum;
595 typedef [switch_type(samr_GroupInfoEnum)] union {
596 [case(GROUPINFOALL)] samr_GroupInfoAll all;
597 [case(GROUPINFONAME)] lsa_String name;
598 [case(GROUPINFOATTRIBUTES)] samr_GroupInfoAttributes attributes;
599 [case(GROUPINFODESCRIPTION)] lsa_String description;
600 [case(GROUPINFOALL2)] samr_GroupInfoAll all2;
601 } samr_GroupInfo;
603 NTSTATUS samr_QueryGroupInfo(
604 [in,ref] policy_handle *group_handle,
605 [in] samr_GroupInfoEnum level,
606 [out,ref,switch_is(level)] samr_GroupInfo **info
609 /************************/
610 /* Function 0x15 */
611 NTSTATUS samr_SetGroupInfo(
612 [in,ref] policy_handle *group_handle,
613 [in] samr_GroupInfoEnum level,
614 [in,switch_is(level),ref] samr_GroupInfo *info
617 /************************/
618 /* Function 0x16 */
619 NTSTATUS samr_AddGroupMember(
620 [in,ref] policy_handle *group_handle,
621 [in] uint32 rid,
622 [in] uint32 flags
625 /************************/
626 /* Function 0x17 */
627 NTSTATUS samr_DeleteDomainGroup(
628 [in,out,ref] policy_handle *group_handle
631 /************************/
632 /* Function 0x18 */
633 NTSTATUS samr_DeleteGroupMember(
634 [in,ref] policy_handle *group_handle,
635 [in] uint32 rid
639 /************************/
640 /* Function 0x19 */
641 typedef struct {
642 uint32 count;
643 [size_is(count)] uint32 *rids;
644 [size_is(count)] security_GroupAttrs *attributes;
645 } samr_RidAttrArray;
647 NTSTATUS samr_QueryGroupMember(
648 [in,ref] policy_handle *group_handle,
649 [out,ref] samr_RidAttrArray **rids
653 /************************/
654 /* Function 0x1a */
657 win2003 seems to accept any data at all for the two integers
658 below, and doesn't seem to do anything with them that I can
659 see. Weird. I really expected the first integer to be a rid
660 and the second to be the attributes for that rid member.
662 NTSTATUS samr_SetMemberAttributesOfGroup(
663 [in,ref] policy_handle *group_handle,
664 [in] uint32 unknown1,
665 [in] uint32 unknown2
669 /************************/
670 /* Function 0x1b */
671 NTSTATUS samr_OpenAlias (
672 [in,ref] policy_handle *domain_handle,
673 [in] samr_AliasAccessMask access_mask,
674 [in] uint32 rid,
675 [out,ref] policy_handle *alias_handle
679 /************************/
680 /* Function 0x1c */
682 typedef struct {
683 lsa_String name;
684 uint32 num_members;
685 lsa_String description;
686 } samr_AliasInfoAll;
688 typedef enum {
689 ALIASINFOALL = 1,
690 ALIASINFONAME = 2,
691 ALIASINFODESCRIPTION = 3
692 } samr_AliasInfoEnum;
694 typedef [switch_type(samr_AliasInfoEnum)] union {
695 [case(ALIASINFOALL)] samr_AliasInfoAll all;
696 [case(ALIASINFONAME)] lsa_String name;
697 [case(ALIASINFODESCRIPTION)] lsa_String description;
698 } samr_AliasInfo;
700 NTSTATUS samr_QueryAliasInfo(
701 [in,ref] policy_handle *alias_handle,
702 [in] samr_AliasInfoEnum level,
703 [out,ref,switch_is(level)] samr_AliasInfo **info
706 /************************/
707 /* Function 0x1d */
708 NTSTATUS samr_SetAliasInfo(
709 [in,ref] policy_handle *alias_handle,
710 [in] samr_AliasInfoEnum level,
711 [in,switch_is(level),ref] samr_AliasInfo *info
714 /************************/
715 /* Function 0x1e */
716 NTSTATUS samr_DeleteDomAlias(
717 [in,out,ref] policy_handle *alias_handle
720 /************************/
721 /* Function 0x1f */
722 NTSTATUS samr_AddAliasMember(
723 [in,ref] policy_handle *alias_handle,
724 [in,ref] dom_sid2 *sid
727 /************************/
728 /* Function 0x20 */
729 NTSTATUS samr_DeleteAliasMember(
730 [in,ref] policy_handle *alias_handle,
731 [in,ref] dom_sid2 *sid
734 /************************/
735 /* Function 0x21 */
736 NTSTATUS samr_GetMembersInAlias(
737 [in,ref] policy_handle *alias_handle,
738 [out,ref] lsa_SidArray *sids
741 /************************/
742 /* Function 0x22 */
743 [public] NTSTATUS samr_OpenUser(
744 [in,ref] policy_handle *domain_handle,
745 [in] samr_UserAccessMask access_mask,
746 [in] uint32 rid,
747 [out,ref] policy_handle *user_handle
750 /************************/
751 /* Function 0x23 */
752 NTSTATUS samr_DeleteUser(
753 [in,out,ref] policy_handle *user_handle
756 /************************/
757 /* Function 0x24 */
759 typedef enum {
760 UserGeneralInformation = 1,
761 UserPreferencesInformation = 2,
762 UserLogonInformation = 3,
763 UserLogonHoursInformation = 4,
764 UserAccountInformation = 5,
765 UserNameInformation = 6,
766 UserAccountNameInformation = 7,
767 UserFullNameInformation = 8,
768 UserPrimaryGroupInformation = 9,
769 UserHomeInformation = 10,
770 UserScriptInformation = 11,
771 UserProfileInformation = 12,
772 UserAdminCommentInformation = 13,
773 UserWorkStationsInformation = 14,
774 UserControlInformation = 16,
775 UserExpiresInformation = 17,
776 UserInternal1Information = 18,
777 UserParametersInformation = 20,
778 UserAllInformation = 21,
779 UserInternal4Information = 23,
780 UserInternal5Information = 24,
781 UserInternal4InformationNew = 25,
782 UserInternal5InformationNew = 26,
783 UserInternal7InformationNew = 31,
784 UserInternal8InformationNew = 32
785 } samr_UserInfoLevel;
787 typedef struct {
788 lsa_String account_name;
789 lsa_String full_name;
790 uint32 primary_gid;
791 lsa_String description;
792 lsa_String comment;
793 } samr_UserInfo1;
795 typedef struct {
796 lsa_String comment;
797 lsa_String reserved; /* settable, but doesn't stick. probably obsolete */
798 uint16 country_code;
799 uint16 code_page;
800 } samr_UserInfo2;
802 /* this is also used in samr and netlogon */
803 typedef [public, flag(NDR_PAHEX)] struct {
804 uint16 units_per_week;
805 [size_is(1260), length_is(units_per_week/8)] uint8 *bits;
806 } samr_LogonHours;
808 typedef struct {
809 lsa_String account_name;
810 lsa_String full_name;
811 uint32 rid;
812 uint32 primary_gid;
813 lsa_String home_directory;
814 lsa_String home_drive;
815 lsa_String logon_script;
816 lsa_String profile_path;
817 lsa_String workstations;
818 NTTIME last_logon;
819 NTTIME last_logoff;
820 NTTIME last_password_change;
821 NTTIME allow_password_change;
822 NTTIME force_password_change;
823 samr_LogonHours logon_hours;
824 uint16 bad_password_count;
825 uint16 logon_count;
826 samr_AcctFlags acct_flags;
827 } samr_UserInfo3;
829 typedef struct {
830 samr_LogonHours logon_hours;
831 } samr_UserInfo4;
833 typedef struct {
834 lsa_String account_name;
835 lsa_String full_name;
836 uint32 rid;
837 uint32 primary_gid;
838 lsa_String home_directory;
839 lsa_String home_drive;
840 lsa_String logon_script;
841 lsa_String profile_path;
842 lsa_String description;
843 lsa_String workstations;
844 NTTIME last_logon;
845 NTTIME last_logoff;
846 samr_LogonHours logon_hours;
847 uint16 bad_password_count;
848 uint16 logon_count;
849 NTTIME last_password_change;
850 NTTIME acct_expiry;
851 samr_AcctFlags acct_flags;
852 } samr_UserInfo5;
854 typedef struct {
855 lsa_String account_name;
856 lsa_String full_name;
857 } samr_UserInfo6;
859 typedef struct {
860 lsa_String account_name;
861 } samr_UserInfo7;
863 typedef struct {
864 lsa_String full_name;
865 } samr_UserInfo8;
867 typedef struct {
868 uint32 primary_gid;
869 } samr_UserInfo9;
871 typedef struct {
872 lsa_String home_directory;
873 lsa_String home_drive;
874 } samr_UserInfo10;
876 typedef struct {
877 lsa_String logon_script;
878 } samr_UserInfo11;
880 typedef struct {
881 lsa_String profile_path;
882 } samr_UserInfo12;
884 typedef struct {
885 lsa_String description;
886 } samr_UserInfo13;
888 typedef struct {
889 lsa_String workstations;
890 } samr_UserInfo14;
892 typedef struct {
893 samr_AcctFlags acct_flags;
894 } samr_UserInfo16;
896 typedef struct {
897 NTTIME acct_expiry;
898 } samr_UserInfo17;
900 typedef [public, flag(NDR_PAHEX)] struct {
901 uint8 hash[16];
902 } samr_Password;
904 typedef struct {
905 samr_Password nt_pwd;
906 samr_Password lm_pwd;
907 boolean8 nt_pwd_active;
908 boolean8 lm_pwd_active;
909 uint8 password_expired;
910 } samr_UserInfo18;
912 typedef struct {
913 lsa_BinaryString parameters;
914 } samr_UserInfo20;
916 /* this defines the bits used for fields_present in info21 */
917 typedef [bitmap32bit] bitmap {
918 SAMR_FIELD_ACCOUNT_NAME = 0x00000001,
919 SAMR_FIELD_FULL_NAME = 0x00000002,
920 SAMR_FIELD_RID = 0x00000004,
921 SAMR_FIELD_PRIMARY_GID = 0x00000008,
922 SAMR_FIELD_DESCRIPTION = 0x00000010,
923 SAMR_FIELD_COMMENT = 0x00000020,
924 SAMR_FIELD_HOME_DIRECTORY = 0x00000040,
925 SAMR_FIELD_HOME_DRIVE = 0x00000080,
926 SAMR_FIELD_LOGON_SCRIPT = 0x00000100,
927 SAMR_FIELD_PROFILE_PATH = 0x00000200,
928 SAMR_FIELD_WORKSTATIONS = 0x00000400,
929 SAMR_FIELD_LAST_LOGON = 0x00000800,
930 SAMR_FIELD_LAST_LOGOFF = 0x00001000,
931 SAMR_FIELD_LOGON_HOURS = 0x00002000,
932 SAMR_FIELD_BAD_PWD_COUNT = 0x00004000,
933 SAMR_FIELD_NUM_LOGONS = 0x00008000,
934 SAMR_FIELD_ALLOW_PWD_CHANGE = 0x00010000,
935 SAMR_FIELD_FORCE_PWD_CHANGE = 0x00020000,
936 SAMR_FIELD_LAST_PWD_CHANGE = 0x00040000,
937 SAMR_FIELD_ACCT_EXPIRY = 0x00080000,
938 SAMR_FIELD_ACCT_FLAGS = 0x00100000,
939 SAMR_FIELD_PARAMETERS = 0x00200000,
940 SAMR_FIELD_COUNTRY_CODE = 0x00400000,
941 SAMR_FIELD_CODE_PAGE = 0x00800000,
942 SAMR_FIELD_NT_PASSWORD_PRESENT = 0x01000000, /* either of these */
943 SAMR_FIELD_LM_PASSWORD_PRESENT = 0x02000000, /* two bits seems to work */
944 SAMR_FIELD_PRIVATE_DATA = 0x04000000,
945 SAMR_FIELD_EXPIRED_FLAG = 0x08000000,
946 SAMR_FIELD_SEC_DESC = 0x10000000,
947 SAMR_FIELD_OWF_PWD = 0x20000000
948 } samr_FieldsPresent;
950 /* used for 'password_expired' in samr_UserInfo21 */
951 const int PASS_MUST_CHANGE_AT_NEXT_LOGON = 0x01;
952 const int PASS_DONT_CHANGE_AT_NEXT_LOGON = 0x00;
954 typedef struct {
955 NTTIME last_logon;
956 NTTIME last_logoff;
957 NTTIME last_password_change;
958 NTTIME acct_expiry;
959 NTTIME allow_password_change;
960 NTTIME force_password_change;
961 lsa_String account_name;
962 lsa_String full_name;
963 lsa_String home_directory;
964 lsa_String home_drive;
965 lsa_String logon_script;
966 lsa_String profile_path;
967 lsa_String description;
968 lsa_String workstations;
969 lsa_String comment;
970 lsa_BinaryString parameters;
971 lsa_BinaryString lm_owf_password;
972 lsa_BinaryString nt_owf_password;
973 lsa_String private_data;
974 uint32 buf_count;
975 [size_is(buf_count)] uint8 *buffer;
976 uint32 rid;
977 uint32 primary_gid;
978 samr_AcctFlags acct_flags;
979 samr_FieldsPresent fields_present;
980 samr_LogonHours logon_hours;
981 uint16 bad_password_count;
982 uint16 logon_count;
983 uint16 country_code;
984 uint16 code_page;
985 uint8 lm_password_set;
986 uint8 nt_password_set;
987 uint8 password_expired;
988 uint8 private_data_sensitive;
989 } samr_UserInfo21;
991 typedef [public, flag(NDR_PAHEX)] struct {
992 uint8 data[516];
993 } samr_CryptPassword;
995 typedef struct {
996 samr_UserInfo21 info;
997 samr_CryptPassword password;
998 } samr_UserInfo23;
1000 typedef struct {
1001 samr_CryptPassword password;
1002 uint8 password_expired;
1003 } samr_UserInfo24;
1005 typedef [flag(NDR_PAHEX)] struct {
1006 uint8 data[532];
1007 } samr_CryptPasswordEx;
1009 typedef struct {
1010 samr_UserInfo21 info;
1011 samr_CryptPasswordEx password;
1012 } samr_UserInfo25;
1014 typedef struct {
1015 samr_CryptPasswordEx password;
1016 uint8 password_expired;
1017 } samr_UserInfo26;
1019 typedef struct {
1020 uint8 auth_data[64];
1021 uint8 salt[16];
1022 uint32 cipher_len;
1023 [size_is(cipher_len)] uint8 *cipher;
1024 hyper PBKDF2Iterations;
1025 } samr_EncryptedPasswordAES;
1027 typedef struct {
1028 samr_EncryptedPasswordAES password;
1029 uint8 password_expired;
1030 } samr_UserInfo31;
1032 typedef struct {
1033 samr_UserInfo21 info;
1034 samr_EncryptedPasswordAES password;
1035 } samr_UserInfo32;
1037 typedef [switch_type(uint16)] union {
1038 [case(1)] samr_UserInfo1 info1;
1039 [case(2)] samr_UserInfo2 info2;
1040 [case(3)] samr_UserInfo3 info3;
1041 [case(4)] samr_UserInfo4 info4;
1042 [case(5)] samr_UserInfo5 info5;
1043 [case(6)] samr_UserInfo6 info6;
1044 [case(7)] samr_UserInfo7 info7;
1045 [case(8)] samr_UserInfo8 info8;
1046 [case(9)] samr_UserInfo9 info9;
1047 [case(10)] samr_UserInfo10 info10;
1048 [case(11)] samr_UserInfo11 info11;
1049 [case(12)] samr_UserInfo12 info12;
1050 [case(13)] samr_UserInfo13 info13;
1051 [case(14)] samr_UserInfo14 info14;
1052 [case(16)] samr_UserInfo16 info16;
1053 [case(17)] samr_UserInfo17 info17;
1054 [case(18)] samr_UserInfo18 info18;
1055 [case(20)] samr_UserInfo20 info20;
1056 [case(21)] samr_UserInfo21 info21;
1057 [case(23)] samr_UserInfo23 info23;
1058 [case(24)] samr_UserInfo24 info24;
1059 [case(25)] samr_UserInfo25 info25;
1060 [case(26)] samr_UserInfo26 info26;
1061 [case(31)] samr_UserInfo31 info31;
1062 [case(32)] samr_UserInfo32 info32;
1063 } samr_UserInfo;
1065 [public] NTSTATUS samr_QueryUserInfo(
1066 [in,ref] policy_handle *user_handle,
1067 [in] samr_UserInfoLevel level,
1068 [out,ref,switch_is(level)] samr_UserInfo **info
1072 /************************/
1073 /* Function 0x25 */
1074 [public] NTSTATUS samr_SetUserInfo(
1075 [in,ref] policy_handle *user_handle,
1076 [in] samr_UserInfoLevel level,
1077 [in,ref,switch_is(level)] samr_UserInfo *info
1080 /************************/
1081 /* Function 0x26 */
1083 this is a password change interface that doesn't give
1084 the server the plaintext password. Deprecated.
1086 NTSTATUS samr_ChangePasswordUser(
1087 [in,ref] policy_handle *user_handle,
1088 [in] boolean8 lm_present,
1089 [in,unique] samr_Password *old_lm_crypted,
1090 [in,unique] samr_Password *new_lm_crypted,
1091 [in] boolean8 nt_present,
1092 [in,unique] samr_Password *old_nt_crypted,
1093 [in,unique] samr_Password *new_nt_crypted,
1094 [in] boolean8 cross1_present,
1095 [in,unique] samr_Password *nt_cross,
1096 [in] boolean8 cross2_present,
1097 [in,unique] samr_Password *lm_cross
1100 /************************/
1101 /* Function 0x27 */
1103 typedef [public] struct {
1104 uint32 rid;
1105 security_GroupAttrs attributes;
1106 } samr_RidWithAttribute;
1108 typedef [public] struct {
1109 uint32 count;
1110 [size_is(count)] samr_RidWithAttribute *rids;
1111 } samr_RidWithAttributeArray;
1113 NTSTATUS samr_GetGroupsForUser(
1114 [in,ref] policy_handle *user_handle,
1115 [out,ref] samr_RidWithAttributeArray **rids
1118 /************************/
1119 /* Function 0x28 */
1121 typedef struct {
1122 uint32 idx;
1123 uint32 rid;
1124 samr_AcctFlags acct_flags;
1125 lsa_String account_name;
1126 lsa_String description;
1127 lsa_String full_name;
1128 } samr_DispEntryGeneral;
1130 typedef struct {
1131 uint32 count;
1132 [size_is(count)] samr_DispEntryGeneral *entries;
1133 } samr_DispInfoGeneral;
1135 typedef struct {
1136 uint32 idx;
1137 uint32 rid;
1138 samr_AcctFlags acct_flags;
1139 lsa_String account_name;
1140 lsa_String description;
1141 } samr_DispEntryFull;
1143 typedef struct {
1144 uint32 count;
1145 [size_is(count)] samr_DispEntryFull *entries;
1146 } samr_DispInfoFull;
1148 typedef struct {
1149 uint32 idx;
1150 uint32 rid;
1151 security_GroupAttrs acct_flags;
1152 lsa_String account_name;
1153 lsa_String description;
1154 } samr_DispEntryFullGroup;
1156 typedef struct {
1157 uint32 count;
1158 [size_is(count)] samr_DispEntryFullGroup *entries;
1159 } samr_DispInfoFullGroups;
1161 typedef struct {
1162 uint32 idx;
1163 lsa_AsciiStringLarge account_name;
1164 } samr_DispEntryAscii;
1166 typedef struct {
1167 uint32 count;
1168 [size_is(count)] samr_DispEntryAscii *entries;
1169 } samr_DispInfoAscii;
1171 typedef [switch_type(uint16)] union {
1172 [case(1)] samr_DispInfoGeneral info1;/* users */
1173 [case(2)] samr_DispInfoFull info2; /* trust accounts? */
1174 [case(3)] samr_DispInfoFullGroups info3; /* groups */
1175 [case(4)] samr_DispInfoAscii info4; /* users */
1176 [case(5)] samr_DispInfoAscii info5; /* groups */
1177 } samr_DispInfo;
1179 NTSTATUS samr_QueryDisplayInfo(
1180 [in,ref] policy_handle *domain_handle,
1181 [in] uint16 level,
1182 [in] uint32 start_idx,
1183 [in] uint32 max_entries,
1184 [in] uint32 buf_size,
1185 [out,ref] uint32 *total_size,
1186 [out,ref] uint32 *returned_size,
1187 [out,ref,switch_is(level)] samr_DispInfo *info
1191 /************************/
1192 /* Function 0x29 */
1195 this seems to be an alphabetic search function. The returned index
1196 is the index for samr_QueryDisplayInfo needed to get names occurring
1197 after the specified name. The supplied name does not need to exist
1198 in the database (for example you can supply just a first letter for
1199 searching starting at that letter)
1201 The level corresponds to the samr_QueryDisplayInfo level
1203 NTSTATUS samr_GetDisplayEnumerationIndex(
1204 [in,ref] policy_handle *domain_handle,
1205 [in] uint16 level,
1206 [in,ref] lsa_String *name,
1207 [out,ref] uint32 *idx
1212 /************************/
1213 /* Function 0x2a */
1216 w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
1218 NTSTATUS samr_TestPrivateFunctionsDomain(
1219 [in,ref] policy_handle *domain_handle
1223 /************************/
1224 /* Function 0x2b */
1227 w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
1229 NTSTATUS samr_TestPrivateFunctionsUser(
1230 [in,ref] policy_handle *user_handle
1234 /************************/
1235 /* Function 0x2c */
1237 typedef struct {
1238 uint16 min_password_length;
1239 samr_PasswordProperties password_properties;
1240 } samr_PwInfo;
1242 [public] NTSTATUS samr_GetUserPwInfo(
1243 [in,ref] policy_handle *user_handle,
1244 [out,ref] samr_PwInfo *info
1247 /************************/
1248 /* Function 0x2d */
1249 NTSTATUS samr_RemoveMemberFromForeignDomain(
1250 [in,ref] policy_handle *domain_handle,
1251 [in,ref] dom_sid2 *sid
1254 /************************/
1255 /* Function 0x2e */
1258 how is this different from QueryDomainInfo ??
1260 NTSTATUS samr_QueryDomainInfo2(
1261 [in,ref] policy_handle *domain_handle,
1262 [in] samr_DomainInfoClass level,
1263 [out,ref,switch_is(level)] samr_DomainInfo **info
1266 /************************/
1267 /* Function 0x2f */
1270 how is this different from QueryUserInfo ??
1272 NTSTATUS samr_QueryUserInfo2(
1273 [in,ref] policy_handle *user_handle,
1274 [in] samr_UserInfoLevel level,
1275 [out,ref,switch_is(level)] samr_UserInfo **info
1278 /************************/
1279 /* Function 0x30 */
1282 how is this different from QueryDisplayInfo??
1284 NTSTATUS samr_QueryDisplayInfo2(
1285 [in,ref] policy_handle *domain_handle,
1286 [in] uint16 level,
1287 [in] uint32 start_idx,
1288 [in] uint32 max_entries,
1289 [in] uint32 buf_size,
1290 [out,ref] uint32 *total_size,
1291 [out,ref] uint32 *returned_size,
1292 [out,ref,switch_is(level)] samr_DispInfo *info
1295 /************************/
1296 /* Function 0x31 */
1299 how is this different from GetDisplayEnumerationIndex ??
1301 NTSTATUS samr_GetDisplayEnumerationIndex2(
1302 [in,ref] policy_handle *domain_handle,
1303 [in] uint16 level,
1304 [in,ref] lsa_String *name,
1305 [out,ref] uint32 *idx
1309 /************************/
1310 /* Function 0x32 */
1311 NTSTATUS samr_CreateUser2(
1312 [in,ref] policy_handle *domain_handle,
1313 [in,ref] lsa_String *account_name,
1314 [in] samr_AcctFlags acct_flags,
1315 [in] samr_UserAccessMask access_mask,
1316 [out,ref] policy_handle *user_handle,
1317 [out,ref] uint32 *access_granted,
1318 [out,ref] uint32 *rid
1322 /************************/
1323 /* Function 0x33 */
1326 another duplicate. There must be a reason ....
1328 NTSTATUS samr_QueryDisplayInfo3(
1329 [in,ref] policy_handle *domain_handle,
1330 [in] uint16 level,
1331 [in] uint32 start_idx,
1332 [in] uint32 max_entries,
1333 [in] uint32 buf_size,
1334 [out,ref] uint32 *total_size,
1335 [out,ref] uint32 *returned_size,
1336 [out,ref,switch_is(level)] samr_DispInfo *info
1339 /************************/
1340 /* Function 0x34 */
1341 NTSTATUS samr_AddMultipleMembersToAlias(
1342 [in,ref] policy_handle *alias_handle,
1343 [in,ref] lsa_SidArray *sids
1346 /************************/
1347 /* Function 0x35 */
1348 NTSTATUS samr_RemoveMultipleMembersFromAlias(
1349 [in,ref] policy_handle *alias_handle,
1350 [in,ref] lsa_SidArray *sids
1353 /************************/
1354 /* Function 0x36 */
1356 NTSTATUS samr_OemChangePasswordUser2(
1357 [in,unique] lsa_AsciiString *server,
1358 [in,ref] lsa_AsciiString *account,
1359 [in,unique] samr_CryptPassword *password,
1360 [in,unique] samr_Password *hash
1363 /************************/
1364 /* Function 0x37 */
1365 NTSTATUS samr_ChangePasswordUser2(
1366 [in,unique] lsa_String *server,
1367 [in,ref] lsa_String *account,
1368 [in,unique] samr_CryptPassword *nt_password,
1369 [in,unique] samr_Password *nt_verifier,
1370 [in] boolean8 lm_change,
1371 [in,unique] samr_CryptPassword *lm_password,
1372 [in,unique] samr_Password *lm_verifier
1375 /************************/
1376 /* Function 0x38 */
1377 NTSTATUS samr_GetDomPwInfo(
1378 [in,unique] lsa_String *domain_name,
1379 [out,ref] samr_PwInfo *info
1382 /************************/
1383 /* Function 0x39 */
1384 NTSTATUS samr_Connect2(
1385 [in,unique,string,charset(UTF16)] uint16 *system_name,
1386 [in] samr_ConnectAccessMask access_mask,
1387 [out,ref] policy_handle *connect_handle
1390 /************************/
1391 /* Function 0x3a */
1393 seems to be an exact alias for samr_SetUserInfo()
1395 [public] NTSTATUS samr_SetUserInfo2(
1396 [in,ref] policy_handle *user_handle,
1397 [in] samr_UserInfoLevel level,
1398 [in,ref,switch_is(level)] samr_UserInfo *info
1401 /************************/
1402 /* Function 0x3b */
1404 this one is mysterious. I have a few guesses, but nothing working yet
1406 NTSTATUS samr_SetBootKeyInformation(
1407 [in,ref] policy_handle *connect_handle,
1408 [in] uint32 unknown1,
1409 [in] uint32 unknown2,
1410 [in] uint32 unknown3
1413 /************************/
1414 /* Function 0x3c */
1415 NTSTATUS samr_GetBootKeyInformation(
1416 [in,ref] policy_handle *domain_handle,
1417 [out,ref] uint32 *unknown
1420 /************************/
1421 /* Function 0x3d */
1422 NTSTATUS samr_Connect3(
1423 [in,unique,string,charset(UTF16)] uint16 *system_name,
1424 /* this unknown value seems to be completely ignored by w2k3 */
1425 [in] uint32 unknown,
1426 [in] samr_ConnectAccessMask access_mask,
1427 [out,ref] policy_handle *connect_handle
1430 /************************/
1431 /* Function 0x3e */
1433 typedef [v1_enum] enum {
1434 SAMR_CONNECT_PRE_W2K = 1,
1435 SAMR_CONNECT_W2K = 2,
1436 SAMR_CONNECT_AFTER_W2K = 3
1437 } samr_ConnectVersion;
1439 NTSTATUS samr_Connect4(
1440 [in,unique,string,charset(UTF16)] uint16 *system_name,
1441 [in] samr_ConnectVersion client_version,
1442 [in] samr_ConnectAccessMask access_mask,
1443 [out,ref] policy_handle *connect_handle
1446 /************************/
1447 /* Function 0x3f */
1449 typedef [public,v1_enum] enum {
1450 SAM_PWD_CHANGE_NO_ERROR = 0,
1451 SAM_PWD_CHANGE_PASSWORD_TOO_SHORT = 1,
1452 SAM_PWD_CHANGE_PWD_IN_HISTORY = 2,
1453 SAM_PWD_CHANGE_USERNAME_IN_PASSWORD = 3,
1454 SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD = 4,
1455 SAM_PWD_CHANGE_NOT_COMPLEX = 5,
1456 SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT = 6,
1457 SAM_PWD_CHANGE_FAILED_BY_FILTER = 7,
1458 SAM_PWD_CHANGE_PASSWORD_TOO_LONG = 8
1459 } samPwdChangeReason;
1461 typedef struct {
1462 samPwdChangeReason extendedFailureReason;
1463 lsa_String filterModuleName;
1464 } userPwdChangeFailureInformation;
1466 [public] NTSTATUS samr_ChangePasswordUser3(
1467 [in,unique] lsa_String *server,
1468 [in,ref] lsa_String *account,
1469 [in,unique] samr_CryptPassword *nt_password,
1470 [in,unique] samr_Password *nt_verifier,
1471 [in] boolean8 lm_change,
1472 [in,unique] samr_CryptPassword *lm_password,
1473 [in,unique] samr_Password *lm_verifier,
1474 [in,unique] samr_CryptPassword *password3,
1475 [out,ref] samr_DomInfo1 **dominfo,
1476 [out,ref] userPwdChangeFailureInformation **reject
1479 /************************/
1480 /* Function 0x40 */
1482 typedef [v1_enum] enum {
1483 SAMR_CONNECT_FEATURE_RID_ONLY = 0x00000001,
1484 SAMR_CONNECT_FEATURE_RESRVED1 = 0x00000002,
1485 SAMR_CONNECT_FEATURE_RESRVED2 = 0x00000004,
1486 SAMR_CONNECT_FEATURE_USE_AES = 0x00000010
1487 } samr_SupportedFeatures;
1489 typedef struct {
1490 samr_ConnectVersion client_version; /* w2k3 gives 3 */
1491 samr_SupportedFeatures supported_features;
1492 } samr_ConnectInfo1;
1494 typedef union {
1495 [case(1)] samr_ConnectInfo1 info1;
1496 } samr_ConnectInfo;
1498 [public] NTSTATUS samr_Connect5(
1499 [in,unique,string,charset(UTF16)] uint16 *system_name,
1500 [in] samr_ConnectAccessMask access_mask,
1501 [in] uint32 level_in,
1502 [in,ref,switch_is(level_in)] samr_ConnectInfo *info_in,
1503 [out,ref] uint32 *level_out,
1504 [out,ref,switch_is(*level_out)] samr_ConnectInfo *info_out,
1505 [out,ref] policy_handle *connect_handle
1508 /************************/
1509 /* Function 0x41 */
1510 NTSTATUS samr_RidToSid(
1511 [in,ref] policy_handle *domain_handle,
1512 [in] uint32 rid,
1513 [out,ref] dom_sid2 **sid
1516 /************************/
1517 /* Function 0x42 */
1520 this should set the DSRM password for the server, which is used
1521 when booting into Directory Services Recovery Mode on a DC. Win2003
1522 gives me NT_STATUS_NOT_SUPPORTED
1525 NTSTATUS samr_SetDsrmPassword(
1526 [in,unique] lsa_String *name,
1527 [in] uint32 unknown,
1528 [in,unique] samr_Password *hash
1532 /************************/
1533 /* Function 0x43 */
1534 /************************/
1535 typedef [bitmap32bit] bitmap {
1536 SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET = 0x00000001,
1537 SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME = 0x00000002,
1538 SAMR_VALIDATE_FIELD_LOCKOUT_TIME = 0x00000004,
1539 SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT = 0x00000008,
1540 SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH = 0x00000010,
1541 SAMR_VALIDATE_FIELD_PASSWORD_HISTORY = 0x00000020
1542 } samr_ValidateFieldsPresent;
1544 typedef enum {
1545 NetValidateAuthentication = 1,
1546 NetValidatePasswordChange= 2,
1547 NetValidatePasswordReset = 3
1548 } samr_ValidatePasswordLevel;
1550 /* NetApi maps samr_ValidationStatus errors to WERRORs. Haven't
1551 * identified the mapping of
1552 * - NERR_PasswordFilterError
1553 * - NERR_PasswordExpired and
1554 * - NERR_PasswordCantChange
1555 * yet - Guenther
1558 typedef enum {
1559 SAMR_VALIDATION_STATUS_SUCCESS = 0,
1560 SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE = 1,
1561 SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT = 2,
1562 SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED = 3,
1563 SAMR_VALIDATION_STATUS_BAD_PASSWORD = 4,
1564 SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT = 5,
1565 SAMR_VALIDATION_STATUS_PWD_TOO_SHORT = 6,
1566 SAMR_VALIDATION_STATUS_PWD_TOO_LONG = 7,
1567 SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH = 8,
1568 SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT = 9,
1569 SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR = 10
1570 } samr_ValidationStatus;
1572 typedef struct {
1573 uint32 length;
1574 [size_is(length)] uint8 *data;
1575 } samr_ValidationBlob;
1577 typedef struct {
1578 samr_ValidateFieldsPresent fields_present;
1579 NTTIME_hyper last_password_change;
1580 NTTIME_hyper bad_password_time;
1581 NTTIME_hyper lockout_time;
1582 uint32 bad_pwd_count;
1583 uint32 pwd_history_len;
1584 [size_is(pwd_history_len)] samr_ValidationBlob *pwd_history;
1585 } samr_ValidatePasswordInfo;
1587 typedef struct {
1588 samr_ValidatePasswordInfo info;
1589 samr_ValidationStatus status;
1590 } samr_ValidatePasswordRepCtr;
1592 typedef [switch_type(uint16)] union {
1593 [case(1)] samr_ValidatePasswordRepCtr ctr1;
1594 [case(2)] samr_ValidatePasswordRepCtr ctr2;
1595 [case(3)] samr_ValidatePasswordRepCtr ctr3;
1596 } samr_ValidatePasswordRep;
1598 typedef struct {
1599 samr_ValidatePasswordInfo info;
1600 lsa_StringLarge password;
1601 lsa_StringLarge account;
1602 samr_ValidationBlob hash;
1603 boolean8 pwd_must_change_at_next_logon;
1604 boolean8 clear_lockout;
1605 } samr_ValidatePasswordReq3;
1607 typedef struct {
1608 samr_ValidatePasswordInfo info;
1609 lsa_StringLarge password;
1610 lsa_StringLarge account;
1611 samr_ValidationBlob hash;
1612 boolean8 password_matched;
1613 } samr_ValidatePasswordReq2;
1615 typedef struct {
1616 samr_ValidatePasswordInfo info;
1617 boolean8 password_matched;
1618 } samr_ValidatePasswordReq1;
1620 typedef [switch_type(uint16)] union {
1621 [case(1)] samr_ValidatePasswordReq1 req1;
1622 [case(2)] samr_ValidatePasswordReq2 req2;
1623 [case(3)] samr_ValidatePasswordReq3 req3;
1624 } samr_ValidatePasswordReq;
1626 NTSTATUS samr_ValidatePassword(
1627 [in] samr_ValidatePasswordLevel level,
1628 [in,switch_is(level)] samr_ValidatePasswordReq *req,
1629 [out,ref,switch_is(level)] samr_ValidatePasswordRep **rep
1632 /************************/
1633 /* Function 0x44 */
1634 /************************/
1635 [todo] void samr_Opnum68NotUsedOnWire(void);
1637 /************************/
1638 /* Function 0x45 */
1639 /************************/
1640 [todo] void samr_Opnum69NotUsedOnWire(void);
1642 /************************/
1643 /* Function 0x46 */
1644 /************************/
1645 [todo] void samr_Opnum70NotUsedOnWire(void);
1647 /************************/
1648 /* Function 0x47 */
1649 /************************/
1650 [todo] void samr_Opnum71NotUsedOnWire(void);
1652 /************************/
1653 /* Function 0x48 */
1654 /************************/
1655 [todo] void samr_Opnum72NotUsedOnWire(void);
1657 /************************/
1658 /* Function 0x49 */
1659 /************************/
1660 [public] NTSTATUS samr_ChangePasswordUser4(
1661 [in,unique] lsa_String *server,
1662 [in,ref] lsa_String *account,
1663 [in,ref] samr_EncryptedPasswordAES *password