RIP BOOL. Convert BOOL -> bool. I found a few interesting
[kai/samba.git] / source / librpc / gen_ndr / srv_initshutdown.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_initshutdown.h"
8
9 static bool api_initshutdown_Init(pipes_struct *p)
10 {
11         const struct ndr_interface_call *call;
12         struct ndr_pull *pull;
13         struct ndr_push *push;
14         NTSTATUS status;
15         DATA_BLOB blob;
16         struct initshutdown_Init *r;
17         
18         call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT];
19         
20         r = talloc(NULL, struct initshutdown_Init);
21         if (r == NULL) {
22                 return False;
23         }
24         
25         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26                 talloc_free(r);
27                 return False;
28         }
29         
30         pull = ndr_pull_init_blob(&blob, r);
31         if (pull == NULL) {
32                 talloc_free(r);
33                 return False;
34         }
35         
36         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37         status = call->ndr_pull(pull, NDR_IN, r);
38         if (NT_STATUS_IS_ERR(status)) {
39                 talloc_free(r);
40                 return False;
41         }
42         
43         if (DEBUGLEVEL >= 10)
44                 NDR_PRINT_IN_DEBUG(initshutdown_Init, r);
45         
46         r->out.result = _initshutdown_Init(p, r);
47         
48         if (p->rng_fault_state) {
49                 talloc_free(r);
50                 /* Return True here, srv_pipe_hnd.c will take care */
51                 return True;
52         }
53         
54         if (DEBUGLEVEL >= 10)
55                 NDR_PRINT_OUT_DEBUG(initshutdown_Init, r);
56         
57         push = ndr_push_init_ctx(r);
58         if (push == NULL) {
59                 talloc_free(r);
60                 return False;
61         }
62         
63         status = call->ndr_push(push, NDR_OUT, r);
64         if (NT_STATUS_IS_ERR(status)) {
65                 talloc_free(r);
66                 return False;
67         }
68         
69         blob = ndr_push_blob(push);
70         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
71                 talloc_free(r);
72                 return False;
73         }
74         
75         talloc_free(r);
76         
77         return True;
78 }
79
80 static bool api_initshutdown_Abort(pipes_struct *p)
81 {
82         const struct ndr_interface_call *call;
83         struct ndr_pull *pull;
84         struct ndr_push *push;
85         NTSTATUS status;
86         DATA_BLOB blob;
87         struct initshutdown_Abort *r;
88         
89         call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT];
90         
91         r = talloc(NULL, struct initshutdown_Abort);
92         if (r == NULL) {
93                 return False;
94         }
95         
96         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
97                 talloc_free(r);
98                 return False;
99         }
100         
101         pull = ndr_pull_init_blob(&blob, r);
102         if (pull == NULL) {
103                 talloc_free(r);
104                 return False;
105         }
106         
107         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
108         status = call->ndr_pull(pull, NDR_IN, r);
109         if (NT_STATUS_IS_ERR(status)) {
110                 talloc_free(r);
111                 return False;
112         }
113         
114         if (DEBUGLEVEL >= 10)
115                 NDR_PRINT_IN_DEBUG(initshutdown_Abort, r);
116         
117         r->out.result = _initshutdown_Abort(p, r);
118         
119         if (p->rng_fault_state) {
120                 talloc_free(r);
121                 /* Return True here, srv_pipe_hnd.c will take care */
122                 return True;
123         }
124         
125         if (DEBUGLEVEL >= 10)
126                 NDR_PRINT_OUT_DEBUG(initshutdown_Abort, r);
127         
128         push = ndr_push_init_ctx(r);
129         if (push == NULL) {
130                 talloc_free(r);
131                 return False;
132         }
133         
134         status = call->ndr_push(push, NDR_OUT, r);
135         if (NT_STATUS_IS_ERR(status)) {
136                 talloc_free(r);
137                 return False;
138         }
139         
140         blob = ndr_push_blob(push);
141         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
142                 talloc_free(r);
143                 return False;
144         }
145         
146         talloc_free(r);
147         
148         return True;
149 }
150
151 static bool api_initshutdown_InitEx(pipes_struct *p)
152 {
153         const struct ndr_interface_call *call;
154         struct ndr_pull *pull;
155         struct ndr_push *push;
156         NTSTATUS status;
157         DATA_BLOB blob;
158         struct initshutdown_InitEx *r;
159         
160         call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX];
161         
162         r = talloc(NULL, struct initshutdown_InitEx);
163         if (r == NULL) {
164                 return False;
165         }
166         
167         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
168                 talloc_free(r);
169                 return False;
170         }
171         
172         pull = ndr_pull_init_blob(&blob, r);
173         if (pull == NULL) {
174                 talloc_free(r);
175                 return False;
176         }
177         
178         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
179         status = call->ndr_pull(pull, NDR_IN, r);
180         if (NT_STATUS_IS_ERR(status)) {
181                 talloc_free(r);
182                 return False;
183         }
184         
185         if (DEBUGLEVEL >= 10)
186                 NDR_PRINT_IN_DEBUG(initshutdown_InitEx, r);
187         
188         r->out.result = _initshutdown_InitEx(p, r);
189         
190         if (p->rng_fault_state) {
191                 talloc_free(r);
192                 /* Return True here, srv_pipe_hnd.c will take care */
193                 return True;
194         }
195         
196         if (DEBUGLEVEL >= 10)
197                 NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, r);
198         
199         push = ndr_push_init_ctx(r);
200         if (push == NULL) {
201                 talloc_free(r);
202                 return False;
203         }
204         
205         status = call->ndr_push(push, NDR_OUT, r);
206         if (NT_STATUS_IS_ERR(status)) {
207                 talloc_free(r);
208                 return False;
209         }
210         
211         blob = ndr_push_blob(push);
212         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
213                 talloc_free(r);
214                 return False;
215         }
216         
217         talloc_free(r);
218         
219         return True;
220 }
221
222
223 /* Tables */
224 static struct api_struct api_initshutdown_cmds[] = 
225 {
226         {"INITSHUTDOWN_INIT", NDR_INITSHUTDOWN_INIT, api_initshutdown_Init},
227         {"INITSHUTDOWN_ABORT", NDR_INITSHUTDOWN_ABORT, api_initshutdown_Abort},
228         {"INITSHUTDOWN_INITEX", NDR_INITSHUTDOWN_INITEX, api_initshutdown_InitEx},
229 };
230
231 void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns)
232 {
233         *fns = api_initshutdown_cmds;
234         *n_fns = sizeof(api_initshutdown_cmds) / sizeof(struct api_struct);
235 }
236
237 NTSTATUS rpc_initshutdown_init(void)
238 {
239         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct));
240 }