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 / srv_clusapi.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "ntdomain.h"
8 #include "bin/default/librpc/gen_ndr/srv_clusapi.h"
9
10 static bool api_clusapi_OpenCluster(struct pipes_struct *p)
11 {
12         const struct ndr_interface_call *call;
13         struct ndr_pull *pull;
14         struct ndr_push *push;
15         enum ndr_err_code ndr_err;
16         struct clusapi_OpenCluster *r;
17
18         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENCLUSTER];
19
20         r = talloc(talloc_tos(), struct clusapi_OpenCluster);
21         if (r == NULL) {
22                 return false;
23         }
24
25         pull = ndr_pull_init_blob(&p->in_data.data, r);
26         if (pull == NULL) {
27                 talloc_free(r);
28                 return false;
29         }
30
31         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
32         if (p->endian) {
33                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
34         }
35         ndr_err = call->ndr_pull(pull, NDR_IN, r);
36         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
37                 talloc_free(r);
38                 return false;
39         }
40
41         if (DEBUGLEVEL >= 10) {
42                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenCluster, NDR_IN, r);
43         }
44
45         ZERO_STRUCT(r->out);
46         r->out.Status = talloc_zero(r, WERROR);
47         if (r->out.Status == NULL) {
48                 talloc_free(r);
49                 return false;
50         }
51
52         r->out.Cluster = talloc_zero(r, struct policy_handle);
53         if (r->out.Cluster == NULL) {
54                 talloc_free(r);
55                 return false;
56         }
57
58         _clusapi_OpenCluster(p, r);
59
60         if (p->fault_state) {
61                 talloc_free(r);
62                 /* Return true here, srv_pipe_hnd.c will take care */
63                 return true;
64         }
65
66         if (DEBUGLEVEL >= 10) {
67                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenCluster, NDR_OUT | NDR_SET_VALUES, r);
68         }
69
70         push = ndr_push_init_ctx(r);
71         if (push == NULL) {
72                 talloc_free(r);
73                 return false;
74         }
75
76         /*
77          * carry over the pointer count to the reply in case we are
78          * using full pointer. See NDR specification for full pointers
79          */
80         push->ptr_count = pull->ptr_count;
81
82         ndr_err = call->ndr_push(push, NDR_OUT, r);
83         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
84                 talloc_free(r);
85                 return false;
86         }
87
88         p->out_data.rdata = ndr_push_blob(push);
89         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
90
91         talloc_free(r);
92
93         return true;
94 }
95
96 static bool api_clusapi_CloseCluster(struct pipes_struct *p)
97 {
98         const struct ndr_interface_call *call;
99         struct ndr_pull *pull;
100         struct ndr_push *push;
101         enum ndr_err_code ndr_err;
102         struct clusapi_CloseCluster *r;
103
104         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSECLUSTER];
105
106         r = talloc(talloc_tos(), struct clusapi_CloseCluster);
107         if (r == NULL) {
108                 return false;
109         }
110
111         pull = ndr_pull_init_blob(&p->in_data.data, r);
112         if (pull == NULL) {
113                 talloc_free(r);
114                 return false;
115         }
116
117         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
118         if (p->endian) {
119                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
120         }
121         ndr_err = call->ndr_pull(pull, NDR_IN, r);
122         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
123                 talloc_free(r);
124                 return false;
125         }
126
127         if (DEBUGLEVEL >= 10) {
128                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseCluster, NDR_IN, r);
129         }
130
131         ZERO_STRUCT(r->out);
132         r->out.Cluster = r->in.Cluster;
133         r->out.result = _clusapi_CloseCluster(p, r);
134
135         if (p->fault_state) {
136                 talloc_free(r);
137                 /* Return true here, srv_pipe_hnd.c will take care */
138                 return true;
139         }
140
141         if (DEBUGLEVEL >= 10) {
142                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseCluster, NDR_OUT | NDR_SET_VALUES, r);
143         }
144
145         push = ndr_push_init_ctx(r);
146         if (push == NULL) {
147                 talloc_free(r);
148                 return false;
149         }
150
151         /*
152          * carry over the pointer count to the reply in case we are
153          * using full pointer. See NDR specification for full pointers
154          */
155         push->ptr_count = pull->ptr_count;
156
157         ndr_err = call->ndr_push(push, NDR_OUT, r);
158         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
159                 talloc_free(r);
160                 return false;
161         }
162
163         p->out_data.rdata = ndr_push_blob(push);
164         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
165
166         talloc_free(r);
167
168         return true;
169 }
170
171 static bool api_clusapi_SetClusterName(struct pipes_struct *p)
172 {
173         const struct ndr_interface_call *call;
174         struct ndr_pull *pull;
175         struct ndr_push *push;
176         enum ndr_err_code ndr_err;
177         struct clusapi_SetClusterName *r;
178
179         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETCLUSTERNAME];
180
181         r = talloc(talloc_tos(), struct clusapi_SetClusterName);
182         if (r == NULL) {
183                 return false;
184         }
185
186         pull = ndr_pull_init_blob(&p->in_data.data, r);
187         if (pull == NULL) {
188                 talloc_free(r);
189                 return false;
190         }
191
192         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
193         if (p->endian) {
194                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
195         }
196         ndr_err = call->ndr_pull(pull, NDR_IN, r);
197         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
198                 talloc_free(r);
199                 return false;
200         }
201
202         if (DEBUGLEVEL >= 10) {
203                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetClusterName, NDR_IN, r);
204         }
205
206         ZERO_STRUCT(r->out);
207         r->out.rpc_status = talloc_zero(r, WERROR);
208         if (r->out.rpc_status == NULL) {
209                 talloc_free(r);
210                 return false;
211         }
212
213         r->out.result = _clusapi_SetClusterName(p, r);
214
215         if (p->fault_state) {
216                 talloc_free(r);
217                 /* Return true here, srv_pipe_hnd.c will take care */
218                 return true;
219         }
220
221         if (DEBUGLEVEL >= 10) {
222                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetClusterName, NDR_OUT | NDR_SET_VALUES, r);
223         }
224
225         push = ndr_push_init_ctx(r);
226         if (push == NULL) {
227                 talloc_free(r);
228                 return false;
229         }
230
231         /*
232          * carry over the pointer count to the reply in case we are
233          * using full pointer. See NDR specification for full pointers
234          */
235         push->ptr_count = pull->ptr_count;
236
237         ndr_err = call->ndr_push(push, NDR_OUT, r);
238         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
239                 talloc_free(r);
240                 return false;
241         }
242
243         p->out_data.rdata = ndr_push_blob(push);
244         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
245
246         talloc_free(r);
247
248         return true;
249 }
250
251 static bool api_clusapi_GetClusterName(struct pipes_struct *p)
252 {
253         const struct ndr_interface_call *call;
254         struct ndr_pull *pull;
255         struct ndr_push *push;
256         enum ndr_err_code ndr_err;
257         struct clusapi_GetClusterName *r;
258
259         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETCLUSTERNAME];
260
261         r = talloc(talloc_tos(), struct clusapi_GetClusterName);
262         if (r == NULL) {
263                 return false;
264         }
265
266         pull = ndr_pull_init_blob(&p->in_data.data, r);
267         if (pull == NULL) {
268                 talloc_free(r);
269                 return false;
270         }
271
272         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
273         if (p->endian) {
274                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
275         }
276         ndr_err = call->ndr_pull(pull, NDR_IN, r);
277         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
278                 talloc_free(r);
279                 return false;
280         }
281
282         if (DEBUGLEVEL >= 10) {
283                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetClusterName, NDR_IN, r);
284         }
285
286         ZERO_STRUCT(r->out);
287         r->out.ClusterName = talloc_zero(r, const char *);
288         if (r->out.ClusterName == NULL) {
289                 talloc_free(r);
290                 return false;
291         }
292
293         r->out.NodeName = talloc_zero(r, const char *);
294         if (r->out.NodeName == NULL) {
295                 talloc_free(r);
296                 return false;
297         }
298
299         r->out.result = _clusapi_GetClusterName(p, r);
300
301         if (p->fault_state) {
302                 talloc_free(r);
303                 /* Return true here, srv_pipe_hnd.c will take care */
304                 return true;
305         }
306
307         if (DEBUGLEVEL >= 10) {
308                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetClusterName, NDR_OUT | NDR_SET_VALUES, r);
309         }
310
311         push = ndr_push_init_ctx(r);
312         if (push == NULL) {
313                 talloc_free(r);
314                 return false;
315         }
316
317         /*
318          * carry over the pointer count to the reply in case we are
319          * using full pointer. See NDR specification for full pointers
320          */
321         push->ptr_count = pull->ptr_count;
322
323         ndr_err = call->ndr_push(push, NDR_OUT, r);
324         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
325                 talloc_free(r);
326                 return false;
327         }
328
329         p->out_data.rdata = ndr_push_blob(push);
330         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
331
332         talloc_free(r);
333
334         return true;
335 }
336
337 static bool api_clusapi_GetClusterVersion(struct pipes_struct *p)
338 {
339         const struct ndr_interface_call *call;
340         struct ndr_pull *pull;
341         struct ndr_push *push;
342         enum ndr_err_code ndr_err;
343         struct clusapi_GetClusterVersion *r;
344
345         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETCLUSTERVERSION];
346
347         r = talloc(talloc_tos(), struct clusapi_GetClusterVersion);
348         if (r == NULL) {
349                 return false;
350         }
351
352         pull = ndr_pull_init_blob(&p->in_data.data, r);
353         if (pull == NULL) {
354                 talloc_free(r);
355                 return false;
356         }
357
358         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
359         if (p->endian) {
360                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
361         }
362         ndr_err = call->ndr_pull(pull, NDR_IN, r);
363         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
364                 talloc_free(r);
365                 return false;
366         }
367
368         if (DEBUGLEVEL >= 10) {
369                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetClusterVersion, NDR_IN, r);
370         }
371
372         ZERO_STRUCT(r->out);
373         r->out.lpwMajorVersion = talloc_zero(r, uint16_t);
374         if (r->out.lpwMajorVersion == NULL) {
375                 talloc_free(r);
376                 return false;
377         }
378
379         r->out.lpwMinorVersion = talloc_zero(r, uint16_t);
380         if (r->out.lpwMinorVersion == NULL) {
381                 talloc_free(r);
382                 return false;
383         }
384
385         r->out.lpwBuildNumber = talloc_zero(r, uint16_t);
386         if (r->out.lpwBuildNumber == NULL) {
387                 talloc_free(r);
388                 return false;
389         }
390
391         r->out.lpszVendorId = talloc_zero(r, const char *);
392         if (r->out.lpszVendorId == NULL) {
393                 talloc_free(r);
394                 return false;
395         }
396
397         r->out.lpszCSDVersion = talloc_zero(r, const char *);
398         if (r->out.lpszCSDVersion == NULL) {
399                 talloc_free(r);
400                 return false;
401         }
402
403         r->out.result = _clusapi_GetClusterVersion(p, r);
404
405         if (p->fault_state) {
406                 talloc_free(r);
407                 /* Return true here, srv_pipe_hnd.c will take care */
408                 return true;
409         }
410
411         if (DEBUGLEVEL >= 10) {
412                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetClusterVersion, NDR_OUT | NDR_SET_VALUES, r);
413         }
414
415         push = ndr_push_init_ctx(r);
416         if (push == NULL) {
417                 talloc_free(r);
418                 return false;
419         }
420
421         /*
422          * carry over the pointer count to the reply in case we are
423          * using full pointer. See NDR specification for full pointers
424          */
425         push->ptr_count = pull->ptr_count;
426
427         ndr_err = call->ndr_push(push, NDR_OUT, r);
428         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
429                 talloc_free(r);
430                 return false;
431         }
432
433         p->out_data.rdata = ndr_push_blob(push);
434         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
435
436         talloc_free(r);
437
438         return true;
439 }
440
441 static bool api_clusapi_GetQuorumResource(struct pipes_struct *p)
442 {
443         const struct ndr_interface_call *call;
444         struct ndr_pull *pull;
445         struct ndr_push *push;
446         enum ndr_err_code ndr_err;
447         struct clusapi_GetQuorumResource *r;
448
449         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETQUORUMRESOURCE];
450
451         r = talloc(talloc_tos(), struct clusapi_GetQuorumResource);
452         if (r == NULL) {
453                 return false;
454         }
455
456         pull = ndr_pull_init_blob(&p->in_data.data, r);
457         if (pull == NULL) {
458                 talloc_free(r);
459                 return false;
460         }
461
462         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
463         if (p->endian) {
464                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
465         }
466         ndr_err = call->ndr_pull(pull, NDR_IN, r);
467         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
468                 talloc_free(r);
469                 return false;
470         }
471
472         if (DEBUGLEVEL >= 10) {
473                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetQuorumResource, NDR_IN, r);
474         }
475
476         ZERO_STRUCT(r->out);
477         r->out.lpszResourceName = talloc_zero(r, const char *);
478         if (r->out.lpszResourceName == NULL) {
479                 talloc_free(r);
480                 return false;
481         }
482
483         r->out.lpszDeviceName = talloc_zero(r, const char *);
484         if (r->out.lpszDeviceName == NULL) {
485                 talloc_free(r);
486                 return false;
487         }
488
489         r->out.pdwMaxQuorumLogSize = talloc_zero(r, uint32_t);
490         if (r->out.pdwMaxQuorumLogSize == NULL) {
491                 talloc_free(r);
492                 return false;
493         }
494
495         r->out.rpc_status = talloc_zero(r, WERROR);
496         if (r->out.rpc_status == NULL) {
497                 talloc_free(r);
498                 return false;
499         }
500
501         r->out.result = _clusapi_GetQuorumResource(p, r);
502
503         if (p->fault_state) {
504                 talloc_free(r);
505                 /* Return true here, srv_pipe_hnd.c will take care */
506                 return true;
507         }
508
509         if (DEBUGLEVEL >= 10) {
510                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetQuorumResource, NDR_OUT | NDR_SET_VALUES, r);
511         }
512
513         push = ndr_push_init_ctx(r);
514         if (push == NULL) {
515                 talloc_free(r);
516                 return false;
517         }
518
519         /*
520          * carry over the pointer count to the reply in case we are
521          * using full pointer. See NDR specification for full pointers
522          */
523         push->ptr_count = pull->ptr_count;
524
525         ndr_err = call->ndr_push(push, NDR_OUT, r);
526         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
527                 talloc_free(r);
528                 return false;
529         }
530
531         p->out_data.rdata = ndr_push_blob(push);
532         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
533
534         talloc_free(r);
535
536         return true;
537 }
538
539 static bool api_clusapi_SetQuorumResource(struct pipes_struct *p)
540 {
541         const struct ndr_interface_call *call;
542         struct ndr_pull *pull;
543         struct ndr_push *push;
544         enum ndr_err_code ndr_err;
545         struct clusapi_SetQuorumResource *r;
546
547         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETQUORUMRESOURCE];
548
549         r = talloc(talloc_tos(), struct clusapi_SetQuorumResource);
550         if (r == NULL) {
551                 return false;
552         }
553
554         pull = ndr_pull_init_blob(&p->in_data.data, r);
555         if (pull == NULL) {
556                 talloc_free(r);
557                 return false;
558         }
559
560         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
561         if (p->endian) {
562                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
563         }
564         ndr_err = call->ndr_pull(pull, NDR_IN, r);
565         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
566                 talloc_free(r);
567                 return false;
568         }
569
570         if (DEBUGLEVEL >= 10) {
571                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetQuorumResource, NDR_IN, r);
572         }
573
574         ZERO_STRUCT(r->out);
575         r->out.rpc_status = talloc_zero(r, WERROR);
576         if (r->out.rpc_status == NULL) {
577                 talloc_free(r);
578                 return false;
579         }
580
581         r->out.result = _clusapi_SetQuorumResource(p, r);
582
583         if (p->fault_state) {
584                 talloc_free(r);
585                 /* Return true here, srv_pipe_hnd.c will take care */
586                 return true;
587         }
588
589         if (DEBUGLEVEL >= 10) {
590                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetQuorumResource, NDR_OUT | NDR_SET_VALUES, r);
591         }
592
593         push = ndr_push_init_ctx(r);
594         if (push == NULL) {
595                 talloc_free(r);
596                 return false;
597         }
598
599         /*
600          * carry over the pointer count to the reply in case we are
601          * using full pointer. See NDR specification for full pointers
602          */
603         push->ptr_count = pull->ptr_count;
604
605         ndr_err = call->ndr_push(push, NDR_OUT, r);
606         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
607                 talloc_free(r);
608                 return false;
609         }
610
611         p->out_data.rdata = ndr_push_blob(push);
612         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
613
614         talloc_free(r);
615
616         return true;
617 }
618
619 static bool api_clusapi_CreateEnum(struct pipes_struct *p)
620 {
621         const struct ndr_interface_call *call;
622         struct ndr_pull *pull;
623         struct ndr_push *push;
624         enum ndr_err_code ndr_err;
625         struct clusapi_CreateEnum *r;
626
627         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEENUM];
628
629         r = talloc(talloc_tos(), struct clusapi_CreateEnum);
630         if (r == NULL) {
631                 return false;
632         }
633
634         pull = ndr_pull_init_blob(&p->in_data.data, r);
635         if (pull == NULL) {
636                 talloc_free(r);
637                 return false;
638         }
639
640         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
641         if (p->endian) {
642                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
643         }
644         ndr_err = call->ndr_pull(pull, NDR_IN, r);
645         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
646                 talloc_free(r);
647                 return false;
648         }
649
650         if (DEBUGLEVEL >= 10) {
651                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateEnum, NDR_IN, r);
652         }
653
654         ZERO_STRUCT(r->out);
655         r->out.ReturnEnum = talloc_zero(r, struct ENUM_LIST *);
656         if (r->out.ReturnEnum == NULL) {
657                 talloc_free(r);
658                 return false;
659         }
660
661         r->out.rpc_status = talloc_zero(r, WERROR);
662         if (r->out.rpc_status == NULL) {
663                 talloc_free(r);
664                 return false;
665         }
666
667         r->out.result = _clusapi_CreateEnum(p, r);
668
669         if (p->fault_state) {
670                 talloc_free(r);
671                 /* Return true here, srv_pipe_hnd.c will take care */
672                 return true;
673         }
674
675         if (DEBUGLEVEL >= 10) {
676                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateEnum, NDR_OUT | NDR_SET_VALUES, r);
677         }
678
679         push = ndr_push_init_ctx(r);
680         if (push == NULL) {
681                 talloc_free(r);
682                 return false;
683         }
684
685         /*
686          * carry over the pointer count to the reply in case we are
687          * using full pointer. See NDR specification for full pointers
688          */
689         push->ptr_count = pull->ptr_count;
690
691         ndr_err = call->ndr_push(push, NDR_OUT, r);
692         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
693                 talloc_free(r);
694                 return false;
695         }
696
697         p->out_data.rdata = ndr_push_blob(push);
698         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
699
700         talloc_free(r);
701
702         return true;
703 }
704
705 static bool api_clusapi_OpenResource(struct pipes_struct *p)
706 {
707         const struct ndr_interface_call *call;
708         struct ndr_pull *pull;
709         struct ndr_push *push;
710         enum ndr_err_code ndr_err;
711         struct clusapi_OpenResource *r;
712
713         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENRESOURCE];
714
715         r = talloc(talloc_tos(), struct clusapi_OpenResource);
716         if (r == NULL) {
717                 return false;
718         }
719
720         pull = ndr_pull_init_blob(&p->in_data.data, r);
721         if (pull == NULL) {
722                 talloc_free(r);
723                 return false;
724         }
725
726         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
727         if (p->endian) {
728                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
729         }
730         ndr_err = call->ndr_pull(pull, NDR_IN, r);
731         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
732                 talloc_free(r);
733                 return false;
734         }
735
736         if (DEBUGLEVEL >= 10) {
737                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenResource, NDR_IN, r);
738         }
739
740         ZERO_STRUCT(r->out);
741         r->out.Status = talloc_zero(r, WERROR);
742         if (r->out.Status == NULL) {
743                 talloc_free(r);
744                 return false;
745         }
746
747         r->out.rpc_status = talloc_zero(r, WERROR);
748         if (r->out.rpc_status == NULL) {
749                 talloc_free(r);
750                 return false;
751         }
752
753         r->out.hResource = talloc_zero(r, struct policy_handle);
754         if (r->out.hResource == NULL) {
755                 talloc_free(r);
756                 return false;
757         }
758
759         _clusapi_OpenResource(p, r);
760
761         if (p->fault_state) {
762                 talloc_free(r);
763                 /* Return true here, srv_pipe_hnd.c will take care */
764                 return true;
765         }
766
767         if (DEBUGLEVEL >= 10) {
768                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenResource, NDR_OUT | NDR_SET_VALUES, r);
769         }
770
771         push = ndr_push_init_ctx(r);
772         if (push == NULL) {
773                 talloc_free(r);
774                 return false;
775         }
776
777         /*
778          * carry over the pointer count to the reply in case we are
779          * using full pointer. See NDR specification for full pointers
780          */
781         push->ptr_count = pull->ptr_count;
782
783         ndr_err = call->ndr_push(push, NDR_OUT, r);
784         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
785                 talloc_free(r);
786                 return false;
787         }
788
789         p->out_data.rdata = ndr_push_blob(push);
790         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
791
792         talloc_free(r);
793
794         return true;
795 }
796
797 static bool api_clusapi_CreateResource(struct pipes_struct *p)
798 {
799         const struct ndr_interface_call *call;
800         struct ndr_pull *pull;
801         struct ndr_push *push;
802         enum ndr_err_code ndr_err;
803         struct clusapi_CreateResource *r;
804
805         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATERESOURCE];
806
807         r = talloc(talloc_tos(), struct clusapi_CreateResource);
808         if (r == NULL) {
809                 return false;
810         }
811
812         pull = ndr_pull_init_blob(&p->in_data.data, r);
813         if (pull == NULL) {
814                 talloc_free(r);
815                 return false;
816         }
817
818         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
819         if (p->endian) {
820                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
821         }
822         ndr_err = call->ndr_pull(pull, NDR_IN, r);
823         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
824                 talloc_free(r);
825                 return false;
826         }
827
828         if (DEBUGLEVEL >= 10) {
829                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResource, NDR_IN, r);
830         }
831
832         ZERO_STRUCT(r->out);
833         r->out.Status = talloc_zero(r, WERROR);
834         if (r->out.Status == NULL) {
835                 talloc_free(r);
836                 return false;
837         }
838
839         r->out.rpc_status = talloc_zero(r, WERROR);
840         if (r->out.rpc_status == NULL) {
841                 talloc_free(r);
842                 return false;
843         }
844
845         r->out.hResource = talloc_zero(r, struct policy_handle);
846         if (r->out.hResource == NULL) {
847                 talloc_free(r);
848                 return false;
849         }
850
851         _clusapi_CreateResource(p, r);
852
853         if (p->fault_state) {
854                 talloc_free(r);
855                 /* Return true here, srv_pipe_hnd.c will take care */
856                 return true;
857         }
858
859         if (DEBUGLEVEL >= 10) {
860                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResource, NDR_OUT | NDR_SET_VALUES, r);
861         }
862
863         push = ndr_push_init_ctx(r);
864         if (push == NULL) {
865                 talloc_free(r);
866                 return false;
867         }
868
869         /*
870          * carry over the pointer count to the reply in case we are
871          * using full pointer. See NDR specification for full pointers
872          */
873         push->ptr_count = pull->ptr_count;
874
875         ndr_err = call->ndr_push(push, NDR_OUT, r);
876         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
877                 talloc_free(r);
878                 return false;
879         }
880
881         p->out_data.rdata = ndr_push_blob(push);
882         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
883
884         talloc_free(r);
885
886         return true;
887 }
888
889 static bool api_clusapi_DeleteResource(struct pipes_struct *p)
890 {
891         const struct ndr_interface_call *call;
892         struct ndr_pull *pull;
893         struct ndr_push *push;
894         enum ndr_err_code ndr_err;
895         struct clusapi_DeleteResource *r;
896
897         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_DELETERESOURCE];
898
899         r = talloc(talloc_tos(), struct clusapi_DeleteResource);
900         if (r == NULL) {
901                 return false;
902         }
903
904         pull = ndr_pull_init_blob(&p->in_data.data, r);
905         if (pull == NULL) {
906                 talloc_free(r);
907                 return false;
908         }
909
910         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
911         if (p->endian) {
912                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
913         }
914         ndr_err = call->ndr_pull(pull, NDR_IN, r);
915         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
916                 talloc_free(r);
917                 return false;
918         }
919
920         if (DEBUGLEVEL >= 10) {
921                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteResource, NDR_IN, r);
922         }
923
924         ZERO_STRUCT(r->out);
925         r->out.rpc_status = talloc_zero(r, WERROR);
926         if (r->out.rpc_status == NULL) {
927                 talloc_free(r);
928                 return false;
929         }
930
931         r->out.result = _clusapi_DeleteResource(p, r);
932
933         if (p->fault_state) {
934                 talloc_free(r);
935                 /* Return true here, srv_pipe_hnd.c will take care */
936                 return true;
937         }
938
939         if (DEBUGLEVEL >= 10) {
940                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteResource, NDR_OUT | NDR_SET_VALUES, r);
941         }
942
943         push = ndr_push_init_ctx(r);
944         if (push == NULL) {
945                 talloc_free(r);
946                 return false;
947         }
948
949         /*
950          * carry over the pointer count to the reply in case we are
951          * using full pointer. See NDR specification for full pointers
952          */
953         push->ptr_count = pull->ptr_count;
954
955         ndr_err = call->ndr_push(push, NDR_OUT, r);
956         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
957                 talloc_free(r);
958                 return false;
959         }
960
961         p->out_data.rdata = ndr_push_blob(push);
962         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
963
964         talloc_free(r);
965
966         return true;
967 }
968
969 static bool api_clusapi_CloseResource(struct pipes_struct *p)
970 {
971         const struct ndr_interface_call *call;
972         struct ndr_pull *pull;
973         struct ndr_push *push;
974         enum ndr_err_code ndr_err;
975         struct clusapi_CloseResource *r;
976
977         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSERESOURCE];
978
979         r = talloc(talloc_tos(), struct clusapi_CloseResource);
980         if (r == NULL) {
981                 return false;
982         }
983
984         pull = ndr_pull_init_blob(&p->in_data.data, r);
985         if (pull == NULL) {
986                 talloc_free(r);
987                 return false;
988         }
989
990         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
991         if (p->endian) {
992                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
993         }
994         ndr_err = call->ndr_pull(pull, NDR_IN, r);
995         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
996                 talloc_free(r);
997                 return false;
998         }
999
1000         if (DEBUGLEVEL >= 10) {
1001                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseResource, NDR_IN, r);
1002         }
1003
1004         ZERO_STRUCT(r->out);
1005         r->out.Resource = r->in.Resource;
1006         r->out.result = _clusapi_CloseResource(p, r);
1007
1008         if (p->fault_state) {
1009                 talloc_free(r);
1010                 /* Return true here, srv_pipe_hnd.c will take care */
1011                 return true;
1012         }
1013
1014         if (DEBUGLEVEL >= 10) {
1015                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseResource, NDR_OUT | NDR_SET_VALUES, r);
1016         }
1017
1018         push = ndr_push_init_ctx(r);
1019         if (push == NULL) {
1020                 talloc_free(r);
1021                 return false;
1022         }
1023
1024         /*
1025          * carry over the pointer count to the reply in case we are
1026          * using full pointer. See NDR specification for full pointers
1027          */
1028         push->ptr_count = pull->ptr_count;
1029
1030         ndr_err = call->ndr_push(push, NDR_OUT, r);
1031         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1032                 talloc_free(r);
1033                 return false;
1034         }
1035
1036         p->out_data.rdata = ndr_push_blob(push);
1037         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1038
1039         talloc_free(r);
1040
1041         return true;
1042 }
1043
1044 static bool api_clusapi_GetResourceState(struct pipes_struct *p)
1045 {
1046         const struct ndr_interface_call *call;
1047         struct ndr_pull *pull;
1048         struct ndr_push *push;
1049         enum ndr_err_code ndr_err;
1050         struct clusapi_GetResourceState *r;
1051
1052         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETRESOURCESTATE];
1053
1054         r = talloc(talloc_tos(), struct clusapi_GetResourceState);
1055         if (r == NULL) {
1056                 return false;
1057         }
1058
1059         pull = ndr_pull_init_blob(&p->in_data.data, r);
1060         if (pull == NULL) {
1061                 talloc_free(r);
1062                 return false;
1063         }
1064
1065         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1066         if (p->endian) {
1067                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1068         }
1069         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1070         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1071                 talloc_free(r);
1072                 return false;
1073         }
1074
1075         if (DEBUGLEVEL >= 10) {
1076                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceState, NDR_IN, r);
1077         }
1078
1079         ZERO_STRUCT(r->out);
1080         r->out.State = talloc_zero(r, enum clusapi_ClusterResourceState);
1081         if (r->out.State == NULL) {
1082                 talloc_free(r);
1083                 return false;
1084         }
1085
1086         r->out.NodeName = talloc_zero(r, const char *);
1087         if (r->out.NodeName == NULL) {
1088                 talloc_free(r);
1089                 return false;
1090         }
1091
1092         r->out.GroupName = talloc_zero(r, const char *);
1093         if (r->out.GroupName == NULL) {
1094                 talloc_free(r);
1095                 return false;
1096         }
1097
1098         r->out.rpc_status = talloc_zero(r, WERROR);
1099         if (r->out.rpc_status == NULL) {
1100                 talloc_free(r);
1101                 return false;
1102         }
1103
1104         r->out.result = _clusapi_GetResourceState(p, r);
1105
1106         if (p->fault_state) {
1107                 talloc_free(r);
1108                 /* Return true here, srv_pipe_hnd.c will take care */
1109                 return true;
1110         }
1111
1112         if (DEBUGLEVEL >= 10) {
1113                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceState, NDR_OUT | NDR_SET_VALUES, r);
1114         }
1115
1116         push = ndr_push_init_ctx(r);
1117         if (push == NULL) {
1118                 talloc_free(r);
1119                 return false;
1120         }
1121
1122         /*
1123          * carry over the pointer count to the reply in case we are
1124          * using full pointer. See NDR specification for full pointers
1125          */
1126         push->ptr_count = pull->ptr_count;
1127
1128         ndr_err = call->ndr_push(push, NDR_OUT, r);
1129         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1130                 talloc_free(r);
1131                 return false;
1132         }
1133
1134         p->out_data.rdata = ndr_push_blob(push);
1135         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1136
1137         talloc_free(r);
1138
1139         return true;
1140 }
1141
1142 static bool api_clusapi_SetResourceName(struct pipes_struct *p)
1143 {
1144         const struct ndr_interface_call *call;
1145         struct ndr_pull *pull;
1146         struct ndr_push *push;
1147         enum ndr_err_code ndr_err;
1148         struct clusapi_SetResourceName *r;
1149
1150         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETRESOURCENAME];
1151
1152         r = talloc(talloc_tos(), struct clusapi_SetResourceName);
1153         if (r == NULL) {
1154                 return false;
1155         }
1156
1157         pull = ndr_pull_init_blob(&p->in_data.data, r);
1158         if (pull == NULL) {
1159                 talloc_free(r);
1160                 return false;
1161         }
1162
1163         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1164         if (p->endian) {
1165                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1166         }
1167         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1168         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1169                 talloc_free(r);
1170                 return false;
1171         }
1172
1173         if (DEBUGLEVEL >= 10) {
1174                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetResourceName, NDR_IN, r);
1175         }
1176
1177         ZERO_STRUCT(r->out);
1178         r->out.rpc_status = talloc_zero(r, WERROR);
1179         if (r->out.rpc_status == NULL) {
1180                 talloc_free(r);
1181                 return false;
1182         }
1183
1184         r->out.result = _clusapi_SetResourceName(p, r);
1185
1186         if (p->fault_state) {
1187                 talloc_free(r);
1188                 /* Return true here, srv_pipe_hnd.c will take care */
1189                 return true;
1190         }
1191
1192         if (DEBUGLEVEL >= 10) {
1193                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetResourceName, NDR_OUT | NDR_SET_VALUES, r);
1194         }
1195
1196         push = ndr_push_init_ctx(r);
1197         if (push == NULL) {
1198                 talloc_free(r);
1199                 return false;
1200         }
1201
1202         /*
1203          * carry over the pointer count to the reply in case we are
1204          * using full pointer. See NDR specification for full pointers
1205          */
1206         push->ptr_count = pull->ptr_count;
1207
1208         ndr_err = call->ndr_push(push, NDR_OUT, r);
1209         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1210                 talloc_free(r);
1211                 return false;
1212         }
1213
1214         p->out_data.rdata = ndr_push_blob(push);
1215         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1216
1217         talloc_free(r);
1218
1219         return true;
1220 }
1221
1222 static bool api_clusapi_GetResourceId(struct pipes_struct *p)
1223 {
1224         const struct ndr_interface_call *call;
1225         struct ndr_pull *pull;
1226         struct ndr_push *push;
1227         enum ndr_err_code ndr_err;
1228         struct clusapi_GetResourceId *r;
1229
1230         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETRESOURCEID];
1231
1232         r = talloc(talloc_tos(), struct clusapi_GetResourceId);
1233         if (r == NULL) {
1234                 return false;
1235         }
1236
1237         pull = ndr_pull_init_blob(&p->in_data.data, r);
1238         if (pull == NULL) {
1239                 talloc_free(r);
1240                 return false;
1241         }
1242
1243         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1244         if (p->endian) {
1245                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1246         }
1247         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1248         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1249                 talloc_free(r);
1250                 return false;
1251         }
1252
1253         if (DEBUGLEVEL >= 10) {
1254                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceId, NDR_IN, r);
1255         }
1256
1257         ZERO_STRUCT(r->out);
1258         r->out.pGuid = talloc_zero(r, const char *);
1259         if (r->out.pGuid == NULL) {
1260                 talloc_free(r);
1261                 return false;
1262         }
1263
1264         r->out.rpc_status = talloc_zero(r, WERROR);
1265         if (r->out.rpc_status == NULL) {
1266                 talloc_free(r);
1267                 return false;
1268         }
1269
1270         r->out.result = _clusapi_GetResourceId(p, r);
1271
1272         if (p->fault_state) {
1273                 talloc_free(r);
1274                 /* Return true here, srv_pipe_hnd.c will take care */
1275                 return true;
1276         }
1277
1278         if (DEBUGLEVEL >= 10) {
1279                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceId, NDR_OUT | NDR_SET_VALUES, r);
1280         }
1281
1282         push = ndr_push_init_ctx(r);
1283         if (push == NULL) {
1284                 talloc_free(r);
1285                 return false;
1286         }
1287
1288         /*
1289          * carry over the pointer count to the reply in case we are
1290          * using full pointer. See NDR specification for full pointers
1291          */
1292         push->ptr_count = pull->ptr_count;
1293
1294         ndr_err = call->ndr_push(push, NDR_OUT, r);
1295         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1296                 talloc_free(r);
1297                 return false;
1298         }
1299
1300         p->out_data.rdata = ndr_push_blob(push);
1301         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1302
1303         talloc_free(r);
1304
1305         return true;
1306 }
1307
1308 static bool api_clusapi_GetResourceType(struct pipes_struct *p)
1309 {
1310         const struct ndr_interface_call *call;
1311         struct ndr_pull *pull;
1312         struct ndr_push *push;
1313         enum ndr_err_code ndr_err;
1314         struct clusapi_GetResourceType *r;
1315
1316         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETRESOURCETYPE];
1317
1318         r = talloc(talloc_tos(), struct clusapi_GetResourceType);
1319         if (r == NULL) {
1320                 return false;
1321         }
1322
1323         pull = ndr_pull_init_blob(&p->in_data.data, r);
1324         if (pull == NULL) {
1325                 talloc_free(r);
1326                 return false;
1327         }
1328
1329         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1330         if (p->endian) {
1331                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1332         }
1333         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1334         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1335                 talloc_free(r);
1336                 return false;
1337         }
1338
1339         if (DEBUGLEVEL >= 10) {
1340                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceType, NDR_IN, r);
1341         }
1342
1343         ZERO_STRUCT(r->out);
1344         r->out.lpszResourceType = talloc_zero(r, const char *);
1345         if (r->out.lpszResourceType == NULL) {
1346                 talloc_free(r);
1347                 return false;
1348         }
1349
1350         r->out.rpc_status = talloc_zero(r, WERROR);
1351         if (r->out.rpc_status == NULL) {
1352                 talloc_free(r);
1353                 return false;
1354         }
1355
1356         r->out.result = _clusapi_GetResourceType(p, r);
1357
1358         if (p->fault_state) {
1359                 talloc_free(r);
1360                 /* Return true here, srv_pipe_hnd.c will take care */
1361                 return true;
1362         }
1363
1364         if (DEBUGLEVEL >= 10) {
1365                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceType, NDR_OUT | NDR_SET_VALUES, r);
1366         }
1367
1368         push = ndr_push_init_ctx(r);
1369         if (push == NULL) {
1370                 talloc_free(r);
1371                 return false;
1372         }
1373
1374         /*
1375          * carry over the pointer count to the reply in case we are
1376          * using full pointer. See NDR specification for full pointers
1377          */
1378         push->ptr_count = pull->ptr_count;
1379
1380         ndr_err = call->ndr_push(push, NDR_OUT, r);
1381         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1382                 talloc_free(r);
1383                 return false;
1384         }
1385
1386         p->out_data.rdata = ndr_push_blob(push);
1387         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1388
1389         talloc_free(r);
1390
1391         return true;
1392 }
1393
1394 static bool api_clusapi_FailResource(struct pipes_struct *p)
1395 {
1396         const struct ndr_interface_call *call;
1397         struct ndr_pull *pull;
1398         struct ndr_push *push;
1399         enum ndr_err_code ndr_err;
1400         struct clusapi_FailResource *r;
1401
1402         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_FAILRESOURCE];
1403
1404         r = talloc(talloc_tos(), struct clusapi_FailResource);
1405         if (r == NULL) {
1406                 return false;
1407         }
1408
1409         pull = ndr_pull_init_blob(&p->in_data.data, r);
1410         if (pull == NULL) {
1411                 talloc_free(r);
1412                 return false;
1413         }
1414
1415         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1416         if (p->endian) {
1417                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1418         }
1419         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1420         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1421                 talloc_free(r);
1422                 return false;
1423         }
1424
1425         if (DEBUGLEVEL >= 10) {
1426                 NDR_PRINT_FUNCTION_DEBUG(clusapi_FailResource, NDR_IN, r);
1427         }
1428
1429         ZERO_STRUCT(r->out);
1430         r->out.rpc_status = talloc_zero(r, WERROR);
1431         if (r->out.rpc_status == NULL) {
1432                 talloc_free(r);
1433                 return false;
1434         }
1435
1436         r->out.result = _clusapi_FailResource(p, r);
1437
1438         if (p->fault_state) {
1439                 talloc_free(r);
1440                 /* Return true here, srv_pipe_hnd.c will take care */
1441                 return true;
1442         }
1443
1444         if (DEBUGLEVEL >= 10) {
1445                 NDR_PRINT_FUNCTION_DEBUG(clusapi_FailResource, NDR_OUT | NDR_SET_VALUES, r);
1446         }
1447
1448         push = ndr_push_init_ctx(r);
1449         if (push == NULL) {
1450                 talloc_free(r);
1451                 return false;
1452         }
1453
1454         /*
1455          * carry over the pointer count to the reply in case we are
1456          * using full pointer. See NDR specification for full pointers
1457          */
1458         push->ptr_count = pull->ptr_count;
1459
1460         ndr_err = call->ndr_push(push, NDR_OUT, r);
1461         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1462                 talloc_free(r);
1463                 return false;
1464         }
1465
1466         p->out_data.rdata = ndr_push_blob(push);
1467         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1468
1469         talloc_free(r);
1470
1471         return true;
1472 }
1473
1474 static bool api_clusapi_OnlineResource(struct pipes_struct *p)
1475 {
1476         const struct ndr_interface_call *call;
1477         struct ndr_pull *pull;
1478         struct ndr_push *push;
1479         enum ndr_err_code ndr_err;
1480         struct clusapi_OnlineResource *r;
1481
1482         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ONLINERESOURCE];
1483
1484         r = talloc(talloc_tos(), struct clusapi_OnlineResource);
1485         if (r == NULL) {
1486                 return false;
1487         }
1488
1489         pull = ndr_pull_init_blob(&p->in_data.data, r);
1490         if (pull == NULL) {
1491                 talloc_free(r);
1492                 return false;
1493         }
1494
1495         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1496         if (p->endian) {
1497                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1498         }
1499         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1500         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1501                 talloc_free(r);
1502                 return false;
1503         }
1504
1505         if (DEBUGLEVEL >= 10) {
1506                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineResource, NDR_IN, r);
1507         }
1508
1509         ZERO_STRUCT(r->out);
1510         r->out.rpc_status = talloc_zero(r, WERROR);
1511         if (r->out.rpc_status == NULL) {
1512                 talloc_free(r);
1513                 return false;
1514         }
1515
1516         r->out.result = _clusapi_OnlineResource(p, r);
1517
1518         if (p->fault_state) {
1519                 talloc_free(r);
1520                 /* Return true here, srv_pipe_hnd.c will take care */
1521                 return true;
1522         }
1523
1524         if (DEBUGLEVEL >= 10) {
1525                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineResource, NDR_OUT | NDR_SET_VALUES, r);
1526         }
1527
1528         push = ndr_push_init_ctx(r);
1529         if (push == NULL) {
1530                 talloc_free(r);
1531                 return false;
1532         }
1533
1534         /*
1535          * carry over the pointer count to the reply in case we are
1536          * using full pointer. See NDR specification for full pointers
1537          */
1538         push->ptr_count = pull->ptr_count;
1539
1540         ndr_err = call->ndr_push(push, NDR_OUT, r);
1541         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1542                 talloc_free(r);
1543                 return false;
1544         }
1545
1546         p->out_data.rdata = ndr_push_blob(push);
1547         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1548
1549         talloc_free(r);
1550
1551         return true;
1552 }
1553
1554 static bool api_clusapi_OfflineResource(struct pipes_struct *p)
1555 {
1556         const struct ndr_interface_call *call;
1557         struct ndr_pull *pull;
1558         struct ndr_push *push;
1559         enum ndr_err_code ndr_err;
1560         struct clusapi_OfflineResource *r;
1561
1562         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OFFLINERESOURCE];
1563
1564         r = talloc(talloc_tos(), struct clusapi_OfflineResource);
1565         if (r == NULL) {
1566                 return false;
1567         }
1568
1569         pull = ndr_pull_init_blob(&p->in_data.data, r);
1570         if (pull == NULL) {
1571                 talloc_free(r);
1572                 return false;
1573         }
1574
1575         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1576         if (p->endian) {
1577                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1578         }
1579         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1580         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1581                 talloc_free(r);
1582                 return false;
1583         }
1584
1585         if (DEBUGLEVEL >= 10) {
1586                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineResource, NDR_IN, r);
1587         }
1588
1589         ZERO_STRUCT(r->out);
1590         r->out.rpc_status = talloc_zero(r, WERROR);
1591         if (r->out.rpc_status == NULL) {
1592                 talloc_free(r);
1593                 return false;
1594         }
1595
1596         r->out.result = _clusapi_OfflineResource(p, r);
1597
1598         if (p->fault_state) {
1599                 talloc_free(r);
1600                 /* Return true here, srv_pipe_hnd.c will take care */
1601                 return true;
1602         }
1603
1604         if (DEBUGLEVEL >= 10) {
1605                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineResource, NDR_OUT | NDR_SET_VALUES, r);
1606         }
1607
1608         push = ndr_push_init_ctx(r);
1609         if (push == NULL) {
1610                 talloc_free(r);
1611                 return false;
1612         }
1613
1614         /*
1615          * carry over the pointer count to the reply in case we are
1616          * using full pointer. See NDR specification for full pointers
1617          */
1618         push->ptr_count = pull->ptr_count;
1619
1620         ndr_err = call->ndr_push(push, NDR_OUT, r);
1621         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1622                 talloc_free(r);
1623                 return false;
1624         }
1625
1626         p->out_data.rdata = ndr_push_blob(push);
1627         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1628
1629         talloc_free(r);
1630
1631         return true;
1632 }
1633
1634 static bool api_clusapi_AddResourceDependency(struct pipes_struct *p)
1635 {
1636         const struct ndr_interface_call *call;
1637         struct ndr_pull *pull;
1638         struct ndr_push *push;
1639         enum ndr_err_code ndr_err;
1640         struct clusapi_AddResourceDependency *r;
1641
1642         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDRESOURCEDEPENDENCY];
1643
1644         r = talloc(talloc_tos(), struct clusapi_AddResourceDependency);
1645         if (r == NULL) {
1646                 return false;
1647         }
1648
1649         pull = ndr_pull_init_blob(&p->in_data.data, r);
1650         if (pull == NULL) {
1651                 talloc_free(r);
1652                 return false;
1653         }
1654
1655         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1656         if (p->endian) {
1657                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1658         }
1659         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1660         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1661                 talloc_free(r);
1662                 return false;
1663         }
1664
1665         if (DEBUGLEVEL >= 10) {
1666                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddResourceDependency, NDR_IN, r);
1667         }
1668
1669         ZERO_STRUCT(r->out);
1670         r->out.rpc_status = talloc_zero(r, WERROR);
1671         if (r->out.rpc_status == NULL) {
1672                 talloc_free(r);
1673                 return false;
1674         }
1675
1676         r->out.result = _clusapi_AddResourceDependency(p, r);
1677
1678         if (p->fault_state) {
1679                 talloc_free(r);
1680                 /* Return true here, srv_pipe_hnd.c will take care */
1681                 return true;
1682         }
1683
1684         if (DEBUGLEVEL >= 10) {
1685                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddResourceDependency, NDR_OUT | NDR_SET_VALUES, r);
1686         }
1687
1688         push = ndr_push_init_ctx(r);
1689         if (push == NULL) {
1690                 talloc_free(r);
1691                 return false;
1692         }
1693
1694         /*
1695          * carry over the pointer count to the reply in case we are
1696          * using full pointer. See NDR specification for full pointers
1697          */
1698         push->ptr_count = pull->ptr_count;
1699
1700         ndr_err = call->ndr_push(push, NDR_OUT, r);
1701         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1702                 talloc_free(r);
1703                 return false;
1704         }
1705
1706         p->out_data.rdata = ndr_push_blob(push);
1707         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1708
1709         talloc_free(r);
1710
1711         return true;
1712 }
1713
1714 static bool api_clusapi_RemoveResourceDependency(struct pipes_struct *p)
1715 {
1716         const struct ndr_interface_call *call;
1717         struct ndr_pull *pull;
1718         struct ndr_push *push;
1719         enum ndr_err_code ndr_err;
1720         struct clusapi_RemoveResourceDependency *r;
1721
1722         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_REMOVERESOURCEDEPENDENCY];
1723
1724         r = talloc(talloc_tos(), struct clusapi_RemoveResourceDependency);
1725         if (r == NULL) {
1726                 return false;
1727         }
1728
1729         pull = ndr_pull_init_blob(&p->in_data.data, r);
1730         if (pull == NULL) {
1731                 talloc_free(r);
1732                 return false;
1733         }
1734
1735         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1736         if (p->endian) {
1737                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1738         }
1739         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1740         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1741                 talloc_free(r);
1742                 return false;
1743         }
1744
1745         if (DEBUGLEVEL >= 10) {
1746                 NDR_PRINT_FUNCTION_DEBUG(clusapi_RemoveResourceDependency, NDR_IN, r);
1747         }
1748
1749         ZERO_STRUCT(r->out);
1750         r->out.rpc_status = talloc_zero(r, WERROR);
1751         if (r->out.rpc_status == NULL) {
1752                 talloc_free(r);
1753                 return false;
1754         }
1755
1756         r->out.result = _clusapi_RemoveResourceDependency(p, r);
1757
1758         if (p->fault_state) {
1759                 talloc_free(r);
1760                 /* Return true here, srv_pipe_hnd.c will take care */
1761                 return true;
1762         }
1763
1764         if (DEBUGLEVEL >= 10) {
1765                 NDR_PRINT_FUNCTION_DEBUG(clusapi_RemoveResourceDependency, NDR_OUT | NDR_SET_VALUES, r);
1766         }
1767
1768         push = ndr_push_init_ctx(r);
1769         if (push == NULL) {
1770                 talloc_free(r);
1771                 return false;
1772         }
1773
1774         /*
1775          * carry over the pointer count to the reply in case we are
1776          * using full pointer. See NDR specification for full pointers
1777          */
1778         push->ptr_count = pull->ptr_count;
1779
1780         ndr_err = call->ndr_push(push, NDR_OUT, r);
1781         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1782                 talloc_free(r);
1783                 return false;
1784         }
1785
1786         p->out_data.rdata = ndr_push_blob(push);
1787         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1788
1789         talloc_free(r);
1790
1791         return true;
1792 }
1793
1794 static bool api_clusapi_CanResourceBeDependent(struct pipes_struct *p)
1795 {
1796         const struct ndr_interface_call *call;
1797         struct ndr_pull *pull;
1798         struct ndr_push *push;
1799         enum ndr_err_code ndr_err;
1800         struct clusapi_CanResourceBeDependent *r;
1801
1802         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CANRESOURCEBEDEPENDENT];
1803
1804         r = talloc(talloc_tos(), struct clusapi_CanResourceBeDependent);
1805         if (r == NULL) {
1806                 return false;
1807         }
1808
1809         pull = ndr_pull_init_blob(&p->in_data.data, r);
1810         if (pull == NULL) {
1811                 talloc_free(r);
1812                 return false;
1813         }
1814
1815         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1816         if (p->endian) {
1817                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1818         }
1819         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1820         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1821                 talloc_free(r);
1822                 return false;
1823         }
1824
1825         if (DEBUGLEVEL >= 10) {
1826                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CanResourceBeDependent, NDR_IN, r);
1827         }
1828
1829         ZERO_STRUCT(r->out);
1830         r->out.rpc_status = talloc_zero(r, WERROR);
1831         if (r->out.rpc_status == NULL) {
1832                 talloc_free(r);
1833                 return false;
1834         }
1835
1836         r->out.result = _clusapi_CanResourceBeDependent(p, r);
1837
1838         if (p->fault_state) {
1839                 talloc_free(r);
1840                 /* Return true here, srv_pipe_hnd.c will take care */
1841                 return true;
1842         }
1843
1844         if (DEBUGLEVEL >= 10) {
1845                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CanResourceBeDependent, NDR_OUT | NDR_SET_VALUES, r);
1846         }
1847
1848         push = ndr_push_init_ctx(r);
1849         if (push == NULL) {
1850                 talloc_free(r);
1851                 return false;
1852         }
1853
1854         /*
1855          * carry over the pointer count to the reply in case we are
1856          * using full pointer. See NDR specification for full pointers
1857          */
1858         push->ptr_count = pull->ptr_count;
1859
1860         ndr_err = call->ndr_push(push, NDR_OUT, r);
1861         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1862                 talloc_free(r);
1863                 return false;
1864         }
1865
1866         p->out_data.rdata = ndr_push_blob(push);
1867         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1868
1869         talloc_free(r);
1870
1871         return true;
1872 }
1873
1874 static bool api_clusapi_CreateResEnum(struct pipes_struct *p)
1875 {
1876         const struct ndr_interface_call *call;
1877         struct ndr_pull *pull;
1878         struct ndr_push *push;
1879         enum ndr_err_code ndr_err;
1880         struct clusapi_CreateResEnum *r;
1881
1882         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATERESENUM];
1883
1884         r = talloc(talloc_tos(), struct clusapi_CreateResEnum);
1885         if (r == NULL) {
1886                 return false;
1887         }
1888
1889         pull = ndr_pull_init_blob(&p->in_data.data, r);
1890         if (pull == NULL) {
1891                 talloc_free(r);
1892                 return false;
1893         }
1894
1895         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1896         if (p->endian) {
1897                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1898         }
1899         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1900         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1901                 talloc_free(r);
1902                 return false;
1903         }
1904
1905         if (DEBUGLEVEL >= 10) {
1906                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResEnum, NDR_IN, r);
1907         }
1908
1909         ZERO_STRUCT(r->out);
1910         r->out.ReturnEnum = talloc_zero(r, struct ENUM_LIST *);
1911         if (r->out.ReturnEnum == NULL) {
1912                 talloc_free(r);
1913                 return false;
1914         }
1915
1916         r->out.rpc_status = talloc_zero(r, WERROR);
1917         if (r->out.rpc_status == NULL) {
1918                 talloc_free(r);
1919                 return false;
1920         }
1921
1922         r->out.result = _clusapi_CreateResEnum(p, r);
1923
1924         if (p->fault_state) {
1925                 talloc_free(r);
1926                 /* Return true here, srv_pipe_hnd.c will take care */
1927                 return true;
1928         }
1929
1930         if (DEBUGLEVEL >= 10) {
1931                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResEnum, NDR_OUT | NDR_SET_VALUES, r);
1932         }
1933
1934         push = ndr_push_init_ctx(r);
1935         if (push == NULL) {
1936                 talloc_free(r);
1937                 return false;
1938         }
1939
1940         /*
1941          * carry over the pointer count to the reply in case we are
1942          * using full pointer. See NDR specification for full pointers
1943          */
1944         push->ptr_count = pull->ptr_count;
1945
1946         ndr_err = call->ndr_push(push, NDR_OUT, r);
1947         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1948                 talloc_free(r);
1949                 return false;
1950         }
1951
1952         p->out_data.rdata = ndr_push_blob(push);
1953         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
1954
1955         talloc_free(r);
1956
1957         return true;
1958 }
1959
1960 static bool api_clusapi_AddResourceNode(struct pipes_struct *p)
1961 {
1962         const struct ndr_interface_call *call;
1963         struct ndr_pull *pull;
1964         struct ndr_push *push;
1965         enum ndr_err_code ndr_err;
1966         struct clusapi_AddResourceNode *r;
1967
1968         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDRESOURCENODE];
1969
1970         r = talloc(talloc_tos(), struct clusapi_AddResourceNode);
1971         if (r == NULL) {
1972                 return false;
1973         }
1974
1975         pull = ndr_pull_init_blob(&p->in_data.data, r);
1976         if (pull == NULL) {
1977                 talloc_free(r);
1978                 return false;
1979         }
1980
1981         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1982         if (p->endian) {
1983                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
1984         }
1985         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1986         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1987                 talloc_free(r);
1988                 return false;
1989         }
1990
1991         if (DEBUGLEVEL >= 10) {
1992                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddResourceNode, NDR_IN, r);
1993         }
1994
1995         ZERO_STRUCT(r->out);
1996         r->out.rpc_status = talloc_zero(r, WERROR);
1997         if (r->out.rpc_status == NULL) {
1998                 talloc_free(r);
1999                 return false;
2000         }
2001
2002         r->out.result = _clusapi_AddResourceNode(p, r);
2003
2004         if (p->fault_state) {
2005                 talloc_free(r);
2006                 /* Return true here, srv_pipe_hnd.c will take care */
2007                 return true;
2008         }
2009
2010         if (DEBUGLEVEL >= 10) {
2011                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddResourceNode, NDR_OUT | NDR_SET_VALUES, r);
2012         }
2013
2014         push = ndr_push_init_ctx(r);
2015         if (push == NULL) {
2016                 talloc_free(r);
2017                 return false;
2018         }
2019
2020         /*
2021          * carry over the pointer count to the reply in case we are
2022          * using full pointer. See NDR specification for full pointers
2023          */
2024         push->ptr_count = pull->ptr_count;
2025
2026         ndr_err = call->ndr_push(push, NDR_OUT, r);
2027         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2028                 talloc_free(r);
2029                 return false;
2030         }
2031
2032         p->out_data.rdata = ndr_push_blob(push);
2033         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2034
2035         talloc_free(r);
2036
2037         return true;
2038 }
2039
2040 static bool api_clusapi_RemoveResourceNode(struct pipes_struct *p)
2041 {
2042         const struct ndr_interface_call *call;
2043         struct ndr_pull *pull;
2044         struct ndr_push *push;
2045         enum ndr_err_code ndr_err;
2046         struct clusapi_RemoveResourceNode *r;
2047
2048         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_REMOVERESOURCENODE];
2049
2050         r = talloc(talloc_tos(), struct clusapi_RemoveResourceNode);
2051         if (r == NULL) {
2052                 return false;
2053         }
2054
2055         pull = ndr_pull_init_blob(&p->in_data.data, r);
2056         if (pull == NULL) {
2057                 talloc_free(r);
2058                 return false;
2059         }
2060
2061         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2062         if (p->endian) {
2063                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2064         }
2065         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2066         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2067                 talloc_free(r);
2068                 return false;
2069         }
2070
2071         if (DEBUGLEVEL >= 10) {
2072                 NDR_PRINT_FUNCTION_DEBUG(clusapi_RemoveResourceNode, NDR_IN, r);
2073         }
2074
2075         ZERO_STRUCT(r->out);
2076         r->out.rpc_status = talloc_zero(r, WERROR);
2077         if (r->out.rpc_status == NULL) {
2078                 talloc_free(r);
2079                 return false;
2080         }
2081
2082         r->out.result = _clusapi_RemoveResourceNode(p, r);
2083
2084         if (p->fault_state) {
2085                 talloc_free(r);
2086                 /* Return true here, srv_pipe_hnd.c will take care */
2087                 return true;
2088         }
2089
2090         if (DEBUGLEVEL >= 10) {
2091                 NDR_PRINT_FUNCTION_DEBUG(clusapi_RemoveResourceNode, NDR_OUT | NDR_SET_VALUES, r);
2092         }
2093
2094         push = ndr_push_init_ctx(r);
2095         if (push == NULL) {
2096                 talloc_free(r);
2097                 return false;
2098         }
2099
2100         /*
2101          * carry over the pointer count to the reply in case we are
2102          * using full pointer. See NDR specification for full pointers
2103          */
2104         push->ptr_count = pull->ptr_count;
2105
2106         ndr_err = call->ndr_push(push, NDR_OUT, r);
2107         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2108                 talloc_free(r);
2109                 return false;
2110         }
2111
2112         p->out_data.rdata = ndr_push_blob(push);
2113         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2114
2115         talloc_free(r);
2116
2117         return true;
2118 }
2119
2120 static bool api_clusapi_ChangeResourceGroup(struct pipes_struct *p)
2121 {
2122         const struct ndr_interface_call *call;
2123         struct ndr_pull *pull;
2124         struct ndr_push *push;
2125         enum ndr_err_code ndr_err;
2126         struct clusapi_ChangeResourceGroup *r;
2127
2128         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CHANGERESOURCEGROUP];
2129
2130         r = talloc(talloc_tos(), struct clusapi_ChangeResourceGroup);
2131         if (r == NULL) {
2132                 return false;
2133         }
2134
2135         pull = ndr_pull_init_blob(&p->in_data.data, r);
2136         if (pull == NULL) {
2137                 talloc_free(r);
2138                 return false;
2139         }
2140
2141         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2142         if (p->endian) {
2143                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2144         }
2145         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2146         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2147                 talloc_free(r);
2148                 return false;
2149         }
2150
2151         if (DEBUGLEVEL >= 10) {
2152                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ChangeResourceGroup, NDR_IN, r);
2153         }
2154
2155         ZERO_STRUCT(r->out);
2156         r->out.rpc_status = talloc_zero(r, WERROR);
2157         if (r->out.rpc_status == NULL) {
2158                 talloc_free(r);
2159                 return false;
2160         }
2161
2162         r->out.result = _clusapi_ChangeResourceGroup(p, r);
2163
2164         if (p->fault_state) {
2165                 talloc_free(r);
2166                 /* Return true here, srv_pipe_hnd.c will take care */
2167                 return true;
2168         }
2169
2170         if (DEBUGLEVEL >= 10) {
2171                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ChangeResourceGroup, NDR_OUT | NDR_SET_VALUES, r);
2172         }
2173
2174         push = ndr_push_init_ctx(r);
2175         if (push == NULL) {
2176                 talloc_free(r);
2177                 return false;
2178         }
2179
2180         /*
2181          * carry over the pointer count to the reply in case we are
2182          * using full pointer. See NDR specification for full pointers
2183          */
2184         push->ptr_count = pull->ptr_count;
2185
2186         ndr_err = call->ndr_push(push, NDR_OUT, r);
2187         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2188                 talloc_free(r);
2189                 return false;
2190         }
2191
2192         p->out_data.rdata = ndr_push_blob(push);
2193         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2194
2195         talloc_free(r);
2196
2197         return true;
2198 }
2199
2200 static bool api_clusapi_CreateResourceType(struct pipes_struct *p)
2201 {
2202         const struct ndr_interface_call *call;
2203         struct ndr_pull *pull;
2204         struct ndr_push *push;
2205         enum ndr_err_code ndr_err;
2206         struct clusapi_CreateResourceType *r;
2207
2208         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATERESOURCETYPE];
2209
2210         r = talloc(talloc_tos(), struct clusapi_CreateResourceType);
2211         if (r == NULL) {
2212                 return false;
2213         }
2214
2215         pull = ndr_pull_init_blob(&p->in_data.data, r);
2216         if (pull == NULL) {
2217                 talloc_free(r);
2218                 return false;
2219         }
2220
2221         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2222         if (p->endian) {
2223                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2224         }
2225         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2226         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2227                 talloc_free(r);
2228                 return false;
2229         }
2230
2231         if (DEBUGLEVEL >= 10) {
2232                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResourceType, NDR_IN, r);
2233         }
2234
2235         ZERO_STRUCT(r->out);
2236         r->out.rpc_status = talloc_zero(r, WERROR);
2237         if (r->out.rpc_status == NULL) {
2238                 talloc_free(r);
2239                 return false;
2240         }
2241
2242         r->out.result = _clusapi_CreateResourceType(p, r);
2243
2244         if (p->fault_state) {
2245                 talloc_free(r);
2246                 /* Return true here, srv_pipe_hnd.c will take care */
2247                 return true;
2248         }
2249
2250         if (DEBUGLEVEL >= 10) {
2251                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResourceType, NDR_OUT | NDR_SET_VALUES, r);
2252         }
2253
2254         push = ndr_push_init_ctx(r);
2255         if (push == NULL) {
2256                 talloc_free(r);
2257                 return false;
2258         }
2259
2260         /*
2261          * carry over the pointer count to the reply in case we are
2262          * using full pointer. See NDR specification for full pointers
2263          */
2264         push->ptr_count = pull->ptr_count;
2265
2266         ndr_err = call->ndr_push(push, NDR_OUT, r);
2267         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2268                 talloc_free(r);
2269                 return false;
2270         }
2271
2272         p->out_data.rdata = ndr_push_blob(push);
2273         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2274
2275         talloc_free(r);
2276
2277         return true;
2278 }
2279
2280 static bool api_clusapi_DeleteResourceType(struct pipes_struct *p)
2281 {
2282         const struct ndr_interface_call *call;
2283         struct ndr_pull *pull;
2284         struct ndr_push *push;
2285         enum ndr_err_code ndr_err;
2286         struct clusapi_DeleteResourceType *r;
2287
2288         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_DELETERESOURCETYPE];
2289
2290         r = talloc(talloc_tos(), struct clusapi_DeleteResourceType);
2291         if (r == NULL) {
2292                 return false;
2293         }
2294
2295         pull = ndr_pull_init_blob(&p->in_data.data, r);
2296         if (pull == NULL) {
2297                 talloc_free(r);
2298                 return false;
2299         }
2300
2301         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2302         if (p->endian) {
2303                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2304         }
2305         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2306         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2307                 talloc_free(r);
2308                 return false;
2309         }
2310
2311         if (DEBUGLEVEL >= 10) {
2312                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteResourceType, NDR_IN, r);
2313         }
2314
2315         ZERO_STRUCT(r->out);
2316         r->out.rpc_status = talloc_zero(r, WERROR);
2317         if (r->out.rpc_status == NULL) {
2318                 talloc_free(r);
2319                 return false;
2320         }
2321
2322         r->out.result = _clusapi_DeleteResourceType(p, r);
2323
2324         if (p->fault_state) {
2325                 talloc_free(r);
2326                 /* Return true here, srv_pipe_hnd.c will take care */
2327                 return true;
2328         }
2329
2330         if (DEBUGLEVEL >= 10) {
2331                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteResourceType, NDR_OUT | NDR_SET_VALUES, r);
2332         }
2333
2334         push = ndr_push_init_ctx(r);
2335         if (push == NULL) {
2336                 talloc_free(r);
2337                 return false;
2338         }
2339
2340         /*
2341          * carry over the pointer count to the reply in case we are
2342          * using full pointer. See NDR specification for full pointers
2343          */
2344         push->ptr_count = pull->ptr_count;
2345
2346         ndr_err = call->ndr_push(push, NDR_OUT, r);
2347         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2348                 talloc_free(r);
2349                 return false;
2350         }
2351
2352         p->out_data.rdata = ndr_push_blob(push);
2353         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2354
2355         talloc_free(r);
2356
2357         return true;
2358 }
2359
2360 static bool api_clusapi_GetRootKey(struct pipes_struct *p)
2361 {
2362         const struct ndr_interface_call *call;
2363         struct ndr_pull *pull;
2364         struct ndr_push *push;
2365         enum ndr_err_code ndr_err;
2366         struct clusapi_GetRootKey *r;
2367
2368         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETROOTKEY];
2369
2370         r = talloc(talloc_tos(), struct clusapi_GetRootKey);
2371         if (r == NULL) {
2372                 return false;
2373         }
2374
2375         pull = ndr_pull_init_blob(&p->in_data.data, r);
2376         if (pull == NULL) {
2377                 talloc_free(r);
2378                 return false;
2379         }
2380
2381         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2382         if (p->endian) {
2383                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2384         }
2385         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2386         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2387                 talloc_free(r);
2388                 return false;
2389         }
2390
2391         if (DEBUGLEVEL >= 10) {
2392                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetRootKey, NDR_IN, r);
2393         }
2394
2395         ZERO_STRUCT(r->out);
2396         r->out.Status = talloc_zero(r, WERROR);
2397         if (r->out.Status == NULL) {
2398                 talloc_free(r);
2399                 return false;
2400         }
2401
2402         r->out.rpc_status = talloc_zero(r, WERROR);
2403         if (r->out.rpc_status == NULL) {
2404                 talloc_free(r);
2405                 return false;
2406         }
2407
2408         r->out.phKey = talloc_zero(r, struct policy_handle);
2409         if (r->out.phKey == NULL) {
2410                 talloc_free(r);
2411                 return false;
2412         }
2413
2414         _clusapi_GetRootKey(p, r);
2415
2416         if (p->fault_state) {
2417                 talloc_free(r);
2418                 /* Return true here, srv_pipe_hnd.c will take care */
2419                 return true;
2420         }
2421
2422         if (DEBUGLEVEL >= 10) {
2423                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetRootKey, NDR_OUT | NDR_SET_VALUES, r);
2424         }
2425
2426         push = ndr_push_init_ctx(r);
2427         if (push == NULL) {
2428                 talloc_free(r);
2429                 return false;
2430         }
2431
2432         /*
2433          * carry over the pointer count to the reply in case we are
2434          * using full pointer. See NDR specification for full pointers
2435          */
2436         push->ptr_count = pull->ptr_count;
2437
2438         ndr_err = call->ndr_push(push, NDR_OUT, r);
2439         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2440                 talloc_free(r);
2441                 return false;
2442         }
2443
2444         p->out_data.rdata = ndr_push_blob(push);
2445         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2446
2447         talloc_free(r);
2448
2449         return true;
2450 }
2451
2452 static bool api_clusapi_CreateKey(struct pipes_struct *p)
2453 {
2454         const struct ndr_interface_call *call;
2455         struct ndr_pull *pull;
2456         struct ndr_push *push;
2457         enum ndr_err_code ndr_err;
2458         struct clusapi_CreateKey *r;
2459
2460         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEKEY];
2461
2462         r = talloc(talloc_tos(), struct clusapi_CreateKey);
2463         if (r == NULL) {
2464                 return false;
2465         }
2466
2467         pull = ndr_pull_init_blob(&p->in_data.data, r);
2468         if (pull == NULL) {
2469                 talloc_free(r);
2470                 return false;
2471         }
2472
2473         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2474         if (p->endian) {
2475                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2476         }
2477         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2478         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2479                 talloc_free(r);
2480                 return false;
2481         }
2482
2483         if (DEBUGLEVEL >= 10) {
2484                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateKey, NDR_IN, r);
2485         }
2486
2487         ZERO_STRUCT(r->out);
2488         r->out.lpdwDisposition = talloc_zero(r, uint32_t);
2489         if (r->out.lpdwDisposition == NULL) {
2490                 talloc_free(r);
2491                 return false;
2492         }
2493
2494         r->out.Status = talloc_zero(r, WERROR);
2495         if (r->out.Status == NULL) {
2496                 talloc_free(r);
2497                 return false;
2498         }
2499
2500         r->out.rpc_status = talloc_zero(r, WERROR);
2501         if (r->out.rpc_status == NULL) {
2502                 talloc_free(r);
2503                 return false;
2504         }
2505
2506         r->out.phKey = talloc_zero(r, struct policy_handle);
2507         if (r->out.phKey == NULL) {
2508                 talloc_free(r);
2509                 return false;
2510         }
2511
2512         _clusapi_CreateKey(p, r);
2513
2514         if (p->fault_state) {
2515                 talloc_free(r);
2516                 /* Return true here, srv_pipe_hnd.c will take care */
2517                 return true;
2518         }
2519
2520         if (DEBUGLEVEL >= 10) {
2521                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateKey, NDR_OUT | NDR_SET_VALUES, r);
2522         }
2523
2524         push = ndr_push_init_ctx(r);
2525         if (push == NULL) {
2526                 talloc_free(r);
2527                 return false;
2528         }
2529
2530         /*
2531          * carry over the pointer count to the reply in case we are
2532          * using full pointer. See NDR specification for full pointers
2533          */
2534         push->ptr_count = pull->ptr_count;
2535
2536         ndr_err = call->ndr_push(push, NDR_OUT, r);
2537         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2538                 talloc_free(r);
2539                 return false;
2540         }
2541
2542         p->out_data.rdata = ndr_push_blob(push);
2543         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2544
2545         talloc_free(r);
2546
2547         return true;
2548 }
2549
2550 static bool api_clusapi_OpenKey(struct pipes_struct *p)
2551 {
2552         const struct ndr_interface_call *call;
2553         struct ndr_pull *pull;
2554         struct ndr_push *push;
2555         enum ndr_err_code ndr_err;
2556         struct clusapi_OpenKey *r;
2557
2558         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENKEY];
2559
2560         r = talloc(talloc_tos(), struct clusapi_OpenKey);
2561         if (r == NULL) {
2562                 return false;
2563         }
2564
2565         pull = ndr_pull_init_blob(&p->in_data.data, r);
2566         if (pull == NULL) {
2567                 talloc_free(r);
2568                 return false;
2569         }
2570
2571         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2572         if (p->endian) {
2573                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2574         }
2575         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2576         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2577                 talloc_free(r);
2578                 return false;
2579         }
2580
2581         if (DEBUGLEVEL >= 10) {
2582                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenKey, NDR_IN, r);
2583         }
2584
2585         ZERO_STRUCT(r->out);
2586         r->out.Status = talloc_zero(r, WERROR);
2587         if (r->out.Status == NULL) {
2588                 talloc_free(r);
2589                 return false;
2590         }
2591
2592         r->out.rpc_status = talloc_zero(r, WERROR);
2593         if (r->out.rpc_status == NULL) {
2594                 talloc_free(r);
2595                 return false;
2596         }
2597
2598         r->out.phKey = talloc_zero(r, struct policy_handle);
2599         if (r->out.phKey == NULL) {
2600                 talloc_free(r);
2601                 return false;
2602         }
2603
2604         _clusapi_OpenKey(p, r);
2605
2606         if (p->fault_state) {
2607                 talloc_free(r);
2608                 /* Return true here, srv_pipe_hnd.c will take care */
2609                 return true;
2610         }
2611
2612         if (DEBUGLEVEL >= 10) {
2613                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenKey, NDR_OUT | NDR_SET_VALUES, r);
2614         }
2615
2616         push = ndr_push_init_ctx(r);
2617         if (push == NULL) {
2618                 talloc_free(r);
2619                 return false;
2620         }
2621
2622         /*
2623          * carry over the pointer count to the reply in case we are
2624          * using full pointer. See NDR specification for full pointers
2625          */
2626         push->ptr_count = pull->ptr_count;
2627
2628         ndr_err = call->ndr_push(push, NDR_OUT, r);
2629         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2630                 talloc_free(r);
2631                 return false;
2632         }
2633
2634         p->out_data.rdata = ndr_push_blob(push);
2635         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2636
2637         talloc_free(r);
2638
2639         return true;
2640 }
2641
2642 static bool api_clusapi_EnumKey(struct pipes_struct *p)
2643 {
2644         const struct ndr_interface_call *call;
2645         struct ndr_pull *pull;
2646         struct ndr_push *push;
2647         enum ndr_err_code ndr_err;
2648         struct clusapi_EnumKey *r;
2649
2650         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ENUMKEY];
2651
2652         r = talloc(talloc_tos(), struct clusapi_EnumKey);
2653         if (r == NULL) {
2654                 return false;
2655         }
2656
2657         pull = ndr_pull_init_blob(&p->in_data.data, r);
2658         if (pull == NULL) {
2659                 talloc_free(r);
2660                 return false;
2661         }
2662
2663         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2664         if (p->endian) {
2665                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2666         }
2667         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2668         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2669                 talloc_free(r);
2670                 return false;
2671         }
2672
2673         if (DEBUGLEVEL >= 10) {
2674                 NDR_PRINT_FUNCTION_DEBUG(clusapi_EnumKey, NDR_IN, r);
2675         }
2676
2677         ZERO_STRUCT(r->out);
2678         r->out.KeyName = talloc_zero(r, const char *);
2679         if (r->out.KeyName == NULL) {
2680                 talloc_free(r);
2681                 return false;
2682         }
2683
2684         r->out.lpftLastWriteTime = talloc_zero(r, NTTIME);
2685         if (r->out.lpftLastWriteTime == NULL) {
2686                 talloc_free(r);
2687                 return false;
2688         }
2689
2690         r->out.rpc_status = talloc_zero(r, WERROR);
2691         if (r->out.rpc_status == NULL) {
2692                 talloc_free(r);
2693                 return false;
2694         }
2695
2696         r->out.result = _clusapi_EnumKey(p, r);
2697
2698         if (p->fault_state) {
2699                 talloc_free(r);
2700                 /* Return true here, srv_pipe_hnd.c will take care */
2701                 return true;
2702         }
2703
2704         if (DEBUGLEVEL >= 10) {
2705                 NDR_PRINT_FUNCTION_DEBUG(clusapi_EnumKey, NDR_OUT | NDR_SET_VALUES, r);
2706         }
2707
2708         push = ndr_push_init_ctx(r);
2709         if (push == NULL) {
2710                 talloc_free(r);
2711                 return false;
2712         }
2713
2714         /*
2715          * carry over the pointer count to the reply in case we are
2716          * using full pointer. See NDR specification for full pointers
2717          */
2718         push->ptr_count = pull->ptr_count;
2719
2720         ndr_err = call->ndr_push(push, NDR_OUT, r);
2721         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2722                 talloc_free(r);
2723                 return false;
2724         }
2725
2726         p->out_data.rdata = ndr_push_blob(push);
2727         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2728
2729         talloc_free(r);
2730
2731         return true;
2732 }
2733
2734 static bool api_clusapi_SetValue(struct pipes_struct *p)
2735 {
2736         const struct ndr_interface_call *call;
2737         struct ndr_pull *pull;
2738         struct ndr_push *push;
2739         enum ndr_err_code ndr_err;
2740         struct clusapi_SetValue *r;
2741
2742         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETVALUE];
2743
2744         r = talloc(talloc_tos(), struct clusapi_SetValue);
2745         if (r == NULL) {
2746                 return false;
2747         }
2748
2749         pull = ndr_pull_init_blob(&p->in_data.data, r);
2750         if (pull == NULL) {
2751                 talloc_free(r);
2752                 return false;
2753         }
2754
2755         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2756         if (p->endian) {
2757                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2758         }
2759         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2760         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2761                 talloc_free(r);
2762                 return false;
2763         }
2764
2765         if (DEBUGLEVEL >= 10) {
2766                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetValue, NDR_IN, r);
2767         }
2768
2769         ZERO_STRUCT(r->out);
2770         r->out.rpc_status = talloc_zero(r, WERROR);
2771         if (r->out.rpc_status == NULL) {
2772                 talloc_free(r);
2773                 return false;
2774         }
2775
2776         r->out.result = _clusapi_SetValue(p, r);
2777
2778         if (p->fault_state) {
2779                 talloc_free(r);
2780                 /* Return true here, srv_pipe_hnd.c will take care */
2781                 return true;
2782         }
2783
2784         if (DEBUGLEVEL >= 10) {
2785                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetValue, NDR_OUT | NDR_SET_VALUES, r);
2786         }
2787
2788         push = ndr_push_init_ctx(r);
2789         if (push == NULL) {
2790                 talloc_free(r);
2791                 return false;
2792         }
2793
2794         /*
2795          * carry over the pointer count to the reply in case we are
2796          * using full pointer. See NDR specification for full pointers
2797          */
2798         push->ptr_count = pull->ptr_count;
2799
2800         ndr_err = call->ndr_push(push, NDR_OUT, r);
2801         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2802                 talloc_free(r);
2803                 return false;
2804         }
2805
2806         p->out_data.rdata = ndr_push_blob(push);
2807         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2808
2809         talloc_free(r);
2810
2811         return true;
2812 }
2813
2814 static bool api_clusapi_DeleteValue(struct pipes_struct *p)
2815 {
2816         const struct ndr_interface_call *call;
2817         struct ndr_pull *pull;
2818         struct ndr_push *push;
2819         enum ndr_err_code ndr_err;
2820         struct clusapi_DeleteValue *r;
2821
2822         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_DELETEVALUE];
2823
2824         r = talloc(talloc_tos(), struct clusapi_DeleteValue);
2825         if (r == NULL) {
2826                 return false;
2827         }
2828
2829         pull = ndr_pull_init_blob(&p->in_data.data, r);
2830         if (pull == NULL) {
2831                 talloc_free(r);
2832                 return false;
2833         }
2834
2835         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2836         if (p->endian) {
2837                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2838         }
2839         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2840         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2841                 talloc_free(r);
2842                 return false;
2843         }
2844
2845         if (DEBUGLEVEL >= 10) {
2846                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteValue, NDR_IN, r);
2847         }
2848
2849         ZERO_STRUCT(r->out);
2850         r->out.rpc_status = talloc_zero(r, WERROR);
2851         if (r->out.rpc_status == NULL) {
2852                 talloc_free(r);
2853                 return false;
2854         }
2855
2856         r->out.result = _clusapi_DeleteValue(p, r);
2857
2858         if (p->fault_state) {
2859                 talloc_free(r);
2860                 /* Return true here, srv_pipe_hnd.c will take care */
2861                 return true;
2862         }
2863
2864         if (DEBUGLEVEL >= 10) {
2865                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteValue, NDR_OUT | NDR_SET_VALUES, r);
2866         }
2867
2868         push = ndr_push_init_ctx(r);
2869         if (push == NULL) {
2870                 talloc_free(r);
2871                 return false;
2872         }
2873
2874         /*
2875          * carry over the pointer count to the reply in case we are
2876          * using full pointer. See NDR specification for full pointers
2877          */
2878         push->ptr_count = pull->ptr_count;
2879
2880         ndr_err = call->ndr_push(push, NDR_OUT, r);
2881         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2882                 talloc_free(r);
2883                 return false;
2884         }
2885
2886         p->out_data.rdata = ndr_push_blob(push);
2887         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2888
2889         talloc_free(r);
2890
2891         return true;
2892 }
2893
2894 static bool api_clusapi_QueryValue(struct pipes_struct *p)
2895 {
2896         const struct ndr_interface_call *call;
2897         struct ndr_pull *pull;
2898         struct ndr_push *push;
2899         enum ndr_err_code ndr_err;
2900         struct clusapi_QueryValue *r;
2901
2902         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_QUERYVALUE];
2903
2904         r = talloc(talloc_tos(), struct clusapi_QueryValue);
2905         if (r == NULL) {
2906                 return false;
2907         }
2908
2909         pull = ndr_pull_init_blob(&p->in_data.data, r);
2910         if (pull == NULL) {
2911                 talloc_free(r);
2912                 return false;
2913         }
2914
2915         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2916         if (p->endian) {
2917                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
2918         }
2919         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2920         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2921                 talloc_free(r);
2922                 return false;
2923         }
2924
2925         if (DEBUGLEVEL >= 10) {
2926                 NDR_PRINT_FUNCTION_DEBUG(clusapi_QueryValue, NDR_IN, r);
2927         }
2928
2929         ZERO_STRUCT(r->out);
2930         r->out.lpValueType = talloc_zero(r, enum winreg_Type);
2931         if (r->out.lpValueType == NULL) {
2932                 talloc_free(r);
2933                 return false;
2934         }
2935
2936         r->out.lpData = talloc_zero_array(r, uint8_t, r->in.cbData);
2937         if (r->out.lpData == NULL) {
2938                 talloc_free(r);
2939                 return false;
2940         }
2941
2942         r->out.lpcbRequired = talloc_zero(r, uint32_t);
2943         if (r->out.lpcbRequired == NULL) {
2944                 talloc_free(r);
2945                 return false;
2946         }
2947
2948         r->out.rpc_status = talloc_zero(r, WERROR);
2949         if (r->out.rpc_status == NULL) {
2950                 talloc_free(r);
2951                 return false;
2952         }
2953
2954         r->out.result = _clusapi_QueryValue(p, r);
2955
2956         if (p->fault_state) {
2957                 talloc_free(r);
2958                 /* Return true here, srv_pipe_hnd.c will take care */
2959                 return true;
2960         }
2961
2962         if (DEBUGLEVEL >= 10) {
2963                 NDR_PRINT_FUNCTION_DEBUG(clusapi_QueryValue, NDR_OUT | NDR_SET_VALUES, r);
2964         }
2965
2966         push = ndr_push_init_ctx(r);
2967         if (push == NULL) {
2968                 talloc_free(r);
2969                 return false;
2970         }
2971
2972         /*
2973          * carry over the pointer count to the reply in case we are
2974          * using full pointer. See NDR specification for full pointers
2975          */
2976         push->ptr_count = pull->ptr_count;
2977
2978         ndr_err = call->ndr_push(push, NDR_OUT, r);
2979         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2980                 talloc_free(r);
2981                 return false;
2982         }
2983
2984         p->out_data.rdata = ndr_push_blob(push);
2985         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
2986
2987         talloc_free(r);
2988
2989         return true;
2990 }
2991
2992 static bool api_clusapi_DeleteKey(struct pipes_struct *p)
2993 {
2994         const struct ndr_interface_call *call;
2995         struct ndr_pull *pull;
2996         struct ndr_push *push;
2997         enum ndr_err_code ndr_err;
2998         struct clusapi_DeleteKey *r;
2999
3000         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_DELETEKEY];
3001
3002         r = talloc(talloc_tos(), struct clusapi_DeleteKey);
3003         if (r == NULL) {
3004                 return false;
3005         }
3006
3007         pull = ndr_pull_init_blob(&p->in_data.data, r);
3008         if (pull == NULL) {
3009                 talloc_free(r);
3010                 return false;
3011         }
3012
3013         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3014         if (p->endian) {
3015                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3016         }
3017         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3018         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3019                 talloc_free(r);
3020                 return false;
3021         }
3022
3023         if (DEBUGLEVEL >= 10) {
3024                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteKey, NDR_IN, r);
3025         }
3026
3027         ZERO_STRUCT(r->out);
3028         r->out.rpc_status = talloc_zero(r, WERROR);
3029         if (r->out.rpc_status == NULL) {
3030                 talloc_free(r);
3031                 return false;
3032         }
3033
3034         r->out.result = _clusapi_DeleteKey(p, r);
3035
3036         if (p->fault_state) {
3037                 talloc_free(r);
3038                 /* Return true here, srv_pipe_hnd.c will take care */
3039                 return true;
3040         }
3041
3042         if (DEBUGLEVEL >= 10) {
3043                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteKey, NDR_OUT | NDR_SET_VALUES, r);
3044         }
3045
3046         push = ndr_push_init_ctx(r);
3047         if (push == NULL) {
3048                 talloc_free(r);
3049                 return false;
3050         }
3051
3052         /*
3053          * carry over the pointer count to the reply in case we are
3054          * using full pointer. See NDR specification for full pointers
3055          */
3056         push->ptr_count = pull->ptr_count;
3057
3058         ndr_err = call->ndr_push(push, NDR_OUT, r);
3059         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3060                 talloc_free(r);
3061                 return false;
3062         }
3063
3064         p->out_data.rdata = ndr_push_blob(push);
3065         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3066
3067         talloc_free(r);
3068
3069         return true;
3070 }
3071
3072 static bool api_clusapi_EnumValue(struct pipes_struct *p)
3073 {
3074         const struct ndr_interface_call *call;
3075         struct ndr_pull *pull;
3076         struct ndr_push *push;
3077         enum ndr_err_code ndr_err;
3078         struct clusapi_EnumValue *r;
3079
3080         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ENUMVALUE];
3081
3082         r = talloc(talloc_tos(), struct clusapi_EnumValue);
3083         if (r == NULL) {
3084                 return false;
3085         }
3086
3087         pull = ndr_pull_init_blob(&p->in_data.data, r);
3088         if (pull == NULL) {
3089                 talloc_free(r);
3090                 return false;
3091         }
3092
3093         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3094         if (p->endian) {
3095                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3096         }
3097         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3098         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3099                 talloc_free(r);
3100                 return false;
3101         }
3102
3103         if (DEBUGLEVEL >= 10) {
3104                 NDR_PRINT_FUNCTION_DEBUG(clusapi_EnumValue, NDR_IN, r);
3105         }
3106
3107         ZERO_STRUCT(r->out);
3108         r->out.lpcbData = r->in.lpcbData;
3109         r->out.lpValueName = talloc_zero(r, const char *);
3110         if (r->out.lpValueName == NULL) {
3111                 talloc_free(r);
3112                 return false;
3113         }
3114
3115         r->out.lpType = talloc_zero(r, enum winreg_Type);
3116         if (r->out.lpType == NULL) {
3117                 talloc_free(r);
3118                 return false;
3119         }
3120
3121         r->out.lpData = talloc_zero_array(r, uint8_t, *r->out.lpcbData);
3122         if (r->out.lpData == NULL) {
3123                 talloc_free(r);
3124                 return false;
3125         }
3126
3127         r->out.TotalSize = talloc_zero(r, uint32_t);
3128         if (r->out.TotalSize == NULL) {
3129                 talloc_free(r);
3130                 return false;
3131         }
3132
3133         r->out.rpc_status = talloc_zero(r, WERROR);
3134         if (r->out.rpc_status == NULL) {
3135                 talloc_free(r);
3136                 return false;
3137         }
3138
3139         r->out.result = _clusapi_EnumValue(p, r);
3140
3141         if (p->fault_state) {
3142                 talloc_free(r);
3143                 /* Return true here, srv_pipe_hnd.c will take care */
3144                 return true;
3145         }
3146
3147         if (DEBUGLEVEL >= 10) {
3148                 NDR_PRINT_FUNCTION_DEBUG(clusapi_EnumValue, NDR_OUT | NDR_SET_VALUES, r);
3149         }
3150
3151         push = ndr_push_init_ctx(r);
3152         if (push == NULL) {
3153                 talloc_free(r);
3154                 return false;
3155         }
3156
3157         /*
3158          * carry over the pointer count to the reply in case we are
3159          * using full pointer. See NDR specification for full pointers
3160          */
3161         push->ptr_count = pull->ptr_count;
3162
3163         ndr_err = call->ndr_push(push, NDR_OUT, r);
3164         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3165                 talloc_free(r);
3166                 return false;
3167         }
3168
3169         p->out_data.rdata = ndr_push_blob(push);
3170         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3171
3172         talloc_free(r);
3173
3174         return true;
3175 }
3176
3177 static bool api_clusapi_CloseKey(struct pipes_struct *p)
3178 {
3179         const struct ndr_interface_call *call;
3180         struct ndr_pull *pull;
3181         struct ndr_push *push;
3182         enum ndr_err_code ndr_err;
3183         struct clusapi_CloseKey *r;
3184
3185         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSEKEY];
3186
3187         r = talloc(talloc_tos(), struct clusapi_CloseKey);
3188         if (r == NULL) {
3189                 return false;
3190         }
3191
3192         pull = ndr_pull_init_blob(&p->in_data.data, r);
3193         if (pull == NULL) {
3194                 talloc_free(r);
3195                 return false;
3196         }
3197
3198         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3199         if (p->endian) {
3200                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3201         }
3202         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3203         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3204                 talloc_free(r);
3205                 return false;
3206         }
3207
3208         if (DEBUGLEVEL >= 10) {
3209                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseKey, NDR_IN, r);
3210         }
3211
3212         ZERO_STRUCT(r->out);
3213         r->out.pKey = r->in.pKey;
3214         r->out.result = _clusapi_CloseKey(p, r);
3215
3216         if (p->fault_state) {
3217                 talloc_free(r);
3218                 /* Return true here, srv_pipe_hnd.c will take care */
3219                 return true;
3220         }
3221
3222         if (DEBUGLEVEL >= 10) {
3223                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseKey, NDR_OUT | NDR_SET_VALUES, r);
3224         }
3225
3226         push = ndr_push_init_ctx(r);
3227         if (push == NULL) {
3228                 talloc_free(r);
3229                 return false;
3230         }
3231
3232         /*
3233          * carry over the pointer count to the reply in case we are
3234          * using full pointer. See NDR specification for full pointers
3235          */
3236         push->ptr_count = pull->ptr_count;
3237
3238         ndr_err = call->ndr_push(push, NDR_OUT, r);
3239         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3240                 talloc_free(r);
3241                 return false;
3242         }
3243
3244         p->out_data.rdata = ndr_push_blob(push);
3245         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3246
3247         talloc_free(r);
3248
3249         return true;
3250 }
3251
3252 static bool api_clusapi_QueryInfoKey(struct pipes_struct *p)
3253 {
3254         const struct ndr_interface_call *call;
3255         struct ndr_pull *pull;
3256         struct ndr_push *push;
3257         enum ndr_err_code ndr_err;
3258         struct clusapi_QueryInfoKey *r;
3259
3260         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_QUERYINFOKEY];
3261
3262         r = talloc(talloc_tos(), struct clusapi_QueryInfoKey);
3263         if (r == NULL) {
3264                 return false;
3265         }
3266
3267         pull = ndr_pull_init_blob(&p->in_data.data, r);
3268         if (pull == NULL) {
3269                 talloc_free(r);
3270                 return false;
3271         }
3272
3273         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3274         if (p->endian) {
3275                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3276         }
3277         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3278         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3279                 talloc_free(r);
3280                 return false;
3281         }
3282
3283         if (DEBUGLEVEL >= 10) {
3284                 NDR_PRINT_FUNCTION_DEBUG(clusapi_QueryInfoKey, NDR_IN, r);
3285         }
3286
3287         ZERO_STRUCT(r->out);
3288         r->out.lpcSubKeys = talloc_zero(r, uint32_t);
3289         if (r->out.lpcSubKeys == NULL) {
3290                 talloc_free(r);
3291                 return false;
3292         }
3293
3294         r->out.lpcbMaxSubKeyLen = talloc_zero(r, uint32_t);
3295         if (r->out.lpcbMaxSubKeyLen == NULL) {
3296                 talloc_free(r);
3297                 return false;
3298         }
3299
3300         r->out.lpcValues = talloc_zero(r, uint32_t);
3301         if (r->out.lpcValues == NULL) {
3302                 talloc_free(r);
3303                 return false;
3304         }
3305
3306         r->out.lpcbMaxValueNameLen = talloc_zero(r, uint32_t);
3307         if (r->out.lpcbMaxValueNameLen == NULL) {
3308                 talloc_free(r);
3309                 return false;
3310         }
3311
3312         r->out.lpcbMaxValueLen = talloc_zero(r, uint32_t);
3313         if (r->out.lpcbMaxValueLen == NULL) {
3314                 talloc_free(r);
3315                 return false;
3316         }
3317
3318         r->out.lpcbSecurityDescriptor = talloc_zero(r, uint32_t);
3319         if (r->out.lpcbSecurityDescriptor == NULL) {
3320                 talloc_free(r);
3321                 return false;
3322         }
3323
3324         r->out.lpftLastWriteTime = talloc_zero(r, NTTIME);
3325         if (r->out.lpftLastWriteTime == NULL) {
3326                 talloc_free(r);
3327                 return false;
3328         }
3329
3330         r->out.rpc_status = talloc_zero(r, WERROR);
3331         if (r->out.rpc_status == NULL) {
3332                 talloc_free(r);
3333                 return false;
3334         }
3335
3336         r->out.result = _clusapi_QueryInfoKey(p, r);
3337
3338         if (p->fault_state) {
3339                 talloc_free(r);
3340                 /* Return true here, srv_pipe_hnd.c will take care */
3341                 return true;
3342         }
3343
3344         if (DEBUGLEVEL >= 10) {
3345                 NDR_PRINT_FUNCTION_DEBUG(clusapi_QueryInfoKey, NDR_OUT | NDR_SET_VALUES, r);
3346         }
3347
3348         push = ndr_push_init_ctx(r);
3349         if (push == NULL) {
3350                 talloc_free(r);
3351                 return false;
3352         }
3353
3354         /*
3355          * carry over the pointer count to the reply in case we are
3356          * using full pointer. See NDR specification for full pointers
3357          */
3358         push->ptr_count = pull->ptr_count;
3359
3360         ndr_err = call->ndr_push(push, NDR_OUT, r);
3361         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3362                 talloc_free(r);
3363                 return false;
3364         }
3365
3366         p->out_data.rdata = ndr_push_blob(push);
3367         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3368
3369         talloc_free(r);
3370
3371         return true;
3372 }
3373
3374 static bool api_clusapi_SetKeySecurity(struct pipes_struct *p)
3375 {
3376         const struct ndr_interface_call *call;
3377         struct ndr_pull *pull;
3378         struct ndr_push *push;
3379         enum ndr_err_code ndr_err;
3380         struct clusapi_SetKeySecurity *r;
3381
3382         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETKEYSECURITY];
3383
3384         r = talloc(talloc_tos(), struct clusapi_SetKeySecurity);
3385         if (r == NULL) {
3386                 return false;
3387         }
3388
3389         pull = ndr_pull_init_blob(&p->in_data.data, r);
3390         if (pull == NULL) {
3391                 talloc_free(r);
3392                 return false;
3393         }
3394
3395         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3396         if (p->endian) {
3397                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3398         }
3399         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3400         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3401                 talloc_free(r);
3402                 return false;
3403         }
3404
3405         if (DEBUGLEVEL >= 10) {
3406                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetKeySecurity, NDR_IN, r);
3407         }
3408
3409         ZERO_STRUCT(r->out);
3410         r->out.rpc_status = talloc_zero(r, WERROR);
3411         if (r->out.rpc_status == NULL) {
3412                 talloc_free(r);
3413                 return false;
3414         }
3415
3416         r->out.result = _clusapi_SetKeySecurity(p, r);
3417
3418         if (p->fault_state) {
3419                 talloc_free(r);
3420                 /* Return true here, srv_pipe_hnd.c will take care */
3421                 return true;
3422         }
3423
3424         if (DEBUGLEVEL >= 10) {
3425                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetKeySecurity, NDR_OUT | NDR_SET_VALUES, r);
3426         }
3427
3428         push = ndr_push_init_ctx(r);
3429         if (push == NULL) {
3430                 talloc_free(r);
3431                 return false;
3432         }
3433
3434         /*
3435          * carry over the pointer count to the reply in case we are
3436          * using full pointer. See NDR specification for full pointers
3437          */
3438         push->ptr_count = pull->ptr_count;
3439
3440         ndr_err = call->ndr_push(push, NDR_OUT, r);
3441         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3442                 talloc_free(r);
3443                 return false;
3444         }
3445
3446         p->out_data.rdata = ndr_push_blob(push);
3447         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3448
3449         talloc_free(r);
3450
3451         return true;
3452 }
3453
3454 static bool api_clusapi_GetKeySecurity(struct pipes_struct *p)
3455 {
3456         const struct ndr_interface_call *call;
3457         struct ndr_pull *pull;
3458         struct ndr_push *push;
3459         enum ndr_err_code ndr_err;
3460         struct clusapi_GetKeySecurity *r;
3461
3462         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETKEYSECURITY];
3463
3464         r = talloc(talloc_tos(), struct clusapi_GetKeySecurity);
3465         if (r == NULL) {
3466                 return false;
3467         }
3468
3469         pull = ndr_pull_init_blob(&p->in_data.data, r);
3470         if (pull == NULL) {
3471                 talloc_free(r);
3472                 return false;
3473         }
3474
3475         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3476         if (p->endian) {
3477                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3478         }
3479         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3480         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3481                 talloc_free(r);
3482                 return false;
3483         }
3484
3485         if (DEBUGLEVEL >= 10) {
3486                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetKeySecurity, NDR_IN, r);
3487         }
3488
3489         ZERO_STRUCT(r->out);
3490         r->out.pRpcSecurityDescriptor = r->in.pRpcSecurityDescriptor;
3491         r->out.rpc_status = talloc_zero(r, WERROR);
3492         if (r->out.rpc_status == NULL) {
3493                 talloc_free(r);
3494                 return false;
3495         }
3496
3497         r->out.result = _clusapi_GetKeySecurity(p, r);
3498
3499         if (p->fault_state) {
3500                 talloc_free(r);
3501                 /* Return true here, srv_pipe_hnd.c will take care */
3502                 return true;
3503         }
3504
3505         if (DEBUGLEVEL >= 10) {
3506                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetKeySecurity, NDR_OUT | NDR_SET_VALUES, r);
3507         }
3508
3509         push = ndr_push_init_ctx(r);
3510         if (push == NULL) {
3511                 talloc_free(r);
3512                 return false;
3513         }
3514
3515         /*
3516          * carry over the pointer count to the reply in case we are
3517          * using full pointer. See NDR specification for full pointers
3518          */
3519         push->ptr_count = pull->ptr_count;
3520
3521         ndr_err = call->ndr_push(push, NDR_OUT, r);
3522         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3523                 talloc_free(r);
3524                 return false;
3525         }
3526
3527         p->out_data.rdata = ndr_push_blob(push);
3528         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3529
3530         talloc_free(r);
3531
3532         return true;
3533 }
3534
3535 static bool api_clusapi_OpenGroup(struct pipes_struct *p)
3536 {
3537         const struct ndr_interface_call *call;
3538         struct ndr_pull *pull;
3539         struct ndr_push *push;
3540         enum ndr_err_code ndr_err;
3541         struct clusapi_OpenGroup *r;
3542
3543         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENGROUP];
3544
3545         r = talloc(talloc_tos(), struct clusapi_OpenGroup);
3546         if (r == NULL) {
3547                 return false;
3548         }
3549
3550         pull = ndr_pull_init_blob(&p->in_data.data, r);
3551         if (pull == NULL) {
3552                 talloc_free(r);
3553                 return false;
3554         }
3555
3556         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3557         if (p->endian) {
3558                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3559         }
3560         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3561         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3562                 talloc_free(r);
3563                 return false;
3564         }
3565
3566         if (DEBUGLEVEL >= 10) {
3567                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenGroup, NDR_IN, r);
3568         }
3569
3570         ZERO_STRUCT(r->out);
3571         r->out.Status = talloc_zero(r, WERROR);
3572         if (r->out.Status == NULL) {
3573                 talloc_free(r);
3574                 return false;
3575         }
3576
3577         r->out.rpc_status = talloc_zero(r, WERROR);
3578         if (r->out.rpc_status == NULL) {
3579                 talloc_free(r);
3580                 return false;
3581         }
3582
3583         r->out.hGroup = talloc_zero(r, struct policy_handle);
3584         if (r->out.hGroup == NULL) {
3585                 talloc_free(r);
3586                 return false;
3587         }
3588
3589         _clusapi_OpenGroup(p, r);
3590
3591         if (p->fault_state) {
3592                 talloc_free(r);
3593                 /* Return true here, srv_pipe_hnd.c will take care */
3594                 return true;
3595         }
3596
3597         if (DEBUGLEVEL >= 10) {
3598                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenGroup, NDR_OUT | NDR_SET_VALUES, r);
3599         }
3600
3601         push = ndr_push_init_ctx(r);
3602         if (push == NULL) {
3603                 talloc_free(r);
3604                 return false;
3605         }
3606
3607         /*
3608          * carry over the pointer count to the reply in case we are
3609          * using full pointer. See NDR specification for full pointers
3610          */
3611         push->ptr_count = pull->ptr_count;
3612
3613         ndr_err = call->ndr_push(push, NDR_OUT, r);
3614         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3615                 talloc_free(r);
3616                 return false;
3617         }
3618
3619         p->out_data.rdata = ndr_push_blob(push);
3620         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3621
3622         talloc_free(r);
3623
3624         return true;
3625 }
3626
3627 static bool api_clusapi_CreateGroup(struct pipes_struct *p)
3628 {
3629         const struct ndr_interface_call *call;
3630         struct ndr_pull *pull;
3631         struct ndr_push *push;
3632         enum ndr_err_code ndr_err;
3633         struct clusapi_CreateGroup *r;
3634
3635         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEGROUP];
3636
3637         r = talloc(talloc_tos(), struct clusapi_CreateGroup);
3638         if (r == NULL) {
3639                 return false;
3640         }
3641
3642         pull = ndr_pull_init_blob(&p->in_data.data, r);
3643         if (pull == NULL) {
3644                 talloc_free(r);
3645                 return false;
3646         }
3647
3648         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3649         if (p->endian) {
3650                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3651         }
3652         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3653         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3654                 talloc_free(r);
3655                 return false;
3656         }
3657
3658         if (DEBUGLEVEL >= 10) {
3659                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroup, NDR_IN, r);
3660         }
3661
3662         ZERO_STRUCT(r->out);
3663         r->out.Status = talloc_zero(r, WERROR);
3664         if (r->out.Status == NULL) {
3665                 talloc_free(r);
3666                 return false;
3667         }
3668
3669         r->out.rpc_status = talloc_zero(r, WERROR);
3670         if (r->out.rpc_status == NULL) {
3671                 talloc_free(r);
3672                 return false;
3673         }
3674
3675         r->out.hGroup = talloc_zero(r, struct policy_handle);
3676         if (r->out.hGroup == NULL) {
3677                 talloc_free(r);
3678                 return false;
3679         }
3680
3681         _clusapi_CreateGroup(p, r);
3682
3683         if (p->fault_state) {
3684                 talloc_free(r);
3685                 /* Return true here, srv_pipe_hnd.c will take care */
3686                 return true;
3687         }
3688
3689         if (DEBUGLEVEL >= 10) {
3690                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroup, NDR_OUT | NDR_SET_VALUES, r);
3691         }
3692
3693         push = ndr_push_init_ctx(r);
3694         if (push == NULL) {
3695                 talloc_free(r);
3696                 return false;
3697         }
3698
3699         /*
3700          * carry over the pointer count to the reply in case we are
3701          * using full pointer. See NDR specification for full pointers
3702          */
3703         push->ptr_count = pull->ptr_count;
3704
3705         ndr_err = call->ndr_push(push, NDR_OUT, r);
3706         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3707                 talloc_free(r);
3708                 return false;
3709         }
3710
3711         p->out_data.rdata = ndr_push_blob(push);
3712         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3713
3714         talloc_free(r);
3715
3716         return true;
3717 }
3718
3719 static bool api_clusapi_DeleteGroup(struct pipes_struct *p)
3720 {
3721         const struct ndr_interface_call *call;
3722         struct ndr_pull *pull;
3723         struct ndr_push *push;
3724         enum ndr_err_code ndr_err;
3725         struct clusapi_DeleteGroup *r;
3726
3727         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_DELETEGROUP];
3728
3729         r = talloc(talloc_tos(), struct clusapi_DeleteGroup);
3730         if (r == NULL) {
3731                 return false;
3732         }
3733
3734         pull = ndr_pull_init_blob(&p->in_data.data, r);
3735         if (pull == NULL) {
3736                 talloc_free(r);
3737                 return false;
3738         }
3739
3740         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3741         if (p->endian) {
3742                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3743         }
3744         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3745         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3746                 talloc_free(r);
3747                 return false;
3748         }
3749
3750         if (DEBUGLEVEL >= 10) {
3751                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteGroup, NDR_IN, r);
3752         }
3753
3754         ZERO_STRUCT(r->out);
3755         r->out.rpc_status = talloc_zero(r, WERROR);
3756         if (r->out.rpc_status == NULL) {
3757                 talloc_free(r);
3758                 return false;
3759         }
3760
3761         r->out.result = _clusapi_DeleteGroup(p, r);
3762
3763         if (p->fault_state) {
3764                 talloc_free(r);
3765                 /* Return true here, srv_pipe_hnd.c will take care */
3766                 return true;
3767         }
3768
3769         if (DEBUGLEVEL >= 10) {
3770                 NDR_PRINT_FUNCTION_DEBUG(clusapi_DeleteGroup, NDR_OUT | NDR_SET_VALUES, r);
3771         }
3772
3773         push = ndr_push_init_ctx(r);
3774         if (push == NULL) {
3775                 talloc_free(r);
3776                 return false;
3777         }
3778
3779         /*
3780          * carry over the pointer count to the reply in case we are
3781          * using full pointer. See NDR specification for full pointers
3782          */
3783         push->ptr_count = pull->ptr_count;
3784
3785         ndr_err = call->ndr_push(push, NDR_OUT, r);
3786         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3787                 talloc_free(r);
3788                 return false;
3789         }
3790
3791         p->out_data.rdata = ndr_push_blob(push);
3792         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3793
3794         talloc_free(r);
3795
3796         return true;
3797 }
3798
3799 static bool api_clusapi_CloseGroup(struct pipes_struct *p)
3800 {
3801         const struct ndr_interface_call *call;
3802         struct ndr_pull *pull;
3803         struct ndr_push *push;
3804         enum ndr_err_code ndr_err;
3805         struct clusapi_CloseGroup *r;
3806
3807         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSEGROUP];
3808
3809         r = talloc(talloc_tos(), struct clusapi_CloseGroup);
3810         if (r == NULL) {
3811                 return false;
3812         }
3813
3814         pull = ndr_pull_init_blob(&p->in_data.data, r);
3815         if (pull == NULL) {
3816                 talloc_free(r);
3817                 return false;
3818         }
3819
3820         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3821         if (p->endian) {
3822                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3823         }
3824         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3825         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3826                 talloc_free(r);
3827                 return false;
3828         }
3829
3830         if (DEBUGLEVEL >= 10) {
3831                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseGroup, NDR_IN, r);
3832         }
3833
3834         ZERO_STRUCT(r->out);
3835         r->out.Group = r->in.Group;
3836         r->out.result = _clusapi_CloseGroup(p, r);
3837
3838         if (p->fault_state) {
3839                 talloc_free(r);
3840                 /* Return true here, srv_pipe_hnd.c will take care */
3841                 return true;
3842         }
3843
3844         if (DEBUGLEVEL >= 10) {
3845                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseGroup, NDR_OUT | NDR_SET_VALUES, r);
3846         }
3847
3848         push = ndr_push_init_ctx(r);
3849         if (push == NULL) {
3850                 talloc_free(r);
3851                 return false;
3852         }
3853
3854         /*
3855          * carry over the pointer count to the reply in case we are
3856          * using full pointer. See NDR specification for full pointers
3857          */
3858         push->ptr_count = pull->ptr_count;
3859
3860         ndr_err = call->ndr_push(push, NDR_OUT, r);
3861         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3862                 talloc_free(r);
3863                 return false;
3864         }
3865
3866         p->out_data.rdata = ndr_push_blob(push);
3867         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3868
3869         talloc_free(r);
3870
3871         return true;
3872 }
3873
3874 static bool api_clusapi_GetGroupState(struct pipes_struct *p)
3875 {
3876         const struct ndr_interface_call *call;
3877         struct ndr_pull *pull;
3878         struct ndr_push *push;
3879         enum ndr_err_code ndr_err;
3880         struct clusapi_GetGroupState *r;
3881
3882         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETGROUPSTATE];
3883
3884         r = talloc(talloc_tos(), struct clusapi_GetGroupState);
3885         if (r == NULL) {
3886                 return false;
3887         }
3888
3889         pull = ndr_pull_init_blob(&p->in_data.data, r);
3890         if (pull == NULL) {
3891                 talloc_free(r);
3892                 return false;
3893         }
3894
3895         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3896         if (p->endian) {
3897                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3898         }
3899         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3900         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3901                 talloc_free(r);
3902                 return false;
3903         }
3904
3905         if (DEBUGLEVEL >= 10) {
3906                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetGroupState, NDR_IN, r);
3907         }
3908
3909         ZERO_STRUCT(r->out);
3910         r->out.State = talloc_zero(r, enum clusapi_ClusterGroupState);
3911         if (r->out.State == NULL) {
3912                 talloc_free(r);
3913                 return false;
3914         }
3915
3916         r->out.NodeName = talloc_zero(r, const char *);
3917         if (r->out.NodeName == NULL) {
3918                 talloc_free(r);
3919                 return false;
3920         }
3921
3922         r->out.rpc_status = talloc_zero(r, WERROR);
3923         if (r->out.rpc_status == NULL) {
3924                 talloc_free(r);
3925                 return false;
3926         }
3927
3928         r->out.result = _clusapi_GetGroupState(p, r);
3929
3930         if (p->fault_state) {
3931                 talloc_free(r);
3932                 /* Return true here, srv_pipe_hnd.c will take care */
3933                 return true;
3934         }
3935
3936         if (DEBUGLEVEL >= 10) {
3937                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetGroupState, NDR_OUT | NDR_SET_VALUES, r);
3938         }
3939
3940         push = ndr_push_init_ctx(r);
3941         if (push == NULL) {
3942                 talloc_free(r);
3943                 return false;
3944         }
3945
3946         /*
3947          * carry over the pointer count to the reply in case we are
3948          * using full pointer. See NDR specification for full pointers
3949          */
3950         push->ptr_count = pull->ptr_count;
3951
3952         ndr_err = call->ndr_push(push, NDR_OUT, r);
3953         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3954                 talloc_free(r);
3955                 return false;
3956         }
3957
3958         p->out_data.rdata = ndr_push_blob(push);
3959         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
3960
3961         talloc_free(r);
3962
3963         return true;
3964 }
3965
3966 static bool api_clusapi_SetGroupName(struct pipes_struct *p)
3967 {
3968         const struct ndr_interface_call *call;
3969         struct ndr_pull *pull;
3970         struct ndr_push *push;
3971         enum ndr_err_code ndr_err;
3972         struct clusapi_SetGroupName *r;
3973
3974         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETGROUPNAME];
3975
3976         r = talloc(talloc_tos(), struct clusapi_SetGroupName);
3977         if (r == NULL) {
3978                 return false;
3979         }
3980
3981         pull = ndr_pull_init_blob(&p->in_data.data, r);
3982         if (pull == NULL) {
3983                 talloc_free(r);
3984                 return false;
3985         }
3986
3987         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3988         if (p->endian) {
3989                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
3990         }
3991         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3992         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3993                 talloc_free(r);
3994                 return false;
3995         }
3996
3997         if (DEBUGLEVEL >= 10) {
3998                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetGroupName, NDR_IN, r);
3999         }
4000
4001         ZERO_STRUCT(r->out);
4002         r->out.rpc_status = talloc_zero(r, WERROR);
4003         if (r->out.rpc_status == NULL) {
4004                 talloc_free(r);
4005                 return false;
4006         }
4007
4008         r->out.result = _clusapi_SetGroupName(p, r);
4009
4010         if (p->fault_state) {
4011                 talloc_free(r);
4012                 /* Return true here, srv_pipe_hnd.c will take care */
4013                 return true;
4014         }
4015
4016         if (DEBUGLEVEL >= 10) {
4017                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetGroupName, NDR_OUT | NDR_SET_VALUES, r);
4018         }
4019
4020         push = ndr_push_init_ctx(r);
4021         if (push == NULL) {
4022                 talloc_free(r);
4023                 return false;
4024         }
4025
4026         /*
4027          * carry over the pointer count to the reply in case we are
4028          * using full pointer. See NDR specification for full pointers
4029          */
4030         push->ptr_count = pull->ptr_count;
4031
4032         ndr_err = call->ndr_push(push, NDR_OUT, r);
4033         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4034                 talloc_free(r);
4035                 return false;
4036         }
4037
4038         p->out_data.rdata = ndr_push_blob(push);
4039         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4040
4041         talloc_free(r);
4042
4043         return true;
4044 }
4045
4046 static bool api_clusapi_GetGroupId(struct pipes_struct *p)
4047 {
4048         const struct ndr_interface_call *call;
4049         struct ndr_pull *pull;
4050         struct ndr_push *push;
4051         enum ndr_err_code ndr_err;
4052         struct clusapi_GetGroupId *r;
4053
4054         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETGROUPID];
4055
4056         r = talloc(talloc_tos(), struct clusapi_GetGroupId);
4057         if (r == NULL) {
4058                 return false;
4059         }
4060
4061         pull = ndr_pull_init_blob(&p->in_data.data, r);
4062         if (pull == NULL) {
4063                 talloc_free(r);
4064                 return false;
4065         }
4066
4067         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4068         if (p->endian) {
4069                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4070         }
4071         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4072         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4073                 talloc_free(r);
4074                 return false;
4075         }
4076
4077         if (DEBUGLEVEL >= 10) {
4078                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetGroupId, NDR_IN, r);
4079         }
4080
4081         ZERO_STRUCT(r->out);
4082         r->out.pGuid = talloc_zero(r, const char *);
4083         if (r->out.pGuid == NULL) {
4084                 talloc_free(r);
4085                 return false;
4086         }
4087
4088         r->out.rpc_status = talloc_zero(r, WERROR);
4089         if (r->out.rpc_status == NULL) {
4090                 talloc_free(r);
4091                 return false;
4092         }
4093
4094         r->out.result = _clusapi_GetGroupId(p, r);
4095
4096         if (p->fault_state) {
4097                 talloc_free(r);
4098                 /* Return true here, srv_pipe_hnd.c will take care */
4099                 return true;
4100         }
4101
4102         if (DEBUGLEVEL >= 10) {
4103                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetGroupId, NDR_OUT | NDR_SET_VALUES, r);
4104         }
4105
4106         push = ndr_push_init_ctx(r);
4107         if (push == NULL) {
4108                 talloc_free(r);
4109                 return false;
4110         }
4111
4112         /*
4113          * carry over the pointer count to the reply in case we are
4114          * using full pointer. See NDR specification for full pointers
4115          */
4116         push->ptr_count = pull->ptr_count;
4117
4118         ndr_err = call->ndr_push(push, NDR_OUT, r);
4119         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4120                 talloc_free(r);
4121                 return false;
4122         }
4123
4124         p->out_data.rdata = ndr_push_blob(push);
4125         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4126
4127         talloc_free(r);
4128
4129         return true;
4130 }
4131
4132 static bool api_clusapi_GetNodeId(struct pipes_struct *p)
4133 {
4134         const struct ndr_interface_call *call;
4135         struct ndr_pull *pull;
4136         struct ndr_push *push;
4137         enum ndr_err_code ndr_err;
4138         struct clusapi_GetNodeId *r;
4139
4140         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNODEID];
4141
4142         r = talloc(talloc_tos(), struct clusapi_GetNodeId);
4143         if (r == NULL) {
4144                 return false;
4145         }
4146
4147         pull = ndr_pull_init_blob(&p->in_data.data, r);
4148         if (pull == NULL) {
4149                 talloc_free(r);
4150                 return false;
4151         }
4152
4153         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4154         if (p->endian) {
4155                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4156         }
4157         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4158         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4159                 talloc_free(r);
4160                 return false;
4161         }
4162
4163         if (DEBUGLEVEL >= 10) {
4164                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNodeId, NDR_IN, r);
4165         }
4166
4167         ZERO_STRUCT(r->out);
4168         r->out.pGuid = talloc_zero(r, const char *);
4169         if (r->out.pGuid == NULL) {
4170                 talloc_free(r);
4171                 return false;
4172         }
4173
4174         r->out.rpc_status = talloc_zero(r, WERROR);
4175         if (r->out.rpc_status == NULL) {
4176                 talloc_free(r);
4177                 return false;
4178         }
4179
4180         r->out.result = _clusapi_GetNodeId(p, r);
4181
4182         if (p->fault_state) {
4183                 talloc_free(r);
4184                 /* Return true here, srv_pipe_hnd.c will take care */
4185                 return true;
4186         }
4187
4188         if (DEBUGLEVEL >= 10) {
4189                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNodeId, NDR_OUT | NDR_SET_VALUES, r);
4190         }
4191
4192         push = ndr_push_init_ctx(r);
4193         if (push == NULL) {
4194                 talloc_free(r);
4195                 return false;
4196         }
4197
4198         /*
4199          * carry over the pointer count to the reply in case we are
4200          * using full pointer. See NDR specification for full pointers
4201          */
4202         push->ptr_count = pull->ptr_count;
4203
4204         ndr_err = call->ndr_push(push, NDR_OUT, r);
4205         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4206                 talloc_free(r);
4207                 return false;
4208         }
4209
4210         p->out_data.rdata = ndr_push_blob(push);
4211         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4212
4213         talloc_free(r);
4214
4215         return true;
4216 }
4217
4218 static bool api_clusapi_OnlineGroup(struct pipes_struct *p)
4219 {
4220         const struct ndr_interface_call *call;
4221         struct ndr_pull *pull;
4222         struct ndr_push *push;
4223         enum ndr_err_code ndr_err;
4224         struct clusapi_OnlineGroup *r;
4225
4226         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ONLINEGROUP];
4227
4228         r = talloc(talloc_tos(), struct clusapi_OnlineGroup);
4229         if (r == NULL) {
4230                 return false;
4231         }
4232
4233         pull = ndr_pull_init_blob(&p->in_data.data, r);
4234         if (pull == NULL) {
4235                 talloc_free(r);
4236                 return false;
4237         }
4238
4239         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4240         if (p->endian) {
4241                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4242         }
4243         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4244         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4245                 talloc_free(r);
4246                 return false;
4247         }
4248
4249         if (DEBUGLEVEL >= 10) {
4250                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineGroup, NDR_IN, r);
4251         }
4252
4253         ZERO_STRUCT(r->out);
4254         r->out.rpc_status = talloc_zero(r, WERROR);
4255         if (r->out.rpc_status == NULL) {
4256                 talloc_free(r);
4257                 return false;
4258         }
4259
4260         r->out.result = _clusapi_OnlineGroup(p, r);
4261
4262         if (p->fault_state) {
4263                 talloc_free(r);
4264                 /* Return true here, srv_pipe_hnd.c will take care */
4265                 return true;
4266         }
4267
4268         if (DEBUGLEVEL >= 10) {
4269                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineGroup, NDR_OUT | NDR_SET_VALUES, r);
4270         }
4271
4272         push = ndr_push_init_ctx(r);
4273         if (push == NULL) {
4274                 talloc_free(r);
4275                 return false;
4276         }
4277
4278         /*
4279          * carry over the pointer count to the reply in case we are
4280          * using full pointer. See NDR specification for full pointers
4281          */
4282         push->ptr_count = pull->ptr_count;
4283
4284         ndr_err = call->ndr_push(push, NDR_OUT, r);
4285         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4286                 talloc_free(r);
4287                 return false;
4288         }
4289
4290         p->out_data.rdata = ndr_push_blob(push);
4291         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4292
4293         talloc_free(r);
4294
4295         return true;
4296 }
4297
4298 static bool api_clusapi_OfflineGroup(struct pipes_struct *p)
4299 {
4300         const struct ndr_interface_call *call;
4301         struct ndr_pull *pull;
4302         struct ndr_push *push;
4303         enum ndr_err_code ndr_err;
4304         struct clusapi_OfflineGroup *r;
4305
4306         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OFFLINEGROUP];
4307
4308         r = talloc(talloc_tos(), struct clusapi_OfflineGroup);
4309         if (r == NULL) {
4310                 return false;
4311         }
4312
4313         pull = ndr_pull_init_blob(&p->in_data.data, r);
4314         if (pull == NULL) {
4315                 talloc_free(r);
4316                 return false;
4317         }
4318
4319         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4320         if (p->endian) {
4321                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4322         }
4323         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4324         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4325                 talloc_free(r);
4326                 return false;
4327         }
4328
4329         if (DEBUGLEVEL >= 10) {
4330                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineGroup, NDR_IN, r);
4331         }
4332
4333         ZERO_STRUCT(r->out);
4334         r->out.rpc_status = talloc_zero(r, WERROR);
4335         if (r->out.rpc_status == NULL) {
4336                 talloc_free(r);
4337                 return false;
4338         }
4339
4340         r->out.result = _clusapi_OfflineGroup(p, r);
4341
4342         if (p->fault_state) {
4343                 talloc_free(r);
4344                 /* Return true here, srv_pipe_hnd.c will take care */
4345                 return true;
4346         }
4347
4348         if (DEBUGLEVEL >= 10) {
4349                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineGroup, NDR_OUT | NDR_SET_VALUES, r);
4350         }
4351
4352         push = ndr_push_init_ctx(r);
4353         if (push == NULL) {
4354                 talloc_free(r);
4355                 return false;
4356         }
4357
4358         /*
4359          * carry over the pointer count to the reply in case we are
4360          * using full pointer. See NDR specification for full pointers
4361          */
4362         push->ptr_count = pull->ptr_count;
4363
4364         ndr_err = call->ndr_push(push, NDR_OUT, r);
4365         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4366                 talloc_free(r);
4367                 return false;
4368         }
4369
4370         p->out_data.rdata = ndr_push_blob(push);
4371         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4372
4373         talloc_free(r);
4374
4375         return true;
4376 }
4377
4378 static bool api_clusapi_MoveGroup(struct pipes_struct *p)
4379 {
4380         const struct ndr_interface_call *call;
4381         struct ndr_pull *pull;
4382         struct ndr_push *push;
4383         enum ndr_err_code ndr_err;
4384         struct clusapi_MoveGroup *r;
4385
4386         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_MOVEGROUP];
4387
4388         r = talloc(talloc_tos(), struct clusapi_MoveGroup);
4389         if (r == NULL) {
4390                 return false;
4391         }
4392
4393         pull = ndr_pull_init_blob(&p->in_data.data, r);
4394         if (pull == NULL) {
4395                 talloc_free(r);
4396                 return false;
4397         }
4398
4399         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4400         if (p->endian) {
4401                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4402         }
4403         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4404         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4405                 talloc_free(r);
4406                 return false;
4407         }
4408
4409         if (DEBUGLEVEL >= 10) {
4410                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroup, NDR_IN, r);
4411         }
4412
4413         ZERO_STRUCT(r->out);
4414         r->out.rpc_status = talloc_zero(r, WERROR);
4415         if (r->out.rpc_status == NULL) {
4416                 talloc_free(r);
4417                 return false;
4418         }
4419
4420         r->out.result = _clusapi_MoveGroup(p, r);
4421
4422         if (p->fault_state) {
4423                 talloc_free(r);
4424                 /* Return true here, srv_pipe_hnd.c will take care */
4425                 return true;
4426         }
4427
4428         if (DEBUGLEVEL >= 10) {
4429                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroup, NDR_OUT | NDR_SET_VALUES, r);
4430         }
4431
4432         push = ndr_push_init_ctx(r);
4433         if (push == NULL) {
4434                 talloc_free(r);
4435                 return false;
4436         }
4437
4438         /*
4439          * carry over the pointer count to the reply in case we are
4440          * using full pointer. See NDR specification for full pointers
4441          */
4442         push->ptr_count = pull->ptr_count;
4443
4444         ndr_err = call->ndr_push(push, NDR_OUT, r);
4445         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4446                 talloc_free(r);
4447                 return false;
4448         }
4449
4450         p->out_data.rdata = ndr_push_blob(push);
4451         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4452
4453         talloc_free(r);
4454
4455         return true;
4456 }
4457
4458 static bool api_clusapi_MoveGroupToNode(struct pipes_struct *p)
4459 {
4460         const struct ndr_interface_call *call;
4461         struct ndr_pull *pull;
4462         struct ndr_push *push;
4463         enum ndr_err_code ndr_err;
4464         struct clusapi_MoveGroupToNode *r;
4465
4466         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_MOVEGROUPTONODE];
4467
4468         r = talloc(talloc_tos(), struct clusapi_MoveGroupToNode);
4469         if (r == NULL) {
4470                 return false;
4471         }
4472
4473         pull = ndr_pull_init_blob(&p->in_data.data, r);
4474         if (pull == NULL) {
4475                 talloc_free(r);
4476                 return false;
4477         }
4478
4479         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4480         if (p->endian) {
4481                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4482         }
4483         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4484         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4485                 talloc_free(r);
4486                 return false;
4487         }
4488
4489         if (DEBUGLEVEL >= 10) {
4490                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroupToNode, NDR_IN, r);
4491         }
4492
4493         ZERO_STRUCT(r->out);
4494         r->out.rpc_status = talloc_zero(r, WERROR);
4495         if (r->out.rpc_status == NULL) {
4496                 talloc_free(r);
4497                 return false;
4498         }
4499
4500         r->out.result = _clusapi_MoveGroupToNode(p, r);
4501
4502         if (p->fault_state) {
4503                 talloc_free(r);
4504                 /* Return true here, srv_pipe_hnd.c will take care */
4505                 return true;
4506         }
4507
4508         if (DEBUGLEVEL >= 10) {
4509                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroupToNode, NDR_OUT | NDR_SET_VALUES, r);
4510         }
4511
4512         push = ndr_push_init_ctx(r);
4513         if (push == NULL) {
4514                 talloc_free(r);
4515                 return false;
4516         }
4517
4518         /*
4519          * carry over the pointer count to the reply in case we are
4520          * using full pointer. See NDR specification for full pointers
4521          */
4522         push->ptr_count = pull->ptr_count;
4523
4524         ndr_err = call->ndr_push(push, NDR_OUT, r);
4525         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4526                 talloc_free(r);
4527                 return false;
4528         }
4529
4530         p->out_data.rdata = ndr_push_blob(push);
4531         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4532
4533         talloc_free(r);
4534
4535         return true;
4536 }
4537
4538 static bool api_clusapi_CreateGroupResourceEnum(struct pipes_struct *p)
4539 {
4540         const struct ndr_interface_call *call;
4541         struct ndr_pull *pull;
4542         struct ndr_push *push;
4543         enum ndr_err_code ndr_err;
4544         struct clusapi_CreateGroupResourceEnum *r;
4545
4546         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEGROUPRESOURCEENUM];
4547
4548         r = talloc(talloc_tos(), struct clusapi_CreateGroupResourceEnum);
4549         if (r == NULL) {
4550                 return false;
4551         }
4552
4553         pull = ndr_pull_init_blob(&p->in_data.data, r);
4554         if (pull == NULL) {
4555                 talloc_free(r);
4556                 return false;
4557         }
4558
4559         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4560         if (p->endian) {
4561                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4562         }
4563         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4564         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4565                 talloc_free(r);
4566                 return false;
4567         }
4568
4569         if (DEBUGLEVEL >= 10) {
4570                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroupResourceEnum, NDR_IN, r);
4571         }
4572
4573         ZERO_STRUCT(r->out);
4574         r->out.ReturnEnum = talloc_zero(r, struct ENUM_LIST *);
4575         if (r->out.ReturnEnum == NULL) {
4576                 talloc_free(r);
4577                 return false;
4578         }
4579
4580         r->out.rpc_status = talloc_zero(r, WERROR);
4581         if (r->out.rpc_status == NULL) {
4582                 talloc_free(r);
4583                 return false;
4584         }
4585
4586         r->out.result = _clusapi_CreateGroupResourceEnum(p, r);
4587
4588         if (p->fault_state) {
4589                 talloc_free(r);
4590                 /* Return true here, srv_pipe_hnd.c will take care */
4591                 return true;
4592         }
4593
4594         if (DEBUGLEVEL >= 10) {
4595                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroupResourceEnum, NDR_OUT | NDR_SET_VALUES, r);
4596         }
4597
4598         push = ndr_push_init_ctx(r);
4599         if (push == NULL) {
4600                 talloc_free(r);
4601                 return false;
4602         }
4603
4604         /*
4605          * carry over the pointer count to the reply in case we are
4606          * using full pointer. See NDR specification for full pointers
4607          */
4608         push->ptr_count = pull->ptr_count;
4609
4610         ndr_err = call->ndr_push(push, NDR_OUT, r);
4611         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4612                 talloc_free(r);
4613                 return false;
4614         }
4615
4616         p->out_data.rdata = ndr_push_blob(push);
4617         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4618
4619         talloc_free(r);
4620
4621         return true;
4622 }
4623
4624 static bool api_clusapi_SetGroupNodeList(struct pipes_struct *p)
4625 {
4626         const struct ndr_interface_call *call;
4627         struct ndr_pull *pull;
4628         struct ndr_push *push;
4629         enum ndr_err_code ndr_err;
4630         struct clusapi_SetGroupNodeList *r;
4631
4632         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETGROUPNODELIST];
4633
4634         r = talloc(talloc_tos(), struct clusapi_SetGroupNodeList);
4635         if (r == NULL) {
4636                 return false;
4637         }
4638
4639         pull = ndr_pull_init_blob(&p->in_data.data, r);
4640         if (pull == NULL) {
4641                 talloc_free(r);
4642                 return false;
4643         }
4644
4645         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4646         if (p->endian) {
4647                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4648         }
4649         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4650         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4651                 talloc_free(r);
4652                 return false;
4653         }
4654
4655         if (DEBUGLEVEL >= 10) {
4656                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetGroupNodeList, NDR_IN, r);
4657         }
4658
4659         ZERO_STRUCT(r->out);
4660         r->out.rpc_status = talloc_zero(r, WERROR);
4661         if (r->out.rpc_status == NULL) {
4662                 talloc_free(r);
4663                 return false;
4664         }
4665
4666         r->out.result = _clusapi_SetGroupNodeList(p, r);
4667
4668         if (p->fault_state) {
4669                 talloc_free(r);
4670                 /* Return true here, srv_pipe_hnd.c will take care */
4671                 return true;
4672         }
4673
4674         if (DEBUGLEVEL >= 10) {
4675                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetGroupNodeList, NDR_OUT | NDR_SET_VALUES, r);
4676         }
4677
4678         push = ndr_push_init_ctx(r);
4679         if (push == NULL) {
4680                 talloc_free(r);
4681                 return false;
4682         }
4683
4684         /*
4685          * carry over the pointer count to the reply in case we are
4686          * using full pointer. See NDR specification for full pointers
4687          */
4688         push->ptr_count = pull->ptr_count;
4689
4690         ndr_err = call->ndr_push(push, NDR_OUT, r);
4691         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4692                 talloc_free(r);
4693                 return false;
4694         }
4695
4696         p->out_data.rdata = ndr_push_blob(push);
4697         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4698
4699         talloc_free(r);
4700
4701         return true;
4702 }
4703
4704 static bool api_clusapi_CreateNotify(struct pipes_struct *p)
4705 {
4706         const struct ndr_interface_call *call;
4707         struct ndr_pull *pull;
4708         struct ndr_push *push;
4709         enum ndr_err_code ndr_err;
4710         struct clusapi_CreateNotify *r;
4711
4712         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATENOTIFY];
4713
4714         r = talloc(talloc_tos(), struct clusapi_CreateNotify);
4715         if (r == NULL) {
4716                 return false;
4717         }
4718
4719         pull = ndr_pull_init_blob(&p->in_data.data, r);
4720         if (pull == NULL) {
4721                 talloc_free(r);
4722                 return false;
4723         }
4724
4725         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4726         if (p->endian) {
4727                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4728         }
4729         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4730         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4731                 talloc_free(r);
4732                 return false;
4733         }
4734
4735         if (DEBUGLEVEL >= 10) {
4736                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNotify, NDR_IN, r);
4737         }
4738
4739         ZERO_STRUCT(r->out);
4740         r->out.Status = talloc_zero(r, WERROR);
4741         if (r->out.Status == NULL) {
4742                 talloc_free(r);
4743                 return false;
4744         }
4745
4746         r->out.rpc_status = talloc_zero(r, WERROR);
4747         if (r->out.rpc_status == NULL) {
4748                 talloc_free(r);
4749                 return false;
4750         }
4751
4752         r->out.hNotify = talloc_zero(r, struct policy_handle);
4753         if (r->out.hNotify == NULL) {
4754                 talloc_free(r);
4755                 return false;
4756         }
4757
4758         _clusapi_CreateNotify(p, r);
4759
4760         if (p->fault_state) {
4761                 talloc_free(r);
4762                 /* Return true here, srv_pipe_hnd.c will take care */
4763                 return true;
4764         }
4765
4766         if (DEBUGLEVEL >= 10) {
4767                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNotify, NDR_OUT | NDR_SET_VALUES, r);
4768         }
4769
4770         push = ndr_push_init_ctx(r);
4771         if (push == NULL) {
4772                 talloc_free(r);
4773                 return false;
4774         }
4775
4776         /*
4777          * carry over the pointer count to the reply in case we are
4778          * using full pointer. See NDR specification for full pointers
4779          */
4780         push->ptr_count = pull->ptr_count;
4781
4782         ndr_err = call->ndr_push(push, NDR_OUT, r);
4783         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4784                 talloc_free(r);
4785                 return false;
4786         }
4787
4788         p->out_data.rdata = ndr_push_blob(push);
4789         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4790
4791         talloc_free(r);
4792
4793         return true;
4794 }
4795
4796 static bool api_clusapi_CloseNotify(struct pipes_struct *p)
4797 {
4798         const struct ndr_interface_call *call;
4799         struct ndr_pull *pull;
4800         struct ndr_push *push;
4801         enum ndr_err_code ndr_err;
4802         struct clusapi_CloseNotify *r;
4803
4804         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSENOTIFY];
4805
4806         r = talloc(talloc_tos(), struct clusapi_CloseNotify);
4807         if (r == NULL) {
4808                 return false;
4809         }
4810
4811         pull = ndr_pull_init_blob(&p->in_data.data, r);
4812         if (pull == NULL) {
4813                 talloc_free(r);
4814                 return false;
4815         }
4816
4817         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4818         if (p->endian) {
4819                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4820         }
4821         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4822         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4823                 talloc_free(r);
4824                 return false;
4825         }
4826
4827         if (DEBUGLEVEL >= 10) {
4828                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNotify, NDR_IN, r);
4829         }
4830
4831         ZERO_STRUCT(r->out);
4832         r->out.Notify = r->in.Notify;
4833         r->out.result = _clusapi_CloseNotify(p, r);
4834
4835         if (p->fault_state) {
4836                 talloc_free(r);
4837                 /* Return true here, srv_pipe_hnd.c will take care */
4838                 return true;
4839         }
4840
4841         if (DEBUGLEVEL >= 10) {
4842                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNotify, NDR_OUT | NDR_SET_VALUES, r);
4843         }
4844
4845         push = ndr_push_init_ctx(r);
4846         if (push == NULL) {
4847                 talloc_free(r);
4848                 return false;
4849         }
4850
4851         /*
4852          * carry over the pointer count to the reply in case we are
4853          * using full pointer. See NDR specification for full pointers
4854          */
4855         push->ptr_count = pull->ptr_count;
4856
4857         ndr_err = call->ndr_push(push, NDR_OUT, r);
4858         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4859                 talloc_free(r);
4860                 return false;
4861         }
4862
4863         p->out_data.rdata = ndr_push_blob(push);
4864         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4865
4866         talloc_free(r);
4867
4868         return true;
4869 }
4870
4871 static bool api_clusapi_AddNotifyCluster(struct pipes_struct *p)
4872 {
4873         const struct ndr_interface_call *call;
4874         struct ndr_pull *pull;
4875         struct ndr_push *push;
4876         enum ndr_err_code ndr_err;
4877         struct clusapi_AddNotifyCluster *r;
4878
4879         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYCLUSTER];
4880
4881         r = talloc(talloc_tos(), struct clusapi_AddNotifyCluster);
4882         if (r == NULL) {
4883                 return false;
4884         }
4885
4886         pull = ndr_pull_init_blob(&p->in_data.data, r);
4887         if (pull == NULL) {
4888                 talloc_free(r);
4889                 return false;
4890         }
4891
4892         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4893         if (p->endian) {
4894                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4895         }
4896         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4897         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4898                 talloc_free(r);
4899                 return false;
4900         }
4901
4902         if (DEBUGLEVEL >= 10) {
4903                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyCluster, NDR_IN, r);
4904         }
4905
4906         ZERO_STRUCT(r->out);
4907         r->out.rpc_status = talloc_zero(r, WERROR);
4908         if (r->out.rpc_status == NULL) {
4909                 talloc_free(r);
4910                 return false;
4911         }
4912
4913         r->out.result = _clusapi_AddNotifyCluster(p, r);
4914
4915         if (p->fault_state) {
4916                 talloc_free(r);
4917                 /* Return true here, srv_pipe_hnd.c will take care */
4918                 return true;
4919         }
4920
4921         if (DEBUGLEVEL >= 10) {
4922                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyCluster, NDR_OUT | NDR_SET_VALUES, r);
4923         }
4924
4925         push = ndr_push_init_ctx(r);
4926         if (push == NULL) {
4927                 talloc_free(r);
4928                 return false;
4929         }
4930
4931         /*
4932          * carry over the pointer count to the reply in case we are
4933          * using full pointer. See NDR specification for full pointers
4934          */
4935         push->ptr_count = pull->ptr_count;
4936
4937         ndr_err = call->ndr_push(push, NDR_OUT, r);
4938         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4939                 talloc_free(r);
4940                 return false;
4941         }
4942
4943         p->out_data.rdata = ndr_push_blob(push);
4944         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
4945
4946         talloc_free(r);
4947
4948         return true;
4949 }
4950
4951 static bool api_clusapi_AddNotifyNode(struct pipes_struct *p)
4952 {
4953         const struct ndr_interface_call *call;
4954         struct ndr_pull *pull;
4955         struct ndr_push *push;
4956         enum ndr_err_code ndr_err;
4957         struct clusapi_AddNotifyNode *r;
4958
4959         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYNODE];
4960
4961         r = talloc(talloc_tos(), struct clusapi_AddNotifyNode);
4962         if (r == NULL) {
4963                 return false;
4964         }
4965
4966         pull = ndr_pull_init_blob(&p->in_data.data, r);
4967         if (pull == NULL) {
4968                 talloc_free(r);
4969                 return false;
4970         }
4971
4972         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4973         if (p->endian) {
4974                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
4975         }
4976         ndr_err = call->ndr_pull(pull, NDR_IN, r);
4977         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4978                 talloc_free(r);
4979                 return false;
4980         }
4981
4982         if (DEBUGLEVEL >= 10) {
4983                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyNode, NDR_IN, r);
4984         }
4985
4986         ZERO_STRUCT(r->out);
4987         r->out.dwStateSequence = talloc_zero(r, uint32_t);
4988         if (r->out.dwStateSequence == NULL) {
4989                 talloc_free(r);
4990                 return false;
4991         }
4992
4993         r->out.rpc_status = talloc_zero(r, WERROR);
4994         if (r->out.rpc_status == NULL) {
4995                 talloc_free(r);
4996                 return false;
4997         }
4998
4999         r->out.result = _clusapi_AddNotifyNode(p, r);
5000
5001         if (p->fault_state) {
5002                 talloc_free(r);
5003                 /* Return true here, srv_pipe_hnd.c will take care */
5004                 return true;
5005         }
5006
5007         if (DEBUGLEVEL >= 10) {
5008                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyNode, NDR_OUT | NDR_SET_VALUES, r);
5009         }
5010
5011         push = ndr_push_init_ctx(r);
5012         if (push == NULL) {
5013                 talloc_free(r);
5014                 return false;
5015         }
5016
5017         /*
5018          * carry over the pointer count to the reply in case we are
5019          * using full pointer. See NDR specification for full pointers
5020          */
5021         push->ptr_count = pull->ptr_count;
5022
5023         ndr_err = call->ndr_push(push, NDR_OUT, r);
5024         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5025                 talloc_free(r);
5026                 return false;
5027         }
5028
5029         p->out_data.rdata = ndr_push_blob(push);
5030         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5031
5032         talloc_free(r);
5033
5034         return true;
5035 }
5036
5037 static bool api_clusapi_AddNotifyGroup(struct pipes_struct *p)
5038 {
5039         const struct ndr_interface_call *call;
5040         struct ndr_pull *pull;
5041         struct ndr_push *push;
5042         enum ndr_err_code ndr_err;
5043         struct clusapi_AddNotifyGroup *r;
5044
5045         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYGROUP];
5046
5047         r = talloc(talloc_tos(), struct clusapi_AddNotifyGroup);
5048         if (r == NULL) {
5049                 return false;
5050         }
5051
5052         pull = ndr_pull_init_blob(&p->in_data.data, r);
5053         if (pull == NULL) {
5054                 talloc_free(r);
5055                 return false;
5056         }
5057
5058         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5059         if (p->endian) {
5060                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5061         }
5062         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5063         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5064                 talloc_free(r);
5065                 return false;
5066         }
5067
5068         if (DEBUGLEVEL >= 10) {
5069                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyGroup, NDR_IN, r);
5070         }
5071
5072         ZERO_STRUCT(r->out);
5073         r->out.dwStateSequence = talloc_zero(r, uint32_t);
5074         if (r->out.dwStateSequence == NULL) {
5075                 talloc_free(r);
5076                 return false;
5077         }
5078
5079         r->out.rpc_status = talloc_zero(r, WERROR);
5080         if (r->out.rpc_status == NULL) {
5081                 talloc_free(r);
5082                 return false;
5083         }
5084
5085         r->out.result = _clusapi_AddNotifyGroup(p, r);
5086
5087         if (p->fault_state) {
5088                 talloc_free(r);
5089                 /* Return true here, srv_pipe_hnd.c will take care */
5090                 return true;
5091         }
5092
5093         if (DEBUGLEVEL >= 10) {
5094                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyGroup, NDR_OUT | NDR_SET_VALUES, r);
5095         }
5096
5097         push = ndr_push_init_ctx(r);
5098         if (push == NULL) {
5099                 talloc_free(r);
5100                 return false;
5101         }
5102
5103         /*
5104          * carry over the pointer count to the reply in case we are
5105          * using full pointer. See NDR specification for full pointers
5106          */
5107         push->ptr_count = pull->ptr_count;
5108
5109         ndr_err = call->ndr_push(push, NDR_OUT, r);
5110         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5111                 talloc_free(r);
5112                 return false;
5113         }
5114
5115         p->out_data.rdata = ndr_push_blob(push);
5116         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5117
5118         talloc_free(r);
5119
5120         return true;
5121 }
5122
5123 static bool api_clusapi_AddNotifyResource(struct pipes_struct *p)
5124 {
5125         const struct ndr_interface_call *call;
5126         struct ndr_pull *pull;
5127         struct ndr_push *push;
5128         enum ndr_err_code ndr_err;
5129         struct clusapi_AddNotifyResource *r;
5130
5131         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYRESOURCE];
5132
5133         r = talloc(talloc_tos(), struct clusapi_AddNotifyResource);
5134         if (r == NULL) {
5135                 return false;
5136         }
5137
5138         pull = ndr_pull_init_blob(&p->in_data.data, r);
5139         if (pull == NULL) {
5140                 talloc_free(r);
5141                 return false;
5142         }
5143
5144         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5145         if (p->endian) {
5146                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5147         }
5148         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5149         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5150                 talloc_free(r);
5151                 return false;
5152         }
5153
5154         if (DEBUGLEVEL >= 10) {
5155                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyResource, NDR_IN, r);
5156         }
5157
5158         ZERO_STRUCT(r->out);
5159         r->out.dwStateSequence = talloc_zero(r, uint32_t);
5160         if (r->out.dwStateSequence == NULL) {
5161                 talloc_free(r);
5162                 return false;
5163         }
5164
5165         r->out.rpc_status = talloc_zero(r, WERROR);
5166         if (r->out.rpc_status == NULL) {
5167                 talloc_free(r);
5168                 return false;
5169         }
5170
5171         r->out.result = _clusapi_AddNotifyResource(p, r);
5172
5173         if (p->fault_state) {
5174                 talloc_free(r);
5175                 /* Return true here, srv_pipe_hnd.c will take care */
5176                 return true;
5177         }
5178
5179         if (DEBUGLEVEL >= 10) {
5180                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyResource, NDR_OUT | NDR_SET_VALUES, r);
5181         }
5182
5183         push = ndr_push_init_ctx(r);
5184         if (push == NULL) {
5185                 talloc_free(r);
5186                 return false;
5187         }
5188
5189         /*
5190          * carry over the pointer count to the reply in case we are
5191          * using full pointer. See NDR specification for full pointers
5192          */
5193         push->ptr_count = pull->ptr_count;
5194
5195         ndr_err = call->ndr_push(push, NDR_OUT, r);
5196         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5197                 talloc_free(r);
5198                 return false;
5199         }
5200
5201         p->out_data.rdata = ndr_push_blob(push);
5202         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5203
5204         talloc_free(r);
5205
5206         return true;
5207 }
5208
5209 static bool api_clusapi_AddNotifyKey(struct pipes_struct *p)
5210 {
5211         const struct ndr_interface_call *call;
5212         struct ndr_pull *pull;
5213         struct ndr_push *push;
5214         enum ndr_err_code ndr_err;
5215         struct clusapi_AddNotifyKey *r;
5216
5217         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYKEY];
5218
5219         r = talloc(talloc_tos(), struct clusapi_AddNotifyKey);
5220         if (r == NULL) {
5221                 return false;
5222         }
5223
5224         pull = ndr_pull_init_blob(&p->in_data.data, r);
5225         if (pull == NULL) {
5226                 talloc_free(r);
5227                 return false;
5228         }
5229
5230         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5231         if (p->endian) {
5232                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5233         }
5234         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5235         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5236                 talloc_free(r);
5237                 return false;
5238         }
5239
5240         if (DEBUGLEVEL >= 10) {
5241                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyKey, NDR_IN, r);
5242         }
5243
5244         ZERO_STRUCT(r->out);
5245         r->out.rpc_status = talloc_zero(r, WERROR);
5246         if (r->out.rpc_status == NULL) {
5247                 talloc_free(r);
5248                 return false;
5249         }
5250
5251         r->out.result = _clusapi_AddNotifyKey(p, r);
5252
5253         if (p->fault_state) {
5254                 talloc_free(r);
5255                 /* Return true here, srv_pipe_hnd.c will take care */
5256                 return true;
5257         }
5258
5259         if (DEBUGLEVEL >= 10) {
5260                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyKey, NDR_OUT | NDR_SET_VALUES, r);
5261         }
5262
5263         push = ndr_push_init_ctx(r);
5264         if (push == NULL) {
5265                 talloc_free(r);
5266                 return false;
5267         }
5268
5269         /*
5270          * carry over the pointer count to the reply in case we are
5271          * using full pointer. See NDR specification for full pointers
5272          */
5273         push->ptr_count = pull->ptr_count;
5274
5275         ndr_err = call->ndr_push(push, NDR_OUT, r);
5276         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5277                 talloc_free(r);
5278                 return false;
5279         }
5280
5281         p->out_data.rdata = ndr_push_blob(push);
5282         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5283
5284         talloc_free(r);
5285
5286         return true;
5287 }
5288
5289 static bool api_clusapi_ReAddNotifyNode(struct pipes_struct *p)
5290 {
5291         const struct ndr_interface_call *call;
5292         struct ndr_pull *pull;
5293         struct ndr_push *push;
5294         enum ndr_err_code ndr_err;
5295         struct clusapi_ReAddNotifyNode *r;
5296
5297         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_READDNOTIFYNODE];
5298
5299         r = talloc(talloc_tos(), struct clusapi_ReAddNotifyNode);
5300         if (r == NULL) {
5301                 return false;
5302         }
5303
5304         pull = ndr_pull_init_blob(&p->in_data.data, r);
5305         if (pull == NULL) {
5306                 talloc_free(r);
5307                 return false;
5308         }
5309
5310         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5311         if (p->endian) {
5312                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5313         }
5314         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5315         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5316                 talloc_free(r);
5317                 return false;
5318         }
5319
5320         if (DEBUGLEVEL >= 10) {
5321                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyNode, NDR_IN, r);
5322         }
5323
5324         ZERO_STRUCT(r->out);
5325         r->out.rpc_status = talloc_zero(r, WERROR);
5326         if (r->out.rpc_status == NULL) {
5327                 talloc_free(r);
5328                 return false;
5329         }
5330
5331         r->out.result = _clusapi_ReAddNotifyNode(p, r);
5332
5333         if (p->fault_state) {
5334                 talloc_free(r);
5335                 /* Return true here, srv_pipe_hnd.c will take care */
5336                 return true;
5337         }
5338
5339         if (DEBUGLEVEL >= 10) {
5340                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyNode, NDR_OUT | NDR_SET_VALUES, r);
5341         }
5342
5343         push = ndr_push_init_ctx(r);
5344         if (push == NULL) {
5345                 talloc_free(r);
5346                 return false;
5347         }
5348
5349         /*
5350          * carry over the pointer count to the reply in case we are
5351          * using full pointer. See NDR specification for full pointers
5352          */
5353         push->ptr_count = pull->ptr_count;
5354
5355         ndr_err = call->ndr_push(push, NDR_OUT, r);
5356         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5357                 talloc_free(r);
5358                 return false;
5359         }
5360
5361         p->out_data.rdata = ndr_push_blob(push);
5362         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5363
5364         talloc_free(r);
5365
5366         return true;
5367 }
5368
5369 static bool api_clusapi_ReAddNotifyGroup(struct pipes_struct *p)
5370 {
5371         const struct ndr_interface_call *call;
5372         struct ndr_pull *pull;
5373         struct ndr_push *push;
5374         enum ndr_err_code ndr_err;
5375         struct clusapi_ReAddNotifyGroup *r;
5376
5377         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_READDNOTIFYGROUP];
5378
5379         r = talloc(talloc_tos(), struct clusapi_ReAddNotifyGroup);
5380         if (r == NULL) {
5381                 return false;
5382         }
5383
5384         pull = ndr_pull_init_blob(&p->in_data.data, r);
5385         if (pull == NULL) {
5386                 talloc_free(r);
5387                 return false;
5388         }
5389
5390         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5391         if (p->endian) {
5392                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5393         }
5394         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5395         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5396                 talloc_free(r);
5397                 return false;
5398         }
5399
5400         if (DEBUGLEVEL >= 10) {
5401                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyGroup, NDR_IN, r);
5402         }
5403
5404         ZERO_STRUCT(r->out);
5405         r->out.rpc_status = talloc_zero(r, WERROR);
5406         if (r->out.rpc_status == NULL) {
5407                 talloc_free(r);
5408                 return false;
5409         }
5410
5411         r->out.result = _clusapi_ReAddNotifyGroup(p, r);
5412
5413         if (p->fault_state) {
5414                 talloc_free(r);
5415                 /* Return true here, srv_pipe_hnd.c will take care */
5416                 return true;
5417         }
5418
5419         if (DEBUGLEVEL >= 10) {
5420                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyGroup, NDR_OUT | NDR_SET_VALUES, r);
5421         }
5422
5423         push = ndr_push_init_ctx(r);
5424         if (push == NULL) {
5425                 talloc_free(r);
5426                 return false;
5427         }
5428
5429         /*
5430          * carry over the pointer count to the reply in case we are
5431          * using full pointer. See NDR specification for full pointers
5432          */
5433         push->ptr_count = pull->ptr_count;
5434
5435         ndr_err = call->ndr_push(push, NDR_OUT, r);
5436         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5437                 talloc_free(r);
5438                 return false;
5439         }
5440
5441         p->out_data.rdata = ndr_push_blob(push);
5442         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5443
5444         talloc_free(r);
5445
5446         return true;
5447 }
5448
5449 static bool api_clusapi_ReAddNotifyResource(struct pipes_struct *p)
5450 {
5451         const struct ndr_interface_call *call;
5452         struct ndr_pull *pull;
5453         struct ndr_push *push;
5454         enum ndr_err_code ndr_err;
5455         struct clusapi_ReAddNotifyResource *r;
5456
5457         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_READDNOTIFYRESOURCE];
5458
5459         r = talloc(talloc_tos(), struct clusapi_ReAddNotifyResource);
5460         if (r == NULL) {
5461                 return false;
5462         }
5463
5464         pull = ndr_pull_init_blob(&p->in_data.data, r);
5465         if (pull == NULL) {
5466                 talloc_free(r);
5467                 return false;
5468         }
5469
5470         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5471         if (p->endian) {
5472                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5473         }
5474         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5475         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5476                 talloc_free(r);
5477                 return false;
5478         }
5479
5480         if (DEBUGLEVEL >= 10) {
5481                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyResource, NDR_IN, r);
5482         }
5483
5484         ZERO_STRUCT(r->out);
5485         r->out.rpc_status = talloc_zero(r, WERROR);
5486         if (r->out.rpc_status == NULL) {
5487                 talloc_free(r);
5488                 return false;
5489         }
5490
5491         r->out.result = _clusapi_ReAddNotifyResource(p, r);
5492
5493         if (p->fault_state) {
5494                 talloc_free(r);
5495                 /* Return true here, srv_pipe_hnd.c will take care */
5496                 return true;
5497         }
5498
5499         if (DEBUGLEVEL >= 10) {
5500                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyResource, NDR_OUT | NDR_SET_VALUES, r);
5501         }
5502
5503         push = ndr_push_init_ctx(r);
5504         if (push == NULL) {
5505                 talloc_free(r);
5506                 return false;
5507         }
5508
5509         /*
5510          * carry over the pointer count to the reply in case we are
5511          * using full pointer. See NDR specification for full pointers
5512          */
5513         push->ptr_count = pull->ptr_count;
5514
5515         ndr_err = call->ndr_push(push, NDR_OUT, r);
5516         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5517                 talloc_free(r);
5518                 return false;
5519         }
5520
5521         p->out_data.rdata = ndr_push_blob(push);
5522         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5523
5524         talloc_free(r);
5525
5526         return true;
5527 }
5528
5529 static bool api_clusapi_GetNotify(struct pipes_struct *p)
5530 {
5531         const struct ndr_interface_call *call;
5532         struct ndr_pull *pull;
5533         struct ndr_push *push;
5534         enum ndr_err_code ndr_err;
5535         struct clusapi_GetNotify *r;
5536
5537         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNOTIFY];
5538
5539         r = talloc(talloc_tos(), struct clusapi_GetNotify);
5540         if (r == NULL) {
5541                 return false;
5542         }
5543
5544         pull = ndr_pull_init_blob(&p->in_data.data, r);
5545         if (pull == NULL) {
5546                 talloc_free(r);
5547                 return false;
5548         }
5549
5550         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5551         if (p->endian) {
5552                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5553         }
5554         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5555         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5556                 talloc_free(r);
5557                 return false;
5558         }
5559
5560         if (DEBUGLEVEL >= 10) {
5561                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNotify, NDR_IN, r);
5562         }
5563
5564         ZERO_STRUCT(r->out);
5565         r->out.dwNotifyKey = talloc_zero(r, uint32_t);
5566         if (r->out.dwNotifyKey == NULL) {
5567                 talloc_free(r);
5568                 return false;
5569         }
5570
5571         r->out.dwFilter = talloc_zero(r, uint32_t);
5572         if (r->out.dwFilter == NULL) {
5573                 talloc_free(r);
5574                 return false;
5575         }
5576
5577         r->out.dwStateSequence = talloc_zero(r, uint32_t);
5578         if (r->out.dwStateSequence == NULL) {
5579                 talloc_free(r);
5580                 return false;
5581         }
5582
5583         r->out.Name = talloc_zero(r, const char *);
5584         if (r->out.Name == NULL) {
5585                 talloc_free(r);
5586                 return false;
5587         }
5588
5589         r->out.rpc_status = talloc_zero(r, WERROR);
5590         if (r->out.rpc_status == NULL) {
5591                 talloc_free(r);
5592                 return false;
5593         }
5594
5595         r->out.result = _clusapi_GetNotify(p, r);
5596
5597         if (p->fault_state) {
5598                 talloc_free(r);
5599                 /* Return true here, srv_pipe_hnd.c will take care */
5600                 return true;
5601         }
5602
5603         if (DEBUGLEVEL >= 10) {
5604                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNotify, NDR_OUT | NDR_SET_VALUES, r);
5605         }
5606
5607         push = ndr_push_init_ctx(r);
5608         if (push == NULL) {
5609                 talloc_free(r);
5610                 return false;
5611         }
5612
5613         /*
5614          * carry over the pointer count to the reply in case we are
5615          * using full pointer. See NDR specification for full pointers
5616          */
5617         push->ptr_count = pull->ptr_count;
5618
5619         ndr_err = call->ndr_push(push, NDR_OUT, r);
5620         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5621                 talloc_free(r);
5622                 return false;
5623         }
5624
5625         p->out_data.rdata = ndr_push_blob(push);
5626         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5627
5628         talloc_free(r);
5629
5630         return true;
5631 }
5632
5633 static bool api_clusapi_OpenNode(struct pipes_struct *p)
5634 {
5635         const struct ndr_interface_call *call;
5636         struct ndr_pull *pull;
5637         struct ndr_push *push;
5638         enum ndr_err_code ndr_err;
5639         struct clusapi_OpenNode *r;
5640
5641         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENNODE];
5642
5643         r = talloc(talloc_tos(), struct clusapi_OpenNode);
5644         if (r == NULL) {
5645                 return false;
5646         }
5647
5648         pull = ndr_pull_init_blob(&p->in_data.data, r);
5649         if (pull == NULL) {
5650                 talloc_free(r);
5651                 return false;
5652         }
5653
5654         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5655         if (p->endian) {
5656                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5657         }
5658         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5659         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5660                 talloc_free(r);
5661                 return false;
5662         }
5663
5664         if (DEBUGLEVEL >= 10) {
5665                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNode, NDR_IN, r);
5666         }
5667
5668         ZERO_STRUCT(r->out);
5669         r->out.Status = talloc_zero(r, WERROR);
5670         if (r->out.Status == NULL) {
5671                 talloc_free(r);
5672                 return false;
5673         }
5674
5675         r->out.rpc_status = talloc_zero(r, WERROR);
5676         if (r->out.rpc_status == NULL) {
5677                 talloc_free(r);
5678                 return false;
5679         }
5680
5681         r->out.hNode = talloc_zero(r, struct policy_handle);
5682         if (r->out.hNode == NULL) {
5683                 talloc_free(r);
5684                 return false;
5685         }
5686
5687         _clusapi_OpenNode(p, r);
5688
5689         if (p->fault_state) {
5690                 talloc_free(r);
5691                 /* Return true here, srv_pipe_hnd.c will take care */
5692                 return true;
5693         }
5694
5695         if (DEBUGLEVEL >= 10) {
5696                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNode, NDR_OUT | NDR_SET_VALUES, r);
5697         }
5698
5699         push = ndr_push_init_ctx(r);
5700         if (push == NULL) {
5701                 talloc_free(r);
5702                 return false;
5703         }
5704
5705         /*
5706          * carry over the pointer count to the reply in case we are
5707          * using full pointer. See NDR specification for full pointers
5708          */
5709         push->ptr_count = pull->ptr_count;
5710
5711         ndr_err = call->ndr_push(push, NDR_OUT, r);
5712         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5713                 talloc_free(r);
5714                 return false;
5715         }
5716
5717         p->out_data.rdata = ndr_push_blob(push);
5718         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5719
5720         talloc_free(r);
5721
5722         return true;
5723 }
5724
5725 static bool api_clusapi_CloseNode(struct pipes_struct *p)
5726 {
5727         const struct ndr_interface_call *call;
5728         struct ndr_pull *pull;
5729         struct ndr_push *push;
5730         enum ndr_err_code ndr_err;
5731         struct clusapi_CloseNode *r;
5732
5733         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSENODE];
5734
5735         r = talloc(talloc_tos(), struct clusapi_CloseNode);
5736         if (r == NULL) {
5737                 return false;
5738         }
5739
5740         pull = ndr_pull_init_blob(&p->in_data.data, r);
5741         if (pull == NULL) {
5742                 talloc_free(r);
5743                 return false;
5744         }
5745
5746         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5747         if (p->endian) {
5748                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5749         }
5750         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5751         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5752                 talloc_free(r);
5753                 return false;
5754         }
5755
5756         if (DEBUGLEVEL >= 10) {
5757                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNode, NDR_IN, r);
5758         }
5759
5760         ZERO_STRUCT(r->out);
5761         r->out.Node = r->in.Node;
5762         r->out.result = _clusapi_CloseNode(p, r);
5763
5764         if (p->fault_state) {
5765                 talloc_free(r);
5766                 /* Return true here, srv_pipe_hnd.c will take care */
5767                 return true;
5768         }
5769
5770         if (DEBUGLEVEL >= 10) {
5771                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNode, NDR_OUT | NDR_SET_VALUES, r);
5772         }
5773
5774         push = ndr_push_init_ctx(r);
5775         if (push == NULL) {
5776                 talloc_free(r);
5777                 return false;
5778         }
5779
5780         /*
5781          * carry over the pointer count to the reply in case we are
5782          * using full pointer. See NDR specification for full pointers
5783          */
5784         push->ptr_count = pull->ptr_count;
5785
5786         ndr_err = call->ndr_push(push, NDR_OUT, r);
5787         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5788                 talloc_free(r);
5789                 return false;
5790         }
5791
5792         p->out_data.rdata = ndr_push_blob(push);
5793         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5794
5795         talloc_free(r);
5796
5797         return true;
5798 }
5799
5800 static bool api_clusapi_GetNodeState(struct pipes_struct *p)
5801 {
5802         const struct ndr_interface_call *call;
5803         struct ndr_pull *pull;
5804         struct ndr_push *push;
5805         enum ndr_err_code ndr_err;
5806         struct clusapi_GetNodeState *r;
5807
5808         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNODESTATE];
5809
5810         r = talloc(talloc_tos(), struct clusapi_GetNodeState);
5811         if (r == NULL) {
5812                 return false;
5813         }
5814
5815         pull = ndr_pull_init_blob(&p->in_data.data, r);
5816         if (pull == NULL) {
5817                 talloc_free(r);
5818                 return false;
5819         }
5820
5821         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5822         if (p->endian) {
5823                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5824         }
5825         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5826         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5827                 talloc_free(r);
5828                 return false;
5829         }
5830
5831         if (DEBUGLEVEL >= 10) {
5832                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNodeState, NDR_IN, r);
5833         }
5834
5835         ZERO_STRUCT(r->out);
5836         r->out.State = talloc_zero(r, enum clusapi_ClusterNodeState);
5837         if (r->out.State == NULL) {
5838                 talloc_free(r);
5839                 return false;
5840         }
5841
5842         r->out.rpc_status = talloc_zero(r, WERROR);
5843         if (r->out.rpc_status == NULL) {
5844                 talloc_free(r);
5845                 return false;
5846         }
5847
5848         r->out.result = _clusapi_GetNodeState(p, r);
5849
5850         if (p->fault_state) {
5851                 talloc_free(r);
5852                 /* Return true here, srv_pipe_hnd.c will take care */
5853                 return true;
5854         }
5855
5856         if (DEBUGLEVEL >= 10) {
5857                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNodeState, NDR_OUT | NDR_SET_VALUES, r);
5858         }
5859
5860         push = ndr_push_init_ctx(r);
5861         if (push == NULL) {
5862                 talloc_free(r);
5863                 return false;
5864         }
5865
5866         /*
5867          * carry over the pointer count to the reply in case we are
5868          * using full pointer. See NDR specification for full pointers
5869          */
5870         push->ptr_count = pull->ptr_count;
5871
5872         ndr_err = call->ndr_push(push, NDR_OUT, r);
5873         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5874                 talloc_free(r);
5875                 return false;
5876         }
5877
5878         p->out_data.rdata = ndr_push_blob(push);
5879         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5880
5881         talloc_free(r);
5882
5883         return true;
5884 }
5885
5886 static bool api_clusapi_PauseNode(struct pipes_struct *p)
5887 {
5888         const struct ndr_interface_call *call;
5889         struct ndr_pull *pull;
5890         struct ndr_push *push;
5891         enum ndr_err_code ndr_err;
5892         struct clusapi_PauseNode *r;
5893
5894         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_PAUSENODE];
5895
5896         r = talloc(talloc_tos(), struct clusapi_PauseNode);
5897         if (r == NULL) {
5898                 return false;
5899         }
5900
5901         pull = ndr_pull_init_blob(&p->in_data.data, r);
5902         if (pull == NULL) {
5903                 talloc_free(r);
5904                 return false;
5905         }
5906
5907         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5908         if (p->endian) {
5909                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5910         }
5911         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5912         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5913                 talloc_free(r);
5914                 return false;
5915         }
5916
5917         if (DEBUGLEVEL >= 10) {
5918                 NDR_PRINT_FUNCTION_DEBUG(clusapi_PauseNode, NDR_IN, r);
5919         }
5920
5921         ZERO_STRUCT(r->out);
5922         r->out.rpc_status = talloc_zero(r, WERROR);
5923         if (r->out.rpc_status == NULL) {
5924                 talloc_free(r);
5925                 return false;
5926         }
5927
5928         r->out.result = _clusapi_PauseNode(p, r);
5929
5930         if (p->fault_state) {
5931                 talloc_free(r);
5932                 /* Return true here, srv_pipe_hnd.c will take care */
5933                 return true;
5934         }
5935
5936         if (DEBUGLEVEL >= 10) {
5937                 NDR_PRINT_FUNCTION_DEBUG(clusapi_PauseNode, NDR_OUT | NDR_SET_VALUES, r);
5938         }
5939
5940         push = ndr_push_init_ctx(r);
5941         if (push == NULL) {
5942                 talloc_free(r);
5943                 return false;
5944         }
5945
5946         /*
5947          * carry over the pointer count to the reply in case we are
5948          * using full pointer. See NDR specification for full pointers
5949          */
5950         push->ptr_count = pull->ptr_count;
5951
5952         ndr_err = call->ndr_push(push, NDR_OUT, r);
5953         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5954                 talloc_free(r);
5955                 return false;
5956         }
5957
5958         p->out_data.rdata = ndr_push_blob(push);
5959         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
5960
5961         talloc_free(r);
5962
5963         return true;
5964 }
5965
5966 static bool api_clusapi_ResumeNode(struct pipes_struct *p)
5967 {
5968         const struct ndr_interface_call *call;
5969         struct ndr_pull *pull;
5970         struct ndr_push *push;
5971         enum ndr_err_code ndr_err;
5972         struct clusapi_ResumeNode *r;
5973
5974         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_RESUMENODE];
5975
5976         r = talloc(talloc_tos(), struct clusapi_ResumeNode);
5977         if (r == NULL) {
5978                 return false;
5979         }
5980
5981         pull = ndr_pull_init_blob(&p->in_data.data, r);
5982         if (pull == NULL) {
5983                 talloc_free(r);
5984                 return false;
5985         }
5986
5987         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5988         if (p->endian) {
5989                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
5990         }
5991         ndr_err = call->ndr_pull(pull, NDR_IN, r);
5992         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5993                 talloc_free(r);
5994                 return false;
5995         }
5996
5997         if (DEBUGLEVEL >= 10) {
5998                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResumeNode, NDR_IN, r);
5999         }
6000
6001         ZERO_STRUCT(r->out);
6002         r->out.rpc_status = talloc_zero(r, WERROR);
6003         if (r->out.rpc_status == NULL) {
6004                 talloc_free(r);
6005                 return false;
6006         }
6007
6008         r->out.result = _clusapi_ResumeNode(p, r);
6009
6010         if (p->fault_state) {
6011                 talloc_free(r);
6012                 /* Return true here, srv_pipe_hnd.c will take care */
6013                 return true;
6014         }
6015
6016         if (DEBUGLEVEL >= 10) {
6017                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResumeNode, NDR_OUT | NDR_SET_VALUES, r);
6018         }
6019
6020         push = ndr_push_init_ctx(r);
6021         if (push == NULL) {
6022                 talloc_free(r);
6023                 return false;
6024         }
6025
6026         /*
6027          * carry over the pointer count to the reply in case we are
6028          * using full pointer. See NDR specification for full pointers
6029          */
6030         push->ptr_count = pull->ptr_count;
6031
6032         ndr_err = call->ndr_push(push, NDR_OUT, r);
6033         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6034                 talloc_free(r);
6035                 return false;
6036         }
6037
6038         p->out_data.rdata = ndr_push_blob(push);
6039         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6040
6041         talloc_free(r);
6042
6043         return true;
6044 }
6045
6046 static bool api_clusapi_EvictNode(struct pipes_struct *p)
6047 {
6048         const struct ndr_interface_call *call;
6049         struct ndr_pull *pull;
6050         struct ndr_push *push;
6051         enum ndr_err_code ndr_err;
6052         struct clusapi_EvictNode *r;
6053
6054         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_EVICTNODE];
6055
6056         r = talloc(talloc_tos(), struct clusapi_EvictNode);
6057         if (r == NULL) {
6058                 return false;
6059         }
6060
6061         pull = ndr_pull_init_blob(&p->in_data.data, r);
6062         if (pull == NULL) {
6063                 talloc_free(r);
6064                 return false;
6065         }
6066
6067         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6068         if (p->endian) {
6069                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6070         }
6071         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6072         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6073                 talloc_free(r);
6074                 return false;
6075         }
6076
6077         if (DEBUGLEVEL >= 10) {
6078                 NDR_PRINT_FUNCTION_DEBUG(clusapi_EvictNode, NDR_IN, r);
6079         }
6080
6081         ZERO_STRUCT(r->out);
6082         r->out.rpc_status = talloc_zero(r, WERROR);
6083         if (r->out.rpc_status == NULL) {
6084                 talloc_free(r);
6085                 return false;
6086         }
6087
6088         r->out.result = _clusapi_EvictNode(p, r);
6089
6090         if (p->fault_state) {
6091                 talloc_free(r);
6092                 /* Return true here, srv_pipe_hnd.c will take care */
6093                 return true;
6094         }
6095
6096         if (DEBUGLEVEL >= 10) {
6097                 NDR_PRINT_FUNCTION_DEBUG(clusapi_EvictNode, NDR_OUT | NDR_SET_VALUES, r);
6098         }
6099
6100         push = ndr_push_init_ctx(r);
6101         if (push == NULL) {
6102                 talloc_free(r);
6103                 return false;
6104         }
6105
6106         /*
6107          * carry over the pointer count to the reply in case we are
6108          * using full pointer. See NDR specification for full pointers
6109          */
6110         push->ptr_count = pull->ptr_count;
6111
6112         ndr_err = call->ndr_push(push, NDR_OUT, r);
6113         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6114                 talloc_free(r);
6115                 return false;
6116         }
6117
6118         p->out_data.rdata = ndr_push_blob(push);
6119         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6120
6121         talloc_free(r);
6122
6123         return true;
6124 }
6125
6126 static bool api_clusapi_NodeResourceControl(struct pipes_struct *p)
6127 {
6128         const struct ndr_interface_call *call;
6129         struct ndr_pull *pull;
6130         struct ndr_push *push;
6131         enum ndr_err_code ndr_err;
6132         struct clusapi_NodeResourceControl *r;
6133
6134         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODERESOURCECONTROL];
6135
6136         r = talloc(talloc_tos(), struct clusapi_NodeResourceControl);
6137         if (r == NULL) {
6138                 return false;
6139         }
6140
6141         pull = ndr_pull_init_blob(&p->in_data.data, r);
6142         if (pull == NULL) {
6143                 talloc_free(r);
6144                 return false;
6145         }
6146
6147         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6148         if (p->endian) {
6149                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6150         }
6151         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6152         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6153                 talloc_free(r);
6154                 return false;
6155         }
6156
6157         if (DEBUGLEVEL >= 10) {
6158                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeResourceControl, NDR_IN, r);
6159         }
6160
6161         ZERO_STRUCT(r->out);
6162         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6163         if (r->out.lpOutBuffer == NULL) {
6164                 talloc_free(r);
6165                 return false;
6166         }
6167
6168         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6169         if (r->out.lpBytesReturned == NULL) {
6170                 talloc_free(r);
6171                 return false;
6172         }
6173
6174         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6175         if (r->out.lpcbRequired == NULL) {
6176                 talloc_free(r);
6177                 return false;
6178         }
6179
6180         r->out.rpc_status = talloc_zero(r, WERROR);
6181         if (r->out.rpc_status == NULL) {
6182                 talloc_free(r);
6183                 return false;
6184         }
6185
6186         r->out.result = _clusapi_NodeResourceControl(p, r);
6187
6188         if (p->fault_state) {
6189                 talloc_free(r);
6190                 /* Return true here, srv_pipe_hnd.c will take care */
6191                 return true;
6192         }
6193
6194         if (DEBUGLEVEL >= 10) {
6195                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeResourceControl, NDR_OUT | NDR_SET_VALUES, r);
6196         }
6197
6198         push = ndr_push_init_ctx(r);
6199         if (push == NULL) {
6200                 talloc_free(r);
6201                 return false;
6202         }
6203
6204         /*
6205          * carry over the pointer count to the reply in case we are
6206          * using full pointer. See NDR specification for full pointers
6207          */
6208         push->ptr_count = pull->ptr_count;
6209
6210         ndr_err = call->ndr_push(push, NDR_OUT, r);
6211         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6212                 talloc_free(r);
6213                 return false;
6214         }
6215
6216         p->out_data.rdata = ndr_push_blob(push);
6217         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6218
6219         talloc_free(r);
6220
6221         return true;
6222 }
6223
6224 static bool api_clusapi_ResourceControl(struct pipes_struct *p)
6225 {
6226         const struct ndr_interface_call *call;
6227         struct ndr_pull *pull;
6228         struct ndr_push *push;
6229         enum ndr_err_code ndr_err;
6230         struct clusapi_ResourceControl *r;
6231
6232         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_RESOURCECONTROL];
6233
6234         r = talloc(talloc_tos(), struct clusapi_ResourceControl);
6235         if (r == NULL) {
6236                 return false;
6237         }
6238
6239         pull = ndr_pull_init_blob(&p->in_data.data, r);
6240         if (pull == NULL) {
6241                 talloc_free(r);
6242                 return false;
6243         }
6244
6245         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6246         if (p->endian) {
6247                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6248         }
6249         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6250         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6251                 talloc_free(r);
6252                 return false;
6253         }
6254
6255         if (DEBUGLEVEL >= 10) {
6256                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResourceControl, NDR_IN, r);
6257         }
6258
6259         ZERO_STRUCT(r->out);
6260         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6261         if (r->out.lpOutBuffer == NULL) {
6262                 talloc_free(r);
6263                 return false;
6264         }
6265
6266         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6267         if (r->out.lpBytesReturned == NULL) {
6268                 talloc_free(r);
6269                 return false;
6270         }
6271
6272         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6273         if (r->out.lpcbRequired == NULL) {
6274                 talloc_free(r);
6275                 return false;
6276         }
6277
6278         r->out.rpc_status = talloc_zero(r, WERROR);
6279         if (r->out.rpc_status == NULL) {
6280                 talloc_free(r);
6281                 return false;
6282         }
6283
6284         r->out.result = _clusapi_ResourceControl(p, r);
6285
6286         if (p->fault_state) {
6287                 talloc_free(r);
6288                 /* Return true here, srv_pipe_hnd.c will take care */
6289                 return true;
6290         }
6291
6292         if (DEBUGLEVEL >= 10) {
6293                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResourceControl, NDR_OUT | NDR_SET_VALUES, r);
6294         }
6295
6296         push = ndr_push_init_ctx(r);
6297         if (push == NULL) {
6298                 talloc_free(r);
6299                 return false;
6300         }
6301
6302         /*
6303          * carry over the pointer count to the reply in case we are
6304          * using full pointer. See NDR specification for full pointers
6305          */
6306         push->ptr_count = pull->ptr_count;
6307
6308         ndr_err = call->ndr_push(push, NDR_OUT, r);
6309         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6310                 talloc_free(r);
6311                 return false;
6312         }
6313
6314         p->out_data.rdata = ndr_push_blob(push);
6315         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6316
6317         talloc_free(r);
6318
6319         return true;
6320 }
6321
6322 static bool api_clusapi_NodeResourceTypeControl(struct pipes_struct *p)
6323 {
6324         const struct ndr_interface_call *call;
6325         struct ndr_pull *pull;
6326         struct ndr_push *push;
6327         enum ndr_err_code ndr_err;
6328         struct clusapi_NodeResourceTypeControl *r;
6329
6330         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODERESOURCETYPECONTROL];
6331
6332         r = talloc(talloc_tos(), struct clusapi_NodeResourceTypeControl);
6333         if (r == NULL) {
6334                 return false;
6335         }
6336
6337         pull = ndr_pull_init_blob(&p->in_data.data, r);
6338         if (pull == NULL) {
6339                 talloc_free(r);
6340                 return false;
6341         }
6342
6343         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6344         if (p->endian) {
6345                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6346         }
6347         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6348         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6349                 talloc_free(r);
6350                 return false;
6351         }
6352
6353         if (DEBUGLEVEL >= 10) {
6354                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeResourceTypeControl, NDR_IN, r);
6355         }
6356
6357         ZERO_STRUCT(r->out);
6358         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6359         if (r->out.lpOutBuffer == NULL) {
6360                 talloc_free(r);
6361                 return false;
6362         }
6363
6364         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6365         if (r->out.lpBytesReturned == NULL) {
6366                 talloc_free(r);
6367                 return false;
6368         }
6369
6370         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6371         if (r->out.lpcbRequired == NULL) {
6372                 talloc_free(r);
6373                 return false;
6374         }
6375
6376         r->out.rpc_status = talloc_zero(r, WERROR);
6377         if (r->out.rpc_status == NULL) {
6378                 talloc_free(r);
6379                 return false;
6380         }
6381
6382         r->out.result = _clusapi_NodeResourceTypeControl(p, r);
6383
6384         if (p->fault_state) {
6385                 talloc_free(r);
6386                 /* Return true here, srv_pipe_hnd.c will take care */
6387                 return true;
6388         }
6389
6390         if (DEBUGLEVEL >= 10) {
6391                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeResourceTypeControl, NDR_OUT | NDR_SET_VALUES, r);
6392         }
6393
6394         push = ndr_push_init_ctx(r);
6395         if (push == NULL) {
6396                 talloc_free(r);
6397                 return false;
6398         }
6399
6400         /*
6401          * carry over the pointer count to the reply in case we are
6402          * using full pointer. See NDR specification for full pointers
6403          */
6404         push->ptr_count = pull->ptr_count;
6405
6406         ndr_err = call->ndr_push(push, NDR_OUT, r);
6407         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6408                 talloc_free(r);
6409                 return false;
6410         }
6411
6412         p->out_data.rdata = ndr_push_blob(push);
6413         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6414
6415         talloc_free(r);
6416
6417         return true;
6418 }
6419
6420 static bool api_clusapi_ResourceTypeControl(struct pipes_struct *p)
6421 {
6422         const struct ndr_interface_call *call;
6423         struct ndr_pull *pull;
6424         struct ndr_push *push;
6425         enum ndr_err_code ndr_err;
6426         struct clusapi_ResourceTypeControl *r;
6427
6428         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_RESOURCETYPECONTROL];
6429
6430         r = talloc(talloc_tos(), struct clusapi_ResourceTypeControl);
6431         if (r == NULL) {
6432                 return false;
6433         }
6434
6435         pull = ndr_pull_init_blob(&p->in_data.data, r);
6436         if (pull == NULL) {
6437                 talloc_free(r);
6438                 return false;
6439         }
6440
6441         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6442         if (p->endian) {
6443                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6444         }
6445         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6446         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6447                 talloc_free(r);
6448                 return false;
6449         }
6450
6451         if (DEBUGLEVEL >= 10) {
6452                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResourceTypeControl, NDR_IN, r);
6453         }
6454
6455         ZERO_STRUCT(r->out);
6456         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6457         if (r->out.lpOutBuffer == NULL) {
6458                 talloc_free(r);
6459                 return false;
6460         }
6461
6462         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6463         if (r->out.lpBytesReturned == NULL) {
6464                 talloc_free(r);
6465                 return false;
6466         }
6467
6468         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6469         if (r->out.lpcbRequired == NULL) {
6470                 talloc_free(r);
6471                 return false;
6472         }
6473
6474         r->out.rpc_status = talloc_zero(r, WERROR);
6475         if (r->out.rpc_status == NULL) {
6476                 talloc_free(r);
6477                 return false;
6478         }
6479
6480         r->out.result = _clusapi_ResourceTypeControl(p, r);
6481
6482         if (p->fault_state) {
6483                 talloc_free(r);
6484                 /* Return true here, srv_pipe_hnd.c will take care */
6485                 return true;
6486         }
6487
6488         if (DEBUGLEVEL >= 10) {
6489                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResourceTypeControl, NDR_OUT | NDR_SET_VALUES, r);
6490         }
6491
6492         push = ndr_push_init_ctx(r);
6493         if (push == NULL) {
6494                 talloc_free(r);
6495                 return false;
6496         }
6497
6498         /*
6499          * carry over the pointer count to the reply in case we are
6500          * using full pointer. See NDR specification for full pointers
6501          */
6502         push->ptr_count = pull->ptr_count;
6503
6504         ndr_err = call->ndr_push(push, NDR_OUT, r);
6505         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6506                 talloc_free(r);
6507                 return false;
6508         }
6509
6510         p->out_data.rdata = ndr_push_blob(push);
6511         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6512
6513         talloc_free(r);
6514
6515         return true;
6516 }
6517
6518 static bool api_clusapi_NodeGroupControl(struct pipes_struct *p)
6519 {
6520         const struct ndr_interface_call *call;
6521         struct ndr_pull *pull;
6522         struct ndr_push *push;
6523         enum ndr_err_code ndr_err;
6524         struct clusapi_NodeGroupControl *r;
6525
6526         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODEGROUPCONTROL];
6527
6528         r = talloc(talloc_tos(), struct clusapi_NodeGroupControl);
6529         if (r == NULL) {
6530                 return false;
6531         }
6532
6533         pull = ndr_pull_init_blob(&p->in_data.data, r);
6534         if (pull == NULL) {
6535                 talloc_free(r);
6536                 return false;
6537         }
6538
6539         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6540         if (p->endian) {
6541                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6542         }
6543         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6544         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6545                 talloc_free(r);
6546                 return false;
6547         }
6548
6549         if (DEBUGLEVEL >= 10) {
6550                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeGroupControl, NDR_IN, r);
6551         }
6552
6553         ZERO_STRUCT(r->out);
6554         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6555         if (r->out.lpOutBuffer == NULL) {
6556                 talloc_free(r);
6557                 return false;
6558         }
6559
6560         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6561         if (r->out.lpBytesReturned == NULL) {
6562                 talloc_free(r);
6563                 return false;
6564         }
6565
6566         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6567         if (r->out.lpcbRequired == NULL) {
6568                 talloc_free(r);
6569                 return false;
6570         }
6571
6572         r->out.rpc_status = talloc_zero(r, WERROR);
6573         if (r->out.rpc_status == NULL) {
6574                 talloc_free(r);
6575                 return false;
6576         }
6577
6578         r->out.result = _clusapi_NodeGroupControl(p, r);
6579
6580         if (p->fault_state) {
6581                 talloc_free(r);
6582                 /* Return true here, srv_pipe_hnd.c will take care */
6583                 return true;
6584         }
6585
6586         if (DEBUGLEVEL >= 10) {
6587                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeGroupControl, NDR_OUT | NDR_SET_VALUES, r);
6588         }
6589
6590         push = ndr_push_init_ctx(r);
6591         if (push == NULL) {
6592                 talloc_free(r);
6593                 return false;
6594         }
6595
6596         /*
6597          * carry over the pointer count to the reply in case we are
6598          * using full pointer. See NDR specification for full pointers
6599          */
6600         push->ptr_count = pull->ptr_count;
6601
6602         ndr_err = call->ndr_push(push, NDR_OUT, r);
6603         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6604                 talloc_free(r);
6605                 return false;
6606         }
6607
6608         p->out_data.rdata = ndr_push_blob(push);
6609         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6610
6611         talloc_free(r);
6612
6613         return true;
6614 }
6615
6616 static bool api_clusapi_GroupControl(struct pipes_struct *p)
6617 {
6618         const struct ndr_interface_call *call;
6619         struct ndr_pull *pull;
6620         struct ndr_push *push;
6621         enum ndr_err_code ndr_err;
6622         struct clusapi_GroupControl *r;
6623
6624         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GROUPCONTROL];
6625
6626         r = talloc(talloc_tos(), struct clusapi_GroupControl);
6627         if (r == NULL) {
6628                 return false;
6629         }
6630
6631         pull = ndr_pull_init_blob(&p->in_data.data, r);
6632         if (pull == NULL) {
6633                 talloc_free(r);
6634                 return false;
6635         }
6636
6637         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6638         if (p->endian) {
6639                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6640         }
6641         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6642         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6643                 talloc_free(r);
6644                 return false;
6645         }
6646
6647         if (DEBUGLEVEL >= 10) {
6648                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GroupControl, NDR_IN, r);
6649         }
6650
6651         ZERO_STRUCT(r->out);
6652         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6653         if (r->out.lpOutBuffer == NULL) {
6654                 talloc_free(r);
6655                 return false;
6656         }
6657
6658         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6659         if (r->out.lpBytesReturned == NULL) {
6660                 talloc_free(r);
6661                 return false;
6662         }
6663
6664         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6665         if (r->out.lpcbRequired == NULL) {
6666                 talloc_free(r);
6667                 return false;
6668         }
6669
6670         r->out.rpc_status = talloc_zero(r, WERROR);
6671         if (r->out.rpc_status == NULL) {
6672                 talloc_free(r);
6673                 return false;
6674         }
6675
6676         r->out.result = _clusapi_GroupControl(p, r);
6677
6678         if (p->fault_state) {
6679                 talloc_free(r);
6680                 /* Return true here, srv_pipe_hnd.c will take care */
6681                 return true;
6682         }
6683
6684         if (DEBUGLEVEL >= 10) {
6685                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GroupControl, NDR_OUT | NDR_SET_VALUES, r);
6686         }
6687
6688         push = ndr_push_init_ctx(r);
6689         if (push == NULL) {
6690                 talloc_free(r);
6691                 return false;
6692         }
6693
6694         /*
6695          * carry over the pointer count to the reply in case we are
6696          * using full pointer. See NDR specification for full pointers
6697          */
6698         push->ptr_count = pull->ptr_count;
6699
6700         ndr_err = call->ndr_push(push, NDR_OUT, r);
6701         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6702                 talloc_free(r);
6703                 return false;
6704         }
6705
6706         p->out_data.rdata = ndr_push_blob(push);
6707         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6708
6709         talloc_free(r);
6710
6711         return true;
6712 }
6713
6714 static bool api_clusapi_NodeNodeControl(struct pipes_struct *p)
6715 {
6716         const struct ndr_interface_call *call;
6717         struct ndr_pull *pull;
6718         struct ndr_push *push;
6719         enum ndr_err_code ndr_err;
6720         struct clusapi_NodeNodeControl *r;
6721
6722         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODENODECONTROL];
6723
6724         r = talloc(talloc_tos(), struct clusapi_NodeNodeControl);
6725         if (r == NULL) {
6726                 return false;
6727         }
6728
6729         pull = ndr_pull_init_blob(&p->in_data.data, r);
6730         if (pull == NULL) {
6731                 talloc_free(r);
6732                 return false;
6733         }
6734
6735         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6736         if (p->endian) {
6737                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6738         }
6739         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6740         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6741                 talloc_free(r);
6742                 return false;
6743         }
6744
6745         if (DEBUGLEVEL >= 10) {
6746                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeNodeControl, NDR_IN, r);
6747         }
6748
6749         ZERO_STRUCT(r->out);
6750         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6751         if (r->out.lpOutBuffer == NULL) {
6752                 talloc_free(r);
6753                 return false;
6754         }
6755
6756         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6757         if (r->out.lpBytesReturned == NULL) {
6758                 talloc_free(r);
6759                 return false;
6760         }
6761
6762         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6763         if (r->out.lpcbRequired == NULL) {
6764                 talloc_free(r);
6765                 return false;
6766         }
6767
6768         r->out.rpc_status = talloc_zero(r, WERROR);
6769         if (r->out.rpc_status == NULL) {
6770                 talloc_free(r);
6771                 return false;
6772         }
6773
6774         r->out.result = _clusapi_NodeNodeControl(p, r);
6775
6776         if (p->fault_state) {
6777                 talloc_free(r);
6778                 /* Return true here, srv_pipe_hnd.c will take care */
6779                 return true;
6780         }
6781
6782         if (DEBUGLEVEL >= 10) {
6783                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeNodeControl, NDR_OUT | NDR_SET_VALUES, r);
6784         }
6785
6786         push = ndr_push_init_ctx(r);
6787         if (push == NULL) {
6788                 talloc_free(r);
6789                 return false;
6790         }
6791
6792         /*
6793          * carry over the pointer count to the reply in case we are
6794          * using full pointer. See NDR specification for full pointers
6795          */
6796         push->ptr_count = pull->ptr_count;
6797
6798         ndr_err = call->ndr_push(push, NDR_OUT, r);
6799         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6800                 talloc_free(r);
6801                 return false;
6802         }
6803
6804         p->out_data.rdata = ndr_push_blob(push);
6805         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6806
6807         talloc_free(r);
6808
6809         return true;
6810 }
6811
6812 static bool api_clusapi_NodeControl(struct pipes_struct *p)
6813 {
6814         const struct ndr_interface_call *call;
6815         struct ndr_pull *pull;
6816         struct ndr_push *push;
6817         enum ndr_err_code ndr_err;
6818         struct clusapi_NodeControl *r;
6819
6820         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODECONTROL];
6821
6822         r = talloc(talloc_tos(), struct clusapi_NodeControl);
6823         if (r == NULL) {
6824                 return false;
6825         }
6826
6827         pull = ndr_pull_init_blob(&p->in_data.data, r);
6828         if (pull == NULL) {
6829                 talloc_free(r);
6830                 return false;
6831         }
6832
6833         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6834         if (p->endian) {
6835                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6836         }
6837         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6838         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6839                 talloc_free(r);
6840                 return false;
6841         }
6842
6843         if (DEBUGLEVEL >= 10) {
6844                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeControl, NDR_IN, r);
6845         }
6846
6847         ZERO_STRUCT(r->out);
6848         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
6849         if (r->out.lpOutBuffer == NULL) {
6850                 talloc_free(r);
6851                 return false;
6852         }
6853
6854         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
6855         if (r->out.lpBytesReturned == NULL) {
6856                 talloc_free(r);
6857                 return false;
6858         }
6859
6860         r->out.lpcbRequired = talloc_zero(r, uint32_t);
6861         if (r->out.lpcbRequired == NULL) {
6862                 talloc_free(r);
6863                 return false;
6864         }
6865
6866         r->out.rpc_status = talloc_zero(r, WERROR);
6867         if (r->out.rpc_status == NULL) {
6868                 talloc_free(r);
6869                 return false;
6870         }
6871
6872         r->out.result = _clusapi_NodeControl(p, r);
6873
6874         if (p->fault_state) {
6875                 talloc_free(r);
6876                 /* Return true here, srv_pipe_hnd.c will take care */
6877                 return true;
6878         }
6879
6880         if (DEBUGLEVEL >= 10) {
6881                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeControl, NDR_OUT | NDR_SET_VALUES, r);
6882         }
6883
6884         push = ndr_push_init_ctx(r);
6885         if (push == NULL) {
6886                 talloc_free(r);
6887                 return false;
6888         }
6889
6890         /*
6891          * carry over the pointer count to the reply in case we are
6892          * using full pointer. See NDR specification for full pointers
6893          */
6894         push->ptr_count = pull->ptr_count;
6895
6896         ndr_err = call->ndr_push(push, NDR_OUT, r);
6897         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6898                 talloc_free(r);
6899                 return false;
6900         }
6901
6902         p->out_data.rdata = ndr_push_blob(push);
6903         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6904
6905         talloc_free(r);
6906
6907         return true;
6908 }
6909
6910 static bool api_Opnum80NotUsedOnWire(struct pipes_struct *p)
6911 {
6912         const struct ndr_interface_call *call;
6913         struct ndr_pull *pull;
6914         struct ndr_push *push;
6915         enum ndr_err_code ndr_err;
6916         struct Opnum80NotUsedOnWire *r;
6917
6918         call = &ndr_table_clusapi.calls[NDR_OPNUM80NOTUSEDONWIRE];
6919
6920         r = talloc(talloc_tos(), struct Opnum80NotUsedOnWire);
6921         if (r == NULL) {
6922                 return false;
6923         }
6924
6925         pull = ndr_pull_init_blob(&p->in_data.data, r);
6926         if (pull == NULL) {
6927                 talloc_free(r);
6928                 return false;
6929         }
6930
6931         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6932         if (p->endian) {
6933                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
6934         }
6935         ndr_err = call->ndr_pull(pull, NDR_IN, r);
6936         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6937                 talloc_free(r);
6938                 return false;
6939         }
6940
6941         if (DEBUGLEVEL >= 10) {
6942                 NDR_PRINT_FUNCTION_DEBUG(Opnum80NotUsedOnWire, NDR_IN, r);
6943         }
6944
6945         r->out.result = _Opnum80NotUsedOnWire(p, r);
6946
6947         if (p->fault_state) {
6948                 talloc_free(r);
6949                 /* Return true here, srv_pipe_hnd.c will take care */
6950                 return true;
6951         }
6952
6953         if (DEBUGLEVEL >= 10) {
6954                 NDR_PRINT_FUNCTION_DEBUG(Opnum80NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r);
6955         }
6956
6957         push = ndr_push_init_ctx(r);
6958         if (push == NULL) {
6959                 talloc_free(r);
6960                 return false;
6961         }
6962
6963         /*
6964          * carry over the pointer count to the reply in case we are
6965          * using full pointer. See NDR specification for full pointers
6966          */
6967         push->ptr_count = pull->ptr_count;
6968
6969         ndr_err = call->ndr_push(push, NDR_OUT, r);
6970         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6971                 talloc_free(r);
6972                 return false;
6973         }
6974
6975         p->out_data.rdata = ndr_push_blob(push);
6976         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
6977
6978         talloc_free(r);
6979
6980         return true;
6981 }
6982
6983 static bool api_clusapi_OpenNetwork(struct pipes_struct *p)
6984 {
6985         const struct ndr_interface_call *call;
6986         struct ndr_pull *pull;
6987         struct ndr_push *push;
6988         enum ndr_err_code ndr_err;
6989         struct clusapi_OpenNetwork *r;
6990
6991         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENNETWORK];
6992
6993         r = talloc(talloc_tos(), struct clusapi_OpenNetwork);
6994         if (r == NULL) {
6995                 return false;
6996         }
6997
6998         pull = ndr_pull_init_blob(&p->in_data.data, r);
6999         if (pull == NULL) {
7000                 talloc_free(r);
7001                 return false;
7002         }
7003
7004         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7005         if (p->endian) {
7006                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7007         }
7008         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7009         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7010                 talloc_free(r);
7011                 return false;
7012         }
7013
7014         if (DEBUGLEVEL >= 10) {
7015                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetwork, NDR_IN, r);
7016         }
7017
7018         ZERO_STRUCT(r->out);
7019         r->out.Status = talloc_zero(r, WERROR);
7020         if (r->out.Status == NULL) {
7021                 talloc_free(r);
7022                 return false;
7023         }
7024
7025         r->out.rpc_status = talloc_zero(r, WERROR);
7026         if (r->out.rpc_status == NULL) {
7027                 talloc_free(r);
7028                 return false;
7029         }
7030
7031         r->out.hNetwork = talloc_zero(r, struct policy_handle);
7032         if (r->out.hNetwork == NULL) {
7033                 talloc_free(r);
7034                 return false;
7035         }
7036
7037         _clusapi_OpenNetwork(p, r);
7038
7039         if (p->fault_state) {
7040                 talloc_free(r);
7041                 /* Return true here, srv_pipe_hnd.c will take care */
7042                 return true;
7043         }
7044
7045         if (DEBUGLEVEL >= 10) {
7046                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetwork, NDR_OUT | NDR_SET_VALUES, r);
7047         }
7048
7049         push = ndr_push_init_ctx(r);
7050         if (push == NULL) {
7051                 talloc_free(r);
7052                 return false;
7053         }
7054
7055         /*
7056          * carry over the pointer count to the reply in case we are
7057          * using full pointer. See NDR specification for full pointers
7058          */
7059         push->ptr_count = pull->ptr_count;
7060
7061         ndr_err = call->ndr_push(push, NDR_OUT, r);
7062         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7063                 talloc_free(r);
7064                 return false;
7065         }
7066
7067         p->out_data.rdata = ndr_push_blob(push);
7068         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7069
7070         talloc_free(r);
7071
7072         return true;
7073 }
7074
7075 static bool api_clusapi_CloseNetwork(struct pipes_struct *p)
7076 {
7077         const struct ndr_interface_call *call;
7078         struct ndr_pull *pull;
7079         struct ndr_push *push;
7080         enum ndr_err_code ndr_err;
7081         struct clusapi_CloseNetwork *r;
7082
7083         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSENETWORK];
7084
7085         r = talloc(talloc_tos(), struct clusapi_CloseNetwork);
7086         if (r == NULL) {
7087                 return false;
7088         }
7089
7090         pull = ndr_pull_init_blob(&p->in_data.data, r);
7091         if (pull == NULL) {
7092                 talloc_free(r);
7093                 return false;
7094         }
7095
7096         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7097         if (p->endian) {
7098                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7099         }
7100         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7101         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7102                 talloc_free(r);
7103                 return false;
7104         }
7105
7106         if (DEBUGLEVEL >= 10) {
7107                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNetwork, NDR_IN, r);
7108         }
7109
7110         ZERO_STRUCT(r->out);
7111         r->out.Network = r->in.Network;
7112         r->out.result = _clusapi_CloseNetwork(p, r);
7113
7114         if (p->fault_state) {
7115                 talloc_free(r);
7116                 /* Return true here, srv_pipe_hnd.c will take care */
7117                 return true;
7118         }
7119
7120         if (DEBUGLEVEL >= 10) {
7121                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNetwork, NDR_OUT | NDR_SET_VALUES, r);
7122         }
7123
7124         push = ndr_push_init_ctx(r);
7125         if (push == NULL) {
7126                 talloc_free(r);
7127                 return false;
7128         }
7129
7130         /*
7131          * carry over the pointer count to the reply in case we are
7132          * using full pointer. See NDR specification for full pointers
7133          */
7134         push->ptr_count = pull->ptr_count;
7135
7136         ndr_err = call->ndr_push(push, NDR_OUT, r);
7137         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7138                 talloc_free(r);
7139                 return false;
7140         }
7141
7142         p->out_data.rdata = ndr_push_blob(push);
7143         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7144
7145         talloc_free(r);
7146
7147         return true;
7148 }
7149
7150 static bool api_clusapi_GetNetworkState(struct pipes_struct *p)
7151 {
7152         const struct ndr_interface_call *call;
7153         struct ndr_pull *pull;
7154         struct ndr_push *push;
7155         enum ndr_err_code ndr_err;
7156         struct clusapi_GetNetworkState *r;
7157
7158         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNETWORKSTATE];
7159
7160         r = talloc(talloc_tos(), struct clusapi_GetNetworkState);
7161         if (r == NULL) {
7162                 return false;
7163         }
7164
7165         pull = ndr_pull_init_blob(&p->in_data.data, r);
7166         if (pull == NULL) {
7167                 talloc_free(r);
7168                 return false;
7169         }
7170
7171         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7172         if (p->endian) {
7173                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7174         }
7175         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7176         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7177                 talloc_free(r);
7178                 return false;
7179         }
7180
7181         if (DEBUGLEVEL >= 10) {
7182                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetworkState, NDR_IN, r);
7183         }
7184
7185         ZERO_STRUCT(r->out);
7186         r->out.State = talloc_zero(r, enum clusapi_ClusterNetworkState);
7187         if (r->out.State == NULL) {
7188                 talloc_free(r);
7189                 return false;
7190         }
7191
7192         r->out.rpc_status = talloc_zero(r, WERROR);
7193         if (r->out.rpc_status == NULL) {
7194                 talloc_free(r);
7195                 return false;
7196         }
7197
7198         r->out.result = _clusapi_GetNetworkState(p, r);
7199
7200         if (p->fault_state) {
7201                 talloc_free(r);
7202                 /* Return true here, srv_pipe_hnd.c will take care */
7203                 return true;
7204         }
7205
7206         if (DEBUGLEVEL >= 10) {
7207                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetworkState, NDR_OUT | NDR_SET_VALUES, r);
7208         }
7209
7210         push = ndr_push_init_ctx(r);
7211         if (push == NULL) {
7212                 talloc_free(r);
7213                 return false;
7214         }
7215
7216         /*
7217          * carry over the pointer count to the reply in case we are
7218          * using full pointer. See NDR specification for full pointers
7219          */
7220         push->ptr_count = pull->ptr_count;
7221
7222         ndr_err = call->ndr_push(push, NDR_OUT, r);
7223         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7224                 talloc_free(r);
7225                 return false;
7226         }
7227
7228         p->out_data.rdata = ndr_push_blob(push);
7229         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7230
7231         talloc_free(r);
7232
7233         return true;
7234 }
7235
7236 static bool api_clusapi_SetNetworkName(struct pipes_struct *p)
7237 {
7238         const struct ndr_interface_call *call;
7239         struct ndr_pull *pull;
7240         struct ndr_push *push;
7241         enum ndr_err_code ndr_err;
7242         struct clusapi_SetNetworkName *r;
7243
7244         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETNETWORKNAME];
7245
7246         r = talloc(talloc_tos(), struct clusapi_SetNetworkName);
7247         if (r == NULL) {
7248                 return false;
7249         }
7250
7251         pull = ndr_pull_init_blob(&p->in_data.data, r);
7252         if (pull == NULL) {
7253                 talloc_free(r);
7254                 return false;
7255         }
7256
7257         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7258         if (p->endian) {
7259                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7260         }
7261         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7262         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7263                 talloc_free(r);
7264                 return false;
7265         }
7266
7267         if (DEBUGLEVEL >= 10) {
7268                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetNetworkName, NDR_IN, r);
7269         }
7270
7271         ZERO_STRUCT(r->out);
7272         r->out.rpc_status = talloc_zero(r, WERROR);
7273         if (r->out.rpc_status == NULL) {
7274                 talloc_free(r);
7275                 return false;
7276         }
7277
7278         r->out.result = _clusapi_SetNetworkName(p, r);
7279
7280         if (p->fault_state) {
7281                 talloc_free(r);
7282                 /* Return true here, srv_pipe_hnd.c will take care */
7283                 return true;
7284         }
7285
7286         if (DEBUGLEVEL >= 10) {
7287                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetNetworkName, NDR_OUT | NDR_SET_VALUES, r);
7288         }
7289
7290         push = ndr_push_init_ctx(r);
7291         if (push == NULL) {
7292                 talloc_free(r);
7293                 return false;
7294         }
7295
7296         /*
7297          * carry over the pointer count to the reply in case we are
7298          * using full pointer. See NDR specification for full pointers
7299          */
7300         push->ptr_count = pull->ptr_count;
7301
7302         ndr_err = call->ndr_push(push, NDR_OUT, r);
7303         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7304                 talloc_free(r);
7305                 return false;
7306         }
7307
7308         p->out_data.rdata = ndr_push_blob(push);
7309         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7310
7311         talloc_free(r);
7312
7313         return true;
7314 }
7315
7316 static bool api_clusapi_CreateNetworkEnum(struct pipes_struct *p)
7317 {
7318         const struct ndr_interface_call *call;
7319         struct ndr_pull *pull;
7320         struct ndr_push *push;
7321         enum ndr_err_code ndr_err;
7322         struct clusapi_CreateNetworkEnum *r;
7323
7324         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATENETWORKENUM];
7325
7326         r = talloc(talloc_tos(), struct clusapi_CreateNetworkEnum);
7327         if (r == NULL) {
7328                 return false;
7329         }
7330
7331         pull = ndr_pull_init_blob(&p->in_data.data, r);
7332         if (pull == NULL) {
7333                 talloc_free(r);
7334                 return false;
7335         }
7336
7337         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7338         if (p->endian) {
7339                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7340         }
7341         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7342         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7343                 talloc_free(r);
7344                 return false;
7345         }
7346
7347         if (DEBUGLEVEL >= 10) {
7348                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNetworkEnum, NDR_IN, r);
7349         }
7350
7351         ZERO_STRUCT(r->out);
7352         r->out.ReturnEnum = talloc_zero(r, struct ENUM_LIST *);
7353         if (r->out.ReturnEnum == NULL) {
7354                 talloc_free(r);
7355                 return false;
7356         }
7357
7358         r->out.rpc_status = talloc_zero(r, WERROR);
7359         if (r->out.rpc_status == NULL) {
7360                 talloc_free(r);
7361                 return false;
7362         }
7363
7364         r->out.result = _clusapi_CreateNetworkEnum(p, r);
7365
7366         if (p->fault_state) {
7367                 talloc_free(r);
7368                 /* Return true here, srv_pipe_hnd.c will take care */
7369                 return true;
7370         }
7371
7372         if (DEBUGLEVEL >= 10) {
7373                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNetworkEnum, NDR_OUT | NDR_SET_VALUES, r);
7374         }
7375
7376         push = ndr_push_init_ctx(r);
7377         if (push == NULL) {
7378                 talloc_free(r);
7379                 return false;
7380         }
7381
7382         /*
7383          * carry over the pointer count to the reply in case we are
7384          * using full pointer. See NDR specification for full pointers
7385          */
7386         push->ptr_count = pull->ptr_count;
7387
7388         ndr_err = call->ndr_push(push, NDR_OUT, r);
7389         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7390                 talloc_free(r);
7391                 return false;
7392         }
7393
7394         p->out_data.rdata = ndr_push_blob(push);
7395         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7396
7397         talloc_free(r);
7398
7399         return true;
7400 }
7401
7402 static bool api_clusapi_GetNetworkId(struct pipes_struct *p)
7403 {
7404         const struct ndr_interface_call *call;
7405         struct ndr_pull *pull;
7406         struct ndr_push *push;
7407         enum ndr_err_code ndr_err;
7408         struct clusapi_GetNetworkId *r;
7409
7410         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNETWORKID];
7411
7412         r = talloc(talloc_tos(), struct clusapi_GetNetworkId);
7413         if (r == NULL) {
7414                 return false;
7415         }
7416
7417         pull = ndr_pull_init_blob(&p->in_data.data, r);
7418         if (pull == NULL) {
7419                 talloc_free(r);
7420                 return false;
7421         }
7422
7423         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7424         if (p->endian) {
7425                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7426         }
7427         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7428         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7429                 talloc_free(r);
7430                 return false;
7431         }
7432
7433         if (DEBUGLEVEL >= 10) {
7434                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetworkId, NDR_IN, r);
7435         }
7436
7437         ZERO_STRUCT(r->out);
7438         r->out.pGuid = talloc_zero(r, const char *);
7439         if (r->out.pGuid == NULL) {
7440                 talloc_free(r);
7441                 return false;
7442         }
7443
7444         r->out.rpc_status = talloc_zero(r, WERROR);
7445         if (r->out.rpc_status == NULL) {
7446                 talloc_free(r);
7447                 return false;
7448         }
7449
7450         r->out.result = _clusapi_GetNetworkId(p, r);
7451
7452         if (p->fault_state) {
7453                 talloc_free(r);
7454                 /* Return true here, srv_pipe_hnd.c will take care */
7455                 return true;
7456         }
7457
7458         if (DEBUGLEVEL >= 10) {
7459                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetworkId, NDR_OUT | NDR_SET_VALUES, r);
7460         }
7461
7462         push = ndr_push_init_ctx(r);
7463         if (push == NULL) {
7464                 talloc_free(r);
7465                 return false;
7466         }
7467
7468         /*
7469          * carry over the pointer count to the reply in case we are
7470          * using full pointer. See NDR specification for full pointers
7471          */
7472         push->ptr_count = pull->ptr_count;
7473
7474         ndr_err = call->ndr_push(push, NDR_OUT, r);
7475         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7476                 talloc_free(r);
7477                 return false;
7478         }
7479
7480         p->out_data.rdata = ndr_push_blob(push);
7481         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7482
7483         talloc_free(r);
7484
7485         return true;
7486 }
7487
7488 static bool api_clusapi_SetNetworkPriorityOrder(struct pipes_struct *p)
7489 {
7490         const struct ndr_interface_call *call;
7491         struct ndr_pull *pull;
7492         struct ndr_push *push;
7493         enum ndr_err_code ndr_err;
7494         struct clusapi_SetNetworkPriorityOrder *r;
7495
7496         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETNETWORKPRIORITYORDER];
7497
7498         r = talloc(talloc_tos(), struct clusapi_SetNetworkPriorityOrder);
7499         if (r == NULL) {
7500                 return false;
7501         }
7502
7503         pull = ndr_pull_init_blob(&p->in_data.data, r);
7504         if (pull == NULL) {
7505                 talloc_free(r);
7506                 return false;
7507         }
7508
7509         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7510         if (p->endian) {
7511                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7512         }
7513         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7514         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7515                 talloc_free(r);
7516                 return false;
7517         }
7518
7519         if (DEBUGLEVEL >= 10) {
7520                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetNetworkPriorityOrder, NDR_IN, r);
7521         }
7522
7523         ZERO_STRUCT(r->out);
7524         r->out.rpc_status = talloc_zero(r, WERROR);
7525         if (r->out.rpc_status == NULL) {
7526                 talloc_free(r);
7527                 return false;
7528         }
7529
7530         r->out.result = _clusapi_SetNetworkPriorityOrder(p, r);
7531
7532         if (p->fault_state) {
7533                 talloc_free(r);
7534                 /* Return true here, srv_pipe_hnd.c will take care */
7535                 return true;
7536         }
7537
7538         if (DEBUGLEVEL >= 10) {
7539                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetNetworkPriorityOrder, NDR_OUT | NDR_SET_VALUES, r);
7540         }
7541
7542         push = ndr_push_init_ctx(r);
7543         if (push == NULL) {
7544                 talloc_free(r);
7545                 return false;
7546         }
7547
7548         /*
7549          * carry over the pointer count to the reply in case we are
7550          * using full pointer. See NDR specification for full pointers
7551          */
7552         push->ptr_count = pull->ptr_count;
7553
7554         ndr_err = call->ndr_push(push, NDR_OUT, r);
7555         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7556                 talloc_free(r);
7557                 return false;
7558         }
7559
7560         p->out_data.rdata = ndr_push_blob(push);
7561         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7562
7563         talloc_free(r);
7564
7565         return true;
7566 }
7567
7568 static bool api_clusapi_NodeNetworkControl(struct pipes_struct *p)
7569 {
7570         const struct ndr_interface_call *call;
7571         struct ndr_pull *pull;
7572         struct ndr_push *push;
7573         enum ndr_err_code ndr_err;
7574         struct clusapi_NodeNetworkControl *r;
7575
7576         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODENETWORKCONTROL];
7577
7578         r = talloc(talloc_tos(), struct clusapi_NodeNetworkControl);
7579         if (r == NULL) {
7580                 return false;
7581         }
7582
7583         pull = ndr_pull_init_blob(&p->in_data.data, r);
7584         if (pull == NULL) {
7585                 talloc_free(r);
7586                 return false;
7587         }
7588
7589         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7590         if (p->endian) {
7591                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7592         }
7593         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7594         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7595                 talloc_free(r);
7596                 return false;
7597         }
7598
7599         if (DEBUGLEVEL >= 10) {
7600                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeNetworkControl, NDR_IN, r);
7601         }
7602
7603         ZERO_STRUCT(r->out);
7604         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
7605         if (r->out.lpOutBuffer == NULL) {
7606                 talloc_free(r);
7607                 return false;
7608         }
7609
7610         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
7611         if (r->out.lpBytesReturned == NULL) {
7612                 talloc_free(r);
7613                 return false;
7614         }
7615
7616         r->out.lpcbRequired = talloc_zero(r, uint32_t);
7617         if (r->out.lpcbRequired == NULL) {
7618                 talloc_free(r);
7619                 return false;
7620         }
7621
7622         r->out.rpc_status = talloc_zero(r, WERROR);
7623         if (r->out.rpc_status == NULL) {
7624                 talloc_free(r);
7625                 return false;
7626         }
7627
7628         r->out.result = _clusapi_NodeNetworkControl(p, r);
7629
7630         if (p->fault_state) {
7631                 talloc_free(r);
7632                 /* Return true here, srv_pipe_hnd.c will take care */
7633                 return true;
7634         }
7635
7636         if (DEBUGLEVEL >= 10) {
7637                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeNetworkControl, NDR_OUT | NDR_SET_VALUES, r);
7638         }
7639
7640         push = ndr_push_init_ctx(r);
7641         if (push == NULL) {
7642                 talloc_free(r);
7643                 return false;
7644         }
7645
7646         /*
7647          * carry over the pointer count to the reply in case we are
7648          * using full pointer. See NDR specification for full pointers
7649          */
7650         push->ptr_count = pull->ptr_count;
7651
7652         ndr_err = call->ndr_push(push, NDR_OUT, r);
7653         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7654                 talloc_free(r);
7655                 return false;
7656         }
7657
7658         p->out_data.rdata = ndr_push_blob(push);
7659         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7660
7661         talloc_free(r);
7662
7663         return true;
7664 }
7665
7666 static bool api_clusapi_NetworkControl(struct pipes_struct *p)
7667 {
7668         const struct ndr_interface_call *call;
7669         struct ndr_pull *pull;
7670         struct ndr_push *push;
7671         enum ndr_err_code ndr_err;
7672         struct clusapi_NetworkControl *r;
7673
7674         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NETWORKCONTROL];
7675
7676         r = talloc(talloc_tos(), struct clusapi_NetworkControl);
7677         if (r == NULL) {
7678                 return false;
7679         }
7680
7681         pull = ndr_pull_init_blob(&p->in_data.data, r);
7682         if (pull == NULL) {
7683                 talloc_free(r);
7684                 return false;
7685         }
7686
7687         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7688         if (p->endian) {
7689                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7690         }
7691         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7692         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7693                 talloc_free(r);
7694                 return false;
7695         }
7696
7697         if (DEBUGLEVEL >= 10) {
7698                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NetworkControl, NDR_IN, r);
7699         }
7700
7701         ZERO_STRUCT(r->out);
7702         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
7703         if (r->out.lpOutBuffer == NULL) {
7704                 talloc_free(r);
7705                 return false;
7706         }
7707
7708         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
7709         if (r->out.lpBytesReturned == NULL) {
7710                 talloc_free(r);
7711                 return false;
7712         }
7713
7714         r->out.lpcbRequired = talloc_zero(r, uint32_t);
7715         if (r->out.lpcbRequired == NULL) {
7716                 talloc_free(r);
7717                 return false;
7718         }
7719
7720         r->out.rpc_status = talloc_zero(r, WERROR);
7721         if (r->out.rpc_status == NULL) {
7722                 talloc_free(r);
7723                 return false;
7724         }
7725
7726         r->out.result = _clusapi_NetworkControl(p, r);
7727
7728         if (p->fault_state) {
7729                 talloc_free(r);
7730                 /* Return true here, srv_pipe_hnd.c will take care */
7731                 return true;
7732         }
7733
7734         if (DEBUGLEVEL >= 10) {
7735                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NetworkControl, NDR_OUT | NDR_SET_VALUES, r);
7736         }
7737
7738         push = ndr_push_init_ctx(r);
7739         if (push == NULL) {
7740                 talloc_free(r);
7741                 return false;
7742         }
7743
7744         /*
7745          * carry over the pointer count to the reply in case we are
7746          * using full pointer. See NDR specification for full pointers
7747          */
7748         push->ptr_count = pull->ptr_count;
7749
7750         ndr_err = call->ndr_push(push, NDR_OUT, r);
7751         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7752                 talloc_free(r);
7753                 return false;
7754         }
7755
7756         p->out_data.rdata = ndr_push_blob(push);
7757         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7758
7759         talloc_free(r);
7760
7761         return true;
7762 }
7763
7764 static bool api_clusapi_AddNotifyNetwork(struct pipes_struct *p)
7765 {
7766         const struct ndr_interface_call *call;
7767         struct ndr_pull *pull;
7768         struct ndr_push *push;
7769         enum ndr_err_code ndr_err;
7770         struct clusapi_AddNotifyNetwork *r;
7771
7772         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYNETWORK];
7773
7774         r = talloc(talloc_tos(), struct clusapi_AddNotifyNetwork);
7775         if (r == NULL) {
7776                 return false;
7777         }
7778
7779         pull = ndr_pull_init_blob(&p->in_data.data, r);
7780         if (pull == NULL) {
7781                 talloc_free(r);
7782                 return false;
7783         }
7784
7785         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7786         if (p->endian) {
7787                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7788         }
7789         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7790         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7791                 talloc_free(r);
7792                 return false;
7793         }
7794
7795         if (DEBUGLEVEL >= 10) {
7796                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyNetwork, NDR_IN, r);
7797         }
7798
7799         ZERO_STRUCT(r->out);
7800         r->out.dwStateSequence = talloc_zero(r, uint32_t);
7801         if (r->out.dwStateSequence == NULL) {
7802                 talloc_free(r);
7803                 return false;
7804         }
7805
7806         r->out.rpc_status = talloc_zero(r, WERROR);
7807         if (r->out.rpc_status == NULL) {
7808                 talloc_free(r);
7809                 return false;
7810         }
7811
7812         r->out.result = _clusapi_AddNotifyNetwork(p, r);
7813
7814         if (p->fault_state) {
7815                 talloc_free(r);
7816                 /* Return true here, srv_pipe_hnd.c will take care */
7817                 return true;
7818         }
7819
7820         if (DEBUGLEVEL >= 10) {
7821                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyNetwork, NDR_OUT | NDR_SET_VALUES, r);
7822         }
7823
7824         push = ndr_push_init_ctx(r);
7825         if (push == NULL) {
7826                 talloc_free(r);
7827                 return false;
7828         }
7829
7830         /*
7831          * carry over the pointer count to the reply in case we are
7832          * using full pointer. See NDR specification for full pointers
7833          */
7834         push->ptr_count = pull->ptr_count;
7835
7836         ndr_err = call->ndr_push(push, NDR_OUT, r);
7837         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7838                 talloc_free(r);
7839                 return false;
7840         }
7841
7842         p->out_data.rdata = ndr_push_blob(push);
7843         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7844
7845         talloc_free(r);
7846
7847         return true;
7848 }
7849
7850 static bool api_clusapi_ReAddNotifyNetwork(struct pipes_struct *p)
7851 {
7852         const struct ndr_interface_call *call;
7853         struct ndr_pull *pull;
7854         struct ndr_push *push;
7855         enum ndr_err_code ndr_err;
7856         struct clusapi_ReAddNotifyNetwork *r;
7857
7858         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_READDNOTIFYNETWORK];
7859
7860         r = talloc(talloc_tos(), struct clusapi_ReAddNotifyNetwork);
7861         if (r == NULL) {
7862                 return false;
7863         }
7864
7865         pull = ndr_pull_init_blob(&p->in_data.data, r);
7866         if (pull == NULL) {
7867                 talloc_free(r);
7868                 return false;
7869         }
7870
7871         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7872         if (p->endian) {
7873                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7874         }
7875         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7876         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7877                 talloc_free(r);
7878                 return false;
7879         }
7880
7881         if (DEBUGLEVEL >= 10) {
7882                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyNetwork, NDR_IN, r);
7883         }
7884
7885         ZERO_STRUCT(r->out);
7886         r->out.rpc_status = talloc_zero(r, WERROR);
7887         if (r->out.rpc_status == NULL) {
7888                 talloc_free(r);
7889                 return false;
7890         }
7891
7892         r->out.result = _clusapi_ReAddNotifyNetwork(p, r);
7893
7894         if (p->fault_state) {
7895                 talloc_free(r);
7896                 /* Return true here, srv_pipe_hnd.c will take care */
7897                 return true;
7898         }
7899
7900         if (DEBUGLEVEL >= 10) {
7901                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyNetwork, NDR_OUT | NDR_SET_VALUES, r);
7902         }
7903
7904         push = ndr_push_init_ctx(r);
7905         if (push == NULL) {
7906                 talloc_free(r);
7907                 return false;
7908         }
7909
7910         /*
7911          * carry over the pointer count to the reply in case we are
7912          * using full pointer. See NDR specification for full pointers
7913          */
7914         push->ptr_count = pull->ptr_count;
7915
7916         ndr_err = call->ndr_push(push, NDR_OUT, r);
7917         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7918                 talloc_free(r);
7919                 return false;
7920         }
7921
7922         p->out_data.rdata = ndr_push_blob(push);
7923         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
7924
7925         talloc_free(r);
7926
7927         return true;
7928 }
7929
7930 static bool api_clusapi_OpenNetInterface(struct pipes_struct *p)
7931 {
7932         const struct ndr_interface_call *call;
7933         struct ndr_pull *pull;
7934         struct ndr_push *push;
7935         enum ndr_err_code ndr_err;
7936         struct clusapi_OpenNetInterface *r;
7937
7938         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENNETINTERFACE];
7939
7940         r = talloc(talloc_tos(), struct clusapi_OpenNetInterface);
7941         if (r == NULL) {
7942                 return false;
7943         }
7944
7945         pull = ndr_pull_init_blob(&p->in_data.data, r);
7946         if (pull == NULL) {
7947                 talloc_free(r);
7948                 return false;
7949         }
7950
7951         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
7952         if (p->endian) {
7953                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
7954         }
7955         ndr_err = call->ndr_pull(pull, NDR_IN, r);
7956         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
7957                 talloc_free(r);
7958                 return false;
7959         }
7960
7961         if (DEBUGLEVEL >= 10) {
7962                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetInterface, NDR_IN, r);
7963         }
7964
7965         ZERO_STRUCT(r->out);
7966         r->out.Status = talloc_zero(r, WERROR);
7967         if (r->out.Status == NULL) {
7968                 talloc_free(r);
7969                 return false;
7970         }
7971
7972         r->out.rpc_status = talloc_zero(r, WERROR);
7973         if (r->out.rpc_status == NULL) {
7974                 talloc_free(r);
7975                 return false;
7976         }
7977
7978         r->out.hNetInterface = talloc_zero(r, struct policy_handle);
7979         if (r->out.hNetInterface == NULL) {
7980                 talloc_free(r);
7981                 return false;
7982         }
7983
7984         _clusapi_OpenNetInterface(p, r);
7985
7986         if (p->fault_state) {
7987                 talloc_free(r);
7988                 /* Return true here, srv_pipe_hnd.c will take care */
7989                 return true;
7990         }
7991
7992         if (DEBUGLEVEL >= 10) {
7993                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetInterface, NDR_OUT | NDR_SET_VALUES, r);
7994         }
7995
7996         push = ndr_push_init_ctx(r);
7997         if (push == NULL) {
7998                 talloc_free(r);
7999                 return false;
8000         }
8001
8002         /*
8003          * carry over the pointer count to the reply in case we are
8004          * using full pointer. See NDR specification for full pointers
8005          */
8006         push->ptr_count = pull->ptr_count;
8007
8008         ndr_err = call->ndr_push(push, NDR_OUT, r);
8009         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8010                 talloc_free(r);
8011                 return false;
8012         }
8013
8014         p->out_data.rdata = ndr_push_blob(push);
8015         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8016
8017         talloc_free(r);
8018
8019         return true;
8020 }
8021
8022 static bool api_clusapi_CloseNetInterface(struct pipes_struct *p)
8023 {
8024         const struct ndr_interface_call *call;
8025         struct ndr_pull *pull;
8026         struct ndr_push *push;
8027         enum ndr_err_code ndr_err;
8028         struct clusapi_CloseNetInterface *r;
8029
8030         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSENETINTERFACE];
8031
8032         r = talloc(talloc_tos(), struct clusapi_CloseNetInterface);
8033         if (r == NULL) {
8034                 return false;
8035         }
8036
8037         pull = ndr_pull_init_blob(&p->in_data.data, r);
8038         if (pull == NULL) {
8039                 talloc_free(r);
8040                 return false;
8041         }
8042
8043         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8044         if (p->endian) {
8045                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8046         }
8047         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8048         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8049                 talloc_free(r);
8050                 return false;
8051         }
8052
8053         if (DEBUGLEVEL >= 10) {
8054                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNetInterface, NDR_IN, r);
8055         }
8056
8057         ZERO_STRUCT(r->out);
8058         r->out.NetInterface = r->in.NetInterface;
8059         r->out.result = _clusapi_CloseNetInterface(p, r);
8060
8061         if (p->fault_state) {
8062                 talloc_free(r);
8063                 /* Return true here, srv_pipe_hnd.c will take care */
8064                 return true;
8065         }
8066
8067         if (DEBUGLEVEL >= 10) {
8068                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseNetInterface, NDR_OUT | NDR_SET_VALUES, r);
8069         }
8070
8071         push = ndr_push_init_ctx(r);
8072         if (push == NULL) {
8073                 talloc_free(r);
8074                 return false;
8075         }
8076
8077         /*
8078          * carry over the pointer count to the reply in case we are
8079          * using full pointer. See NDR specification for full pointers
8080          */
8081         push->ptr_count = pull->ptr_count;
8082
8083         ndr_err = call->ndr_push(push, NDR_OUT, r);
8084         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8085                 talloc_free(r);
8086                 return false;
8087         }
8088
8089         p->out_data.rdata = ndr_push_blob(push);
8090         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8091
8092         talloc_free(r);
8093
8094         return true;
8095 }
8096
8097 static bool api_clusapi_GetNetInterfaceState(struct pipes_struct *p)
8098 {
8099         const struct ndr_interface_call *call;
8100         struct ndr_pull *pull;
8101         struct ndr_push *push;
8102         enum ndr_err_code ndr_err;
8103         struct clusapi_GetNetInterfaceState *r;
8104
8105         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNETINTERFACESTATE];
8106
8107         r = talloc(talloc_tos(), struct clusapi_GetNetInterfaceState);
8108         if (r == NULL) {
8109                 return false;
8110         }
8111
8112         pull = ndr_pull_init_blob(&p->in_data.data, r);
8113         if (pull == NULL) {
8114                 talloc_free(r);
8115                 return false;
8116         }
8117
8118         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8119         if (p->endian) {
8120                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8121         }
8122         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8123         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8124                 talloc_free(r);
8125                 return false;
8126         }
8127
8128         if (DEBUGLEVEL >= 10) {
8129                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetInterfaceState, NDR_IN, r);
8130         }
8131
8132         ZERO_STRUCT(r->out);
8133         r->out.State = talloc_zero(r, enum clusapi_ClusterNetInterfaceState);
8134         if (r->out.State == NULL) {
8135                 talloc_free(r);
8136                 return false;
8137         }
8138
8139         r->out.rpc_status = talloc_zero(r, WERROR);
8140         if (r->out.rpc_status == NULL) {
8141                 talloc_free(r);
8142                 return false;
8143         }
8144
8145         r->out.result = _clusapi_GetNetInterfaceState(p, r);
8146
8147         if (p->fault_state) {
8148                 talloc_free(r);
8149                 /* Return true here, srv_pipe_hnd.c will take care */
8150                 return true;
8151         }
8152
8153         if (DEBUGLEVEL >= 10) {
8154                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetInterfaceState, NDR_OUT | NDR_SET_VALUES, r);
8155         }
8156
8157         push = ndr_push_init_ctx(r);
8158         if (push == NULL) {
8159                 talloc_free(r);
8160                 return false;
8161         }
8162
8163         /*
8164          * carry over the pointer count to the reply in case we are
8165          * using full pointer. See NDR specification for full pointers
8166          */
8167         push->ptr_count = pull->ptr_count;
8168
8169         ndr_err = call->ndr_push(push, NDR_OUT, r);
8170         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8171                 talloc_free(r);
8172                 return false;
8173         }
8174
8175         p->out_data.rdata = ndr_push_blob(push);
8176         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8177
8178         talloc_free(r);
8179
8180         return true;
8181 }
8182
8183 static bool api_clusapi_GetNetInterface(struct pipes_struct *p)
8184 {
8185         const struct ndr_interface_call *call;
8186         struct ndr_pull *pull;
8187         struct ndr_push *push;
8188         enum ndr_err_code ndr_err;
8189         struct clusapi_GetNetInterface *r;
8190
8191         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNETINTERFACE];
8192
8193         r = talloc(talloc_tos(), struct clusapi_GetNetInterface);
8194         if (r == NULL) {
8195                 return false;
8196         }
8197
8198         pull = ndr_pull_init_blob(&p->in_data.data, r);
8199         if (pull == NULL) {
8200                 talloc_free(r);
8201                 return false;
8202         }
8203
8204         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8205         if (p->endian) {
8206                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8207         }
8208         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8209         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8210                 talloc_free(r);
8211                 return false;
8212         }
8213
8214         if (DEBUGLEVEL >= 10) {
8215                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetInterface, NDR_IN, r);
8216         }
8217
8218         ZERO_STRUCT(r->out);
8219         r->out.lppszInterfaceName = talloc_zero(r, const char *);
8220         if (r->out.lppszInterfaceName == NULL) {
8221                 talloc_free(r);
8222                 return false;
8223         }
8224
8225         r->out.rpc_status = talloc_zero(r, WERROR);
8226         if (r->out.rpc_status == NULL) {
8227                 talloc_free(r);
8228                 return false;
8229         }
8230
8231         r->out.result = _clusapi_GetNetInterface(p, r);
8232
8233         if (p->fault_state) {
8234                 talloc_free(r);
8235                 /* Return true here, srv_pipe_hnd.c will take care */
8236                 return true;
8237         }
8238
8239         if (DEBUGLEVEL >= 10) {
8240                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetInterface, NDR_OUT | NDR_SET_VALUES, r);
8241         }
8242
8243         push = ndr_push_init_ctx(r);
8244         if (push == NULL) {
8245                 talloc_free(r);
8246                 return false;
8247         }
8248
8249         /*
8250          * carry over the pointer count to the reply in case we are
8251          * using full pointer. See NDR specification for full pointers
8252          */
8253         push->ptr_count = pull->ptr_count;
8254
8255         ndr_err = call->ndr_push(push, NDR_OUT, r);
8256         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8257                 talloc_free(r);
8258                 return false;
8259         }
8260
8261         p->out_data.rdata = ndr_push_blob(push);
8262         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8263
8264         talloc_free(r);
8265
8266         return true;
8267 }
8268
8269 static bool api_clusapi_GetNetInterfaceId(struct pipes_struct *p)
8270 {
8271         const struct ndr_interface_call *call;
8272         struct ndr_pull *pull;
8273         struct ndr_push *push;
8274         enum ndr_err_code ndr_err;
8275         struct clusapi_GetNetInterfaceId *r;
8276
8277         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNETINTERFACEID];
8278
8279         r = talloc(talloc_tos(), struct clusapi_GetNetInterfaceId);
8280         if (r == NULL) {
8281                 return false;
8282         }
8283
8284         pull = ndr_pull_init_blob(&p->in_data.data, r);
8285         if (pull == NULL) {
8286                 talloc_free(r);
8287                 return false;
8288         }
8289
8290         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8291         if (p->endian) {
8292                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8293         }
8294         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8295         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8296                 talloc_free(r);
8297                 return false;
8298         }
8299
8300         if (DEBUGLEVEL >= 10) {
8301                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetInterfaceId, NDR_IN, r);
8302         }
8303
8304         ZERO_STRUCT(r->out);
8305         r->out.pGuid = talloc_zero(r, const char *);
8306         if (r->out.pGuid == NULL) {
8307                 talloc_free(r);
8308                 return false;
8309         }
8310
8311         r->out.rpc_status = talloc_zero(r, WERROR);
8312         if (r->out.rpc_status == NULL) {
8313                 talloc_free(r);
8314                 return false;
8315         }
8316
8317         r->out.result = _clusapi_GetNetInterfaceId(p, r);
8318
8319         if (p->fault_state) {
8320                 talloc_free(r);
8321                 /* Return true here, srv_pipe_hnd.c will take care */
8322                 return true;
8323         }
8324
8325         if (DEBUGLEVEL >= 10) {
8326                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNetInterfaceId, NDR_OUT | NDR_SET_VALUES, r);
8327         }
8328
8329         push = ndr_push_init_ctx(r);
8330         if (push == NULL) {
8331                 talloc_free(r);
8332                 return false;
8333         }
8334
8335         /*
8336          * carry over the pointer count to the reply in case we are
8337          * using full pointer. See NDR specification for full pointers
8338          */
8339         push->ptr_count = pull->ptr_count;
8340
8341         ndr_err = call->ndr_push(push, NDR_OUT, r);
8342         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8343                 talloc_free(r);
8344                 return false;
8345         }
8346
8347         p->out_data.rdata = ndr_push_blob(push);
8348         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8349
8350         talloc_free(r);
8351
8352         return true;
8353 }
8354
8355 static bool api_clusapi_NodeNetInterfaceControl(struct pipes_struct *p)
8356 {
8357         const struct ndr_interface_call *call;
8358         struct ndr_pull *pull;
8359         struct ndr_push *push;
8360         enum ndr_err_code ndr_err;
8361         struct clusapi_NodeNetInterfaceControl *r;
8362
8363         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODENETINTERFACECONTROL];
8364
8365         r = talloc(talloc_tos(), struct clusapi_NodeNetInterfaceControl);
8366         if (r == NULL) {
8367                 return false;
8368         }
8369
8370         pull = ndr_pull_init_blob(&p->in_data.data, r);
8371         if (pull == NULL) {
8372                 talloc_free(r);
8373                 return false;
8374         }
8375
8376         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8377         if (p->endian) {
8378                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8379         }
8380         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8381         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8382                 talloc_free(r);
8383                 return false;
8384         }
8385
8386         if (DEBUGLEVEL >= 10) {
8387                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeNetInterfaceControl, NDR_IN, r);
8388         }
8389
8390         ZERO_STRUCT(r->out);
8391         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
8392         if (r->out.lpOutBuffer == NULL) {
8393                 talloc_free(r);
8394                 return false;
8395         }
8396
8397         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
8398         if (r->out.lpBytesReturned == NULL) {
8399                 talloc_free(r);
8400                 return false;
8401         }
8402
8403         r->out.lpcbRequired = talloc_zero(r, uint32_t);
8404         if (r->out.lpcbRequired == NULL) {
8405                 talloc_free(r);
8406                 return false;
8407         }
8408
8409         r->out.rpc_status = talloc_zero(r, WERROR);
8410         if (r->out.rpc_status == NULL) {
8411                 talloc_free(r);
8412                 return false;
8413         }
8414
8415         r->out.result = _clusapi_NodeNetInterfaceControl(p, r);
8416
8417         if (p->fault_state) {
8418                 talloc_free(r);
8419                 /* Return true here, srv_pipe_hnd.c will take care */
8420                 return true;
8421         }
8422
8423         if (DEBUGLEVEL >= 10) {
8424                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeNetInterfaceControl, NDR_OUT | NDR_SET_VALUES, r);
8425         }
8426
8427         push = ndr_push_init_ctx(r);
8428         if (push == NULL) {
8429                 talloc_free(r);
8430                 return false;
8431         }
8432
8433         /*
8434          * carry over the pointer count to the reply in case we are
8435          * using full pointer. See NDR specification for full pointers
8436          */
8437         push->ptr_count = pull->ptr_count;
8438
8439         ndr_err = call->ndr_push(push, NDR_OUT, r);
8440         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8441                 talloc_free(r);
8442                 return false;
8443         }
8444
8445         p->out_data.rdata = ndr_push_blob(push);
8446         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8447
8448         talloc_free(r);
8449
8450         return true;
8451 }
8452
8453 static bool api_clusapi_NetInterfaceControl(struct pipes_struct *p)
8454 {
8455         const struct ndr_interface_call *call;
8456         struct ndr_pull *pull;
8457         struct ndr_push *push;
8458         enum ndr_err_code ndr_err;
8459         struct clusapi_NetInterfaceControl *r;
8460
8461         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NETINTERFACECONTROL];
8462
8463         r = talloc(talloc_tos(), struct clusapi_NetInterfaceControl);
8464         if (r == NULL) {
8465                 return false;
8466         }
8467
8468         pull = ndr_pull_init_blob(&p->in_data.data, r);
8469         if (pull == NULL) {
8470                 talloc_free(r);
8471                 return false;
8472         }
8473
8474         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8475         if (p->endian) {
8476                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8477         }
8478         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8479         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8480                 talloc_free(r);
8481                 return false;
8482         }
8483
8484         if (DEBUGLEVEL >= 10) {
8485                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NetInterfaceControl, NDR_IN, r);
8486         }
8487
8488         ZERO_STRUCT(r->out);
8489         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
8490         if (r->out.lpOutBuffer == NULL) {
8491                 talloc_free(r);
8492                 return false;
8493         }
8494
8495         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
8496         if (r->out.lpBytesReturned == NULL) {
8497                 talloc_free(r);
8498                 return false;
8499         }
8500
8501         r->out.lpcbRequired = talloc_zero(r, uint32_t);
8502         if (r->out.lpcbRequired == NULL) {
8503                 talloc_free(r);
8504                 return false;
8505         }
8506
8507         r->out.rpc_status = talloc_zero(r, WERROR);
8508         if (r->out.rpc_status == NULL) {
8509                 talloc_free(r);
8510                 return false;
8511         }
8512
8513         r->out.result = _clusapi_NetInterfaceControl(p, r);
8514
8515         if (p->fault_state) {
8516                 talloc_free(r);
8517                 /* Return true here, srv_pipe_hnd.c will take care */
8518                 return true;
8519         }
8520
8521         if (DEBUGLEVEL >= 10) {
8522                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NetInterfaceControl, NDR_OUT | NDR_SET_VALUES, r);
8523         }
8524
8525         push = ndr_push_init_ctx(r);
8526         if (push == NULL) {
8527                 talloc_free(r);
8528                 return false;
8529         }
8530
8531         /*
8532          * carry over the pointer count to the reply in case we are
8533          * using full pointer. See NDR specification for full pointers
8534          */
8535         push->ptr_count = pull->ptr_count;
8536
8537         ndr_err = call->ndr_push(push, NDR_OUT, r);
8538         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8539                 talloc_free(r);
8540                 return false;
8541         }
8542
8543         p->out_data.rdata = ndr_push_blob(push);
8544         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8545
8546         talloc_free(r);
8547
8548         return true;
8549 }
8550
8551 static bool api_clusapi_AddNotifyNetInterface(struct pipes_struct *p)
8552 {
8553         const struct ndr_interface_call *call;
8554         struct ndr_pull *pull;
8555         struct ndr_push *push;
8556         enum ndr_err_code ndr_err;
8557         struct clusapi_AddNotifyNetInterface *r;
8558
8559         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYNETINTERFACE];
8560
8561         r = talloc(talloc_tos(), struct clusapi_AddNotifyNetInterface);
8562         if (r == NULL) {
8563                 return false;
8564         }
8565
8566         pull = ndr_pull_init_blob(&p->in_data.data, r);
8567         if (pull == NULL) {
8568                 talloc_free(r);
8569                 return false;
8570         }
8571
8572         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8573         if (p->endian) {
8574                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8575         }
8576         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8577         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8578                 talloc_free(r);
8579                 return false;
8580         }
8581
8582         if (DEBUGLEVEL >= 10) {
8583                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyNetInterface, NDR_IN, r);
8584         }
8585
8586         ZERO_STRUCT(r->out);
8587         r->out.dwStateSequence = talloc_zero(r, uint32_t);
8588         if (r->out.dwStateSequence == NULL) {
8589                 talloc_free(r);
8590                 return false;
8591         }
8592
8593         r->out.rpc_status = talloc_zero(r, WERROR);
8594         if (r->out.rpc_status == NULL) {
8595                 talloc_free(r);
8596                 return false;
8597         }
8598
8599         r->out.result = _clusapi_AddNotifyNetInterface(p, r);
8600
8601         if (p->fault_state) {
8602                 talloc_free(r);
8603                 /* Return true here, srv_pipe_hnd.c will take care */
8604                 return true;
8605         }
8606
8607         if (DEBUGLEVEL >= 10) {
8608                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyNetInterface, NDR_OUT | NDR_SET_VALUES, r);
8609         }
8610
8611         push = ndr_push_init_ctx(r);
8612         if (push == NULL) {
8613                 talloc_free(r);
8614                 return false;
8615         }
8616
8617         /*
8618          * carry over the pointer count to the reply in case we are
8619          * using full pointer. See NDR specification for full pointers
8620          */
8621         push->ptr_count = pull->ptr_count;
8622
8623         ndr_err = call->ndr_push(push, NDR_OUT, r);
8624         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8625                 talloc_free(r);
8626                 return false;
8627         }
8628
8629         p->out_data.rdata = ndr_push_blob(push);
8630         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8631
8632         talloc_free(r);
8633
8634         return true;
8635 }
8636
8637 static bool api_clusapi_ReAddNotifyNetInterface(struct pipes_struct *p)
8638 {
8639         const struct ndr_interface_call *call;
8640         struct ndr_pull *pull;
8641         struct ndr_push *push;
8642         enum ndr_err_code ndr_err;
8643         struct clusapi_ReAddNotifyNetInterface *r;
8644
8645         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_READDNOTIFYNETINTERFACE];
8646
8647         r = talloc(talloc_tos(), struct clusapi_ReAddNotifyNetInterface);
8648         if (r == NULL) {
8649                 return false;
8650         }
8651
8652         pull = ndr_pull_init_blob(&p->in_data.data, r);
8653         if (pull == NULL) {
8654                 talloc_free(r);
8655                 return false;
8656         }
8657
8658         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8659         if (p->endian) {
8660                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8661         }
8662         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8663         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8664                 talloc_free(r);
8665                 return false;
8666         }
8667
8668         if (DEBUGLEVEL >= 10) {
8669                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyNetInterface, NDR_IN, r);
8670         }
8671
8672         ZERO_STRUCT(r->out);
8673         r->out.rpc_status = talloc_zero(r, WERROR);
8674         if (r->out.rpc_status == NULL) {
8675                 talloc_free(r);
8676                 return false;
8677         }
8678
8679         r->out.result = _clusapi_ReAddNotifyNetInterface(p, r);
8680
8681         if (p->fault_state) {
8682                 talloc_free(r);
8683                 /* Return true here, srv_pipe_hnd.c will take care */
8684                 return true;
8685         }
8686
8687         if (DEBUGLEVEL >= 10) {
8688                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ReAddNotifyNetInterface, NDR_OUT | NDR_SET_VALUES, r);
8689         }
8690
8691         push = ndr_push_init_ctx(r);
8692         if (push == NULL) {
8693                 talloc_free(r);
8694                 return false;
8695         }
8696
8697         /*
8698          * carry over the pointer count to the reply in case we are
8699          * using full pointer. See NDR specification for full pointers
8700          */
8701         push->ptr_count = pull->ptr_count;
8702
8703         ndr_err = call->ndr_push(push, NDR_OUT, r);
8704         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8705                 talloc_free(r);
8706                 return false;
8707         }
8708
8709         p->out_data.rdata = ndr_push_blob(push);
8710         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8711
8712         talloc_free(r);
8713
8714         return true;
8715 }
8716
8717 static bool api_clusapi_CreateNodeEnum(struct pipes_struct *p)
8718 {
8719         const struct ndr_interface_call *call;
8720         struct ndr_pull *pull;
8721         struct ndr_push *push;
8722         enum ndr_err_code ndr_err;
8723         struct clusapi_CreateNodeEnum *r;
8724
8725         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATENODEENUM];
8726
8727         r = talloc(talloc_tos(), struct clusapi_CreateNodeEnum);
8728         if (r == NULL) {
8729                 return false;
8730         }
8731
8732         pull = ndr_pull_init_blob(&p->in_data.data, r);
8733         if (pull == NULL) {
8734                 talloc_free(r);
8735                 return false;
8736         }
8737
8738         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8739         if (p->endian) {
8740                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8741         }
8742         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8743         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8744                 talloc_free(r);
8745                 return false;
8746         }
8747
8748         if (DEBUGLEVEL >= 10) {
8749                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNodeEnum, NDR_IN, r);
8750         }
8751
8752         ZERO_STRUCT(r->out);
8753         r->out.ReturnEnum = talloc_zero(r, struct ENUM_LIST *);
8754         if (r->out.ReturnEnum == NULL) {
8755                 talloc_free(r);
8756                 return false;
8757         }
8758
8759         r->out.rpc_status = talloc_zero(r, WERROR);
8760         if (r->out.rpc_status == NULL) {
8761                 talloc_free(r);
8762                 return false;
8763         }
8764
8765         r->out.result = _clusapi_CreateNodeEnum(p, r);
8766
8767         if (p->fault_state) {
8768                 talloc_free(r);
8769                 /* Return true here, srv_pipe_hnd.c will take care */
8770                 return true;
8771         }
8772
8773         if (DEBUGLEVEL >= 10) {
8774                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNodeEnum, NDR_OUT | NDR_SET_VALUES, r);
8775         }
8776
8777         push = ndr_push_init_ctx(r);
8778         if (push == NULL) {
8779                 talloc_free(r);
8780                 return false;
8781         }
8782
8783         /*
8784          * carry over the pointer count to the reply in case we are
8785          * using full pointer. See NDR specification for full pointers
8786          */
8787         push->ptr_count = pull->ptr_count;
8788
8789         ndr_err = call->ndr_push(push, NDR_OUT, r);
8790         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8791                 talloc_free(r);
8792                 return false;
8793         }
8794
8795         p->out_data.rdata = ndr_push_blob(push);
8796         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8797
8798         talloc_free(r);
8799
8800         return true;
8801 }
8802
8803 static bool api_clusapi_GetClusterVersion2(struct pipes_struct *p)
8804 {
8805         const struct ndr_interface_call *call;
8806         struct ndr_pull *pull;
8807         struct ndr_push *push;
8808         enum ndr_err_code ndr_err;
8809         struct clusapi_GetClusterVersion2 *r;
8810
8811         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETCLUSTERVERSION2];
8812
8813         r = talloc(talloc_tos(), struct clusapi_GetClusterVersion2);
8814         if (r == NULL) {
8815                 return false;
8816         }
8817
8818         pull = ndr_pull_init_blob(&p->in_data.data, r);
8819         if (pull == NULL) {
8820                 talloc_free(r);
8821                 return false;
8822         }
8823
8824         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8825         if (p->endian) {
8826                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8827         }
8828         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8829         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8830                 talloc_free(r);
8831                 return false;
8832         }
8833
8834         if (DEBUGLEVEL >= 10) {
8835                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetClusterVersion2, NDR_IN, r);
8836         }
8837
8838         ZERO_STRUCT(r->out);
8839         r->out.lpwMajorVersion = talloc_zero(r, uint16_t);
8840         if (r->out.lpwMajorVersion == NULL) {
8841                 talloc_free(r);
8842                 return false;
8843         }
8844
8845         r->out.lpwMinorVersion = talloc_zero(r, uint16_t);
8846         if (r->out.lpwMinorVersion == NULL) {
8847                 talloc_free(r);
8848                 return false;
8849         }
8850
8851         r->out.lpwBuildNumber = talloc_zero(r, uint16_t);
8852         if (r->out.lpwBuildNumber == NULL) {
8853                 talloc_free(r);
8854                 return false;
8855         }
8856
8857         r->out.lpszVendorId = talloc_zero(r, const char *);
8858         if (r->out.lpszVendorId == NULL) {
8859                 talloc_free(r);
8860                 return false;
8861         }
8862
8863         r->out.lpszCSDVersion = talloc_zero(r, const char *);
8864         if (r->out.lpszCSDVersion == NULL) {
8865                 talloc_free(r);
8866                 return false;
8867         }
8868
8869         r->out.ppClusterOpVerInfo = talloc_zero(r, struct CLUSTER_OPERATIONAL_VERSION_INFO *);
8870         if (r->out.ppClusterOpVerInfo == NULL) {
8871                 talloc_free(r);
8872                 return false;
8873         }
8874
8875         r->out.rpc_status = talloc_zero(r, WERROR);
8876         if (r->out.rpc_status == NULL) {
8877                 talloc_free(r);
8878                 return false;
8879         }
8880
8881         r->out.result = _clusapi_GetClusterVersion2(p, r);
8882
8883         if (p->fault_state) {
8884                 talloc_free(r);
8885                 /* Return true here, srv_pipe_hnd.c will take care */
8886                 return true;
8887         }
8888
8889         if (DEBUGLEVEL >= 10) {
8890                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetClusterVersion2, NDR_OUT | NDR_SET_VALUES, r);
8891         }
8892
8893         push = ndr_push_init_ctx(r);
8894         if (push == NULL) {
8895                 talloc_free(r);
8896                 return false;
8897         }
8898
8899         /*
8900          * carry over the pointer count to the reply in case we are
8901          * using full pointer. See NDR specification for full pointers
8902          */
8903         push->ptr_count = pull->ptr_count;
8904
8905         ndr_err = call->ndr_push(push, NDR_OUT, r);
8906         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8907                 talloc_free(r);
8908                 return false;
8909         }
8910
8911         p->out_data.rdata = ndr_push_blob(push);
8912         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8913
8914         talloc_free(r);
8915
8916         return true;
8917 }
8918
8919 static bool api_clusapi_CreateResTypeEnum(struct pipes_struct *p)
8920 {
8921         const struct ndr_interface_call *call;
8922         struct ndr_pull *pull;
8923         struct ndr_push *push;
8924         enum ndr_err_code ndr_err;
8925         struct clusapi_CreateResTypeEnum *r;
8926
8927         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATERESTYPEENUM];
8928
8929         r = talloc(talloc_tos(), struct clusapi_CreateResTypeEnum);
8930         if (r == NULL) {
8931                 return false;
8932         }
8933
8934         pull = ndr_pull_init_blob(&p->in_data.data, r);
8935         if (pull == NULL) {
8936                 talloc_free(r);
8937                 return false;
8938         }
8939
8940         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
8941         if (p->endian) {
8942                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
8943         }
8944         ndr_err = call->ndr_pull(pull, NDR_IN, r);
8945         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8946                 talloc_free(r);
8947                 return false;
8948         }
8949
8950         if (DEBUGLEVEL >= 10) {
8951                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResTypeEnum, NDR_IN, r);
8952         }
8953
8954         ZERO_STRUCT(r->out);
8955         r->out.ReturnEnum = talloc_zero(r, struct ENUM_LIST *);
8956         if (r->out.ReturnEnum == NULL) {
8957                 talloc_free(r);
8958                 return false;
8959         }
8960
8961         r->out.rpc_status = talloc_zero(r, WERROR);
8962         if (r->out.rpc_status == NULL) {
8963                 talloc_free(r);
8964                 return false;
8965         }
8966
8967         r->out.result = _clusapi_CreateResTypeEnum(p, r);
8968
8969         if (p->fault_state) {
8970                 talloc_free(r);
8971                 /* Return true here, srv_pipe_hnd.c will take care */
8972                 return true;
8973         }
8974
8975         if (DEBUGLEVEL >= 10) {
8976                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResTypeEnum, NDR_OUT | NDR_SET_VALUES, r);
8977         }
8978
8979         push = ndr_push_init_ctx(r);
8980         if (push == NULL) {
8981                 talloc_free(r);
8982                 return false;
8983         }
8984
8985         /*
8986          * carry over the pointer count to the reply in case we are
8987          * using full pointer. See NDR specification for full pointers
8988          */
8989         push->ptr_count = pull->ptr_count;
8990
8991         ndr_err = call->ndr_push(push, NDR_OUT, r);
8992         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
8993                 talloc_free(r);
8994                 return false;
8995         }
8996
8997         p->out_data.rdata = ndr_push_blob(push);
8998         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
8999
9000         talloc_free(r);
9001
9002         return true;
9003 }
9004
9005 static bool api_clusapi_BackupClusterDatabase(struct pipes_struct *p)
9006 {
9007         const struct ndr_interface_call *call;
9008         struct ndr_pull *pull;
9009         struct ndr_push *push;
9010         enum ndr_err_code ndr_err;
9011         struct clusapi_BackupClusterDatabase *r;
9012
9013         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_BACKUPCLUSTERDATABASE];
9014
9015         r = talloc(talloc_tos(), struct clusapi_BackupClusterDatabase);
9016         if (r == NULL) {
9017                 return false;
9018         }
9019
9020         pull = ndr_pull_init_blob(&p->in_data.data, r);
9021         if (pull == NULL) {
9022                 talloc_free(r);
9023                 return false;
9024         }
9025
9026         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9027         if (p->endian) {
9028                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9029         }
9030         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9031         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9032                 talloc_free(r);
9033                 return false;
9034         }
9035
9036         if (DEBUGLEVEL >= 10) {
9037                 NDR_PRINT_FUNCTION_DEBUG(clusapi_BackupClusterDatabase, NDR_IN, r);
9038         }
9039
9040         ZERO_STRUCT(r->out);
9041         r->out.rpc_status = talloc_zero(r, WERROR);
9042         if (r->out.rpc_status == NULL) {
9043                 talloc_free(r);
9044                 return false;
9045         }
9046
9047         r->out.result = _clusapi_BackupClusterDatabase(p, r);
9048
9049         if (p->fault_state) {
9050                 talloc_free(r);
9051                 /* Return true here, srv_pipe_hnd.c will take care */
9052                 return true;
9053         }
9054
9055         if (DEBUGLEVEL >= 10) {
9056                 NDR_PRINT_FUNCTION_DEBUG(clusapi_BackupClusterDatabase, NDR_OUT | NDR_SET_VALUES, r);
9057         }
9058
9059         push = ndr_push_init_ctx(r);
9060         if (push == NULL) {
9061                 talloc_free(r);
9062                 return false;
9063         }
9064
9065         /*
9066          * carry over the pointer count to the reply in case we are
9067          * using full pointer. See NDR specification for full pointers
9068          */
9069         push->ptr_count = pull->ptr_count;
9070
9071         ndr_err = call->ndr_push(push, NDR_OUT, r);
9072         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9073                 talloc_free(r);
9074                 return false;
9075         }
9076
9077         p->out_data.rdata = ndr_push_blob(push);
9078         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9079
9080         talloc_free(r);
9081
9082         return true;
9083 }
9084
9085 static bool api_clusapi_NodeClusterControl(struct pipes_struct *p)
9086 {
9087         const struct ndr_interface_call *call;
9088         struct ndr_pull *pull;
9089         struct ndr_push *push;
9090         enum ndr_err_code ndr_err;
9091         struct clusapi_NodeClusterControl *r;
9092
9093         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_NODECLUSTERCONTROL];
9094
9095         r = talloc(talloc_tos(), struct clusapi_NodeClusterControl);
9096         if (r == NULL) {
9097                 return false;
9098         }
9099
9100         pull = ndr_pull_init_blob(&p->in_data.data, r);
9101         if (pull == NULL) {
9102                 talloc_free(r);
9103                 return false;
9104         }
9105
9106         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9107         if (p->endian) {
9108                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9109         }
9110         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9111         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9112                 talloc_free(r);
9113                 return false;
9114         }
9115
9116         if (DEBUGLEVEL >= 10) {
9117                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeClusterControl, NDR_IN, r);
9118         }
9119
9120         ZERO_STRUCT(r->out);
9121         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
9122         if (r->out.lpOutBuffer == NULL) {
9123                 talloc_free(r);
9124                 return false;
9125         }
9126
9127         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
9128         if (r->out.lpBytesReturned == NULL) {
9129                 talloc_free(r);
9130                 return false;
9131         }
9132
9133         r->out.lpcbRequired = talloc_zero(r, uint32_t);
9134         if (r->out.lpcbRequired == NULL) {
9135                 talloc_free(r);
9136                 return false;
9137         }
9138
9139         r->out.rpc_status = talloc_zero(r, WERROR);
9140         if (r->out.rpc_status == NULL) {
9141                 talloc_free(r);
9142                 return false;
9143         }
9144
9145         r->out.result = _clusapi_NodeClusterControl(p, r);
9146
9147         if (p->fault_state) {
9148                 talloc_free(r);
9149                 /* Return true here, srv_pipe_hnd.c will take care */
9150                 return true;
9151         }
9152
9153         if (DEBUGLEVEL >= 10) {
9154                 NDR_PRINT_FUNCTION_DEBUG(clusapi_NodeClusterControl, NDR_OUT | NDR_SET_VALUES, r);
9155         }
9156
9157         push = ndr_push_init_ctx(r);
9158         if (push == NULL) {
9159                 talloc_free(r);
9160                 return false;
9161         }
9162
9163         /*
9164          * carry over the pointer count to the reply in case we are
9165          * using full pointer. See NDR specification for full pointers
9166          */
9167         push->ptr_count = pull->ptr_count;
9168
9169         ndr_err = call->ndr_push(push, NDR_OUT, r);
9170         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9171                 talloc_free(r);
9172                 return false;
9173         }
9174
9175         p->out_data.rdata = ndr_push_blob(push);
9176         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9177
9178         talloc_free(r);
9179
9180         return true;
9181 }
9182
9183 static bool api_clusapi_ClusterControl(struct pipes_struct *p)
9184 {
9185         const struct ndr_interface_call *call;
9186         struct ndr_pull *pull;
9187         struct ndr_push *push;
9188         enum ndr_err_code ndr_err;
9189         struct clusapi_ClusterControl *r;
9190
9191         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLUSTERCONTROL];
9192
9193         r = talloc(talloc_tos(), struct clusapi_ClusterControl);
9194         if (r == NULL) {
9195                 return false;
9196         }
9197
9198         pull = ndr_pull_init_blob(&p->in_data.data, r);
9199         if (pull == NULL) {
9200                 talloc_free(r);
9201                 return false;
9202         }
9203
9204         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9205         if (p->endian) {
9206                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9207         }
9208         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9209         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9210                 talloc_free(r);
9211                 return false;
9212         }
9213
9214         if (DEBUGLEVEL >= 10) {
9215                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ClusterControl, NDR_IN, r);
9216         }
9217
9218         ZERO_STRUCT(r->out);
9219         r->out.lpOutBuffer = talloc_zero_array(r, uint8_t, r->in.nOutBufferSize);
9220         if (r->out.lpOutBuffer == NULL) {
9221                 talloc_free(r);
9222                 return false;
9223         }
9224
9225         r->out.lpBytesReturned = talloc_zero(r, uint32_t);
9226         if (r->out.lpBytesReturned == NULL) {
9227                 talloc_free(r);
9228                 return false;
9229         }
9230
9231         r->out.lpcbRequired = talloc_zero(r, uint32_t);
9232         if (r->out.lpcbRequired == NULL) {
9233                 talloc_free(r);
9234                 return false;
9235         }
9236
9237         r->out.rpc_status = talloc_zero(r, WERROR);
9238         if (r->out.rpc_status == NULL) {
9239                 talloc_free(r);
9240                 return false;
9241         }
9242
9243         r->out.result = _clusapi_ClusterControl(p, r);
9244
9245         if (p->fault_state) {
9246                 talloc_free(r);
9247                 /* Return true here, srv_pipe_hnd.c will take care */
9248                 return true;
9249         }
9250
9251         if (DEBUGLEVEL >= 10) {
9252                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ClusterControl, NDR_OUT | NDR_SET_VALUES, r);
9253         }
9254
9255         push = ndr_push_init_ctx(r);
9256         if (push == NULL) {
9257                 talloc_free(r);
9258                 return false;
9259         }
9260
9261         /*
9262          * carry over the pointer count to the reply in case we are
9263          * using full pointer. See NDR specification for full pointers
9264          */
9265         push->ptr_count = pull->ptr_count;
9266
9267         ndr_err = call->ndr_push(push, NDR_OUT, r);
9268         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9269                 talloc_free(r);
9270                 return false;
9271         }
9272
9273         p->out_data.rdata = ndr_push_blob(push);
9274         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9275
9276         talloc_free(r);
9277
9278         return true;
9279 }
9280
9281 static bool api_clusapi_UnblockGetNotifyCall(struct pipes_struct *p)
9282 {
9283         const struct ndr_interface_call *call;
9284         struct ndr_pull *pull;
9285         struct ndr_push *push;
9286         enum ndr_err_code ndr_err;
9287         struct clusapi_UnblockGetNotifyCall *r;
9288
9289         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_UNBLOCKGETNOTIFYCALL];
9290
9291         r = talloc(talloc_tos(), struct clusapi_UnblockGetNotifyCall);
9292         if (r == NULL) {
9293                 return false;
9294         }
9295
9296         pull = ndr_pull_init_blob(&p->in_data.data, r);
9297         if (pull == NULL) {
9298                 talloc_free(r);
9299                 return false;
9300         }
9301
9302         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9303         if (p->endian) {
9304                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9305         }
9306         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9307         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9308                 talloc_free(r);
9309                 return false;
9310         }
9311
9312         if (DEBUGLEVEL >= 10) {
9313                 NDR_PRINT_FUNCTION_DEBUG(clusapi_UnblockGetNotifyCall, NDR_IN, r);
9314         }
9315
9316         r->out.result = _clusapi_UnblockGetNotifyCall(p, r);
9317
9318         if (p->fault_state) {
9319                 talloc_free(r);
9320                 /* Return true here, srv_pipe_hnd.c will take care */
9321                 return true;
9322         }
9323
9324         if (DEBUGLEVEL >= 10) {
9325                 NDR_PRINT_FUNCTION_DEBUG(clusapi_UnblockGetNotifyCall, NDR_OUT | NDR_SET_VALUES, r);
9326         }
9327
9328         push = ndr_push_init_ctx(r);
9329         if (push == NULL) {
9330                 talloc_free(r);
9331                 return false;
9332         }
9333
9334         /*
9335          * carry over the pointer count to the reply in case we are
9336          * using full pointer. See NDR specification for full pointers
9337          */
9338         push->ptr_count = pull->ptr_count;
9339
9340         ndr_err = call->ndr_push(push, NDR_OUT, r);
9341         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9342                 talloc_free(r);
9343                 return false;
9344         }
9345
9346         p->out_data.rdata = ndr_push_blob(push);
9347         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9348
9349         talloc_free(r);
9350
9351         return true;
9352 }
9353
9354 static bool api_clusapi_SetServiceAccountPassword(struct pipes_struct *p)
9355 {
9356         const struct ndr_interface_call *call;
9357         struct ndr_pull *pull;
9358         struct ndr_push *push;
9359         enum ndr_err_code ndr_err;
9360         struct clusapi_SetServiceAccountPassword *r;
9361
9362         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETSERVICEACCOUNTPASSWORD];
9363
9364         r = talloc(talloc_tos(), struct clusapi_SetServiceAccountPassword);
9365         if (r == NULL) {
9366                 return false;
9367         }
9368
9369         pull = ndr_pull_init_blob(&p->in_data.data, r);
9370         if (pull == NULL) {
9371                 talloc_free(r);
9372                 return false;
9373         }
9374
9375         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9376         if (p->endian) {
9377                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9378         }
9379         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9380         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9381                 talloc_free(r);
9382                 return false;
9383         }
9384
9385         if (DEBUGLEVEL >= 10) {
9386                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetServiceAccountPassword, NDR_IN, r);
9387         }
9388
9389         ZERO_STRUCT(r->out);
9390         r->out.ReturnStatusBufferPtr = talloc_zero_array(r, struct IDL_CLUSTER_SET_PASSWORD_STATUS, r->in.ReturnStatusBufferSize);
9391         if (r->out.ReturnStatusBufferPtr == NULL) {
9392                 talloc_free(r);
9393                 return false;
9394         }
9395
9396         r->out.SizeReturned = talloc_zero(r, uint32_t);
9397         if (r->out.SizeReturned == NULL) {
9398                 talloc_free(r);
9399                 return false;
9400         }
9401
9402         r->out.ExpectedBufferSize = talloc_zero(r, uint32_t);
9403         if (r->out.ExpectedBufferSize == NULL) {
9404                 talloc_free(r);
9405                 return false;
9406         }
9407
9408         r->out.result = _clusapi_SetServiceAccountPassword(p, r);
9409
9410         if (p->fault_state) {
9411                 talloc_free(r);
9412                 /* Return true here, srv_pipe_hnd.c will take care */
9413                 return true;
9414         }
9415
9416         if (DEBUGLEVEL >= 10) {
9417                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetServiceAccountPassword, NDR_OUT | NDR_SET_VALUES, r);
9418         }
9419
9420         push = ndr_push_init_ctx(r);
9421         if (push == NULL) {
9422                 talloc_free(r);
9423                 return false;
9424         }
9425
9426         /*
9427          * carry over the pointer count to the reply in case we are
9428          * using full pointer. See NDR specification for full pointers
9429          */
9430         push->ptr_count = pull->ptr_count;
9431
9432         ndr_err = call->ndr_push(push, NDR_OUT, r);
9433         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9434                 talloc_free(r);
9435                 return false;
9436         }
9437
9438         p->out_data.rdata = ndr_push_blob(push);
9439         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9440
9441         talloc_free(r);
9442
9443         return true;
9444 }
9445
9446 static bool api_clusapi_SetResourceDependencyExpression(struct pipes_struct *p)
9447 {
9448         const struct ndr_interface_call *call;
9449         struct ndr_pull *pull;
9450         struct ndr_push *push;
9451         enum ndr_err_code ndr_err;
9452         struct clusapi_SetResourceDependencyExpression *r;
9453
9454         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_SETRESOURCEDEPENDENCYEXPRESSION];
9455
9456         r = talloc(talloc_tos(), struct clusapi_SetResourceDependencyExpression);
9457         if (r == NULL) {
9458                 return false;
9459         }
9460
9461         pull = ndr_pull_init_blob(&p->in_data.data, r);
9462         if (pull == NULL) {
9463                 talloc_free(r);
9464                 return false;
9465         }
9466
9467         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9468         if (p->endian) {
9469                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9470         }
9471         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9472         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9473                 talloc_free(r);
9474                 return false;
9475         }
9476
9477         if (DEBUGLEVEL >= 10) {
9478                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetResourceDependencyExpression, NDR_IN, r);
9479         }
9480
9481         ZERO_STRUCT(r->out);
9482         r->out.rpc_status = talloc_zero(r, WERROR);
9483         if (r->out.rpc_status == NULL) {
9484                 talloc_free(r);
9485                 return false;
9486         }
9487
9488         r->out.result = _clusapi_SetResourceDependencyExpression(p, r);
9489
9490         if (p->fault_state) {
9491                 talloc_free(r);
9492                 /* Return true here, srv_pipe_hnd.c will take care */
9493                 return true;
9494         }
9495
9496         if (DEBUGLEVEL >= 10) {
9497                 NDR_PRINT_FUNCTION_DEBUG(clusapi_SetResourceDependencyExpression, NDR_OUT | NDR_SET_VALUES, r);
9498         }
9499
9500         push = ndr_push_init_ctx(r);
9501         if (push == NULL) {
9502                 talloc_free(r);
9503                 return false;
9504         }
9505
9506         /*
9507          * carry over the pointer count to the reply in case we are
9508          * using full pointer. See NDR specification for full pointers
9509          */
9510         push->ptr_count = pull->ptr_count;
9511
9512         ndr_err = call->ndr_push(push, NDR_OUT, r);
9513         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9514                 talloc_free(r);
9515                 return false;
9516         }
9517
9518         p->out_data.rdata = ndr_push_blob(push);
9519         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9520
9521         talloc_free(r);
9522
9523         return true;
9524 }
9525
9526 static bool api_clusapi_GetResourceDependencyExpression(struct pipes_struct *p)
9527 {
9528         const struct ndr_interface_call *call;
9529         struct ndr_pull *pull;
9530         struct ndr_push *push;
9531         enum ndr_err_code ndr_err;
9532         struct clusapi_GetResourceDependencyExpression *r;
9533
9534         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETRESOURCEDEPENDENCYEXPRESSION];
9535
9536         r = talloc(talloc_tos(), struct clusapi_GetResourceDependencyExpression);
9537         if (r == NULL) {
9538                 return false;
9539         }
9540
9541         pull = ndr_pull_init_blob(&p->in_data.data, r);
9542         if (pull == NULL) {
9543                 talloc_free(r);
9544                 return false;
9545         }
9546
9547         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9548         if (p->endian) {
9549                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9550         }
9551         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9552         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9553                 talloc_free(r);
9554                 return false;
9555         }
9556
9557         if (DEBUGLEVEL >= 10) {
9558                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceDependencyExpression, NDR_IN, r);
9559         }
9560
9561         ZERO_STRUCT(r->out);
9562         r->out.lpszDependencyExpression = talloc_zero(r, const char *);
9563         if (r->out.lpszDependencyExpression == NULL) {
9564                 talloc_free(r);
9565                 return false;
9566         }
9567
9568         r->out.rpc_status = talloc_zero(r, WERROR);
9569         if (r->out.rpc_status == NULL) {
9570                 talloc_free(r);
9571                 return false;
9572         }
9573
9574         r->out.result = _clusapi_GetResourceDependencyExpression(p, r);
9575
9576         if (p->fault_state) {
9577                 talloc_free(r);
9578                 /* Return true here, srv_pipe_hnd.c will take care */
9579                 return true;
9580         }
9581
9582         if (DEBUGLEVEL >= 10) {
9583                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceDependencyExpression, NDR_OUT | NDR_SET_VALUES, r);
9584         }
9585
9586         push = ndr_push_init_ctx(r);
9587         if (push == NULL) {
9588                 talloc_free(r);
9589                 return false;
9590         }
9591
9592         /*
9593          * carry over the pointer count to the reply in case we are
9594          * using full pointer. See NDR specification for full pointers
9595          */
9596         push->ptr_count = pull->ptr_count;
9597
9598         ndr_err = call->ndr_push(push, NDR_OUT, r);
9599         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9600                 talloc_free(r);
9601                 return false;
9602         }
9603
9604         p->out_data.rdata = ndr_push_blob(push);
9605         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9606
9607         talloc_free(r);
9608
9609         return true;
9610 }
9611
9612 static bool api_Opnum111NotUsedOnWire(struct pipes_struct *p)
9613 {
9614         const struct ndr_interface_call *call;
9615         struct ndr_pull *pull;
9616         struct ndr_push *push;
9617         enum ndr_err_code ndr_err;
9618         struct Opnum111NotUsedOnWire *r;
9619
9620         call = &ndr_table_clusapi.calls[NDR_OPNUM111NOTUSEDONWIRE];
9621
9622         r = talloc(talloc_tos(), struct Opnum111NotUsedOnWire);
9623         if (r == NULL) {
9624                 return false;
9625         }
9626
9627         pull = ndr_pull_init_blob(&p->in_data.data, r);
9628         if (pull == NULL) {
9629                 talloc_free(r);
9630                 return false;
9631         }
9632
9633         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9634         if (p->endian) {
9635                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9636         }
9637         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9638         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9639                 talloc_free(r);
9640                 return false;
9641         }
9642
9643         if (DEBUGLEVEL >= 10) {
9644                 NDR_PRINT_FUNCTION_DEBUG(Opnum111NotUsedOnWire, NDR_IN, r);
9645         }
9646
9647         r->out.result = _Opnum111NotUsedOnWire(p, r);
9648
9649         if (p->fault_state) {
9650                 talloc_free(r);
9651                 /* Return true here, srv_pipe_hnd.c will take care */
9652                 return true;
9653         }
9654
9655         if (DEBUGLEVEL >= 10) {
9656                 NDR_PRINT_FUNCTION_DEBUG(Opnum111NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r);
9657         }
9658
9659         push = ndr_push_init_ctx(r);
9660         if (push == NULL) {
9661                 talloc_free(r);
9662                 return false;
9663         }
9664
9665         /*
9666          * carry over the pointer count to the reply in case we are
9667          * using full pointer. See NDR specification for full pointers
9668          */
9669         push->ptr_count = pull->ptr_count;
9670
9671         ndr_err = call->ndr_push(push, NDR_OUT, r);
9672         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9673                 talloc_free(r);
9674                 return false;
9675         }
9676
9677         p->out_data.rdata = ndr_push_blob(push);
9678         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9679
9680         talloc_free(r);
9681
9682         return true;
9683 }
9684
9685 static bool api_clusapi_GetResourceNetworkName(struct pipes_struct *p)
9686 {
9687         const struct ndr_interface_call *call;
9688         struct ndr_pull *pull;
9689         struct ndr_push *push;
9690         enum ndr_err_code ndr_err;
9691         struct clusapi_GetResourceNetworkName *r;
9692
9693         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETRESOURCENETWORKNAME];
9694
9695         r = talloc(talloc_tos(), struct clusapi_GetResourceNetworkName);
9696         if (r == NULL) {
9697                 return false;
9698         }
9699
9700         pull = ndr_pull_init_blob(&p->in_data.data, r);
9701         if (pull == NULL) {
9702                 talloc_free(r);
9703                 return false;
9704         }
9705
9706         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9707         if (p->endian) {
9708                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9709         }
9710         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9711         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9712                 talloc_free(r);
9713                 return false;
9714         }
9715
9716         if (DEBUGLEVEL >= 10) {
9717                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceNetworkName, NDR_IN, r);
9718         }
9719
9720         ZERO_STRUCT(r->out);
9721         r->out.lpszName = talloc_zero(r, const char *);
9722         if (r->out.lpszName == NULL) {
9723                 talloc_free(r);
9724                 return false;
9725         }
9726
9727         r->out.rpc_status = talloc_zero(r, WERROR);
9728         if (r->out.rpc_status == NULL) {
9729                 talloc_free(r);
9730                 return false;
9731         }
9732
9733         r->out.result = _clusapi_GetResourceNetworkName(p, r);
9734
9735         if (p->fault_state) {
9736                 talloc_free(r);
9737                 /* Return true here, srv_pipe_hnd.c will take care */
9738                 return true;
9739         }
9740
9741         if (DEBUGLEVEL >= 10) {
9742                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetResourceNetworkName, NDR_OUT | NDR_SET_VALUES, r);
9743         }
9744
9745         push = ndr_push_init_ctx(r);
9746         if (push == NULL) {
9747                 talloc_free(r);
9748                 return false;
9749         }
9750
9751         /*
9752          * carry over the pointer count to the reply in case we are
9753          * using full pointer. See NDR specification for full pointers
9754          */
9755         push->ptr_count = pull->ptr_count;
9756
9757         ndr_err = call->ndr_push(push, NDR_OUT, r);
9758         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9759                 talloc_free(r);
9760                 return false;
9761         }
9762
9763         p->out_data.rdata = ndr_push_blob(push);
9764         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9765
9766         talloc_free(r);
9767
9768         return true;
9769 }
9770
9771 static bool api_clusapi_ExecuteBatch(struct pipes_struct *p)
9772 {
9773         const struct ndr_interface_call *call;
9774         struct ndr_pull *pull;
9775         struct ndr_push *push;
9776         enum ndr_err_code ndr_err;
9777         struct clusapi_ExecuteBatch *r;
9778
9779         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_EXECUTEBATCH];
9780
9781         r = talloc(talloc_tos(), struct clusapi_ExecuteBatch);
9782         if (r == NULL) {
9783                 return false;
9784         }
9785
9786         pull = ndr_pull_init_blob(&p->in_data.data, r);
9787         if (pull == NULL) {
9788                 talloc_free(r);
9789                 return false;
9790         }
9791
9792         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9793         if (p->endian) {
9794                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9795         }
9796         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9797         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9798                 talloc_free(r);
9799                 return false;
9800         }
9801
9802         if (DEBUGLEVEL >= 10) {
9803                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ExecuteBatch, NDR_IN, r);
9804         }
9805
9806         ZERO_STRUCT(r->out);
9807         r->out.pdwFailedCommand = talloc_zero(r, int32_t);
9808         if (r->out.pdwFailedCommand == NULL) {
9809                 talloc_free(r);
9810                 return false;
9811         }
9812
9813         r->out.rpc_status = talloc_zero(r, WERROR);
9814         if (r->out.rpc_status == NULL) {
9815                 talloc_free(r);
9816                 return false;
9817         }
9818
9819         r->out.result = _clusapi_ExecuteBatch(p, r);
9820
9821         if (p->fault_state) {
9822                 talloc_free(r);
9823                 /* Return true here, srv_pipe_hnd.c will take care */
9824                 return true;
9825         }
9826
9827         if (DEBUGLEVEL >= 10) {
9828                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ExecuteBatch, NDR_OUT | NDR_SET_VALUES, r);
9829         }
9830
9831         push = ndr_push_init_ctx(r);
9832         if (push == NULL) {
9833                 talloc_free(r);
9834                 return false;
9835         }
9836
9837         /*
9838          * carry over the pointer count to the reply in case we are
9839          * using full pointer. See NDR specification for full pointers
9840          */
9841         push->ptr_count = pull->ptr_count;
9842
9843         ndr_err = call->ndr_push(push, NDR_OUT, r);
9844         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9845                 talloc_free(r);
9846                 return false;
9847         }
9848
9849         p->out_data.rdata = ndr_push_blob(push);
9850         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9851
9852         talloc_free(r);
9853
9854         return true;
9855 }
9856
9857 static bool api_clusapi_CreateBatchPort(struct pipes_struct *p)
9858 {
9859         const struct ndr_interface_call *call;
9860         struct ndr_pull *pull;
9861         struct ndr_push *push;
9862         enum ndr_err_code ndr_err;
9863         struct clusapi_CreateBatchPort *r;
9864
9865         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEBATCHPORT];
9866
9867         r = talloc(talloc_tos(), struct clusapi_CreateBatchPort);
9868         if (r == NULL) {
9869                 return false;
9870         }
9871
9872         pull = ndr_pull_init_blob(&p->in_data.data, r);
9873         if (pull == NULL) {
9874                 talloc_free(r);
9875                 return false;
9876         }
9877
9878         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9879         if (p->endian) {
9880                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9881         }
9882         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9883         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9884                 talloc_free(r);
9885                 return false;
9886         }
9887
9888         if (DEBUGLEVEL >= 10) {
9889                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateBatchPort, NDR_IN, r);
9890         }
9891
9892         ZERO_STRUCT(r->out);
9893         r->out.phBatchPort = talloc_zero(r, struct policy_handle);
9894         if (r->out.phBatchPort == NULL) {
9895                 talloc_free(r);
9896                 return false;
9897         }
9898
9899         r->out.rpc_status = talloc_zero(r, WERROR);
9900         if (r->out.rpc_status == NULL) {
9901                 talloc_free(r);
9902                 return false;
9903         }
9904
9905         r->out.result = _clusapi_CreateBatchPort(p, r);
9906
9907         if (p->fault_state) {
9908                 talloc_free(r);
9909                 /* Return true here, srv_pipe_hnd.c will take care */
9910                 return true;
9911         }
9912
9913         if (DEBUGLEVEL >= 10) {
9914                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateBatchPort, NDR_OUT | NDR_SET_VALUES, r);
9915         }
9916
9917         push = ndr_push_init_ctx(r);
9918         if (push == NULL) {
9919                 talloc_free(r);
9920                 return false;
9921         }
9922
9923         /*
9924          * carry over the pointer count to the reply in case we are
9925          * using full pointer. See NDR specification for full pointers
9926          */
9927         push->ptr_count = pull->ptr_count;
9928
9929         ndr_err = call->ndr_push(push, NDR_OUT, r);
9930         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9931                 talloc_free(r);
9932                 return false;
9933         }
9934
9935         p->out_data.rdata = ndr_push_blob(push);
9936         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
9937
9938         talloc_free(r);
9939
9940         return true;
9941 }
9942
9943 static bool api_clusapi_GetBatchNotification(struct pipes_struct *p)
9944 {
9945         const struct ndr_interface_call *call;
9946         struct ndr_pull *pull;
9947         struct ndr_push *push;
9948         enum ndr_err_code ndr_err;
9949         struct clusapi_GetBatchNotification *r;
9950
9951         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETBATCHNOTIFICATION];
9952
9953         r = talloc(talloc_tos(), struct clusapi_GetBatchNotification);
9954         if (r == NULL) {
9955                 return false;
9956         }
9957
9958         pull = ndr_pull_init_blob(&p->in_data.data, r);
9959         if (pull == NULL) {
9960                 talloc_free(r);
9961                 return false;
9962         }
9963
9964         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
9965         if (p->endian) {
9966                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
9967         }
9968         ndr_err = call->ndr_pull(pull, NDR_IN, r);
9969         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
9970                 talloc_free(r);
9971                 return false;
9972         }
9973
9974         if (DEBUGLEVEL >= 10) {
9975                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetBatchNotification, NDR_IN, r);
9976         }
9977
9978         ZERO_STRUCT(r->out);
9979         r->out.cbData = talloc_zero(r, uint32_t);
9980         if (r->out.cbData == NULL) {
9981                 talloc_free(r);
9982                 return false;
9983         }
9984
9985         r->out.lpData = talloc_zero(r, uint8_t *);
9986         if (r->out.lpData == NULL) {
9987                 talloc_free(r);
9988                 return false;
9989         }
9990
9991         r->out.result = _clusapi_GetBatchNotification(p, r);
9992
9993         if (p->fault_state) {
9994                 talloc_free(r);
9995                 /* Return true here, srv_pipe_hnd.c will take care */
9996                 return true;
9997         }
9998
9999         if (DEBUGLEVEL >= 10) {
10000                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetBatchNotification, NDR_OUT | NDR_SET_VALUES, r);
10001         }
10002
10003         push = ndr_push_init_ctx(r);
10004         if (push == NULL) {
10005                 talloc_free(r);
10006                 return false;
10007         }
10008
10009         /*
10010          * carry over the pointer count to the reply in case we are
10011          * using full pointer. See NDR specification for full pointers
10012          */
10013         push->ptr_count = pull->ptr_count;
10014
10015         ndr_err = call->ndr_push(push, NDR_OUT, r);
10016         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10017                 talloc_free(r);
10018                 return false;
10019         }
10020
10021         p->out_data.rdata = ndr_push_blob(push);
10022         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10023
10024         talloc_free(r);
10025
10026         return true;
10027 }
10028
10029 static bool api_clusapi_CloseBatchPort(struct pipes_struct *p)
10030 {
10031         const struct ndr_interface_call *call;
10032         struct ndr_pull *pull;
10033         struct ndr_push *push;
10034         enum ndr_err_code ndr_err;
10035         struct clusapi_CloseBatchPort *r;
10036
10037         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLOSEBATCHPORT];
10038
10039         r = talloc(talloc_tos(), struct clusapi_CloseBatchPort);
10040         if (r == NULL) {
10041                 return false;
10042         }
10043
10044         pull = ndr_pull_init_blob(&p->in_data.data, r);
10045         if (pull == NULL) {
10046                 talloc_free(r);
10047                 return false;
10048         }
10049
10050         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10051         if (p->endian) {
10052                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10053         }
10054         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10055         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10056                 talloc_free(r);
10057                 return false;
10058         }
10059
10060         if (DEBUGLEVEL >= 10) {
10061                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseBatchPort, NDR_IN, r);
10062         }
10063
10064         ZERO_STRUCT(r->out);
10065         r->out.phBatchPort = r->in.phBatchPort;
10066         r->out.result = _clusapi_CloseBatchPort(p, r);
10067
10068         if (p->fault_state) {
10069                 talloc_free(r);
10070                 /* Return true here, srv_pipe_hnd.c will take care */
10071                 return true;
10072         }
10073
10074         if (DEBUGLEVEL >= 10) {
10075                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CloseBatchPort, NDR_OUT | NDR_SET_VALUES, r);
10076         }
10077
10078         push = ndr_push_init_ctx(r);
10079         if (push == NULL) {
10080                 talloc_free(r);
10081                 return false;
10082         }
10083
10084         /*
10085          * carry over the pointer count to the reply in case we are
10086          * using full pointer. See NDR specification for full pointers
10087          */
10088         push->ptr_count = pull->ptr_count;
10089
10090         ndr_err = call->ndr_push(push, NDR_OUT, r);
10091         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10092                 talloc_free(r);
10093                 return false;
10094         }
10095
10096         p->out_data.rdata = ndr_push_blob(push);
10097         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10098
10099         talloc_free(r);
10100
10101         return true;
10102 }
10103
10104 static bool api_clusapi_OpenClusterEx(struct pipes_struct *p)
10105 {
10106         const struct ndr_interface_call *call;
10107         struct ndr_pull *pull;
10108         struct ndr_push *push;
10109         enum ndr_err_code ndr_err;
10110         struct clusapi_OpenClusterEx *r;
10111
10112         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENCLUSTEREX];
10113
10114         r = talloc(talloc_tos(), struct clusapi_OpenClusterEx);
10115         if (r == NULL) {
10116                 return false;
10117         }
10118
10119         pull = ndr_pull_init_blob(&p->in_data.data, r);
10120         if (pull == NULL) {
10121                 talloc_free(r);
10122                 return false;
10123         }
10124
10125         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10126         if (p->endian) {
10127                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10128         }
10129         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10130         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10131                 talloc_free(r);
10132                 return false;
10133         }
10134
10135         if (DEBUGLEVEL >= 10) {
10136                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenClusterEx, NDR_IN, r);
10137         }
10138
10139         ZERO_STRUCT(r->out);
10140         r->out.lpdwGrantedAccess = talloc_zero(r, uint32_t);
10141         if (r->out.lpdwGrantedAccess == NULL) {
10142                 talloc_free(r);
10143                 return false;
10144         }
10145
10146         r->out.Status = talloc_zero(r, WERROR);
10147         if (r->out.Status == NULL) {
10148                 talloc_free(r);
10149                 return false;
10150         }
10151
10152         r->out.hCluster = talloc_zero(r, struct policy_handle);
10153         if (r->out.hCluster == NULL) {
10154                 talloc_free(r);
10155                 return false;
10156         }
10157
10158         _clusapi_OpenClusterEx(p, r);
10159
10160         if (p->fault_state) {
10161                 talloc_free(r);
10162                 /* Return true here, srv_pipe_hnd.c will take care */
10163                 return true;
10164         }
10165
10166         if (DEBUGLEVEL >= 10) {
10167                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenClusterEx, NDR_OUT | NDR_SET_VALUES, r);
10168         }
10169
10170         push = ndr_push_init_ctx(r);
10171         if (push == NULL) {
10172                 talloc_free(r);
10173                 return false;
10174         }
10175
10176         /*
10177          * carry over the pointer count to the reply in case we are
10178          * using full pointer. See NDR specification for full pointers
10179          */
10180         push->ptr_count = pull->ptr_count;
10181
10182         ndr_err = call->ndr_push(push, NDR_OUT, r);
10183         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10184                 talloc_free(r);
10185                 return false;
10186         }
10187
10188         p->out_data.rdata = ndr_push_blob(push);
10189         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10190
10191         talloc_free(r);
10192
10193         return true;
10194 }
10195
10196 static bool api_clusapi_OpenNodeEx(struct pipes_struct *p)
10197 {
10198         const struct ndr_interface_call *call;
10199         struct ndr_pull *pull;
10200         struct ndr_push *push;
10201         enum ndr_err_code ndr_err;
10202         struct clusapi_OpenNodeEx *r;
10203
10204         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENNODEEX];
10205
10206         r = talloc(talloc_tos(), struct clusapi_OpenNodeEx);
10207         if (r == NULL) {
10208                 return false;
10209         }
10210
10211         pull = ndr_pull_init_blob(&p->in_data.data, r);
10212         if (pull == NULL) {
10213                 talloc_free(r);
10214                 return false;
10215         }
10216
10217         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10218         if (p->endian) {
10219                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10220         }
10221         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10222         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10223                 talloc_free(r);
10224                 return false;
10225         }
10226
10227         if (DEBUGLEVEL >= 10) {
10228                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNodeEx, NDR_IN, r);
10229         }
10230
10231         ZERO_STRUCT(r->out);
10232         r->out.lpdwGrantedAccess = talloc_zero(r, uint32_t);
10233         if (r->out.lpdwGrantedAccess == NULL) {
10234                 talloc_free(r);
10235                 return false;
10236         }
10237
10238         r->out.Status = talloc_zero(r, WERROR);
10239         if (r->out.Status == NULL) {
10240                 talloc_free(r);
10241                 return false;
10242         }
10243
10244         r->out.rpc_status = talloc_zero(r, WERROR);
10245         if (r->out.rpc_status == NULL) {
10246                 talloc_free(r);
10247                 return false;
10248         }
10249
10250         r->out.hNode = talloc_zero(r, struct policy_handle);
10251         if (r->out.hNode == NULL) {
10252                 talloc_free(r);
10253                 return false;
10254         }
10255
10256         _clusapi_OpenNodeEx(p, r);
10257
10258         if (p->fault_state) {
10259                 talloc_free(r);
10260                 /* Return true here, srv_pipe_hnd.c will take care */
10261                 return true;
10262         }
10263
10264         if (DEBUGLEVEL >= 10) {
10265                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNodeEx, NDR_OUT | NDR_SET_VALUES, r);
10266         }
10267
10268         push = ndr_push_init_ctx(r);
10269         if (push == NULL) {
10270                 talloc_free(r);
10271                 return false;
10272         }
10273
10274         /*
10275          * carry over the pointer count to the reply in case we are
10276          * using full pointer. See NDR specification for full pointers
10277          */
10278         push->ptr_count = pull->ptr_count;
10279
10280         ndr_err = call->ndr_push(push, NDR_OUT, r);
10281         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10282                 talloc_free(r);
10283                 return false;
10284         }
10285
10286         p->out_data.rdata = ndr_push_blob(push);
10287         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10288
10289         talloc_free(r);
10290
10291         return true;
10292 }
10293
10294 static bool api_clusapi_OpenGroupEx(struct pipes_struct *p)
10295 {
10296         const struct ndr_interface_call *call;
10297         struct ndr_pull *pull;
10298         struct ndr_push *push;
10299         enum ndr_err_code ndr_err;
10300         struct clusapi_OpenGroupEx *r;
10301
10302         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENGROUPEX];
10303
10304         r = talloc(talloc_tos(), struct clusapi_OpenGroupEx);
10305         if (r == NULL) {
10306                 return false;
10307         }
10308
10309         pull = ndr_pull_init_blob(&p->in_data.data, r);
10310         if (pull == NULL) {
10311                 talloc_free(r);
10312                 return false;
10313         }
10314
10315         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10316         if (p->endian) {
10317                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10318         }
10319         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10320         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10321                 talloc_free(r);
10322                 return false;
10323         }
10324
10325         if (DEBUGLEVEL >= 10) {
10326                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenGroupEx, NDR_IN, r);
10327         }
10328
10329         ZERO_STRUCT(r->out);
10330         r->out.lpdwGrantedAccess = talloc_zero(r, uint32_t);
10331         if (r->out.lpdwGrantedAccess == NULL) {
10332                 talloc_free(r);
10333                 return false;
10334         }
10335
10336         r->out.Status = talloc_zero(r, WERROR);
10337         if (r->out.Status == NULL) {
10338                 talloc_free(r);
10339                 return false;
10340         }
10341
10342         r->out.rpc_status = talloc_zero(r, WERROR);
10343         if (r->out.rpc_status == NULL) {
10344                 talloc_free(r);
10345                 return false;
10346         }
10347
10348         r->out.hGroup = talloc_zero(r, struct policy_handle);
10349         if (r->out.hGroup == NULL) {
10350                 talloc_free(r);
10351                 return false;
10352         }
10353
10354         _clusapi_OpenGroupEx(p, r);
10355
10356         if (p->fault_state) {
10357                 talloc_free(r);
10358                 /* Return true here, srv_pipe_hnd.c will take care */
10359                 return true;
10360         }
10361
10362         if (DEBUGLEVEL >= 10) {
10363                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenGroupEx, NDR_OUT | NDR_SET_VALUES, r);
10364         }
10365
10366         push = ndr_push_init_ctx(r);
10367         if (push == NULL) {
10368                 talloc_free(r);
10369                 return false;
10370         }
10371
10372         /*
10373          * carry over the pointer count to the reply in case we are
10374          * using full pointer. See NDR specification for full pointers
10375          */
10376         push->ptr_count = pull->ptr_count;
10377
10378         ndr_err = call->ndr_push(push, NDR_OUT, r);
10379         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10380                 talloc_free(r);
10381                 return false;
10382         }
10383
10384         p->out_data.rdata = ndr_push_blob(push);
10385         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10386
10387         talloc_free(r);
10388
10389         return true;
10390 }
10391
10392 static bool api_clusapi_OpenResourceEx(struct pipes_struct *p)
10393 {
10394         const struct ndr_interface_call *call;
10395         struct ndr_pull *pull;
10396         struct ndr_push *push;
10397         enum ndr_err_code ndr_err;
10398         struct clusapi_OpenResourceEx *r;
10399
10400         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENRESOURCEEX];
10401
10402         r = talloc(talloc_tos(), struct clusapi_OpenResourceEx);
10403         if (r == NULL) {
10404                 return false;
10405         }
10406
10407         pull = ndr_pull_init_blob(&p->in_data.data, r);
10408         if (pull == NULL) {
10409                 talloc_free(r);
10410                 return false;
10411         }
10412
10413         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10414         if (p->endian) {
10415                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10416         }
10417         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10418         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10419                 talloc_free(r);
10420                 return false;
10421         }
10422
10423         if (DEBUGLEVEL >= 10) {
10424                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenResourceEx, NDR_IN, r);
10425         }
10426
10427         ZERO_STRUCT(r->out);
10428         r->out.lpdwGrantedAccess = talloc_zero(r, uint32_t);
10429         if (r->out.lpdwGrantedAccess == NULL) {
10430                 talloc_free(r);
10431                 return false;
10432         }
10433
10434         r->out.Status = talloc_zero(r, WERROR);
10435         if (r->out.Status == NULL) {
10436                 talloc_free(r);
10437                 return false;
10438         }
10439
10440         r->out.rpc_status = talloc_zero(r, WERROR);
10441         if (r->out.rpc_status == NULL) {
10442                 talloc_free(r);
10443                 return false;
10444         }
10445
10446         r->out.hResource = talloc_zero(r, struct policy_handle);
10447         if (r->out.hResource == NULL) {
10448                 talloc_free(r);
10449                 return false;
10450         }
10451
10452         _clusapi_OpenResourceEx(p, r);
10453
10454         if (p->fault_state) {
10455                 talloc_free(r);
10456                 /* Return true here, srv_pipe_hnd.c will take care */
10457                 return true;
10458         }
10459
10460         if (DEBUGLEVEL >= 10) {
10461                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenResourceEx, NDR_OUT | NDR_SET_VALUES, r);
10462         }
10463
10464         push = ndr_push_init_ctx(r);
10465         if (push == NULL) {
10466                 talloc_free(r);
10467                 return false;
10468         }
10469
10470         /*
10471          * carry over the pointer count to the reply in case we are
10472          * using full pointer. See NDR specification for full pointers
10473          */
10474         push->ptr_count = pull->ptr_count;
10475
10476         ndr_err = call->ndr_push(push, NDR_OUT, r);
10477         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10478                 talloc_free(r);
10479                 return false;
10480         }
10481
10482         p->out_data.rdata = ndr_push_blob(push);
10483         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10484
10485         talloc_free(r);
10486
10487         return true;
10488 }
10489
10490 static bool api_clusapi_OpenNetworkEx(struct pipes_struct *p)
10491 {
10492         const struct ndr_interface_call *call;
10493         struct ndr_pull *pull;
10494         struct ndr_push *push;
10495         enum ndr_err_code ndr_err;
10496         struct clusapi_OpenNetworkEx *r;
10497
10498         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENNETWORKEX];
10499
10500         r = talloc(talloc_tos(), struct clusapi_OpenNetworkEx);
10501         if (r == NULL) {
10502                 return false;
10503         }
10504
10505         pull = ndr_pull_init_blob(&p->in_data.data, r);
10506         if (pull == NULL) {
10507                 talloc_free(r);
10508                 return false;
10509         }
10510
10511         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10512         if (p->endian) {
10513                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10514         }
10515         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10516         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10517                 talloc_free(r);
10518                 return false;
10519         }
10520
10521         if (DEBUGLEVEL >= 10) {
10522                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetworkEx, NDR_IN, r);
10523         }
10524
10525         ZERO_STRUCT(r->out);
10526         r->out.lpdwGrantedAccess = talloc_zero(r, uint32_t);
10527         if (r->out.lpdwGrantedAccess == NULL) {
10528                 talloc_free(r);
10529                 return false;
10530         }
10531
10532         r->out.Status = talloc_zero(r, WERROR);
10533         if (r->out.Status == NULL) {
10534                 talloc_free(r);
10535                 return false;
10536         }
10537
10538         r->out.rpc_status = talloc_zero(r, WERROR);
10539         if (r->out.rpc_status == NULL) {
10540                 talloc_free(r);
10541                 return false;
10542         }
10543
10544         r->out.hNetwork = talloc_zero(r, struct policy_handle);
10545         if (r->out.hNetwork == NULL) {
10546                 talloc_free(r);
10547                 return false;
10548         }
10549
10550         _clusapi_OpenNetworkEx(p, r);
10551
10552         if (p->fault_state) {
10553                 talloc_free(r);
10554                 /* Return true here, srv_pipe_hnd.c will take care */
10555                 return true;
10556         }
10557
10558         if (DEBUGLEVEL >= 10) {
10559                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetworkEx, NDR_OUT | NDR_SET_VALUES, r);
10560         }
10561
10562         push = ndr_push_init_ctx(r);
10563         if (push == NULL) {
10564                 talloc_free(r);
10565                 return false;
10566         }
10567
10568         /*
10569          * carry over the pointer count to the reply in case we are
10570          * using full pointer. See NDR specification for full pointers
10571          */
10572         push->ptr_count = pull->ptr_count;
10573
10574         ndr_err = call->ndr_push(push, NDR_OUT, r);
10575         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10576                 talloc_free(r);
10577                 return false;
10578         }
10579
10580         p->out_data.rdata = ndr_push_blob(push);
10581         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10582
10583         talloc_free(r);
10584
10585         return true;
10586 }
10587
10588 static bool api_clusapi_OpenNetInterfaceEx(struct pipes_struct *p)
10589 {
10590         const struct ndr_interface_call *call;
10591         struct ndr_pull *pull;
10592         struct ndr_push *push;
10593         enum ndr_err_code ndr_err;
10594         struct clusapi_OpenNetInterfaceEx *r;
10595
10596         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OPENNETINTERFACEEX];
10597
10598         r = talloc(talloc_tos(), struct clusapi_OpenNetInterfaceEx);
10599         if (r == NULL) {
10600                 return false;
10601         }
10602
10603         pull = ndr_pull_init_blob(&p->in_data.data, r);
10604         if (pull == NULL) {
10605                 talloc_free(r);
10606                 return false;
10607         }
10608
10609         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10610         if (p->endian) {
10611                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10612         }
10613         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10614         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10615                 talloc_free(r);
10616                 return false;
10617         }
10618
10619         if (DEBUGLEVEL >= 10) {
10620                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetInterfaceEx, NDR_IN, r);
10621         }
10622
10623         ZERO_STRUCT(r->out);
10624         r->out.lpdwGrantedAccess = talloc_zero(r, uint32_t);
10625         if (r->out.lpdwGrantedAccess == NULL) {
10626                 talloc_free(r);
10627                 return false;
10628         }
10629
10630         r->out.Status = talloc_zero(r, WERROR);
10631         if (r->out.Status == NULL) {
10632                 talloc_free(r);
10633                 return false;
10634         }
10635
10636         r->out.rpc_status = talloc_zero(r, WERROR);
10637         if (r->out.rpc_status == NULL) {
10638                 talloc_free(r);
10639                 return false;
10640         }
10641
10642         r->out.hNetInterface = talloc_zero(r, struct policy_handle);
10643         if (r->out.hNetInterface == NULL) {
10644                 talloc_free(r);
10645                 return false;
10646         }
10647
10648         _clusapi_OpenNetInterfaceEx(p, r);
10649
10650         if (p->fault_state) {
10651                 talloc_free(r);
10652                 /* Return true here, srv_pipe_hnd.c will take care */
10653                 return true;
10654         }
10655
10656         if (DEBUGLEVEL >= 10) {
10657                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OpenNetInterfaceEx, NDR_OUT | NDR_SET_VALUES, r);
10658         }
10659
10660         push = ndr_push_init_ctx(r);
10661         if (push == NULL) {
10662                 talloc_free(r);
10663                 return false;
10664         }
10665
10666         /*
10667          * carry over the pointer count to the reply in case we are
10668          * using full pointer. See NDR specification for full pointers
10669          */
10670         push->ptr_count = pull->ptr_count;
10671
10672         ndr_err = call->ndr_push(push, NDR_OUT, r);
10673         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10674                 talloc_free(r);
10675                 return false;
10676         }
10677
10678         p->out_data.rdata = ndr_push_blob(push);
10679         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10680
10681         talloc_free(r);
10682
10683         return true;
10684 }
10685
10686 static bool api_clusapi_ChangeCsvState(struct pipes_struct *p)
10687 {
10688         const struct ndr_interface_call *call;
10689         struct ndr_pull *pull;
10690         struct ndr_push *push;
10691         enum ndr_err_code ndr_err;
10692         struct clusapi_ChangeCsvState *r;
10693
10694         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CHANGECSVSTATE];
10695
10696         r = talloc(talloc_tos(), struct clusapi_ChangeCsvState);
10697         if (r == NULL) {
10698                 return false;
10699         }
10700
10701         pull = ndr_pull_init_blob(&p->in_data.data, r);
10702         if (pull == NULL) {
10703                 talloc_free(r);
10704                 return false;
10705         }
10706
10707         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10708         if (p->endian) {
10709                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10710         }
10711         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10712         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10713                 talloc_free(r);
10714                 return false;
10715         }
10716
10717         if (DEBUGLEVEL >= 10) {
10718                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ChangeCsvState, NDR_IN, r);
10719         }
10720
10721         ZERO_STRUCT(r->out);
10722         r->out.rpc_status = talloc_zero(r, WERROR);
10723         if (r->out.rpc_status == NULL) {
10724                 talloc_free(r);
10725                 return false;
10726         }
10727
10728         r->out.result = _clusapi_ChangeCsvState(p, r);
10729
10730         if (p->fault_state) {
10731                 talloc_free(r);
10732                 /* Return true here, srv_pipe_hnd.c will take care */
10733                 return true;
10734         }
10735
10736         if (DEBUGLEVEL >= 10) {
10737                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ChangeCsvState, NDR_OUT | NDR_SET_VALUES, r);
10738         }
10739
10740         push = ndr_push_init_ctx(r);
10741         if (push == NULL) {
10742                 talloc_free(r);
10743                 return false;
10744         }
10745
10746         /*
10747          * carry over the pointer count to the reply in case we are
10748          * using full pointer. See NDR specification for full pointers
10749          */
10750         push->ptr_count = pull->ptr_count;
10751
10752         ndr_err = call->ndr_push(push, NDR_OUT, r);
10753         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10754                 talloc_free(r);
10755                 return false;
10756         }
10757
10758         p->out_data.rdata = ndr_push_blob(push);
10759         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10760
10761         talloc_free(r);
10762
10763         return true;
10764 }
10765
10766 static bool api_clusapi_CreateNodeEnumEx(struct pipes_struct *p)
10767 {
10768         const struct ndr_interface_call *call;
10769         struct ndr_pull *pull;
10770         struct ndr_push *push;
10771         enum ndr_err_code ndr_err;
10772         struct clusapi_CreateNodeEnumEx *r;
10773
10774         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATENODEENUMEX];
10775
10776         r = talloc(talloc_tos(), struct clusapi_CreateNodeEnumEx);
10777         if (r == NULL) {
10778                 return false;
10779         }
10780
10781         pull = ndr_pull_init_blob(&p->in_data.data, r);
10782         if (pull == NULL) {
10783                 talloc_free(r);
10784                 return false;
10785         }
10786
10787         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10788         if (p->endian) {
10789                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10790         }
10791         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10792         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10793                 talloc_free(r);
10794                 return false;
10795         }
10796
10797         if (DEBUGLEVEL >= 10) {
10798                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNodeEnumEx, NDR_IN, r);
10799         }
10800
10801         ZERO_STRUCT(r->out);
10802         r->out.ReturnIdEnum = talloc_zero(r, struct ENUM_LIST *);
10803         if (r->out.ReturnIdEnum == NULL) {
10804                 talloc_free(r);
10805                 return false;
10806         }
10807
10808         r->out.ReturnNameEnum = talloc_zero(r, struct ENUM_LIST *);
10809         if (r->out.ReturnNameEnum == NULL) {
10810                 talloc_free(r);
10811                 return false;
10812         }
10813
10814         r->out.rpc_status = talloc_zero(r, WERROR);
10815         if (r->out.rpc_status == NULL) {
10816                 talloc_free(r);
10817                 return false;
10818         }
10819
10820         r->out.result = _clusapi_CreateNodeEnumEx(p, r);
10821
10822         if (p->fault_state) {
10823                 talloc_free(r);
10824                 /* Return true here, srv_pipe_hnd.c will take care */
10825                 return true;
10826         }
10827
10828         if (DEBUGLEVEL >= 10) {
10829                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNodeEnumEx, NDR_OUT | NDR_SET_VALUES, r);
10830         }
10831
10832         push = ndr_push_init_ctx(r);
10833         if (push == NULL) {
10834                 talloc_free(r);
10835                 return false;
10836         }
10837
10838         /*
10839          * carry over the pointer count to the reply in case we are
10840          * using full pointer. See NDR specification for full pointers
10841          */
10842         push->ptr_count = pull->ptr_count;
10843
10844         ndr_err = call->ndr_push(push, NDR_OUT, r);
10845         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10846                 talloc_free(r);
10847                 return false;
10848         }
10849
10850         p->out_data.rdata = ndr_push_blob(push);
10851         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10852
10853         talloc_free(r);
10854
10855         return true;
10856 }
10857
10858 static bool api_clusapi_CreateEnumEx(struct pipes_struct *p)
10859 {
10860         const struct ndr_interface_call *call;
10861         struct ndr_pull *pull;
10862         struct ndr_push *push;
10863         enum ndr_err_code ndr_err;
10864         struct clusapi_CreateEnumEx *r;
10865
10866         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEENUMEX];
10867
10868         r = talloc(talloc_tos(), struct clusapi_CreateEnumEx);
10869         if (r == NULL) {
10870                 return false;
10871         }
10872
10873         pull = ndr_pull_init_blob(&p->in_data.data, r);
10874         if (pull == NULL) {
10875                 talloc_free(r);
10876                 return false;
10877         }
10878
10879         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10880         if (p->endian) {
10881                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10882         }
10883         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10884         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10885                 talloc_free(r);
10886                 return false;
10887         }
10888
10889         if (DEBUGLEVEL >= 10) {
10890                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateEnumEx, NDR_IN, r);
10891         }
10892
10893         ZERO_STRUCT(r->out);
10894         r->out.ReturnIdEnum = talloc_zero(r, struct ENUM_LIST *);
10895         if (r->out.ReturnIdEnum == NULL) {
10896                 talloc_free(r);
10897                 return false;
10898         }
10899
10900         r->out.ReturnNameEnum = talloc_zero(r, struct ENUM_LIST *);
10901         if (r->out.ReturnNameEnum == NULL) {
10902                 talloc_free(r);
10903                 return false;
10904         }
10905
10906         r->out.rpc_status = talloc_zero(r, WERROR);
10907         if (r->out.rpc_status == NULL) {
10908                 talloc_free(r);
10909                 return false;
10910         }
10911
10912         r->out.result = _clusapi_CreateEnumEx(p, r);
10913
10914         if (p->fault_state) {
10915                 talloc_free(r);
10916                 /* Return true here, srv_pipe_hnd.c will take care */
10917                 return true;
10918         }
10919
10920         if (DEBUGLEVEL >= 10) {
10921                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateEnumEx, NDR_OUT | NDR_SET_VALUES, r);
10922         }
10923
10924         push = ndr_push_init_ctx(r);
10925         if (push == NULL) {
10926                 talloc_free(r);
10927                 return false;
10928         }
10929
10930         /*
10931          * carry over the pointer count to the reply in case we are
10932          * using full pointer. See NDR specification for full pointers
10933          */
10934         push->ptr_count = pull->ptr_count;
10935
10936         ndr_err = call->ndr_push(push, NDR_OUT, r);
10937         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10938                 talloc_free(r);
10939                 return false;
10940         }
10941
10942         p->out_data.rdata = ndr_push_blob(push);
10943         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
10944
10945         talloc_free(r);
10946
10947         return true;
10948 }
10949
10950 static bool api_clusapi_PauseNodeEx(struct pipes_struct *p)
10951 {
10952         const struct ndr_interface_call *call;
10953         struct ndr_pull *pull;
10954         struct ndr_push *push;
10955         enum ndr_err_code ndr_err;
10956         struct clusapi_PauseNodeEx *r;
10957
10958         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_PAUSENODEEX];
10959
10960         r = talloc(talloc_tos(), struct clusapi_PauseNodeEx);
10961         if (r == NULL) {
10962                 return false;
10963         }
10964
10965         pull = ndr_pull_init_blob(&p->in_data.data, r);
10966         if (pull == NULL) {
10967                 talloc_free(r);
10968                 return false;
10969         }
10970
10971         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
10972         if (p->endian) {
10973                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
10974         }
10975         ndr_err = call->ndr_pull(pull, NDR_IN, r);
10976         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
10977                 talloc_free(r);
10978                 return false;
10979         }
10980
10981         if (DEBUGLEVEL >= 10) {
10982                 NDR_PRINT_FUNCTION_DEBUG(clusapi_PauseNodeEx, NDR_IN, r);
10983         }
10984
10985         ZERO_STRUCT(r->out);
10986         r->out.rpc_status = talloc_zero(r, WERROR);
10987         if (r->out.rpc_status == NULL) {
10988                 talloc_free(r);
10989                 return false;
10990         }
10991
10992         r->out.result = _clusapi_PauseNodeEx(p, r);
10993
10994         if (p->fault_state) {
10995                 talloc_free(r);
10996                 /* Return true here, srv_pipe_hnd.c will take care */
10997                 return true;
10998         }
10999
11000         if (DEBUGLEVEL >= 10) {
11001                 NDR_PRINT_FUNCTION_DEBUG(clusapi_PauseNodeEx, NDR_OUT | NDR_SET_VALUES, r);
11002         }
11003
11004         push = ndr_push_init_ctx(r);
11005         if (push == NULL) {
11006                 talloc_free(r);
11007                 return false;
11008         }
11009
11010         /*
11011          * carry over the pointer count to the reply in case we are
11012          * using full pointer. See NDR specification for full pointers
11013          */
11014         push->ptr_count = pull->ptr_count;
11015
11016         ndr_err = call->ndr_push(push, NDR_OUT, r);
11017         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11018                 talloc_free(r);
11019                 return false;
11020         }
11021
11022         p->out_data.rdata = ndr_push_blob(push);
11023         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11024
11025         talloc_free(r);
11026
11027         return true;
11028 }
11029
11030 static bool api_clusapi_PauseNodeWithDrainTarget(struct pipes_struct *p)
11031 {
11032         const struct ndr_interface_call *call;
11033         struct ndr_pull *pull;
11034         struct ndr_push *push;
11035         enum ndr_err_code ndr_err;
11036         struct clusapi_PauseNodeWithDrainTarget *r;
11037
11038         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_PAUSENODEWITHDRAINTARGET];
11039
11040         r = talloc(talloc_tos(), struct clusapi_PauseNodeWithDrainTarget);
11041         if (r == NULL) {
11042                 return false;
11043         }
11044
11045         pull = ndr_pull_init_blob(&p->in_data.data, r);
11046         if (pull == NULL) {
11047                 talloc_free(r);
11048                 return false;
11049         }
11050
11051         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11052         if (p->endian) {
11053                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11054         }
11055         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11056         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11057                 talloc_free(r);
11058                 return false;
11059         }
11060
11061         if (DEBUGLEVEL >= 10) {
11062                 NDR_PRINT_FUNCTION_DEBUG(clusapi_PauseNodeWithDrainTarget, NDR_IN, r);
11063         }
11064
11065         ZERO_STRUCT(r->out);
11066         r->out.rpc_status = talloc_zero(r, WERROR);
11067         if (r->out.rpc_status == NULL) {
11068                 talloc_free(r);
11069                 return false;
11070         }
11071
11072         r->out.result = _clusapi_PauseNodeWithDrainTarget(p, r);
11073
11074         if (p->fault_state) {
11075                 talloc_free(r);
11076                 /* Return true here, srv_pipe_hnd.c will take care */
11077                 return true;
11078         }
11079
11080         if (DEBUGLEVEL >= 10) {
11081                 NDR_PRINT_FUNCTION_DEBUG(clusapi_PauseNodeWithDrainTarget, NDR_OUT | NDR_SET_VALUES, r);
11082         }
11083
11084         push = ndr_push_init_ctx(r);
11085         if (push == NULL) {
11086                 talloc_free(r);
11087                 return false;
11088         }
11089
11090         /*
11091          * carry over the pointer count to the reply in case we are
11092          * using full pointer. See NDR specification for full pointers
11093          */
11094         push->ptr_count = pull->ptr_count;
11095
11096         ndr_err = call->ndr_push(push, NDR_OUT, r);
11097         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11098                 talloc_free(r);
11099                 return false;
11100         }
11101
11102         p->out_data.rdata = ndr_push_blob(push);
11103         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11104
11105         talloc_free(r);
11106
11107         return true;
11108 }
11109
11110 static bool api_clusapi_ResumeNodeEx(struct pipes_struct *p)
11111 {
11112         const struct ndr_interface_call *call;
11113         struct ndr_pull *pull;
11114         struct ndr_push *push;
11115         enum ndr_err_code ndr_err;
11116         struct clusapi_ResumeNodeEx *r;
11117
11118         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_RESUMENODEEX];
11119
11120         r = talloc(talloc_tos(), struct clusapi_ResumeNodeEx);
11121         if (r == NULL) {
11122                 return false;
11123         }
11124
11125         pull = ndr_pull_init_blob(&p->in_data.data, r);
11126         if (pull == NULL) {
11127                 talloc_free(r);
11128                 return false;
11129         }
11130
11131         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11132         if (p->endian) {
11133                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11134         }
11135         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11136         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11137                 talloc_free(r);
11138                 return false;
11139         }
11140
11141         if (DEBUGLEVEL >= 10) {
11142                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResumeNodeEx, NDR_IN, r);
11143         }
11144
11145         ZERO_STRUCT(r->out);
11146         r->out.rpc_status = talloc_zero(r, WERROR);
11147         if (r->out.rpc_status == NULL) {
11148                 talloc_free(r);
11149                 return false;
11150         }
11151
11152         r->out.result = _clusapi_ResumeNodeEx(p, r);
11153
11154         if (p->fault_state) {
11155                 talloc_free(r);
11156                 /* Return true here, srv_pipe_hnd.c will take care */
11157                 return true;
11158         }
11159
11160         if (DEBUGLEVEL >= 10) {
11161                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ResumeNodeEx, NDR_OUT | NDR_SET_VALUES, r);
11162         }
11163
11164         push = ndr_push_init_ctx(r);
11165         if (push == NULL) {
11166                 talloc_free(r);
11167                 return false;
11168         }
11169
11170         /*
11171          * carry over the pointer count to the reply in case we are
11172          * using full pointer. See NDR specification for full pointers
11173          */
11174         push->ptr_count = pull->ptr_count;
11175
11176         ndr_err = call->ndr_push(push, NDR_OUT, r);
11177         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11178                 talloc_free(r);
11179                 return false;
11180         }
11181
11182         p->out_data.rdata = ndr_push_blob(push);
11183         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11184
11185         talloc_free(r);
11186
11187         return true;
11188 }
11189
11190 static bool api_clusapi_CreateGroupEx(struct pipes_struct *p)
11191 {
11192         const struct ndr_interface_call *call;
11193         struct ndr_pull *pull;
11194         struct ndr_push *push;
11195         enum ndr_err_code ndr_err;
11196         struct clusapi_CreateGroupEx *r;
11197
11198         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEGROUPEX];
11199
11200         r = talloc(talloc_tos(), struct clusapi_CreateGroupEx);
11201         if (r == NULL) {
11202                 return false;
11203         }
11204
11205         pull = ndr_pull_init_blob(&p->in_data.data, r);
11206         if (pull == NULL) {
11207                 talloc_free(r);
11208                 return false;
11209         }
11210
11211         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11212         if (p->endian) {
11213                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11214         }
11215         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11216         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11217                 talloc_free(r);
11218                 return false;
11219         }
11220
11221         if (DEBUGLEVEL >= 10) {
11222                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroupEx, NDR_IN, r);
11223         }
11224
11225         ZERO_STRUCT(r->out);
11226         r->out.Status = talloc_zero(r, WERROR);
11227         if (r->out.Status == NULL) {
11228                 talloc_free(r);
11229                 return false;
11230         }
11231
11232         r->out.rpc_status = talloc_zero(r, WERROR);
11233         if (r->out.rpc_status == NULL) {
11234                 talloc_free(r);
11235                 return false;
11236         }
11237
11238         r->out.hGroup = talloc_zero(r, struct policy_handle);
11239         if (r->out.hGroup == NULL) {
11240                 talloc_free(r);
11241                 return false;
11242         }
11243
11244         _clusapi_CreateGroupEx(p, r);
11245
11246         if (p->fault_state) {
11247                 talloc_free(r);
11248                 /* Return true here, srv_pipe_hnd.c will take care */
11249                 return true;
11250         }
11251
11252         if (DEBUGLEVEL >= 10) {
11253                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroupEx, NDR_OUT | NDR_SET_VALUES, r);
11254         }
11255
11256         push = ndr_push_init_ctx(r);
11257         if (push == NULL) {
11258                 talloc_free(r);
11259                 return false;
11260         }
11261
11262         /*
11263          * carry over the pointer count to the reply in case we are
11264          * using full pointer. See NDR specification for full pointers
11265          */
11266         push->ptr_count = pull->ptr_count;
11267
11268         ndr_err = call->ndr_push(push, NDR_OUT, r);
11269         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11270                 talloc_free(r);
11271                 return false;
11272         }
11273
11274         p->out_data.rdata = ndr_push_blob(push);
11275         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11276
11277         talloc_free(r);
11278
11279         return true;
11280 }
11281
11282 static bool api_clusapi_OnlineGroupEx(struct pipes_struct *p)
11283 {
11284         const struct ndr_interface_call *call;
11285         struct ndr_pull *pull;
11286         struct ndr_push *push;
11287         enum ndr_err_code ndr_err;
11288         struct clusapi_OnlineGroupEx *r;
11289
11290         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ONLINEGROUPEX];
11291
11292         r = talloc(talloc_tos(), struct clusapi_OnlineGroupEx);
11293         if (r == NULL) {
11294                 return false;
11295         }
11296
11297         pull = ndr_pull_init_blob(&p->in_data.data, r);
11298         if (pull == NULL) {
11299                 talloc_free(r);
11300                 return false;
11301         }
11302
11303         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11304         if (p->endian) {
11305                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11306         }
11307         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11308         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11309                 talloc_free(r);
11310                 return false;
11311         }
11312
11313         if (DEBUGLEVEL >= 10) {
11314                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineGroupEx, NDR_IN, r);
11315         }
11316
11317         ZERO_STRUCT(r->out);
11318         r->out.rpc_status = talloc_zero(r, WERROR);
11319         if (r->out.rpc_status == NULL) {
11320                 talloc_free(r);
11321                 return false;
11322         }
11323
11324         r->out.result = _clusapi_OnlineGroupEx(p, r);
11325
11326         if (p->fault_state) {
11327                 talloc_free(r);
11328                 /* Return true here, srv_pipe_hnd.c will take care */
11329                 return true;
11330         }
11331
11332         if (DEBUGLEVEL >= 10) {
11333                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineGroupEx, NDR_OUT | NDR_SET_VALUES, r);
11334         }
11335
11336         push = ndr_push_init_ctx(r);
11337         if (push == NULL) {
11338                 talloc_free(r);
11339                 return false;
11340         }
11341
11342         /*
11343          * carry over the pointer count to the reply in case we are
11344          * using full pointer. See NDR specification for full pointers
11345          */
11346         push->ptr_count = pull->ptr_count;
11347
11348         ndr_err = call->ndr_push(push, NDR_OUT, r);
11349         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11350                 talloc_free(r);
11351                 return false;
11352         }
11353
11354         p->out_data.rdata = ndr_push_blob(push);
11355         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11356
11357         talloc_free(r);
11358
11359         return true;
11360 }
11361
11362 static bool api_clusapi_OfflineGroupEx(struct pipes_struct *p)
11363 {
11364         const struct ndr_interface_call *call;
11365         struct ndr_pull *pull;
11366         struct ndr_push *push;
11367         enum ndr_err_code ndr_err;
11368         struct clusapi_OfflineGroupEx *r;
11369
11370         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OFFLINEGROUPEX];
11371
11372         r = talloc(talloc_tos(), struct clusapi_OfflineGroupEx);
11373         if (r == NULL) {
11374                 return false;
11375         }
11376
11377         pull = ndr_pull_init_blob(&p->in_data.data, r);
11378         if (pull == NULL) {
11379                 talloc_free(r);
11380                 return false;
11381         }
11382
11383         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11384         if (p->endian) {
11385                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11386         }
11387         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11388         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11389                 talloc_free(r);
11390                 return false;
11391         }
11392
11393         if (DEBUGLEVEL >= 10) {
11394                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineGroupEx, NDR_IN, r);
11395         }
11396
11397         ZERO_STRUCT(r->out);
11398         r->out.rpc_status = talloc_zero(r, WERROR);
11399         if (r->out.rpc_status == NULL) {
11400                 talloc_free(r);
11401                 return false;
11402         }
11403
11404         r->out.result = _clusapi_OfflineGroupEx(p, r);
11405
11406         if (p->fault_state) {
11407                 talloc_free(r);
11408                 /* Return true here, srv_pipe_hnd.c will take care */
11409                 return true;
11410         }
11411
11412         if (DEBUGLEVEL >= 10) {
11413                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineGroupEx, NDR_OUT | NDR_SET_VALUES, r);
11414         }
11415
11416         push = ndr_push_init_ctx(r);
11417         if (push == NULL) {
11418                 talloc_free(r);
11419                 return false;
11420         }
11421
11422         /*
11423          * carry over the pointer count to the reply in case we are
11424          * using full pointer. See NDR specification for full pointers
11425          */
11426         push->ptr_count = pull->ptr_count;
11427
11428         ndr_err = call->ndr_push(push, NDR_OUT, r);
11429         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11430                 talloc_free(r);
11431                 return false;
11432         }
11433
11434         p->out_data.rdata = ndr_push_blob(push);
11435         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11436
11437         talloc_free(r);
11438
11439         return true;
11440 }
11441
11442 static bool api_clusapi_MoveGroupEx(struct pipes_struct *p)
11443 {
11444         const struct ndr_interface_call *call;
11445         struct ndr_pull *pull;
11446         struct ndr_push *push;
11447         enum ndr_err_code ndr_err;
11448         struct clusapi_MoveGroupEx *r;
11449
11450         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_MOVEGROUPEX];
11451
11452         r = talloc(talloc_tos(), struct clusapi_MoveGroupEx);
11453         if (r == NULL) {
11454                 return false;
11455         }
11456
11457         pull = ndr_pull_init_blob(&p->in_data.data, r);
11458         if (pull == NULL) {
11459                 talloc_free(r);
11460                 return false;
11461         }
11462
11463         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11464         if (p->endian) {
11465                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11466         }
11467         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11468         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11469                 talloc_free(r);
11470                 return false;
11471         }
11472
11473         if (DEBUGLEVEL >= 10) {
11474                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroupEx, NDR_IN, r);
11475         }
11476
11477         ZERO_STRUCT(r->out);
11478         r->out.rpc_status = talloc_zero(r, WERROR);
11479         if (r->out.rpc_status == NULL) {
11480                 talloc_free(r);
11481                 return false;
11482         }
11483
11484         r->out.result = _clusapi_MoveGroupEx(p, r);
11485
11486         if (p->fault_state) {
11487                 talloc_free(r);
11488                 /* Return true here, srv_pipe_hnd.c will take care */
11489                 return true;
11490         }
11491
11492         if (DEBUGLEVEL >= 10) {
11493                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroupEx, NDR_OUT | NDR_SET_VALUES, r);
11494         }
11495
11496         push = ndr_push_init_ctx(r);
11497         if (push == NULL) {
11498                 talloc_free(r);
11499                 return false;
11500         }
11501
11502         /*
11503          * carry over the pointer count to the reply in case we are
11504          * using full pointer. See NDR specification for full pointers
11505          */
11506         push->ptr_count = pull->ptr_count;
11507
11508         ndr_err = call->ndr_push(push, NDR_OUT, r);
11509         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11510                 talloc_free(r);
11511                 return false;
11512         }
11513
11514         p->out_data.rdata = ndr_push_blob(push);
11515         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11516
11517         talloc_free(r);
11518
11519         return true;
11520 }
11521
11522 static bool api_clusapi_MoveGroupToNodeEx(struct pipes_struct *p)
11523 {
11524         const struct ndr_interface_call *call;
11525         struct ndr_pull *pull;
11526         struct ndr_push *push;
11527         enum ndr_err_code ndr_err;
11528         struct clusapi_MoveGroupToNodeEx *r;
11529
11530         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_MOVEGROUPTONODEEX];
11531
11532         r = talloc(talloc_tos(), struct clusapi_MoveGroupToNodeEx);
11533         if (r == NULL) {
11534                 return false;
11535         }
11536
11537         pull = ndr_pull_init_blob(&p->in_data.data, r);
11538         if (pull == NULL) {
11539                 talloc_free(r);
11540                 return false;
11541         }
11542
11543         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11544         if (p->endian) {
11545                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11546         }
11547         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11548         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11549                 talloc_free(r);
11550                 return false;
11551         }
11552
11553         if (DEBUGLEVEL >= 10) {
11554                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroupToNodeEx, NDR_IN, r);
11555         }
11556
11557         ZERO_STRUCT(r->out);
11558         r->out.rpc_status = talloc_zero(r, WERROR);
11559         if (r->out.rpc_status == NULL) {
11560                 talloc_free(r);
11561                 return false;
11562         }
11563
11564         r->out.result = _clusapi_MoveGroupToNodeEx(p, r);
11565
11566         if (p->fault_state) {
11567                 talloc_free(r);
11568                 /* Return true here, srv_pipe_hnd.c will take care */
11569                 return true;
11570         }
11571
11572         if (DEBUGLEVEL >= 10) {
11573                 NDR_PRINT_FUNCTION_DEBUG(clusapi_MoveGroupToNodeEx, NDR_OUT | NDR_SET_VALUES, r);
11574         }
11575
11576         push = ndr_push_init_ctx(r);
11577         if (push == NULL) {
11578                 talloc_free(r);
11579                 return false;
11580         }
11581
11582         /*
11583          * carry over the pointer count to the reply in case we are
11584          * using full pointer. See NDR specification for full pointers
11585          */
11586         push->ptr_count = pull->ptr_count;
11587
11588         ndr_err = call->ndr_push(push, NDR_OUT, r);
11589         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11590                 talloc_free(r);
11591                 return false;
11592         }
11593
11594         p->out_data.rdata = ndr_push_blob(push);
11595         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11596
11597         talloc_free(r);
11598
11599         return true;
11600 }
11601
11602 static bool api_clusapi_CancelClusterGroupOperation(struct pipes_struct *p)
11603 {
11604         const struct ndr_interface_call *call;
11605         struct ndr_pull *pull;
11606         struct ndr_push *push;
11607         enum ndr_err_code ndr_err;
11608         struct clusapi_CancelClusterGroupOperation *r;
11609
11610         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CANCELCLUSTERGROUPOPERATION];
11611
11612         r = talloc(talloc_tos(), struct clusapi_CancelClusterGroupOperation);
11613         if (r == NULL) {
11614                 return false;
11615         }
11616
11617         pull = ndr_pull_init_blob(&p->in_data.data, r);
11618         if (pull == NULL) {
11619                 talloc_free(r);
11620                 return false;
11621         }
11622
11623         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11624         if (p->endian) {
11625                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11626         }
11627         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11628         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11629                 talloc_free(r);
11630                 return false;
11631         }
11632
11633         if (DEBUGLEVEL >= 10) {
11634                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CancelClusterGroupOperation, NDR_IN, r);
11635         }
11636
11637         ZERO_STRUCT(r->out);
11638         r->out.rpc_status = talloc_zero(r, WERROR);
11639         if (r->out.rpc_status == NULL) {
11640                 talloc_free(r);
11641                 return false;
11642         }
11643
11644         r->out.result = _clusapi_CancelClusterGroupOperation(p, r);
11645
11646         if (p->fault_state) {
11647                 talloc_free(r);
11648                 /* Return true here, srv_pipe_hnd.c will take care */
11649                 return true;
11650         }
11651
11652         if (DEBUGLEVEL >= 10) {
11653                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CancelClusterGroupOperation, NDR_OUT | NDR_SET_VALUES, r);
11654         }
11655
11656         push = ndr_push_init_ctx(r);
11657         if (push == NULL) {
11658                 talloc_free(r);
11659                 return false;
11660         }
11661
11662         /*
11663          * carry over the pointer count to the reply in case we are
11664          * using full pointer. See NDR specification for full pointers
11665          */
11666         push->ptr_count = pull->ptr_count;
11667
11668         ndr_err = call->ndr_push(push, NDR_OUT, r);
11669         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11670                 talloc_free(r);
11671                 return false;
11672         }
11673
11674         p->out_data.rdata = ndr_push_blob(push);
11675         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11676
11677         talloc_free(r);
11678
11679         return true;
11680 }
11681
11682 static bool api_clusapi_OnlineResourceEx(struct pipes_struct *p)
11683 {
11684         const struct ndr_interface_call *call;
11685         struct ndr_pull *pull;
11686         struct ndr_push *push;
11687         enum ndr_err_code ndr_err;
11688         struct clusapi_OnlineResourceEx *r;
11689
11690         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ONLINERESOURCEEX];
11691
11692         r = talloc(talloc_tos(), struct clusapi_OnlineResourceEx);
11693         if (r == NULL) {
11694                 return false;
11695         }
11696
11697         pull = ndr_pull_init_blob(&p->in_data.data, r);
11698         if (pull == NULL) {
11699                 talloc_free(r);
11700                 return false;
11701         }
11702
11703         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11704         if (p->endian) {
11705                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11706         }
11707         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11708         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11709                 talloc_free(r);
11710                 return false;
11711         }
11712
11713         if (DEBUGLEVEL >= 10) {
11714                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineResourceEx, NDR_IN, r);
11715         }
11716
11717         ZERO_STRUCT(r->out);
11718         r->out.rpc_status = talloc_zero(r, WERROR);
11719         if (r->out.rpc_status == NULL) {
11720                 talloc_free(r);
11721                 return false;
11722         }
11723
11724         r->out.result = _clusapi_OnlineResourceEx(p, r);
11725
11726         if (p->fault_state) {
11727                 talloc_free(r);
11728                 /* Return true here, srv_pipe_hnd.c will take care */
11729                 return true;
11730         }
11731
11732         if (DEBUGLEVEL >= 10) {
11733                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OnlineResourceEx, NDR_OUT | NDR_SET_VALUES, r);
11734         }
11735
11736         push = ndr_push_init_ctx(r);
11737         if (push == NULL) {
11738                 talloc_free(r);
11739                 return false;
11740         }
11741
11742         /*
11743          * carry over the pointer count to the reply in case we are
11744          * using full pointer. See NDR specification for full pointers
11745          */
11746         push->ptr_count = pull->ptr_count;
11747
11748         ndr_err = call->ndr_push(push, NDR_OUT, r);
11749         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11750                 talloc_free(r);
11751                 return false;
11752         }
11753
11754         p->out_data.rdata = ndr_push_blob(push);
11755         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11756
11757         talloc_free(r);
11758
11759         return true;
11760 }
11761
11762 static bool api_clusapi_OfflineResourceEx(struct pipes_struct *p)
11763 {
11764         const struct ndr_interface_call *call;
11765         struct ndr_pull *pull;
11766         struct ndr_push *push;
11767         enum ndr_err_code ndr_err;
11768         struct clusapi_OfflineResourceEx *r;
11769
11770         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_OFFLINERESOURCEEX];
11771
11772         r = talloc(talloc_tos(), struct clusapi_OfflineResourceEx);
11773         if (r == NULL) {
11774                 return false;
11775         }
11776
11777         pull = ndr_pull_init_blob(&p->in_data.data, r);
11778         if (pull == NULL) {
11779                 talloc_free(r);
11780                 return false;
11781         }
11782
11783         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11784         if (p->endian) {
11785                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11786         }
11787         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11788         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11789                 talloc_free(r);
11790                 return false;
11791         }
11792
11793         if (DEBUGLEVEL >= 10) {
11794                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineResourceEx, NDR_IN, r);
11795         }
11796
11797         ZERO_STRUCT(r->out);
11798         r->out.rpc_status = talloc_zero(r, WERROR);
11799         if (r->out.rpc_status == NULL) {
11800                 talloc_free(r);
11801                 return false;
11802         }
11803
11804         r->out.result = _clusapi_OfflineResourceEx(p, r);
11805
11806         if (p->fault_state) {
11807                 talloc_free(r);
11808                 /* Return true here, srv_pipe_hnd.c will take care */
11809                 return true;
11810         }
11811
11812         if (DEBUGLEVEL >= 10) {
11813                 NDR_PRINT_FUNCTION_DEBUG(clusapi_OfflineResourceEx, NDR_OUT | NDR_SET_VALUES, r);
11814         }
11815
11816         push = ndr_push_init_ctx(r);
11817         if (push == NULL) {
11818                 talloc_free(r);
11819                 return false;
11820         }
11821
11822         /*
11823          * carry over the pointer count to the reply in case we are
11824          * using full pointer. See NDR specification for full pointers
11825          */
11826         push->ptr_count = pull->ptr_count;
11827
11828         ndr_err = call->ndr_push(push, NDR_OUT, r);
11829         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11830                 talloc_free(r);
11831                 return false;
11832         }
11833
11834         p->out_data.rdata = ndr_push_blob(push);
11835         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11836
11837         talloc_free(r);
11838
11839         return true;
11840 }
11841
11842 static bool api_clusapi_CreateNotifyV2(struct pipes_struct *p)
11843 {
11844         const struct ndr_interface_call *call;
11845         struct ndr_pull *pull;
11846         struct ndr_push *push;
11847         enum ndr_err_code ndr_err;
11848         struct clusapi_CreateNotifyV2 *r;
11849
11850         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATENOTIFYV2];
11851
11852         r = talloc(talloc_tos(), struct clusapi_CreateNotifyV2);
11853         if (r == NULL) {
11854                 return false;
11855         }
11856
11857         pull = ndr_pull_init_blob(&p->in_data.data, r);
11858         if (pull == NULL) {
11859                 talloc_free(r);
11860                 return false;
11861         }
11862
11863         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11864         if (p->endian) {
11865                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11866         }
11867         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11868         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11869                 talloc_free(r);
11870                 return false;
11871         }
11872
11873         if (DEBUGLEVEL >= 10) {
11874                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNotifyV2, NDR_IN, r);
11875         }
11876
11877         ZERO_STRUCT(r->out);
11878         r->out.rpc_error = talloc_zero(r, WERROR);
11879         if (r->out.rpc_error == NULL) {
11880                 talloc_free(r);
11881                 return false;
11882         }
11883
11884         r->out.rpc_status = talloc_zero(r, WERROR);
11885         if (r->out.rpc_status == NULL) {
11886                 talloc_free(r);
11887                 return false;
11888         }
11889
11890         r->out.hNotify = talloc_zero(r, struct policy_handle);
11891         if (r->out.hNotify == NULL) {
11892                 talloc_free(r);
11893                 return false;
11894         }
11895
11896         _clusapi_CreateNotifyV2(p, r);
11897
11898         if (p->fault_state) {
11899                 talloc_free(r);
11900                 /* Return true here, srv_pipe_hnd.c will take care */
11901                 return true;
11902         }
11903
11904         if (DEBUGLEVEL >= 10) {
11905                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateNotifyV2, NDR_OUT | NDR_SET_VALUES, r);
11906         }
11907
11908         push = ndr_push_init_ctx(r);
11909         if (push == NULL) {
11910                 talloc_free(r);
11911                 return false;
11912         }
11913
11914         /*
11915          * carry over the pointer count to the reply in case we are
11916          * using full pointer. See NDR specification for full pointers
11917          */
11918         push->ptr_count = pull->ptr_count;
11919
11920         ndr_err = call->ndr_push(push, NDR_OUT, r);
11921         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11922                 talloc_free(r);
11923                 return false;
11924         }
11925
11926         p->out_data.rdata = ndr_push_blob(push);
11927         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
11928
11929         talloc_free(r);
11930
11931         return true;
11932 }
11933
11934 static bool api_clusapi_AddNotifyV2(struct pipes_struct *p)
11935 {
11936         const struct ndr_interface_call *call;
11937         struct ndr_pull *pull;
11938         struct ndr_push *push;
11939         enum ndr_err_code ndr_err;
11940         struct clusapi_AddNotifyV2 *r;
11941
11942         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_ADDNOTIFYV2];
11943
11944         r = talloc(talloc_tos(), struct clusapi_AddNotifyV2);
11945         if (r == NULL) {
11946                 return false;
11947         }
11948
11949         pull = ndr_pull_init_blob(&p->in_data.data, r);
11950         if (pull == NULL) {
11951                 talloc_free(r);
11952                 return false;
11953         }
11954
11955         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
11956         if (p->endian) {
11957                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
11958         }
11959         ndr_err = call->ndr_pull(pull, NDR_IN, r);
11960         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
11961                 talloc_free(r);
11962                 return false;
11963         }
11964
11965         if (DEBUGLEVEL >= 10) {
11966                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyV2, NDR_IN, r);
11967         }
11968
11969         ZERO_STRUCT(r->out);
11970         r->out.rpc_status = talloc_zero(r, WERROR);
11971         if (r->out.rpc_status == NULL) {
11972                 talloc_free(r);
11973                 return false;
11974         }
11975
11976         r->out.result = _clusapi_AddNotifyV2(p, r);
11977
11978         if (p->fault_state) {
11979                 talloc_free(r);
11980                 /* Return true here, srv_pipe_hnd.c will take care */
11981                 return true;
11982         }
11983
11984         if (DEBUGLEVEL >= 10) {
11985                 NDR_PRINT_FUNCTION_DEBUG(clusapi_AddNotifyV2, NDR_OUT | NDR_SET_VALUES, r);
11986         }
11987
11988         push = ndr_push_init_ctx(r);
11989         if (push == NULL) {
11990                 talloc_free(r);
11991                 return false;
11992         }
11993
11994         /*
11995          * carry over the pointer count to the reply in case we are
11996          * using full pointer. See NDR specification for full pointers
11997          */
11998         push->ptr_count = pull->ptr_count;
11999
12000         ndr_err = call->ndr_push(push, NDR_OUT, r);
12001         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12002                 talloc_free(r);
12003                 return false;
12004         }
12005
12006         p->out_data.rdata = ndr_push_blob(push);
12007         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12008
12009         talloc_free(r);
12010
12011         return true;
12012 }
12013
12014 static bool api_clusapi_GetNotifyV2(struct pipes_struct *p)
12015 {
12016         const struct ndr_interface_call *call;
12017         struct ndr_pull *pull;
12018         struct ndr_push *push;
12019         enum ndr_err_code ndr_err;
12020         struct clusapi_GetNotifyV2 *r;
12021
12022         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNOTIFYV2];
12023
12024         r = talloc(talloc_tos(), struct clusapi_GetNotifyV2);
12025         if (r == NULL) {
12026                 return false;
12027         }
12028
12029         pull = ndr_pull_init_blob(&p->in_data.data, r);
12030         if (pull == NULL) {
12031                 talloc_free(r);
12032                 return false;
12033         }
12034
12035         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12036         if (p->endian) {
12037                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12038         }
12039         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12040         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12041                 talloc_free(r);
12042                 return false;
12043         }
12044
12045         if (DEBUGLEVEL >= 10) {
12046                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNotifyV2, NDR_IN, r);
12047         }
12048
12049         ZERO_STRUCT(r->out);
12050         r->out.Notifications = talloc_zero(r, struct NOTIFICATION_RPC *);
12051         if (r->out.Notifications == NULL) {
12052                 talloc_free(r);
12053                 return false;
12054         }
12055
12056         r->out.dwNumNotifications = talloc_zero(r, uint32_t);
12057         if (r->out.dwNumNotifications == NULL) {
12058                 talloc_free(r);
12059                 return false;
12060         }
12061
12062         r->out.result = _clusapi_GetNotifyV2(p, r);
12063
12064         if (p->fault_state) {
12065                 talloc_free(r);
12066                 /* Return true here, srv_pipe_hnd.c will take care */
12067                 return true;
12068         }
12069
12070         if (DEBUGLEVEL >= 10) {
12071                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNotifyV2, NDR_OUT | NDR_SET_VALUES, r);
12072         }
12073
12074         push = ndr_push_init_ctx(r);
12075         if (push == NULL) {
12076                 talloc_free(r);
12077                 return false;
12078         }
12079
12080         /*
12081          * carry over the pointer count to the reply in case we are
12082          * using full pointer. See NDR specification for full pointers
12083          */
12084         push->ptr_count = pull->ptr_count;
12085
12086         ndr_err = call->ndr_push(push, NDR_OUT, r);
12087         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12088                 talloc_free(r);
12089                 return false;
12090         }
12091
12092         p->out_data.rdata = ndr_push_blob(push);
12093         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12094
12095         talloc_free(r);
12096
12097         return true;
12098 }
12099
12100 static bool api_clusapi_QueryAllValues(struct pipes_struct *p)
12101 {
12102         const struct ndr_interface_call *call;
12103         struct ndr_pull *pull;
12104         struct ndr_push *push;
12105         enum ndr_err_code ndr_err;
12106         struct clusapi_QueryAllValues *r;
12107
12108         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_QUERYALLVALUES];
12109
12110         r = talloc(talloc_tos(), struct clusapi_QueryAllValues);
12111         if (r == NULL) {
12112                 return false;
12113         }
12114
12115         pull = ndr_pull_init_blob(&p->in_data.data, r);
12116         if (pull == NULL) {
12117                 talloc_free(r);
12118                 return false;
12119         }
12120
12121         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12122         if (p->endian) {
12123                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12124         }
12125         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12126         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12127                 talloc_free(r);
12128                 return false;
12129         }
12130
12131         if (DEBUGLEVEL >= 10) {
12132                 NDR_PRINT_FUNCTION_DEBUG(clusapi_QueryAllValues, NDR_IN, r);
12133         }
12134
12135         ZERO_STRUCT(r->out);
12136         r->out.pcbData = talloc_zero(r, uint32_t);
12137         if (r->out.pcbData == NULL) {
12138                 talloc_free(r);
12139                 return false;
12140         }
12141
12142         r->out.ppData = talloc_zero_array(r, uint8_t *, 1);
12143         if (r->out.ppData == NULL) {
12144                 talloc_free(r);
12145                 return false;
12146         }
12147
12148         r->out.rpc_status = talloc_zero(r, WERROR);
12149         if (r->out.rpc_status == NULL) {
12150                 talloc_free(r);
12151                 return false;
12152         }
12153
12154         r->out.result = _clusapi_QueryAllValues(p, r);
12155
12156         if (p->fault_state) {
12157                 talloc_free(r);
12158                 /* Return true here, srv_pipe_hnd.c will take care */
12159                 return true;
12160         }
12161
12162         if (DEBUGLEVEL >= 10) {
12163                 NDR_PRINT_FUNCTION_DEBUG(clusapi_QueryAllValues, NDR_OUT | NDR_SET_VALUES, r);
12164         }
12165
12166         push = ndr_push_init_ctx(r);
12167         if (push == NULL) {
12168                 talloc_free(r);
12169                 return false;
12170         }
12171
12172         /*
12173          * carry over the pointer count to the reply in case we are
12174          * using full pointer. See NDR specification for full pointers
12175          */
12176         push->ptr_count = pull->ptr_count;
12177
12178         ndr_err = call->ndr_push(push, NDR_OUT, r);
12179         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12180                 talloc_free(r);
12181                 return false;
12182         }
12183
12184         p->out_data.rdata = ndr_push_blob(push);
12185         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12186
12187         talloc_free(r);
12188
12189         return true;
12190 }
12191
12192 static bool api_clusapi_StmFindDisk(struct pipes_struct *p)
12193 {
12194         const struct ndr_interface_call *call;
12195         struct ndr_pull *pull;
12196         struct ndr_push *push;
12197         enum ndr_err_code ndr_err;
12198         struct clusapi_StmFindDisk *r;
12199
12200         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_STMFINDDISK];
12201
12202         r = talloc(talloc_tos(), struct clusapi_StmFindDisk);
12203         if (r == NULL) {
12204                 return false;
12205         }
12206
12207         pull = ndr_pull_init_blob(&p->in_data.data, r);
12208         if (pull == NULL) {
12209                 talloc_free(r);
12210                 return false;
12211         }
12212
12213         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12214         if (p->endian) {
12215                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12216         }
12217         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12218         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12219                 talloc_free(r);
12220                 return false;
12221         }
12222
12223         if (DEBUGLEVEL >= 10) {
12224                 NDR_PRINT_FUNCTION_DEBUG(clusapi_StmFindDisk, NDR_IN, r);
12225         }
12226
12227         ZERO_STRUCT(r->out);
12228         r->out.pDiskId = r->in.pDiskId;
12229         r->out.ppszDeviceName = talloc_zero(r, const char *);
12230         if (r->out.ppszDeviceName == NULL) {
12231                 talloc_free(r);
12232                 return false;
12233         }
12234
12235         r->out.rpc_status = talloc_zero(r, WERROR);
12236         if (r->out.rpc_status == NULL) {
12237                 talloc_free(r);
12238                 return false;
12239         }
12240
12241         r->out.result = _clusapi_StmFindDisk(p, r);
12242
12243         if (p->fault_state) {
12244                 talloc_free(r);
12245                 /* Return true here, srv_pipe_hnd.c will take care */
12246                 return true;
12247         }
12248
12249         if (DEBUGLEVEL >= 10) {
12250                 NDR_PRINT_FUNCTION_DEBUG(clusapi_StmFindDisk, NDR_OUT | NDR_SET_VALUES, r);
12251         }
12252
12253         push = ndr_push_init_ctx(r);
12254         if (push == NULL) {
12255                 talloc_free(r);
12256                 return false;
12257         }
12258
12259         /*
12260          * carry over the pointer count to the reply in case we are
12261          * using full pointer. See NDR specification for full pointers
12262          */
12263         push->ptr_count = pull->ptr_count;
12264
12265         ndr_err = call->ndr_push(push, NDR_OUT, r);
12266         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12267                 talloc_free(r);
12268                 return false;
12269         }
12270
12271         p->out_data.rdata = ndr_push_blob(push);
12272         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12273
12274         talloc_free(r);
12275
12276         return true;
12277 }
12278
12279 static bool api_clusapi_ClusterMrr(struct pipes_struct *p)
12280 {
12281         const struct ndr_interface_call *call;
12282         struct ndr_pull *pull;
12283         struct ndr_push *push;
12284         enum ndr_err_code ndr_err;
12285         struct clusapi_ClusterMrr *r;
12286
12287         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CLUSTERMRR];
12288
12289         r = talloc(talloc_tos(), struct clusapi_ClusterMrr);
12290         if (r == NULL) {
12291                 return false;
12292         }
12293
12294         pull = ndr_pull_init_blob(&p->in_data.data, r);
12295         if (pull == NULL) {
12296                 talloc_free(r);
12297                 return false;
12298         }
12299
12300         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12301         if (p->endian) {
12302                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12303         }
12304         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12305         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12306                 talloc_free(r);
12307                 return false;
12308         }
12309
12310         if (DEBUGLEVEL >= 10) {
12311                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ClusterMrr, NDR_IN, r);
12312         }
12313
12314         ZERO_STRUCT(r->out);
12315         r->out.ppInfo = talloc_zero_array(r, struct CLUSTER_MRR_RESPONSE *, 1);
12316         if (r->out.ppInfo == NULL) {
12317                 talloc_free(r);
12318                 return false;
12319         }
12320
12321         r->out.rpc_status = talloc_zero(r, WERROR);
12322         if (r->out.rpc_status == NULL) {
12323                 talloc_free(r);
12324                 return false;
12325         }
12326
12327         r->out.result = _clusapi_ClusterMrr(p, r);
12328
12329         if (p->fault_state) {
12330                 talloc_free(r);
12331                 /* Return true here, srv_pipe_hnd.c will take care */
12332                 return true;
12333         }
12334
12335         if (DEBUGLEVEL >= 10) {
12336                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ClusterMrr, NDR_OUT | NDR_SET_VALUES, r);
12337         }
12338
12339         push = ndr_push_init_ctx(r);
12340         if (push == NULL) {
12341                 talloc_free(r);
12342                 return false;
12343         }
12344
12345         /*
12346          * carry over the pointer count to the reply in case we are
12347          * using full pointer. See NDR specification for full pointers
12348          */
12349         push->ptr_count = pull->ptr_count;
12350
12351         ndr_err = call->ndr_push(push, NDR_OUT, r);
12352         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12353                 talloc_free(r);
12354                 return false;
12355         }
12356
12357         p->out_data.rdata = ndr_push_blob(push);
12358         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12359
12360         talloc_free(r);
12361
12362         return true;
12363 }
12364
12365 static bool api_clusapi_CreateGroupEnum(struct pipes_struct *p)
12366 {
12367         const struct ndr_interface_call *call;
12368         struct ndr_pull *pull;
12369         struct ndr_push *push;
12370         enum ndr_err_code ndr_err;
12371         struct clusapi_CreateGroupEnum *r;
12372
12373         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATEGROUPENUM];
12374
12375         r = talloc(talloc_tos(), struct clusapi_CreateGroupEnum);
12376         if (r == NULL) {
12377                 return false;
12378         }
12379
12380         pull = ndr_pull_init_blob(&p->in_data.data, r);
12381         if (pull == NULL) {
12382                 talloc_free(r);
12383                 return false;
12384         }
12385
12386         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12387         if (p->endian) {
12388                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12389         }
12390         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12391         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12392                 talloc_free(r);
12393                 return false;
12394         }
12395
12396         if (DEBUGLEVEL >= 10) {
12397                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroupEnum, NDR_IN, r);
12398         }
12399
12400         ZERO_STRUCT(r->out);
12401         r->out.ppResultList = talloc_zero(r, struct GROUP_ENUM_LIST *);
12402         if (r->out.ppResultList == NULL) {
12403                 talloc_free(r);
12404                 return false;
12405         }
12406
12407         r->out.rpc_status = talloc_zero(r, WERROR);
12408         if (r->out.rpc_status == NULL) {
12409                 talloc_free(r);
12410                 return false;
12411         }
12412
12413         r->out.result = _clusapi_CreateGroupEnum(p, r);
12414
12415         if (p->fault_state) {
12416                 talloc_free(r);
12417                 /* Return true here, srv_pipe_hnd.c will take care */
12418                 return true;
12419         }
12420
12421         if (DEBUGLEVEL >= 10) {
12422                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateGroupEnum, NDR_OUT | NDR_SET_VALUES, r);
12423         }
12424
12425         push = ndr_push_init_ctx(r);
12426         if (push == NULL) {
12427                 talloc_free(r);
12428                 return false;
12429         }
12430
12431         /*
12432          * carry over the pointer count to the reply in case we are
12433          * using full pointer. See NDR specification for full pointers
12434          */
12435         push->ptr_count = pull->ptr_count;
12436
12437         ndr_err = call->ndr_push(push, NDR_OUT, r);
12438         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12439                 talloc_free(r);
12440                 return false;
12441         }
12442
12443         p->out_data.rdata = ndr_push_blob(push);
12444         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12445
12446         talloc_free(r);
12447
12448         return true;
12449 }
12450
12451 static bool api_clusapi_CreateResourceEnum(struct pipes_struct *p)
12452 {
12453         const struct ndr_interface_call *call;
12454         struct ndr_pull *pull;
12455         struct ndr_push *push;
12456         enum ndr_err_code ndr_err;
12457         struct clusapi_CreateResourceEnum *r;
12458
12459         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_CREATERESOURCEENUM];
12460
12461         r = talloc(talloc_tos(), struct clusapi_CreateResourceEnum);
12462         if (r == NULL) {
12463                 return false;
12464         }
12465
12466         pull = ndr_pull_init_blob(&p->in_data.data, r);
12467         if (pull == NULL) {
12468                 talloc_free(r);
12469                 return false;
12470         }
12471
12472         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12473         if (p->endian) {
12474                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12475         }
12476         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12477         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12478                 talloc_free(r);
12479                 return false;
12480         }
12481
12482         if (DEBUGLEVEL >= 10) {
12483                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResourceEnum, NDR_IN, r);
12484         }
12485
12486         ZERO_STRUCT(r->out);
12487         r->out.ppResultList = talloc_zero(r, struct RESOURCE_ENUM_LIST *);
12488         if (r->out.ppResultList == NULL) {
12489                 talloc_free(r);
12490                 return false;
12491         }
12492
12493         r->out.rpc_status = talloc_zero(r, WERROR);
12494         if (r->out.rpc_status == NULL) {
12495                 talloc_free(r);
12496                 return false;
12497         }
12498
12499         r->out.result = _clusapi_CreateResourceEnum(p, r);
12500
12501         if (p->fault_state) {
12502                 talloc_free(r);
12503                 /* Return true here, srv_pipe_hnd.c will take care */
12504                 return true;
12505         }
12506
12507         if (DEBUGLEVEL >= 10) {
12508                 NDR_PRINT_FUNCTION_DEBUG(clusapi_CreateResourceEnum, NDR_OUT | NDR_SET_VALUES, r);
12509         }
12510
12511         push = ndr_push_init_ctx(r);
12512         if (push == NULL) {
12513                 talloc_free(r);
12514                 return false;
12515         }
12516
12517         /*
12518          * carry over the pointer count to the reply in case we are
12519          * using full pointer. See NDR specification for full pointers
12520          */
12521         push->ptr_count = pull->ptr_count;
12522
12523         ndr_err = call->ndr_push(push, NDR_OUT, r);
12524         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12525                 talloc_free(r);
12526                 return false;
12527         }
12528
12529         p->out_data.rdata = ndr_push_blob(push);
12530         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12531
12532         talloc_free(r);
12533
12534         return true;
12535 }
12536
12537 static bool api_clusapi_ExecuteReadBatch(struct pipes_struct *p)
12538 {
12539         const struct ndr_interface_call *call;
12540         struct ndr_pull *pull;
12541         struct ndr_push *push;
12542         enum ndr_err_code ndr_err;
12543         struct clusapi_ExecuteReadBatch *r;
12544
12545         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_EXECUTEREADBATCH];
12546
12547         r = talloc(talloc_tos(), struct clusapi_ExecuteReadBatch);
12548         if (r == NULL) {
12549                 return false;
12550         }
12551
12552         pull = ndr_pull_init_blob(&p->in_data.data, r);
12553         if (pull == NULL) {
12554                 talloc_free(r);
12555                 return false;
12556         }
12557
12558         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12559         if (p->endian) {
12560                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12561         }
12562         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12563         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12564                 talloc_free(r);
12565                 return false;
12566         }
12567
12568         if (DEBUGLEVEL >= 10) {
12569                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ExecuteReadBatch, NDR_IN, r);
12570         }
12571
12572         ZERO_STRUCT(r->out);
12573         r->out.cbOutData = talloc_zero(r, uint32_t);
12574         if (r->out.cbOutData == NULL) {
12575                 talloc_free(r);
12576                 return false;
12577         }
12578
12579         r->out.lpOutData = talloc_zero(r, uint8_t *);
12580         if (r->out.lpOutData == NULL) {
12581                 talloc_free(r);
12582                 return false;
12583         }
12584
12585         r->out.rpc_status = talloc_zero(r, WERROR);
12586         if (r->out.rpc_status == NULL) {
12587                 talloc_free(r);
12588                 return false;
12589         }
12590
12591         r->out.result = _clusapi_ExecuteReadBatch(p, r);
12592
12593         if (p->fault_state) {
12594                 talloc_free(r);
12595                 /* Return true here, srv_pipe_hnd.c will take care */
12596                 return true;
12597         }
12598
12599         if (DEBUGLEVEL >= 10) {
12600                 NDR_PRINT_FUNCTION_DEBUG(clusapi_ExecuteReadBatch, NDR_OUT | NDR_SET_VALUES, r);
12601         }
12602
12603         push = ndr_push_init_ctx(r);
12604         if (push == NULL) {
12605                 talloc_free(r);
12606                 return false;
12607         }
12608
12609         /*
12610          * carry over the pointer count to the reply in case we are
12611          * using full pointer. See NDR specification for full pointers
12612          */
12613         push->ptr_count = pull->ptr_count;
12614
12615         ndr_err = call->ndr_push(push, NDR_OUT, r);
12616         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12617                 talloc_free(r);
12618                 return false;
12619         }
12620
12621         p->out_data.rdata = ndr_push_blob(push);
12622         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12623
12624         talloc_free(r);
12625
12626         return true;
12627 }
12628
12629 static bool api_clusapi_RestartResource(struct pipes_struct *p)
12630 {
12631         const struct ndr_interface_call *call;
12632         struct ndr_pull *pull;
12633         struct ndr_push *push;
12634         enum ndr_err_code ndr_err;
12635         struct clusapi_RestartResource *r;
12636
12637         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_RESTARTRESOURCE];
12638
12639         r = talloc(talloc_tos(), struct clusapi_RestartResource);
12640         if (r == NULL) {
12641                 return false;
12642         }
12643
12644         pull = ndr_pull_init_blob(&p->in_data.data, r);
12645         if (pull == NULL) {
12646                 talloc_free(r);
12647                 return false;
12648         }
12649
12650         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12651         if (p->endian) {
12652                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12653         }
12654         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12655         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12656                 talloc_free(r);
12657                 return false;
12658         }
12659
12660         if (DEBUGLEVEL >= 10) {
12661                 NDR_PRINT_FUNCTION_DEBUG(clusapi_RestartResource, NDR_IN, r);
12662         }
12663
12664         ZERO_STRUCT(r->out);
12665         r->out.rpc_status = talloc_zero(r, WERROR);
12666         if (r->out.rpc_status == NULL) {
12667                 talloc_free(r);
12668                 return false;
12669         }
12670
12671         r->out.result = _clusapi_RestartResource(p, r);
12672
12673         if (p->fault_state) {
12674                 talloc_free(r);
12675                 /* Return true here, srv_pipe_hnd.c will take care */
12676                 return true;
12677         }
12678
12679         if (DEBUGLEVEL >= 10) {
12680                 NDR_PRINT_FUNCTION_DEBUG(clusapi_RestartResource, NDR_OUT | NDR_SET_VALUES, r);
12681         }
12682
12683         push = ndr_push_init_ctx(r);
12684         if (push == NULL) {
12685                 talloc_free(r);
12686                 return false;
12687         }
12688
12689         /*
12690          * carry over the pointer count to the reply in case we are
12691          * using full pointer. See NDR specification for full pointers
12692          */
12693         push->ptr_count = pull->ptr_count;
12694
12695         ndr_err = call->ndr_push(push, NDR_OUT, r);
12696         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12697                 talloc_free(r);
12698                 return false;
12699         }
12700
12701         p->out_data.rdata = ndr_push_blob(push);
12702         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12703
12704         talloc_free(r);
12705
12706         return true;
12707 }
12708
12709 static bool api_clusapi_GetNotifyAsync(struct pipes_struct *p)
12710 {
12711         const struct ndr_interface_call *call;
12712         struct ndr_pull *pull;
12713         struct ndr_push *push;
12714         enum ndr_err_code ndr_err;
12715         struct clusapi_GetNotifyAsync *r;
12716
12717         call = &ndr_table_clusapi.calls[NDR_CLUSAPI_GETNOTIFYASYNC];
12718
12719         r = talloc(talloc_tos(), struct clusapi_GetNotifyAsync);
12720         if (r == NULL) {
12721                 return false;
12722         }
12723
12724         pull = ndr_pull_init_blob(&p->in_data.data, r);
12725         if (pull == NULL) {
12726                 talloc_free(r);
12727                 return false;
12728         }
12729
12730         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
12731         if (p->endian) {
12732                 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
12733         }
12734         ndr_err = call->ndr_pull(pull, NDR_IN, r);
12735         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12736                 talloc_free(r);
12737                 return false;
12738         }
12739
12740         if (DEBUGLEVEL >= 10) {
12741                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNotifyAsync, NDR_IN, r);
12742         }
12743
12744         ZERO_STRUCT(r->out);
12745         r->out.Notifications = talloc_zero(r, struct NOTIFICATION_DATA_ASYNC_RPC *);
12746         if (r->out.Notifications == NULL) {
12747                 talloc_free(r);
12748                 return false;
12749         }
12750
12751         r->out.dwNumNotifications = talloc_zero(r, uint32_t);
12752         if (r->out.dwNumNotifications == NULL) {
12753                 talloc_free(r);
12754                 return false;
12755         }
12756
12757         r->out.result = _clusapi_GetNotifyAsync(p, r);
12758
12759         if (p->fault_state) {
12760                 talloc_free(r);
12761                 /* Return true here, srv_pipe_hnd.c will take care */
12762                 return true;
12763         }
12764
12765         if (DEBUGLEVEL >= 10) {
12766                 NDR_PRINT_FUNCTION_DEBUG(clusapi_GetNotifyAsync, NDR_OUT | NDR_SET_VALUES, r);
12767         }
12768
12769         push = ndr_push_init_ctx(r);
12770         if (push == NULL) {
12771                 talloc_free(r);
12772                 return false;
12773         }
12774
12775         /*
12776          * carry over the pointer count to the reply in case we are
12777          * using full pointer. See NDR specification for full pointers
12778          */
12779         push->ptr_count = pull->ptr_count;
12780
12781         ndr_err = call->ndr_push(push, NDR_OUT, r);
12782         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
12783                 talloc_free(r);
12784                 return false;
12785         }
12786
12787         p->out_data.rdata = ndr_push_blob(push);
12788         talloc_steal(p->mem_ctx, p->out_data.rdata.data);
12789
12790         talloc_free(r);
12791
12792         return true;
12793 }
12794
12795
12796 /* Tables */
12797 static struct api_struct api_clusapi_cmds[] = 
12798 {
12799         {"CLUSAPI_OPENCLUSTER", NDR_CLUSAPI_OPENCLUSTER, api_clusapi_OpenCluster},
12800         {"CLUSAPI_CLOSECLUSTER", NDR_CLUSAPI_CLOSECLUSTER, api_clusapi_CloseCluster},
12801         {"CLUSAPI_SETCLUSTERNAME", NDR_CLUSAPI_SETCLUSTERNAME, api_clusapi_SetClusterName},
12802         {"CLUSAPI_GETCLUSTERNAME", NDR_CLUSAPI_GETCLUSTERNAME, api_clusapi_GetClusterName},
12803         {"CLUSAPI_GETCLUSTERVERSION", NDR_CLUSAPI_GETCLUSTERVERSION, api_clusapi_GetClusterVersion},
12804         {"CLUSAPI_GETQUORUMRESOURCE", NDR_CLUSAPI_GETQUORUMRESOURCE, api_clusapi_GetQuorumResource},
12805         {"CLUSAPI_SETQUORUMRESOURCE", NDR_CLUSAPI_SETQUORUMRESOURCE, api_clusapi_SetQuorumResource},
12806         {"CLUSAPI_CREATEENUM", NDR_CLUSAPI_CREATEENUM, api_clusapi_CreateEnum},
12807         {"CLUSAPI_OPENRESOURCE", NDR_CLUSAPI_OPENRESOURCE, api_clusapi_OpenResource},
12808         {"CLUSAPI_CREATERESOURCE", NDR_CLUSAPI_CREATERESOURCE, api_clusapi_CreateResource},
12809         {"CLUSAPI_DELETERESOURCE", NDR_CLUSAPI_DELETERESOURCE, api_clusapi_DeleteResource},
12810         {"CLUSAPI_CLOSERESOURCE", NDR_CLUSAPI_CLOSERESOURCE, api_clusapi_CloseResource},
12811         {"CLUSAPI_GETRESOURCESTATE", NDR_CLUSAPI_GETRESOURCESTATE, api_clusapi_GetResourceState},
12812         {"CLUSAPI_SETRESOURCENAME", NDR_CLUSAPI_SETRESOURCENAME, api_clusapi_SetResourceName},
12813         {"CLUSAPI_GETRESOURCEID", NDR_CLUSAPI_GETRESOURCEID, api_clusapi_GetResourceId},
12814         {"CLUSAPI_GETRESOURCETYPE", NDR_CLUSAPI_GETRESOURCETYPE, api_clusapi_GetResourceType},
12815         {"CLUSAPI_FAILRESOURCE", NDR_CLUSAPI_FAILRESOURCE, api_clusapi_FailResource},
12816         {"CLUSAPI_ONLINERESOURCE", NDR_CLUSAPI_ONLINERESOURCE, api_clusapi_OnlineResource},
12817         {"CLUSAPI_OFFLINERESOURCE", NDR_CLUSAPI_OFFLINERESOURCE, api_clusapi_OfflineResource},
12818         {"CLUSAPI_ADDRESOURCEDEPENDENCY", NDR_CLUSAPI_ADDRESOURCEDEPENDENCY, api_clusapi_AddResourceDependency},
12819         {"CLUSAPI_REMOVERESOURCEDEPENDENCY", NDR_CLUSAPI_REMOVERESOURCEDEPENDENCY, api_clusapi_RemoveResourceDependency},
12820         {"CLUSAPI_CANRESOURCEBEDEPENDENT", NDR_CLUSAPI_CANRESOURCEBEDEPENDENT, api_clusapi_CanResourceBeDependent},
12821         {"CLUSAPI_CREATERESENUM", NDR_CLUSAPI_CREATERESENUM, api_clusapi_CreateResEnum},
12822         {"CLUSAPI_ADDRESOURCENODE", NDR_CLUSAPI_ADDRESOURCENODE, api_clusapi_AddResourceNode},
12823         {"CLUSAPI_REMOVERESOURCENODE", NDR_CLUSAPI_REMOVERESOURCENODE, api_clusapi_RemoveResourceNode},
12824         {"CLUSAPI_CHANGERESOURCEGROUP", NDR_CLUSAPI_CHANGERESOURCEGROUP, api_clusapi_ChangeResourceGroup},
12825         {"CLUSAPI_CREATERESOURCETYPE", NDR_CLUSAPI_CREATERESOURCETYPE, api_clusapi_CreateResourceType},
12826         {"CLUSAPI_DELETERESOURCETYPE", NDR_CLUSAPI_DELETERESOURCETYPE, api_clusapi_DeleteResourceType},
12827         {"CLUSAPI_GETROOTKEY", NDR_CLUSAPI_GETROOTKEY, api_clusapi_GetRootKey},
12828         {"CLUSAPI_CREATEKEY", NDR_CLUSAPI_CREATEKEY, api_clusapi_CreateKey},
12829         {"CLUSAPI_OPENKEY", NDR_CLUSAPI_OPENKEY, api_clusapi_OpenKey},
12830         {"CLUSAPI_ENUMKEY", NDR_CLUSAPI_ENUMKEY, api_clusapi_EnumKey},
12831         {"CLUSAPI_SETVALUE", NDR_CLUSAPI_SETVALUE, api_clusapi_SetValue},
12832         {"CLUSAPI_DELETEVALUE", NDR_CLUSAPI_DELETEVALUE, api_clusapi_DeleteValue},
12833         {"CLUSAPI_QUERYVALUE", NDR_CLUSAPI_QUERYVALUE, api_clusapi_QueryValue},
12834         {"CLUSAPI_DELETEKEY", NDR_CLUSAPI_DELETEKEY, api_clusapi_DeleteKey},
12835         {"CLUSAPI_ENUMVALUE", NDR_CLUSAPI_ENUMVALUE, api_clusapi_EnumValue},
12836         {"CLUSAPI_CLOSEKEY", NDR_CLUSAPI_CLOSEKEY, api_clusapi_CloseKey},
12837         {"CLUSAPI_QUERYINFOKEY", NDR_CLUSAPI_QUERYINFOKEY, api_clusapi_QueryInfoKey},
12838         {"CLUSAPI_SETKEYSECURITY", NDR_CLUSAPI_SETKEYSECURITY, api_clusapi_SetKeySecurity},
12839         {"CLUSAPI_GETKEYSECURITY", NDR_CLUSAPI_GETKEYSECURITY, api_clusapi_GetKeySecurity},
12840         {"CLUSAPI_OPENGROUP", NDR_CLUSAPI_OPENGROUP, api_clusapi_OpenGroup},
12841         {"CLUSAPI_CREATEGROUP", NDR_CLUSAPI_CREATEGROUP, api_clusapi_CreateGroup},
12842         {"CLUSAPI_DELETEGROUP", NDR_CLUSAPI_DELETEGROUP, api_clusapi_DeleteGroup},
12843         {"CLUSAPI_CLOSEGROUP", NDR_CLUSAPI_CLOSEGROUP, api_clusapi_CloseGroup},
12844         {"CLUSAPI_GETGROUPSTATE", NDR_CLUSAPI_GETGROUPSTATE, api_clusapi_GetGroupState},
12845         {"CLUSAPI_SETGROUPNAME", NDR_CLUSAPI_SETGROUPNAME, api_clusapi_SetGroupName},
12846         {"CLUSAPI_GETGROUPID", NDR_CLUSAPI_GETGROUPID, api_clusapi_GetGroupId},
12847         {"CLUSAPI_GETNODEID", NDR_CLUSAPI_GETNODEID, api_clusapi_GetNodeId},
12848         {"CLUSAPI_ONLINEGROUP", NDR_CLUSAPI_ONLINEGROUP, api_clusapi_OnlineGroup},
12849         {"CLUSAPI_OFFLINEGROUP", NDR_CLUSAPI_OFFLINEGROUP, api_clusapi_OfflineGroup},
12850         {"CLUSAPI_MOVEGROUP", NDR_CLUSAPI_MOVEGROUP, api_clusapi_MoveGroup},
12851         {"CLUSAPI_MOVEGROUPTONODE", NDR_CLUSAPI_MOVEGROUPTONODE, api_clusapi_MoveGroupToNode},
12852         {"CLUSAPI_CREATEGROUPRESOURCEENUM", NDR_CLUSAPI_CREATEGROUPRESOURCEENUM, api_clusapi_CreateGroupResourceEnum},
12853         {"CLUSAPI_SETGROUPNODELIST", NDR_CLUSAPI_SETGROUPNODELIST, api_clusapi_SetGroupNodeList},
12854         {"CLUSAPI_CREATENOTIFY", NDR_CLUSAPI_CREATENOTIFY, api_clusapi_CreateNotify},
12855         {"CLUSAPI_CLOSENOTIFY", NDR_CLUSAPI_CLOSENOTIFY, api_clusapi_CloseNotify},
12856         {"CLUSAPI_ADDNOTIFYCLUSTER", NDR_CLUSAPI_ADDNOTIFYCLUSTER, api_clusapi_AddNotifyCluster},
12857         {"CLUSAPI_ADDNOTIFYNODE", NDR_CLUSAPI_ADDNOTIFYNODE, api_clusapi_AddNotifyNode},
12858         {"CLUSAPI_ADDNOTIFYGROUP", NDR_CLUSAPI_ADDNOTIFYGROUP, api_clusapi_AddNotifyGroup},
12859         {"CLUSAPI_ADDNOTIFYRESOURCE", NDR_CLUSAPI_ADDNOTIFYRESOURCE, api_clusapi_AddNotifyResource},
12860         {"CLUSAPI_ADDNOTIFYKEY", NDR_CLUSAPI_ADDNOTIFYKEY, api_clusapi_AddNotifyKey},
12861         {"CLUSAPI_READDNOTIFYNODE", NDR_CLUSAPI_READDNOTIFYNODE, api_clusapi_ReAddNotifyNode},
12862         {"CLUSAPI_READDNOTIFYGROUP", NDR_CLUSAPI_READDNOTIFYGROUP, api_clusapi_ReAddNotifyGroup},
12863         {"CLUSAPI_READDNOTIFYRESOURCE", NDR_CLUSAPI_READDNOTIFYRESOURCE, api_clusapi_ReAddNotifyResource},
12864         {"CLUSAPI_GETNOTIFY", NDR_CLUSAPI_GETNOTIFY, api_clusapi_GetNotify},
12865         {"CLUSAPI_OPENNODE", NDR_CLUSAPI_OPENNODE, api_clusapi_OpenNode},
12866         {"CLUSAPI_CLOSENODE", NDR_CLUSAPI_CLOSENODE, api_clusapi_CloseNode},
12867         {"CLUSAPI_GETNODESTATE", NDR_CLUSAPI_GETNODESTATE, api_clusapi_GetNodeState},
12868         {"CLUSAPI_PAUSENODE", NDR_CLUSAPI_PAUSENODE, api_clusapi_PauseNode},
12869         {"CLUSAPI_RESUMENODE", NDR_CLUSAPI_RESUMENODE, api_clusapi_ResumeNode},
12870         {"CLUSAPI_EVICTNODE", NDR_CLUSAPI_EVICTNODE, api_clusapi_EvictNode},
12871         {"CLUSAPI_NODERESOURCECONTROL", NDR_CLUSAPI_NODERESOURCECONTROL, api_clusapi_NodeResourceControl},
12872         {"CLUSAPI_RESOURCECONTROL", NDR_CLUSAPI_RESOURCECONTROL, api_clusapi_ResourceControl},
12873         {"CLUSAPI_NODERESOURCETYPECONTROL", NDR_CLUSAPI_NODERESOURCETYPECONTROL, api_clusapi_NodeResourceTypeControl},
12874         {"CLUSAPI_RESOURCETYPECONTROL", NDR_CLUSAPI_RESOURCETYPECONTROL, api_clusapi_ResourceTypeControl},
12875         {"CLUSAPI_NODEGROUPCONTROL", NDR_CLUSAPI_NODEGROUPCONTROL, api_clusapi_NodeGroupControl},
12876         {"CLUSAPI_GROUPCONTROL", NDR_CLUSAPI_GROUPCONTROL, api_clusapi_GroupControl},
12877         {"CLUSAPI_NODENODECONTROL", NDR_CLUSAPI_NODENODECONTROL, api_clusapi_NodeNodeControl},
12878         {"CLUSAPI_NODECONTROL", NDR_CLUSAPI_NODECONTROL, api_clusapi_NodeControl},
12879         {"OPNUM80NOTUSEDONWIRE", NDR_OPNUM80NOTUSEDONWIRE, api_Opnum80NotUsedOnWire},
12880         {"CLUSAPI_OPENNETWORK", NDR_CLUSAPI_OPENNETWORK, api_clusapi_OpenNetwork},
12881         {"CLUSAPI_CLOSENETWORK", NDR_CLUSAPI_CLOSENETWORK, api_clusapi_CloseNetwork},
12882         {"CLUSAPI_GETNETWORKSTATE", NDR_CLUSAPI_GETNETWORKSTATE, api_clusapi_GetNetworkState},
12883         {"CLUSAPI_SETNETWORKNAME", NDR_CLUSAPI_SETNETWORKNAME, api_clusapi_SetNetworkName},
12884         {"CLUSAPI_CREATENETWORKENUM", NDR_CLUSAPI_CREATENETWORKENUM, api_clusapi_CreateNetworkEnum},
12885         {"CLUSAPI_GETNETWORKID", NDR_CLUSAPI_GETNETWORKID, api_clusapi_GetNetworkId},
12886         {"CLUSAPI_SETNETWORKPRIORITYORDER", NDR_CLUSAPI_SETNETWORKPRIORITYORDER, api_clusapi_SetNetworkPriorityOrder},
12887         {"CLUSAPI_NODENETWORKCONTROL", NDR_CLUSAPI_NODENETWORKCONTROL, api_clusapi_NodeNetworkControl},
12888         {"CLUSAPI_NETWORKCONTROL", NDR_CLUSAPI_NETWORKCONTROL, api_clusapi_NetworkControl},
12889         {"CLUSAPI_ADDNOTIFYNETWORK", NDR_CLUSAPI_ADDNOTIFYNETWORK, api_clusapi_AddNotifyNetwork},
12890         {"CLUSAPI_READDNOTIFYNETWORK", NDR_CLUSAPI_READDNOTIFYNETWORK, api_clusapi_ReAddNotifyNetwork},
12891         {"CLUSAPI_OPENNETINTERFACE", NDR_CLUSAPI_OPENNETINTERFACE, api_clusapi_OpenNetInterface},
12892         {"CLUSAPI_CLOSENETINTERFACE", NDR_CLUSAPI_CLOSENETINTERFACE, api_clusapi_CloseNetInterface},
12893         {"CLUSAPI_GETNETINTERFACESTATE", NDR_CLUSAPI_GETNETINTERFACESTATE, api_clusapi_GetNetInterfaceState},
12894         {"CLUSAPI_GETNETINTERFACE", NDR_CLUSAPI_GETNETINTERFACE, api_clusapi_GetNetInterface},
12895         {"CLUSAPI_GETNETINTERFACEID", NDR_CLUSAPI_GETNETINTERFACEID, api_clusapi_GetNetInterfaceId},
12896         {"CLUSAPI_NODENETINTERFACECONTROL", NDR_CLUSAPI_NODENETINTERFACECONTROL, api_clusapi_NodeNetInterfaceControl},
12897         {"CLUSAPI_NETINTERFACECONTROL", NDR_CLUSAPI_NETINTERFACECONTROL, api_clusapi_NetInterfaceControl},
12898         {"CLUSAPI_ADDNOTIFYNETINTERFACE", NDR_CLUSAPI_ADDNOTIFYNETINTERFACE, api_clusapi_AddNotifyNetInterface},
12899         {"CLUSAPI_READDNOTIFYNETINTERFACE", NDR_CLUSAPI_READDNOTIFYNETINTERFACE, api_clusapi_ReAddNotifyNetInterface},
12900         {"CLUSAPI_CREATENODEENUM", NDR_CLUSAPI_CREATENODEENUM, api_clusapi_CreateNodeEnum},
12901         {"CLUSAPI_GETCLUSTERVERSION2", NDR_CLUSAPI_GETCLUSTERVERSION2, api_clusapi_GetClusterVersion2},
12902         {"CLUSAPI_CREATERESTYPEENUM", NDR_CLUSAPI_CREATERESTYPEENUM, api_clusapi_CreateResTypeEnum},
12903         {"CLUSAPI_BACKUPCLUSTERDATABASE", NDR_CLUSAPI_BACKUPCLUSTERDATABASE, api_clusapi_BackupClusterDatabase},
12904         {"CLUSAPI_NODECLUSTERCONTROL", NDR_CLUSAPI_NODECLUSTERCONTROL, api_clusapi_NodeClusterControl},
12905         {"CLUSAPI_CLUSTERCONTROL", NDR_CLUSAPI_CLUSTERCONTROL, api_clusapi_ClusterControl},
12906         {"CLUSAPI_UNBLOCKGETNOTIFYCALL", NDR_CLUSAPI_UNBLOCKGETNOTIFYCALL, api_clusapi_UnblockGetNotifyCall},
12907         {"CLUSAPI_SETSERVICEACCOUNTPASSWORD", NDR_CLUSAPI_SETSERVICEACCOUNTPASSWORD, api_clusapi_SetServiceAccountPassword},
12908         {"CLUSAPI_SETRESOURCEDEPENDENCYEXPRESSION", NDR_CLUSAPI_SETRESOURCEDEPENDENCYEXPRESSION, api_clusapi_SetResourceDependencyExpression},
12909         {"CLUSAPI_GETRESOURCEDEPENDENCYEXPRESSION", NDR_CLUSAPI_GETRESOURCEDEPENDENCYEXPRESSION, api_clusapi_GetResourceDependencyExpression},
12910         {"OPNUM111NOTUSEDONWIRE", NDR_OPNUM111NOTUSEDONWIRE, api_Opnum111NotUsedOnWire},
12911         {"CLUSAPI_GETRESOURCENETWORKNAME", NDR_CLUSAPI_GETRESOURCENETWORKNAME, api_clusapi_GetResourceNetworkName},
12912         {"CLUSAPI_EXECUTEBATCH", NDR_CLUSAPI_EXECUTEBATCH, api_clusapi_ExecuteBatch},
12913         {"CLUSAPI_CREATEBATCHPORT", NDR_CLUSAPI_CREATEBATCHPORT, api_clusapi_CreateBatchPort},
12914         {"CLUSAPI_GETBATCHNOTIFICATION", NDR_CLUSAPI_GETBATCHNOTIFICATION, api_clusapi_GetBatchNotification},
12915         {"CLUSAPI_CLOSEBATCHPORT", NDR_CLUSAPI_CLOSEBATCHPORT, api_clusapi_CloseBatchPort},
12916         {"CLUSAPI_OPENCLUSTEREX", NDR_CLUSAPI_OPENCLUSTEREX, api_clusapi_OpenClusterEx},
12917         {"CLUSAPI_OPENNODEEX", NDR_CLUSAPI_OPENNODEEX, api_clusapi_OpenNodeEx},
12918         {"CLUSAPI_OPENGROUPEX", NDR_CLUSAPI_OPENGROUPEX, api_clusapi_OpenGroupEx},
12919         {"CLUSAPI_OPENRESOURCEEX", NDR_CLUSAPI_OPENRESOURCEEX, api_clusapi_OpenResourceEx},
12920         {"CLUSAPI_OPENNETWORKEX", NDR_CLUSAPI_OPENNETWORKEX, api_clusapi_OpenNetworkEx},
12921         {"CLUSAPI_OPENNETINTERFACEEX", NDR_CLUSAPI_OPENNETINTERFACEEX, api_clusapi_OpenNetInterfaceEx},
12922         {"CLUSAPI_CHANGECSVSTATE", NDR_CLUSAPI_CHANGECSVSTATE, api_clusapi_ChangeCsvState},
12923         {"CLUSAPI_CREATENODEENUMEX", NDR_CLUSAPI_CREATENODEENUMEX, api_clusapi_CreateNodeEnumEx},
12924         {"CLUSAPI_CREATEENUMEX", NDR_CLUSAPI_CREATEENUMEX, api_clusapi_CreateEnumEx},
12925         {"CLUSAPI_PAUSENODEEX", NDR_CLUSAPI_PAUSENODEEX, api_clusapi_PauseNodeEx},
12926         {"CLUSAPI_PAUSENODEWITHDRAINTARGET", NDR_CLUSAPI_PAUSENODEWITHDRAINTARGET, api_clusapi_PauseNodeWithDrainTarget},
12927         {"CLUSAPI_RESUMENODEEX", NDR_CLUSAPI_RESUMENODEEX, api_clusapi_ResumeNodeEx},
12928         {"CLUSAPI_CREATEGROUPEX", NDR_CLUSAPI_CREATEGROUPEX, api_clusapi_CreateGroupEx},
12929         {"CLUSAPI_ONLINEGROUPEX", NDR_CLUSAPI_ONLINEGROUPEX, api_clusapi_OnlineGroupEx},
12930         {"CLUSAPI_OFFLINEGROUPEX", NDR_CLUSAPI_OFFLINEGROUPEX, api_clusapi_OfflineGroupEx},
12931         {"CLUSAPI_MOVEGROUPEX", NDR_CLUSAPI_MOVEGROUPEX, api_clusapi_MoveGroupEx},
12932         {"CLUSAPI_MOVEGROUPTONODEEX", NDR_CLUSAPI_MOVEGROUPTONODEEX, api_clusapi_MoveGroupToNodeEx},
12933         {"CLUSAPI_CANCELCLUSTERGROUPOPERATION", NDR_CLUSAPI_CANCELCLUSTERGROUPOPERATION, api_clusapi_CancelClusterGroupOperation},
12934         {"CLUSAPI_ONLINERESOURCEEX", NDR_CLUSAPI_ONLINERESOURCEEX, api_clusapi_OnlineResourceEx},
12935         {"CLUSAPI_OFFLINERESOURCEEX", NDR_CLUSAPI_OFFLINERESOURCEEX, api_clusapi_OfflineResourceEx},
12936         {"CLUSAPI_CREATENOTIFYV2", NDR_CLUSAPI_CREATENOTIFYV2, api_clusapi_CreateNotifyV2},
12937         {"CLUSAPI_ADDNOTIFYV2", NDR_CLUSAPI_ADDNOTIFYV2, api_clusapi_AddNotifyV2},
12938         {"CLUSAPI_GETNOTIFYV2", NDR_CLUSAPI_GETNOTIFYV2, api_clusapi_GetNotifyV2},
12939         {"CLUSAPI_QUERYALLVALUES", NDR_CLUSAPI_QUERYALLVALUES, api_clusapi_QueryAllValues},
12940         {"CLUSAPI_STMFINDDISK", NDR_CLUSAPI_STMFINDDISK, api_clusapi_StmFindDisk},
12941         {"CLUSAPI_CLUSTERMRR", NDR_CLUSAPI_CLUSTERMRR, api_clusapi_ClusterMrr},
12942         {"CLUSAPI_CREATEGROUPENUM", NDR_CLUSAPI_CREATEGROUPENUM, api_clusapi_CreateGroupEnum},
12943         {"CLUSAPI_CREATERESOURCEENUM", NDR_CLUSAPI_CREATERESOURCEENUM, api_clusapi_CreateResourceEnum},
12944         {"CLUSAPI_EXECUTEREADBATCH", NDR_CLUSAPI_EXECUTEREADBATCH, api_clusapi_ExecuteReadBatch},
12945         {"CLUSAPI_RESTARTRESOURCE", NDR_CLUSAPI_RESTARTRESOURCE, api_clusapi_RestartResource},
12946         {"CLUSAPI_GETNOTIFYASYNC", NDR_CLUSAPI_GETNOTIFYASYNC, api_clusapi_GetNotifyAsync},
12947 };
12948
12949 void clusapi_get_pipe_fns(struct api_struct **fns, int *n_fns)
12950 {
12951         *fns = api_clusapi_cmds;
12952         *n_fns = sizeof(api_clusapi_cmds) / sizeof(struct api_struct);
12953 }
12954
12955 NTSTATUS rpc_clusapi_init(const struct rpc_srv_callbacks *rpc_srv_cb)
12956 {
12957         return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "clusapi", "clusapi", &ndr_table_clusapi, api_clusapi_cmds, sizeof(api_clusapi_cmds) / sizeof(struct api_struct), rpc_srv_cb);
12958 }
12959
12960 NTSTATUS rpc_clusapi_shutdown(void)
12961 {
12962         return rpc_srv_unregister(&ndr_table_clusapi);
12963 }