git add -f bin/default/librpc/gen_ndr/*.{c,h,ndr,pidl} bin/default/source*/librpc...
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / s3compat_lsa.c
1 #include "includes.h"
2 #include "ntdomain.h"
3 #include "lib/util/tevent_ntstatus.h"
4 #include "librpc/rpc/dcerpc_connection.h"
5 #include "bin/default/librpc/gen_ndr/s3compat_lsa.h"
6
7 struct _s3_compat_lsa_Close_state {
8         struct tevent_context *ev;
9         struct dcerpc_call_handle *call;
10         struct lsa_Close *r;
11 };
12
13 static struct tevent_req *_s3_compat_lsa_Close_send(TALLOC_CTX *mem_ctx,
14                                                     struct tevent_context *ev,
15                                                     struct dcerpc_call_handle *call,
16                                                     struct lsa_Close *r)
17 {
18         struct tevent_req *req;
19         struct _s3_compat_lsa_Close_state *state;
20         struct pipes_struct *p;
21
22         req = tevent_req_create(mem_ctx, &state,
23                                 struct _s3_compat_lsa_Close_state);
24         if (req == NULL) {
25                 return NULL;
26         }
27         state->ev = ev;
28         state->call = call;
29         state->r = r;
30
31         p = dcerpc_call_handle_get_pipes_struct(call);
32         if (p == NULL) {
33                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
34                 return tevent_req_post(req, ev);
35         }
36
37         ZERO_STRUCT(r->out);
38         r->out.handle = r->in.handle;
39         r->out.result = _lsa_Close(p, r);
40
41         if (p->fault_state) {
42                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
43                 tevent_req_nterror(req, status);
44                 return tevent_req_post(req, ev);
45         }
46
47         tevent_req_done(req);
48         return tevent_req_post(req, ev);
49 }
50
51 static NTSTATUS _s3_compat_lsa_Close_recv(struct tevent_req *req)
52 {
53         return tevent_req_simple_recv_ntstatus(req);
54 }
55
56 struct _s3_compat_lsa_Delete_state {
57         struct tevent_context *ev;
58         struct dcerpc_call_handle *call;
59         struct lsa_Delete *r;
60 };
61
62 static struct tevent_req *_s3_compat_lsa_Delete_send(TALLOC_CTX *mem_ctx,
63                                                      struct tevent_context *ev,
64                                                      struct dcerpc_call_handle *call,
65                                                      struct lsa_Delete *r)
66 {
67         struct tevent_req *req;
68         struct _s3_compat_lsa_Delete_state *state;
69         struct pipes_struct *p;
70
71         req = tevent_req_create(mem_ctx, &state,
72                                 struct _s3_compat_lsa_Delete_state);
73         if (req == NULL) {
74                 return NULL;
75         }
76         state->ev = ev;
77         state->call = call;
78         state->r = r;
79
80         p = dcerpc_call_handle_get_pipes_struct(call);
81         if (p == NULL) {
82                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
83                 return tevent_req_post(req, ev);
84         }
85
86         r->out.result = _lsa_Delete(p, r);
87
88         if (p->fault_state) {
89                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
90                 tevent_req_nterror(req, status);
91                 return tevent_req_post(req, ev);
92         }
93
94         tevent_req_done(req);
95         return tevent_req_post(req, ev);
96 }
97
98 static NTSTATUS _s3_compat_lsa_Delete_recv(struct tevent_req *req)
99 {
100         return tevent_req_simple_recv_ntstatus(req);
101 }
102
103 struct _s3_compat_lsa_EnumPrivs_state {
104         struct tevent_context *ev;
105         struct dcerpc_call_handle *call;
106         struct lsa_EnumPrivs *r;
107 };
108
109 static struct tevent_req *_s3_compat_lsa_EnumPrivs_send(TALLOC_CTX *mem_ctx,
110                                                         struct tevent_context *ev,
111                                                         struct dcerpc_call_handle *call,
112                                                         struct lsa_EnumPrivs *r)
113 {
114         struct tevent_req *req;
115         struct _s3_compat_lsa_EnumPrivs_state *state;
116         struct pipes_struct *p;
117
118         req = tevent_req_create(mem_ctx, &state,
119                                 struct _s3_compat_lsa_EnumPrivs_state);
120         if (req == NULL) {
121                 return NULL;
122         }
123         state->ev = ev;
124         state->call = call;
125         state->r = r;
126
127         p = dcerpc_call_handle_get_pipes_struct(call);
128         if (p == NULL) {
129                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
130                 return tevent_req_post(req, ev);
131         }
132
133         ZERO_STRUCT(r->out);
134         r->out.resume_handle = r->in.resume_handle;
135         r->out.privs = talloc_zero(r, struct lsa_PrivArray);
136         if (tevent_req_nomem(r->out.privs, req)) {
137                 return tevent_req_post(req, ev);
138         }
139
140         r->out.result = _lsa_EnumPrivs(p, r);
141
142         if (p->fault_state) {
143                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
144                 tevent_req_nterror(req, status);
145                 return tevent_req_post(req, ev);
146         }
147
148         tevent_req_done(req);
149         return tevent_req_post(req, ev);
150 }
151
152 static NTSTATUS _s3_compat_lsa_EnumPrivs_recv(struct tevent_req *req)
153 {
154         return tevent_req_simple_recv_ntstatus(req);
155 }
156
157 struct _s3_compat_lsa_QuerySecurity_state {
158         struct tevent_context *ev;
159         struct dcerpc_call_handle *call;
160         struct lsa_QuerySecurity *r;
161 };
162
163 static struct tevent_req *_s3_compat_lsa_QuerySecurity_send(TALLOC_CTX *mem_ctx,
164                                                             struct tevent_context *ev,
165                                                             struct dcerpc_call_handle *call,
166                                                             struct lsa_QuerySecurity *r)
167 {
168         struct tevent_req *req;
169         struct _s3_compat_lsa_QuerySecurity_state *state;
170         struct pipes_struct *p;
171
172         req = tevent_req_create(mem_ctx, &state,
173                                 struct _s3_compat_lsa_QuerySecurity_state);
174         if (req == NULL) {
175                 return NULL;
176         }
177         state->ev = ev;
178         state->call = call;
179         state->r = r;
180
181         p = dcerpc_call_handle_get_pipes_struct(call);
182         if (p == NULL) {
183                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
184                 return tevent_req_post(req, ev);
185         }
186
187         ZERO_STRUCT(r->out);
188         r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *);
189         if (tevent_req_nomem(r->out.sdbuf, req)) {
190                 return tevent_req_post(req, ev);
191         }
192
193         r->out.result = _lsa_QuerySecurity(p, r);
194
195         if (p->fault_state) {
196                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
197                 tevent_req_nterror(req, status);
198                 return tevent_req_post(req, ev);
199         }
200
201         tevent_req_done(req);
202         return tevent_req_post(req, ev);
203 }
204
205 static NTSTATUS _s3_compat_lsa_QuerySecurity_recv(struct tevent_req *req)
206 {
207         return tevent_req_simple_recv_ntstatus(req);
208 }
209
210 struct _s3_compat_lsa_SetSecObj_state {
211         struct tevent_context *ev;
212         struct dcerpc_call_handle *call;
213         struct lsa_SetSecObj *r;
214 };
215
216 static struct tevent_req *_s3_compat_lsa_SetSecObj_send(TALLOC_CTX *mem_ctx,
217                                                         struct tevent_context *ev,
218                                                         struct dcerpc_call_handle *call,
219                                                         struct lsa_SetSecObj *r)
220 {
221         struct tevent_req *req;
222         struct _s3_compat_lsa_SetSecObj_state *state;
223         struct pipes_struct *p;
224
225         req = tevent_req_create(mem_ctx, &state,
226                                 struct _s3_compat_lsa_SetSecObj_state);
227         if (req == NULL) {
228                 return NULL;
229         }
230         state->ev = ev;
231         state->call = call;
232         state->r = r;
233
234         p = dcerpc_call_handle_get_pipes_struct(call);
235         if (p == NULL) {
236                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
237                 return tevent_req_post(req, ev);
238         }
239
240         r->out.result = _lsa_SetSecObj(p, r);
241
242         if (p->fault_state) {
243                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
244                 tevent_req_nterror(req, status);
245                 return tevent_req_post(req, ev);
246         }
247
248         tevent_req_done(req);
249         return tevent_req_post(req, ev);
250 }
251
252 static NTSTATUS _s3_compat_lsa_SetSecObj_recv(struct tevent_req *req)
253 {
254         return tevent_req_simple_recv_ntstatus(req);
255 }
256
257 struct _s3_compat_lsa_ChangePassword_state {
258         struct tevent_context *ev;
259         struct dcerpc_call_handle *call;
260         struct lsa_ChangePassword *r;
261 };
262
263 static struct tevent_req *_s3_compat_lsa_ChangePassword_send(TALLOC_CTX *mem_ctx,
264                                                              struct tevent_context *ev,
265                                                              struct dcerpc_call_handle *call,
266                                                              struct lsa_ChangePassword *r)
267 {
268         struct tevent_req *req;
269         struct _s3_compat_lsa_ChangePassword_state *state;
270         struct pipes_struct *p;
271
272         req = tevent_req_create(mem_ctx, &state,
273                                 struct _s3_compat_lsa_ChangePassword_state);
274         if (req == NULL) {
275                 return NULL;
276         }
277         state->ev = ev;
278         state->call = call;
279         state->r = r;
280
281         p = dcerpc_call_handle_get_pipes_struct(call);
282         if (p == NULL) {
283                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
284                 return tevent_req_post(req, ev);
285         }
286
287         r->out.result = _lsa_ChangePassword(p, r);
288
289         if (p->fault_state) {
290                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
291                 tevent_req_nterror(req, status);
292                 return tevent_req_post(req, ev);
293         }
294
295         tevent_req_done(req);
296         return tevent_req_post(req, ev);
297 }
298
299 static NTSTATUS _s3_compat_lsa_ChangePassword_recv(struct tevent_req *req)
300 {
301         return tevent_req_simple_recv_ntstatus(req);
302 }
303
304 struct _s3_compat_lsa_OpenPolicy_state {
305         struct tevent_context *ev;
306         struct dcerpc_call_handle *call;
307         struct lsa_OpenPolicy *r;
308 };
309
310 static struct tevent_req *_s3_compat_lsa_OpenPolicy_send(TALLOC_CTX *mem_ctx,
311                                                          struct tevent_context *ev,
312                                                          struct dcerpc_call_handle *call,
313                                                          struct lsa_OpenPolicy *r)
314 {
315         struct tevent_req *req;
316         struct _s3_compat_lsa_OpenPolicy_state *state;
317         struct pipes_struct *p;
318
319         req = tevent_req_create(mem_ctx, &state,
320                                 struct _s3_compat_lsa_OpenPolicy_state);
321         if (req == NULL) {
322                 return NULL;
323         }
324         state->ev = ev;
325         state->call = call;
326         state->r = r;
327
328         p = dcerpc_call_handle_get_pipes_struct(call);
329         if (p == NULL) {
330                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
331                 return tevent_req_post(req, ev);
332         }
333
334         ZERO_STRUCT(r->out);
335         r->out.handle = talloc_zero(r, struct policy_handle);
336         if (tevent_req_nomem(r->out.handle, req)) {
337                 return tevent_req_post(req, ev);
338         }
339
340         r->out.result = _lsa_OpenPolicy(p, r);
341
342         if (p->fault_state) {
343                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
344                 tevent_req_nterror(req, status);
345                 return tevent_req_post(req, ev);
346         }
347
348         tevent_req_done(req);
349         return tevent_req_post(req, ev);
350 }
351
352 static NTSTATUS _s3_compat_lsa_OpenPolicy_recv(struct tevent_req *req)
353 {
354         return tevent_req_simple_recv_ntstatus(req);
355 }
356
357 struct _s3_compat_lsa_QueryInfoPolicy_state {
358         struct tevent_context *ev;
359         struct dcerpc_call_handle *call;
360         struct lsa_QueryInfoPolicy *r;
361 };
362
363 static struct tevent_req *_s3_compat_lsa_QueryInfoPolicy_send(TALLOC_CTX *mem_ctx,
364                                                               struct tevent_context *ev,
365                                                               struct dcerpc_call_handle *call,
366                                                               struct lsa_QueryInfoPolicy *r)
367 {
368         struct tevent_req *req;
369         struct _s3_compat_lsa_QueryInfoPolicy_state *state;
370         struct pipes_struct *p;
371
372         req = tevent_req_create(mem_ctx, &state,
373                                 struct _s3_compat_lsa_QueryInfoPolicy_state);
374         if (req == NULL) {
375                 return NULL;
376         }
377         state->ev = ev;
378         state->call = call;
379         state->r = r;
380
381         p = dcerpc_call_handle_get_pipes_struct(call);
382         if (p == NULL) {
383                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
384                 return tevent_req_post(req, ev);
385         }
386
387         ZERO_STRUCT(r->out);
388         r->out.info = talloc_zero(r, union lsa_PolicyInformation *);
389         if (tevent_req_nomem(r->out.info, req)) {
390                 return tevent_req_post(req, ev);
391         }
392
393         r->out.result = _lsa_QueryInfoPolicy(p, r);
394
395         if (p->fault_state) {
396                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
397                 tevent_req_nterror(req, status);
398                 return tevent_req_post(req, ev);
399         }
400
401         tevent_req_done(req);
402         return tevent_req_post(req, ev);
403 }
404
405 static NTSTATUS _s3_compat_lsa_QueryInfoPolicy_recv(struct tevent_req *req)
406 {
407         return tevent_req_simple_recv_ntstatus(req);
408 }
409
410 struct _s3_compat_lsa_SetInfoPolicy_state {
411         struct tevent_context *ev;
412         struct dcerpc_call_handle *call;
413         struct lsa_SetInfoPolicy *r;
414 };
415
416 static struct tevent_req *_s3_compat_lsa_SetInfoPolicy_send(TALLOC_CTX *mem_ctx,
417                                                             struct tevent_context *ev,
418                                                             struct dcerpc_call_handle *call,
419                                                             struct lsa_SetInfoPolicy *r)
420 {
421         struct tevent_req *req;
422         struct _s3_compat_lsa_SetInfoPolicy_state *state;
423         struct pipes_struct *p;
424
425         req = tevent_req_create(mem_ctx, &state,
426                                 struct _s3_compat_lsa_SetInfoPolicy_state);
427         if (req == NULL) {
428                 return NULL;
429         }
430         state->ev = ev;
431         state->call = call;
432         state->r = r;
433
434         p = dcerpc_call_handle_get_pipes_struct(call);
435         if (p == NULL) {
436                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
437                 return tevent_req_post(req, ev);
438         }
439
440         r->out.result = _lsa_SetInfoPolicy(p, r);
441
442         if (p->fault_state) {
443                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
444                 tevent_req_nterror(req, status);
445                 return tevent_req_post(req, ev);
446         }
447
448         tevent_req_done(req);
449         return tevent_req_post(req, ev);
450 }
451
452 static NTSTATUS _s3_compat_lsa_SetInfoPolicy_recv(struct tevent_req *req)
453 {
454         return tevent_req_simple_recv_ntstatus(req);
455 }
456
457 struct _s3_compat_lsa_ClearAuditLog_state {
458         struct tevent_context *ev;
459         struct dcerpc_call_handle *call;
460         struct lsa_ClearAuditLog *r;
461 };
462
463 static struct tevent_req *_s3_compat_lsa_ClearAuditLog_send(TALLOC_CTX *mem_ctx,
464                                                             struct tevent_context *ev,
465                                                             struct dcerpc_call_handle *call,
466                                                             struct lsa_ClearAuditLog *r)
467 {
468         struct tevent_req *req;
469         struct _s3_compat_lsa_ClearAuditLog_state *state;
470         struct pipes_struct *p;
471
472         req = tevent_req_create(mem_ctx, &state,
473                                 struct _s3_compat_lsa_ClearAuditLog_state);
474         if (req == NULL) {
475                 return NULL;
476         }
477         state->ev = ev;
478         state->call = call;
479         state->r = r;
480
481         p = dcerpc_call_handle_get_pipes_struct(call);
482         if (p == NULL) {
483                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
484                 return tevent_req_post(req, ev);
485         }
486
487         r->out.result = _lsa_ClearAuditLog(p, r);
488
489         if (p->fault_state) {
490                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
491                 tevent_req_nterror(req, status);
492                 return tevent_req_post(req, ev);
493         }
494
495         tevent_req_done(req);
496         return tevent_req_post(req, ev);
497 }
498
499 static NTSTATUS _s3_compat_lsa_ClearAuditLog_recv(struct tevent_req *req)
500 {
501         return tevent_req_simple_recv_ntstatus(req);
502 }
503
504 struct _s3_compat_lsa_CreateAccount_state {
505         struct tevent_context *ev;
506         struct dcerpc_call_handle *call;
507         struct lsa_CreateAccount *r;
508 };
509
510 static struct tevent_req *_s3_compat_lsa_CreateAccount_send(TALLOC_CTX *mem_ctx,
511                                                             struct tevent_context *ev,
512                                                             struct dcerpc_call_handle *call,
513                                                             struct lsa_CreateAccount *r)
514 {
515         struct tevent_req *req;
516         struct _s3_compat_lsa_CreateAccount_state *state;
517         struct pipes_struct *p;
518
519         req = tevent_req_create(mem_ctx, &state,
520                                 struct _s3_compat_lsa_CreateAccount_state);
521         if (req == NULL) {
522                 return NULL;
523         }
524         state->ev = ev;
525         state->call = call;
526         state->r = r;
527
528         p = dcerpc_call_handle_get_pipes_struct(call);
529         if (p == NULL) {
530                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
531                 return tevent_req_post(req, ev);
532         }
533
534         ZERO_STRUCT(r->out);
535         r->out.acct_handle = talloc_zero(r, struct policy_handle);
536         if (tevent_req_nomem(r->out.acct_handle, req)) {
537                 return tevent_req_post(req, ev);
538         }
539
540         r->out.result = _lsa_CreateAccount(p, r);
541
542         if (p->fault_state) {
543                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
544                 tevent_req_nterror(req, status);
545                 return tevent_req_post(req, ev);
546         }
547
548         tevent_req_done(req);
549         return tevent_req_post(req, ev);
550 }
551
552 static NTSTATUS _s3_compat_lsa_CreateAccount_recv(struct tevent_req *req)
553 {
554         return tevent_req_simple_recv_ntstatus(req);
555 }
556
557 struct _s3_compat_lsa_EnumAccounts_state {
558         struct tevent_context *ev;
559         struct dcerpc_call_handle *call;
560         struct lsa_EnumAccounts *r;
561 };
562
563 static struct tevent_req *_s3_compat_lsa_EnumAccounts_send(TALLOC_CTX *mem_ctx,
564                                                            struct tevent_context *ev,
565                                                            struct dcerpc_call_handle *call,
566                                                            struct lsa_EnumAccounts *r)
567 {
568         struct tevent_req *req;
569         struct _s3_compat_lsa_EnumAccounts_state *state;
570         struct pipes_struct *p;
571
572         req = tevent_req_create(mem_ctx, &state,
573                                 struct _s3_compat_lsa_EnumAccounts_state);
574         if (req == NULL) {
575                 return NULL;
576         }
577         state->ev = ev;
578         state->call = call;
579         state->r = r;
580
581         p = dcerpc_call_handle_get_pipes_struct(call);
582         if (p == NULL) {
583                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
584                 return tevent_req_post(req, ev);
585         }
586
587         ZERO_STRUCT(r->out);
588         r->out.resume_handle = r->in.resume_handle;
589         r->out.sids = talloc_zero(r, struct lsa_SidArray);
590         if (tevent_req_nomem(r->out.sids, req)) {
591                 return tevent_req_post(req, ev);
592         }
593
594         r->out.result = _lsa_EnumAccounts(p, r);
595
596         if (p->fault_state) {
597                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
598                 tevent_req_nterror(req, status);
599                 return tevent_req_post(req, ev);
600         }
601
602         tevent_req_done(req);
603         return tevent_req_post(req, ev);
604 }
605
606 static NTSTATUS _s3_compat_lsa_EnumAccounts_recv(struct tevent_req *req)
607 {
608         return tevent_req_simple_recv_ntstatus(req);
609 }
610
611 struct _s3_compat_lsa_CreateTrustedDomain_state {
612         struct tevent_context *ev;
613         struct dcerpc_call_handle *call;
614         struct lsa_CreateTrustedDomain *r;
615 };
616
617 static struct tevent_req *_s3_compat_lsa_CreateTrustedDomain_send(TALLOC_CTX *mem_ctx,
618                                                                   struct tevent_context *ev,
619                                                                   struct dcerpc_call_handle *call,
620                                                                   struct lsa_CreateTrustedDomain *r)
621 {
622         struct tevent_req *req;
623         struct _s3_compat_lsa_CreateTrustedDomain_state *state;
624         struct pipes_struct *p;
625
626         req = tevent_req_create(mem_ctx, &state,
627                                 struct _s3_compat_lsa_CreateTrustedDomain_state);
628         if (req == NULL) {
629                 return NULL;
630         }
631         state->ev = ev;
632         state->call = call;
633         state->r = r;
634
635         p = dcerpc_call_handle_get_pipes_struct(call);
636         if (p == NULL) {
637                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
638                 return tevent_req_post(req, ev);
639         }
640
641         ZERO_STRUCT(r->out);
642         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
643         if (tevent_req_nomem(r->out.trustdom_handle, req)) {
644                 return tevent_req_post(req, ev);
645         }
646
647         r->out.result = _lsa_CreateTrustedDomain(p, r);
648
649         if (p->fault_state) {
650                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
651                 tevent_req_nterror(req, status);
652                 return tevent_req_post(req, ev);
653         }
654
655         tevent_req_done(req);
656         return tevent_req_post(req, ev);
657 }
658
659 static NTSTATUS _s3_compat_lsa_CreateTrustedDomain_recv(struct tevent_req *req)
660 {
661         return tevent_req_simple_recv_ntstatus(req);
662 }
663
664 struct _s3_compat_lsa_EnumTrustDom_state {
665         struct tevent_context *ev;
666         struct dcerpc_call_handle *call;
667         struct lsa_EnumTrustDom *r;
668 };
669
670 static struct tevent_req *_s3_compat_lsa_EnumTrustDom_send(TALLOC_CTX *mem_ctx,
671                                                            struct tevent_context *ev,
672                                                            struct dcerpc_call_handle *call,
673                                                            struct lsa_EnumTrustDom *r)
674 {
675         struct tevent_req *req;
676         struct _s3_compat_lsa_EnumTrustDom_state *state;
677         struct pipes_struct *p;
678
679         req = tevent_req_create(mem_ctx, &state,
680                                 struct _s3_compat_lsa_EnumTrustDom_state);
681         if (req == NULL) {
682                 return NULL;
683         }
684         state->ev = ev;
685         state->call = call;
686         state->r = r;
687
688         p = dcerpc_call_handle_get_pipes_struct(call);
689         if (p == NULL) {
690                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
691                 return tevent_req_post(req, ev);
692         }
693
694         ZERO_STRUCT(r->out);
695         r->out.resume_handle = r->in.resume_handle;
696         r->out.domains = talloc_zero(r, struct lsa_DomainList);
697         if (tevent_req_nomem(r->out.domains, req)) {
698                 return tevent_req_post(req, ev);
699         }
700
701         r->out.result = _lsa_EnumTrustDom(p, r);
702
703         if (p->fault_state) {
704                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
705                 tevent_req_nterror(req, status);
706                 return tevent_req_post(req, ev);
707         }
708
709         tevent_req_done(req);
710         return tevent_req_post(req, ev);
711 }
712
713 static NTSTATUS _s3_compat_lsa_EnumTrustDom_recv(struct tevent_req *req)
714 {
715         return tevent_req_simple_recv_ntstatus(req);
716 }
717
718 struct _s3_compat_lsa_LookupNames_state {
719         struct tevent_context *ev;
720         struct dcerpc_call_handle *call;
721         struct lsa_LookupNames *r;
722 };
723
724 static struct tevent_req *_s3_compat_lsa_LookupNames_send(TALLOC_CTX *mem_ctx,
725                                                           struct tevent_context *ev,
726                                                           struct dcerpc_call_handle *call,
727                                                           struct lsa_LookupNames *r)
728 {
729         struct tevent_req *req;
730         struct _s3_compat_lsa_LookupNames_state *state;
731         struct pipes_struct *p;
732
733         req = tevent_req_create(mem_ctx, &state,
734                                 struct _s3_compat_lsa_LookupNames_state);
735         if (req == NULL) {
736                 return NULL;
737         }
738         state->ev = ev;
739         state->call = call;
740         state->r = r;
741
742         p = dcerpc_call_handle_get_pipes_struct(call);
743         if (p == NULL) {
744                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
745                 return tevent_req_post(req, ev);
746         }
747
748         ZERO_STRUCT(r->out);
749         r->out.sids = r->in.sids;
750         r->out.count = r->in.count;
751         r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
752         if (tevent_req_nomem(r->out.domains, req)) {
753                 return tevent_req_post(req, ev);
754         }
755
756         r->out.result = _lsa_LookupNames(p, r);
757
758         if (p->fault_state) {
759                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
760                 tevent_req_nterror(req, status);
761                 return tevent_req_post(req, ev);
762         }
763
764         tevent_req_done(req);
765         return tevent_req_post(req, ev);
766 }
767
768 static NTSTATUS _s3_compat_lsa_LookupNames_recv(struct tevent_req *req)
769 {
770         return tevent_req_simple_recv_ntstatus(req);
771 }
772
773 struct _s3_compat_lsa_LookupSids_state {
774         struct tevent_context *ev;
775         struct dcerpc_call_handle *call;
776         struct lsa_LookupSids *r;
777 };
778
779 static struct tevent_req *_s3_compat_lsa_LookupSids_send(TALLOC_CTX *mem_ctx,
780                                                          struct tevent_context *ev,
781                                                          struct dcerpc_call_handle *call,
782                                                          struct lsa_LookupSids *r)
783 {
784         struct tevent_req *req;
785         struct _s3_compat_lsa_LookupSids_state *state;
786         struct pipes_struct *p;
787
788         req = tevent_req_create(mem_ctx, &state,
789                                 struct _s3_compat_lsa_LookupSids_state);
790         if (req == NULL) {
791                 return NULL;
792         }
793         state->ev = ev;
794         state->call = call;
795         state->r = r;
796
797         p = dcerpc_call_handle_get_pipes_struct(call);
798         if (p == NULL) {
799                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
800                 return tevent_req_post(req, ev);
801         }
802
803         ZERO_STRUCT(r->out);
804         r->out.names = r->in.names;
805         r->out.count = r->in.count;
806         r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
807         if (tevent_req_nomem(r->out.domains, req)) {
808                 return tevent_req_post(req, ev);
809         }
810
811         r->out.result = _lsa_LookupSids(p, r);
812
813         if (p->fault_state) {
814                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
815                 tevent_req_nterror(req, status);
816                 return tevent_req_post(req, ev);
817         }
818
819         tevent_req_done(req);
820         return tevent_req_post(req, ev);
821 }
822
823 static NTSTATUS _s3_compat_lsa_LookupSids_recv(struct tevent_req *req)
824 {
825         return tevent_req_simple_recv_ntstatus(req);
826 }
827
828 struct _s3_compat_lsa_CreateSecret_state {
829         struct tevent_context *ev;
830         struct dcerpc_call_handle *call;
831         struct lsa_CreateSecret *r;
832 };
833
834 static struct tevent_req *_s3_compat_lsa_CreateSecret_send(TALLOC_CTX *mem_ctx,
835                                                            struct tevent_context *ev,
836                                                            struct dcerpc_call_handle *call,
837                                                            struct lsa_CreateSecret *r)
838 {
839         struct tevent_req *req;
840         struct _s3_compat_lsa_CreateSecret_state *state;
841         struct pipes_struct *p;
842
843         req = tevent_req_create(mem_ctx, &state,
844                                 struct _s3_compat_lsa_CreateSecret_state);
845         if (req == NULL) {
846                 return NULL;
847         }
848         state->ev = ev;
849         state->call = call;
850         state->r = r;
851
852         p = dcerpc_call_handle_get_pipes_struct(call);
853         if (p == NULL) {
854                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
855                 return tevent_req_post(req, ev);
856         }
857
858         ZERO_STRUCT(r->out);
859         r->out.sec_handle = talloc_zero(r, struct policy_handle);
860         if (tevent_req_nomem(r->out.sec_handle, req)) {
861                 return tevent_req_post(req, ev);
862         }
863
864         r->out.result = _lsa_CreateSecret(p, r);
865
866         if (p->fault_state) {
867                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
868                 tevent_req_nterror(req, status);
869                 return tevent_req_post(req, ev);
870         }
871
872         tevent_req_done(req);
873         return tevent_req_post(req, ev);
874 }
875
876 static NTSTATUS _s3_compat_lsa_CreateSecret_recv(struct tevent_req *req)
877 {
878         return tevent_req_simple_recv_ntstatus(req);
879 }
880
881 struct _s3_compat_lsa_OpenAccount_state {
882         struct tevent_context *ev;
883         struct dcerpc_call_handle *call;
884         struct lsa_OpenAccount *r;
885 };
886
887 static struct tevent_req *_s3_compat_lsa_OpenAccount_send(TALLOC_CTX *mem_ctx,
888                                                           struct tevent_context *ev,
889                                                           struct dcerpc_call_handle *call,
890                                                           struct lsa_OpenAccount *r)
891 {
892         struct tevent_req *req;
893         struct _s3_compat_lsa_OpenAccount_state *state;
894         struct pipes_struct *p;
895
896         req = tevent_req_create(mem_ctx, &state,
897                                 struct _s3_compat_lsa_OpenAccount_state);
898         if (req == NULL) {
899                 return NULL;
900         }
901         state->ev = ev;
902         state->call = call;
903         state->r = r;
904
905         p = dcerpc_call_handle_get_pipes_struct(call);
906         if (p == NULL) {
907                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
908                 return tevent_req_post(req, ev);
909         }
910
911         ZERO_STRUCT(r->out);
912         r->out.acct_handle = talloc_zero(r, struct policy_handle);
913         if (tevent_req_nomem(r->out.acct_handle, req)) {
914                 return tevent_req_post(req, ev);
915         }
916
917         r->out.result = _lsa_OpenAccount(p, r);
918
919         if (p->fault_state) {
920                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
921                 tevent_req_nterror(req, status);
922                 return tevent_req_post(req, ev);
923         }
924
925         tevent_req_done(req);
926         return tevent_req_post(req, ev);
927 }
928
929 static NTSTATUS _s3_compat_lsa_OpenAccount_recv(struct tevent_req *req)
930 {
931         return tevent_req_simple_recv_ntstatus(req);
932 }
933
934 struct _s3_compat_lsa_EnumPrivsAccount_state {
935         struct tevent_context *ev;
936         struct dcerpc_call_handle *call;
937         struct lsa_EnumPrivsAccount *r;
938 };
939
940 static struct tevent_req *_s3_compat_lsa_EnumPrivsAccount_send(TALLOC_CTX *mem_ctx,
941                                                                struct tevent_context *ev,
942                                                                struct dcerpc_call_handle *call,
943                                                                struct lsa_EnumPrivsAccount *r)
944 {
945         struct tevent_req *req;
946         struct _s3_compat_lsa_EnumPrivsAccount_state *state;
947         struct pipes_struct *p;
948
949         req = tevent_req_create(mem_ctx, &state,
950                                 struct _s3_compat_lsa_EnumPrivsAccount_state);
951         if (req == NULL) {
952                 return NULL;
953         }
954         state->ev = ev;
955         state->call = call;
956         state->r = r;
957
958         p = dcerpc_call_handle_get_pipes_struct(call);
959         if (p == NULL) {
960                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
961                 return tevent_req_post(req, ev);
962         }
963
964         ZERO_STRUCT(r->out);
965         r->out.privs = talloc_zero(r, struct lsa_PrivilegeSet *);
966         if (tevent_req_nomem(r->out.privs, req)) {
967                 return tevent_req_post(req, ev);
968         }
969
970         r->out.result = _lsa_EnumPrivsAccount(p, r);
971
972         if (p->fault_state) {
973                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
974                 tevent_req_nterror(req, status);
975                 return tevent_req_post(req, ev);
976         }
977
978         tevent_req_done(req);
979         return tevent_req_post(req, ev);
980 }
981
982 static NTSTATUS _s3_compat_lsa_EnumPrivsAccount_recv(struct tevent_req *req)
983 {
984         return tevent_req_simple_recv_ntstatus(req);
985 }
986
987 struct _s3_compat_lsa_AddPrivilegesToAccount_state {
988         struct tevent_context *ev;
989         struct dcerpc_call_handle *call;
990         struct lsa_AddPrivilegesToAccount *r;
991 };
992
993 static struct tevent_req *_s3_compat_lsa_AddPrivilegesToAccount_send(TALLOC_CTX *mem_ctx,
994                                                                      struct tevent_context *ev,
995                                                                      struct dcerpc_call_handle *call,
996                                                                      struct lsa_AddPrivilegesToAccount *r)
997 {
998         struct tevent_req *req;
999         struct _s3_compat_lsa_AddPrivilegesToAccount_state *state;
1000         struct pipes_struct *p;
1001
1002         req = tevent_req_create(mem_ctx, &state,
1003                                 struct _s3_compat_lsa_AddPrivilegesToAccount_state);
1004         if (req == NULL) {
1005                 return NULL;
1006         }
1007         state->ev = ev;
1008         state->call = call;
1009         state->r = r;
1010
1011         p = dcerpc_call_handle_get_pipes_struct(call);
1012         if (p == NULL) {
1013                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1014                 return tevent_req_post(req, ev);
1015         }
1016
1017         r->out.result = _lsa_AddPrivilegesToAccount(p, r);
1018
1019         if (p->fault_state) {
1020                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1021                 tevent_req_nterror(req, status);
1022                 return tevent_req_post(req, ev);
1023         }
1024
1025         tevent_req_done(req);
1026         return tevent_req_post(req, ev);
1027 }
1028
1029 static NTSTATUS _s3_compat_lsa_AddPrivilegesToAccount_recv(struct tevent_req *req)
1030 {
1031         return tevent_req_simple_recv_ntstatus(req);
1032 }
1033
1034 struct _s3_compat_lsa_RemovePrivilegesFromAccount_state {
1035         struct tevent_context *ev;
1036         struct dcerpc_call_handle *call;
1037         struct lsa_RemovePrivilegesFromAccount *r;
1038 };
1039
1040 static struct tevent_req *_s3_compat_lsa_RemovePrivilegesFromAccount_send(TALLOC_CTX *mem_ctx,
1041                                                                           struct tevent_context *ev,
1042                                                                           struct dcerpc_call_handle *call,
1043                                                                           struct lsa_RemovePrivilegesFromAccount *r)
1044 {
1045         struct tevent_req *req;
1046         struct _s3_compat_lsa_RemovePrivilegesFromAccount_state *state;
1047         struct pipes_struct *p;
1048
1049         req = tevent_req_create(mem_ctx, &state,
1050                                 struct _s3_compat_lsa_RemovePrivilegesFromAccount_state);
1051         if (req == NULL) {
1052                 return NULL;
1053         }
1054         state->ev = ev;
1055         state->call = call;
1056         state->r = r;
1057
1058         p = dcerpc_call_handle_get_pipes_struct(call);
1059         if (p == NULL) {
1060                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1061                 return tevent_req_post(req, ev);
1062         }
1063
1064         r->out.result = _lsa_RemovePrivilegesFromAccount(p, r);
1065
1066         if (p->fault_state) {
1067                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1068                 tevent_req_nterror(req, status);
1069                 return tevent_req_post(req, ev);
1070         }
1071
1072         tevent_req_done(req);
1073         return tevent_req_post(req, ev);
1074 }
1075
1076 static NTSTATUS _s3_compat_lsa_RemovePrivilegesFromAccount_recv(struct tevent_req *req)
1077 {
1078         return tevent_req_simple_recv_ntstatus(req);
1079 }
1080
1081 struct _s3_compat_lsa_GetQuotasForAccount_state {
1082         struct tevent_context *ev;
1083         struct dcerpc_call_handle *call;
1084         struct lsa_GetQuotasForAccount *r;
1085 };
1086
1087 static struct tevent_req *_s3_compat_lsa_GetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
1088                                                                   struct tevent_context *ev,
1089                                                                   struct dcerpc_call_handle *call,
1090                                                                   struct lsa_GetQuotasForAccount *r)
1091 {
1092         struct tevent_req *req;
1093         struct _s3_compat_lsa_GetQuotasForAccount_state *state;
1094         struct pipes_struct *p;
1095
1096         req = tevent_req_create(mem_ctx, &state,
1097                                 struct _s3_compat_lsa_GetQuotasForAccount_state);
1098         if (req == NULL) {
1099                 return NULL;
1100         }
1101         state->ev = ev;
1102         state->call = call;
1103         state->r = r;
1104
1105         p = dcerpc_call_handle_get_pipes_struct(call);
1106         if (p == NULL) {
1107                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1108                 return tevent_req_post(req, ev);
1109         }
1110
1111         r->out.result = _lsa_GetQuotasForAccount(p, r);
1112
1113         if (p->fault_state) {
1114                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1115                 tevent_req_nterror(req, status);
1116                 return tevent_req_post(req, ev);
1117         }
1118
1119         tevent_req_done(req);
1120         return tevent_req_post(req, ev);
1121 }
1122
1123 static NTSTATUS _s3_compat_lsa_GetQuotasForAccount_recv(struct tevent_req *req)
1124 {
1125         return tevent_req_simple_recv_ntstatus(req);
1126 }
1127
1128 struct _s3_compat_lsa_SetQuotasForAccount_state {
1129         struct tevent_context *ev;
1130         struct dcerpc_call_handle *call;
1131         struct lsa_SetQuotasForAccount *r;
1132 };
1133
1134 static struct tevent_req *_s3_compat_lsa_SetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
1135                                                                   struct tevent_context *ev,
1136                                                                   struct dcerpc_call_handle *call,
1137                                                                   struct lsa_SetQuotasForAccount *r)
1138 {
1139         struct tevent_req *req;
1140         struct _s3_compat_lsa_SetQuotasForAccount_state *state;
1141         struct pipes_struct *p;
1142
1143         req = tevent_req_create(mem_ctx, &state,
1144                                 struct _s3_compat_lsa_SetQuotasForAccount_state);
1145         if (req == NULL) {
1146                 return NULL;
1147         }
1148         state->ev = ev;
1149         state->call = call;
1150         state->r = r;
1151
1152         p = dcerpc_call_handle_get_pipes_struct(call);
1153         if (p == NULL) {
1154                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1155                 return tevent_req_post(req, ev);
1156         }
1157
1158         r->out.result = _lsa_SetQuotasForAccount(p, r);
1159
1160         if (p->fault_state) {
1161                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1162                 tevent_req_nterror(req, status);
1163                 return tevent_req_post(req, ev);
1164         }
1165
1166         tevent_req_done(req);
1167         return tevent_req_post(req, ev);
1168 }
1169
1170 static NTSTATUS _s3_compat_lsa_SetQuotasForAccount_recv(struct tevent_req *req)
1171 {
1172         return tevent_req_simple_recv_ntstatus(req);
1173 }
1174
1175 struct _s3_compat_lsa_GetSystemAccessAccount_state {
1176         struct tevent_context *ev;
1177         struct dcerpc_call_handle *call;
1178         struct lsa_GetSystemAccessAccount *r;
1179 };
1180
1181 static struct tevent_req *_s3_compat_lsa_GetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
1182                                                                      struct tevent_context *ev,
1183                                                                      struct dcerpc_call_handle *call,
1184                                                                      struct lsa_GetSystemAccessAccount *r)
1185 {
1186         struct tevent_req *req;
1187         struct _s3_compat_lsa_GetSystemAccessAccount_state *state;
1188         struct pipes_struct *p;
1189
1190         req = tevent_req_create(mem_ctx, &state,
1191                                 struct _s3_compat_lsa_GetSystemAccessAccount_state);
1192         if (req == NULL) {
1193                 return NULL;
1194         }
1195         state->ev = ev;
1196         state->call = call;
1197         state->r = r;
1198
1199         p = dcerpc_call_handle_get_pipes_struct(call);
1200         if (p == NULL) {
1201                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1202                 return tevent_req_post(req, ev);
1203         }
1204
1205         ZERO_STRUCT(r->out);
1206         r->out.access_mask = talloc_zero(r, uint32_t);
1207         if (tevent_req_nomem(r->out.access_mask, req)) {
1208                 return tevent_req_post(req, ev);
1209         }
1210
1211         r->out.result = _lsa_GetSystemAccessAccount(p, r);
1212
1213         if (p->fault_state) {
1214                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1215                 tevent_req_nterror(req, status);
1216                 return tevent_req_post(req, ev);
1217         }
1218
1219         tevent_req_done(req);
1220         return tevent_req_post(req, ev);
1221 }
1222
1223 static NTSTATUS _s3_compat_lsa_GetSystemAccessAccount_recv(struct tevent_req *req)
1224 {
1225         return tevent_req_simple_recv_ntstatus(req);
1226 }
1227
1228 struct _s3_compat_lsa_SetSystemAccessAccount_state {
1229         struct tevent_context *ev;
1230         struct dcerpc_call_handle *call;
1231         struct lsa_SetSystemAccessAccount *r;
1232 };
1233
1234 static struct tevent_req *_s3_compat_lsa_SetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
1235                                                                      struct tevent_context *ev,
1236                                                                      struct dcerpc_call_handle *call,
1237                                                                      struct lsa_SetSystemAccessAccount *r)
1238 {
1239         struct tevent_req *req;
1240         struct _s3_compat_lsa_SetSystemAccessAccount_state *state;
1241         struct pipes_struct *p;
1242
1243         req = tevent_req_create(mem_ctx, &state,
1244                                 struct _s3_compat_lsa_SetSystemAccessAccount_state);
1245         if (req == NULL) {
1246                 return NULL;
1247         }
1248         state->ev = ev;
1249         state->call = call;
1250         state->r = r;
1251
1252         p = dcerpc_call_handle_get_pipes_struct(call);
1253         if (p == NULL) {
1254                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1255                 return tevent_req_post(req, ev);
1256         }
1257
1258         r->out.result = _lsa_SetSystemAccessAccount(p, r);
1259
1260         if (p->fault_state) {
1261                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1262                 tevent_req_nterror(req, status);
1263                 return tevent_req_post(req, ev);
1264         }
1265
1266         tevent_req_done(req);
1267         return tevent_req_post(req, ev);
1268 }
1269
1270 static NTSTATUS _s3_compat_lsa_SetSystemAccessAccount_recv(struct tevent_req *req)
1271 {
1272         return tevent_req_simple_recv_ntstatus(req);
1273 }
1274
1275 struct _s3_compat_lsa_OpenTrustedDomain_state {
1276         struct tevent_context *ev;
1277         struct dcerpc_call_handle *call;
1278         struct lsa_OpenTrustedDomain *r;
1279 };
1280
1281 static struct tevent_req *_s3_compat_lsa_OpenTrustedDomain_send(TALLOC_CTX *mem_ctx,
1282                                                                 struct tevent_context *ev,
1283                                                                 struct dcerpc_call_handle *call,
1284                                                                 struct lsa_OpenTrustedDomain *r)
1285 {
1286         struct tevent_req *req;
1287         struct _s3_compat_lsa_OpenTrustedDomain_state *state;
1288         struct pipes_struct *p;
1289
1290         req = tevent_req_create(mem_ctx, &state,
1291                                 struct _s3_compat_lsa_OpenTrustedDomain_state);
1292         if (req == NULL) {
1293                 return NULL;
1294         }
1295         state->ev = ev;
1296         state->call = call;
1297         state->r = r;
1298
1299         p = dcerpc_call_handle_get_pipes_struct(call);
1300         if (p == NULL) {
1301                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1302                 return tevent_req_post(req, ev);
1303         }
1304
1305         ZERO_STRUCT(r->out);
1306         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
1307         if (tevent_req_nomem(r->out.trustdom_handle, req)) {
1308                 return tevent_req_post(req, ev);
1309         }
1310
1311         r->out.result = _lsa_OpenTrustedDomain(p, r);
1312
1313         if (p->fault_state) {
1314                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1315                 tevent_req_nterror(req, status);
1316                 return tevent_req_post(req, ev);
1317         }
1318
1319         tevent_req_done(req);
1320         return tevent_req_post(req, ev);
1321 }
1322
1323 static NTSTATUS _s3_compat_lsa_OpenTrustedDomain_recv(struct tevent_req *req)
1324 {
1325         return tevent_req_simple_recv_ntstatus(req);
1326 }
1327
1328 struct _s3_compat_lsa_QueryTrustedDomainInfo_state {
1329         struct tevent_context *ev;
1330         struct dcerpc_call_handle *call;
1331         struct lsa_QueryTrustedDomainInfo *r;
1332 };
1333
1334 static struct tevent_req *_s3_compat_lsa_QueryTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
1335                                                                      struct tevent_context *ev,
1336                                                                      struct dcerpc_call_handle *call,
1337                                                                      struct lsa_QueryTrustedDomainInfo *r)
1338 {
1339         struct tevent_req *req;
1340         struct _s3_compat_lsa_QueryTrustedDomainInfo_state *state;
1341         struct pipes_struct *p;
1342
1343         req = tevent_req_create(mem_ctx, &state,
1344                                 struct _s3_compat_lsa_QueryTrustedDomainInfo_state);
1345         if (req == NULL) {
1346                 return NULL;
1347         }
1348         state->ev = ev;
1349         state->call = call;
1350         state->r = r;
1351
1352         p = dcerpc_call_handle_get_pipes_struct(call);
1353         if (p == NULL) {
1354                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1355                 return tevent_req_post(req, ev);
1356         }
1357
1358         ZERO_STRUCT(r->out);
1359         r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *);
1360         if (tevent_req_nomem(r->out.info, req)) {
1361                 return tevent_req_post(req, ev);
1362         }
1363
1364         r->out.result = _lsa_QueryTrustedDomainInfo(p, r);
1365
1366         if (p->fault_state) {
1367                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1368                 tevent_req_nterror(req, status);
1369                 return tevent_req_post(req, ev);
1370         }
1371
1372         tevent_req_done(req);
1373         return tevent_req_post(req, ev);
1374 }
1375
1376 static NTSTATUS _s3_compat_lsa_QueryTrustedDomainInfo_recv(struct tevent_req *req)
1377 {
1378         return tevent_req_simple_recv_ntstatus(req);
1379 }
1380
1381 struct _s3_compat_lsa_SetInformationTrustedDomain_state {
1382         struct tevent_context *ev;
1383         struct dcerpc_call_handle *call;
1384         struct lsa_SetInformationTrustedDomain *r;
1385 };
1386
1387 static struct tevent_req *_s3_compat_lsa_SetInformationTrustedDomain_send(TALLOC_CTX *mem_ctx,
1388                                                                           struct tevent_context *ev,
1389                                                                           struct dcerpc_call_handle *call,
1390                                                                           struct lsa_SetInformationTrustedDomain *r)
1391 {
1392         struct tevent_req *req;
1393         struct _s3_compat_lsa_SetInformationTrustedDomain_state *state;
1394         struct pipes_struct *p;
1395
1396         req = tevent_req_create(mem_ctx, &state,
1397                                 struct _s3_compat_lsa_SetInformationTrustedDomain_state);
1398         if (req == NULL) {
1399                 return NULL;
1400         }
1401         state->ev = ev;
1402         state->call = call;
1403         state->r = r;
1404
1405         p = dcerpc_call_handle_get_pipes_struct(call);
1406         if (p == NULL) {
1407                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1408                 return tevent_req_post(req, ev);
1409         }
1410
1411         r->out.result = _lsa_SetInformationTrustedDomain(p, r);
1412
1413         if (p->fault_state) {
1414                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1415                 tevent_req_nterror(req, status);
1416                 return tevent_req_post(req, ev);
1417         }
1418
1419         tevent_req_done(req);
1420         return tevent_req_post(req, ev);
1421 }
1422
1423 static NTSTATUS _s3_compat_lsa_SetInformationTrustedDomain_recv(struct tevent_req *req)
1424 {
1425         return tevent_req_simple_recv_ntstatus(req);
1426 }
1427
1428 struct _s3_compat_lsa_OpenSecret_state {
1429         struct tevent_context *ev;
1430         struct dcerpc_call_handle *call;
1431         struct lsa_OpenSecret *r;
1432 };
1433
1434 static struct tevent_req *_s3_compat_lsa_OpenSecret_send(TALLOC_CTX *mem_ctx,
1435                                                          struct tevent_context *ev,
1436                                                          struct dcerpc_call_handle *call,
1437                                                          struct lsa_OpenSecret *r)
1438 {
1439         struct tevent_req *req;
1440         struct _s3_compat_lsa_OpenSecret_state *state;
1441         struct pipes_struct *p;
1442
1443         req = tevent_req_create(mem_ctx, &state,
1444                                 struct _s3_compat_lsa_OpenSecret_state);
1445         if (req == NULL) {
1446                 return NULL;
1447         }
1448         state->ev = ev;
1449         state->call = call;
1450         state->r = r;
1451
1452         p = dcerpc_call_handle_get_pipes_struct(call);
1453         if (p == NULL) {
1454                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1455                 return tevent_req_post(req, ev);
1456         }
1457
1458         ZERO_STRUCT(r->out);
1459         r->out.sec_handle = talloc_zero(r, struct policy_handle);
1460         if (tevent_req_nomem(r->out.sec_handle, req)) {
1461                 return tevent_req_post(req, ev);
1462         }
1463
1464         r->out.result = _lsa_OpenSecret(p, r);
1465
1466         if (p->fault_state) {
1467                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1468                 tevent_req_nterror(req, status);
1469                 return tevent_req_post(req, ev);
1470         }
1471
1472         tevent_req_done(req);
1473         return tevent_req_post(req, ev);
1474 }
1475
1476 static NTSTATUS _s3_compat_lsa_OpenSecret_recv(struct tevent_req *req)
1477 {
1478         return tevent_req_simple_recv_ntstatus(req);
1479 }
1480
1481 struct _s3_compat_lsa_SetSecret_state {
1482         struct tevent_context *ev;
1483         struct dcerpc_call_handle *call;
1484         struct lsa_SetSecret *r;
1485 };
1486
1487 static struct tevent_req *_s3_compat_lsa_SetSecret_send(TALLOC_CTX *mem_ctx,
1488                                                         struct tevent_context *ev,
1489                                                         struct dcerpc_call_handle *call,
1490                                                         struct lsa_SetSecret *r)
1491 {
1492         struct tevent_req *req;
1493         struct _s3_compat_lsa_SetSecret_state *state;
1494         struct pipes_struct *p;
1495
1496         req = tevent_req_create(mem_ctx, &state,
1497                                 struct _s3_compat_lsa_SetSecret_state);
1498         if (req == NULL) {
1499                 return NULL;
1500         }
1501         state->ev = ev;
1502         state->call = call;
1503         state->r = r;
1504
1505         p = dcerpc_call_handle_get_pipes_struct(call);
1506         if (p == NULL) {
1507                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1508                 return tevent_req_post(req, ev);
1509         }
1510
1511         r->out.result = _lsa_SetSecret(p, r);
1512
1513         if (p->fault_state) {
1514                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1515                 tevent_req_nterror(req, status);
1516                 return tevent_req_post(req, ev);
1517         }
1518
1519         tevent_req_done(req);
1520         return tevent_req_post(req, ev);
1521 }
1522
1523 static NTSTATUS _s3_compat_lsa_SetSecret_recv(struct tevent_req *req)
1524 {
1525         return tevent_req_simple_recv_ntstatus(req);
1526 }
1527
1528 struct _s3_compat_lsa_QuerySecret_state {
1529         struct tevent_context *ev;
1530         struct dcerpc_call_handle *call;
1531         struct lsa_QuerySecret *r;
1532 };
1533
1534 static struct tevent_req *_s3_compat_lsa_QuerySecret_send(TALLOC_CTX *mem_ctx,
1535                                                           struct tevent_context *ev,
1536                                                           struct dcerpc_call_handle *call,
1537                                                           struct lsa_QuerySecret *r)
1538 {
1539         struct tevent_req *req;
1540         struct _s3_compat_lsa_QuerySecret_state *state;
1541         struct pipes_struct *p;
1542
1543         req = tevent_req_create(mem_ctx, &state,
1544                                 struct _s3_compat_lsa_QuerySecret_state);
1545         if (req == NULL) {
1546                 return NULL;
1547         }
1548         state->ev = ev;
1549         state->call = call;
1550         state->r = r;
1551
1552         p = dcerpc_call_handle_get_pipes_struct(call);
1553         if (p == NULL) {
1554                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1555                 return tevent_req_post(req, ev);
1556         }
1557
1558         ZERO_STRUCT(r->out);
1559         r->out.new_val = r->in.new_val;
1560         r->out.new_mtime = r->in.new_mtime;
1561         r->out.old_val = r->in.old_val;
1562         r->out.old_mtime = r->in.old_mtime;
1563         r->out.result = _lsa_QuerySecret(p, r);
1564
1565         if (p->fault_state) {
1566                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1567                 tevent_req_nterror(req, status);
1568                 return tevent_req_post(req, ev);
1569         }
1570
1571         tevent_req_done(req);
1572         return tevent_req_post(req, ev);
1573 }
1574
1575 static NTSTATUS _s3_compat_lsa_QuerySecret_recv(struct tevent_req *req)
1576 {
1577         return tevent_req_simple_recv_ntstatus(req);
1578 }
1579
1580 struct _s3_compat_lsa_LookupPrivValue_state {
1581         struct tevent_context *ev;
1582         struct dcerpc_call_handle *call;
1583         struct lsa_LookupPrivValue *r;
1584 };
1585
1586 static struct tevent_req *_s3_compat_lsa_LookupPrivValue_send(TALLOC_CTX *mem_ctx,
1587                                                               struct tevent_context *ev,
1588                                                               struct dcerpc_call_handle *call,
1589                                                               struct lsa_LookupPrivValue *r)
1590 {
1591         struct tevent_req *req;
1592         struct _s3_compat_lsa_LookupPrivValue_state *state;
1593         struct pipes_struct *p;
1594
1595         req = tevent_req_create(mem_ctx, &state,
1596                                 struct _s3_compat_lsa_LookupPrivValue_state);
1597         if (req == NULL) {
1598                 return NULL;
1599         }
1600         state->ev = ev;
1601         state->call = call;
1602         state->r = r;
1603
1604         p = dcerpc_call_handle_get_pipes_struct(call);
1605         if (p == NULL) {
1606                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1607                 return tevent_req_post(req, ev);
1608         }
1609
1610         ZERO_STRUCT(r->out);
1611         r->out.luid = talloc_zero(r, struct lsa_LUID);
1612         if (tevent_req_nomem(r->out.luid, req)) {
1613                 return tevent_req_post(req, ev);
1614         }
1615
1616         r->out.result = _lsa_LookupPrivValue(p, r);
1617
1618         if (p->fault_state) {
1619                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1620                 tevent_req_nterror(req, status);
1621                 return tevent_req_post(req, ev);
1622         }
1623
1624         tevent_req_done(req);
1625         return tevent_req_post(req, ev);
1626 }
1627
1628 static NTSTATUS _s3_compat_lsa_LookupPrivValue_recv(struct tevent_req *req)
1629 {
1630         return tevent_req_simple_recv_ntstatus(req);
1631 }
1632
1633 struct _s3_compat_lsa_LookupPrivName_state {
1634         struct tevent_context *ev;
1635         struct dcerpc_call_handle *call;
1636         struct lsa_LookupPrivName *r;
1637 };
1638
1639 static struct tevent_req *_s3_compat_lsa_LookupPrivName_send(TALLOC_CTX *mem_ctx,
1640                                                              struct tevent_context *ev,
1641                                                              struct dcerpc_call_handle *call,
1642                                                              struct lsa_LookupPrivName *r)
1643 {
1644         struct tevent_req *req;
1645         struct _s3_compat_lsa_LookupPrivName_state *state;
1646         struct pipes_struct *p;
1647
1648         req = tevent_req_create(mem_ctx, &state,
1649                                 struct _s3_compat_lsa_LookupPrivName_state);
1650         if (req == NULL) {
1651                 return NULL;
1652         }
1653         state->ev = ev;
1654         state->call = call;
1655         state->r = r;
1656
1657         p = dcerpc_call_handle_get_pipes_struct(call);
1658         if (p == NULL) {
1659                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1660                 return tevent_req_post(req, ev);
1661         }
1662
1663         ZERO_STRUCT(r->out);
1664         r->out.name = talloc_zero(r, struct lsa_StringLarge *);
1665         if (tevent_req_nomem(r->out.name, req)) {
1666                 return tevent_req_post(req, ev);
1667         }
1668
1669         r->out.result = _lsa_LookupPrivName(p, r);
1670
1671         if (p->fault_state) {
1672                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1673                 tevent_req_nterror(req, status);
1674                 return tevent_req_post(req, ev);
1675         }
1676
1677         tevent_req_done(req);
1678         return tevent_req_post(req, ev);
1679 }
1680
1681 static NTSTATUS _s3_compat_lsa_LookupPrivName_recv(struct tevent_req *req)
1682 {
1683         return tevent_req_simple_recv_ntstatus(req);
1684 }
1685
1686 struct _s3_compat_lsa_LookupPrivDisplayName_state {
1687         struct tevent_context *ev;
1688         struct dcerpc_call_handle *call;
1689         struct lsa_LookupPrivDisplayName *r;
1690 };
1691
1692 static struct tevent_req *_s3_compat_lsa_LookupPrivDisplayName_send(TALLOC_CTX *mem_ctx,
1693                                                                     struct tevent_context *ev,
1694                                                                     struct dcerpc_call_handle *call,
1695                                                                     struct lsa_LookupPrivDisplayName *r)
1696 {
1697         struct tevent_req *req;
1698         struct _s3_compat_lsa_LookupPrivDisplayName_state *state;
1699         struct pipes_struct *p;
1700
1701         req = tevent_req_create(mem_ctx, &state,
1702                                 struct _s3_compat_lsa_LookupPrivDisplayName_state);
1703         if (req == NULL) {
1704                 return NULL;
1705         }
1706         state->ev = ev;
1707         state->call = call;
1708         state->r = r;
1709
1710         p = dcerpc_call_handle_get_pipes_struct(call);
1711         if (p == NULL) {
1712                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1713                 return tevent_req_post(req, ev);
1714         }
1715
1716         ZERO_STRUCT(r->out);
1717         r->out.disp_name = talloc_zero(r, struct lsa_StringLarge *);
1718         if (tevent_req_nomem(r->out.disp_name, req)) {
1719                 return tevent_req_post(req, ev);
1720         }
1721
1722         r->out.returned_language_id = talloc_zero(r, uint16_t);
1723         if (tevent_req_nomem(r->out.returned_language_id, req)) {
1724                 return tevent_req_post(req, ev);
1725         }
1726
1727         r->out.result = _lsa_LookupPrivDisplayName(p, r);
1728
1729         if (p->fault_state) {
1730                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1731                 tevent_req_nterror(req, status);
1732                 return tevent_req_post(req, ev);
1733         }
1734
1735         tevent_req_done(req);
1736         return tevent_req_post(req, ev);
1737 }
1738
1739 static NTSTATUS _s3_compat_lsa_LookupPrivDisplayName_recv(struct tevent_req *req)
1740 {
1741         return tevent_req_simple_recv_ntstatus(req);
1742 }
1743
1744 struct _s3_compat_lsa_DeleteObject_state {
1745         struct tevent_context *ev;
1746         struct dcerpc_call_handle *call;
1747         struct lsa_DeleteObject *r;
1748 };
1749
1750 static struct tevent_req *_s3_compat_lsa_DeleteObject_send(TALLOC_CTX *mem_ctx,
1751                                                            struct tevent_context *ev,
1752                                                            struct dcerpc_call_handle *call,
1753                                                            struct lsa_DeleteObject *r)
1754 {
1755         struct tevent_req *req;
1756         struct _s3_compat_lsa_DeleteObject_state *state;
1757         struct pipes_struct *p;
1758
1759         req = tevent_req_create(mem_ctx, &state,
1760                                 struct _s3_compat_lsa_DeleteObject_state);
1761         if (req == NULL) {
1762                 return NULL;
1763         }
1764         state->ev = ev;
1765         state->call = call;
1766         state->r = r;
1767
1768         p = dcerpc_call_handle_get_pipes_struct(call);
1769         if (p == NULL) {
1770                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1771                 return tevent_req_post(req, ev);
1772         }
1773
1774         ZERO_STRUCT(r->out);
1775         r->out.handle = r->in.handle;
1776         r->out.result = _lsa_DeleteObject(p, r);
1777
1778         if (p->fault_state) {
1779                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1780                 tevent_req_nterror(req, status);
1781                 return tevent_req_post(req, ev);
1782         }
1783
1784         tevent_req_done(req);
1785         return tevent_req_post(req, ev);
1786 }
1787
1788 static NTSTATUS _s3_compat_lsa_DeleteObject_recv(struct tevent_req *req)
1789 {
1790         return tevent_req_simple_recv_ntstatus(req);
1791 }
1792
1793 struct _s3_compat_lsa_EnumAccountsWithUserRight_state {
1794         struct tevent_context *ev;
1795         struct dcerpc_call_handle *call;
1796         struct lsa_EnumAccountsWithUserRight *r;
1797 };
1798
1799 static struct tevent_req *_s3_compat_lsa_EnumAccountsWithUserRight_send(TALLOC_CTX *mem_ctx,
1800                                                                         struct tevent_context *ev,
1801                                                                         struct dcerpc_call_handle *call,
1802                                                                         struct lsa_EnumAccountsWithUserRight *r)
1803 {
1804         struct tevent_req *req;
1805         struct _s3_compat_lsa_EnumAccountsWithUserRight_state *state;
1806         struct pipes_struct *p;
1807
1808         req = tevent_req_create(mem_ctx, &state,
1809                                 struct _s3_compat_lsa_EnumAccountsWithUserRight_state);
1810         if (req == NULL) {
1811                 return NULL;
1812         }
1813         state->ev = ev;
1814         state->call = call;
1815         state->r = r;
1816
1817         p = dcerpc_call_handle_get_pipes_struct(call);
1818         if (p == NULL) {
1819                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1820                 return tevent_req_post(req, ev);
1821         }
1822
1823         ZERO_STRUCT(r->out);
1824         r->out.sids = talloc_zero(r, struct lsa_SidArray);
1825         if (tevent_req_nomem(r->out.sids, req)) {
1826                 return tevent_req_post(req, ev);
1827         }
1828
1829         r->out.result = _lsa_EnumAccountsWithUserRight(p, r);
1830
1831         if (p->fault_state) {
1832                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1833                 tevent_req_nterror(req, status);
1834                 return tevent_req_post(req, ev);
1835         }
1836
1837         tevent_req_done(req);
1838         return tevent_req_post(req, ev);
1839 }
1840
1841 static NTSTATUS _s3_compat_lsa_EnumAccountsWithUserRight_recv(struct tevent_req *req)
1842 {
1843         return tevent_req_simple_recv_ntstatus(req);
1844 }
1845
1846 struct _s3_compat_lsa_EnumAccountRights_state {
1847         struct tevent_context *ev;
1848         struct dcerpc_call_handle *call;
1849         struct lsa_EnumAccountRights *r;
1850 };
1851
1852 static struct tevent_req *_s3_compat_lsa_EnumAccountRights_send(TALLOC_CTX *mem_ctx,
1853                                                                 struct tevent_context *ev,
1854                                                                 struct dcerpc_call_handle *call,
1855                                                                 struct lsa_EnumAccountRights *r)
1856 {
1857         struct tevent_req *req;
1858         struct _s3_compat_lsa_EnumAccountRights_state *state;
1859         struct pipes_struct *p;
1860
1861         req = tevent_req_create(mem_ctx, &state,
1862                                 struct _s3_compat_lsa_EnumAccountRights_state);
1863         if (req == NULL) {
1864                 return NULL;
1865         }
1866         state->ev = ev;
1867         state->call = call;
1868         state->r = r;
1869
1870         p = dcerpc_call_handle_get_pipes_struct(call);
1871         if (p == NULL) {
1872                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1873                 return tevent_req_post(req, ev);
1874         }
1875
1876         ZERO_STRUCT(r->out);
1877         r->out.rights = talloc_zero(r, struct lsa_RightSet);
1878         if (tevent_req_nomem(r->out.rights, req)) {
1879                 return tevent_req_post(req, ev);
1880         }
1881
1882         r->out.result = _lsa_EnumAccountRights(p, r);
1883
1884         if (p->fault_state) {
1885                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1886                 tevent_req_nterror(req, status);
1887                 return tevent_req_post(req, ev);
1888         }
1889
1890         tevent_req_done(req);
1891         return tevent_req_post(req, ev);
1892 }
1893
1894 static NTSTATUS _s3_compat_lsa_EnumAccountRights_recv(struct tevent_req *req)
1895 {
1896         return tevent_req_simple_recv_ntstatus(req);
1897 }
1898
1899 struct _s3_compat_lsa_AddAccountRights_state {
1900         struct tevent_context *ev;
1901         struct dcerpc_call_handle *call;
1902         struct lsa_AddAccountRights *r;
1903 };
1904
1905 static struct tevent_req *_s3_compat_lsa_AddAccountRights_send(TALLOC_CTX *mem_ctx,
1906                                                                struct tevent_context *ev,
1907                                                                struct dcerpc_call_handle *call,
1908                                                                struct lsa_AddAccountRights *r)
1909 {
1910         struct tevent_req *req;
1911         struct _s3_compat_lsa_AddAccountRights_state *state;
1912         struct pipes_struct *p;
1913
1914         req = tevent_req_create(mem_ctx, &state,
1915                                 struct _s3_compat_lsa_AddAccountRights_state);
1916         if (req == NULL) {
1917                 return NULL;
1918         }
1919         state->ev = ev;
1920         state->call = call;
1921         state->r = r;
1922
1923         p = dcerpc_call_handle_get_pipes_struct(call);
1924         if (p == NULL) {
1925                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1926                 return tevent_req_post(req, ev);
1927         }
1928
1929         r->out.result = _lsa_AddAccountRights(p, r);
1930
1931         if (p->fault_state) {
1932                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1933                 tevent_req_nterror(req, status);
1934                 return tevent_req_post(req, ev);
1935         }
1936
1937         tevent_req_done(req);
1938         return tevent_req_post(req, ev);
1939 }
1940
1941 static NTSTATUS _s3_compat_lsa_AddAccountRights_recv(struct tevent_req *req)
1942 {
1943         return tevent_req_simple_recv_ntstatus(req);
1944 }
1945
1946 struct _s3_compat_lsa_RemoveAccountRights_state {
1947         struct tevent_context *ev;
1948         struct dcerpc_call_handle *call;
1949         struct lsa_RemoveAccountRights *r;
1950 };
1951
1952 static struct tevent_req *_s3_compat_lsa_RemoveAccountRights_send(TALLOC_CTX *mem_ctx,
1953                                                                   struct tevent_context *ev,
1954                                                                   struct dcerpc_call_handle *call,
1955                                                                   struct lsa_RemoveAccountRights *r)
1956 {
1957         struct tevent_req *req;
1958         struct _s3_compat_lsa_RemoveAccountRights_state *state;
1959         struct pipes_struct *p;
1960
1961         req = tevent_req_create(mem_ctx, &state,
1962                                 struct _s3_compat_lsa_RemoveAccountRights_state);
1963         if (req == NULL) {
1964                 return NULL;
1965         }
1966         state->ev = ev;
1967         state->call = call;
1968         state->r = r;
1969
1970         p = dcerpc_call_handle_get_pipes_struct(call);
1971         if (p == NULL) {
1972                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
1973                 return tevent_req_post(req, ev);
1974         }
1975
1976         r->out.result = _lsa_RemoveAccountRights(p, r);
1977
1978         if (p->fault_state) {
1979                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
1980                 tevent_req_nterror(req, status);
1981                 return tevent_req_post(req, ev);
1982         }
1983
1984         tevent_req_done(req);
1985         return tevent_req_post(req, ev);
1986 }
1987
1988 static NTSTATUS _s3_compat_lsa_RemoveAccountRights_recv(struct tevent_req *req)
1989 {
1990         return tevent_req_simple_recv_ntstatus(req);
1991 }
1992
1993 struct _s3_compat_lsa_QueryTrustedDomainInfoBySid_state {
1994         struct tevent_context *ev;
1995         struct dcerpc_call_handle *call;
1996         struct lsa_QueryTrustedDomainInfoBySid *r;
1997 };
1998
1999 static struct tevent_req *_s3_compat_lsa_QueryTrustedDomainInfoBySid_send(TALLOC_CTX *mem_ctx,
2000                                                                           struct tevent_context *ev,
2001                                                                           struct dcerpc_call_handle *call,
2002                                                                           struct lsa_QueryTrustedDomainInfoBySid *r)
2003 {
2004         struct tevent_req *req;
2005         struct _s3_compat_lsa_QueryTrustedDomainInfoBySid_state *state;
2006         struct pipes_struct *p;
2007
2008         req = tevent_req_create(mem_ctx, &state,
2009                                 struct _s3_compat_lsa_QueryTrustedDomainInfoBySid_state);
2010         if (req == NULL) {
2011                 return NULL;
2012         }
2013         state->ev = ev;
2014         state->call = call;
2015         state->r = r;
2016
2017         p = dcerpc_call_handle_get_pipes_struct(call);
2018         if (p == NULL) {
2019                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2020                 return tevent_req_post(req, ev);
2021         }
2022
2023         ZERO_STRUCT(r->out);
2024         r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *);
2025         if (tevent_req_nomem(r->out.info, req)) {
2026                 return tevent_req_post(req, ev);
2027         }
2028
2029         r->out.result = _lsa_QueryTrustedDomainInfoBySid(p, r);
2030
2031         if (p->fault_state) {
2032                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2033                 tevent_req_nterror(req, status);
2034                 return tevent_req_post(req, ev);
2035         }
2036
2037         tevent_req_done(req);
2038         return tevent_req_post(req, ev);
2039 }
2040
2041 static NTSTATUS _s3_compat_lsa_QueryTrustedDomainInfoBySid_recv(struct tevent_req *req)
2042 {
2043         return tevent_req_simple_recv_ntstatus(req);
2044 }
2045
2046 struct _s3_compat_lsa_SetTrustedDomainInfo_state {
2047         struct tevent_context *ev;
2048         struct dcerpc_call_handle *call;
2049         struct lsa_SetTrustedDomainInfo *r;
2050 };
2051
2052 static struct tevent_req *_s3_compat_lsa_SetTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
2053                                                                    struct tevent_context *ev,
2054                                                                    struct dcerpc_call_handle *call,
2055                                                                    struct lsa_SetTrustedDomainInfo *r)
2056 {
2057         struct tevent_req *req;
2058         struct _s3_compat_lsa_SetTrustedDomainInfo_state *state;
2059         struct pipes_struct *p;
2060
2061         req = tevent_req_create(mem_ctx, &state,
2062                                 struct _s3_compat_lsa_SetTrustedDomainInfo_state);
2063         if (req == NULL) {
2064                 return NULL;
2065         }
2066         state->ev = ev;
2067         state->call = call;
2068         state->r = r;
2069
2070         p = dcerpc_call_handle_get_pipes_struct(call);
2071         if (p == NULL) {
2072                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2073                 return tevent_req_post(req, ev);
2074         }
2075
2076         r->out.result = _lsa_SetTrustedDomainInfo(p, r);
2077
2078         if (p->fault_state) {
2079                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2080                 tevent_req_nterror(req, status);
2081                 return tevent_req_post(req, ev);
2082         }
2083
2084         tevent_req_done(req);
2085         return tevent_req_post(req, ev);
2086 }
2087
2088 static NTSTATUS _s3_compat_lsa_SetTrustedDomainInfo_recv(struct tevent_req *req)
2089 {
2090         return tevent_req_simple_recv_ntstatus(req);
2091 }
2092
2093 struct _s3_compat_lsa_DeleteTrustedDomain_state {
2094         struct tevent_context *ev;
2095         struct dcerpc_call_handle *call;
2096         struct lsa_DeleteTrustedDomain *r;
2097 };
2098
2099 static struct tevent_req *_s3_compat_lsa_DeleteTrustedDomain_send(TALLOC_CTX *mem_ctx,
2100                                                                   struct tevent_context *ev,
2101                                                                   struct dcerpc_call_handle *call,
2102                                                                   struct lsa_DeleteTrustedDomain *r)
2103 {
2104         struct tevent_req *req;
2105         struct _s3_compat_lsa_DeleteTrustedDomain_state *state;
2106         struct pipes_struct *p;
2107
2108         req = tevent_req_create(mem_ctx, &state,
2109                                 struct _s3_compat_lsa_DeleteTrustedDomain_state);
2110         if (req == NULL) {
2111                 return NULL;
2112         }
2113         state->ev = ev;
2114         state->call = call;
2115         state->r = r;
2116
2117         p = dcerpc_call_handle_get_pipes_struct(call);
2118         if (p == NULL) {
2119                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2120                 return tevent_req_post(req, ev);
2121         }
2122
2123         r->out.result = _lsa_DeleteTrustedDomain(p, r);
2124
2125         if (p->fault_state) {
2126                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2127                 tevent_req_nterror(req, status);
2128                 return tevent_req_post(req, ev);
2129         }
2130
2131         tevent_req_done(req);
2132         return tevent_req_post(req, ev);
2133 }
2134
2135 static NTSTATUS _s3_compat_lsa_DeleteTrustedDomain_recv(struct tevent_req *req)
2136 {
2137         return tevent_req_simple_recv_ntstatus(req);
2138 }
2139
2140 struct _s3_compat_lsa_StorePrivateData_state {
2141         struct tevent_context *ev;
2142         struct dcerpc_call_handle *call;
2143         struct lsa_StorePrivateData *r;
2144 };
2145
2146 static struct tevent_req *_s3_compat_lsa_StorePrivateData_send(TALLOC_CTX *mem_ctx,
2147                                                                struct tevent_context *ev,
2148                                                                struct dcerpc_call_handle *call,
2149                                                                struct lsa_StorePrivateData *r)
2150 {
2151         struct tevent_req *req;
2152         struct _s3_compat_lsa_StorePrivateData_state *state;
2153         struct pipes_struct *p;
2154
2155         req = tevent_req_create(mem_ctx, &state,
2156                                 struct _s3_compat_lsa_StorePrivateData_state);
2157         if (req == NULL) {
2158                 return NULL;
2159         }
2160         state->ev = ev;
2161         state->call = call;
2162         state->r = r;
2163
2164         p = dcerpc_call_handle_get_pipes_struct(call);
2165         if (p == NULL) {
2166                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2167                 return tevent_req_post(req, ev);
2168         }
2169
2170         r->out.result = _lsa_StorePrivateData(p, r);
2171
2172         if (p->fault_state) {
2173                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2174                 tevent_req_nterror(req, status);
2175                 return tevent_req_post(req, ev);
2176         }
2177
2178         tevent_req_done(req);
2179         return tevent_req_post(req, ev);
2180 }
2181
2182 static NTSTATUS _s3_compat_lsa_StorePrivateData_recv(struct tevent_req *req)
2183 {
2184         return tevent_req_simple_recv_ntstatus(req);
2185 }
2186
2187 struct _s3_compat_lsa_RetrievePrivateData_state {
2188         struct tevent_context *ev;
2189         struct dcerpc_call_handle *call;
2190         struct lsa_RetrievePrivateData *r;
2191 };
2192
2193 static struct tevent_req *_s3_compat_lsa_RetrievePrivateData_send(TALLOC_CTX *mem_ctx,
2194                                                                   struct tevent_context *ev,
2195                                                                   struct dcerpc_call_handle *call,
2196                                                                   struct lsa_RetrievePrivateData *r)
2197 {
2198         struct tevent_req *req;
2199         struct _s3_compat_lsa_RetrievePrivateData_state *state;
2200         struct pipes_struct *p;
2201
2202         req = tevent_req_create(mem_ctx, &state,
2203                                 struct _s3_compat_lsa_RetrievePrivateData_state);
2204         if (req == NULL) {
2205                 return NULL;
2206         }
2207         state->ev = ev;
2208         state->call = call;
2209         state->r = r;
2210
2211         p = dcerpc_call_handle_get_pipes_struct(call);
2212         if (p == NULL) {
2213                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2214                 return tevent_req_post(req, ev);
2215         }
2216
2217         ZERO_STRUCT(r->out);
2218         r->out.val = r->in.val;
2219         r->out.result = _lsa_RetrievePrivateData(p, r);
2220
2221         if (p->fault_state) {
2222                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2223                 tevent_req_nterror(req, status);
2224                 return tevent_req_post(req, ev);
2225         }
2226
2227         tevent_req_done(req);
2228         return tevent_req_post(req, ev);
2229 }
2230
2231 static NTSTATUS _s3_compat_lsa_RetrievePrivateData_recv(struct tevent_req *req)
2232 {
2233         return tevent_req_simple_recv_ntstatus(req);
2234 }
2235
2236 struct _s3_compat_lsa_OpenPolicy2_state {
2237         struct tevent_context *ev;
2238         struct dcerpc_call_handle *call;
2239         struct lsa_OpenPolicy2 *r;
2240 };
2241
2242 static struct tevent_req *_s3_compat_lsa_OpenPolicy2_send(TALLOC_CTX *mem_ctx,
2243                                                           struct tevent_context *ev,
2244                                                           struct dcerpc_call_handle *call,
2245                                                           struct lsa_OpenPolicy2 *r)
2246 {
2247         struct tevent_req *req;
2248         struct _s3_compat_lsa_OpenPolicy2_state *state;
2249         struct pipes_struct *p;
2250
2251         req = tevent_req_create(mem_ctx, &state,
2252                                 struct _s3_compat_lsa_OpenPolicy2_state);
2253         if (req == NULL) {
2254                 return NULL;
2255         }
2256         state->ev = ev;
2257         state->call = call;
2258         state->r = r;
2259
2260         p = dcerpc_call_handle_get_pipes_struct(call);
2261         if (p == NULL) {
2262                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2263                 return tevent_req_post(req, ev);
2264         }
2265
2266         ZERO_STRUCT(r->out);
2267         r->out.handle = talloc_zero(r, struct policy_handle);
2268         if (tevent_req_nomem(r->out.handle, req)) {
2269                 return tevent_req_post(req, ev);
2270         }
2271
2272         r->out.result = _lsa_OpenPolicy2(p, r);
2273
2274         if (p->fault_state) {
2275                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2276                 tevent_req_nterror(req, status);
2277                 return tevent_req_post(req, ev);
2278         }
2279
2280         tevent_req_done(req);
2281         return tevent_req_post(req, ev);
2282 }
2283
2284 static NTSTATUS _s3_compat_lsa_OpenPolicy2_recv(struct tevent_req *req)
2285 {
2286         return tevent_req_simple_recv_ntstatus(req);
2287 }
2288
2289 struct _s3_compat_lsa_GetUserName_state {
2290         struct tevent_context *ev;
2291         struct dcerpc_call_handle *call;
2292         struct lsa_GetUserName *r;
2293 };
2294
2295 static struct tevent_req *_s3_compat_lsa_GetUserName_send(TALLOC_CTX *mem_ctx,
2296                                                           struct tevent_context *ev,
2297                                                           struct dcerpc_call_handle *call,
2298                                                           struct lsa_GetUserName *r)
2299 {
2300         struct tevent_req *req;
2301         struct _s3_compat_lsa_GetUserName_state *state;
2302         struct pipes_struct *p;
2303
2304         req = tevent_req_create(mem_ctx, &state,
2305                                 struct _s3_compat_lsa_GetUserName_state);
2306         if (req == NULL) {
2307                 return NULL;
2308         }
2309         state->ev = ev;
2310         state->call = call;
2311         state->r = r;
2312
2313         p = dcerpc_call_handle_get_pipes_struct(call);
2314         if (p == NULL) {
2315                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2316                 return tevent_req_post(req, ev);
2317         }
2318
2319         ZERO_STRUCT(r->out);
2320         r->out.account_name = r->in.account_name;
2321         r->out.authority_name = r->in.authority_name;
2322         r->out.result = _lsa_GetUserName(p, r);
2323
2324         if (p->fault_state) {
2325                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2326                 tevent_req_nterror(req, status);
2327                 return tevent_req_post(req, ev);
2328         }
2329
2330         tevent_req_done(req);
2331         return tevent_req_post(req, ev);
2332 }
2333
2334 static NTSTATUS _s3_compat_lsa_GetUserName_recv(struct tevent_req *req)
2335 {
2336         return tevent_req_simple_recv_ntstatus(req);
2337 }
2338
2339 struct _s3_compat_lsa_QueryInfoPolicy2_state {
2340         struct tevent_context *ev;
2341         struct dcerpc_call_handle *call;
2342         struct lsa_QueryInfoPolicy2 *r;
2343 };
2344
2345 static struct tevent_req *_s3_compat_lsa_QueryInfoPolicy2_send(TALLOC_CTX *mem_ctx,
2346                                                                struct tevent_context *ev,
2347                                                                struct dcerpc_call_handle *call,
2348                                                                struct lsa_QueryInfoPolicy2 *r)
2349 {
2350         struct tevent_req *req;
2351         struct _s3_compat_lsa_QueryInfoPolicy2_state *state;
2352         struct pipes_struct *p;
2353
2354         req = tevent_req_create(mem_ctx, &state,
2355                                 struct _s3_compat_lsa_QueryInfoPolicy2_state);
2356         if (req == NULL) {
2357                 return NULL;
2358         }
2359         state->ev = ev;
2360         state->call = call;
2361         state->r = r;
2362
2363         p = dcerpc_call_handle_get_pipes_struct(call);
2364         if (p == NULL) {
2365                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2366                 return tevent_req_post(req, ev);
2367         }
2368
2369         ZERO_STRUCT(r->out);
2370         r->out.info = talloc_zero(r, union lsa_PolicyInformation *);
2371         if (tevent_req_nomem(r->out.info, req)) {
2372                 return tevent_req_post(req, ev);
2373         }
2374
2375         r->out.result = _lsa_QueryInfoPolicy2(p, r);
2376
2377         if (p->fault_state) {
2378                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2379                 tevent_req_nterror(req, status);
2380                 return tevent_req_post(req, ev);
2381         }
2382
2383         tevent_req_done(req);
2384         return tevent_req_post(req, ev);
2385 }
2386
2387 static NTSTATUS _s3_compat_lsa_QueryInfoPolicy2_recv(struct tevent_req *req)
2388 {
2389         return tevent_req_simple_recv_ntstatus(req);
2390 }
2391
2392 struct _s3_compat_lsa_SetInfoPolicy2_state {
2393         struct tevent_context *ev;
2394         struct dcerpc_call_handle *call;
2395         struct lsa_SetInfoPolicy2 *r;
2396 };
2397
2398 static struct tevent_req *_s3_compat_lsa_SetInfoPolicy2_send(TALLOC_CTX *mem_ctx,
2399                                                              struct tevent_context *ev,
2400                                                              struct dcerpc_call_handle *call,
2401                                                              struct lsa_SetInfoPolicy2 *r)
2402 {
2403         struct tevent_req *req;
2404         struct _s3_compat_lsa_SetInfoPolicy2_state *state;
2405         struct pipes_struct *p;
2406
2407         req = tevent_req_create(mem_ctx, &state,
2408                                 struct _s3_compat_lsa_SetInfoPolicy2_state);
2409         if (req == NULL) {
2410                 return NULL;
2411         }
2412         state->ev = ev;
2413         state->call = call;
2414         state->r = r;
2415
2416         p = dcerpc_call_handle_get_pipes_struct(call);
2417         if (p == NULL) {
2418                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2419                 return tevent_req_post(req, ev);
2420         }
2421
2422         r->out.result = _lsa_SetInfoPolicy2(p, r);
2423
2424         if (p->fault_state) {
2425                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2426                 tevent_req_nterror(req, status);
2427                 return tevent_req_post(req, ev);
2428         }
2429
2430         tevent_req_done(req);
2431         return tevent_req_post(req, ev);
2432 }
2433
2434 static NTSTATUS _s3_compat_lsa_SetInfoPolicy2_recv(struct tevent_req *req)
2435 {
2436         return tevent_req_simple_recv_ntstatus(req);
2437 }
2438
2439 struct _s3_compat_lsa_QueryTrustedDomainInfoByName_state {
2440         struct tevent_context *ev;
2441         struct dcerpc_call_handle *call;
2442         struct lsa_QueryTrustedDomainInfoByName *r;
2443 };
2444
2445 static struct tevent_req *_s3_compat_lsa_QueryTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
2446                                                                            struct tevent_context *ev,
2447                                                                            struct dcerpc_call_handle *call,
2448                                                                            struct lsa_QueryTrustedDomainInfoByName *r)
2449 {
2450         struct tevent_req *req;
2451         struct _s3_compat_lsa_QueryTrustedDomainInfoByName_state *state;
2452         struct pipes_struct *p;
2453
2454         req = tevent_req_create(mem_ctx, &state,
2455                                 struct _s3_compat_lsa_QueryTrustedDomainInfoByName_state);
2456         if (req == NULL) {
2457                 return NULL;
2458         }
2459         state->ev = ev;
2460         state->call = call;
2461         state->r = r;
2462
2463         p = dcerpc_call_handle_get_pipes_struct(call);
2464         if (p == NULL) {
2465                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2466                 return tevent_req_post(req, ev);
2467         }
2468
2469         ZERO_STRUCT(r->out);
2470         r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *);
2471         if (tevent_req_nomem(r->out.info, req)) {
2472                 return tevent_req_post(req, ev);
2473         }
2474
2475         r->out.result = _lsa_QueryTrustedDomainInfoByName(p, r);
2476
2477         if (p->fault_state) {
2478                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2479                 tevent_req_nterror(req, status);
2480                 return tevent_req_post(req, ev);
2481         }
2482
2483         tevent_req_done(req);
2484         return tevent_req_post(req, ev);
2485 }
2486
2487 static NTSTATUS _s3_compat_lsa_QueryTrustedDomainInfoByName_recv(struct tevent_req *req)
2488 {
2489         return tevent_req_simple_recv_ntstatus(req);
2490 }
2491
2492 struct _s3_compat_lsa_SetTrustedDomainInfoByName_state {
2493         struct tevent_context *ev;
2494         struct dcerpc_call_handle *call;
2495         struct lsa_SetTrustedDomainInfoByName *r;
2496 };
2497
2498 static struct tevent_req *_s3_compat_lsa_SetTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
2499                                                                          struct tevent_context *ev,
2500                                                                          struct dcerpc_call_handle *call,
2501                                                                          struct lsa_SetTrustedDomainInfoByName *r)
2502 {
2503         struct tevent_req *req;
2504         struct _s3_compat_lsa_SetTrustedDomainInfoByName_state *state;
2505         struct pipes_struct *p;
2506
2507         req = tevent_req_create(mem_ctx, &state,
2508                                 struct _s3_compat_lsa_SetTrustedDomainInfoByName_state);
2509         if (req == NULL) {
2510                 return NULL;
2511         }
2512         state->ev = ev;
2513         state->call = call;
2514         state->r = r;
2515
2516         p = dcerpc_call_handle_get_pipes_struct(call);
2517         if (p == NULL) {
2518                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2519                 return tevent_req_post(req, ev);
2520         }
2521
2522         r->out.result = _lsa_SetTrustedDomainInfoByName(p, r);
2523
2524         if (p->fault_state) {
2525                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2526                 tevent_req_nterror(req, status);
2527                 return tevent_req_post(req, ev);
2528         }
2529
2530         tevent_req_done(req);
2531         return tevent_req_post(req, ev);
2532 }
2533
2534 static NTSTATUS _s3_compat_lsa_SetTrustedDomainInfoByName_recv(struct tevent_req *req)
2535 {
2536         return tevent_req_simple_recv_ntstatus(req);
2537 }
2538
2539 struct _s3_compat_lsa_EnumTrustedDomainsEx_state {
2540         struct tevent_context *ev;
2541         struct dcerpc_call_handle *call;
2542         struct lsa_EnumTrustedDomainsEx *r;
2543 };
2544
2545 static struct tevent_req *_s3_compat_lsa_EnumTrustedDomainsEx_send(TALLOC_CTX *mem_ctx,
2546                                                                    struct tevent_context *ev,
2547                                                                    struct dcerpc_call_handle *call,
2548                                                                    struct lsa_EnumTrustedDomainsEx *r)
2549 {
2550         struct tevent_req *req;
2551         struct _s3_compat_lsa_EnumTrustedDomainsEx_state *state;
2552         struct pipes_struct *p;
2553
2554         req = tevent_req_create(mem_ctx, &state,
2555                                 struct _s3_compat_lsa_EnumTrustedDomainsEx_state);
2556         if (req == NULL) {
2557                 return NULL;
2558         }
2559         state->ev = ev;
2560         state->call = call;
2561         state->r = r;
2562
2563         p = dcerpc_call_handle_get_pipes_struct(call);
2564         if (p == NULL) {
2565                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2566                 return tevent_req_post(req, ev);
2567         }
2568
2569         ZERO_STRUCT(r->out);
2570         r->out.resume_handle = r->in.resume_handle;
2571         r->out.domains = talloc_zero(r, struct lsa_DomainListEx);
2572         if (tevent_req_nomem(r->out.domains, req)) {
2573                 return tevent_req_post(req, ev);
2574         }
2575
2576         r->out.result = _lsa_EnumTrustedDomainsEx(p, r);
2577
2578         if (p->fault_state) {
2579                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2580                 tevent_req_nterror(req, status);
2581                 return tevent_req_post(req, ev);
2582         }
2583
2584         tevent_req_done(req);
2585         return tevent_req_post(req, ev);
2586 }
2587
2588 static NTSTATUS _s3_compat_lsa_EnumTrustedDomainsEx_recv(struct tevent_req *req)
2589 {
2590         return tevent_req_simple_recv_ntstatus(req);
2591 }
2592
2593 struct _s3_compat_lsa_CreateTrustedDomainEx_state {
2594         struct tevent_context *ev;
2595         struct dcerpc_call_handle *call;
2596         struct lsa_CreateTrustedDomainEx *r;
2597 };
2598
2599 static struct tevent_req *_s3_compat_lsa_CreateTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
2600                                                                     struct tevent_context *ev,
2601                                                                     struct dcerpc_call_handle *call,
2602                                                                     struct lsa_CreateTrustedDomainEx *r)
2603 {
2604         struct tevent_req *req;
2605         struct _s3_compat_lsa_CreateTrustedDomainEx_state *state;
2606         struct pipes_struct *p;
2607
2608         req = tevent_req_create(mem_ctx, &state,
2609                                 struct _s3_compat_lsa_CreateTrustedDomainEx_state);
2610         if (req == NULL) {
2611                 return NULL;
2612         }
2613         state->ev = ev;
2614         state->call = call;
2615         state->r = r;
2616
2617         p = dcerpc_call_handle_get_pipes_struct(call);
2618         if (p == NULL) {
2619                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2620                 return tevent_req_post(req, ev);
2621         }
2622
2623         ZERO_STRUCT(r->out);
2624         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
2625         if (tevent_req_nomem(r->out.trustdom_handle, req)) {
2626                 return tevent_req_post(req, ev);
2627         }
2628
2629         r->out.result = _lsa_CreateTrustedDomainEx(p, r);
2630
2631         if (p->fault_state) {
2632                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2633                 tevent_req_nterror(req, status);
2634                 return tevent_req_post(req, ev);
2635         }
2636
2637         tevent_req_done(req);
2638         return tevent_req_post(req, ev);
2639 }
2640
2641 static NTSTATUS _s3_compat_lsa_CreateTrustedDomainEx_recv(struct tevent_req *req)
2642 {
2643         return tevent_req_simple_recv_ntstatus(req);
2644 }
2645
2646 struct _s3_compat_lsa_CloseTrustedDomainEx_state {
2647         struct tevent_context *ev;
2648         struct dcerpc_call_handle *call;
2649         struct lsa_CloseTrustedDomainEx *r;
2650 };
2651
2652 static struct tevent_req *_s3_compat_lsa_CloseTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
2653                                                                    struct tevent_context *ev,
2654                                                                    struct dcerpc_call_handle *call,
2655                                                                    struct lsa_CloseTrustedDomainEx *r)
2656 {
2657         struct tevent_req *req;
2658         struct _s3_compat_lsa_CloseTrustedDomainEx_state *state;
2659         struct pipes_struct *p;
2660
2661         req = tevent_req_create(mem_ctx, &state,
2662                                 struct _s3_compat_lsa_CloseTrustedDomainEx_state);
2663         if (req == NULL) {
2664                 return NULL;
2665         }
2666         state->ev = ev;
2667         state->call = call;
2668         state->r = r;
2669
2670         p = dcerpc_call_handle_get_pipes_struct(call);
2671         if (p == NULL) {
2672                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2673                 return tevent_req_post(req, ev);
2674         }
2675
2676         ZERO_STRUCT(r->out);
2677         r->out.handle = r->in.handle;
2678         r->out.result = _lsa_CloseTrustedDomainEx(p, r);
2679
2680         if (p->fault_state) {
2681                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2682                 tevent_req_nterror(req, status);
2683                 return tevent_req_post(req, ev);
2684         }
2685
2686         tevent_req_done(req);
2687         return tevent_req_post(req, ev);
2688 }
2689
2690 static NTSTATUS _s3_compat_lsa_CloseTrustedDomainEx_recv(struct tevent_req *req)
2691 {
2692         return tevent_req_simple_recv_ntstatus(req);
2693 }
2694
2695 struct _s3_compat_lsa_QueryDomainInformationPolicy_state {
2696         struct tevent_context *ev;
2697         struct dcerpc_call_handle *call;
2698         struct lsa_QueryDomainInformationPolicy *r;
2699 };
2700
2701 static struct tevent_req *_s3_compat_lsa_QueryDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
2702                                                                            struct tevent_context *ev,
2703                                                                            struct dcerpc_call_handle *call,
2704                                                                            struct lsa_QueryDomainInformationPolicy *r)
2705 {
2706         struct tevent_req *req;
2707         struct _s3_compat_lsa_QueryDomainInformationPolicy_state *state;
2708         struct pipes_struct *p;
2709
2710         req = tevent_req_create(mem_ctx, &state,
2711                                 struct _s3_compat_lsa_QueryDomainInformationPolicy_state);
2712         if (req == NULL) {
2713                 return NULL;
2714         }
2715         state->ev = ev;
2716         state->call = call;
2717         state->r = r;
2718
2719         p = dcerpc_call_handle_get_pipes_struct(call);
2720         if (p == NULL) {
2721                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2722                 return tevent_req_post(req, ev);
2723         }
2724
2725         ZERO_STRUCT(r->out);
2726         r->out.info = talloc_zero(r, union lsa_DomainInformationPolicy *);
2727         if (tevent_req_nomem(r->out.info, req)) {
2728                 return tevent_req_post(req, ev);
2729         }
2730
2731         r->out.result = _lsa_QueryDomainInformationPolicy(p, r);
2732
2733         if (p->fault_state) {
2734                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2735                 tevent_req_nterror(req, status);
2736                 return tevent_req_post(req, ev);
2737         }
2738
2739         tevent_req_done(req);
2740         return tevent_req_post(req, ev);
2741 }
2742
2743 static NTSTATUS _s3_compat_lsa_QueryDomainInformationPolicy_recv(struct tevent_req *req)
2744 {
2745         return tevent_req_simple_recv_ntstatus(req);
2746 }
2747
2748 struct _s3_compat_lsa_SetDomainInformationPolicy_state {
2749         struct tevent_context *ev;
2750         struct dcerpc_call_handle *call;
2751         struct lsa_SetDomainInformationPolicy *r;
2752 };
2753
2754 static struct tevent_req *_s3_compat_lsa_SetDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
2755                                                                          struct tevent_context *ev,
2756                                                                          struct dcerpc_call_handle *call,
2757                                                                          struct lsa_SetDomainInformationPolicy *r)
2758 {
2759         struct tevent_req *req;
2760         struct _s3_compat_lsa_SetDomainInformationPolicy_state *state;
2761         struct pipes_struct *p;
2762
2763         req = tevent_req_create(mem_ctx, &state,
2764                                 struct _s3_compat_lsa_SetDomainInformationPolicy_state);
2765         if (req == NULL) {
2766                 return NULL;
2767         }
2768         state->ev = ev;
2769         state->call = call;
2770         state->r = r;
2771
2772         p = dcerpc_call_handle_get_pipes_struct(call);
2773         if (p == NULL) {
2774                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2775                 return tevent_req_post(req, ev);
2776         }
2777
2778         r->out.result = _lsa_SetDomainInformationPolicy(p, r);
2779
2780         if (p->fault_state) {
2781                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2782                 tevent_req_nterror(req, status);
2783                 return tevent_req_post(req, ev);
2784         }
2785
2786         tevent_req_done(req);
2787         return tevent_req_post(req, ev);
2788 }
2789
2790 static NTSTATUS _s3_compat_lsa_SetDomainInformationPolicy_recv(struct tevent_req *req)
2791 {
2792         return tevent_req_simple_recv_ntstatus(req);
2793 }
2794
2795 struct _s3_compat_lsa_OpenTrustedDomainByName_state {
2796         struct tevent_context *ev;
2797         struct dcerpc_call_handle *call;
2798         struct lsa_OpenTrustedDomainByName *r;
2799 };
2800
2801 static struct tevent_req *_s3_compat_lsa_OpenTrustedDomainByName_send(TALLOC_CTX *mem_ctx,
2802                                                                       struct tevent_context *ev,
2803                                                                       struct dcerpc_call_handle *call,
2804                                                                       struct lsa_OpenTrustedDomainByName *r)
2805 {
2806         struct tevent_req *req;
2807         struct _s3_compat_lsa_OpenTrustedDomainByName_state *state;
2808         struct pipes_struct *p;
2809
2810         req = tevent_req_create(mem_ctx, &state,
2811                                 struct _s3_compat_lsa_OpenTrustedDomainByName_state);
2812         if (req == NULL) {
2813                 return NULL;
2814         }
2815         state->ev = ev;
2816         state->call = call;
2817         state->r = r;
2818
2819         p = dcerpc_call_handle_get_pipes_struct(call);
2820         if (p == NULL) {
2821                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2822                 return tevent_req_post(req, ev);
2823         }
2824
2825         ZERO_STRUCT(r->out);
2826         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
2827         if (tevent_req_nomem(r->out.trustdom_handle, req)) {
2828                 return tevent_req_post(req, ev);
2829         }
2830
2831         r->out.result = _lsa_OpenTrustedDomainByName(p, r);
2832
2833         if (p->fault_state) {
2834                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2835                 tevent_req_nterror(req, status);
2836                 return tevent_req_post(req, ev);
2837         }
2838
2839         tevent_req_done(req);
2840         return tevent_req_post(req, ev);
2841 }
2842
2843 static NTSTATUS _s3_compat_lsa_OpenTrustedDomainByName_recv(struct tevent_req *req)
2844 {
2845         return tevent_req_simple_recv_ntstatus(req);
2846 }
2847
2848 struct _s3_compat_lsa_TestCall_state {
2849         struct tevent_context *ev;
2850         struct dcerpc_call_handle *call;
2851         struct lsa_TestCall *r;
2852 };
2853
2854 static struct tevent_req *_s3_compat_lsa_TestCall_send(TALLOC_CTX *mem_ctx,
2855                                                        struct tevent_context *ev,
2856                                                        struct dcerpc_call_handle *call,
2857                                                        struct lsa_TestCall *r)
2858 {
2859         struct tevent_req *req;
2860         struct _s3_compat_lsa_TestCall_state *state;
2861         struct pipes_struct *p;
2862
2863         req = tevent_req_create(mem_ctx, &state,
2864                                 struct _s3_compat_lsa_TestCall_state);
2865         if (req == NULL) {
2866                 return NULL;
2867         }
2868         state->ev = ev;
2869         state->call = call;
2870         state->r = r;
2871
2872         p = dcerpc_call_handle_get_pipes_struct(call);
2873         if (p == NULL) {
2874                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2875                 return tevent_req_post(req, ev);
2876         }
2877
2878         r->out.result = _lsa_TestCall(p, r);
2879
2880         if (p->fault_state) {
2881                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2882                 tevent_req_nterror(req, status);
2883                 return tevent_req_post(req, ev);
2884         }
2885
2886         tevent_req_done(req);
2887         return tevent_req_post(req, ev);
2888 }
2889
2890 static NTSTATUS _s3_compat_lsa_TestCall_recv(struct tevent_req *req)
2891 {
2892         return tevent_req_simple_recv_ntstatus(req);
2893 }
2894
2895 struct _s3_compat_lsa_LookupSids2_state {
2896         struct tevent_context *ev;
2897         struct dcerpc_call_handle *call;
2898         struct lsa_LookupSids2 *r;
2899 };
2900
2901 static struct tevent_req *_s3_compat_lsa_LookupSids2_send(TALLOC_CTX *mem_ctx,
2902                                                           struct tevent_context *ev,
2903                                                           struct dcerpc_call_handle *call,
2904                                                           struct lsa_LookupSids2 *r)
2905 {
2906         struct tevent_req *req;
2907         struct _s3_compat_lsa_LookupSids2_state *state;
2908         struct pipes_struct *p;
2909
2910         req = tevent_req_create(mem_ctx, &state,
2911                                 struct _s3_compat_lsa_LookupSids2_state);
2912         if (req == NULL) {
2913                 return NULL;
2914         }
2915         state->ev = ev;
2916         state->call = call;
2917         state->r = r;
2918
2919         p = dcerpc_call_handle_get_pipes_struct(call);
2920         if (p == NULL) {
2921                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2922                 return tevent_req_post(req, ev);
2923         }
2924
2925         ZERO_STRUCT(r->out);
2926         r->out.names = r->in.names;
2927         r->out.count = r->in.count;
2928         r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
2929         if (tevent_req_nomem(r->out.domains, req)) {
2930                 return tevent_req_post(req, ev);
2931         }
2932
2933         r->out.result = _lsa_LookupSids2(p, r);
2934
2935         if (p->fault_state) {
2936                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2937                 tevent_req_nterror(req, status);
2938                 return tevent_req_post(req, ev);
2939         }
2940
2941         tevent_req_done(req);
2942         return tevent_req_post(req, ev);
2943 }
2944
2945 static NTSTATUS _s3_compat_lsa_LookupSids2_recv(struct tevent_req *req)
2946 {
2947         return tevent_req_simple_recv_ntstatus(req);
2948 }
2949
2950 struct _s3_compat_lsa_LookupNames2_state {
2951         struct tevent_context *ev;
2952         struct dcerpc_call_handle *call;
2953         struct lsa_LookupNames2 *r;
2954 };
2955
2956 static struct tevent_req *_s3_compat_lsa_LookupNames2_send(TALLOC_CTX *mem_ctx,
2957                                                            struct tevent_context *ev,
2958                                                            struct dcerpc_call_handle *call,
2959                                                            struct lsa_LookupNames2 *r)
2960 {
2961         struct tevent_req *req;
2962         struct _s3_compat_lsa_LookupNames2_state *state;
2963         struct pipes_struct *p;
2964
2965         req = tevent_req_create(mem_ctx, &state,
2966                                 struct _s3_compat_lsa_LookupNames2_state);
2967         if (req == NULL) {
2968                 return NULL;
2969         }
2970         state->ev = ev;
2971         state->call = call;
2972         state->r = r;
2973
2974         p = dcerpc_call_handle_get_pipes_struct(call);
2975         if (p == NULL) {
2976                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
2977                 return tevent_req_post(req, ev);
2978         }
2979
2980         ZERO_STRUCT(r->out);
2981         r->out.sids = r->in.sids;
2982         r->out.count = r->in.count;
2983         r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
2984         if (tevent_req_nomem(r->out.domains, req)) {
2985                 return tevent_req_post(req, ev);
2986         }
2987
2988         r->out.result = _lsa_LookupNames2(p, r);
2989
2990         if (p->fault_state) {
2991                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
2992                 tevent_req_nterror(req, status);
2993                 return tevent_req_post(req, ev);
2994         }
2995
2996         tevent_req_done(req);
2997         return tevent_req_post(req, ev);
2998 }
2999
3000 static NTSTATUS _s3_compat_lsa_LookupNames2_recv(struct tevent_req *req)
3001 {
3002         return tevent_req_simple_recv_ntstatus(req);
3003 }
3004
3005 struct _s3_compat_lsa_CreateTrustedDomainEx2_state {
3006         struct tevent_context *ev;
3007         struct dcerpc_call_handle *call;
3008         struct lsa_CreateTrustedDomainEx2 *r;
3009 };
3010
3011 static struct tevent_req *_s3_compat_lsa_CreateTrustedDomainEx2_send(TALLOC_CTX *mem_ctx,
3012                                                                      struct tevent_context *ev,
3013                                                                      struct dcerpc_call_handle *call,
3014                                                                      struct lsa_CreateTrustedDomainEx2 *r)
3015 {
3016         struct tevent_req *req;
3017         struct _s3_compat_lsa_CreateTrustedDomainEx2_state *state;
3018         struct pipes_struct *p;
3019
3020         req = tevent_req_create(mem_ctx, &state,
3021                                 struct _s3_compat_lsa_CreateTrustedDomainEx2_state);
3022         if (req == NULL) {
3023                 return NULL;
3024         }
3025         state->ev = ev;
3026         state->call = call;
3027         state->r = r;
3028
3029         p = dcerpc_call_handle_get_pipes_struct(call);
3030         if (p == NULL) {
3031                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3032                 return tevent_req_post(req, ev);
3033         }
3034
3035         ZERO_STRUCT(r->out);
3036         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
3037         if (tevent_req_nomem(r->out.trustdom_handle, req)) {
3038                 return tevent_req_post(req, ev);
3039         }
3040
3041         r->out.result = _lsa_CreateTrustedDomainEx2(p, r);
3042
3043         if (p->fault_state) {
3044                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3045                 tevent_req_nterror(req, status);
3046                 return tevent_req_post(req, ev);
3047         }
3048
3049         tevent_req_done(req);
3050         return tevent_req_post(req, ev);
3051 }
3052
3053 static NTSTATUS _s3_compat_lsa_CreateTrustedDomainEx2_recv(struct tevent_req *req)
3054 {
3055         return tevent_req_simple_recv_ntstatus(req);
3056 }
3057
3058 struct _s3_compat_lsa_CREDRWRITE_state {
3059         struct tevent_context *ev;
3060         struct dcerpc_call_handle *call;
3061         struct lsa_CREDRWRITE *r;
3062 };
3063
3064 static struct tevent_req *_s3_compat_lsa_CREDRWRITE_send(TALLOC_CTX *mem_ctx,
3065                                                          struct tevent_context *ev,
3066                                                          struct dcerpc_call_handle *call,
3067                                                          struct lsa_CREDRWRITE *r)
3068 {
3069         struct tevent_req *req;
3070         struct _s3_compat_lsa_CREDRWRITE_state *state;
3071         struct pipes_struct *p;
3072
3073         req = tevent_req_create(mem_ctx, &state,
3074                                 struct _s3_compat_lsa_CREDRWRITE_state);
3075         if (req == NULL) {
3076                 return NULL;
3077         }
3078         state->ev = ev;
3079         state->call = call;
3080         state->r = r;
3081
3082         p = dcerpc_call_handle_get_pipes_struct(call);
3083         if (p == NULL) {
3084                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3085                 return tevent_req_post(req, ev);
3086         }
3087
3088         r->out.result = _lsa_CREDRWRITE(p, r);
3089
3090         if (p->fault_state) {
3091                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3092                 tevent_req_nterror(req, status);
3093                 return tevent_req_post(req, ev);
3094         }
3095
3096         tevent_req_done(req);
3097         return tevent_req_post(req, ev);
3098 }
3099
3100 static NTSTATUS _s3_compat_lsa_CREDRWRITE_recv(struct tevent_req *req)
3101 {
3102         return tevent_req_simple_recv_ntstatus(req);
3103 }
3104
3105 struct _s3_compat_lsa_CREDRREAD_state {
3106         struct tevent_context *ev;
3107         struct dcerpc_call_handle *call;
3108         struct lsa_CREDRREAD *r;
3109 };
3110
3111 static struct tevent_req *_s3_compat_lsa_CREDRREAD_send(TALLOC_CTX *mem_ctx,
3112                                                         struct tevent_context *ev,
3113                                                         struct dcerpc_call_handle *call,
3114                                                         struct lsa_CREDRREAD *r)
3115 {
3116         struct tevent_req *req;
3117         struct _s3_compat_lsa_CREDRREAD_state *state;
3118         struct pipes_struct *p;
3119
3120         req = tevent_req_create(mem_ctx, &state,
3121                                 struct _s3_compat_lsa_CREDRREAD_state);
3122         if (req == NULL) {
3123                 return NULL;
3124         }
3125         state->ev = ev;
3126         state->call = call;
3127         state->r = r;
3128
3129         p = dcerpc_call_handle_get_pipes_struct(call);
3130         if (p == NULL) {
3131                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3132                 return tevent_req_post(req, ev);
3133         }
3134
3135         r->out.result = _lsa_CREDRREAD(p, r);
3136
3137         if (p->fault_state) {
3138                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3139                 tevent_req_nterror(req, status);
3140                 return tevent_req_post(req, ev);
3141         }
3142
3143         tevent_req_done(req);
3144         return tevent_req_post(req, ev);
3145 }
3146
3147 static NTSTATUS _s3_compat_lsa_CREDRREAD_recv(struct tevent_req *req)
3148 {
3149         return tevent_req_simple_recv_ntstatus(req);
3150 }
3151
3152 struct _s3_compat_lsa_CREDRENUMERATE_state {
3153         struct tevent_context *ev;
3154         struct dcerpc_call_handle *call;
3155         struct lsa_CREDRENUMERATE *r;
3156 };
3157
3158 static struct tevent_req *_s3_compat_lsa_CREDRENUMERATE_send(TALLOC_CTX *mem_ctx,
3159                                                              struct tevent_context *ev,
3160                                                              struct dcerpc_call_handle *call,
3161                                                              struct lsa_CREDRENUMERATE *r)
3162 {
3163         struct tevent_req *req;
3164         struct _s3_compat_lsa_CREDRENUMERATE_state *state;
3165         struct pipes_struct *p;
3166
3167         req = tevent_req_create(mem_ctx, &state,
3168                                 struct _s3_compat_lsa_CREDRENUMERATE_state);
3169         if (req == NULL) {
3170                 return NULL;
3171         }
3172         state->ev = ev;
3173         state->call = call;
3174         state->r = r;
3175
3176         p = dcerpc_call_handle_get_pipes_struct(call);
3177         if (p == NULL) {
3178                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3179                 return tevent_req_post(req, ev);
3180         }
3181
3182         r->out.result = _lsa_CREDRENUMERATE(p, r);
3183
3184         if (p->fault_state) {
3185                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3186                 tevent_req_nterror(req, status);
3187                 return tevent_req_post(req, ev);
3188         }
3189
3190         tevent_req_done(req);
3191         return tevent_req_post(req, ev);
3192 }
3193
3194 static NTSTATUS _s3_compat_lsa_CREDRENUMERATE_recv(struct tevent_req *req)
3195 {
3196         return tevent_req_simple_recv_ntstatus(req);
3197 }
3198
3199 struct _s3_compat_lsa_CREDRWRITEDOMAINCREDENTIALS_state {
3200         struct tevent_context *ev;
3201         struct dcerpc_call_handle *call;
3202         struct lsa_CREDRWRITEDOMAINCREDENTIALS *r;
3203 };
3204
3205 static struct tevent_req *_s3_compat_lsa_CREDRWRITEDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
3206                                                                           struct tevent_context *ev,
3207                                                                           struct dcerpc_call_handle *call,
3208                                                                           struct lsa_CREDRWRITEDOMAINCREDENTIALS *r)
3209 {
3210         struct tevent_req *req;
3211         struct _s3_compat_lsa_CREDRWRITEDOMAINCREDENTIALS_state *state;
3212         struct pipes_struct *p;
3213
3214         req = tevent_req_create(mem_ctx, &state,
3215                                 struct _s3_compat_lsa_CREDRWRITEDOMAINCREDENTIALS_state);
3216         if (req == NULL) {
3217                 return NULL;
3218         }
3219         state->ev = ev;
3220         state->call = call;
3221         state->r = r;
3222
3223         p = dcerpc_call_handle_get_pipes_struct(call);
3224         if (p == NULL) {
3225                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3226                 return tevent_req_post(req, ev);
3227         }
3228
3229         r->out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p, r);
3230
3231         if (p->fault_state) {
3232                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3233                 tevent_req_nterror(req, status);
3234                 return tevent_req_post(req, ev);
3235         }
3236
3237         tevent_req_done(req);
3238         return tevent_req_post(req, ev);
3239 }
3240
3241 static NTSTATUS _s3_compat_lsa_CREDRWRITEDOMAINCREDENTIALS_recv(struct tevent_req *req)
3242 {
3243         return tevent_req_simple_recv_ntstatus(req);
3244 }
3245
3246 struct _s3_compat_lsa_CREDRREADDOMAINCREDENTIALS_state {
3247         struct tevent_context *ev;
3248         struct dcerpc_call_handle *call;
3249         struct lsa_CREDRREADDOMAINCREDENTIALS *r;
3250 };
3251
3252 static struct tevent_req *_s3_compat_lsa_CREDRREADDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
3253                                                                          struct tevent_context *ev,
3254                                                                          struct dcerpc_call_handle *call,
3255                                                                          struct lsa_CREDRREADDOMAINCREDENTIALS *r)
3256 {
3257         struct tevent_req *req;
3258         struct _s3_compat_lsa_CREDRREADDOMAINCREDENTIALS_state *state;
3259         struct pipes_struct *p;
3260
3261         req = tevent_req_create(mem_ctx, &state,
3262                                 struct _s3_compat_lsa_CREDRREADDOMAINCREDENTIALS_state);
3263         if (req == NULL) {
3264                 return NULL;
3265         }
3266         state->ev = ev;
3267         state->call = call;
3268         state->r = r;
3269
3270         p = dcerpc_call_handle_get_pipes_struct(call);
3271         if (p == NULL) {
3272                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3273                 return tevent_req_post(req, ev);
3274         }
3275
3276         r->out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p, r);
3277
3278         if (p->fault_state) {
3279                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3280                 tevent_req_nterror(req, status);
3281                 return tevent_req_post(req, ev);
3282         }
3283
3284         tevent_req_done(req);
3285         return tevent_req_post(req, ev);
3286 }
3287
3288 static NTSTATUS _s3_compat_lsa_CREDRREADDOMAINCREDENTIALS_recv(struct tevent_req *req)
3289 {
3290         return tevent_req_simple_recv_ntstatus(req);
3291 }
3292
3293 struct _s3_compat_lsa_CREDRDELETE_state {
3294         struct tevent_context *ev;
3295         struct dcerpc_call_handle *call;
3296         struct lsa_CREDRDELETE *r;
3297 };
3298
3299 static struct tevent_req *_s3_compat_lsa_CREDRDELETE_send(TALLOC_CTX *mem_ctx,
3300                                                           struct tevent_context *ev,
3301                                                           struct dcerpc_call_handle *call,
3302                                                           struct lsa_CREDRDELETE *r)
3303 {
3304         struct tevent_req *req;
3305         struct _s3_compat_lsa_CREDRDELETE_state *state;
3306         struct pipes_struct *p;
3307
3308         req = tevent_req_create(mem_ctx, &state,
3309                                 struct _s3_compat_lsa_CREDRDELETE_state);
3310         if (req == NULL) {
3311                 return NULL;
3312         }
3313         state->ev = ev;
3314         state->call = call;
3315         state->r = r;
3316
3317         p = dcerpc_call_handle_get_pipes_struct(call);
3318         if (p == NULL) {
3319                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3320                 return tevent_req_post(req, ev);
3321         }
3322
3323         r->out.result = _lsa_CREDRDELETE(p, r);
3324
3325         if (p->fault_state) {
3326                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3327                 tevent_req_nterror(req, status);
3328                 return tevent_req_post(req, ev);
3329         }
3330
3331         tevent_req_done(req);
3332         return tevent_req_post(req, ev);
3333 }
3334
3335 static NTSTATUS _s3_compat_lsa_CREDRDELETE_recv(struct tevent_req *req)
3336 {
3337         return tevent_req_simple_recv_ntstatus(req);
3338 }
3339
3340 struct _s3_compat_lsa_CREDRGETTARGETINFO_state {
3341         struct tevent_context *ev;
3342         struct dcerpc_call_handle *call;
3343         struct lsa_CREDRGETTARGETINFO *r;
3344 };
3345
3346 static struct tevent_req *_s3_compat_lsa_CREDRGETTARGETINFO_send(TALLOC_CTX *mem_ctx,
3347                                                                  struct tevent_context *ev,
3348                                                                  struct dcerpc_call_handle *call,
3349                                                                  struct lsa_CREDRGETTARGETINFO *r)
3350 {
3351         struct tevent_req *req;
3352         struct _s3_compat_lsa_CREDRGETTARGETINFO_state *state;
3353         struct pipes_struct *p;
3354
3355         req = tevent_req_create(mem_ctx, &state,
3356                                 struct _s3_compat_lsa_CREDRGETTARGETINFO_state);
3357         if (req == NULL) {
3358                 return NULL;
3359         }
3360         state->ev = ev;
3361         state->call = call;
3362         state->r = r;
3363
3364         p = dcerpc_call_handle_get_pipes_struct(call);
3365         if (p == NULL) {
3366                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3367                 return tevent_req_post(req, ev);
3368         }
3369
3370         r->out.result = _lsa_CREDRGETTARGETINFO(p, r);
3371
3372         if (p->fault_state) {
3373                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3374                 tevent_req_nterror(req, status);
3375                 return tevent_req_post(req, ev);
3376         }
3377
3378         tevent_req_done(req);
3379         return tevent_req_post(req, ev);
3380 }
3381
3382 static NTSTATUS _s3_compat_lsa_CREDRGETTARGETINFO_recv(struct tevent_req *req)
3383 {
3384         return tevent_req_simple_recv_ntstatus(req);
3385 }
3386
3387 struct _s3_compat_lsa_CREDRPROFILELOADED_state {
3388         struct tevent_context *ev;
3389         struct dcerpc_call_handle *call;
3390         struct lsa_CREDRPROFILELOADED *r;
3391 };
3392
3393 static struct tevent_req *_s3_compat_lsa_CREDRPROFILELOADED_send(TALLOC_CTX *mem_ctx,
3394                                                                  struct tevent_context *ev,
3395                                                                  struct dcerpc_call_handle *call,
3396                                                                  struct lsa_CREDRPROFILELOADED *r)
3397 {
3398         struct tevent_req *req;
3399         struct _s3_compat_lsa_CREDRPROFILELOADED_state *state;
3400         struct pipes_struct *p;
3401
3402         req = tevent_req_create(mem_ctx, &state,
3403                                 struct _s3_compat_lsa_CREDRPROFILELOADED_state);
3404         if (req == NULL) {
3405                 return NULL;
3406         }
3407         state->ev = ev;
3408         state->call = call;
3409         state->r = r;
3410
3411         p = dcerpc_call_handle_get_pipes_struct(call);
3412         if (p == NULL) {
3413                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3414                 return tevent_req_post(req, ev);
3415         }
3416
3417         r->out.result = _lsa_CREDRPROFILELOADED(p, r);
3418
3419         if (p->fault_state) {
3420                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3421                 tevent_req_nterror(req, status);
3422                 return tevent_req_post(req, ev);
3423         }
3424
3425         tevent_req_done(req);
3426         return tevent_req_post(req, ev);
3427 }
3428
3429 static NTSTATUS _s3_compat_lsa_CREDRPROFILELOADED_recv(struct tevent_req *req)
3430 {
3431         return tevent_req_simple_recv_ntstatus(req);
3432 }
3433
3434 struct _s3_compat_lsa_LookupNames3_state {
3435         struct tevent_context *ev;
3436         struct dcerpc_call_handle *call;
3437         struct lsa_LookupNames3 *r;
3438 };
3439
3440 static struct tevent_req *_s3_compat_lsa_LookupNames3_send(TALLOC_CTX *mem_ctx,
3441                                                            struct tevent_context *ev,
3442                                                            struct dcerpc_call_handle *call,
3443                                                            struct lsa_LookupNames3 *r)
3444 {
3445         struct tevent_req *req;
3446         struct _s3_compat_lsa_LookupNames3_state *state;
3447         struct pipes_struct *p;
3448
3449         req = tevent_req_create(mem_ctx, &state,
3450                                 struct _s3_compat_lsa_LookupNames3_state);
3451         if (req == NULL) {
3452                 return NULL;
3453         }
3454         state->ev = ev;
3455         state->call = call;
3456         state->r = r;
3457
3458         p = dcerpc_call_handle_get_pipes_struct(call);
3459         if (p == NULL) {
3460                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3461                 return tevent_req_post(req, ev);
3462         }
3463
3464         ZERO_STRUCT(r->out);
3465         r->out.sids = r->in.sids;
3466         r->out.count = r->in.count;
3467         r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
3468         if (tevent_req_nomem(r->out.domains, req)) {
3469                 return tevent_req_post(req, ev);
3470         }
3471
3472         r->out.result = _lsa_LookupNames3(p, r);
3473
3474         if (p->fault_state) {
3475                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3476                 tevent_req_nterror(req, status);
3477                 return tevent_req_post(req, ev);
3478         }
3479
3480         tevent_req_done(req);
3481         return tevent_req_post(req, ev);
3482 }
3483
3484 static NTSTATUS _s3_compat_lsa_LookupNames3_recv(struct tevent_req *req)
3485 {
3486         return tevent_req_simple_recv_ntstatus(req);
3487 }
3488
3489 struct _s3_compat_lsa_CREDRGETSESSIONTYPES_state {
3490         struct tevent_context *ev;
3491         struct dcerpc_call_handle *call;
3492         struct lsa_CREDRGETSESSIONTYPES *r;
3493 };
3494
3495 static struct tevent_req *_s3_compat_lsa_CREDRGETSESSIONTYPES_send(TALLOC_CTX *mem_ctx,
3496                                                                    struct tevent_context *ev,
3497                                                                    struct dcerpc_call_handle *call,
3498                                                                    struct lsa_CREDRGETSESSIONTYPES *r)
3499 {
3500         struct tevent_req *req;
3501         struct _s3_compat_lsa_CREDRGETSESSIONTYPES_state *state;
3502         struct pipes_struct *p;
3503
3504         req = tevent_req_create(mem_ctx, &state,
3505                                 struct _s3_compat_lsa_CREDRGETSESSIONTYPES_state);
3506         if (req == NULL) {
3507                 return NULL;
3508         }
3509         state->ev = ev;
3510         state->call = call;
3511         state->r = r;
3512
3513         p = dcerpc_call_handle_get_pipes_struct(call);
3514         if (p == NULL) {
3515                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3516                 return tevent_req_post(req, ev);
3517         }
3518
3519         r->out.result = _lsa_CREDRGETSESSIONTYPES(p, r);
3520
3521         if (p->fault_state) {
3522                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3523                 tevent_req_nterror(req, status);
3524                 return tevent_req_post(req, ev);
3525         }
3526
3527         tevent_req_done(req);
3528         return tevent_req_post(req, ev);
3529 }
3530
3531 static NTSTATUS _s3_compat_lsa_CREDRGETSESSIONTYPES_recv(struct tevent_req *req)
3532 {
3533         return tevent_req_simple_recv_ntstatus(req);
3534 }
3535
3536 struct _s3_compat_lsa_LSARREGISTERAUDITEVENT_state {
3537         struct tevent_context *ev;
3538         struct dcerpc_call_handle *call;
3539         struct lsa_LSARREGISTERAUDITEVENT *r;
3540 };
3541
3542 static struct tevent_req *_s3_compat_lsa_LSARREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
3543                                                                      struct tevent_context *ev,
3544                                                                      struct dcerpc_call_handle *call,
3545                                                                      struct lsa_LSARREGISTERAUDITEVENT *r)
3546 {
3547         struct tevent_req *req;
3548         struct _s3_compat_lsa_LSARREGISTERAUDITEVENT_state *state;
3549         struct pipes_struct *p;
3550
3551         req = tevent_req_create(mem_ctx, &state,
3552                                 struct _s3_compat_lsa_LSARREGISTERAUDITEVENT_state);
3553         if (req == NULL) {
3554                 return NULL;
3555         }
3556         state->ev = ev;
3557         state->call = call;
3558         state->r = r;
3559
3560         p = dcerpc_call_handle_get_pipes_struct(call);
3561         if (p == NULL) {
3562                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3563                 return tevent_req_post(req, ev);
3564         }
3565
3566         r->out.result = _lsa_LSARREGISTERAUDITEVENT(p, r);
3567
3568         if (p->fault_state) {
3569                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3570                 tevent_req_nterror(req, status);
3571                 return tevent_req_post(req, ev);
3572         }
3573
3574         tevent_req_done(req);
3575         return tevent_req_post(req, ev);
3576 }
3577
3578 static NTSTATUS _s3_compat_lsa_LSARREGISTERAUDITEVENT_recv(struct tevent_req *req)
3579 {
3580         return tevent_req_simple_recv_ntstatus(req);
3581 }
3582
3583 struct _s3_compat_lsa_LSARGENAUDITEVENT_state {
3584         struct tevent_context *ev;
3585         struct dcerpc_call_handle *call;
3586         struct lsa_LSARGENAUDITEVENT *r;
3587 };
3588
3589 static struct tevent_req *_s3_compat_lsa_LSARGENAUDITEVENT_send(TALLOC_CTX *mem_ctx,
3590                                                                 struct tevent_context *ev,
3591                                                                 struct dcerpc_call_handle *call,
3592                                                                 struct lsa_LSARGENAUDITEVENT *r)
3593 {
3594         struct tevent_req *req;
3595         struct _s3_compat_lsa_LSARGENAUDITEVENT_state *state;
3596         struct pipes_struct *p;
3597
3598         req = tevent_req_create(mem_ctx, &state,
3599                                 struct _s3_compat_lsa_LSARGENAUDITEVENT_state);
3600         if (req == NULL) {
3601                 return NULL;
3602         }
3603         state->ev = ev;
3604         state->call = call;
3605         state->r = r;
3606
3607         p = dcerpc_call_handle_get_pipes_struct(call);
3608         if (p == NULL) {
3609                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3610                 return tevent_req_post(req, ev);
3611         }
3612
3613         r->out.result = _lsa_LSARGENAUDITEVENT(p, r);
3614
3615         if (p->fault_state) {
3616                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3617                 tevent_req_nterror(req, status);
3618                 return tevent_req_post(req, ev);
3619         }
3620
3621         tevent_req_done(req);
3622         return tevent_req_post(req, ev);
3623 }
3624
3625 static NTSTATUS _s3_compat_lsa_LSARGENAUDITEVENT_recv(struct tevent_req *req)
3626 {
3627         return tevent_req_simple_recv_ntstatus(req);
3628 }
3629
3630 struct _s3_compat_lsa_LSARUNREGISTERAUDITEVENT_state {
3631         struct tevent_context *ev;
3632         struct dcerpc_call_handle *call;
3633         struct lsa_LSARUNREGISTERAUDITEVENT *r;
3634 };
3635
3636 static struct tevent_req *_s3_compat_lsa_LSARUNREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
3637                                                                        struct tevent_context *ev,
3638                                                                        struct dcerpc_call_handle *call,
3639                                                                        struct lsa_LSARUNREGISTERAUDITEVENT *r)
3640 {
3641         struct tevent_req *req;
3642         struct _s3_compat_lsa_LSARUNREGISTERAUDITEVENT_state *state;
3643         struct pipes_struct *p;
3644
3645         req = tevent_req_create(mem_ctx, &state,
3646                                 struct _s3_compat_lsa_LSARUNREGISTERAUDITEVENT_state);
3647         if (req == NULL) {
3648                 return NULL;
3649         }
3650         state->ev = ev;
3651         state->call = call;
3652         state->r = r;
3653
3654         p = dcerpc_call_handle_get_pipes_struct(call);
3655         if (p == NULL) {
3656                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3657                 return tevent_req_post(req, ev);
3658         }
3659
3660         r->out.result = _lsa_LSARUNREGISTERAUDITEVENT(p, r);
3661
3662         if (p->fault_state) {
3663                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3664                 tevent_req_nterror(req, status);
3665                 return tevent_req_post(req, ev);
3666         }
3667
3668         tevent_req_done(req);
3669         return tevent_req_post(req, ev);
3670 }
3671
3672 static NTSTATUS _s3_compat_lsa_LSARUNREGISTERAUDITEVENT_recv(struct tevent_req *req)
3673 {
3674         return tevent_req_simple_recv_ntstatus(req);
3675 }
3676
3677 struct _s3_compat_lsa_lsaRQueryForestTrustInformation_state {
3678         struct tevent_context *ev;
3679         struct dcerpc_call_handle *call;
3680         struct lsa_lsaRQueryForestTrustInformation *r;
3681 };
3682
3683 static struct tevent_req *_s3_compat_lsa_lsaRQueryForestTrustInformation_send(TALLOC_CTX *mem_ctx,
3684                                                                               struct tevent_context *ev,
3685                                                                               struct dcerpc_call_handle *call,
3686                                                                               struct lsa_lsaRQueryForestTrustInformation *r)
3687 {
3688         struct tevent_req *req;
3689         struct _s3_compat_lsa_lsaRQueryForestTrustInformation_state *state;
3690         struct pipes_struct *p;
3691
3692         req = tevent_req_create(mem_ctx, &state,
3693                                 struct _s3_compat_lsa_lsaRQueryForestTrustInformation_state);
3694         if (req == NULL) {
3695                 return NULL;
3696         }
3697         state->ev = ev;
3698         state->call = call;
3699         state->r = r;
3700
3701         p = dcerpc_call_handle_get_pipes_struct(call);
3702         if (p == NULL) {
3703                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3704                 return tevent_req_post(req, ev);
3705         }
3706
3707         ZERO_STRUCT(r->out);
3708         r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *);
3709         if (tevent_req_nomem(r->out.forest_trust_info, req)) {
3710                 return tevent_req_post(req, ev);
3711         }
3712
3713         r->out.result = _lsa_lsaRQueryForestTrustInformation(p, r);
3714
3715         if (p->fault_state) {
3716                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3717                 tevent_req_nterror(req, status);
3718                 return tevent_req_post(req, ev);
3719         }
3720
3721         tevent_req_done(req);
3722         return tevent_req_post(req, ev);
3723 }
3724
3725 static NTSTATUS _s3_compat_lsa_lsaRQueryForestTrustInformation_recv(struct tevent_req *req)
3726 {
3727         return tevent_req_simple_recv_ntstatus(req);
3728 }
3729
3730 struct _s3_compat_lsa_lsaRSetForestTrustInformation_state {
3731         struct tevent_context *ev;
3732         struct dcerpc_call_handle *call;
3733         struct lsa_lsaRSetForestTrustInformation *r;
3734 };
3735
3736 static struct tevent_req *_s3_compat_lsa_lsaRSetForestTrustInformation_send(TALLOC_CTX *mem_ctx,
3737                                                                             struct tevent_context *ev,
3738                                                                             struct dcerpc_call_handle *call,
3739                                                                             struct lsa_lsaRSetForestTrustInformation *r)
3740 {
3741         struct tevent_req *req;
3742         struct _s3_compat_lsa_lsaRSetForestTrustInformation_state *state;
3743         struct pipes_struct *p;
3744
3745         req = tevent_req_create(mem_ctx, &state,
3746                                 struct _s3_compat_lsa_lsaRSetForestTrustInformation_state);
3747         if (req == NULL) {
3748                 return NULL;
3749         }
3750         state->ev = ev;
3751         state->call = call;
3752         state->r = r;
3753
3754         p = dcerpc_call_handle_get_pipes_struct(call);
3755         if (p == NULL) {
3756                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3757                 return tevent_req_post(req, ev);
3758         }
3759
3760         ZERO_STRUCT(r->out);
3761         r->out.collision_info = talloc_zero(r, struct lsa_ForestTrustCollisionInfo *);
3762         if (tevent_req_nomem(r->out.collision_info, req)) {
3763                 return tevent_req_post(req, ev);
3764         }
3765
3766         r->out.result = _lsa_lsaRSetForestTrustInformation(p, r);
3767
3768         if (p->fault_state) {
3769                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3770                 tevent_req_nterror(req, status);
3771                 return tevent_req_post(req, ev);
3772         }
3773
3774         tevent_req_done(req);
3775         return tevent_req_post(req, ev);
3776 }
3777
3778 static NTSTATUS _s3_compat_lsa_lsaRSetForestTrustInformation_recv(struct tevent_req *req)
3779 {
3780         return tevent_req_simple_recv_ntstatus(req);
3781 }
3782
3783 struct _s3_compat_lsa_CREDRRENAME_state {
3784         struct tevent_context *ev;
3785         struct dcerpc_call_handle *call;
3786         struct lsa_CREDRRENAME *r;
3787 };
3788
3789 static struct tevent_req *_s3_compat_lsa_CREDRRENAME_send(TALLOC_CTX *mem_ctx,
3790                                                           struct tevent_context *ev,
3791                                                           struct dcerpc_call_handle *call,
3792                                                           struct lsa_CREDRRENAME *r)
3793 {
3794         struct tevent_req *req;
3795         struct _s3_compat_lsa_CREDRRENAME_state *state;
3796         struct pipes_struct *p;
3797
3798         req = tevent_req_create(mem_ctx, &state,
3799                                 struct _s3_compat_lsa_CREDRRENAME_state);
3800         if (req == NULL) {
3801                 return NULL;
3802         }
3803         state->ev = ev;
3804         state->call = call;
3805         state->r = r;
3806
3807         p = dcerpc_call_handle_get_pipes_struct(call);
3808         if (p == NULL) {
3809                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3810                 return tevent_req_post(req, ev);
3811         }
3812
3813         r->out.result = _lsa_CREDRRENAME(p, r);
3814
3815         if (p->fault_state) {
3816                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3817                 tevent_req_nterror(req, status);
3818                 return tevent_req_post(req, ev);
3819         }
3820
3821         tevent_req_done(req);
3822         return tevent_req_post(req, ev);
3823 }
3824
3825 static NTSTATUS _s3_compat_lsa_CREDRRENAME_recv(struct tevent_req *req)
3826 {
3827         return tevent_req_simple_recv_ntstatus(req);
3828 }
3829
3830 struct _s3_compat_lsa_LookupSids3_state {
3831         struct tevent_context *ev;
3832         struct dcerpc_call_handle *call;
3833         struct lsa_LookupSids3 *r;
3834 };
3835
3836 static struct tevent_req *_s3_compat_lsa_LookupSids3_send(TALLOC_CTX *mem_ctx,
3837                                                           struct tevent_context *ev,
3838                                                           struct dcerpc_call_handle *call,
3839                                                           struct lsa_LookupSids3 *r)
3840 {
3841         struct tevent_req *req;
3842         struct _s3_compat_lsa_LookupSids3_state *state;
3843         struct pipes_struct *p;
3844
3845         req = tevent_req_create(mem_ctx, &state,
3846                                 struct _s3_compat_lsa_LookupSids3_state);
3847         if (req == NULL) {
3848                 return NULL;
3849         }
3850         state->ev = ev;
3851         state->call = call;
3852         state->r = r;
3853
3854         p = dcerpc_call_handle_get_pipes_struct(call);
3855         if (p == NULL) {
3856                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3857                 return tevent_req_post(req, ev);
3858         }
3859
3860         ZERO_STRUCT(r->out);
3861         r->out.names = r->in.names;
3862         r->out.count = r->in.count;
3863         r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
3864         if (tevent_req_nomem(r->out.domains, req)) {
3865                 return tevent_req_post(req, ev);
3866         }
3867
3868         r->out.result = _lsa_LookupSids3(p, r);
3869
3870         if (p->fault_state) {
3871                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3872                 tevent_req_nterror(req, status);
3873                 return tevent_req_post(req, ev);
3874         }
3875
3876         tevent_req_done(req);
3877         return tevent_req_post(req, ev);
3878 }
3879
3880 static NTSTATUS _s3_compat_lsa_LookupSids3_recv(struct tevent_req *req)
3881 {
3882         return tevent_req_simple_recv_ntstatus(req);
3883 }
3884
3885 struct _s3_compat_lsa_LookupNames4_state {
3886         struct tevent_context *ev;
3887         struct dcerpc_call_handle *call;
3888         struct lsa_LookupNames4 *r;
3889 };
3890
3891 static struct tevent_req *_s3_compat_lsa_LookupNames4_send(TALLOC_CTX *mem_ctx,
3892                                                            struct tevent_context *ev,
3893                                                            struct dcerpc_call_handle *call,
3894                                                            struct lsa_LookupNames4 *r)
3895 {
3896         struct tevent_req *req;
3897         struct _s3_compat_lsa_LookupNames4_state *state;
3898         struct pipes_struct *p;
3899
3900         req = tevent_req_create(mem_ctx, &state,
3901                                 struct _s3_compat_lsa_LookupNames4_state);
3902         if (req == NULL) {
3903                 return NULL;
3904         }
3905         state->ev = ev;
3906         state->call = call;
3907         state->r = r;
3908
3909         p = dcerpc_call_handle_get_pipes_struct(call);
3910         if (p == NULL) {
3911                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3912                 return tevent_req_post(req, ev);
3913         }
3914
3915         ZERO_STRUCT(r->out);
3916         r->out.sids = r->in.sids;
3917         r->out.count = r->in.count;
3918         r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
3919         if (tevent_req_nomem(r->out.domains, req)) {
3920                 return tevent_req_post(req, ev);
3921         }
3922
3923         r->out.result = _lsa_LookupNames4(p, r);
3924
3925         if (p->fault_state) {
3926                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3927                 tevent_req_nterror(req, status);
3928                 return tevent_req_post(req, ev);
3929         }
3930
3931         tevent_req_done(req);
3932         return tevent_req_post(req, ev);
3933 }
3934
3935 static NTSTATUS _s3_compat_lsa_LookupNames4_recv(struct tevent_req *req)
3936 {
3937         return tevent_req_simple_recv_ntstatus(req);
3938 }
3939
3940 struct _s3_compat_lsa_LSAROPENPOLICYSCE_state {
3941         struct tevent_context *ev;
3942         struct dcerpc_call_handle *call;
3943         struct lsa_LSAROPENPOLICYSCE *r;
3944 };
3945
3946 static struct tevent_req *_s3_compat_lsa_LSAROPENPOLICYSCE_send(TALLOC_CTX *mem_ctx,
3947                                                                 struct tevent_context *ev,
3948                                                                 struct dcerpc_call_handle *call,
3949                                                                 struct lsa_LSAROPENPOLICYSCE *r)
3950 {
3951         struct tevent_req *req;
3952         struct _s3_compat_lsa_LSAROPENPOLICYSCE_state *state;
3953         struct pipes_struct *p;
3954
3955         req = tevent_req_create(mem_ctx, &state,
3956                                 struct _s3_compat_lsa_LSAROPENPOLICYSCE_state);
3957         if (req == NULL) {
3958                 return NULL;
3959         }
3960         state->ev = ev;
3961         state->call = call;
3962         state->r = r;
3963
3964         p = dcerpc_call_handle_get_pipes_struct(call);
3965         if (p == NULL) {
3966                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
3967                 return tevent_req_post(req, ev);
3968         }
3969
3970         r->out.result = _lsa_LSAROPENPOLICYSCE(p, r);
3971
3972         if (p->fault_state) {
3973                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
3974                 tevent_req_nterror(req, status);
3975                 return tevent_req_post(req, ev);
3976         }
3977
3978         tevent_req_done(req);
3979         return tevent_req_post(req, ev);
3980 }
3981
3982 static NTSTATUS _s3_compat_lsa_LSAROPENPOLICYSCE_recv(struct tevent_req *req)
3983 {
3984         return tevent_req_simple_recv_ntstatus(req);
3985 }
3986
3987 struct _s3_compat_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state {
3988         struct tevent_context *ev;
3989         struct dcerpc_call_handle *call;
3990         struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r;
3991 };
3992
3993 static struct tevent_req *_s3_compat_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
3994                                                                                  struct tevent_context *ev,
3995                                                                                  struct dcerpc_call_handle *call,
3996                                                                                  struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r)
3997 {
3998         struct tevent_req *req;
3999         struct _s3_compat_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state *state;
4000         struct pipes_struct *p;
4001
4002         req = tevent_req_create(mem_ctx, &state,
4003                                 struct _s3_compat_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state);
4004         if (req == NULL) {
4005                 return NULL;
4006         }
4007         state->ev = ev;
4008         state->call = call;
4009         state->r = r;
4010
4011         p = dcerpc_call_handle_get_pipes_struct(call);
4012         if (p == NULL) {
4013                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
4014                 return tevent_req_post(req, ev);
4015         }
4016
4017         r->out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p, r);
4018
4019         if (p->fault_state) {
4020                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
4021                 tevent_req_nterror(req, status);
4022                 return tevent_req_post(req, ev);
4023         }
4024
4025         tevent_req_done(req);
4026         return tevent_req_post(req, ev);
4027 }
4028
4029 static NTSTATUS _s3_compat_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req)
4030 {
4031         return tevent_req_simple_recv_ntstatus(req);
4032 }
4033
4034 struct _s3_compat_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state {
4035         struct tevent_context *ev;
4036         struct dcerpc_call_handle *call;
4037         struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r;
4038 };
4039
4040 static struct tevent_req *_s3_compat_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
4041                                                                                    struct tevent_context *ev,
4042                                                                                    struct dcerpc_call_handle *call,
4043                                                                                    struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r)
4044 {
4045         struct tevent_req *req;
4046         struct _s3_compat_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state *state;
4047         struct pipes_struct *p;
4048
4049         req = tevent_req_create(mem_ctx, &state,
4050                                 struct _s3_compat_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state);
4051         if (req == NULL) {
4052                 return NULL;
4053         }
4054         state->ev = ev;
4055         state->call = call;
4056         state->r = r;
4057
4058         p = dcerpc_call_handle_get_pipes_struct(call);
4059         if (p == NULL) {
4060                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
4061                 return tevent_req_post(req, ev);
4062         }
4063
4064         r->out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p, r);
4065
4066         if (p->fault_state) {
4067                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
4068                 tevent_req_nterror(req, status);
4069                 return tevent_req_post(req, ev);
4070         }
4071
4072         tevent_req_done(req);
4073         return tevent_req_post(req, ev);
4074 }
4075
4076 static NTSTATUS _s3_compat_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req)
4077 {
4078         return tevent_req_simple_recv_ntstatus(req);
4079 }
4080
4081 struct _s3_compat_lsa_LSARADTREPORTSECURITYEVENT_state {
4082         struct tevent_context *ev;
4083         struct dcerpc_call_handle *call;
4084         struct lsa_LSARADTREPORTSECURITYEVENT *r;
4085 };
4086
4087 static struct tevent_req *_s3_compat_lsa_LSARADTREPORTSECURITYEVENT_send(TALLOC_CTX *mem_ctx,
4088                                                                          struct tevent_context *ev,
4089                                                                          struct dcerpc_call_handle *call,
4090                                                                          struct lsa_LSARADTREPORTSECURITYEVENT *r)
4091 {
4092         struct tevent_req *req;
4093         struct _s3_compat_lsa_LSARADTREPORTSECURITYEVENT_state *state;
4094         struct pipes_struct *p;
4095
4096         req = tevent_req_create(mem_ctx, &state,
4097                                 struct _s3_compat_lsa_LSARADTREPORTSECURITYEVENT_state);
4098         if (req == NULL) {
4099                 return NULL;
4100         }
4101         state->ev = ev;
4102         state->call = call;
4103         state->r = r;
4104
4105         p = dcerpc_call_handle_get_pipes_struct(call);
4106         if (p == NULL) {
4107                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
4108                 return tevent_req_post(req, ev);
4109         }
4110
4111         r->out.result = _lsa_LSARADTREPORTSECURITYEVENT(p, r);
4112
4113         if (p->fault_state) {
4114                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
4115                 tevent_req_nterror(req, status);
4116                 return tevent_req_post(req, ev);
4117         }
4118
4119         tevent_req_done(req);
4120         return tevent_req_post(req, ev);
4121 }
4122
4123 static NTSTATUS _s3_compat_lsa_LSARADTREPORTSECURITYEVENT_recv(struct tevent_req *req)
4124 {
4125         return tevent_req_simple_recv_ntstatus(req);
4126 }
4127
4128
4129 static const struct dcerpc_call_entry_point_fns _s3_compat_lsarpc_fns[] = {
4130         {
4131                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4132                         _s3_compat_lsa_Close_send,
4133                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4134                         _s3_compat_lsa_Close_recv,
4135         },
4136         {
4137                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4138                         _s3_compat_lsa_Delete_send,
4139                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4140                         _s3_compat_lsa_Delete_recv,
4141         },
4142         {
4143                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4144                         _s3_compat_lsa_EnumPrivs_send,
4145                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4146                         _s3_compat_lsa_EnumPrivs_recv,
4147         },
4148         {
4149                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4150                         _s3_compat_lsa_QuerySecurity_send,
4151                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4152                         _s3_compat_lsa_QuerySecurity_recv,
4153         },
4154         {
4155                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4156                         _s3_compat_lsa_SetSecObj_send,
4157                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4158                         _s3_compat_lsa_SetSecObj_recv,
4159         },
4160         {
4161                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4162                         _s3_compat_lsa_ChangePassword_send,
4163                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4164                         _s3_compat_lsa_ChangePassword_recv,
4165         },
4166         {
4167                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4168                         _s3_compat_lsa_OpenPolicy_send,
4169                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4170                         _s3_compat_lsa_OpenPolicy_recv,
4171         },
4172         {
4173                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4174                         _s3_compat_lsa_QueryInfoPolicy_send,
4175                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4176                         _s3_compat_lsa_QueryInfoPolicy_recv,
4177         },
4178         {
4179                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4180                         _s3_compat_lsa_SetInfoPolicy_send,
4181                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4182                         _s3_compat_lsa_SetInfoPolicy_recv,
4183         },
4184         {
4185                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4186                         _s3_compat_lsa_ClearAuditLog_send,
4187                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4188                         _s3_compat_lsa_ClearAuditLog_recv,
4189         },
4190         {
4191                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4192                         _s3_compat_lsa_CreateAccount_send,
4193                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4194                         _s3_compat_lsa_CreateAccount_recv,
4195         },
4196         {
4197                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4198                         _s3_compat_lsa_EnumAccounts_send,
4199                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4200                         _s3_compat_lsa_EnumAccounts_recv,
4201         },
4202         {
4203                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4204                         _s3_compat_lsa_CreateTrustedDomain_send,
4205                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4206                         _s3_compat_lsa_CreateTrustedDomain_recv,
4207         },
4208         {
4209                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4210                         _s3_compat_lsa_EnumTrustDom_send,
4211                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4212                         _s3_compat_lsa_EnumTrustDom_recv,
4213         },
4214         {
4215                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4216                         _s3_compat_lsa_LookupNames_send,
4217                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4218                         _s3_compat_lsa_LookupNames_recv,
4219         },
4220         {
4221                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4222                         _s3_compat_lsa_LookupSids_send,
4223                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4224                         _s3_compat_lsa_LookupSids_recv,
4225         },
4226         {
4227                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4228                         _s3_compat_lsa_CreateSecret_send,
4229                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4230                         _s3_compat_lsa_CreateSecret_recv,
4231         },
4232         {
4233                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4234                         _s3_compat_lsa_OpenAccount_send,
4235                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4236                         _s3_compat_lsa_OpenAccount_recv,
4237         },
4238         {
4239                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4240                         _s3_compat_lsa_EnumPrivsAccount_send,
4241                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4242                         _s3_compat_lsa_EnumPrivsAccount_recv,
4243         },
4244         {
4245                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4246                         _s3_compat_lsa_AddPrivilegesToAccount_send,
4247                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4248                         _s3_compat_lsa_AddPrivilegesToAccount_recv,
4249         },
4250         {
4251                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4252                         _s3_compat_lsa_RemovePrivilegesFromAccount_send,
4253                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4254                         _s3_compat_lsa_RemovePrivilegesFromAccount_recv,
4255         },
4256         {
4257                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4258                         _s3_compat_lsa_GetQuotasForAccount_send,
4259                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4260                         _s3_compat_lsa_GetQuotasForAccount_recv,
4261         },
4262         {
4263                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4264                         _s3_compat_lsa_SetQuotasForAccount_send,
4265                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4266                         _s3_compat_lsa_SetQuotasForAccount_recv,
4267         },
4268         {
4269                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4270                         _s3_compat_lsa_GetSystemAccessAccount_send,
4271                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4272                         _s3_compat_lsa_GetSystemAccessAccount_recv,
4273         },
4274         {
4275                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4276                         _s3_compat_lsa_SetSystemAccessAccount_send,
4277                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4278                         _s3_compat_lsa_SetSystemAccessAccount_recv,
4279         },
4280         {
4281                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4282                         _s3_compat_lsa_OpenTrustedDomain_send,
4283                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4284                         _s3_compat_lsa_OpenTrustedDomain_recv,
4285         },
4286         {
4287                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4288                         _s3_compat_lsa_QueryTrustedDomainInfo_send,
4289                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4290                         _s3_compat_lsa_QueryTrustedDomainInfo_recv,
4291         },
4292         {
4293                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4294                         _s3_compat_lsa_SetInformationTrustedDomain_send,
4295                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4296                         _s3_compat_lsa_SetInformationTrustedDomain_recv,
4297         },
4298         {
4299                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4300                         _s3_compat_lsa_OpenSecret_send,
4301                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4302                         _s3_compat_lsa_OpenSecret_recv,
4303         },
4304         {
4305                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4306                         _s3_compat_lsa_SetSecret_send,
4307                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4308                         _s3_compat_lsa_SetSecret_recv,
4309         },
4310         {
4311                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4312                         _s3_compat_lsa_QuerySecret_send,
4313                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4314                         _s3_compat_lsa_QuerySecret_recv,
4315         },
4316         {
4317                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4318                         _s3_compat_lsa_LookupPrivValue_send,
4319                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4320                         _s3_compat_lsa_LookupPrivValue_recv,
4321         },
4322         {
4323                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4324                         _s3_compat_lsa_LookupPrivName_send,
4325                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4326                         _s3_compat_lsa_LookupPrivName_recv,
4327         },
4328         {
4329                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4330                         _s3_compat_lsa_LookupPrivDisplayName_send,
4331                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4332                         _s3_compat_lsa_LookupPrivDisplayName_recv,
4333         },
4334         {
4335                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4336                         _s3_compat_lsa_DeleteObject_send,
4337                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4338                         _s3_compat_lsa_DeleteObject_recv,
4339         },
4340         {
4341                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4342                         _s3_compat_lsa_EnumAccountsWithUserRight_send,
4343                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4344                         _s3_compat_lsa_EnumAccountsWithUserRight_recv,
4345         },
4346         {
4347                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4348                         _s3_compat_lsa_EnumAccountRights_send,
4349                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4350                         _s3_compat_lsa_EnumAccountRights_recv,
4351         },
4352         {
4353                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4354                         _s3_compat_lsa_AddAccountRights_send,
4355                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4356                         _s3_compat_lsa_AddAccountRights_recv,
4357         },
4358         {
4359                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4360                         _s3_compat_lsa_RemoveAccountRights_send,
4361                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4362                         _s3_compat_lsa_RemoveAccountRights_recv,
4363         },
4364         {
4365                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4366                         _s3_compat_lsa_QueryTrustedDomainInfoBySid_send,
4367                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4368                         _s3_compat_lsa_QueryTrustedDomainInfoBySid_recv,
4369         },
4370         {
4371                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4372                         _s3_compat_lsa_SetTrustedDomainInfo_send,
4373                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4374                         _s3_compat_lsa_SetTrustedDomainInfo_recv,
4375         },
4376         {
4377                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4378                         _s3_compat_lsa_DeleteTrustedDomain_send,
4379                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4380                         _s3_compat_lsa_DeleteTrustedDomain_recv,
4381         },
4382         {
4383                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4384                         _s3_compat_lsa_StorePrivateData_send,
4385                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4386                         _s3_compat_lsa_StorePrivateData_recv,
4387         },
4388         {
4389                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4390                         _s3_compat_lsa_RetrievePrivateData_send,
4391                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4392                         _s3_compat_lsa_RetrievePrivateData_recv,
4393         },
4394         {
4395                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4396                         _s3_compat_lsa_OpenPolicy2_send,
4397                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4398                         _s3_compat_lsa_OpenPolicy2_recv,
4399         },
4400         {
4401                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4402                         _s3_compat_lsa_GetUserName_send,
4403                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4404                         _s3_compat_lsa_GetUserName_recv,
4405         },
4406         {
4407                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4408                         _s3_compat_lsa_QueryInfoPolicy2_send,
4409                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4410                         _s3_compat_lsa_QueryInfoPolicy2_recv,
4411         },
4412         {
4413                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4414                         _s3_compat_lsa_SetInfoPolicy2_send,
4415                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4416                         _s3_compat_lsa_SetInfoPolicy2_recv,
4417         },
4418         {
4419                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4420                         _s3_compat_lsa_QueryTrustedDomainInfoByName_send,
4421                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4422                         _s3_compat_lsa_QueryTrustedDomainInfoByName_recv,
4423         },
4424         {
4425                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4426                         _s3_compat_lsa_SetTrustedDomainInfoByName_send,
4427                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4428                         _s3_compat_lsa_SetTrustedDomainInfoByName_recv,
4429         },
4430         {
4431                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4432                         _s3_compat_lsa_EnumTrustedDomainsEx_send,
4433                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4434                         _s3_compat_lsa_EnumTrustedDomainsEx_recv,
4435         },
4436         {
4437                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4438                         _s3_compat_lsa_CreateTrustedDomainEx_send,
4439                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4440                         _s3_compat_lsa_CreateTrustedDomainEx_recv,
4441         },
4442         {
4443                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4444                         _s3_compat_lsa_CloseTrustedDomainEx_send,
4445                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4446                         _s3_compat_lsa_CloseTrustedDomainEx_recv,
4447         },
4448         {
4449                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4450                         _s3_compat_lsa_QueryDomainInformationPolicy_send,
4451                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4452                         _s3_compat_lsa_QueryDomainInformationPolicy_recv,
4453         },
4454         {
4455                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4456                         _s3_compat_lsa_SetDomainInformationPolicy_send,
4457                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4458                         _s3_compat_lsa_SetDomainInformationPolicy_recv,
4459         },
4460         {
4461                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4462                         _s3_compat_lsa_OpenTrustedDomainByName_send,
4463                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4464                         _s3_compat_lsa_OpenTrustedDomainByName_recv,
4465         },
4466         {
4467                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4468                         _s3_compat_lsa_TestCall_send,
4469                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4470                         _s3_compat_lsa_TestCall_recv,
4471         },
4472         {
4473                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4474                         _s3_compat_lsa_LookupSids2_send,
4475                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4476                         _s3_compat_lsa_LookupSids2_recv,
4477         },
4478         {
4479                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4480                         _s3_compat_lsa_LookupNames2_send,
4481                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4482                         _s3_compat_lsa_LookupNames2_recv,
4483         },
4484         {
4485                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4486                         _s3_compat_lsa_CreateTrustedDomainEx2_send,
4487                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4488                         _s3_compat_lsa_CreateTrustedDomainEx2_recv,
4489         },
4490         {
4491                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4492                         _s3_compat_lsa_CREDRWRITE_send,
4493                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4494                         _s3_compat_lsa_CREDRWRITE_recv,
4495         },
4496         {
4497                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4498                         _s3_compat_lsa_CREDRREAD_send,
4499                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4500                         _s3_compat_lsa_CREDRREAD_recv,
4501         },
4502         {
4503                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4504                         _s3_compat_lsa_CREDRENUMERATE_send,
4505                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4506                         _s3_compat_lsa_CREDRENUMERATE_recv,
4507         },
4508         {
4509                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4510                         _s3_compat_lsa_CREDRWRITEDOMAINCREDENTIALS_send,
4511                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4512                         _s3_compat_lsa_CREDRWRITEDOMAINCREDENTIALS_recv,
4513         },
4514         {
4515                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4516                         _s3_compat_lsa_CREDRREADDOMAINCREDENTIALS_send,
4517                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4518                         _s3_compat_lsa_CREDRREADDOMAINCREDENTIALS_recv,
4519         },
4520         {
4521                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4522                         _s3_compat_lsa_CREDRDELETE_send,
4523                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4524                         _s3_compat_lsa_CREDRDELETE_recv,
4525         },
4526         {
4527                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4528                         _s3_compat_lsa_CREDRGETTARGETINFO_send,
4529                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4530                         _s3_compat_lsa_CREDRGETTARGETINFO_recv,
4531         },
4532         {
4533                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4534                         _s3_compat_lsa_CREDRPROFILELOADED_send,
4535                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4536                         _s3_compat_lsa_CREDRPROFILELOADED_recv,
4537         },
4538         {
4539                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4540                         _s3_compat_lsa_LookupNames3_send,
4541                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4542                         _s3_compat_lsa_LookupNames3_recv,
4543         },
4544         {
4545                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4546                         _s3_compat_lsa_CREDRGETSESSIONTYPES_send,
4547                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4548                         _s3_compat_lsa_CREDRGETSESSIONTYPES_recv,
4549         },
4550         {
4551                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4552                         _s3_compat_lsa_LSARREGISTERAUDITEVENT_send,
4553                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4554                         _s3_compat_lsa_LSARREGISTERAUDITEVENT_recv,
4555         },
4556         {
4557                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4558                         _s3_compat_lsa_LSARGENAUDITEVENT_send,
4559                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4560                         _s3_compat_lsa_LSARGENAUDITEVENT_recv,
4561         },
4562         {
4563                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4564                         _s3_compat_lsa_LSARUNREGISTERAUDITEVENT_send,
4565                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4566                         _s3_compat_lsa_LSARUNREGISTERAUDITEVENT_recv,
4567         },
4568         {
4569                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4570                         _s3_compat_lsa_lsaRQueryForestTrustInformation_send,
4571                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4572                         _s3_compat_lsa_lsaRQueryForestTrustInformation_recv,
4573         },
4574         {
4575                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4576                         _s3_compat_lsa_lsaRSetForestTrustInformation_send,
4577                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4578                         _s3_compat_lsa_lsaRSetForestTrustInformation_recv,
4579         },
4580         {
4581                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4582                         _s3_compat_lsa_CREDRRENAME_send,
4583                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4584                         _s3_compat_lsa_CREDRRENAME_recv,
4585         },
4586         {
4587                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4588                         _s3_compat_lsa_LookupSids3_send,
4589                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4590                         _s3_compat_lsa_LookupSids3_recv,
4591         },
4592         {
4593                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4594                         _s3_compat_lsa_LookupNames4_send,
4595                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4596                         _s3_compat_lsa_LookupNames4_recv,
4597         },
4598         {
4599                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4600                         _s3_compat_lsa_LSAROPENPOLICYSCE_send,
4601                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4602                         _s3_compat_lsa_LSAROPENPOLICYSCE_recv,
4603         },
4604         {
4605                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4606                         _s3_compat_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_send,
4607                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4608                         _s3_compat_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_recv,
4609         },
4610         {
4611                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4612                         _s3_compat_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_send,
4613                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4614                         _s3_compat_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_recv,
4615         },
4616         {
4617                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
4618                         _s3_compat_lsa_LSARADTREPORTSECURITYEVENT_send,
4619                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
4620                         _s3_compat_lsa_LSARADTREPORTSECURITYEVENT_recv,
4621         },
4622         {
4623                 .send_fn = NULL,
4624                 .recv_fn = NULL,
4625         },
4626 };
4627
4628 static const struct dcerpc_call_entry_point_vector _s3_compat_lsarpc_epv[] = {
4629         {
4630         .name = "_s3_compat_lsarpc",
4631         .table = &ndr_table_lsarpc,
4632         .num_fns = 82,
4633         .fns = _s3_compat_lsarpc_fns,
4634         },
4635 };
4636
4637 NTSTATUS dcerpc_server_setup_s3compat_lsarpc(struct dcerpc_server *server)
4638 {
4639         return NT_STATUS_NOT_IMPLEMENTED;
4640 }