util_strlist: Add some more "const"s - small correction
[Samba/ekacnet.git] / librpc / gen_ndr / cli_initshutdown.c
blobb3ed6bb1f385eacc73b54498e870e6270bab3ef1
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_initshutdown.h"
9 struct rpccli_initshutdown_Init_state {
10 struct initshutdown_Init orig;
11 struct initshutdown_Init tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_initshutdown_Init_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_initshutdown_Init_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint16_t *_hostname /* [in] [unique] */,
22 struct lsa_StringLarge *_message /* [in] [unique] */,
23 uint32_t _timeout /* [in] */,
24 uint8_t _force_apps /* [in] */,
25 uint8_t _do_reboot /* [in] */)
27 struct tevent_req *req;
28 struct rpccli_initshutdown_Init_state *state;
29 struct tevent_req *subreq;
31 req = tevent_req_create(mem_ctx, &state,
32 struct rpccli_initshutdown_Init_state);
33 if (req == NULL) {
34 return NULL;
36 state->out_mem_ctx = NULL;
37 state->dispatch_recv = cli->dispatch_recv;
39 /* In parameters */
40 state->orig.in.hostname = _hostname;
41 state->orig.in.message = _message;
42 state->orig.in.timeout = _timeout;
43 state->orig.in.force_apps = _force_apps;
44 state->orig.in.do_reboot = _do_reboot;
46 /* Out parameters */
48 /* Result */
49 ZERO_STRUCT(state->orig.out.result);
51 if (DEBUGLEVEL >= 10) {
52 NDR_PRINT_IN_DEBUG(initshutdown_Init, &state->orig);
55 /* make a temporary copy, that we pass to the dispatch function */
56 state->tmp = state->orig;
58 subreq = cli->dispatch_send(state, ev, cli,
59 &ndr_table_initshutdown,
60 NDR_INITSHUTDOWN_INIT,
61 &state->tmp);
62 if (tevent_req_nomem(subreq, req)) {
63 return tevent_req_post(req, ev);
65 tevent_req_set_callback(subreq, rpccli_initshutdown_Init_done, req);
66 return req;
69 static void rpccli_initshutdown_Init_done(struct tevent_req *subreq)
71 struct tevent_req *req = tevent_req_callback_data(
72 subreq, struct tevent_req);
73 struct rpccli_initshutdown_Init_state *state = tevent_req_data(
74 req, struct rpccli_initshutdown_Init_state);
75 NTSTATUS status;
76 TALLOC_CTX *mem_ctx;
78 if (state->out_mem_ctx) {
79 mem_ctx = state->out_mem_ctx;
80 } else {
81 mem_ctx = state;
84 status = state->dispatch_recv(subreq, mem_ctx);
85 TALLOC_FREE(subreq);
86 if (!NT_STATUS_IS_OK(status)) {
87 tevent_req_nterror(req, status);
88 return;
91 /* Copy out parameters */
93 /* Copy result */
94 state->orig.out.result = state->tmp.out.result;
96 /* Reset temporary structure */
97 ZERO_STRUCT(state->tmp);
99 if (DEBUGLEVEL >= 10) {
100 NDR_PRINT_OUT_DEBUG(initshutdown_Init, &state->orig);
103 tevent_req_done(req);
106 NTSTATUS rpccli_initshutdown_Init_recv(struct tevent_req *req,
107 TALLOC_CTX *mem_ctx,
108 WERROR *result)
110 struct rpccli_initshutdown_Init_state *state = tevent_req_data(
111 req, struct rpccli_initshutdown_Init_state);
112 NTSTATUS status;
114 if (tevent_req_is_nterror(req, &status)) {
115 tevent_req_received(req);
116 return status;
119 /* Steal possbile out parameters to the callers context */
120 talloc_steal(mem_ctx, state->out_mem_ctx);
122 /* Return result */
123 *result = state->orig.out.result;
125 tevent_req_received(req);
126 return NT_STATUS_OK;
129 NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
130 TALLOC_CTX *mem_ctx,
131 uint16_t *hostname /* [in] [unique] */,
132 struct lsa_StringLarge *message /* [in] [unique] */,
133 uint32_t timeout /* [in] */,
134 uint8_t force_apps /* [in] */,
135 uint8_t do_reboot /* [in] */,
136 WERROR *werror)
138 struct initshutdown_Init r;
139 NTSTATUS status;
141 /* In parameters */
142 r.in.hostname = hostname;
143 r.in.message = message;
144 r.in.timeout = timeout;
145 r.in.force_apps = force_apps;
146 r.in.do_reboot = do_reboot;
148 if (DEBUGLEVEL >= 10) {
149 NDR_PRINT_IN_DEBUG(initshutdown_Init, &r);
152 status = cli->dispatch(cli,
153 mem_ctx,
154 &ndr_table_initshutdown,
155 NDR_INITSHUTDOWN_INIT,
156 &r);
158 if (!NT_STATUS_IS_OK(status)) {
159 return status;
162 if (DEBUGLEVEL >= 10) {
163 NDR_PRINT_OUT_DEBUG(initshutdown_Init, &r);
166 if (NT_STATUS_IS_ERR(status)) {
167 return status;
170 /* Return variables */
172 /* Return result */
173 if (werror) {
174 *werror = r.out.result;
177 return werror_to_ntstatus(r.out.result);
180 struct rpccli_initshutdown_Abort_state {
181 struct initshutdown_Abort orig;
182 struct initshutdown_Abort tmp;
183 TALLOC_CTX *out_mem_ctx;
184 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
187 static void rpccli_initshutdown_Abort_done(struct tevent_req *subreq);
189 struct tevent_req *rpccli_initshutdown_Abort_send(TALLOC_CTX *mem_ctx,
190 struct tevent_context *ev,
191 struct rpc_pipe_client *cli,
192 uint16_t *_server /* [in] [unique] */)
194 struct tevent_req *req;
195 struct rpccli_initshutdown_Abort_state *state;
196 struct tevent_req *subreq;
198 req = tevent_req_create(mem_ctx, &state,
199 struct rpccli_initshutdown_Abort_state);
200 if (req == NULL) {
201 return NULL;
203 state->out_mem_ctx = NULL;
204 state->dispatch_recv = cli->dispatch_recv;
206 /* In parameters */
207 state->orig.in.server = _server;
209 /* Out parameters */
211 /* Result */
212 ZERO_STRUCT(state->orig.out.result);
214 if (DEBUGLEVEL >= 10) {
215 NDR_PRINT_IN_DEBUG(initshutdown_Abort, &state->orig);
218 /* make a temporary copy, that we pass to the dispatch function */
219 state->tmp = state->orig;
221 subreq = cli->dispatch_send(state, ev, cli,
222 &ndr_table_initshutdown,
223 NDR_INITSHUTDOWN_ABORT,
224 &state->tmp);
225 if (tevent_req_nomem(subreq, req)) {
226 return tevent_req_post(req, ev);
228 tevent_req_set_callback(subreq, rpccli_initshutdown_Abort_done, req);
229 return req;
232 static void rpccli_initshutdown_Abort_done(struct tevent_req *subreq)
234 struct tevent_req *req = tevent_req_callback_data(
235 subreq, struct tevent_req);
236 struct rpccli_initshutdown_Abort_state *state = tevent_req_data(
237 req, struct rpccli_initshutdown_Abort_state);
238 NTSTATUS status;
239 TALLOC_CTX *mem_ctx;
241 if (state->out_mem_ctx) {
242 mem_ctx = state->out_mem_ctx;
243 } else {
244 mem_ctx = state;
247 status = state->dispatch_recv(subreq, mem_ctx);
248 TALLOC_FREE(subreq);
249 if (!NT_STATUS_IS_OK(status)) {
250 tevent_req_nterror(req, status);
251 return;
254 /* Copy out parameters */
256 /* Copy result */
257 state->orig.out.result = state->tmp.out.result;
259 /* Reset temporary structure */
260 ZERO_STRUCT(state->tmp);
262 if (DEBUGLEVEL >= 10) {
263 NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &state->orig);
266 tevent_req_done(req);
269 NTSTATUS rpccli_initshutdown_Abort_recv(struct tevent_req *req,
270 TALLOC_CTX *mem_ctx,
271 WERROR *result)
273 struct rpccli_initshutdown_Abort_state *state = tevent_req_data(
274 req, struct rpccli_initshutdown_Abort_state);
275 NTSTATUS status;
277 if (tevent_req_is_nterror(req, &status)) {
278 tevent_req_received(req);
279 return status;
282 /* Steal possbile out parameters to the callers context */
283 talloc_steal(mem_ctx, state->out_mem_ctx);
285 /* Return result */
286 *result = state->orig.out.result;
288 tevent_req_received(req);
289 return NT_STATUS_OK;
292 NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli,
293 TALLOC_CTX *mem_ctx,
294 uint16_t *server /* [in] [unique] */,
295 WERROR *werror)
297 struct initshutdown_Abort r;
298 NTSTATUS status;
300 /* In parameters */
301 r.in.server = server;
303 if (DEBUGLEVEL >= 10) {
304 NDR_PRINT_IN_DEBUG(initshutdown_Abort, &r);
307 status = cli->dispatch(cli,
308 mem_ctx,
309 &ndr_table_initshutdown,
310 NDR_INITSHUTDOWN_ABORT,
311 &r);
313 if (!NT_STATUS_IS_OK(status)) {
314 return status;
317 if (DEBUGLEVEL >= 10) {
318 NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &r);
321 if (NT_STATUS_IS_ERR(status)) {
322 return status;
325 /* Return variables */
327 /* Return result */
328 if (werror) {
329 *werror = r.out.result;
332 return werror_to_ntstatus(r.out.result);
335 struct rpccli_initshutdown_InitEx_state {
336 struct initshutdown_InitEx orig;
337 struct initshutdown_InitEx tmp;
338 TALLOC_CTX *out_mem_ctx;
339 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
342 static void rpccli_initshutdown_InitEx_done(struct tevent_req *subreq);
344 struct tevent_req *rpccli_initshutdown_InitEx_send(TALLOC_CTX *mem_ctx,
345 struct tevent_context *ev,
346 struct rpc_pipe_client *cli,
347 uint16_t *_hostname /* [in] [unique] */,
348 struct lsa_StringLarge *_message /* [in] [unique] */,
349 uint32_t _timeout /* [in] */,
350 uint8_t _force_apps /* [in] */,
351 uint8_t _do_reboot /* [in] */,
352 uint32_t _reason /* [in] */)
354 struct tevent_req *req;
355 struct rpccli_initshutdown_InitEx_state *state;
356 struct tevent_req *subreq;
358 req = tevent_req_create(mem_ctx, &state,
359 struct rpccli_initshutdown_InitEx_state);
360 if (req == NULL) {
361 return NULL;
363 state->out_mem_ctx = NULL;
364 state->dispatch_recv = cli->dispatch_recv;
366 /* In parameters */
367 state->orig.in.hostname = _hostname;
368 state->orig.in.message = _message;
369 state->orig.in.timeout = _timeout;
370 state->orig.in.force_apps = _force_apps;
371 state->orig.in.do_reboot = _do_reboot;
372 state->orig.in.reason = _reason;
374 /* Out parameters */
376 /* Result */
377 ZERO_STRUCT(state->orig.out.result);
379 if (DEBUGLEVEL >= 10) {
380 NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &state->orig);
383 /* make a temporary copy, that we pass to the dispatch function */
384 state->tmp = state->orig;
386 subreq = cli->dispatch_send(state, ev, cli,
387 &ndr_table_initshutdown,
388 NDR_INITSHUTDOWN_INITEX,
389 &state->tmp);
390 if (tevent_req_nomem(subreq, req)) {
391 return tevent_req_post(req, ev);
393 tevent_req_set_callback(subreq, rpccli_initshutdown_InitEx_done, req);
394 return req;
397 static void rpccli_initshutdown_InitEx_done(struct tevent_req *subreq)
399 struct tevent_req *req = tevent_req_callback_data(
400 subreq, struct tevent_req);
401 struct rpccli_initshutdown_InitEx_state *state = tevent_req_data(
402 req, struct rpccli_initshutdown_InitEx_state);
403 NTSTATUS status;
404 TALLOC_CTX *mem_ctx;
406 if (state->out_mem_ctx) {
407 mem_ctx = state->out_mem_ctx;
408 } else {
409 mem_ctx = state;
412 status = state->dispatch_recv(subreq, mem_ctx);
413 TALLOC_FREE(subreq);
414 if (!NT_STATUS_IS_OK(status)) {
415 tevent_req_nterror(req, status);
416 return;
419 /* Copy out parameters */
421 /* Copy result */
422 state->orig.out.result = state->tmp.out.result;
424 /* Reset temporary structure */
425 ZERO_STRUCT(state->tmp);
427 if (DEBUGLEVEL >= 10) {
428 NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &state->orig);
431 tevent_req_done(req);
434 NTSTATUS rpccli_initshutdown_InitEx_recv(struct tevent_req *req,
435 TALLOC_CTX *mem_ctx,
436 WERROR *result)
438 struct rpccli_initshutdown_InitEx_state *state = tevent_req_data(
439 req, struct rpccli_initshutdown_InitEx_state);
440 NTSTATUS status;
442 if (tevent_req_is_nterror(req, &status)) {
443 tevent_req_received(req);
444 return status;
447 /* Steal possbile out parameters to the callers context */
448 talloc_steal(mem_ctx, state->out_mem_ctx);
450 /* Return result */
451 *result = state->orig.out.result;
453 tevent_req_received(req);
454 return NT_STATUS_OK;
457 NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli,
458 TALLOC_CTX *mem_ctx,
459 uint16_t *hostname /* [in] [unique] */,
460 struct lsa_StringLarge *message /* [in] [unique] */,
461 uint32_t timeout /* [in] */,
462 uint8_t force_apps /* [in] */,
463 uint8_t do_reboot /* [in] */,
464 uint32_t reason /* [in] */,
465 WERROR *werror)
467 struct initshutdown_InitEx r;
468 NTSTATUS status;
470 /* In parameters */
471 r.in.hostname = hostname;
472 r.in.message = message;
473 r.in.timeout = timeout;
474 r.in.force_apps = force_apps;
475 r.in.do_reboot = do_reboot;
476 r.in.reason = reason;
478 if (DEBUGLEVEL >= 10) {
479 NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &r);
482 status = cli->dispatch(cli,
483 mem_ctx,
484 &ndr_table_initshutdown,
485 NDR_INITSHUTDOWN_INITEX,
486 &r);
488 if (!NT_STATUS_IS_OK(status)) {
489 return status;
492 if (DEBUGLEVEL >= 10) {
493 NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &r);
496 if (NT_STATUS_IS_ERR(status)) {
497 return status;
500 /* Return variables */
502 /* Return result */
503 if (werror) {
504 *werror = r.out.result;
507 return werror_to_ntstatus(r.out.result);