r307: added IDL and test code for samr_GetDomPwInfo(), samr_SetUserInfo2(),
[kai/samba.git] / source / librpc / idl / samr.idl
1 #include "idl_types.h"
2
3 /*
4   samr interface definition
5 */
6
7 /*
8   Thanks to Todd Sabin for some information from his samr.idl in acltools
9 */
10
11 [ uuid(12345778-1234-abcd-ef00-0123456789ac),
12   version(1.0),
13   pointer_default(unique)
14 ] interface samr
15 {
16         /******************/
17         /* Function: 0x00 */
18         NTSTATUS samr_Connect (
19                 /* notice the lack of [string] */
20                 [in]       uint16 *system_name,
21                 [in]       uint32 access_mask,
22                 [out,ref]  policy_handle *handle
23                 );
24
25
26         /******************/
27         /* Function: 0x01 */
28         NTSTATUS samr_Close (
29                 [in,out,ref]  policy_handle *handle
30                 );
31
32         /******************/
33         /* Function: 0x02 */
34
35         typedef struct {
36                 [value(ndr_size_security_descriptor(r->sd))] uint32 sd_size;
37                 [subcontext(4)] security_descriptor *sd;
38         } samr_SdBuf;
39
40         NTSTATUS samr_SetSecurity (
41                 [in,ref]          policy_handle *handle,
42                 [in]              uint32 sec_info,
43                 [in,ref]          samr_SdBuf *sdbuf
44                 );
45
46         /******************/
47         /* Function: 0x03 */
48
49         NTSTATUS samr_QuerySecurity (
50                 [in,ref]          policy_handle *handle,
51                 [in]              uint32 sec_info,
52                 [out]             samr_SdBuf *sdbuf
53                 );
54
55         /******************/
56         /* Function: 0x04 */
57         NTSTATUS samr_Shutdown ();
58
59         /******************/
60         /* Function: 0x05 */
61         typedef struct {
62                 [value(2*strlen_m(r->name))] uint16 name_len;
63                 [value(r->name_len)] uint16 name_size;
64                 unistr_noterm *name;
65         } samr_Name;    
66
67         NTSTATUS samr_LookupDomain (
68                 [in,ref]  policy_handle *handle,                
69                 [in,ref]  samr_Name *domain,
70                 [out]     dom_sid2 *sid
71                 );
72
73
74         /******************/
75         /* Function: 0x06 */
76
77         typedef struct {
78                 uint32 idx;
79                 samr_Name name;
80         } samr_SamEntry;
81
82         typedef struct {
83                 uint32 count;
84                 [size_is(count)] samr_SamEntry *entries;
85         } samr_SamArray;
86
87         NTSTATUS samr_EnumDomains (
88                 [in,ref]      policy_handle *handle,
89                 [in,out,ref]  uint32 *resume_handle,
90                 [in]          uint32 buf_size,
91                 [out]         samr_SamArray *sam,
92                 [out]         uint32 num_entries
93                 );
94
95
96         /************************/
97         /* Function    0x07     */
98         NTSTATUS samr_OpenDomain(
99                 [in,ref]      policy_handle *handle,
100                 [in]          uint32 access_mask,
101                 [in,ref]      dom_sid2 *sid,
102                 [out,ref]     policy_handle *domain_handle
103                 );
104
105         /************************/
106         /* Function    0x08     */
107
108         typedef struct {
109                 uint16 min_length_password;
110                 uint16 password_history;
111                 uint32 flag;
112                 NTTIME expire;
113                 NTTIME min_passwordage;
114         } samr_DomInfo1;
115
116         typedef struct {
117                 ULONG8 force_logoff_time;
118                 samr_Name unknown1;
119                 samr_Name domain;  /* domain name */
120                 samr_Name primary; /* PDC name if this is a BDC */
121                 HYPER_T sequence_num;
122                 uint32 unknown2;
123                 uint32 role;
124                 uint32 unknown3;
125                 uint32 num_users;
126                 uint32 num_groups;
127                 uint32 num_aliases;
128         } samr_DomInfo2;
129
130         typedef struct {
131                 ULONG8 force_logoff_time;
132         } samr_DomInfo3;
133
134         typedef struct {
135                 samr_Name unknown;
136         } samr_DomInfo4;
137
138         typedef struct {
139                 samr_Name domain;
140         } samr_DomInfo5;
141
142         typedef struct {
143                 samr_Name primary;
144         } samr_DomInfo6;
145
146         typedef struct {
147                 uint32 role;
148         } samr_DomInfo7;
149
150         typedef struct {
151                 HYPER_T sequence_num;
152                 NTTIME last_xxx_time;
153         } samr_DomInfo8;
154
155         typedef struct {
156                 uint32 unknown;
157         } samr_DomInfo9;
158
159         typedef struct {
160                 ULONG8 force_logoff_time;
161                 samr_Name unknown1;
162                 samr_Name domain;
163                 samr_Name primary;
164                 HYPER_T sequence_num;
165                 uint32 unknown2;
166                 uint32 role;
167                 uint32 unknown3;
168                 uint32 num_users;
169                 uint32 num_groups;
170                 uint32 num_aliases;
171                 HYPER_T lockout_duration;
172                 HYPER_T lockout_window;
173                 uint16 lockout_threshold;
174         } samr_DomInfo11;
175
176         typedef struct {
177                 HYPER_T lockout_duration;
178                 HYPER_T lockout_window;
179                 uint16 lockout_threshold;
180         } samr_DomInfo12;
181
182         typedef struct {
183                 HYPER_T sequence_num;
184                 NTTIME last_xxx_time;
185                 uint32 unknown1;
186                 uint32 unknown2;
187         } samr_DomInfo13;
188
189         typedef union {
190                 [case(1)] samr_DomInfo1 info1;
191                 [case(2)] samr_DomInfo2 info2;
192                 [case(3)] samr_DomInfo3 info3;
193                 [case(4)] samr_DomInfo4 info4;
194                 [case(5)] samr_DomInfo5 info5;
195                 [case(6)] samr_DomInfo6 info6;
196                 [case(7)] samr_DomInfo7 info7;
197                 [case(8)] samr_DomInfo8 info8;
198                 [case(9)] samr_DomInfo9 info9;
199                 [case(11)] samr_DomInfo11 info11;
200                 [case(12)] samr_DomInfo12 info12;
201                 [case(13)] samr_DomInfo13 info13;
202         } samr_DomainInfo;
203
204         NTSTATUS samr_QueryDomainInfo(
205                 [in,ref]      policy_handle *handle,
206                 [in]          uint16 level,
207                 [out,switch_is(level)] samr_DomainInfo *info
208                 );
209
210         /************************/
211         /* Function    0x09     */
212         /*
213           only levels 1, 3, 4, 6, 7, 9, 12 are valid for this 
214           call in w2k3
215         */
216         NTSTATUS samr_SetDomainInfo(
217                 [in,ref]      policy_handle *handle,
218                 [in]          uint16 level,
219                 [in,switch_is(level),ref] samr_DomainInfo *info
220                 );
221
222
223         /************************/
224         /* Function    0x0a     */
225         NTSTATUS samr_CreateDomainGroup(
226                 [in,ref]      policy_handle *handle,
227                 [in,ref]      samr_Name *name,
228                 [in]          uint32 access_mask,
229                 [out,ref]     policy_handle *group_handle,
230                 [out,ref]     uint32 *rid
231                 );
232                 
233
234         /************************/
235         /* Function    0x0b     */
236         NTSTATUS samr_EnumDomainGroups(
237                 [in,ref]      policy_handle *handle,
238                 [in,out,ref]  uint32 *resume_handle,
239                 [in]          uint32 max_size,
240                 [out]         samr_SamArray *sam,
241                 [out]         uint32 num_entries
242                 );
243
244         /************************/
245         /* Function    0x0c     */
246         NTSTATUS samr_CreateUser(
247                 [in,ref]      policy_handle *handle,
248                 [in,ref]      samr_Name *username,
249                 [in]          uint32 access_mask,
250                 [out,ref]     policy_handle *acct_handle,
251                 [out,ref]     uint32 *rid
252                 );
253
254         /************************/
255         /* Function    0x0d     */
256         NTSTATUS samr_EnumDomainUsers(
257                 [in,ref]      policy_handle *handle,
258                 [in,out,ref]  uint32 *resume_handle,
259                 [in]          uint32 acct_flags,
260                 [in]          uint32 max_size,
261                 [out]         samr_SamArray *sam,
262                 [out]         uint32 num_entries
263                 );
264
265         /************************/
266         /* Function    0x0e     */
267         NTSTATUS samr_CreateDomAlias(
268                 [in,ref]      policy_handle *handle,
269                 [in,ref]      samr_Name     *aliasname,
270                 [in]          uint32         access_mask,
271                 [out,ref]     policy_handle *acct_handle,
272                 [out,ref]     uint32        *rid
273                 );
274
275         /************************/
276         /* Function    0x0f     */
277         NTSTATUS samr_EnumDomainAliases(
278                 [in,ref]      policy_handle *handle,
279                 [in,out,ref]  uint32 *resume_handle,
280                 [in]          uint32 max_size,
281                 [out]         samr_SamArray *sam,
282                 [out]         uint32 num_entries
283                 );
284
285         /************************/
286         /* Function    0x10     */
287
288         typedef struct {
289                 uint32 count;
290                 [size_is(count)] uint32 *ids;
291         } samr_Ids;
292
293         NTSTATUS samr_GetAliasMembership(
294                 [in,ref]      policy_handle *handle,
295                 [in,ref]      lsa_SidArray  *sids,
296                 [out]         samr_Ids *rids
297                 );
298
299         /************************/
300         /* Function    0x11     */
301
302         NTSTATUS samr_LookupNames(
303                 [in,ref]      policy_handle *handle,
304                 [in]          uint32 num_names,
305                 [in,ref,size_is(1000),length_is(num_names)] samr_Name *names,
306                 [out]         samr_Ids rids,
307                 [out]         samr_Ids types
308                 );
309
310
311         /************************/
312         /* Function    0x12     */
313
314         typedef struct {
315                 uint32 count;
316                 [size_is(count)] samr_Name *names;
317         } samr_Names;
318
319         NTSTATUS samr_LookupRids(
320                 [in,ref]      policy_handle *handle,
321                 [in]          uint32 num_rids,
322                 [in,ref,size_is(1000),length_is(num_rids)] uint32 *rids,
323                 [out]         samr_Names names,
324                 [out]         samr_Ids types
325                 );
326
327         /************************/
328         /* Function    0x13     */
329         NTSTATUS samr_OpenGroup(
330                 [in,ref]      policy_handle *handle,
331                 [in]          uint32 access_mask,
332                 [in]          uint32 rid,
333                 [out,ref]     policy_handle *acct_handle
334                 );
335
336
337         /************************/
338         /* Function    0x14     */
339
340         typedef struct {
341                 samr_Name name;
342                 uint32 unknown;
343                 uint32 num_members;
344                 samr_Name description;
345         } samr_GroupInfoAll;
346
347         typedef struct {
348                 uint32 unknown;
349         } samr_GroupInfoX;
350
351         typedef struct {
352                 samr_Name description;
353         } samr_GroupInfoDesciption;
354
355         typedef enum {
356                 GroupInfoAll = 1,
357                 GroupInfoName,
358                 GroupInfoX,
359                 GroupInfoDescription
360         } GroupInfo;
361
362         typedef union {
363                 [case(GroupInfoAll)]         samr_GroupInfoAll    all;
364                 [case(GroupInfoName)]        samr_Name            name;
365                 [case(GroupInfoX)]           samr_GroupInfoX      unknown;
366                 [case(GroupInfoDescription)] samr_Name            description;
367         } samr_GroupInfo;
368
369         NTSTATUS samr_QueryGroupInfo(
370                 [in,ref]                  policy_handle *handle,
371                 [in]                      uint16 level,
372                 [out,switch_is(level)]    samr_GroupInfo *info
373                 );
374
375         /************************/
376         /* Function    0x15     */
377         NTSTATUS samr_SetGroupInfo(
378                 [in,ref]                  policy_handle *handle,
379                 [in]                      uint16 level,
380                 [in,switch_is(level),ref] samr_GroupInfo *info
381                 );
382
383         /************************/
384         /* Function    0x16     */
385         NTSTATUS samr_AddGroupMember(
386                 [in,ref]                  policy_handle *handle,
387                 [in]                      uint32 rid,
388                 [in]                      uint32 flags
389                 );
390
391         /************************/
392         /* Function    0x17     */
393         NTSTATUS samr_DeleteDomainGroup(
394                 [in,out,ref]   policy_handle *handle
395                 );
396
397         /************************/
398         /* Function    0x18     */
399         NTSTATUS samr_DeleteGroupMember(
400                 [in,ref]                  policy_handle *handle,
401                 [in]                      uint32 rid
402                 );
403
404         /************************/
405         /* Function    0x19     */
406         NTSTATUS samr_QUERY_GROUPMEM();
407
408         /************************/
409         /* Function    0x1a     */
410         NTSTATUS samr_SET_MEMBER_ATTRIBUTES_OF_GROUP();
411
412
413         /************************/
414         /* Function    0x1b     */
415         NTSTATUS samr_OpenAlias (
416                 [in,ref]      policy_handle *handle,
417                 [in]          uint32 access_mask,
418                 [in]          uint32 rid,
419                 [out,ref]     policy_handle *acct_handle
420                 );
421
422
423         /************************/
424         /* Function    0x1c     */
425
426         typedef struct {
427                 samr_Name name;
428                 uint32 num_members;
429                 samr_Name description;
430         } samr_AliasInfoAll;
431
432         typedef union {
433                 [case(1)] samr_AliasInfoAll all;
434                 [case(2)] samr_Name name;
435                 [case(3)] samr_Name description;
436         } samr_AliasInfo;
437
438         NTSTATUS samr_QueryAliasInfo(
439                 [in,ref]                  policy_handle *handle,
440                 [in]                      uint16 level,
441                 [out,switch_is(level)]    samr_AliasInfo *info
442                 );
443
444         /************************/
445         /* Function    0x1d     */
446         NTSTATUS samr_SetAliasInfo(
447                 [in,ref]                  policy_handle  *handle,
448                 [in]                      uint16          level,
449                 [in,switch_is(level)]     samr_AliasInfo  info
450                 );
451
452         /************************/
453         /* Function    0x1e     */
454         NTSTATUS samr_DeleteDomAlias(
455                 [in,out,ref]  policy_handle *handle
456                 );
457
458         /************************/
459         /* Function    0x1f     */
460         NTSTATUS samr_AddAliasMem(
461                 [in,ref]  policy_handle *handle,
462                 [in,ref]  dom_sid2      *sid
463                 );
464
465         /************************/
466         /* Function    0x20     */
467         NTSTATUS samr_DelAliasMem(
468                 [in,ref] policy_handle *handle,
469                 [in,ref] dom_sid2      *sid
470                 );
471
472         /************************/
473         /* Function    0x21     */
474         NTSTATUS samr_GetMembersInAlias(
475                 [in,ref]   policy_handle *handle,
476                 [out,ref]  lsa_SidArray    *sids
477                 );
478
479         /************************/
480         /* Function    0x22     */
481         NTSTATUS samr_OpenUser(
482                 [in,ref]      policy_handle *handle,
483                 [in]          uint32 access_mask,
484                 [in]          uint32 rid,
485                 [out,ref]     policy_handle *acct_handle
486                 );
487
488         /************************/
489         /* Function    0x23     */
490         NTSTATUS samr_DeleteUser(
491                 [in,out,ref]   policy_handle *handle
492                 );
493
494         /************************/
495         /* Function    0x24     */
496         typedef struct {
497                 samr_Name username;
498                 samr_Name full_name;
499                 uint32 primary_gid;
500                 samr_Name description;
501                 samr_Name comment;
502         } samr_UserInfo1;
503
504         typedef struct {
505                 samr_Name comment;
506                 samr_Name unknown; /* settable, but doesn't stick. probably obsolete */
507                 uint16 country_code;
508                 uint16 code_page;
509         } samr_UserInfo2;
510
511         typedef struct {
512                 samr_Name username;
513                 samr_Name full_name;
514                 uint32 Rid;
515                 uint32 primary_gid;
516                 samr_Name home_directory;
517                 samr_Name home_drive;
518                 samr_Name logon_script;
519                 samr_Name profile;
520                 samr_Name workstations;
521                 NTTIME last_logon;
522                 NTTIME last_logoff;
523                 NTTIME last_pwd_change;
524                 NTTIME allow_pwd_change;
525                 NTTIME force_pwd_change;
526                 samr_LogonHours logon_hours;
527                 uint16 bad_pwd_count;
528                 uint16 num_logons;
529                 uint32 acct_flags;
530         } samr_UserInfo3;
531
532         typedef struct {
533                 samr_LogonHours logon_hours;
534         } samr_UserInfo4;
535
536         typedef struct {
537                 samr_Name username;
538                 samr_Name full_name;
539                 uint32 rid;
540                 uint32 primary_gid;
541                 samr_Name home_directory;
542                 samr_Name home_drive;
543                 samr_Name logon_script;
544                 samr_Name profile;
545                 samr_Name description;
546                 samr_Name workstations;
547                 NTTIME last_logon;
548                 NTTIME last_logoff;
549                 samr_LogonHours logon_hours;
550                 uint16 bad_pwd_count;
551                 uint16 num_logons;
552                 NTTIME last_pwd_change;
553                 NTTIME acct_expiry;
554                 uint32 acct_flags;
555         } samr_UserInfo5;
556
557         typedef struct {
558                 samr_Name username;
559                 samr_Name full_name;
560         } samr_UserInfo6;
561
562         typedef struct {
563                 samr_Name username;
564         } samr_UserInfo7;
565
566         typedef struct {
567                 samr_Name full_name;
568         } samr_UserInfo8;
569
570         typedef struct {
571                 uint32 primary_gid;
572         } samr_UserInfo9;
573
574         typedef struct {
575                 samr_Name home_dir;
576                 samr_Name home_drive;
577         } samr_UserInfo10;
578
579         typedef struct {
580                 samr_Name logon_script;
581         } samr_UserInfo11;
582
583         typedef struct {
584                 samr_Name profile;
585         } samr_UserInfo12;
586
587         typedef struct {
588                 samr_Name description;
589         } samr_UserInfo13;
590
591         typedef struct {
592                 samr_Name workstations;
593         } samr_UserInfo14;
594
595         typedef struct {
596                 uint32 acct_flags;
597         } samr_UserInfo16;
598         
599         typedef struct {
600                 NTTIME acct_expiry;
601         } samr_UserInfo17;
602
603         typedef struct {
604                 samr_Name callback;
605         } samr_UserInfo20;
606
607         typedef struct {
608                 NTTIME last_logon;
609                 NTTIME last_logoff;
610                 NTTIME last_pwd_change;
611                 NTTIME acct_expiry;
612                 NTTIME allow_pwd_change;
613                 NTTIME force_pwd_change;
614                 samr_Name username;
615                 samr_Name full_name;
616                 samr_Name home_dir;
617                 samr_Name home_drive;
618                 samr_Name logon_script;
619                 samr_Name profile;
620                 samr_Name description;
621                 samr_Name workstations;
622                 samr_Name comment;
623                 samr_Name callback;
624                 samr_Name unknown1;
625                 samr_Name unknown2;
626                 samr_Name unknown3;
627                 uint32 buf_count;
628                 [size_is(buf_count)] uint8 *buffer;
629                 uint32 rid;
630                 uint32 primary_gid;
631                 uint32 acct_flags;
632                 uint32 fields_present;
633                 samr_LogonHours logon_hours;
634                 uint16 bad_pwd_count;
635                 uint16 num_logons;
636                 uint16 country_code;
637                 uint16 code_page;
638                 uint8  nt_pwd_set;
639                 uint8  lm_pwd_set;
640                 uint8  expired_flag;
641                 uint8  unknown4;
642         } samr_UserInfo21;
643
644         typedef [flag(NDR_PAHEX)] struct {
645                 uint8 data[516];
646         } samr_CryptPassword;
647
648         typedef struct {
649                 samr_CryptPassword password;
650                 uint16 pw_len;
651         } samr_UserInfo24;
652
653         typedef union {
654                 [case(1)] samr_UserInfo1 info1;
655                 [case(2)] samr_UserInfo2 info2;
656                 [case(3)] samr_UserInfo3 info3;
657                 [case(4)] samr_UserInfo4 info4;
658                 [case(5)] samr_UserInfo5 info5;
659                 [case(6)] samr_UserInfo6 info6;
660                 [case(7)] samr_UserInfo7 info7;
661                 [case(8)] samr_UserInfo8 info8;
662                 [case(9)] samr_UserInfo9 info9;
663                 [case(10)] samr_UserInfo10 info10;
664                 [case(11)] samr_UserInfo11 info11;
665                 [case(12)] samr_UserInfo12 info12;
666                 [case(13)] samr_UserInfo13 info13;
667                 [case(14)] samr_UserInfo14 info14;
668                 [case(16)] samr_UserInfo16 info16;
669                 [case(17)] samr_UserInfo17 info17;
670                 [case(20)] samr_UserInfo20 info20;
671                 [case(21)] samr_UserInfo21 info21;
672                 [case(24)] samr_UserInfo24 info24;
673         } samr_UserInfo;
674
675         NTSTATUS samr_QueryUserInfo(
676                 [in,ref]                  policy_handle *handle,
677                 [in]                      uint16 level,
678                 [out,switch_is(level)]    samr_UserInfo *info
679                 );
680
681
682         /************************/
683         /* Function    0x25     */
684         NTSTATUS samr_SetUserInfo(
685                 [in,ref]                   policy_handle *handle,
686                 [in]                       uint16 level,
687                 [in,ref,switch_is(level)]  samr_UserInfo *info
688                 );
689
690         /************************/
691         /* Function    0x26     */
692         
693         typedef [flag(NDR_PAHEX)] struct {
694                 uint8 hash[16];
695         } samr_Hash;
696
697         /*
698           this interface is quite mysterious. I can make w2k3 give me
699           NT_STATUS_PASSWORD_RESTRICTION and NT_STATUS_WRONG_PASSWORD
700           with various options, but so far I haven't managed a successful
701           password change. Perhaps this interface is disabled now?
702           Needs testing against NT4
703         */
704         NTSTATUS samr_ChangePasswordUser(
705                 [in,ref]    policy_handle *handle,
706                 [in]        bool8 unknown1,
707                 [in]        samr_Hash *hash1,
708                 [in]        samr_Hash *hash2,
709                 [in]        bool8 unknown2,
710                 [in]        samr_Hash *hash3,
711                 [in]        samr_Hash *hash4,
712                 [in]        bool8 unknown3,
713                 [in]        samr_Hash *hash5,
714                 [in]        bool8 unknown4,
715                 [in]        samr_Hash *hash6
716                 );
717
718         /************************/
719         /* Function    0x27     */
720
721         typedef struct {
722                 uint32 rid;
723                 uint32 type;
724         } samr_RidType;
725
726         typedef struct {
727                 uint32     count;
728                 [size_is(count)] samr_RidType *rid;
729         } samr_RidArray;
730
731         NTSTATUS samr_GetGroupsForUser(
732                 [in,ref]   policy_handle *handle,
733                 [out]      samr_RidArray  *rids
734                 );
735
736         /************************/
737         /* Function    0x28     */
738
739         typedef struct {
740                 uint32    idx;
741                 uint32    rid;
742                 uint32    acct_flags;
743                 samr_Name account_name;
744                 samr_Name full_name;
745                 samr_Name description;
746         } samr_DispEntryGeneral;
747
748         typedef struct {
749                 uint32 count;
750                 [size_is(count)] samr_DispEntryGeneral *entries;
751         } samr_DispInfoGeneral;
752
753         typedef struct {
754                 uint32    idx;
755                 uint32    rid;
756                 uint32    acct_flags;
757                 samr_Name account_name;
758                 samr_Name description;
759         } samr_DispEntryFull;
760
761         typedef struct {
762                 uint32 count;
763                 [size_is(count)] samr_DispEntryFull *entries;
764         } samr_DispInfoFull;
765
766         typedef struct {
767                 [value(strlen_m(r->name))] uint16 name_len;
768                 [value(strlen_m(r->name))] uint16 name_size;
769                 ascstr_noterm *name;
770         } samr_AsciiName;       
771
772         typedef struct {
773                 uint32    idx;
774                 samr_AsciiName account_name;
775         } samr_DispEntryAscii;
776
777         typedef struct {
778                 uint32 count;
779                 [size_is(count)] samr_DispEntryAscii *entries;
780         } samr_DispInfoAscii;
781
782         typedef union {
783                 [case(1)] samr_DispInfoGeneral info1;/* users */
784                 [case(2)] samr_DispInfoFull info2; /* trust accounts? */
785                 [case(3)] samr_DispInfoFull info3; /* groups */
786                 [case(4)] samr_DispInfoAscii info4; /* users */
787                 [case(5)] samr_DispInfoAscii info5; /* groups */
788         } samr_DispInfo;
789
790         NTSTATUS samr_QueryDisplayInfo(
791                 [in,ref]    policy_handle *handle,
792                 [in]        uint16 level,
793                 [in]        uint32 start_idx,
794                 [in]        uint32 max_entries,
795                 [in]        uint32 buf_size,
796                 [out]       uint32 total_size,
797                 [out]       uint32 returned_size,
798                 [out,switch_is(level)] samr_DispInfo info
799                 );
800
801
802         /************************/
803         /* Function    0x29     */
804
805         /*
806           this seems to be an alphabetic search function. The returned index
807           is the index for samr_QueryDisplayInfo needed to get names occurring
808           after the specified name. The supplied name does not need to exist
809           in the database (for example you can supply just a first letter for 
810           searching starting at that letter)
811
812           The level corresponds to the samr_QueryDisplayInfo level
813         */
814         NTSTATUS samr_GetDisplayEnumerationIndex(
815                 [in,ref]    policy_handle *handle,
816                 [in]        uint16 level,
817                 [in]        samr_Name name,
818                 [out]       uint32 idx
819                 );
820
821
822
823         /************************/
824         /* Function    0x2a     */
825
826         /*
827           w2k3 return NT_STATUS_NOT_IMPLEMENTED for this
828         */
829         NTSTATUS samr_TestPrivateFunctionsDomain(
830                 [in,ref]    policy_handle *handle
831                 );
832
833
834         /************************/
835         /* Function    0x2b     */
836
837         /*
838           w2k3 return NT_STATUS_NOT_IMPLEMENTED for this
839         */
840         NTSTATUS samr_TestPrivateFunctionsUser(
841                 [in,ref]    policy_handle *handle
842                 );
843
844
845         /************************/
846         /* Function    0x2c     */
847
848         /* password properties flags */
849         const uint32 DOMAIN_PASSWORD_COMPLEX         = 0x00000001;
850         const uint32 DOMAIN_PASSWORD_NO_ANON_CHANGE  = 0x00000002;
851         const uint32 DOMAIN_PASSWORD_NO_CLEAR_CHANGE = 0x00000004;
852         const uint32 DOMAIN_PASSWORD_STORE_CLEARTEXT = 0x00000010;
853         const uint32 DOMAIN_REFUSE_PASSWORD_CHANGE   = 0x00000020;
854
855         typedef struct {
856                 uint16 min_pwd_len;
857                 uint32 password_properties;
858         } samr_PwInfo;
859
860         NTSTATUS samr_GetUserPwInfo(
861                 [in,ref]    policy_handle *handle,
862                 [out]       samr_PwInfo info
863                 );
864
865         /************************/
866         /* Function    0x2d     */
867         NTSTATUS samr_RemoveMemberFromForeignDomain(
868                 [in,ref]    policy_handle *handle,
869                 [in,ref]    dom_sid2 *sid
870                 );
871
872         /************************/
873         /* Function    0x2e     */
874
875         /*
876           how is this different from QueryDomainInfo ??
877         */
878         NTSTATUS samr_QueryDomainInfo2(
879                 [in,ref]      policy_handle *handle,
880                 [in]          uint16 level,
881                 [out,switch_is(level)] samr_DomainInfo *info
882                 );
883
884         /************************/
885         /* Function    0x2f     */
886
887         /*
888           how is this different from QueryUserInfo ??
889         */
890         NTSTATUS samr_QueryUserInfo2(
891                 [in,ref]                  policy_handle *handle,
892                 [in]                      uint16 level,
893                 [out,switch_is(level)]    samr_UserInfo *info
894                 );
895
896         /************************/
897         /* Function    0x30     */
898
899         /*
900           how is this different from QueryDisplayInfo??
901         */
902         NTSTATUS samr_QueryDisplayInfo2(
903                 [in,ref]    policy_handle *handle,
904                 [in]        uint16 level,
905                 [in]        uint32 start_idx,
906                 [in]        uint32 max_entries,
907                 [in]        uint32 buf_size,
908                 [out]       uint32 total_size,
909                 [out]       uint32 returned_size,
910                 [out,switch_is(level)] samr_DispInfo info
911                 );
912
913         /************************/
914         /* Function    0x31     */
915
916         /*
917           how is this different from GetDisplayEnumerationIndex ??
918         */
919         NTSTATUS samr_GetDisplayEnumerationIndex2(
920                 [in,ref]    policy_handle *handle,
921                 [in]        uint16 level,
922                 [in]        samr_Name name,
923                 [out]       uint32 idx
924                 );
925
926
927         /************************/
928         /* Function    0x32     */
929         NTSTATUS samr_CreateUser2(
930         /************************/
931                 [in,ref]      policy_handle *handle,
932                 [in,ref]      samr_Name *username,
933                 [in]          uint32 acct_flags,
934                 [in]          uint32 access_mask,
935                 [out,ref]     policy_handle *acct_handle,
936                 [out,ref]     uint32 *access_granted,
937                 [out,ref]     uint32 *rid
938                 );
939
940
941         /************************/
942         /* Function    0x33     */
943
944         /*
945           another duplicate. There must be a reason ....
946         */
947         NTSTATUS samr_QueryDisplayInfo3(
948                 [in,ref]    policy_handle *handle,
949                 [in]        uint16 level,
950                 [in]        uint32 start_idx,
951                 [in]        uint32 max_entries,
952                 [in]        uint32 buf_size,
953                 [out]       uint32 total_size,
954                 [out]       uint32 returned_size,
955                 [out,switch_is(level)] samr_DispInfo info
956                 );
957
958         /************************/
959         /* Function    0x34     */
960         NTSTATUS samr_AddMultipleMembersToAlias(
961                 [in,ref]    policy_handle *handle,
962                 [in,ref]    lsa_SidArray *sids
963                 );
964
965         /************************/
966         /* Function    0x35     */
967         NTSTATUS samr_RemoveMultipleMembersFromAlias(
968                 [in,ref]    policy_handle *handle,
969                 [in,ref]    lsa_SidArray *sids
970                 );
971
972         /************************/
973         /* Function    0x36     */
974
975         NTSTATUS samr_OemChangePasswordUser2(
976                 [in]              samr_AsciiName *server,
977                 [in,ref]          samr_AsciiName *account,
978                 [in]              samr_CryptPassword *password,
979                 [in]              samr_Hash *hash
980                 );
981
982         /************************/
983         /* Function    0x37     */
984         NTSTATUS samr_ChangePasswordUser2(
985                 [in]              samr_Name *server,
986                 [in,ref]          samr_Name *account,
987                 [in]              samr_CryptPassword *nt_password,
988                 [in]              samr_Hash *nt_verifier,
989                 [in]              bool8 lm_change,
990                 [in]              samr_CryptPassword *lm_password,
991                 [in]              samr_Hash *lm_verifier
992                 );
993
994         /************************/
995         /* Function    0x38     */
996         NTSTATUS samr_GetDomPwInfo(
997                 [in]        samr_Name *name,
998                 [out]       samr_PwInfo info
999                 );
1000
1001         /************************/
1002         /* Function    0x39     */
1003         NTSTATUS samr_Connect2(
1004                 [in] unistr *system_name,
1005                 [in] uint32 access_mask,
1006                 [out,ref]  policy_handle *handle
1007                 );
1008
1009         /************************/
1010         /* Function    0x3a     */
1011         /*
1012           seems to be an exact alias for samr_SetUserInfo() 
1013         */
1014         NTSTATUS samr_SetUserInfo2(
1015                 [in,ref]                   policy_handle *handle,
1016                 [in]                       uint16 level,
1017                 [in,ref,switch_is(level)]  samr_UserInfo *info
1018                 );
1019
1020         /************************/
1021         /* Function    0x3b     */
1022         /*
1023           this one is mysterious. I have a few guesses, but nothing working yet
1024         */
1025         NTSTATUS samr_SetBootKeyInformation(
1026                 [in,ref]   policy_handle *handle
1027                 [in]       uint32 unknown1,
1028                 [in]       uint32 unknown2,
1029                 [in]       uint32 unknown3
1030                 );
1031
1032         /************************/
1033         /* Function    0x3c     */
1034         NTSTATUS samr_GetBootKeyInformation(
1035                 [in,ref]   policy_handle *handle,
1036                 [out]      uint32 unknown
1037                 );
1038
1039         /************************/
1040         /* Function    0x3d     */
1041         NTSTATUS samr_Connect3(
1042                 [in] unistr *system_name,
1043                 [in] uint32 unknown,
1044                 [in] uint32 access_mask,
1045                 [out,ref]  policy_handle *handle
1046                 );
1047
1048         /************************/
1049         /* Function    0x3e     */
1050         NTSTATUS samr_Connect4(
1051                 [in] unistr *system_name,
1052                 [in] uint32 unknown,
1053                 [in] uint32 access_mask,
1054                 [out,ref]  policy_handle *handle
1055                 );
1056
1057         /************************/
1058         /* Function    0x3f     */
1059         NTSTATUS samr_UNICODE_CHANGE_PASSWORD_USER3();
1060
1061         /************************/
1062         /* Function    0x40      */
1063         NTSTATUS samr_Connect5(
1064                 [in]       unistr        *system_name,
1065                 [in]       uint32         access_mask,
1066                 [in]       uint32         unknown0,
1067                 [in]       uint32         unknown1,
1068                 [in]       uint32         unknown2,
1069                 [in]       uint32         unknown3,
1070                 [out]      uint32         unknown4,
1071                 [out]      uint32         unknown5,
1072                 [out]      uint32         unknown6,
1073                 [out]      uint32         unknown7,
1074                 [out,ref]  policy_handle *handle
1075                 );
1076
1077         /************************/
1078         /* Function    0x41     */
1079         NTSTATUS samr_RidToSid(
1080                 [in,ref]    policy_handle *handle,
1081                 [in]        uint32        rid,
1082                 [out]       dom_sid2      *sid
1083                 );
1084
1085         /************************/
1086         /* Function    0x42     */
1087         NTSTATUS samr_SET_DSRM_PASSWORD();
1088
1089         /************************/
1090         /* Function    0x43     */
1091         NTSTATUS samr_VALIDATE_PASSWORD();
1092
1093 }