1 | /*
|
---|
2 | * Unix SMB/CIFS implementation.
|
---|
3 | * client auto-generated by pidl. DO NOT MODIFY!
|
---|
4 | */
|
---|
5 |
|
---|
6 | #include "includes.h"
|
---|
7 | #include "../librpc/gen_ndr/cli_initshutdown.h"
|
---|
8 |
|
---|
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);
|
---|
14 | };
|
---|
15 |
|
---|
16 | static void rpccli_initshutdown_Init_done(struct tevent_req *subreq);
|
---|
17 |
|
---|
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] */)
|
---|
26 | {
|
---|
27 | struct tevent_req *req;
|
---|
28 | struct rpccli_initshutdown_Init_state *state;
|
---|
29 | struct tevent_req *subreq;
|
---|
30 |
|
---|
31 | req = tevent_req_create(mem_ctx, &state,
|
---|
32 | struct rpccli_initshutdown_Init_state);
|
---|
33 | if (req == NULL) {
|
---|
34 | return NULL;
|
---|
35 | }
|
---|
36 | state->out_mem_ctx = NULL;
|
---|
37 | state->dispatch_recv = cli->dispatch_recv;
|
---|
38 |
|
---|
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;
|
---|
45 |
|
---|
46 | /* Out parameters */
|
---|
47 |
|
---|
48 | /* Result */
|
---|
49 | ZERO_STRUCT(state->orig.out.result);
|
---|
50 |
|
---|
51 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
52 | state->tmp = state->orig;
|
---|
53 |
|
---|
54 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
55 | &ndr_table_initshutdown,
|
---|
56 | NDR_INITSHUTDOWN_INIT,
|
---|
57 | &state->tmp);
|
---|
58 | if (tevent_req_nomem(subreq, req)) {
|
---|
59 | return tevent_req_post(req, ev);
|
---|
60 | }
|
---|
61 | tevent_req_set_callback(subreq, rpccli_initshutdown_Init_done, req);
|
---|
62 | return req;
|
---|
63 | }
|
---|
64 |
|
---|
65 | static void rpccli_initshutdown_Init_done(struct tevent_req *subreq)
|
---|
66 | {
|
---|
67 | struct tevent_req *req = tevent_req_callback_data(
|
---|
68 | subreq, struct tevent_req);
|
---|
69 | struct rpccli_initshutdown_Init_state *state = tevent_req_data(
|
---|
70 | req, struct rpccli_initshutdown_Init_state);
|
---|
71 | NTSTATUS status;
|
---|
72 | TALLOC_CTX *mem_ctx;
|
---|
73 |
|
---|
74 | if (state->out_mem_ctx) {
|
---|
75 | mem_ctx = state->out_mem_ctx;
|
---|
76 | } else {
|
---|
77 | mem_ctx = state;
|
---|
78 | }
|
---|
79 |
|
---|
80 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
81 | TALLOC_FREE(subreq);
|
---|
82 | if (!NT_STATUS_IS_OK(status)) {
|
---|
83 | tevent_req_nterror(req, status);
|
---|
84 | return;
|
---|
85 | }
|
---|
86 |
|
---|
87 | /* Copy out parameters */
|
---|
88 |
|
---|
89 | /* Copy result */
|
---|
90 | state->orig.out.result = state->tmp.out.result;
|
---|
91 |
|
---|
92 | /* Reset temporary structure */
|
---|
93 | ZERO_STRUCT(state->tmp);
|
---|
94 |
|
---|
95 | tevent_req_done(req);
|
---|
96 | }
|
---|
97 |
|
---|
98 | NTSTATUS rpccli_initshutdown_Init_recv(struct tevent_req *req,
|
---|
99 | TALLOC_CTX *mem_ctx,
|
---|
100 | WERROR *result)
|
---|
101 | {
|
---|
102 | struct rpccli_initshutdown_Init_state *state = tevent_req_data(
|
---|
103 | req, struct rpccli_initshutdown_Init_state);
|
---|
104 | NTSTATUS status;
|
---|
105 |
|
---|
106 | if (tevent_req_is_nterror(req, &status)) {
|
---|
107 | tevent_req_received(req);
|
---|
108 | return status;
|
---|
109 | }
|
---|
110 |
|
---|
111 | /* Steal possbile out parameters to the callers context */
|
---|
112 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
113 |
|
---|
114 | /* Return result */
|
---|
115 | *result = state->orig.out.result;
|
---|
116 |
|
---|
117 | tevent_req_received(req);
|
---|
118 | return NT_STATUS_OK;
|
---|
119 | }
|
---|
120 |
|
---|
121 | NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
|
---|
122 | TALLOC_CTX *mem_ctx,
|
---|
123 | uint16_t *hostname /* [in] [unique] */,
|
---|
124 | struct lsa_StringLarge *message /* [in] [unique] */,
|
---|
125 | uint32_t timeout /* [in] */,
|
---|
126 | uint8_t force_apps /* [in] */,
|
---|
127 | uint8_t do_reboot /* [in] */,
|
---|
128 | WERROR *werror)
|
---|
129 | {
|
---|
130 | struct initshutdown_Init r;
|
---|
131 | NTSTATUS status;
|
---|
132 |
|
---|
133 | /* In parameters */
|
---|
134 | r.in.hostname = hostname;
|
---|
135 | r.in.message = message;
|
---|
136 | r.in.timeout = timeout;
|
---|
137 | r.in.force_apps = force_apps;
|
---|
138 | r.in.do_reboot = do_reboot;
|
---|
139 |
|
---|
140 | status = cli->dispatch(cli,
|
---|
141 | mem_ctx,
|
---|
142 | &ndr_table_initshutdown,
|
---|
143 | NDR_INITSHUTDOWN_INIT,
|
---|
144 | &r);
|
---|
145 |
|
---|
146 | if (!NT_STATUS_IS_OK(status)) {
|
---|
147 | return status;
|
---|
148 | }
|
---|
149 |
|
---|
150 | if (NT_STATUS_IS_ERR(status)) {
|
---|
151 | return status;
|
---|
152 | }
|
---|
153 |
|
---|
154 | /* Return variables */
|
---|
155 |
|
---|
156 | /* Return result */
|
---|
157 | if (werror) {
|
---|
158 | *werror = r.out.result;
|
---|
159 | }
|
---|
160 |
|
---|
161 | return werror_to_ntstatus(r.out.result);
|
---|
162 | }
|
---|
163 |
|
---|
164 | struct rpccli_initshutdown_Abort_state {
|
---|
165 | struct initshutdown_Abort orig;
|
---|
166 | struct initshutdown_Abort tmp;
|
---|
167 | TALLOC_CTX *out_mem_ctx;
|
---|
168 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
169 | };
|
---|
170 |
|
---|
171 | static void rpccli_initshutdown_Abort_done(struct tevent_req *subreq);
|
---|
172 |
|
---|
173 | struct tevent_req *rpccli_initshutdown_Abort_send(TALLOC_CTX *mem_ctx,
|
---|
174 | struct tevent_context *ev,
|
---|
175 | struct rpc_pipe_client *cli,
|
---|
176 | uint16_t *_server /* [in] [unique] */)
|
---|
177 | {
|
---|
178 | struct tevent_req *req;
|
---|
179 | struct rpccli_initshutdown_Abort_state *state;
|
---|
180 | struct tevent_req *subreq;
|
---|
181 |
|
---|
182 | req = tevent_req_create(mem_ctx, &state,
|
---|
183 | struct rpccli_initshutdown_Abort_state);
|
---|
184 | if (req == NULL) {
|
---|
185 | return NULL;
|
---|
186 | }
|
---|
187 | state->out_mem_ctx = NULL;
|
---|
188 | state->dispatch_recv = cli->dispatch_recv;
|
---|
189 |
|
---|
190 | /* In parameters */
|
---|
191 | state->orig.in.server = _server;
|
---|
192 |
|
---|
193 | /* Out parameters */
|
---|
194 |
|
---|
195 | /* Result */
|
---|
196 | ZERO_STRUCT(state->orig.out.result);
|
---|
197 |
|
---|
198 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
199 | state->tmp = state->orig;
|
---|
200 |
|
---|
201 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
202 | &ndr_table_initshutdown,
|
---|
203 | NDR_INITSHUTDOWN_ABORT,
|
---|
204 | &state->tmp);
|
---|
205 | if (tevent_req_nomem(subreq, req)) {
|
---|
206 | return tevent_req_post(req, ev);
|
---|
207 | }
|
---|
208 | tevent_req_set_callback(subreq, rpccli_initshutdown_Abort_done, req);
|
---|
209 | return req;
|
---|
210 | }
|
---|
211 |
|
---|
212 | static void rpccli_initshutdown_Abort_done(struct tevent_req *subreq)
|
---|
213 | {
|
---|
214 | struct tevent_req *req = tevent_req_callback_data(
|
---|
215 | subreq, struct tevent_req);
|
---|
216 | struct rpccli_initshutdown_Abort_state *state = tevent_req_data(
|
---|
217 | req, struct rpccli_initshutdown_Abort_state);
|
---|
218 | NTSTATUS status;
|
---|
219 | TALLOC_CTX *mem_ctx;
|
---|
220 |
|
---|
221 | if (state->out_mem_ctx) {
|
---|
222 | mem_ctx = state->out_mem_ctx;
|
---|
223 | } else {
|
---|
224 | mem_ctx = state;
|
---|
225 | }
|
---|
226 |
|
---|
227 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
228 | TALLOC_FREE(subreq);
|
---|
229 | if (!NT_STATUS_IS_OK(status)) {
|
---|
230 | tevent_req_nterror(req, status);
|
---|
231 | return;
|
---|
232 | }
|
---|
233 |
|
---|
234 | /* Copy out parameters */
|
---|
235 |
|
---|
236 | /* Copy result */
|
---|
237 | state->orig.out.result = state->tmp.out.result;
|
---|
238 |
|
---|
239 | /* Reset temporary structure */
|
---|
240 | ZERO_STRUCT(state->tmp);
|
---|
241 |
|
---|
242 | tevent_req_done(req);
|
---|
243 | }
|
---|
244 |
|
---|
245 | NTSTATUS rpccli_initshutdown_Abort_recv(struct tevent_req *req,
|
---|
246 | TALLOC_CTX *mem_ctx,
|
---|
247 | WERROR *result)
|
---|
248 | {
|
---|
249 | struct rpccli_initshutdown_Abort_state *state = tevent_req_data(
|
---|
250 | req, struct rpccli_initshutdown_Abort_state);
|
---|
251 | NTSTATUS status;
|
---|
252 |
|
---|
253 | if (tevent_req_is_nterror(req, &status)) {
|
---|
254 | tevent_req_received(req);
|
---|
255 | return status;
|
---|
256 | }
|
---|
257 |
|
---|
258 | /* Steal possbile out parameters to the callers context */
|
---|
259 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
260 |
|
---|
261 | /* Return result */
|
---|
262 | *result = state->orig.out.result;
|
---|
263 |
|
---|
264 | tevent_req_received(req);
|
---|
265 | return NT_STATUS_OK;
|
---|
266 | }
|
---|
267 |
|
---|
268 | NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli,
|
---|
269 | TALLOC_CTX *mem_ctx,
|
---|
270 | uint16_t *server /* [in] [unique] */,
|
---|
271 | WERROR *werror)
|
---|
272 | {
|
---|
273 | struct initshutdown_Abort r;
|
---|
274 | NTSTATUS status;
|
---|
275 |
|
---|
276 | /* In parameters */
|
---|
277 | r.in.server = server;
|
---|
278 |
|
---|
279 | status = cli->dispatch(cli,
|
---|
280 | mem_ctx,
|
---|
281 | &ndr_table_initshutdown,
|
---|
282 | NDR_INITSHUTDOWN_ABORT,
|
---|
283 | &r);
|
---|
284 |
|
---|
285 | if (!NT_STATUS_IS_OK(status)) {
|
---|
286 | return status;
|
---|
287 | }
|
---|
288 |
|
---|
289 | if (NT_STATUS_IS_ERR(status)) {
|
---|
290 | return status;
|
---|
291 | }
|
---|
292 |
|
---|
293 | /* Return variables */
|
---|
294 |
|
---|
295 | /* Return result */
|
---|
296 | if (werror) {
|
---|
297 | *werror = r.out.result;
|
---|
298 | }
|
---|
299 |
|
---|
300 | return werror_to_ntstatus(r.out.result);
|
---|
301 | }
|
---|
302 |
|
---|
303 | struct rpccli_initshutdown_InitEx_state {
|
---|
304 | struct initshutdown_InitEx orig;
|
---|
305 | struct initshutdown_InitEx tmp;
|
---|
306 | TALLOC_CTX *out_mem_ctx;
|
---|
307 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
308 | };
|
---|
309 |
|
---|
310 | static void rpccli_initshutdown_InitEx_done(struct tevent_req *subreq);
|
---|
311 |
|
---|
312 | struct tevent_req *rpccli_initshutdown_InitEx_send(TALLOC_CTX *mem_ctx,
|
---|
313 | struct tevent_context *ev,
|
---|
314 | struct rpc_pipe_client *cli,
|
---|
315 | uint16_t *_hostname /* [in] [unique] */,
|
---|
316 | struct lsa_StringLarge *_message /* [in] [unique] */,
|
---|
317 | uint32_t _timeout /* [in] */,
|
---|
318 | uint8_t _force_apps /* [in] */,
|
---|
319 | uint8_t _do_reboot /* [in] */,
|
---|
320 | uint32_t _reason /* [in] */)
|
---|
321 | {
|
---|
322 | struct tevent_req *req;
|
---|
323 | struct rpccli_initshutdown_InitEx_state *state;
|
---|
324 | struct tevent_req *subreq;
|
---|
325 |
|
---|
326 | req = tevent_req_create(mem_ctx, &state,
|
---|
327 | struct rpccli_initshutdown_InitEx_state);
|
---|
328 | if (req == NULL) {
|
---|
329 | return NULL;
|
---|
330 | }
|
---|
331 | state->out_mem_ctx = NULL;
|
---|
332 | state->dispatch_recv = cli->dispatch_recv;
|
---|
333 |
|
---|
334 | /* In parameters */
|
---|
335 | state->orig.in.hostname = _hostname;
|
---|
336 | state->orig.in.message = _message;
|
---|
337 | state->orig.in.timeout = _timeout;
|
---|
338 | state->orig.in.force_apps = _force_apps;
|
---|
339 | state->orig.in.do_reboot = _do_reboot;
|
---|
340 | state->orig.in.reason = _reason;
|
---|
341 |
|
---|
342 | /* Out parameters */
|
---|
343 |
|
---|
344 | /* Result */
|
---|
345 | ZERO_STRUCT(state->orig.out.result);
|
---|
346 |
|
---|
347 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
348 | state->tmp = state->orig;
|
---|
349 |
|
---|
350 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
351 | &ndr_table_initshutdown,
|
---|
352 | NDR_INITSHUTDOWN_INITEX,
|
---|
353 | &state->tmp);
|
---|
354 | if (tevent_req_nomem(subreq, req)) {
|
---|
355 | return tevent_req_post(req, ev);
|
---|
356 | }
|
---|
357 | tevent_req_set_callback(subreq, rpccli_initshutdown_InitEx_done, req);
|
---|
358 | return req;
|
---|
359 | }
|
---|
360 |
|
---|
361 | static void rpccli_initshutdown_InitEx_done(struct tevent_req *subreq)
|
---|
362 | {
|
---|
363 | struct tevent_req *req = tevent_req_callback_data(
|
---|
364 | subreq, struct tevent_req);
|
---|
365 | struct rpccli_initshutdown_InitEx_state *state = tevent_req_data(
|
---|
366 | req, struct rpccli_initshutdown_InitEx_state);
|
---|
367 | NTSTATUS status;
|
---|
368 | TALLOC_CTX *mem_ctx;
|
---|
369 |
|
---|
370 | if (state->out_mem_ctx) {
|
---|
371 | mem_ctx = state->out_mem_ctx;
|
---|
372 | } else {
|
---|
373 | mem_ctx = state;
|
---|
374 | }
|
---|
375 |
|
---|
376 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
377 | TALLOC_FREE(subreq);
|
---|
378 | if (!NT_STATUS_IS_OK(status)) {
|
---|
379 | tevent_req_nterror(req, status);
|
---|
380 | return;
|
---|
381 | }
|
---|
382 |
|
---|
383 | /* Copy out parameters */
|
---|
384 |
|
---|
385 | /* Copy result */
|
---|
386 | state->orig.out.result = state->tmp.out.result;
|
---|
387 |
|
---|
388 | /* Reset temporary structure */
|
---|
389 | ZERO_STRUCT(state->tmp);
|
---|
390 |
|
---|
391 | tevent_req_done(req);
|
---|
392 | }
|
---|
393 |
|
---|
394 | NTSTATUS rpccli_initshutdown_InitEx_recv(struct tevent_req *req,
|
---|
395 | TALLOC_CTX *mem_ctx,
|
---|
396 | WERROR *result)
|
---|
397 | {
|
---|
398 | struct rpccli_initshutdown_InitEx_state *state = tevent_req_data(
|
---|
399 | req, struct rpccli_initshutdown_InitEx_state);
|
---|
400 | NTSTATUS status;
|
---|
401 |
|
---|
402 | if (tevent_req_is_nterror(req, &status)) {
|
---|
403 | tevent_req_received(req);
|
---|
404 | return status;
|
---|
405 | }
|
---|
406 |
|
---|
407 | /* Steal possbile out parameters to the callers context */
|
---|
408 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
409 |
|
---|
410 | /* Return result */
|
---|
411 | *result = state->orig.out.result;
|
---|
412 |
|
---|
413 | tevent_req_received(req);
|
---|
414 | return NT_STATUS_OK;
|
---|
415 | }
|
---|
416 |
|
---|
417 | NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli,
|
---|
418 | TALLOC_CTX *mem_ctx,
|
---|
419 | uint16_t *hostname /* [in] [unique] */,
|
---|
420 | struct lsa_StringLarge *message /* [in] [unique] */,
|
---|
421 | uint32_t timeout /* [in] */,
|
---|
422 | uint8_t force_apps /* [in] */,
|
---|
423 | uint8_t do_reboot /* [in] */,
|
---|
424 | uint32_t reason /* [in] */,
|
---|
425 | WERROR *werror)
|
---|
426 | {
|
---|
427 | struct initshutdown_InitEx r;
|
---|
428 | NTSTATUS status;
|
---|
429 |
|
---|
430 | /* In parameters */
|
---|
431 | r.in.hostname = hostname;
|
---|
432 | r.in.message = message;
|
---|
433 | r.in.timeout = timeout;
|
---|
434 | r.in.force_apps = force_apps;
|
---|
435 | r.in.do_reboot = do_reboot;
|
---|
436 | r.in.reason = reason;
|
---|
437 |
|
---|
438 | status = cli->dispatch(cli,
|
---|
439 | mem_ctx,
|
---|
440 | &ndr_table_initshutdown,
|
---|
441 | NDR_INITSHUTDOWN_INITEX,
|
---|
442 | &r);
|
---|
443 |
|
---|
444 | if (!NT_STATUS_IS_OK(status)) {
|
---|
445 | return status;
|
---|
446 | }
|
---|
447 |
|
---|
448 | if (NT_STATUS_IS_ERR(status)) {
|
---|
449 | return status;
|
---|
450 | }
|
---|
451 |
|
---|
452 | /* Return variables */
|
---|
453 |
|
---|
454 | /* Return result */
|
---|
455 | if (werror) {
|
---|
456 | *werror = r.out.result;
|
---|
457 | }
|
---|
458 |
|
---|
459 | return werror_to_ntstatus(r.out.result);
|
---|
460 | }
|
---|
461 |
|
---|