added samr_UserInfo2 and samr_UserInfo3
[samba.git] / source / librpc / idl / samr.idl
1 /*
2   samr interface definition
3 */
4
5 [ uuid(12345778-1234-abcd-ef00-0123456789ac),
6   version(1.0),
7   pointer_default(unique)
8 ] interface lsarpc
9 {
10         /******************/
11         /* Function: 0x00 */
12         NTSTATUS samr_Connect (
13                 /* notice the lack of [string] */
14                 [in]       uint16 *system_name,
15                 [in]       uint32 access_mask,
16                 [out,ref]  policy_handle *handle
17                 );
18
19
20         /******************/
21         /* Function: 0x01 */
22         NTSTATUS samr_Close ();
23
24         /******************/
25         /* Function: 0x02 */
26         NTSTATUS samr_SetSecurity ();
27
28         /******************/
29         /* Function: 0x03 */
30         NTSTATUS samr_QuerySecurity ();
31
32         /******************/
33         /* Function: 0x04 */
34         NTSTATUS samr_Shutdown ();
35
36         /******************/
37         /* Function: 0x05 */
38         typedef struct {
39                 [value(2*strlen_m(r->name))] uint16 name_len;
40                 [value(2*strlen_m(r->name))] uint16 name_size;
41                 unistr_noterm *name;
42         } samr_Name;    
43
44         NTSTATUS samr_LookupDomain (
45                 [in,ref]  policy_handle *handle,                
46                 [in,ref]  samr_Name *domain,
47                 [out]     dom_sid2 *sid
48                 );
49
50
51         /******************/
52         /* Function: 0x06 */
53
54         typedef struct {
55                 uint32 idx;
56                 samr_Name name;
57         } samr_SamEntry;
58
59         typedef struct {
60                 uint32 count;
61                 [size_is(count)] samr_SamEntry *entries;
62         } samr_SamArray;
63
64         NTSTATUS samr_EnumDomains (
65                 [in,ref]      policy_handle *handle,
66                 [in,out,ref]  uint32 *resume_handle,
67                 [in]          uint32 buf_size,
68                 [out]         samr_SamArray *sam,
69                 [out,ref]     uint32 *num_entries
70                 );
71
72
73         /************************/
74         /* Function    0x07     */
75         NTSTATUS samr_OpenDomain(
76                 [in,ref]      policy_handle *handle,
77                 [in]          uint32 access_mask,
78                 [in,ref]      dom_sid2 *sid,
79                 [out,ref]     policy_handle *domain_handle
80                 );
81
82         /************************/
83         /* Function    0x08     */
84
85         typedef struct {
86                 uint16 min_length_password;
87                 uint16 password_history;
88                 uint32 flag;
89                 NTTIME expire;
90                 NTTIME min_passwordage;
91         } samr_DomInfo1;
92
93         typedef struct {
94                 HYPER_T force_logoff_time;
95                 samr_Name unknown_name;
96                 samr_Name domain;  /* domain name */
97                 samr_Name primary; /* PDC name if this is a BDC */
98                 HYPER_T sequence_num;
99                 uint32 unknown_2;
100                 uint32 role;
101                 uint32 unknown_3;
102                 uint32 num_users;
103                 uint32 num_groups;
104                 uint32 num_aliases;
105         } samr_DomInfo2;
106
107         typedef struct {
108                 HYPER_T force_logoff_time;
109         } samr_DomInfo3;
110
111         typedef struct {
112                 samr_Name unknown_name;
113         } samr_DomInfo4;
114
115         typedef struct {
116                 samr_Name domain;
117         } samr_DomInfo5;
118
119         typedef struct {
120                 samr_Name primary;
121         } samr_DomInfo6;
122
123         typedef struct {
124                 uint32 role;
125         } samr_DomInfo7;
126
127         typedef struct {
128                 HYPER_T sequence_num;
129                 NTTIME last_xxx_time;
130         } samr_DomInfo8;
131
132         typedef struct {
133                 uint32 unknown;
134         } samr_DomInfo9;
135
136         typedef struct {
137                 HYPER_T force_logoff_time;
138                 samr_Name unknown_name;
139                 samr_Name domain;
140                 samr_Name primary;
141                 HYPER_T sequence_num;
142                 uint32 unknown_2;
143                 uint32 role;
144                 uint32 unknown_3;
145                 uint32 num_users;
146                 uint32 num_groups;
147                 uint32 num_aliases;
148                 HYPER_T lockout_duration;
149                 HYPER_T lockout_window;
150                 uint16 lockout_threshold;
151         } samr_DomInfo11;
152
153         typedef struct {
154                 HYPER_T lockout_duration;
155                 HYPER_T lockout_window;
156                 uint16 lockout_threshold;
157         } samr_DomInfo12;
158
159         typedef struct {
160                 HYPER_T sequence_num;
161                 NTTIME last_xxx_time;
162                 uint32 foo7;
163                 uint32 foo8;
164         } samr_DomInfo13;
165
166         typedef union {
167                 case(1) samr_DomInfo1 info1;
168                 case(2) samr_DomInfo2 info2;
169                 case(3) samr_DomInfo3 info3;
170                 case(4) samr_DomInfo4 info4;
171                 case(5) samr_DomInfo5 info5;
172                 case(6) samr_DomInfo6 info6;
173                 case(7) samr_DomInfo7 info7;
174                 case(8) samr_DomInfo8 info8;
175                 case(9) samr_DomInfo9 info9;
176                 case(11) samr_DomInfo11 info11;
177                 case(12) samr_DomInfo12 info12;
178                 case(13) samr_DomInfo13 info13;
179         } samr_DomainInfo;
180
181         NTSTATUS samr_QueryDomainInfo(
182                 [in,ref]      policy_handle *handle,
183                 [in]          uint16 level,
184                 [out,switch_is(level)] samr_DomainInfo *info
185                 );
186
187         /************************/
188         /* Function    0x09     */
189         NTSTATUS samr_SET_DOMAIN_INFO();
190
191         /************************/
192         /* Function    0x0a     */
193         NTSTATUS samr_CREATE_DOM_GROUP();
194
195         /************************/
196         /* Function    0x0b     */
197         NTSTATUS samr_EnumDomainGroups(
198                 [in,ref]      policy_handle *handle,
199                 [in,out,ref]  uint32 *resume_handle,
200                 [in]          uint32 max_size,
201                 [out]         samr_SamArray *sam,
202                 [out,ref]     uint32 num_entries
203                 );
204
205         /************************/
206         /* Function    0x0c     */
207         NTSTATUS samr_CREATE_USER_IN_DOMAIN();
208
209         /************************/
210         /* Function    0x0d     */
211         NTSTATUS samr_EnumDomainUsers(
212                 [in,ref]      policy_handle *handle,
213                 [in,out,ref]  uint32 *resume_handle,
214                 [in]          uint32 acct_flags,
215                 [in]          uint32 max_size,
216                 [out]         samr_SamArray *sam,
217                 [out,ref]     uint32 num_entries
218                 );
219
220         /************************/
221         /* Function    0x0e     */
222         NTSTATUS samr_CREATE_DOM_ALIAS();
223
224         /************************/
225         /* Function    0x0f     */
226         NTSTATUS samr_EnumDomainAliases(
227                 [in,ref]      policy_handle *handle,
228                 [in,out,ref]  uint32 *resume_handle,
229                 [in]          uint32 max_size,
230                 [out]         samr_SamArray *sam,
231                 [out,ref]     uint32 num_entries
232                 );
233
234         /************************/
235         /* Function    0x10     */
236         NTSTATUS samr_GET_ALIAS_MEMBERSHIP();
237
238         /************************/
239         /* Function    0x11     */
240         NTSTATUS samr_LOOKUP_NAMES();
241
242         /************************/
243         /* Function    0x12     */
244         NTSTATUS samr_LOOKUP_RIDS();
245
246         /************************/
247         /* Function    0x13     */
248         NTSTATUS samr_OPEN_GROUP();
249
250         /************************/
251         /* Function    0x14     */
252         NTSTATUS samr_QUERY_GROUPINFO();
253
254         /************************/
255         /* Function    0x15     */
256         NTSTATUS samr_SET_GROUPINFO();
257
258         /************************/
259         /* Function    0x16     */
260         NTSTATUS samr_ADD_GROUPMEM();
261
262         /************************/
263         /* Function    0x17     */
264         NTSTATUS samr_DELETE_DOM_GROUP();
265
266         /************************/
267         /* Function    0x18     */
268         NTSTATUS samr_DEL_GROUPMEM();
269
270         /************************/
271         /* Function    0x19     */
272         NTSTATUS samr_QUERY_GROUPMEM();
273
274         /************************/
275         /* Function    0x1a     */
276         NTSTATUS samr_SET_MEMBER_ATTRIBUTES_OF_GROUP();
277
278         /************************/
279         /* Function    0x1b     */
280         NTSTATUS samr_OPEN_ALIAS();
281
282         /************************/
283         /* Function    0x1c     */
284         NTSTATUS samr_QUERY_ALIASINFO();
285
286         /************************/
287         /* Function    0x1d     */
288         NTSTATUS samr_SET_ALIASINFO();
289
290         /************************/
291         /* Function    0x1e     */
292         NTSTATUS samr_DELETE_DOM_ALIAS();
293
294         /************************/
295         /* Function    0x1f     */
296         NTSTATUS samr_ADD_ALIASMEM();
297
298         /************************/
299         /* Function    0x20     */
300         NTSTATUS samr_DEL_ALIASMEM();
301
302         /************************/
303         /* Function    0x21     */
304         NTSTATUS samr_GET_MEMBERS_IN_ALIAS();
305
306         /************************/
307         /* Function    0x22     */
308         NTSTATUS samr_OpenUser(
309                 [in,ref]      policy_handle *handle,
310                 [in]          uint32 access_mask,
311                 [in]          uint32 rid,
312                 [out,ref]     policy_handle *acct_handle
313                 );
314
315         /************************/
316         /* Function    0x23     */
317         NTSTATUS samr_DELETE_DOM_USER();
318
319         /************************/
320         /* Function    0x24     */
321         typedef struct {
322                 samr_Name username;
323                 samr_Name full_name;
324                 uint32 primary_group_rid;
325                 samr_Name description;
326                 samr_Name comment;
327         } samr_UserInfo1;
328
329         typedef struct {
330                 samr_Name comment;
331                 uint32 foo1;
332                 uint32 foo2;
333                 uint16 country_code;
334                 uint16 code_page;
335         } samr_UserInfo2;
336
337         typedef struct {
338                 samr_Name username;
339                 samr_Name full_name;
340                 uint32 Rid;
341                 uint32 primary_group_rid;
342                 samr_Name home_directory;
343                 samr_Name home_drive;
344                 samr_Name logon_script;
345                 samr_Name profile;
346                 samr_Name workstations;
347                 NTTIME last_logon;
348                 NTTIME last_logoff;
349                 NTTIME last_pwd_change;
350                 NTTIME allow_pwd_change;
351                 NTTIME force_pwd_change; /* uncertain about this one */
352                 uint32 units_per_week;
353                 [size_is(1260), length_is(units_per_week/8)] uint8 *logon_hours;
354                 uint16 bad_pwd_count;
355                 uint16 num_logons;
356                 uint32 acct_flags;
357         } samr_UserInfo3;
358
359         typedef union {
360                 case(1) samr_UserInfo1 info1;
361                 case(2) samr_UserInfo2 info2;
362                 case(3) samr_UserInfo3 info3;
363         } samr_UserInfo;
364
365         NTSTATUS samr_QueryUserInfo(
366                 [in,ref]                  policy_handle *handle,
367                 [in]                      uint16 level,
368                 [out,switch_is(level)]    samr_UserInfo *info
369                 );
370
371         /************************/
372         /* Function    0x25     */
373         NTSTATUS samr_SET_USERINFO();
374
375         /************************/
376         /* Function    0x26     */
377         NTSTATUS samr_CHANGE_PASSWORD_USER();
378
379         /************************/
380         /* Function    0x27     */
381         NTSTATUS samr_GET_GROUPS_FOR_USER();
382
383         /************************/
384         /* Function    0x28     */
385         NTSTATUS samr_QUERY_DISPINFO();
386
387         /************************/
388         /* Function    0x29     */
389         NTSTATUS samr_GET_DISPLAY_ENUMERATION_INDEX();
390
391         /************************/
392         /* Function    0x2a     */
393         NTSTATUS samr_TEST_PRIVATE_FUNCTIONS_DOMAIN();
394
395         /************************/
396         /* Function    0x2b     */
397         NTSTATUS samr_TEST_PRIVATE_FUNCTIONS_USER();
398
399         /************************/
400         /* Function    0x2c     */
401         NTSTATUS samr_GET_USRDOM_PWINFO();
402
403         /************************/
404         /* Function    0x2d     */
405         NTSTATUS samr_REMOVE_MEMBER_FROM_FOREIGN_DOMAIN();
406
407         /************************/
408         /* Function    0x2e     */
409         NTSTATUS samr_QUERY_INFORMATION_DOMAIN2();
410
411         /************************/
412         /* Function    0x2f     */
413         NTSTATUS samr_QUERY_INFORMATION_USER2();
414
415         /************************/
416         /* Function    0x30     */
417         NTSTATUS samr_QUERY_DISPINFO2();
418
419         /************************/
420         /* Function    0x31     */
421         NTSTATUS samr_GET_DISPLAY_ENUMERATION_INDEX2();
422
423         /************************/
424         /* Function    0x32     */
425         NTSTATUS samr_CREATE_USER2_IN_DOMAIN();
426
427         /************************/
428         /* Function    0x33     */
429         NTSTATUS samr_QUERY_DISPINFO3();
430
431         /************************/
432         /* Function    0x34     */
433         NTSTATUS samr_ADD_MULTIPLE_MEMBERS_TO_ALIAS();
434
435         /************************/
436         /* Function    0x35     */
437         NTSTATUS samr_REMOVE_MULTIPLE_MEMBERS_FROM_ALIAS();
438
439         /************************/
440         /* Function    0x36     */
441         NTSTATUS samr_OEM_CHANGE_PASSWORD_USER2();
442
443         /************************/
444         /* Function    0x37     */
445         NTSTATUS samr_UNICODE_CHANGE_PASSWORD_USER2();
446
447         /************************/
448         /* Function    0x38     */
449         NTSTATUS samr_GET_DOM_PWINFO();
450
451         /************************/
452         /* Function    0x39     */
453         NTSTATUS samr_CONNECT2();
454
455         /************************/
456         /* Function    0x3a     */
457         NTSTATUS samr_SET_USERINFO2();
458
459         /************************/
460         /* Function    0x3b     */
461         NTSTATUS samr_SET_BOOT_KEY_INFORMATION();
462
463         /************************/
464         /* Function    0x3c     */
465         NTSTATUS samr_GET_BOOT_KEY_INFORMATION();
466
467         /************************/
468         /* Function    0x3d     */
469         NTSTATUS samr_CONNECT3();
470
471         /************************/
472         /* Function    0x3e     */
473         NTSTATUS samr_Connect4(
474                 [in] unistr *system_name,
475                 [in] uint32 unknown,
476                 [in] uint32 access_mask,
477                 [out,ref]  policy_handle *handle
478                 );
479
480         /************************/
481         /* Function    0x3f     */
482         NTSTATUS samr_UNICODE_CHANGE_PASSWORD_USER3();
483
484         /************************/
485         /* Function    0x40      */
486         NTSTATUS samr_CONNECT5();
487
488         /************************/
489         /* Function    0x41     */
490         NTSTATUS samr_RID_TO_SID();
491
492         /************************/
493         /* Function    0x42     */
494         NTSTATUS samr_SET_DSRM_PASSWORD();
495
496         /************************/
497         /* Function    0x43     */
498         NTSTATUS samr_VALIDATE_PASSWORD();
499
500 }