fix crash bug in pidl generated client code, this
[obnox/samba/samba-obnox.git] / source / librpc / gen_ndr / cli_netlogon.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_netlogon.h"
8
9 NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, const char *workstation, struct netr_UasInfo *info)
10 {
11         struct netr_LogonUasLogon r;
12         NTSTATUS status;
13         
14         /* In parameters */
15         r.in.server_name = server_name;
16         r.in.account_name = account_name;
17         r.in.workstation = workstation;
18         
19         if (DEBUGLEVEL >= 10)
20                 NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, &r);
21         
22         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONUASLOGON, &r);
23         
24         if (!NT_STATUS_IS_OK(status)) {
25                 return status;
26         }
27         
28         if (DEBUGLEVEL >= 10)
29                 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &r);
30         
31         if (NT_STATUS_IS_ERR(status)) {
32                 return status;
33         }
34         
35         /* Return variables */
36         if (info && r.out.info) {
37                 *info = *r.out.info;
38         }
39         
40         /* Return result */
41         return werror_to_ntstatus(r.out.result);
42 }
43
44 NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, const char *workstation, struct netr_UasLogoffInfo *info)
45 {
46         struct netr_LogonUasLogoff r;
47         NTSTATUS status;
48         
49         /* In parameters */
50         r.in.server_name = server_name;
51         r.in.account_name = account_name;
52         r.in.workstation = workstation;
53         
54         if (DEBUGLEVEL >= 10)
55                 NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, &r);
56         
57         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONUASLOGOFF, &r);
58         
59         if (!NT_STATUS_IS_OK(status)) {
60                 return status;
61         }
62         
63         if (DEBUGLEVEL >= 10)
64                 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &r);
65         
66         if (NT_STATUS_IS_ERR(status)) {
67                 return status;
68         }
69         
70         /* Return variables */
71         *info = *r.out.info;
72         
73         /* Return result */
74         return werror_to_ntstatus(r.out.result);
75 }
76
77 NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, uint16_t logon_level, union netr_LogonLevel logon, uint16_t validation_level, union netr_Validation *validation, uint8_t *authoritative)
78 {
79         struct netr_LogonSamLogon r;
80         NTSTATUS status;
81         
82         /* In parameters */
83         r.in.server_name = server_name;
84         r.in.computer_name = computer_name;
85         r.in.credential = credential;
86         r.in.return_authenticator = return_authenticator;
87         r.in.logon_level = logon_level;
88         r.in.logon = logon;
89         r.in.validation_level = validation_level;
90         
91         if (DEBUGLEVEL >= 10)
92                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, &r);
93         
94         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONSAMLOGON, &r);
95         
96         if (!NT_STATUS_IS_OK(status)) {
97                 return status;
98         }
99         
100         if (DEBUGLEVEL >= 10)
101                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &r);
102         
103         if (NT_STATUS_IS_ERR(status)) {
104                 return status;
105         }
106         
107         /* Return variables */
108         if (return_authenticator && r.out.return_authenticator) {
109                 *return_authenticator = *r.out.return_authenticator;
110         }
111         *validation = *r.out.validation;
112         *authoritative = *r.out.authoritative;
113         
114         /* Return result */
115         return r.out.result;
116 }
117
118 NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, uint16_t logon_level, union netr_LogonLevel logon)
119 {
120         struct netr_LogonSamLogoff r;
121         NTSTATUS status;
122         
123         /* In parameters */
124         r.in.server_name = server_name;
125         r.in.computer_name = computer_name;
126         r.in.credential = credential;
127         r.in.return_authenticator = return_authenticator;
128         r.in.logon_level = logon_level;
129         r.in.logon = logon;
130         
131         if (DEBUGLEVEL >= 10)
132                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, &r);
133         
134         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONSAMLOGOFF, &r);
135         
136         if (!NT_STATUS_IS_OK(status)) {
137                 return status;
138         }
139         
140         if (DEBUGLEVEL >= 10)
141                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &r);
142         
143         if (NT_STATUS_IS_ERR(status)) {
144                 return status;
145         }
146         
147         /* Return variables */
148         if (return_authenticator && r.out.return_authenticator) {
149                 *return_authenticator = *r.out.return_authenticator;
150         }
151         
152         /* Return result */
153         return r.out.result;
154 }
155
156 NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, struct netr_Credential *credentials)
157 {
158         struct netr_ServerReqChallenge r;
159         NTSTATUS status;
160         
161         /* In parameters */
162         r.in.server_name = server_name;
163         r.in.computer_name = computer_name;
164         r.in.credentials = credentials;
165         
166         if (DEBUGLEVEL >= 10)
167                 NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &r);
168         
169         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_SERVERREQCHALLENGE, &r);
170         
171         if (!NT_STATUS_IS_OK(status)) {
172                 return status;
173         }
174         
175         if (DEBUGLEVEL >= 10)
176                 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r);
177         
178         if (NT_STATUS_IS_ERR(status)) {
179                 return status;
180         }
181         
182         /* Return variables */
183         *credentials = *r.out.credentials;
184         
185         /* Return result */
186         return r.out.result;
187 }
188
189 NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, struct netr_Credential *credentials)
190 {
191         struct netr_ServerAuthenticate r;
192         NTSTATUS status;
193         
194         /* In parameters */
195         r.in.server_name = server_name;
196         r.in.account_name = account_name;
197         r.in.secure_channel_type = secure_channel_type;
198         r.in.computer_name = computer_name;
199         r.in.credentials = credentials;
200         
201         if (DEBUGLEVEL >= 10)
202                 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &r);
203         
204         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_SERVERAUTHENTICATE, &r);
205         
206         if (!NT_STATUS_IS_OK(status)) {
207                 return status;
208         }
209         
210         if (DEBUGLEVEL >= 10)
211                 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r);
212         
213         if (NT_STATUS_IS_ERR(status)) {
214                 return status;
215         }
216         
217         /* Return variables */
218         *credentials = *r.out.credentials;
219         
220         /* Return result */
221         return r.out.result;
222 }
223
224 NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, struct netr_Authenticator credential, struct samr_Password new_password, struct netr_Authenticator *return_authenticator)
225 {
226         struct netr_ServerPasswordSet r;
227         NTSTATUS status;
228         
229         /* In parameters */
230         r.in.server_name = server_name;
231         r.in.account_name = account_name;
232         r.in.secure_channel_type = secure_channel_type;
233         r.in.computer_name = computer_name;
234         r.in.credential = credential;
235         r.in.new_password = new_password;
236         
237         if (DEBUGLEVEL >= 10)
238                 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &r);
239         
240         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_SERVERPASSWORDSET, &r);
241         
242         if (!NT_STATUS_IS_OK(status)) {
243                 return status;
244         }
245         
246         if (DEBUGLEVEL >= 10)
247                 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r);
248         
249         if (NT_STATUS_IS_ERR(status)) {
250                 return status;
251         }
252         
253         /* Return variables */
254         *return_authenticator = *r.out.return_authenticator;
255         
256         /* Return result */
257         return r.out.result;
258 }
259
260 NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, struct netr_Authenticator credential, struct netr_Authenticator *return_authenticator, enum netr_SamDatabaseID database_id, uint64_t *sequence_num, uint32_t preferredmaximumlength, struct netr_DELTA_ENUM_ARRAY *delta_enum_array)
261 {
262         struct netr_DatabaseDeltas r;
263         NTSTATUS status;
264         
265         /* In parameters */
266         r.in.logon_server = logon_server;
267         r.in.computername = computername;
268         r.in.credential = credential;
269         r.in.return_authenticator = return_authenticator;
270         r.in.database_id = database_id;
271         r.in.sequence_num = sequence_num;
272         r.in.preferredmaximumlength = preferredmaximumlength;
273         
274         if (DEBUGLEVEL >= 10)
275                 NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &r);
276         
277         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DATABASEDELTAS, &r);
278         
279         if (!NT_STATUS_IS_OK(status)) {
280                 return status;
281         }
282         
283         if (DEBUGLEVEL >= 10)
284                 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r);
285         
286         if (NT_STATUS_IS_ERR(status)) {
287                 return status;
288         }
289         
290         /* Return variables */
291         *return_authenticator = *r.out.return_authenticator;
292         *sequence_num = *r.out.sequence_num;
293         if (delta_enum_array && r.out.delta_enum_array) {
294                 *delta_enum_array = *r.out.delta_enum_array;
295         }
296         
297         /* Return result */
298         return r.out.result;
299 }
300
301 NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, struct netr_Authenticator credential, struct netr_Authenticator *return_authenticator, enum netr_SamDatabaseID database_id, uint32_t *sync_context, uint32_t preferredmaximumlength, struct netr_DELTA_ENUM_ARRAY *delta_enum_array)
302 {
303         struct netr_DatabaseSync r;
304         NTSTATUS status;
305         
306         /* In parameters */
307         r.in.logon_server = logon_server;
308         r.in.computername = computername;
309         r.in.credential = credential;
310         r.in.return_authenticator = return_authenticator;
311         r.in.database_id = database_id;
312         r.in.sync_context = sync_context;
313         r.in.preferredmaximumlength = preferredmaximumlength;
314         
315         if (DEBUGLEVEL >= 10)
316                 NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &r);
317         
318         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DATABASESYNC, &r);
319         
320         if (!NT_STATUS_IS_OK(status)) {
321                 return status;
322         }
323         
324         if (DEBUGLEVEL >= 10)
325                 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r);
326         
327         if (NT_STATUS_IS_ERR(status)) {
328                 return status;
329         }
330         
331         /* Return variables */
332         *return_authenticator = *r.out.return_authenticator;
333         *sync_context = *r.out.sync_context;
334         if (delta_enum_array && r.out.delta_enum_array) {
335                 *delta_enum_array = *r.out.delta_enum_array;
336         }
337         
338         /* Return result */
339         return r.out.result;
340 }
341
342 NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, struct netr_Authenticator credential, struct netr_Authenticator *return_authenticator, struct netr_UAS_INFO_0 uas, uint32_t count, uint32_t level, uint32_t buffersize, struct netr_AccountBuffer *buffer, uint32_t *count_returned, uint32_t *total_entries, struct netr_UAS_INFO_0 *recordid)
343 {
344         struct netr_AccountDeltas r;
345         NTSTATUS status;
346         
347         /* In parameters */
348         r.in.logon_server = logon_server;
349         r.in.computername = computername;
350         r.in.credential = credential;
351         r.in.return_authenticator = return_authenticator;
352         r.in.uas = uas;
353         r.in.count = count;
354         r.in.level = level;
355         r.in.buffersize = buffersize;
356         
357         if (DEBUGLEVEL >= 10)
358                 NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r);
359         
360         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_ACCOUNTDELTAS, &r);
361         
362         if (!NT_STATUS_IS_OK(status)) {
363                 return status;
364         }
365         
366         if (DEBUGLEVEL >= 10)
367                 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r);
368         
369         if (NT_STATUS_IS_ERR(status)) {
370                 return status;
371         }
372         
373         /* Return variables */
374         *return_authenticator = *r.out.return_authenticator;
375         *buffer = *r.out.buffer;
376         *count_returned = *r.out.count_returned;
377         *total_entries = *r.out.total_entries;
378         *recordid = *r.out.recordid;
379         
380         /* Return result */
381         return r.out.result;
382 }
383
384 NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, struct netr_Authenticator credential, struct netr_Authenticator *return_authenticator, uint32_t reference, uint32_t level, uint32_t buffersize, struct netr_AccountBuffer *buffer, uint32_t *count_returned, uint32_t *total_entries, uint32_t *next_reference, struct netr_UAS_INFO_0 *recordid)
385 {
386         struct netr_AccountSync r;
387         NTSTATUS status;
388         
389         /* In parameters */
390         r.in.logon_server = logon_server;
391         r.in.computername = computername;
392         r.in.credential = credential;
393         r.in.return_authenticator = return_authenticator;
394         r.in.reference = reference;
395         r.in.level = level;
396         r.in.buffersize = buffersize;
397         r.in.recordid = recordid;
398         
399         if (DEBUGLEVEL >= 10)
400                 NDR_PRINT_IN_DEBUG(netr_AccountSync, &r);
401         
402         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_ACCOUNTSYNC, &r);
403         
404         if (!NT_STATUS_IS_OK(status)) {
405                 return status;
406         }
407         
408         if (DEBUGLEVEL >= 10)
409                 NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r);
410         
411         if (NT_STATUS_IS_ERR(status)) {
412                 return status;
413         }
414         
415         /* Return variables */
416         *return_authenticator = *r.out.return_authenticator;
417         *buffer = *r.out.buffer;
418         *count_returned = *r.out.count_returned;
419         *total_entries = *r.out.total_entries;
420         *next_reference = *r.out.next_reference;
421         *recordid = *r.out.recordid;
422         
423         /* Return result */
424         return r.out.result;
425 }
426
427 NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *domainname, const char **dcname)
428 {
429         struct netr_GetDcName r;
430         NTSTATUS status;
431         
432         /* In parameters */
433         r.in.logon_server = logon_server;
434         r.in.domainname = domainname;
435         
436         if (DEBUGLEVEL >= 10)
437                 NDR_PRINT_IN_DEBUG(netr_GetDcName, &r);
438         
439         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_GETDCNAME, &r);
440         
441         if (!NT_STATUS_IS_OK(status)) {
442                 return status;
443         }
444         
445         if (DEBUGLEVEL >= 10)
446                 NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r);
447         
448         if (NT_STATUS_IS_ERR(status)) {
449                 return status;
450         }
451         
452         /* Return variables */
453         *dcname = *r.out.dcname;
454         
455         /* Return result */
456         return r.out.result;
457 }
458
459 NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, enum netr_LogonControlCode function_code, uint32_t level, union netr_CONTROL_QUERY_INFORMATION *info)
460 {
461         struct netr_LogonControl r;
462         NTSTATUS status;
463         
464         /* In parameters */
465         r.in.logon_server = logon_server;
466         r.in.function_code = function_code;
467         r.in.level = level;
468         
469         if (DEBUGLEVEL >= 10)
470                 NDR_PRINT_IN_DEBUG(netr_LogonControl, &r);
471         
472         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONCONTROL, &r);
473         
474         if (!NT_STATUS_IS_OK(status)) {
475                 return status;
476         }
477         
478         if (DEBUGLEVEL >= 10)
479                 NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r);
480         
481         if (NT_STATUS_IS_ERR(status)) {
482                 return status;
483         }
484         
485         /* Return variables */
486         *info = *r.out.info;
487         
488         /* Return result */
489         return werror_to_ntstatus(r.out.result);
490 }
491
492 NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *domainname, const char **dcname)
493 {
494         struct netr_GetAnyDCName r;
495         NTSTATUS status;
496         
497         /* In parameters */
498         r.in.logon_server = logon_server;
499         r.in.domainname = domainname;
500         
501         if (DEBUGLEVEL >= 10)
502                 NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &r);
503         
504         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_GETANYDCNAME, &r);
505         
506         if (!NT_STATUS_IS_OK(status)) {
507                 return status;
508         }
509         
510         if (DEBUGLEVEL >= 10)
511                 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r);
512         
513         if (NT_STATUS_IS_ERR(status)) {
514                 return status;
515         }
516         
517         /* Return variables */
518         *dcname = *r.out.dcname;
519         
520         /* Return result */
521         return werror_to_ntstatus(r.out.result);
522 }
523
524 NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, uint32_t function_code, uint32_t level, union netr_CONTROL_DATA_INFORMATION data, union netr_CONTROL_QUERY_INFORMATION *query)
525 {
526         struct netr_LogonControl2 r;
527         NTSTATUS status;
528         
529         /* In parameters */
530         r.in.logon_server = logon_server;
531         r.in.function_code = function_code;
532         r.in.level = level;
533         r.in.data = data;
534         
535         if (DEBUGLEVEL >= 10)
536                 NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r);
537         
538         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONCONTROL2, &r);
539         
540         if (!NT_STATUS_IS_OK(status)) {
541                 return status;
542         }
543         
544         if (DEBUGLEVEL >= 10)
545                 NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r);
546         
547         if (NT_STATUS_IS_ERR(status)) {
548                 return status;
549         }
550         
551         /* Return variables */
552         *query = *r.out.query;
553         
554         /* Return result */
555         return werror_to_ntstatus(r.out.result);
556 }
557
558 NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, struct netr_Credential *credentials, uint32_t *negotiate_flags)
559 {
560         struct netr_ServerAuthenticate2 r;
561         NTSTATUS status;
562         
563         /* In parameters */
564         r.in.server_name = server_name;
565         r.in.account_name = account_name;
566         r.in.secure_channel_type = secure_channel_type;
567         r.in.computer_name = computer_name;
568         r.in.credentials = credentials;
569         r.in.negotiate_flags = negotiate_flags;
570         
571         if (DEBUGLEVEL >= 10)
572                 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &r);
573         
574         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_SERVERAUTHENTICATE2, &r);
575         
576         if (!NT_STATUS_IS_OK(status)) {
577                 return status;
578         }
579         
580         if (DEBUGLEVEL >= 10)
581                 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r);
582         
583         if (NT_STATUS_IS_ERR(status)) {
584                 return status;
585         }
586         
587         /* Return variables */
588         *credentials = *r.out.credentials;
589         *negotiate_flags = *r.out.negotiate_flags;
590         
591         /* Return result */
592         return r.out.result;
593 }
594
595 NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, struct netr_Authenticator credential, struct netr_Authenticator *return_authenticator, enum netr_SamDatabaseID database_id, uint16_t restart_state, uint32_t *sync_context, uint32_t preferredmaximumlength, struct netr_DELTA_ENUM_ARRAY *delta_enum_array)
596 {
597         struct netr_DatabaseSync2 r;
598         NTSTATUS status;
599         
600         /* In parameters */
601         r.in.logon_server = logon_server;
602         r.in.computername = computername;
603         r.in.credential = credential;
604         r.in.return_authenticator = return_authenticator;
605         r.in.database_id = database_id;
606         r.in.restart_state = restart_state;
607         r.in.sync_context = sync_context;
608         r.in.preferredmaximumlength = preferredmaximumlength;
609         
610         if (DEBUGLEVEL >= 10)
611                 NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &r);
612         
613         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DATABASESYNC2, &r);
614         
615         if (!NT_STATUS_IS_OK(status)) {
616                 return status;
617         }
618         
619         if (DEBUGLEVEL >= 10)
620                 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r);
621         
622         if (NT_STATUS_IS_ERR(status)) {
623                 return status;
624         }
625         
626         /* Return variables */
627         *return_authenticator = *r.out.return_authenticator;
628         *sync_context = *r.out.sync_context;
629         if (delta_enum_array && r.out.delta_enum_array) {
630                 *delta_enum_array = *r.out.delta_enum_array;
631         }
632         
633         /* Return result */
634         return r.out.result;
635 }
636
637 NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, struct netr_Authenticator credential, struct netr_Authenticator *return_authenticator, uint8_t *change_log_entry, uint32_t change_log_entry_size, struct netr_DELTA_ENUM_ARRAY *delta_enum_array)
638 {
639         struct netr_DatabaseRedo r;
640         NTSTATUS status;
641         
642         /* In parameters */
643         r.in.logon_server = logon_server;
644         r.in.computername = computername;
645         r.in.credential = credential;
646         r.in.return_authenticator = return_authenticator;
647         r.in.change_log_entry = change_log_entry;
648         r.in.change_log_entry_size = change_log_entry_size;
649         
650         if (DEBUGLEVEL >= 10)
651                 NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &r);
652         
653         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DATABASEREDO, &r);
654         
655         if (!NT_STATUS_IS_OK(status)) {
656                 return status;
657         }
658         
659         if (DEBUGLEVEL >= 10)
660                 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r);
661         
662         if (NT_STATUS_IS_ERR(status)) {
663                 return status;
664         }
665         
666         /* Return variables */
667         *return_authenticator = *r.out.return_authenticator;
668         if (delta_enum_array && r.out.delta_enum_array) {
669                 *delta_enum_array = *r.out.delta_enum_array;
670         }
671         
672         /* Return result */
673         return r.out.result;
674 }
675
676 NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, uint32_t function_code, uint32_t level, union netr_CONTROL_DATA_INFORMATION data, union netr_CONTROL_QUERY_INFORMATION *query)
677 {
678         struct netr_LogonControl2Ex r;
679         NTSTATUS status;
680         
681         /* In parameters */
682         r.in.logon_server = logon_server;
683         r.in.function_code = function_code;
684         r.in.level = level;
685         r.in.data = data;
686         
687         if (DEBUGLEVEL >= 10)
688                 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r);
689         
690         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONCONTROL2EX, &r);
691         
692         if (!NT_STATUS_IS_OK(status)) {
693                 return status;
694         }
695         
696         if (DEBUGLEVEL >= 10)
697                 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r);
698         
699         if (NT_STATUS_IS_ERR(status)) {
700                 return status;
701         }
702         
703         /* Return variables */
704         *query = *r.out.query;
705         
706         /* Return result */
707         return werror_to_ntstatus(r.out.result);
708 }
709
710 NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINS(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
711 {
712         struct netr_NETRENUMERATETRUSTEDDOMAINS r;
713         NTSTATUS status;
714         
715         /* In parameters */
716         
717         if (DEBUGLEVEL >= 10)
718                 NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, &r);
719         
720         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, &r);
721         
722         if (!NT_STATUS_IS_OK(status)) {
723                 return status;
724         }
725         
726         if (DEBUGLEVEL >= 10)
727                 NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, &r);
728         
729         if (NT_STATUS_IS_ERR(status)) {
730                 return status;
731         }
732         
733         /* Return variables */
734         
735         /* Return result */
736         return werror_to_ntstatus(r.out.result);
737 }
738
739 NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_unc, const char *domain_name, struct GUID *domain_guid, struct GUID *site_guid, uint32_t flags, struct netr_DsRGetDCNameInfo *info)
740 {
741         struct netr_DsRGetDCName r;
742         NTSTATUS status;
743         
744         /* In parameters */
745         r.in.server_unc = server_unc;
746         r.in.domain_name = domain_name;
747         r.in.domain_guid = domain_guid;
748         r.in.site_guid = site_guid;
749         r.in.flags = flags;
750         
751         if (DEBUGLEVEL >= 10)
752                 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r);
753         
754         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRGETDCNAME, &r);
755         
756         if (!NT_STATUS_IS_OK(status)) {
757                 return status;
758         }
759         
760         if (DEBUGLEVEL >= 10)
761                 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r);
762         
763         if (NT_STATUS_IS_ERR(status)) {
764                 return status;
765         }
766         
767         /* Return variables */
768         if (info && r.out.info) {
769                 *info = *r.out.info;
770         }
771         
772         /* Return result */
773         return werror_to_ntstatus(r.out.result);
774 }
775
776 NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
777 {
778         struct netr_NETRLOGONDUMMYROUTINE1 r;
779         NTSTATUS status;
780         
781         /* In parameters */
782         
783         if (DEBUGLEVEL >= 10)
784                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r);
785         
786         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRLOGONDUMMYROUTINE1, &r);
787         
788         if (!NT_STATUS_IS_OK(status)) {
789                 return status;
790         }
791         
792         if (DEBUGLEVEL >= 10)
793                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r);
794         
795         if (NT_STATUS_IS_ERR(status)) {
796                 return status;
797         }
798         
799         /* Return variables */
800         
801         /* Return result */
802         return werror_to_ntstatus(r.out.result);
803 }
804
805 NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
806 {
807         struct netr_NETRLOGONSETSERVICEBITS r;
808         NTSTATUS status;
809         
810         /* In parameters */
811         
812         if (DEBUGLEVEL >= 10)
813                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
814         
815         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRLOGONSETSERVICEBITS, &r);
816         
817         if (!NT_STATUS_IS_OK(status)) {
818                 return status;
819         }
820         
821         if (DEBUGLEVEL >= 10)
822                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
823         
824         if (NT_STATUS_IS_ERR(status)) {
825                 return status;
826         }
827         
828         /* Return variables */
829         
830         /* Return result */
831         return werror_to_ntstatus(r.out.result);
832 }
833
834 NTSTATUS rpccli_netr_NETRLOGONGETTRUSTRID(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
835 {
836         struct netr_NETRLOGONGETTRUSTRID r;
837         NTSTATUS status;
838         
839         /* In parameters */
840         
841         if (DEBUGLEVEL >= 10)
842                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTRUSTRID, &r);
843         
844         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRLOGONGETTRUSTRID, &r);
845         
846         if (!NT_STATUS_IS_OK(status)) {
847                 return status;
848         }
849         
850         if (DEBUGLEVEL >= 10)
851                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTRUSTRID, &r);
852         
853         if (NT_STATUS_IS_ERR(status)) {
854                 return status;
855         }
856         
857         /* Return variables */
858         
859         /* Return result */
860         return werror_to_ntstatus(r.out.result);
861 }
862
863 NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
864 {
865         struct netr_NETRLOGONCOMPUTESERVERDIGEST r;
866         NTSTATUS status;
867         
868         /* In parameters */
869         
870         if (DEBUGLEVEL >= 10)
871                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
872         
873         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, &r);
874         
875         if (!NT_STATUS_IS_OK(status)) {
876                 return status;
877         }
878         
879         if (DEBUGLEVEL >= 10)
880                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
881         
882         if (NT_STATUS_IS_ERR(status)) {
883                 return status;
884         }
885         
886         /* Return variables */
887         
888         /* Return result */
889         return werror_to_ntstatus(r.out.result);
890 }
891
892 NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
893 {
894         struct netr_NETRLOGONCOMPUTECLIENTDIGEST r;
895         NTSTATUS status;
896         
897         /* In parameters */
898         
899         if (DEBUGLEVEL >= 10)
900                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
901         
902         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, &r);
903         
904         if (!NT_STATUS_IS_OK(status)) {
905                 return status;
906         }
907         
908         if (DEBUGLEVEL >= 10)
909                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
910         
911         if (NT_STATUS_IS_ERR(status)) {
912                 return status;
913         }
914         
915         /* Return variables */
916         
917         /* Return result */
918         return werror_to_ntstatus(r.out.result);
919 }
920
921 NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, struct netr_Credential *credentials, uint32_t *negotiate_flags, uint32_t *rid)
922 {
923         struct netr_ServerAuthenticate3 r;
924         NTSTATUS status;
925         
926         /* In parameters */
927         r.in.server_name = server_name;
928         r.in.account_name = account_name;
929         r.in.secure_channel_type = secure_channel_type;
930         r.in.computer_name = computer_name;
931         r.in.credentials = credentials;
932         r.in.negotiate_flags = negotiate_flags;
933         
934         if (DEBUGLEVEL >= 10)
935                 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, &r);
936         
937         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_SERVERAUTHENTICATE3, &r);
938         
939         if (!NT_STATUS_IS_OK(status)) {
940                 return status;
941         }
942         
943         if (DEBUGLEVEL >= 10)
944                 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &r);
945         
946         if (NT_STATUS_IS_ERR(status)) {
947                 return status;
948         }
949         
950         /* Return variables */
951         *credentials = *r.out.credentials;
952         *negotiate_flags = *r.out.negotiate_flags;
953         *rid = *r.out.rid;
954         
955         /* Return result */
956         return r.out.result;
957 }
958
959 NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_unc, const char *domain_name, struct GUID *domain_guid, const char *site_name, uint32_t flags, struct netr_DsRGetDCNameInfo *info)
960 {
961         struct netr_DsRGetDCNameEx r;
962         NTSTATUS status;
963         
964         /* In parameters */
965         r.in.server_unc = server_unc;
966         r.in.domain_name = domain_name;
967         r.in.domain_guid = domain_guid;
968         r.in.site_name = site_name;
969         r.in.flags = flags;
970         
971         if (DEBUGLEVEL >= 10)
972                 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, &r);
973         
974         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRGETDCNAMEEX, &r);
975         
976         if (!NT_STATUS_IS_OK(status)) {
977                 return status;
978         }
979         
980         if (DEBUGLEVEL >= 10)
981                 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &r);
982         
983         if (NT_STATUS_IS_ERR(status)) {
984                 return status;
985         }
986         
987         /* Return variables */
988         if (info && r.out.info) {
989                 *info = *r.out.info;
990         }
991         
992         /* Return result */
993         return werror_to_ntstatus(r.out.result);
994 }
995
996 NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *computer_name, const char **site)
997 {
998         struct netr_DsRGetSiteName r;
999         NTSTATUS status;
1000         
1001         /* In parameters */
1002         r.in.computer_name = computer_name;
1003         
1004         if (DEBUGLEVEL >= 10)
1005                 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, &r);
1006         
1007         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRGETSITENAME, &r);
1008         
1009         if (!NT_STATUS_IS_OK(status)) {
1010                 return status;
1011         }
1012         
1013         if (DEBUGLEVEL >= 10)
1014                 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &r);
1015         
1016         if (NT_STATUS_IS_ERR(status)) {
1017                 return status;
1018         }
1019         
1020         /* Return variables */
1021         *site = *r.out.site;
1022         
1023         /* Return result */
1024         return werror_to_ntstatus(r.out.result);
1025 }
1026
1027 NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, uint32_t level, union netr_DomainQuery query, union netr_DomainInfo *info)
1028 {
1029         struct netr_LogonGetDomainInfo r;
1030         NTSTATUS status;
1031         
1032         /* In parameters */
1033         r.in.server_name = server_name;
1034         r.in.computer_name = computer_name;
1035         r.in.credential = credential;
1036         r.in.return_authenticator = return_authenticator;
1037         r.in.level = level;
1038         r.in.query = query;
1039         
1040         if (DEBUGLEVEL >= 10)
1041                 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, &r);
1042         
1043         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONGETDOMAININFO, &r);
1044         
1045         if (!NT_STATUS_IS_OK(status)) {
1046                 return status;
1047         }
1048         
1049         if (DEBUGLEVEL >= 10)
1050                 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &r);
1051         
1052         if (NT_STATUS_IS_ERR(status)) {
1053                 return status;
1054         }
1055         
1056         /* Return variables */
1057         *return_authenticator = *r.out.return_authenticator;
1058         *info = *r.out.info;
1059         
1060         /* Return result */
1061         return r.out.result;
1062 }
1063
1064 NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, struct netr_Authenticator credential, struct netr_CryptPassword new_password, struct netr_Authenticator *return_authenticator)
1065 {
1066         struct netr_ServerPasswordSet2 r;
1067         NTSTATUS status;
1068         
1069         /* In parameters */
1070         r.in.server_name = server_name;
1071         r.in.account_name = account_name;
1072         r.in.secure_channel_type = secure_channel_type;
1073         r.in.computer_name = computer_name;
1074         r.in.credential = credential;
1075         r.in.new_password = new_password;
1076         
1077         if (DEBUGLEVEL >= 10)
1078                 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, &r);
1079         
1080         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_SERVERPASSWORDSET2, &r);
1081         
1082         if (!NT_STATUS_IS_OK(status)) {
1083                 return status;
1084         }
1085         
1086         if (DEBUGLEVEL >= 10)
1087                 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r);
1088         
1089         if (NT_STATUS_IS_ERR(status)) {
1090                 return status;
1091         }
1092         
1093         /* Return variables */
1094         *return_authenticator = *r.out.return_authenticator;
1095         
1096         /* Return result */
1097         return r.out.result;
1098 }
1099
1100 NTSTATUS rpccli_netr_NETRSERVERPASSWORDGET(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1101 {
1102         struct netr_NETRSERVERPASSWORDGET r;
1103         NTSTATUS status;
1104         
1105         /* In parameters */
1106         
1107         if (DEBUGLEVEL >= 10)
1108                 NDR_PRINT_IN_DEBUG(netr_NETRSERVERPASSWORDGET, &r);
1109         
1110         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRSERVERPASSWORDGET, &r);
1111         
1112         if (!NT_STATUS_IS_OK(status)) {
1113                 return status;
1114         }
1115         
1116         if (DEBUGLEVEL >= 10)
1117                 NDR_PRINT_OUT_DEBUG(netr_NETRSERVERPASSWORDGET, &r);
1118         
1119         if (NT_STATUS_IS_ERR(status)) {
1120                 return status;
1121         }
1122         
1123         /* Return variables */
1124         
1125         /* Return result */
1126         return werror_to_ntstatus(r.out.result);
1127 }
1128
1129 NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1130 {
1131         struct netr_NETRLOGONSENDTOSAM r;
1132         NTSTATUS status;
1133         
1134         /* In parameters */
1135         
1136         if (DEBUGLEVEL >= 10)
1137                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
1138         
1139         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRLOGONSENDTOSAM, &r);
1140         
1141         if (!NT_STATUS_IS_OK(status)) {
1142                 return status;
1143         }
1144         
1145         if (DEBUGLEVEL >= 10)
1146                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
1147         
1148         if (NT_STATUS_IS_ERR(status)) {
1149                 return status;
1150         }
1151         
1152         /* Return variables */
1153         
1154         /* Return result */
1155         return werror_to_ntstatus(r.out.result);
1156 }
1157
1158 NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1159 {
1160         struct netr_DSRADDRESSTOSITENAMESW r;
1161         NTSTATUS status;
1162         
1163         /* In parameters */
1164         
1165         if (DEBUGLEVEL >= 10)
1166                 NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESW, &r);
1167         
1168         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRADDRESSTOSITENAMESW, &r);
1169         
1170         if (!NT_STATUS_IS_OK(status)) {
1171                 return status;
1172         }
1173         
1174         if (DEBUGLEVEL >= 10)
1175                 NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESW, &r);
1176         
1177         if (NT_STATUS_IS_ERR(status)) {
1178                 return status;
1179         }
1180         
1181         /* Return variables */
1182         
1183         /* Return result */
1184         return werror_to_ntstatus(r.out.result);
1185 }
1186
1187 NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_unc, const char *client_account, uint32_t mask, const char *domain_name, struct GUID *domain_guid, const char *site_name, uint32_t flags, struct netr_DsRGetDCNameInfo *info)
1188 {
1189         struct netr_DsRGetDCNameEx2 r;
1190         NTSTATUS status;
1191         
1192         /* In parameters */
1193         r.in.server_unc = server_unc;
1194         r.in.client_account = client_account;
1195         r.in.mask = mask;
1196         r.in.domain_name = domain_name;
1197         r.in.domain_guid = domain_guid;
1198         r.in.site_name = site_name;
1199         r.in.flags = flags;
1200         
1201         if (DEBUGLEVEL >= 10)
1202                 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, &r);
1203         
1204         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRGETDCNAMEEX2, &r);
1205         
1206         if (!NT_STATUS_IS_OK(status)) {
1207                 return status;
1208         }
1209         
1210         if (DEBUGLEVEL >= 10)
1211                 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &r);
1212         
1213         if (NT_STATUS_IS_ERR(status)) {
1214                 return status;
1215         }
1216         
1217         /* Return variables */
1218         if (info && r.out.info) {
1219                 *info = *r.out.info;
1220         }
1221         
1222         /* Return result */
1223         return werror_to_ntstatus(r.out.result);
1224 }
1225
1226 NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1227 {
1228         struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r;
1229         NTSTATUS status;
1230         
1231         /* In parameters */
1232         
1233         if (DEBUGLEVEL >= 10)
1234                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
1235         
1236         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
1237         
1238         if (!NT_STATUS_IS_OK(status)) {
1239                 return status;
1240         }
1241         
1242         if (DEBUGLEVEL >= 10)
1243                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
1244         
1245         if (NT_STATUS_IS_ERR(status)) {
1246                 return status;
1247         }
1248         
1249         /* Return variables */
1250         
1251         /* Return result */
1252         return werror_to_ntstatus(r.out.result);
1253 }
1254
1255 NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1256 {
1257         struct netr_NETRENUMERATETRUSTEDDOMAINSEX r;
1258         NTSTATUS status;
1259         
1260         /* In parameters */
1261         
1262         if (DEBUGLEVEL >= 10)
1263                 NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, &r);
1264         
1265         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, &r);
1266         
1267         if (!NT_STATUS_IS_OK(status)) {
1268                 return status;
1269         }
1270         
1271         if (DEBUGLEVEL >= 10)
1272                 NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, &r);
1273         
1274         if (NT_STATUS_IS_ERR(status)) {
1275                 return status;
1276         }
1277         
1278         /* Return variables */
1279         
1280         /* Return result */
1281         return werror_to_ntstatus(r.out.result);
1282 }
1283
1284 NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESEXW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1285 {
1286         struct netr_DSRADDRESSTOSITENAMESEXW r;
1287         NTSTATUS status;
1288         
1289         /* In parameters */
1290         
1291         if (DEBUGLEVEL >= 10)
1292                 NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, &r);
1293         
1294         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRADDRESSTOSITENAMESEXW, &r);
1295         
1296         if (!NT_STATUS_IS_OK(status)) {
1297                 return status;
1298         }
1299         
1300         if (DEBUGLEVEL >= 10)
1301                 NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, &r);
1302         
1303         if (NT_STATUS_IS_ERR(status)) {
1304                 return status;
1305         }
1306         
1307         /* Return variables */
1308         
1309         /* Return result */
1310         return werror_to_ntstatus(r.out.result);
1311 }
1312
1313 NTSTATUS rpccli_netr_DSRGETDCSITECOVERAGEW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1314 {
1315         struct netr_DSRGETDCSITECOVERAGEW r;
1316         NTSTATUS status;
1317         
1318         /* In parameters */
1319         
1320         if (DEBUGLEVEL >= 10)
1321                 NDR_PRINT_IN_DEBUG(netr_DSRGETDCSITECOVERAGEW, &r);
1322         
1323         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRGETDCSITECOVERAGEW, &r);
1324         
1325         if (!NT_STATUS_IS_OK(status)) {
1326                 return status;
1327         }
1328         
1329         if (DEBUGLEVEL >= 10)
1330                 NDR_PRINT_OUT_DEBUG(netr_DSRGETDCSITECOVERAGEW, &r);
1331         
1332         if (NT_STATUS_IS_ERR(status)) {
1333                 return status;
1334         }
1335         
1336         /* Return variables */
1337         
1338         /* Return result */
1339         return werror_to_ntstatus(r.out.result);
1340 }
1341
1342 NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, uint16_t logon_level, union netr_LogonLevel logon, uint16_t validation_level, union netr_Validation *validation, uint8_t *authoritative, uint32_t *flags)
1343 {
1344         struct netr_LogonSamLogonEx r;
1345         NTSTATUS status;
1346         
1347         /* In parameters */
1348         r.in.server_name = server_name;
1349         r.in.computer_name = computer_name;
1350         r.in.logon_level = logon_level;
1351         r.in.logon = logon;
1352         r.in.validation_level = validation_level;
1353         r.in.flags = flags;
1354         
1355         if (DEBUGLEVEL >= 10)
1356                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, &r);
1357         
1358         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONSAMLOGONEX, &r);
1359         
1360         if (!NT_STATUS_IS_OK(status)) {
1361                 return status;
1362         }
1363         
1364         if (DEBUGLEVEL >= 10)
1365                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &r);
1366         
1367         if (NT_STATUS_IS_ERR(status)) {
1368                 return status;
1369         }
1370         
1371         /* Return variables */
1372         *validation = *r.out.validation;
1373         *authoritative = *r.out.authoritative;
1374         *flags = *r.out.flags;
1375         
1376         /* Return result */
1377         return r.out.result;
1378 }
1379
1380 NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, uint32_t trust_flags, uint32_t *count, struct netr_DomainTrust **trusts)
1381 {
1382         struct netr_DsrEnumerateDomainTrusts r;
1383         NTSTATUS status;
1384         
1385         /* In parameters */
1386         r.in.server_name = server_name;
1387         r.in.trust_flags = trust_flags;
1388         
1389         if (DEBUGLEVEL >= 10)
1390                 NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
1391         
1392         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRENUMERATEDOMAINTRUSTS, &r);
1393         
1394         if (!NT_STATUS_IS_OK(status)) {
1395                 return status;
1396         }
1397         
1398         if (DEBUGLEVEL >= 10)
1399                 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
1400         
1401         if (NT_STATUS_IS_ERR(status)) {
1402                 return status;
1403         }
1404         
1405         /* Return variables */
1406         *count = *r.out.count;
1407         memcpy(trusts, r.out.trusts, count);
1408         
1409         /* Return result */
1410         return werror_to_ntstatus(r.out.result);
1411 }
1412
1413 NTSTATUS rpccli_netr_DSRDEREGISTERDNSHOSTRECORDS(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1414 {
1415         struct netr_DSRDEREGISTERDNSHOSTRECORDS r;
1416         NTSTATUS status;
1417         
1418         /* In parameters */
1419         
1420         if (DEBUGLEVEL >= 10)
1421                 NDR_PRINT_IN_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, &r);
1422         
1423         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, &r);
1424         
1425         if (!NT_STATUS_IS_OK(status)) {
1426                 return status;
1427         }
1428         
1429         if (DEBUGLEVEL >= 10)
1430                 NDR_PRINT_OUT_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, &r);
1431         
1432         if (NT_STATUS_IS_ERR(status)) {
1433                 return status;
1434         }
1435         
1436         /* Return variables */
1437         
1438         /* Return result */
1439         return werror_to_ntstatus(r.out.result);
1440 }
1441
1442 NTSTATUS rpccli_netr_NETRSERVERTRUSTPASSWORDSGET(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1443 {
1444         struct netr_NETRSERVERTRUSTPASSWORDSGET r;
1445         NTSTATUS status;
1446         
1447         /* In parameters */
1448         
1449         if (DEBUGLEVEL >= 10)
1450                 NDR_PRINT_IN_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, &r);
1451         
1452         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRSERVERTRUSTPASSWORDSGET, &r);
1453         
1454         if (!NT_STATUS_IS_OK(status)) {
1455                 return status;
1456         }
1457         
1458         if (DEBUGLEVEL >= 10)
1459                 NDR_PRINT_OUT_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, &r);
1460         
1461         if (NT_STATUS_IS_ERR(status)) {
1462                 return status;
1463         }
1464         
1465         /* Return variables */
1466         
1467         /* Return result */
1468         return werror_to_ntstatus(r.out.result);
1469 }
1470
1471 NTSTATUS rpccli_netr_DSRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1472 {
1473         struct netr_DSRGETFORESTTRUSTINFORMATION r;
1474         NTSTATUS status;
1475         
1476         /* In parameters */
1477         
1478         if (DEBUGLEVEL >= 10)
1479                 NDR_PRINT_IN_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, &r);
1480         
1481         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_DSRGETFORESTTRUSTINFORMATION, &r);
1482         
1483         if (!NT_STATUS_IS_OK(status)) {
1484                 return status;
1485         }
1486         
1487         if (DEBUGLEVEL >= 10)
1488                 NDR_PRINT_OUT_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, &r);
1489         
1490         if (NT_STATUS_IS_ERR(status)) {
1491                 return status;
1492         }
1493         
1494         /* Return variables */
1495         
1496         /* Return result */
1497         return werror_to_ntstatus(r.out.result);
1498 }
1499
1500 NTSTATUS rpccli_netr_NETRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1501 {
1502         struct netr_NETRGETFORESTTRUSTINFORMATION r;
1503         NTSTATUS status;
1504         
1505         /* In parameters */
1506         
1507         if (DEBUGLEVEL >= 10)
1508                 NDR_PRINT_IN_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, &r);
1509         
1510         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRGETFORESTTRUSTINFORMATION, &r);
1511         
1512         if (!NT_STATUS_IS_OK(status)) {
1513                 return status;
1514         }
1515         
1516         if (DEBUGLEVEL >= 10)
1517                 NDR_PRINT_OUT_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, &r);
1518         
1519         if (NT_STATUS_IS_ERR(status)) {
1520                 return status;
1521         }
1522         
1523         /* Return variables */
1524         
1525         /* Return result */
1526         return werror_to_ntstatus(r.out.result);
1527 }
1528
1529 NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, uint16_t logon_level, union netr_LogonLevel logon, uint16_t validation_level, union netr_Validation *validation, uint8_t *authoritative, uint32_t *flags)
1530 {
1531         struct netr_LogonSamLogonWithFlags r;
1532         NTSTATUS status;
1533         
1534         /* In parameters */
1535         r.in.server_name = server_name;
1536         r.in.computer_name = computer_name;
1537         r.in.credential = credential;
1538         r.in.return_authenticator = return_authenticator;
1539         r.in.logon_level = logon_level;
1540         r.in.logon = logon;
1541         r.in.validation_level = validation_level;
1542         r.in.flags = flags;
1543         
1544         if (DEBUGLEVEL >= 10)
1545                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, &r);
1546         
1547         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_LOGONSAMLOGONWITHFLAGS, &r);
1548         
1549         if (!NT_STATUS_IS_OK(status)) {
1550                 return status;
1551         }
1552         
1553         if (DEBUGLEVEL >= 10)
1554                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &r);
1555         
1556         if (NT_STATUS_IS_ERR(status)) {
1557                 return status;
1558         }
1559         
1560         /* Return variables */
1561         if (return_authenticator && r.out.return_authenticator) {
1562                 *return_authenticator = *r.out.return_authenticator;
1563         }
1564         *validation = *r.out.validation;
1565         *authoritative = *r.out.authoritative;
1566         *flags = *r.out.flags;
1567         
1568         /* Return result */
1569         return r.out.result;
1570 }
1571
1572 NTSTATUS rpccli_netr_NETRSERVERGETTRUSTINFO(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1573 {
1574         struct netr_NETRSERVERGETTRUSTINFO r;
1575         NTSTATUS status;
1576         
1577         /* In parameters */
1578         
1579         if (DEBUGLEVEL >= 10)
1580                 NDR_PRINT_IN_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
1581         
1582         status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, NDR_NETR_NETRSERVERGETTRUSTINFO, &r);
1583         
1584         if (!NT_STATUS_IS_OK(status)) {
1585                 return status;
1586         }
1587         
1588         if (DEBUGLEVEL >= 10)
1589                 NDR_PRINT_OUT_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
1590         
1591         if (NT_STATUS_IS_ERR(status)) {
1592                 return status;
1593         }
1594         
1595         /* Return variables */
1596         
1597         /* Return result */
1598         return werror_to_ntstatus(r.out.result);
1599 }
1600