summaryrefslogtreecommitdiff
path: root/source4/librpc/idl/samr.idl
blob: 7fc2847620e70d78af2c0b8a1db36744f24a3697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
/*
  samr interface definition

*/

/*
  Thanks to Todd Sabin for some information from his samr.idl in acltools
*/

[ uuid(12345778-1234-abcd-ef00-0123456789ac),
  version(1.0),
  pointer_default(unique)
] interface samr
{
	/******************/
	/* Function: 0x00 */
	NTSTATUS samr_Connect (
		/* notice the lack of [string] */
		[in]       uint16 *system_name,
		[in]       uint32 access_mask,
		[out,ref]  policy_handle *handle
		);


	/******************/
	/* Function: 0x01 */
	NTSTATUS samr_Close (
		[in,out,ref]  policy_handle *handle
		);

	/******************/
	/* Function: 0x02 */
	NTSTATUS samr_SetSecurity ();

	/******************/
	/* Function: 0x03 */

	typedef struct {
		uint32 sd_size;
		[subcontext] security_descriptor *sd;
	} samr_SdBuf;

	NTSTATUS samr_QuerySecurity (
		[in,ref]          policy_handle *handle,
		[in]              uint32 sec_info,
		[out]             samr_SdBuf *sdbuf
		);

	/******************/
	/* Function: 0x04 */
	NTSTATUS samr_Shutdown ();

	/******************/
	/* Function: 0x05 */
	typedef struct {
		[value(2*strlen_m(r->name))] uint16 name_len;
		[value(2*strlen_m(r->name))] uint16 name_size;
		unistr_noterm *name;
	} samr_Name;	

	NTSTATUS samr_LookupDomain (
		[in,ref]  policy_handle *handle,		
		[in,ref]  samr_Name *domain,
		[out]     dom_sid2 *sid
		);


	/******************/
	/* Function: 0x06 */

	typedef struct {
		uint32 idx;
		samr_Name name;
	} samr_SamEntry;

	typedef struct {
		uint32 count;
		[size_is(count)] samr_SamEntry *entries;
	} samr_SamArray;

	NTSTATUS samr_EnumDomains (
		[in,ref]      policy_handle *handle,
		[in,out,ref]  uint32 *resume_handle,
		[in]          uint32 buf_size,
		[out]         samr_SamArray *sam,
		[out,ref]     uint32 *num_entries
		);


	/************************/
	/* Function    0x07     */
	NTSTATUS samr_OpenDomain(
		[in,ref]      policy_handle *handle,
		[in]          uint32 access_mask,
		[in,ref]      dom_sid2 *sid,
		[out,ref]     policy_handle *domain_handle
		);

	/************************/
	/* Function    0x08     */

	typedef struct {
		uint16 min_length_password;
		uint16 password_history;
		uint32 flag;
		NTTIME expire;
		NTTIME min_passwordage;
	} samr_DomInfo1;

	typedef struct {
		HYPER_T force_logoff_time;
		samr_Name unknown1;
		samr_Name domain;  /* domain name */
		samr_Name primary; /* PDC name if this is a BDC */
		HYPER_T sequence_num;
		uint32 unknown2;
		uint32 role;
		uint32 unknown3;
		uint32 num_users;
		uint32 num_groups;
		uint32 num_aliases;
	} samr_DomInfo2;

	typedef struct {
		HYPER_T force_logoff_time;
	} samr_DomInfo3;

	typedef struct {
		samr_Name unknown;
	} samr_DomInfo4;

	typedef struct {
		samr_Name domain;
	} samr_DomInfo5;

	typedef struct {
		samr_Name primary;
	} samr_DomInfo6;

	typedef struct {
		uint32 role;
	} samr_DomInfo7;

	typedef struct {
		HYPER_T sequence_num;
		NTTIME last_xxx_time;
	} samr_DomInfo8;

	typedef struct {
		uint32 unknown;
	} samr_DomInfo9;

	typedef struct {
		HYPER_T force_logoff_time;
		samr_Name unknown1;
		samr_Name domain;
		samr_Name primary;
		HYPER_T sequence_num;
		uint32 unknown2;
		uint32 role;
		uint32 unknown3;
		uint32 num_users;
		uint32 num_groups;
		uint32 num_aliases;
		HYPER_T lockout_duration;
		HYPER_T lockout_window;
		uint16 lockout_threshold;
	} samr_DomInfo11;

	typedef struct {
		HYPER_T lockout_duration;
		HYPER_T lockout_window;
		uint16 lockout_threshold;
	} samr_DomInfo12;

	typedef struct {
		HYPER_T sequence_num;
		NTTIME last_xxx_time;
		uint32 unknown1;
		uint32 unknown2;
	} samr_DomInfo13;

	typedef union {
		[case(1)] samr_DomInfo1 info1;
		[case(2)] samr_DomInfo2 info2;
		[case(3)] samr_DomInfo3 info3;
		[case(4)] samr_DomInfo4 info4;
		[case(5)] samr_DomInfo5 info5;
		[case(6)] samr_DomInfo6 info6;
		[case(7)] samr_DomInfo7 info7;
		[case(8)] samr_DomInfo8 info8;
		[case(9)] samr_DomInfo9 info9;
		[case(11)] samr_DomInfo11 info11;
		[case(12)] samr_DomInfo12 info12;
		[case(13)] samr_DomInfo13 info13;
	} samr_DomainInfo;

	NTSTATUS samr_QueryDomainInfo(
		[in,ref]      policy_handle *handle,
		[in]          uint16 level,
		[out,switch_is(level)] samr_DomainInfo *info
		);

	/************************/
	/* Function    0x09     */
	NTSTATUS samr_SET_DOMAIN_INFO();

	/************************/
	/* Function    0x0a     */
	NTSTATUS samr_CREATE_DOM_GROUP();

	/************************/
	/* Function    0x0b     */
	NTSTATUS samr_EnumDomainGroups(
		[in,ref]      policy_handle *handle,
		[in,out,ref]  uint32 *resume_handle,
		[in]          uint32 max_size,
		[out]         samr_SamArray *sam,
		[out,ref]     uint32 num_entries
		);

	/************************/
	/* Function    0x0c     */
	NTSTATUS samr_CreateUser(
		[in,ref]      policy_handle *handle,
		[in,ref]      samr_Name *username,
		[in]          uint32 access_mask,
		[out,ref]     policy_handle *acct_handle,
		[out,ref]     uint32 *rid
		);

	/************************/
	/* Function    0x0d     */
	NTSTATUS samr_EnumDomainUsers(
		[in,ref]      policy_handle *handle,
		[in,out,ref]  uint32 *resume_handle,
		[in]          uint32 acct_flags,
		[in]          uint32 max_size,
		[out]         samr_SamArray *sam,
		[out,ref]     uint32 num_entries
		);

	/************************/
	/* Function    0x0e     */
	NTSTATUS samr_CREATE_DOM_ALIAS();

	/************************/
	/* Function    0x0f     */
	NTSTATUS samr_EnumDomainAliases(
		[in,ref]      policy_handle *handle,
		[in,out,ref]  uint32 *resume_handle,
		[in]          uint32 max_size,
		[out]         samr_SamArray *sam,
		[out,ref]     uint32 num_entries
		);

	/************************/
	/* Function    0x10     */

	typedef struct {
		uint32 count;
		[size_is(count)] dom_sid2 *sids;
	} samr_Sids;

	typedef struct {
		uint32 count;
		[size_is(count)] uint32 *rids;
	} samr_Rids;

	NTSTATUS samr_GetAliasMembership(
		[in,ref]      policy_handle *handle,
		[in]          samr_Sids *sids,
		[out]         samr_Rids *rids
		);

	/************************/
	/* Function    0x11     */
	NTSTATUS samr_LOOKUP_NAMES();

	/************************/
	/* Function    0x12     */
	NTSTATUS samr_LOOKUP_RIDS();

	/************************/
	/* Function    0x13     */
	NTSTATUS samr_OpenGroup(
		[in,ref]      policy_handle *handle,
		[in]          uint32 access_mask,
		[in]          uint32 rid,
		[out,ref]     policy_handle *acct_handle
		);


	/************************/
	/* Function    0x14     */

	typedef struct {
		samr_Name name;
		uint32 unknown;
		uint32 num_members;
		samr_Name description;
	} samr_GroupInfoAll;

	typedef struct {
		samr_Name Name;
	} samr_GroupInfoName;

	typedef struct {
		uint32 unknown;
	} samr_GroupInfoX;

	typedef struct {
		samr_Name description;
	} samr_GroupInfoDesciption;

	typedef union {
		[case(1)] samr_GroupInfoAll all;
		[case(2)] samr_GroupInfoName name;
		[case(3)] samr_GroupInfoX unknown;
		[case(4)] samr_GroupInfoDesciption description;
	} samr_GroupInfo;

	NTSTATUS samr_QueryGroupInfo(
		[in,ref]                  policy_handle *handle,
		[in]                      uint16 level,
		[out,switch_is(level)]    samr_GroupInfo *info
		);

	/************************/
	/* Function    0x15     */
	NTSTATUS samr_SET_GROUPINFO();

	/************************/
	/* Function    0x16     */
	NTSTATUS samr_ADD_GROUPMEM();

	/************************/
	/* Function    0x17     */
	NTSTATUS samr_DELETE_DOM_GROUP();

	/************************/
	/* Function    0x18     */
	NTSTATUS samr_DEL_GROUPMEM();

	/************************/
	/* Function    0x19     */
	NTSTATUS samr_QUERY_GROUPMEM();

	/************************/
	/* Function    0x1a     */
	NTSTATUS samr_SET_MEMBER_ATTRIBUTES_OF_GROUP();


	/************************/
	/* Function    0x1b     */
	NTSTATUS samr_OpenAlias (
		[in,ref]      policy_handle *handle,
		[in]          uint32 access_mask,
		[in]          uint32 rid,
		[out,ref]     policy_handle *acct_handle
		);


	/************************/
	/* Function    0x1c     */

	typedef struct {
		samr_Name name;
		uint32 num_members;
		samr_Name description;
	} samr_AliasInfoAll;

	typedef struct {
		samr_Name name;
	} samr_AliasInfoName;

	typedef struct {
		samr_Name description;
	} samr_AliasInfoDescription;

	typedef union {
		[case(1)] samr_AliasInfoAll all;
		[case(2)] samr_AliasInfoName name;
		[case(3)] samr_AliasInfoDescription description;
	} samr_AliasInfo;

	NTSTATUS samr_QueryAliasInfo(
		[in,ref]                  policy_handle *handle,
		[in]                      uint16 level,
		[out,switch_is(level)]    samr_AliasInfo *info
		);

	/************************/
	/* Function    0x1d     */
	NTSTATUS samr_SET_ALIASINFO();

	/************************/
	/* Function    0x1e     */
	NTSTATUS samr_DELETE_DOM_ALIAS();

	/************************/
	/* Function    0x1f     */
	NTSTATUS samr_ADD_ALIASMEM();

	/************************/
	/* Function    0x20     */
	NTSTATUS samr_DEL_ALIASMEM();

	/************************/
	/* Function    0x21     */
	NTSTATUS samr_GET_MEMBERS_IN_ALIAS();

	/************************/
	/* Function    0x22     */
	NTSTATUS samr_OpenUser(
		[in,ref]      policy_handle *handle,
		[in]          uint32 access_mask,
		[in]          uint32 rid,
		[out,ref]     policy_handle *acct_handle
		);

	/************************/
	/* Function    0x23     */
	NTSTATUS samr_DeleteUser(
		[in,out,ref]   policy_handle *handle
		);

	/************************/
	/* Function    0x24     */
	typedef struct {
		samr_Name username;
		samr_Name full_name;
		uint32 primary_group_rid;
		samr_Name description;
		samr_Name comment;
	} samr_UserInfo1;

	typedef struct {
		samr_Name comment;
		uint32 unknown1;
		uint32 unknown2;
		uint16 country_code;
		uint16 code_page;
	} samr_UserInfo2;

	typedef struct {
		samr_Name username;
		samr_Name full_name;
		uint32 Rid;
		uint32 primary_group_rid;
		samr_Name home_directory;
		samr_Name home_drive;
		samr_Name logon_script;
		samr_Name profile;
		samr_Name workstations;
		NTTIME last_logon;
		NTTIME last_logoff;
		NTTIME last_pwd_change;
		NTTIME allow_pwd_change;
		NTTIME force_pwd_change;
		uint32 units_per_week;
		[size_is(1260), length_is(units_per_week/8)] uint8 *logon_hours;
		uint16 bad_pwd_count;
		uint16 num_logons;
		uint32 acct_flags;
	} samr_UserInfo3;

	typedef struct {
		uint32 units_per_week;
		[size_is(1260), length_is(units_per_week/8)] uint8 *logon_hours;
	} samr_UserInfo4;

	typedef struct {
		samr_Name username;
		samr_Name full_name;
		uint32 rid;
		uint32 primary_group_rid;
		samr_Name home_directory;
		samr_Name home_drive;
		samr_Name logon_script;
		samr_Name profile;
		samr_Name descriptiom;
		samr_Name workstations;
		NTTIME last_logon;
		NTTIME last_logoff;
		uint32 units_per_week;
		[size_is(1260), length_is(units_per_week/8)] uint8 *logon_hours;
		uint16 bad_pwd_count;
		uint16 num_logons;
		NTTIME last_pwd_change;
		NTTIME acct_expiry;
		uint32 acct_flags;
	} samr_UserInfo5;

	typedef struct {
		samr_Name username;
		samr_Name full_name;
	} samr_UserInfo6;

	typedef struct {
		samr_Name username;
	} samr_UserInfo7;

	typedef struct {
		samr_Name full_name;
	} samr_UserInfo8;

	typedef struct {
		uint32 PrimaryGroupRid;
	} samr_UserInfo9;

	typedef struct {
		samr_Name home_dir;
		samr_Name home_drive;
	} samr_UserInfo10;

	typedef struct {
		samr_Name logon_script;
	} samr_UserInfo11;

	typedef struct {
		samr_Name profile;
	} samr_UserInfo12;

	typedef struct {
		samr_Name descriptiom;
	} samr_UserInfo13;

	typedef struct {
		samr_Name workstations;
	} samr_UserInfo14;

	typedef struct {
		uint32 acct_flags;
	} samr_UserInfo16;
	
	typedef struct {
		NTTIME acct_expiry;
	} samr_UserInfo17;

	typedef struct {
		samr_Name callback;
	} samr_UserInfo20;

	typedef struct {
		NTTIME last_logon;
		NTTIME last_logoff;
		NTTIME last_pwd_change;
		NTTIME acct_expiry;
		NTTIME allow_pwd_change;
		NTTIME force_pwd_change;
		samr_Name username;
		samr_Name full_name;
		samr_Name home_dir;
		samr_Name home_drive;
		samr_Name logon_script;
		samr_Name profile;
		samr_Name description;
		samr_Name workstations;
		samr_Name comment;
		samr_Name callback;
		samr_Name unknown1;
		samr_Name unknown2;
		samr_Name unknown3;
		uint32 buf_count;
		[size_is(buf_count)] uint8 *buffer;
		uint32 rid;
		uint32 primary_group_rid;
		uint32 acct_flags;
		uint32 fields_present;
		uint32 units_per_week;
		[size_is(1260), length_is(units_per_week/8)] uint8 *logon_hours;
		uint16 bad_pwd_count;
		uint16 num_logons;
		uint16 country_code;
		uint16 code_page;
		uint8  nt_pwd_set;
		uint8  lm_pwd_set;
		uint8  expired_flag;
		uint8  unknown4;
	} samr_UserInfo21;

	typedef union {
		[case(1)] samr_UserInfo1 info1;
		[case(2)] samr_UserInfo2 info2;
		[case(3)] samr_UserInfo3 info3;
		[case(4)] samr_UserInfo4 info4;
		[case(5)] samr_UserInfo5 info5;
		[case(6)] samr_UserInfo6 info6;
		[case(7)] samr_UserInfo7 info7;
		[case(8)] samr_UserInfo8 info8;
		[case(9)] samr_UserInfo9 info9;
		[case(10)] samr_UserInfo10 info10;
		[case(11)] samr_UserInfo11 info11;
		[case(12)] samr_UserInfo12 info12;
		[case(13)] samr_UserInfo13 info13;
		[case(14)] samr_UserInfo14 info14;
		[case(16)] samr_UserInfo16 info16;
		[case(17)] samr_UserInfo17 info17;
		[case(20)] samr_UserInfo20 info20;
		[case(21)] samr_UserInfo21 info21;
	} samr_UserInfo;

	NTSTATUS samr_QueryUserInfo(
		[in,ref]                  policy_handle *handle,
		[in]                      uint16 level,
		[out,switch_is(level)]    samr_UserInfo *info
		);

	/************************/
	/* Function    0x25     */
	NTSTATUS samr_SET_USERINFO();

	/************************/
	/* Function    0x26     */
	NTSTATUS samr_CHANGE_PASSWORD_USER();

	/************************/
	/* Function    0x27     */
	NTSTATUS samr_GET_GROUPS_FOR_USER();

	/************************/
	/* Function    0x28     */
	NTSTATUS samr_QUERY_DISPINFO();

	/************************/
	/* Function    0x29     */
	NTSTATUS samr_GET_DISPLAY_ENUMERATION_INDEX();

	/************************/
	/* Function    0x2a     */
	NTSTATUS samr_TEST_PRIVATE_FUNCTIONS_DOMAIN();

	/************************/
	/* Function    0x2b     */
	NTSTATUS samr_TEST_PRIVATE_FUNCTIONS_USER();

	/************************/
	/* Function    0x2c     */
	NTSTATUS samr_GET_USRDOM_PWINFO();

	/************************/
	/* Function    0x2d     */
	NTSTATUS samr_REMOVE_MEMBER_FROM_FOREIGN_DOMAIN();

	/************************/
	/* Function    0x2e     */
	NTSTATUS samr_QUERY_INFORMATION_DOMAIN2();

	/************************/
	/* Function    0x2f     */
	NTSTATUS samr_QUERY_INFORMATION_USER2();

	/************************/
	/* Function    0x30     */
	NTSTATUS samr_QUERY_DISPINFO2();

	/************************/
	/* Function    0x31     */
	NTSTATUS samr_GET_DISPLAY_ENUMERATION_INDEX2();

	/************************/
	/* Function    0x32     */
	NTSTATUS samr_CREATE_USER2_IN_DOMAIN();

	/************************/
	/* Function    0x33     */
	NTSTATUS samr_QUERY_DISPINFO3();

	/************************/
	/* Function    0x34     */
	NTSTATUS samr_ADD_MULTIPLE_MEMBERS_TO_ALIAS();

	/************************/
	/* Function    0x35     */
	NTSTATUS samr_REMOVE_MULTIPLE_MEMBERS_FROM_ALIAS();

	/************************/
	/* Function    0x36     */
	NTSTATUS samr_OEM_CHANGE_PASSWORD_USER2();

	/************************/
	/* Function    0x37     */
	NTSTATUS samr_UNICODE_CHANGE_PASSWORD_USER2();

	/************************/
	/* Function    0x38     */
	NTSTATUS samr_GET_DOM_PWINFO();

	/************************/
	/* Function    0x39     */
	NTSTATUS samr_CONNECT2();

	/************************/
	/* Function    0x3a     */
	NTSTATUS samr_SET_USERINFO2();

	/************************/
	/* Function    0x3b     */
	NTSTATUS samr_SET_BOOT_KEY_INFORMATION();

	/************************/
	/* Function    0x3c     */
	NTSTATUS samr_GET_BOOT_KEY_INFORMATION();

	/************************/
	/* Function    0x3d     */
	NTSTATUS samr_CONNECT3();

	/************************/
	/* Function    0x3e     */
	NTSTATUS samr_Connect4(
		[in] unistr *system_name,
		[in] uint32 unknown,
		[in] uint32 access_mask,
		[out,ref]  policy_handle *handle
		);

	/************************/
	/* Function    0x3f     */
	NTSTATUS samr_UNICODE_CHANGE_PASSWORD_USER3();

	/************************/
	/* Function    0x40      */
	NTSTATUS samr_CONNECT5();

	/************************/
	/* Function    0x41     */
	NTSTATUS samr_RID_TO_SID();

	/************************/
	/* Function    0x42     */
	NTSTATUS samr_SET_DSRM_PASSWORD();

	/************************/
	/* Function    0x43     */
	NTSTATUS samr_VALIDATE_PASSWORD();

}