2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
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
);
36 state
->out_mem_ctx
= NULL
;
37 state
->dispatch_recv
= cli
->dispatch_recv
;
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
;
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
,
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
);
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
);
78 if (state
->out_mem_ctx
) {
79 mem_ctx
= state
->out_mem_ctx
;
84 status
= state
->dispatch_recv(subreq
, mem_ctx
);
86 if (!NT_STATUS_IS_OK(status
)) {
87 tevent_req_nterror(req
, status
);
91 /* Copy out parameters */
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
,
110 struct rpccli_initshutdown_Init_state
*state
= tevent_req_data(
111 req
, struct rpccli_initshutdown_Init_state
);
114 if (tevent_req_is_nterror(req
, &status
)) {
115 tevent_req_received(req
);
119 /* Steal possbile out parameters to the callers context */
120 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
123 *result
= state
->orig
.out
.result
;
125 tevent_req_received(req
);
129 NTSTATUS
rpccli_initshutdown_Init(struct rpc_pipe_client
*cli
,
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] */,
138 struct initshutdown_Init r
;
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
,
154 &ndr_table_initshutdown
,
155 NDR_INITSHUTDOWN_INIT
,
158 if (!NT_STATUS_IS_OK(status
)) {
162 if (DEBUGLEVEL
>= 10) {
163 NDR_PRINT_OUT_DEBUG(initshutdown_Init
, &r
);
166 if (NT_STATUS_IS_ERR(status
)) {
170 /* Return variables */
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
);
203 state
->out_mem_ctx
= NULL
;
204 state
->dispatch_recv
= cli
->dispatch_recv
;
207 state
->orig
.in
.server
= _server
;
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
,
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
);
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
);
241 if (state
->out_mem_ctx
) {
242 mem_ctx
= state
->out_mem_ctx
;
247 status
= state
->dispatch_recv(subreq
, mem_ctx
);
249 if (!NT_STATUS_IS_OK(status
)) {
250 tevent_req_nterror(req
, status
);
254 /* Copy out parameters */
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
,
273 struct rpccli_initshutdown_Abort_state
*state
= tevent_req_data(
274 req
, struct rpccli_initshutdown_Abort_state
);
277 if (tevent_req_is_nterror(req
, &status
)) {
278 tevent_req_received(req
);
282 /* Steal possbile out parameters to the callers context */
283 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
286 *result
= state
->orig
.out
.result
;
288 tevent_req_received(req
);
292 NTSTATUS
rpccli_initshutdown_Abort(struct rpc_pipe_client
*cli
,
294 uint16_t *server
/* [in] [unique] */,
297 struct initshutdown_Abort r
;
301 r
.in
.server
= server
;
303 if (DEBUGLEVEL
>= 10) {
304 NDR_PRINT_IN_DEBUG(initshutdown_Abort
, &r
);
307 status
= cli
->dispatch(cli
,
309 &ndr_table_initshutdown
,
310 NDR_INITSHUTDOWN_ABORT
,
313 if (!NT_STATUS_IS_OK(status
)) {
317 if (DEBUGLEVEL
>= 10) {
318 NDR_PRINT_OUT_DEBUG(initshutdown_Abort
, &r
);
321 if (NT_STATUS_IS_ERR(status
)) {
325 /* Return variables */
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
);
363 state
->out_mem_ctx
= NULL
;
364 state
->dispatch_recv
= cli
->dispatch_recv
;
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
;
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
,
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
);
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
);
406 if (state
->out_mem_ctx
) {
407 mem_ctx
= state
->out_mem_ctx
;
412 status
= state
->dispatch_recv(subreq
, mem_ctx
);
414 if (!NT_STATUS_IS_OK(status
)) {
415 tevent_req_nterror(req
, status
);
419 /* Copy out parameters */
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
,
438 struct rpccli_initshutdown_InitEx_state
*state
= tevent_req_data(
439 req
, struct rpccli_initshutdown_InitEx_state
);
442 if (tevent_req_is_nterror(req
, &status
)) {
443 tevent_req_received(req
);
447 /* Steal possbile out parameters to the callers context */
448 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
451 *result
= state
->orig
.out
.result
;
453 tevent_req_received(req
);
457 NTSTATUS
rpccli_initshutdown_InitEx(struct rpc_pipe_client
*cli
,
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] */,
467 struct initshutdown_InitEx r
;
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
,
484 &ndr_table_initshutdown
,
485 NDR_INITSHUTDOWN_INITEX
,
488 if (!NT_STATUS_IS_OK(status
)) {
492 if (DEBUGLEVEL
>= 10) {
493 NDR_PRINT_OUT_DEBUG(initshutdown_InitEx
, &r
);
496 if (NT_STATUS_IS_ERR(status
)) {
500 /* Return variables */
504 *werror
= r
.out
.result
;
507 return werror_to_ntstatus(r
.out
.result
);