399bd6c543a2af696f2fc64d757c89cce1ee2631
[jelmer/samba4-debian.git] / source / librpc / idl / netlogon.idl
1 /*
2   netlogon interface
3   much of this was derived from the ethereal sources - thanks to everyone 
4   who contributed!
5 */
6
7 #include "idl_types.h"
8
9 [
10   uuid(12345678-1234-abcd-ef00-01234567cffb),
11   version(1.0),
12   pointer_default(unique)
13 ]
14
15 interface netlogon
16 {
17
18         /*****************/
19         /* Function 0x00 */
20
21         typedef struct {
22                 unistr *account_name;
23                 uint32 priv;
24                 uint32 auth_flags;
25                 uint32 logon_count;
26                 uint32 bad_pw_count;
27                 time_t last_logon;
28                 time_t last_logoff;
29                 time_t logoff_time;
30                 time_t kickoff_time;
31                 uint32 password_age;
32                 time_t pw_can_change;
33                 time_t pw_must_change;
34                 unistr *computer;
35                 unistr *domain;
36                 unistr *script_path;
37                 uint32 unknown;
38         } netr_UasInfo;
39
40         WERROR netr_LogonUasLogon(
41                 [in]   unistr *server_name,
42                 [in]   unistr username,
43                 [in]   unistr workstation,
44                 [out]  netr_UasInfo *info
45                 );
46
47
48         /*****************/
49         /* Function 0x01 */
50
51         typedef struct {
52                 uint32 duration;
53                 uint16 logon_count;
54         } netr_UasLogoffInfo;
55
56         WERROR netr_LogonUasLogoff(
57                 [in] unistr *server_name,
58                 [in] unistr username,
59                 [in] unistr workstation,
60                 [out] netr_UasLogoffInfo info
61                 );
62
63
64         /*****************/
65         /* Function 0x02 */
66
67         typedef [flag(NDR_PAHEX)] struct {
68                 uint8 data[8];
69         } netr_Credential;
70
71         typedef [flag(NDR_PAHEX)] struct {
72                 uint8 session_key[8];
73                 uint32 sequence;
74                 netr_Credential seed;
75                 netr_Credential client;
76                 netr_Credential server;
77         } netr_CredentialState;
78
79         typedef struct {
80                 [value(strlen_m(r->string)*2)] uint16 size;
81                 [value(r->size)]               uint16 length;
82                 unistr_noterm *string;
83         } netr_String;
84         
85         /* in netr_AcctLockStr size seems to be be 24, and rrenard thinks 
86            that the structure of the bindata looks like this:
87
88                 ULONG8 lockout_duration;
89                 ULONG8 reset_count;
90                 uint32 bad_attempt_lockout;
91                 uint32 dummy;   
92
93            but it doesn't look as though this structure is reflected at the
94            NDR level. Maybe it is left to the application to decode the bindata array.
95         */
96         typedef struct {
97                 uint16 size;
98                 uint16 length;
99                 [size_is(size/2),length_is(length/2)] uint16 *bindata;
100         } netr_AcctLockStr;
101
102         typedef struct {
103                 netr_String domain_name;
104                 uint32      parameter_control;
105                 uint32      logon_id_low;
106                 uint32      logon_id_high;
107                 netr_String username;
108                 netr_String workstation;
109         } netr_IdentityInfo;
110
111         typedef [flag(NDR_PAHEX)] struct {
112                 uint8 data[16];
113         } netr_Password;
114
115         typedef struct {
116                 netr_IdentityInfo identity_info;
117                 netr_Password lmpassword;
118                 netr_Password ntpassword;
119         } netr_PasswordInfo;
120
121         typedef [flag(NDR_PAHEX)] struct {
122                 uint16 length;
123                 [value(r->length)] uint16 size;
124                 [size_is(size),length_is(length)] uint8 *data;
125         } netr_ChallengeResponse;
126
127         typedef [flag(NDR_PAHEX)] struct {
128                 netr_IdentityInfo logon_info;
129                 uint8 challenge[8];
130                 netr_ChallengeResponse nt;
131                 netr_ChallengeResponse lm;
132         } netr_NetworkInfo;
133
134         typedef union {
135                 [case(1)] netr_PasswordInfo *interactive;
136                 [case(2)] netr_NetworkInfo  *network;
137                 [case(3)] netr_PasswordInfo *service;
138         } netr_LogonLevel;
139
140         typedef struct {
141                 netr_Credential cred;
142                 time_t timestamp;
143         } netr_Authenticator;
144
145         typedef struct {
146                 uint32 user_id;
147                 uint32 attributes;
148         } netr_GroupMembership;
149
150         typedef [flag(NDR_PAHEX)] struct {
151                 uint8 key[16];
152         } netr_UserSessionKey;
153
154         typedef [flag(NDR_PAHEX)] struct {
155                 uint8 key[8];
156         } netr_LMSessionKey;
157
158         typedef struct {
159                 NTTIME logon_time;
160                 NTTIME logoff_time;
161                 NTTIME kickoff_time;
162                 NTTIME passwd_last_set;
163                 NTTIME passwd_can_change;
164                 NTTIME passwd_must_change;
165                 netr_String account_name;
166                 netr_String full_name;
167                 netr_String logon_script;
168                 netr_String profile_path;
169                 netr_String home_dir;
170                 netr_String home_drive;
171                 uint16 logon_count;
172                 uint16 bad_passwd_count;
173                 uint32 userid;
174                 uint32 primary_group;
175                 uint32 group_count;
176                 [size_is(group_count)] netr_GroupMembership *groupids;
177                 uint32 user_flags;
178                 netr_UserSessionKey key;
179                 netr_String logon_server;
180                 netr_String domain;
181                 dom_sid2 *domain_sid;
182                 netr_LMSessionKey LMSessKey;
183                 uint32 AccountControl;
184                 uint32 expansionroom[7];
185         } netr_SamInfo;
186
187         typedef struct {
188                 dom_sid2 *sid;
189                 uint32 attribute;
190         } netr_SidAttr;
191
192         typedef struct {
193                 NTTIME logon_time;
194                 NTTIME logoff_time;
195                 NTTIME kickoff_time;
196                 NTTIME passwd_last_set;
197                 NTTIME passwd_can_change;
198                 NTTIME passwd_must_change;
199                 netr_String account_name;
200                 netr_String full_name;
201                 netr_String logon_script;
202                 netr_String profile_path;
203                 netr_String home_dir;
204                 netr_String home_drive;
205                 uint16 logon_count;
206                 uint16 bad_passwd_count;
207                 uint32 userid;
208                 uint32 primary_group;
209                 uint32 group_count;
210                 [size_is(group_count)] netr_GroupMembership *groupids;
211                 uint32 user_flags;
212                 netr_UserSessionKey key;
213                 netr_String logon_server;
214                 netr_String domain;
215                 dom_sid2 *domain_sid;
216                 netr_LMSessionKey LMSessKey;
217                 uint32 AccountControl;
218                 uint32 expansionroom[7];
219                 uint32 sidcount;
220                 [size_is(sidcount)] netr_SidAttr *sids;
221         } netr_SamInfo2;
222
223         typedef struct {
224                 uint32 pac_size;
225                 [size_is(pac_size)] uint8 *pac;
226                 netr_String logon_domain;
227                 netr_String logon_server;
228                 netr_String principal_name;
229                 uint32 auth_size;
230                 [size_is(auth_size)] uint8 *auth;
231                 netr_UserSessionKey user_session_key;
232                 uint32 expansionroom[10];
233                 netr_String unknown1;
234                 netr_String unknown2;
235                 netr_String unknown3;
236                 netr_String unknown4;
237         } netr_PacInfo;
238
239         typedef union {
240                 [case(2)] netr_SamInfo  *sam;
241                 [case(3)] netr_SamInfo2 *sam2;
242                 [case(4)] netr_PacInfo  *pac;
243                 [case(5)] netr_PacInfo  *pac2;
244         } netr_Validation;
245
246         NTSTATUS netr_LogonSamLogon(
247                 [in] unistr *server_name,
248                 [in] unistr *workstation,
249                 [in] netr_Authenticator *credential,
250                 [in][out] netr_Authenticator *authenticator,
251                 [in]  uint16 logon_level,
252                 [in]  [switch_is(logon_level)] netr_LogonLevel logon,
253                 [in]  uint16 validation_level,
254                 [out] [switch_is(validation_level)] netr_Validation validation,
255                 [out] uint32 authoritative
256                 );
257
258
259         /*****************/
260         /* Function 0x03 */
261
262         NTSTATUS netr_LogonSamLogoff(
263                 [in] unistr *server_name,
264                 [in] unistr *computer_name,
265                 [in]      netr_Authenticator *credential,
266                 [in][out] netr_Authenticator *return_authenticator,
267                 [in] uint16 logon_level,
268                 [in] [switch_is(logon_level)] netr_LogonLevel logon
269                 );
270
271
272
273         /*****************/
274         /* Function 0x04 */
275
276         NTSTATUS netr_ServerReqChallenge(
277                 [in]        unistr *server_name,
278                 [in]        unistr computer_name,
279                 [in][out]   netr_Credential credentials
280                 );
281
282
283         /*****************/
284         /* Function 0x05 */
285
286         /* secure channel types */
287         const int SEC_CHAN_WKSTA   = 2;
288         const int SEC_CHAN_DOMAIN  = 4;
289         const int SEC_CHAN_BDC     = 6;
290
291         NTSTATUS netr_ServerAuthenticate(
292                 [in]        unistr *server_name,
293                 [in]        unistr username,
294                 [in]        uint16 secure_channel_type,
295                 [in]        unistr computer_name,
296                 [in,out]    netr_Credential credentials
297                 );
298
299
300         /*****************/
301         /* Function 0x06 */
302
303         NTSTATUS netr_ServerPasswordSet(
304                 [in]  unistr *server_name,
305                 [in]  unistr username,
306                 [in]  uint16 secure_channel_type,
307                 [in]  unistr computer_name,
308                 [in]  netr_Authenticator credential,
309                 [in]  netr_Password new_password,
310                 [out] netr_Authenticator return_authenticator
311                 );
312
313
314         /*****************/
315         /* Function 0x07 */
316
317         typedef struct {
318                 unistr *username;
319                 netr_String unknown1;
320                 netr_String unknown2;
321                 netr_String unknown3;
322                 netr_String unknown4;
323                 uint32 unknown5;
324                 uint32 unknown6;
325                 uint32 unknown7;
326                 uint32 unknown8;
327         } netr_DELTA_DELETE_USER;
328
329         typedef struct {
330                 bool8  SensitiveDataFlag;
331                 uint32 DataLength;
332                 [size_is(DataLength)] uint8 *SensitiveData;
333         } netr_USER_PRIVATE_INFO;
334
335         typedef struct {
336                 netr_String account_name;
337                 netr_String full_name;
338                 uint32 rid;
339                 uint32 primary_group;
340                 netr_String home_dir;
341                 netr_String home_drive;
342                 netr_String logon_script;
343                 netr_String description;
344                 netr_String workstations;
345                 NTTIME LastLogon;
346                 NTTIME LastLogoff;
347                 samr_LogonHours logon_hours;
348                 uint16 bad_pw_count;
349                 uint16 logon_count;
350                 NTTIME PwLastSet;
351                 NTTIME AccountExpires;
352                 uint32 AccountControl;
353                 netr_Password lmpw;
354                 netr_Password ntpw;
355                 bool8 NTPwPresent;
356                 bool8 LMPwPresent;
357                 bool8 PwExpired;
358                 netr_String UserComment;
359                 netr_String Parameters;
360                 uint16 CountryCode;
361                 uint16 CodePage;
362                 netr_USER_PRIVATE_INFO user_private_info;
363                 uint32 SecurityInformation;
364                 sec_desc_buf sdbuf;
365                 netr_String profile_path;
366                 netr_String unknown2;
367                 netr_String unknown3;
368                 netr_String unknown4;
369                 uint32 unknown5;
370                 uint32 unknown6;
371                 uint32 unknown7;
372                 uint32 unknown8;
373         } netr_DELTA_USER;
374
375         typedef struct {
376                 netr_String DomainName;
377                 netr_String OEMInfo;
378                 NTTIME forcedlogoff;
379                 uint16 minpasswdlen;
380                 uint16 passwdhistorylen;
381                 ULONG8 pwd_must_change_time;
382                 ULONG8 pwd_can_change_time;
383                 ULONG8 sequence_num;
384                 NTTIME domain_create_time;
385                 uint32 SecurityInformation;
386                 sec_desc_buf sdbuf;
387                 netr_AcctLockStr account_lockout;
388                 netr_String unknown2;
389                 netr_String unknown3;
390                 netr_String unknown4;
391                 uint32 unknown5;
392                 uint32 unknown6;
393                 uint32 unknown7;
394                 uint32 unknown8;
395         } netr_DELTA_DOMAIN;
396
397         typedef struct {
398                 netr_String groupname;
399                 netr_GroupMembership group_membership;
400                 netr_String comment;
401                 uint32 SecurityInformation;
402                 sec_desc_buf sdbuf;
403                 netr_String unknown1;
404                 netr_String unknown2;
405                 netr_String unknown3;
406                 netr_String unknown4;
407                 uint32 unknown5;
408                 uint32 unknown6;
409                 uint32 unknown7;
410                 uint32 unknown8;
411         } netr_DELTA_GROUP;
412
413         typedef struct {
414                 netr_String OldName;
415                 netr_String NewName;
416                 netr_String unknown1;
417                 netr_String unknown2;
418                 netr_String unknown3;
419                 netr_String unknown4;
420                 uint32 unknown5;
421                 uint32 unknown6;
422                 uint32 unknown7;
423                 uint32 unknown8;
424         } netr_DELTA_RENAME;
425
426         typedef struct {
427                 [size_is(num_rids)] uint32 *rids;
428                 [size_is(num_rids)] uint32 *attribs;
429                 uint32 num_rids;
430                 uint32 unknown1;
431                 uint32 unknown2;
432                 uint32 unknown3;
433                 uint32 unknown4;
434         } netr_DELTA_GROUP_MEMBER;
435
436         typedef struct {
437                 netr_String alias_name;
438                 uint32 rid;
439                 uint32 SecurityInformation;
440                 sec_desc_buf sdbuf;
441                 netr_String unknown1;
442                 netr_String unknown2;
443                 netr_String unknown3;
444                 netr_String unknown4;
445                 uint32 unknown5;
446                 uint32 unknown6;
447                 uint32 unknown7;
448                 uint32 unknown8;
449         } netr_DELTA_ALIAS;
450
451         typedef struct {
452                 lsa_SidArray sids;
453                 uint32 unknown1;
454                 uint32 unknown2;
455                 uint32 unknown3;
456                 uint32 unknown4;
457         } netr_DELTA_ALIAS_MEMBER;
458
459         typedef struct {
460                 uint32 pagedpoollimit;
461                 uint32 nonpagedpoollimit;
462                 uint32 minimumworkingsetsize;
463                 uint32 maximumworkingsetsize;
464                 uint32 pagefilelimit;
465                 NTTIME timelimit;
466         } netr_QUOTA_LIMITS;
467
468         typedef struct {
469                 uint32 maxlogsize;
470                 NTTIME auditretentionperiod;
471                 bool8 auditingmode;
472                 uint32 maxauditeventcount;
473                 [size_is(maxauditeventcount+1)] uint32 *eventauditoptions;
474                 netr_String primarydomainname;
475                 dom_sid2 *sid;
476                 netr_QUOTA_LIMITS quota_limits;
477                 NTTIME db_modify_time;
478                 NTTIME db_create_time;
479                 uint32 SecurityInformation;
480                 sec_desc_buf sdbuf;
481                 netr_String unknown1;
482                 netr_String unknown2;
483                 netr_String unknown3;
484                 netr_String unknown4;
485                 uint32 unknown5;
486                 uint32 unknown6;
487                 uint32 unknown7;
488                 uint32 unknown8;
489         } netr_DELTA_POLICY;
490
491         typedef struct {
492                 netr_String DomainName;
493                 uint32 num_controllers;
494                 [size_is(num_controllers)] netr_String *controller_names;
495                 uint32 SecurityInformation;
496                 sec_desc_buf sdbuf;
497                 netr_String unknown1;
498                 netr_String unknown2;
499                 netr_String unknown3;
500                 netr_String unknown4;
501                 uint32 unknown5;
502                 uint32 unknown6;
503                 uint32 unknown7;
504                 uint32 unknown8;
505         } netr_DELTA_TRUSTED_DOMAINS;
506
507         typedef struct {
508                 uint16 unknown;
509         } netr_DELTA_DELETE_TRUST;
510
511         typedef struct {
512                 uint32 privilege_entries;
513                 uint32 privilege_control;
514                 [size_is(privilege_entries)] uint32 *privilege_attrib;
515                 [size_is(privilege_entries)] netr_String *privilege_name;
516                 netr_QUOTA_LIMITS quotalimits;
517                 uint32 system_flags;
518                 uint32 SecurityInformation;
519                 sec_desc_buf sdbuf;
520                 netr_String unknown1;
521                 netr_String unknown2;
522                 netr_String unknown3;
523                 netr_String unknown4;
524                 uint32 unknown5;
525                 uint32 unknown6;
526                 uint32 unknown7;
527                 uint32 unknown8;
528         } netr_DELTA_ACCOUNTS;
529
530         typedef struct {
531                 uint16 unknown;
532         } netr_DELTA_DELETE_ACCOUNT;
533
534         typedef struct {
535                 uint16 unknown;
536         } netr_DELTA_DELETE_SECRET;
537
538         typedef struct {
539                 uint32 len;
540                 uint32 maxlen;
541                 [size_is(maxlen)][length_is(len)] uint8 *cipher_data;
542         } netr_CIPHER_VALUE;
543
544         typedef struct {
545                 netr_CIPHER_VALUE current_cipher;
546                 NTTIME current_cipher_set_time;
547                 netr_CIPHER_VALUE old_cipher;
548                 NTTIME old_cipher_set_time;
549                 uint32 SecurityInformation;
550                 sec_desc_buf sdbuf;
551                 netr_String unknown1;
552                 netr_String unknown2;
553                 netr_String unknown3;
554                 netr_String unknown4;
555                 uint32 unknown5;
556                 uint32 unknown6;
557                 uint32 unknown7;
558                 uint32 unknown8;
559         } netr_DELTA_SECRET;
560
561         typedef enum {
562                 NETR_DELTA_DOMAIN           = 1,
563                 NETR_DELTA_GROUP            = 2,
564                 NETR_DELTA_DELETE_GROUP     = 3,
565                 NETR_DELTA_RENAME_GROUP     = 4,
566                 NETR_DELTA_USER             = 5,
567                 NETR_DELTA_DELETE_USER      = 6,
568                 NETR_DELTA_RENAME_USER      = 7,
569                 NETR_DELTA_GROUP_MEMBER     = 8,
570                 NETR_DELTA_ALIAS            = 9,
571                 NETR_DELTA_UNKNOWN1         = 10,  /* maybe delete alias? */
572                 NETR_DELTA_RENAME_ALIAS     = 11,
573                 NETR_DELTA_ALIAS_MEMBER     = 12,
574                 NETR_DELTA_POLICY           = 13,
575                 NETR_DELTA_TRUSTED_DOMAINS  = 14,
576                 NETR_DELTA_DELETE_TRUST     = 15,
577                 NETR_DELTA_ACCOUNTS         = 16,
578                 NETR_DELTA_DELETE_ACCOUNT   = 17,
579                 NETR_DELTA_SECRET           = 18,
580                 NETR_DELTA_DELETE_SECRET    = 19,
581                 NETR_DELTA_DELETE_GROUP2    = 20,
582                 NETR_DELTA_DELETE_USER2     = 21,
583                 NETR_DELTA_MODIFY_COUNT     = 22
584         } netr_DeltaEnum;
585
586         typedef union {
587                 [case(NETR_DELTA_DOMAIN)]          netr_DELTA_DOMAIN          *domain;
588                 [case(NETR_DELTA_GROUP)]           netr_DELTA_GROUP           *group;
589                 [case(NETR_DELTA_DELETE_GROUP)]    ; /* rid only */
590                 [case(NETR_DELTA_RENAME_GROUP)]    netr_DELTA_RENAME          *rename_group;
591                 [case(NETR_DELTA_USER)]            netr_DELTA_USER            *user;
592                 [case(NETR_DELTA_DELETE_USER)]     ; /* rid only */
593                 [case(NETR_DELTA_RENAME_USER)]     netr_DELTA_RENAME          *rename_user;
594                 [case(NETR_DELTA_GROUP_MEMBER)]    netr_DELTA_GROUP_MEMBER    *group_member;
595                 [case(NETR_DELTA_ALIAS)]           netr_DELTA_ALIAS           *alias;
596                 [case(NETR_DELTA_RENAME_ALIAS)]    netr_DELTA_RENAME          *rename_alias;
597                 [case(NETR_DELTA_ALIAS_MEMBER)]    netr_DELTA_ALIAS_MEMBER    *alias_member;
598                 [case(NETR_DELTA_POLICY)]          netr_DELTA_POLICY          *policy;
599                 [case(NETR_DELTA_TRUSTED_DOMAINS)] netr_DELTA_TRUSTED_DOMAINS *trusted_domains;
600                 [case(NETR_DELTA_DELETE_TRUST)]    netr_DELTA_DELETE_TRUST    delete_trust;
601                 [case(NETR_DELTA_ACCOUNTS)]        netr_DELTA_ACCOUNTS        *accounts;
602                 [case(NETR_DELTA_DELETE_ACCOUNT)]  netr_DELTA_DELETE_ACCOUNT  delete_account;
603                 [case(NETR_DELTA_SECRET)]          netr_DELTA_SECRET          *secret;
604                 [case(NETR_DELTA_DELETE_SECRET)]   netr_DELTA_DELETE_SECRET   delete_secret;
605                 [case(NETR_DELTA_DELETE_GROUP2)]   netr_DELTA_DELETE_USER     *delete_group;
606                 [case(NETR_DELTA_DELETE_USER2)]    netr_DELTA_DELETE_USER     *delete_user;
607                 [case(NETR_DELTA_MODIFY_COUNT)]    ULONG8                     *modified_count;
608         } netr_DELTA_UNION;
609
610         typedef union {
611                 [case(NETR_DELTA_DOMAIN)]          uint32 rid;
612                 [case(NETR_DELTA_GROUP)]           uint32 rid;
613                 [case(NETR_DELTA_DELETE_GROUP)]    uint32 rid;
614                 [case(NETR_DELTA_RENAME_GROUP)]    uint32 rid;
615                 [case(NETR_DELTA_USER)]            uint32 rid;
616                 [case(NETR_DELTA_DELETE_USER)]     uint32 rid;
617                 [case(NETR_DELTA_RENAME_USER)]     uint32 rid;
618                 [case(NETR_DELTA_GROUP_MEMBER)]    uint32 rid;
619                 [case(NETR_DELTA_ALIAS)]           uint32 rid;
620                 [case(NETR_DELTA_UNKNOWN1)]        uint32 rid;
621                 [case(NETR_DELTA_RENAME_ALIAS)]    uint32 rid;
622                 [case(NETR_DELTA_ALIAS_MEMBER)]    uint32 rid;
623                 [case(NETR_DELTA_POLICY)]          dom_sid2 *sid;
624                 [case(NETR_DELTA_TRUSTED_DOMAINS)] dom_sid2 *sid;
625                 [case(NETR_DELTA_DELETE_TRUST)]    dom_sid2 *sid;
626                 [case(NETR_DELTA_ACCOUNTS)]        dom_sid2 *sid;
627                 [case(NETR_DELTA_DELETE_ACCOUNT)]  dom_sid2 *sid;
628                 [case(NETR_DELTA_SECRET)]          unistr *name;
629                 [case(NETR_DELTA_DELETE_SECRET)]   unistr *name;
630                 [case(NETR_DELTA_DELETE_GROUP2)]   unistr *name;
631                 [case(NETR_DELTA_DELETE_USER2)]    uint32 rid;
632                 [case(NETR_DELTA_MODIFY_COUNT)]    uint32 rid;
633         } netr_DELTA_ID_UNION;
634
635         typedef struct {
636                 uint16 delta_type;
637                 [switch_is(delta_type)] netr_DELTA_ID_UNION delta_id_union;
638                 [switch_is(delta_type)] netr_DELTA_UNION delta_union;
639         } netr_DELTA_ENUM;
640
641         typedef struct {
642                 uint32 num_deltas;
643                 [size_is(num_deltas)] netr_DELTA_ENUM *delta_enum;
644         } netr_DELTA_ENUM_ARRAY;
645
646
647         NTSTATUS netr_DatabaseDeltas(
648                 [in]      unistr logon_server,
649                 [in]      unistr computername,
650                 [in]      netr_Authenticator credential,
651                 [in,out]  netr_Authenticator return_authenticator,
652                 [in]      uint32 database_id,
653                 [in,out]  ULONG8 sequence_num,
654                 [in]      uint32 preferredmaximumlength,
655                 [out]     netr_DELTA_ENUM_ARRAY *delta_enum_array
656                 );
657
658
659         /*****************/
660         /* Function 0x08 */
661
662         NTSTATUS netr_DatabaseSync(
663                 [in]     unistr logon_server,
664                 [in]     unistr computername,
665                 [in]     netr_Authenticator credential,
666                 [in,out] netr_Authenticator return_authenticator,
667                 [in]     uint32 database_id,
668                 [in,out] uint32 sync_context,
669                 [in]     uint32 preferredmaximumlength,
670                 [out]    netr_DELTA_ENUM_ARRAY *delta_enum_array
671                 );
672
673
674         /*****************/
675         /* Function 0x09 */
676
677         /* w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this call */
678
679         typedef [flag(NDR_PAHEX)] struct {
680                 uint8 computer_name[16];
681                 uint32 timecreated;
682                 uint32 serial_number;
683         } netr_UAS_INFO_0;
684
685         typedef struct {
686                 [flag(NDR_REMAINING)] DATA_BLOB blob;
687         } netr_AccountBuffer;
688
689         NTSTATUS netr_AccountDeltas(
690                 [in]     unistr *logon_server,
691                 [in]     unistr computername,
692                 [in]     netr_Authenticator credential,
693                 [in,out] netr_Authenticator return_authenticator,
694                 [in]     netr_UAS_INFO_0 uas,
695                 [in]     uint32 count,
696                 [in]     uint32 level,
697                 [in]     uint32 buffersize,
698                 [out,subcontext(4)] netr_AccountBuffer buffer,
699                 [out]    uint32 count_returned,
700                 [out]    uint32 total_entries,
701                 [out]    netr_UAS_INFO_0 recordid
702                 );
703
704
705         /*****************/
706         /* Function 0x0A */
707
708         NTSTATUS netr_AccountSync(
709                 [in]      unistr *logon_server,
710                 [in]      unistr computername,
711                 [in]      netr_Authenticator credential,
712                 [in,out]  netr_Authenticator return_authenticator,
713                 [in]      uint32 reference,
714                 [in]      uint32 level,
715                 [in]      uint32 buffersize,
716                 [out,subcontext(4)] netr_AccountBuffer buffer,
717                 [out]     uint32 count_returned,
718                 [out]     uint32 total_entries,
719                 [out]     uint32 next_reference,
720                 [in,out]  netr_UAS_INFO_0 recordid
721                 );
722
723
724         /*****************/
725         /* Function 0x0B */
726
727         NTSTATUS netr_GetDcName(
728                 [in]  unistr logon_server,
729                 [in]  unistr *domainname,
730                 [out] unistr *dcname
731                 );
732
733
734
735         /*****************/
736         /* Function 0x0C */
737
738         typedef struct {
739                 uint32 flags;
740                 uint32 pdc_connection_status;
741         } netr_NETLOGON_INFO_1;
742
743         typedef struct {
744                 uint32 flags;
745                 uint32 pdc_connection_status;
746                 unistr trusted_dc_name;
747                 uint32 tc_connection_status;
748         } netr_NETLOGON_INFO_2;
749
750         typedef struct {
751                 uint32 flags;
752                 uint32 logon_attempts;
753                 uint32 unknown1;
754                 uint32 unknown2;
755                 uint32 unknown3;
756                 uint32 unknown4;
757                 uint32 unknown5;
758         } netr_NETLOGON_INFO_3;
759
760         typedef union {
761                 [case(1)]  netr_NETLOGON_INFO_1 *info1;
762                 [case(2)]  netr_NETLOGON_INFO_2 *info2;
763                 [case(3)]  netr_NETLOGON_INFO_3 *info3;
764         } netr_CONTROL_QUERY_INFORMATION;
765
766         /* function_code values */
767         const int NETLOGON_CONTROL_REDISCOVER       = 5;
768         const int NETLOGON_CONTROL_TC_QUERY         = 6;
769         const int NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7;
770         const int NETLOGON_CONTROL_SET_DBFLAG       = 65534;
771
772         WERROR netr_LogonControl(
773                 [in]   unistr *logon_server,
774                 [in]   uint32 function_code,
775                 [in]   uint32 level,
776                 [out,switch_is(level)]  netr_CONTROL_QUERY_INFORMATION info
777                 );
778
779
780         /*****************/
781         /* Function 0x0D */
782
783         WERROR netr_GetAnyDCName(
784                 [in]  unistr *logon_server,
785                 [in]  unistr *domainname,
786                 [out] unistr *dcname
787                 );
788
789
790         /*****************/
791         /* Function 0x0E */
792
793         typedef union {
794                 [case(NETLOGON_CONTROL_REDISCOVER)]        unistr *domain;
795                 [case(NETLOGON_CONTROL_TC_QUERY)]          unistr *domain;
796                 [case(NETLOGON_CONTROL_TRANSPORT_NOTIFY)]  unistr *domain;
797                 [case(NETLOGON_CONTROL_SET_DBFLAG)]        uint32 debug_level;
798         } netr_CONTROL_DATA_INFORMATION;
799
800         WERROR netr_LogonControl2(
801                 [in]    unistr *logon_server,
802                 [in]    uint32 function_code,
803                 [in]    uint32 level,
804                 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION  data,
805                 [out][switch_is(level)]        netr_CONTROL_QUERY_INFORMATION query
806                 );
807
808
809         /*****************/
810         /* Function 0x0F */
811
812         NTSTATUS netr_ServerAuthenticate2(
813                 [in]         unistr *server_name,
814                 [in]         unistr username,
815                 [in]         uint16 secure_channel_type,
816                 [in]         unistr computer_name,
817                 [in,out]     netr_Credential credentials,
818                 [in,out,ref] uint32 *negotiate_flags
819                 );
820
821
822         /*****************/
823         /* Function 0x10 */
824
825         NTSTATUS netr_DatabaseSync2(
826                 [in]     unistr logon_server,
827                 [in]     unistr computername,
828                 [in]     netr_Authenticator credential,
829                 [in,out] netr_Authenticator return_authenticator,
830                 [in]     uint32 database_id,
831                 [in]     uint16 restart_state,
832                 [in,out] uint32 sync_context,
833                 [in]     uint32 preferredmaximumlength,
834                 [out]    netr_DELTA_ENUM_ARRAY *delta_enum_array
835                 );
836
837
838         /*****************/
839         /* Function 0x11 */
840
841         /* i'm not at all sure how this call works */
842
843         NTSTATUS netr_DatabaseRedo(
844                 [in]     unistr logon_server,
845                 [in]     unistr computername,
846                 [in]     netr_Authenticator credential,
847                 [in,out] netr_Authenticator return_authenticator,
848                 [in][size_is(change_log_entry_size)] uint8 *change_log_entry,
849                 [in]     uint32 change_log_entry_size,
850                 [out]    netr_DELTA_ENUM_ARRAY *delta_enum_array
851                 );
852
853
854         /*****************/
855         /* Function 0x12 */
856
857         WERROR netr_LogonControl2Ex(
858                 [in]   unistr *logon_server,
859                 [in]   uint32 function_code,
860                 [in]   uint32 level,
861                 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION  data,
862                 [out][switch_is(level)]        netr_CONTROL_QUERY_INFORMATION query
863                 );
864 }