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