r295: more correct IDL for the netr_AcctLock structure (I hope)
[ira/wip.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 user_session_key[16];
152         } netr_UserSessionKey;
153
154         typedef struct {
155                 NTTIME logon_time;
156                 NTTIME logoff_time;
157                 NTTIME kickoff_time;
158                 NTTIME passwd_last_set;
159                 NTTIME passwd_can_change;
160                 NTTIME passwd_must_change;
161                 netr_String account_name;
162                 netr_String full_name;
163                 netr_String logon_script;
164                 netr_String profile_path;
165                 netr_String home_dir;
166                 netr_String home_drive;
167                 uint16 logon_count;
168                 uint16 bad_passwd_count;
169                 uint32 userid;
170                 uint32 primary_group;
171                 uint32 group_count;
172                 [size_is(group_count)] netr_GroupMembership *groupids;
173                 uint32 user_flags;
174                 netr_UserSessionKey key;
175                 netr_String logon_server;
176                 netr_String domain;
177                 dom_sid2 *domain_sid;
178                 uint32 expansionroom[10];
179         } netr_SamInfo;
180
181         typedef struct {
182                 dom_sid2 *sid;
183                 uint32 attribute;
184         } netr_SidAttr;
185
186         typedef struct {
187                 NTTIME logon_time;
188                 NTTIME logoff_time;
189                 NTTIME kickoff_time;
190                 NTTIME passwd_last_set;
191                 NTTIME passwd_can_change;
192                 NTTIME passwd_must_change;
193                 netr_String account_name;
194                 netr_String full_name;
195                 netr_String logon_script;
196                 netr_String profile_path;
197                 netr_String home_dir;
198                 netr_String home_drive;
199                 uint16 logon_count;
200                 uint16 bad_passwd_count;
201                 uint32 userid;
202                 uint32 primary_group;
203                 uint32 group_count;
204                 [size_is(group_count)] netr_GroupMembership *groupids;
205                 uint32 user_flags;
206                 netr_UserSessionKey key;
207                 netr_String logon_server;
208                 netr_String domain;
209                 dom_sid2 *domain_sid;
210                 uint32 expansionroom[10];
211                 uint32 sidcount;
212                 [size_is(sidcount)] netr_SidAttr *sids;
213         } netr_SamInfo2;
214
215         typedef struct {
216                 uint32 pac_size;
217                 [size_is(pac_size)] uint8 *pac;
218                 netr_String logon_domain;
219                 netr_String logon_server;
220                 netr_String principal_name;
221                 uint32 auth_size;
222                 [size_is(auth_size)] uint8 *auth;
223                 netr_UserSessionKey user_session_key;
224                 uint32 expansionroom[10];
225                 netr_String unknown1;
226                 netr_String unknown2;
227                 netr_String unknown3;
228                 netr_String unknown4;
229         } netr_PacInfo;
230
231         typedef union {
232                 [case(2)] netr_SamInfo  *sam;
233                 [case(3)] netr_SamInfo2 *sam2;
234                 [case(4)] netr_PacInfo  *pac;
235                 [case(5)] netr_PacInfo  *pac2;
236         } netr_Validation;
237
238         NTSTATUS netr_LogonSamLogon(
239                 [in] unistr *server_name,
240                 [in] unistr *workstation,
241                 [in] netr_Authenticator *credential,
242                 [in][out] netr_Authenticator *authenticator,
243                 [in]  uint16 logon_level,
244                 [in]  [switch_is(logon_level)] netr_LogonLevel logon,
245                 [in]  uint16 validation_level,
246                 [out] [switch_is(validation_level)] netr_Validation validation,
247                 [out] uint32 authoritative
248                 );
249
250
251         /*****************/
252         /* Function 0x03 */
253
254         NTSTATUS netr_LogonSamLogoff(
255                 [in] unistr *server_name,
256                 [in] unistr *computer_name,
257                 [in]      netr_Authenticator *credential,
258                 [in][out] netr_Authenticator *return_authenticator,
259                 [in] uint16 logon_level,
260                 [in] [switch_is(logon_level)] netr_LogonLevel logon
261                 );
262
263
264
265         /*****************/
266         /* Function 0x04 */
267
268         NTSTATUS netr_ServerReqChallenge(
269                 [in]        unistr *server_name,
270                 [in]        unistr computer_name,
271                 [in][out]   netr_Credential credentials
272                 );
273
274
275         /*****************/
276         /* Function 0x05 */
277
278         /* secure channel types */
279         const int SEC_CHAN_WKSTA   = 2;
280         const int SEC_CHAN_DOMAIN  = 4;
281         const int SEC_CHAN_BDC     = 6;
282
283         NTSTATUS netr_ServerAuthenticate(
284                 [in]        unistr *server_name,
285                 [in]        unistr username,
286                 [in]        uint16 secure_channel_type,
287                 [in]        unistr computer_name,
288                 [in,out]    netr_Credential credentials
289                 );
290
291
292         /*****************/
293         /* Function 0x06 */
294
295         NTSTATUS netr_ServerPasswordSet(
296                 [in]  unistr *server_name,
297                 [in]  unistr username,
298                 [in]  uint16 secure_channel_type,
299                 [in]  unistr computer_name,
300                 [in]  netr_Authenticator credential,
301                 [in]  netr_Password new_password,
302                 [out] netr_Authenticator return_authenticator
303                 );
304
305
306         /*****************/
307         /* Function 0x07 */
308
309         typedef struct {
310                 unistr *username;
311                 netr_String unknown1;
312                 netr_String unknown2;
313                 netr_String unknown3;
314                 netr_String unknown4;
315                 uint32 unknown5;
316                 uint32 unknown6;
317                 uint32 unknown7;
318                 uint32 unknown8;
319         } netr_DELTA_DELETE_USER;
320
321         typedef struct {
322                 bool8  SensitiveDataFlag;
323                 uint32 DataLength;
324                 [size_is(DataLength)] uint8 *SensitiveData;
325         } netr_USER_PRIVATE_INFO;
326
327         typedef struct {
328                 netr_String account_name;
329                 netr_String full_name;
330                 uint32 rid;
331                 uint32 primary_group;
332                 netr_String home_dir;
333                 netr_String home_drive;
334                 netr_String logon_script;
335                 netr_String description;
336                 netr_String workstations;
337                 NTTIME LastLogon;
338                 NTTIME LastLogoff;
339                 samr_LogonHours logon_hours;
340                 uint16 bad_pw_count;
341                 uint16 logon_count;
342                 NTTIME PwLastSet;
343                 NTTIME AccountExpires;
344                 uint32 AccountControl;
345                 netr_Password lmpw;
346                 netr_Password ntpw;
347                 bool8 NTPwPresent;
348                 bool8 LMPwPresent;
349                 bool8 PwExpired;
350                 netr_String UserComment;
351                 netr_String Parameters;
352                 uint16 CountryCode;
353                 uint16 CodePage;
354                 netr_USER_PRIVATE_INFO user_private_info;
355                 uint32 SecurityInformation;
356                 sec_desc_buf sdbuf;
357                 netr_String profile_path;
358                 netr_String unknown2;
359                 netr_String unknown3;
360                 netr_String unknown4;
361                 uint32 unknown5;
362                 uint32 unknown6;
363                 uint32 unknown7;
364                 uint32 unknown8;
365         } netr_DELTA_USER;
366
367         typedef struct {
368                 netr_String DomainName;
369                 netr_String OEMInfo;
370                 NTTIME forcedlogoff;
371                 uint16 minpasswdlen;
372                 uint16 passwdhistorylen;
373                 ULONG8 pwd_must_change_time;
374                 ULONG8 pwd_can_change_time;
375                 ULONG8 sequence_num;
376                 NTTIME domain_create_time;
377                 uint32 SecurityInformation;
378                 sec_desc_buf sdbuf;
379                 netr_AcctLockStr account_lockout;
380                 netr_String unknown2;
381                 netr_String unknown3;
382                 netr_String unknown4;
383                 uint32 unknown5;
384                 uint32 unknown6;
385                 uint32 unknown7;
386                 uint32 unknown8;
387         } netr_DELTA_DOMAIN;
388
389         typedef struct {
390                 netr_String groupname;
391                 netr_GroupMembership group_membership;
392                 netr_String comment;
393                 uint32 SecurityInformation;
394                 sec_desc_buf sdbuf;
395                 netr_String unknown1;
396                 netr_String unknown2;
397                 netr_String unknown3;
398                 netr_String unknown4;
399                 uint32 unknown5;
400                 uint32 unknown6;
401                 uint32 unknown7;
402                 uint32 unknown8;
403         } netr_DELTA_GROUP;
404
405         typedef struct {
406                 netr_String OldName;
407                 netr_String NewName;
408                 netr_String unknown1;
409                 netr_String unknown2;
410                 netr_String unknown3;
411                 netr_String unknown4;
412                 uint32 unknown5;
413                 uint32 unknown6;
414                 uint32 unknown7;
415                 uint32 unknown8;
416         } netr_DELTA_RENAME;
417
418         typedef struct {
419                 [size_is(num_rids)] uint32 *rids;
420                 [size_is(num_rids)] uint32 *attribs;
421                 uint32 num_rids;
422                 uint32 unknown1;
423                 uint32 unknown2;
424                 uint32 unknown3;
425                 uint32 unknown4;
426         } netr_DELTA_GROUP_MEMBER;
427
428         typedef struct {
429                 netr_String alias_name;
430                 uint32 rid;
431                 uint32 SecurityInformation;
432                 sec_desc_buf sdbuf;
433                 netr_String unknown1;
434                 netr_String unknown2;
435                 netr_String unknown3;
436                 netr_String unknown4;
437                 uint32 unknown5;
438                 uint32 unknown6;
439                 uint32 unknown7;
440                 uint32 unknown8;
441         } netr_DELTA_ALIAS;
442
443         typedef struct {
444                 lsa_SidArray sids;
445                 uint32 unknown1;
446                 uint32 unknown2;
447                 uint32 unknown3;
448                 uint32 unknown4;
449         } netr_DELTA_ALIAS_MEMBER;
450
451         typedef struct {
452                 uint32 pagedpoollimit;
453                 uint32 nonpagedpoollimit;
454                 uint32 minimumworkingsetsize;
455                 uint32 maximumworkingsetsize;
456                 uint32 pagefilelimit;
457                 NTTIME timelimit;
458         } netr_QUOTA_LIMITS;
459
460         typedef struct {
461                 uint32 maxlogsize;
462                 NTTIME auditretentionperiod;
463                 bool8 auditingmode;
464                 uint32 maxauditeventcount;
465                 [size_is(maxauditeventcount+1)] uint32 *eventauditoptions;
466                 netr_String primarydomainname;
467                 dom_sid2 *sid;
468                 netr_QUOTA_LIMITS quota_limits;
469                 NTTIME db_modify_time;
470                 NTTIME db_create_time;
471                 uint32 SecurityInformation;
472                 sec_desc_buf sdbuf;
473                 netr_String unknown1;
474                 netr_String unknown2;
475                 netr_String unknown3;
476                 netr_String unknown4;
477                 uint32 unknown5;
478                 uint32 unknown6;
479                 uint32 unknown7;
480                 uint32 unknown8;
481         } netr_DELTA_POLICY;
482
483         typedef struct {
484                 netr_String DomainName;
485                 uint32 num_controllers;
486                 [size_is(num_controllers)] netr_String *controller_names;
487                 uint32 SecurityInformation;
488                 sec_desc_buf sdbuf;
489                 netr_String unknown1;
490                 netr_String unknown2;
491                 netr_String unknown3;
492                 netr_String unknown4;
493                 uint32 unknown5;
494                 uint32 unknown6;
495                 uint32 unknown7;
496                 uint32 unknown8;
497         } netr_DELTA_TRUSTED_DOMAINS;
498
499         typedef struct {
500                 uint32 privilege_entries;
501                 uint32 privilege_control;
502                 [size_is(privilege_entries)] uint32 *privilege_attrib;
503                 [size_is(privilege_entries)] netr_String *privilege_name;
504                 netr_QUOTA_LIMITS quotalimits;
505                 uint32 system_flags;
506                 uint32 SecurityInformation;
507                 sec_desc_buf sdbuf;
508                 netr_String unknown1;
509                 netr_String unknown2;
510                 netr_String unknown3;
511                 netr_String unknown4;
512                 uint32 unknown5;
513                 uint32 unknown6;
514                 uint32 unknown7;
515                 uint32 unknown8;
516         } netr_DELTA_ACCOUNTS;
517
518         typedef struct {
519                 uint32 len;
520                 uint32 maxlen;
521                 [size_is(maxlen)][length_is(len)] uint8 *cipher_data;
522         } netr_CIPHER_VALUE;
523
524         typedef struct {
525                 netr_CIPHER_VALUE current_cipher;
526                 NTTIME current_cipher_set_time;
527                 netr_CIPHER_VALUE old_cipher;
528                 NTTIME old_cipher_set_time;
529                 uint32 SecurityInformation;
530                 sec_desc_buf sdbuf;
531                 netr_String unknown1;
532                 netr_String unknown2;
533                 netr_String unknown3;
534                 netr_String unknown4;
535                 uint32 unknown5;
536                 uint32 unknown6;
537                 uint32 unknown7;
538                 uint32 unknown8;
539         } netr_DELTA_SECRET;
540
541         typedef enum {
542                 NETR_DELTA_DOMAIN           = 1,
543                 NETR_DELTA_GROUP            = 2,
544                 NETR_DELTA_DELETE_GROUP     = 3,
545                 NETR_DELTA_RENAME_GROUP     = 4,
546                 NETR_DELTA_USER             = 5,
547                 NETR_DELTA_DELETE_USER      = 6,
548                 NETR_DELTA_RENAME_USER      = 7,
549                 NETR_DELTA_GROUP_MEMBER     = 8,
550                 NETR_DELTA_ALIAS            = 9,
551                 NETR_DELTA_UNKNOWN1         = 10,  /* maybe delete alias? */
552                 NETR_DELTA_RENAME_ALIAS     = 11,
553                 NETR_DELTA_ALIAS_MEMBER     = 12,
554                 NETR_DELTA_POLICY           = 13,
555                 NETR_DELTA_TRUSTED_DOMAINS  = 14,
556                 NETR_DELTA_UNKNOWN2         = 15,
557                 NETR_DELTA_ACCOUNTS         = 16,
558                 NETR_DELTA_UNKNOWN3         = 17,
559                 NETR_DELTA_SECRET           = 18,
560                 NETR_DELTA_UNKNOWN4         = 19,   /* maybe delete secret? */
561                 NETR_DELTA_DELETE_GROUP2    = 20,
562                 NETR_DELTA_DELETE_USER2     = 21,
563                 NETR_DELTA_MODIFY_COUNT     = 22
564         } netr_DeltaEnum;
565
566         typedef union {
567                 [case(NETR_DELTA_DOMAIN)]          netr_DELTA_DOMAIN          *domain;
568                 [case(NETR_DELTA_GROUP)]           netr_DELTA_GROUP           *group;
569                 [case(NETR_DELTA_DELETE_GROUP)]    ; /* rid only */
570                 [case(NETR_DELTA_RENAME_GROUP)]    netr_DELTA_RENAME          *rename_group;
571                 [case(NETR_DELTA_USER)]            netr_DELTA_USER            *user;
572                 [case(NETR_DELTA_DELETE_USER)]     ; /* rid only */
573                 [case(NETR_DELTA_RENAME_USER)]     netr_DELTA_RENAME          *rename_user;
574                 [case(NETR_DELTA_GROUP_MEMBER)]    netr_DELTA_GROUP_MEMBER    *group_member;
575                 [case(NETR_DELTA_ALIAS)]           netr_DELTA_ALIAS           *alias;
576                 [case(NETR_DELTA_RENAME_ALIAS)]    netr_DELTA_RENAME          *rename_alias;
577                 [case(NETR_DELTA_ALIAS_MEMBER)]    netr_DELTA_ALIAS_MEMBER    *alias_member;
578                 [case(NETR_DELTA_POLICY)]          netr_DELTA_POLICY          *policy;
579                 [case(NETR_DELTA_TRUSTED_DOMAINS)] netr_DELTA_TRUSTED_DOMAINS *trusted_domains;
580                 [case(NETR_DELTA_ACCOUNTS)]        netr_DELTA_ACCOUNTS        *accounts;
581                 [case(NETR_DELTA_SECRET)]          netr_DELTA_SECRET          *secret;
582                 [case(NETR_DELTA_DELETE_GROUP2)]   netr_DELTA_DELETE_USER     *delete_group;
583                 [case(NETR_DELTA_DELETE_USER2)]    netr_DELTA_DELETE_USER     *delete_user;
584                 [case(NETR_DELTA_MODIFY_COUNT)]    ULONG8                     *modified_count;
585         } netr_DELTA_UNION;
586
587         typedef union {
588                 [case(NETR_DELTA_DOMAIN)]          uint32 rid;
589                 [case(NETR_DELTA_GROUP)]           uint32 rid;
590                 [case(NETR_DELTA_DELETE_GROUP)]    uint32 rid;
591                 [case(NETR_DELTA_RENAME_GROUP)]    uint32 rid;
592                 [case(NETR_DELTA_USER)]            uint32 rid;
593                 [case(NETR_DELTA_DELETE_USER)]     uint32 rid;
594                 [case(NETR_DELTA_RENAME_USER)]     uint32 rid;
595                 [case(NETR_DELTA_GROUP_MEMBER)]    uint32 rid;
596                 [case(NETR_DELTA_ALIAS)]           uint32 rid;
597                 [case(NETR_DELTA_UNKNOWN1)]        uint32 rid;
598                 [case(NETR_DELTA_RENAME_ALIAS)]    uint32 rid;
599                 [case(NETR_DELTA_ALIAS_MEMBER)]    uint32 rid;
600                 [case(NETR_DELTA_POLICY)]          dom_sid2 *sid;
601                 [case(NETR_DELTA_TRUSTED_DOMAINS)] dom_sid2 *sid;
602                 [case(NETR_DELTA_UNKNOWN2)]        dom_sid2 *sid;
603                 [case(NETR_DELTA_ACCOUNTS)]        dom_sid2 *sid;
604                 [case(NETR_DELTA_UNKNOWN3)]        dom_sid2 *sid;
605                 [case(NETR_DELTA_SECRET)]          unistr *name;
606                 [case(NETR_DELTA_DELETE_GROUP2)]   unistr *name;
607                 [case(NETR_DELTA_DELETE_USER2)]    uint32 rid;
608                 [case(NETR_DELTA_MODIFY_COUNT)]    uint32 rid;
609         } netr_DELTA_ID_UNION;
610
611         typedef struct {
612                 uint16 delta_type;
613                 [switch_is(delta_type)] netr_DELTA_ID_UNION delta_id_union;
614                 [switch_is(delta_type)] netr_DELTA_UNION delta_union;
615         } netr_DELTA_ENUM;
616
617         typedef struct {
618                 uint32 num_deltas;
619                 [size_is(num_deltas)] netr_DELTA_ENUM *delta_enum;
620         } netr_DELTA_ENUM_ARRAY;
621
622
623         NTSTATUS netr_DatabaseDeltas(
624                 [in]      unistr logon_server,
625                 [in]      unistr computername,
626                 [in]      netr_Authenticator credential,
627                 [in,out]  netr_Authenticator return_authenticator,
628                 [in]      uint32 database_id,
629                 [in,out]  ULONG8 sequence_num,
630                 [in]      uint32 preferredmaximumlength,
631                 [out]     netr_DELTA_ENUM_ARRAY *delta_enum_array
632                 );
633
634
635         /*****************/
636         /* Function 0x08 */
637
638         NTSTATUS netr_DatabaseSync(
639                 [in]     unistr logon_server,
640                 [in]     unistr computername,
641                 [in]     netr_Authenticator credential,
642                 [in,out] netr_Authenticator return_authenticator,
643                 [in]     uint32 database_id,
644                 [in,out] uint32 sync_context,
645                 [in]     uint32 preferredmaximumlength,
646                 [out]    netr_DELTA_ENUM_ARRAY *delta_enum_array
647                 );
648
649
650         /*****************/
651         /* Function 0x09 */
652
653         /* w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this call */
654
655         typedef [flag(NDR_PAHEX)] struct {
656                 uint8 computer_name[16];
657                 uint32 timecreated;
658                 uint32 serial_number;
659         } netr_UAS_INFO_0;
660
661         typedef struct {
662                 [flag(NDR_REMAINING)] DATA_BLOB blob;
663         } netr_AccountBuffer;
664
665         NTSTATUS netr_AccountDeltas(
666                 [in]     unistr *logon_server,
667                 [in]     unistr computername,
668                 [in]     netr_Authenticator credential,
669                 [in,out] netr_Authenticator return_authenticator,
670                 [in]     netr_UAS_INFO_0 uas,
671                 [in]     uint32 count,
672                 [in]     uint32 level,
673                 [in]     uint32 buffersize,
674                 [out,subcontext(4)] netr_AccountBuffer buffer,
675                 [out]    uint32 count_returned,
676                 [out]    uint32 total_entries,
677                 [out]    netr_UAS_INFO_0 recordid
678                 );
679
680
681         /*****************/
682         /* Function 0x0A */
683
684         NTSTATUS netr_AccountSync(
685                 [in]      unistr *logon_server,
686                 [in]      unistr computername,
687                 [in]      netr_Authenticator credential,
688                 [in,out]  netr_Authenticator return_authenticator,
689                 [in]      uint32 reference,
690                 [in]      uint32 level,
691                 [in]      uint32 buffersize,
692                 [out,subcontext(4)] netr_AccountBuffer buffer,
693                 [out]     uint32 count_returned,
694                 [out]     uint32 total_entries,
695                 [out]     uint32 next_reference,
696                 [in,out]  netr_UAS_INFO_0 recordid
697                 );
698
699
700         /*****************/
701         /* Function 0x0B */
702
703         NTSTATUS netr_GetDcName(
704                 [in]  unistr logon_server,
705                 [in]  unistr *domainname,
706                 [out] unistr *dcname
707                 );
708
709
710
711         /*****************/
712         /* Function 0x0C */
713
714         typedef struct {
715                 uint32 flags;
716                 uint32 pdc_connection_status;
717         } netr_NETLOGON_INFO_1;
718
719         typedef struct {
720                 uint32 flags;
721                 uint32 pdc_connection_status;
722                 unistr trusted_dc_name;
723                 uint32 tc_connection_status;
724         } netr_NETLOGON_INFO_2;
725
726         typedef struct {
727                 uint32 flags;
728                 uint32 logon_attempts;
729                 uint32 unknown1;
730                 uint32 unknown2;
731                 uint32 unknown3;
732                 uint32 unknown4;
733                 uint32 unknown5;
734         } netr_NETLOGON_INFO_3;
735
736         typedef union {
737                 [case(1)]  netr_NETLOGON_INFO_1 *info1;
738                 [case(2)]  netr_NETLOGON_INFO_2 *info2;
739                 [case(3)]  netr_NETLOGON_INFO_3 *info3;
740         } netr_CONTROL_QUERY_INFORMATION;
741
742         /* function_code values */
743         const int NETLOGON_CONTROL_REDISCOVER       = 5;
744         const int NETLOGON_CONTROL_TC_QUERY         = 6;
745         const int NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7;
746         const int NETLOGON_CONTROL_SET_DBFLAG       = 65534;
747
748         WERROR netr_LogonControl(
749                 [in]   unistr *logon_server,
750                 [in]   uint32 function_code,
751                 [in]   uint32 level,
752                 [out,switch_is(level)]  netr_CONTROL_QUERY_INFORMATION info
753                 );
754
755
756         /*****************/
757         /* Function 0x0D */
758
759         WERROR netr_GetAnyDCName(
760                 [in]  unistr *logon_server,
761                 [in]  unistr *domainname,
762                 [out] unistr *dcname
763                 );
764
765
766         /*****************/
767         /* Function 0x0E */
768
769         typedef union {
770                 [case(NETLOGON_CONTROL_REDISCOVER)]        unistr *domain;
771                 [case(NETLOGON_CONTROL_TC_QUERY)]          unistr *domain;
772                 [case(NETLOGON_CONTROL_TRANSPORT_NOTIFY)]  unistr *domain;
773                 [case(NETLOGON_CONTROL_SET_DBFLAG)]        uint32 debug_level;
774         } netr_CONTROL_DATA_INFORMATION;
775
776         WERROR netr_LogonControl2(
777                 [in]    unistr *logon_server,
778                 [in]    uint32 function_code,
779                 [in]    uint32 level,
780                 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION  data,
781                 [out][switch_is(level)]        netr_CONTROL_QUERY_INFORMATION query
782                 );
783
784
785         /*****************/
786         /* Function 0x0F */
787
788         NTSTATUS netr_ServerAuthenticate2(
789                 [in]         unistr *server_name,
790                 [in]         unistr username,
791                 [in]         uint16 secure_channel_type,
792                 [in]         unistr computer_name,
793                 [in,out]     netr_Credential credentials,
794                 [in,out,ref] uint32 *negotiate_flags
795                 );
796
797
798         /*****************/
799         /* Function 0x10 */
800
801         NTSTATUS netr_DatabaseSync2(
802                 [in]     unistr logon_server,
803                 [in]     unistr computername,
804                 [in]     netr_Authenticator credential,
805                 [in,out] netr_Authenticator return_authenticator,
806                 [in]     uint32 database_id,
807                 [in]     uint16 restart_state,
808                 [in,out] uint32 sync_context,
809                 [in]     uint32 preferredmaximumlength,
810                 [out]    netr_DELTA_ENUM_ARRAY *delta_enum_array
811                 );
812
813
814         /*****************/
815         /* Function 0x11 */
816
817         /* i'm not at all sure how this call works */
818
819         NTSTATUS netr_DatabaseRedo(
820                 [in]     unistr logon_server,
821                 [in]     unistr computername,
822                 [in]     netr_Authenticator credential,
823                 [in,out] netr_Authenticator return_authenticator,
824                 [in][size_is(change_log_entry_size)] uint8 *change_log_entry,
825                 [in]     uint32 change_log_entry_size,
826                 [out]    netr_DELTA_ENUM_ARRAY *delta_enum_array
827                 );
828
829
830         /*****************/
831         /* Function 0x12 */
832
833         WERROR netr_LogonControl2Ex(
834                 [in]   unistr *logon_server,
835                 [in]   uint32 function_code,
836                 [in]   uint32 level,
837                 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION  data,
838                 [out][switch_is(level)]        netr_CONTROL_QUERY_INFORMATION query
839                 );
840 }