build: Add an always parameter to CHECK_DECLS
[Samba/gebeck_regimport.git] / librpc / gen_ndr / cli_wkssvc.c
blobb8465d9bef5813b644e2a925fcfcabd10389a92e
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_wkssvc.h"
9 struct rpccli_wkssvc_NetWkstaGetInfo_state {
10 struct wkssvc_NetWkstaGetInfo orig;
11 struct wkssvc_NetWkstaGetInfo tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_wkssvc_NetWkstaGetInfo_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_wkssvc_NetWkstaGetInfo_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 const char *_server_name /* [in] [unique,charset(UTF16)] */,
22 uint32_t _level /* [in] */,
23 union wkssvc_NetWkstaInfo *_info /* [out] [ref,switch_is(level)] */)
25 struct tevent_req *req;
26 struct rpccli_wkssvc_NetWkstaGetInfo_state *state;
27 struct tevent_req *subreq;
29 req = tevent_req_create(mem_ctx, &state,
30 struct rpccli_wkssvc_NetWkstaGetInfo_state);
31 if (req == NULL) {
32 return NULL;
34 state->out_mem_ctx = NULL;
35 state->dispatch_recv = cli->dispatch_recv;
37 /* In parameters */
38 state->orig.in.server_name = _server_name;
39 state->orig.in.level = _level;
41 /* Out parameters */
42 state->orig.out.info = _info;
44 /* Result */
45 ZERO_STRUCT(state->orig.out.result);
47 state->out_mem_ctx = talloc_named_const(state, 0,
48 "rpccli_wkssvc_NetWkstaGetInfo_out_memory");
49 if (tevent_req_nomem(state->out_mem_ctx, req)) {
50 return tevent_req_post(req, ev);
53 /* make a temporary copy, that we pass to the dispatch function */
54 state->tmp = state->orig;
56 subreq = cli->dispatch_send(state, ev, cli,
57 &ndr_table_wkssvc,
58 NDR_WKSSVC_NETWKSTAGETINFO,
59 &state->tmp);
60 if (tevent_req_nomem(subreq, req)) {
61 return tevent_req_post(req, ev);
63 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaGetInfo_done, req);
64 return req;
67 static void rpccli_wkssvc_NetWkstaGetInfo_done(struct tevent_req *subreq)
69 struct tevent_req *req = tevent_req_callback_data(
70 subreq, struct tevent_req);
71 struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
72 req, struct rpccli_wkssvc_NetWkstaGetInfo_state);
73 NTSTATUS status;
74 TALLOC_CTX *mem_ctx;
76 if (state->out_mem_ctx) {
77 mem_ctx = state->out_mem_ctx;
78 } else {
79 mem_ctx = state;
82 status = state->dispatch_recv(subreq, mem_ctx);
83 TALLOC_FREE(subreq);
84 if (!NT_STATUS_IS_OK(status)) {
85 tevent_req_nterror(req, status);
86 return;
89 /* Copy out parameters */
90 *state->orig.out.info = *state->tmp.out.info;
92 /* Copy result */
93 state->orig.out.result = state->tmp.out.result;
95 /* Reset temporary structure */
96 ZERO_STRUCT(state->tmp);
98 tevent_req_done(req);
101 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo_recv(struct tevent_req *req,
102 TALLOC_CTX *mem_ctx,
103 WERROR *result)
105 struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
106 req, struct rpccli_wkssvc_NetWkstaGetInfo_state);
107 NTSTATUS status;
109 if (tevent_req_is_nterror(req, &status)) {
110 tevent_req_received(req);
111 return status;
114 /* Steal possbile out parameters to the callers context */
115 talloc_steal(mem_ctx, state->out_mem_ctx);
117 /* Return result */
118 *result = state->orig.out.result;
120 tevent_req_received(req);
121 return NT_STATUS_OK;
124 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli,
125 TALLOC_CTX *mem_ctx,
126 const char *server_name /* [in] [unique,charset(UTF16)] */,
127 uint32_t level /* [in] */,
128 union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */,
129 WERROR *werror)
131 struct wkssvc_NetWkstaGetInfo r;
132 NTSTATUS status;
134 /* In parameters */
135 r.in.server_name = server_name;
136 r.in.level = level;
138 status = cli->dispatch(cli,
139 mem_ctx,
140 &ndr_table_wkssvc,
141 NDR_WKSSVC_NETWKSTAGETINFO,
142 &r);
144 if (!NT_STATUS_IS_OK(status)) {
145 return status;
148 if (NT_STATUS_IS_ERR(status)) {
149 return status;
152 /* Return variables */
153 *info = *r.out.info;
155 /* Return result */
156 if (werror) {
157 *werror = r.out.result;
160 return werror_to_ntstatus(r.out.result);
163 struct rpccli_wkssvc_NetWkstaSetInfo_state {
164 struct wkssvc_NetWkstaSetInfo orig;
165 struct wkssvc_NetWkstaSetInfo tmp;
166 TALLOC_CTX *out_mem_ctx;
167 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
170 static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq);
172 struct tevent_req *rpccli_wkssvc_NetWkstaSetInfo_send(TALLOC_CTX *mem_ctx,
173 struct tevent_context *ev,
174 struct rpc_pipe_client *cli,
175 const char *_server_name /* [in] [unique,charset(UTF16)] */,
176 uint32_t _level /* [in] */,
177 union wkssvc_NetWkstaInfo *_info /* [in] [ref,switch_is(level)] */,
178 uint32_t *_parm_error /* [in,out] [ref] */)
180 struct tevent_req *req;
181 struct rpccli_wkssvc_NetWkstaSetInfo_state *state;
182 struct tevent_req *subreq;
184 req = tevent_req_create(mem_ctx, &state,
185 struct rpccli_wkssvc_NetWkstaSetInfo_state);
186 if (req == NULL) {
187 return NULL;
189 state->out_mem_ctx = NULL;
190 state->dispatch_recv = cli->dispatch_recv;
192 /* In parameters */
193 state->orig.in.server_name = _server_name;
194 state->orig.in.level = _level;
195 state->orig.in.info = _info;
196 state->orig.in.parm_error = _parm_error;
198 /* Out parameters */
199 state->orig.out.parm_error = _parm_error;
201 /* Result */
202 ZERO_STRUCT(state->orig.out.result);
204 state->out_mem_ctx = talloc_named_const(state, 0,
205 "rpccli_wkssvc_NetWkstaSetInfo_out_memory");
206 if (tevent_req_nomem(state->out_mem_ctx, req)) {
207 return tevent_req_post(req, ev);
210 /* make a temporary copy, that we pass to the dispatch function */
211 state->tmp = state->orig;
213 subreq = cli->dispatch_send(state, ev, cli,
214 &ndr_table_wkssvc,
215 NDR_WKSSVC_NETWKSTASETINFO,
216 &state->tmp);
217 if (tevent_req_nomem(subreq, req)) {
218 return tevent_req_post(req, ev);
220 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaSetInfo_done, req);
221 return req;
224 static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq)
226 struct tevent_req *req = tevent_req_callback_data(
227 subreq, struct tevent_req);
228 struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
229 req, struct rpccli_wkssvc_NetWkstaSetInfo_state);
230 NTSTATUS status;
231 TALLOC_CTX *mem_ctx;
233 if (state->out_mem_ctx) {
234 mem_ctx = state->out_mem_ctx;
235 } else {
236 mem_ctx = state;
239 status = state->dispatch_recv(subreq, mem_ctx);
240 TALLOC_FREE(subreq);
241 if (!NT_STATUS_IS_OK(status)) {
242 tevent_req_nterror(req, status);
243 return;
246 /* Copy out parameters */
247 *state->orig.out.parm_error = *state->tmp.out.parm_error;
249 /* Copy result */
250 state->orig.out.result = state->tmp.out.result;
252 /* Reset temporary structure */
253 ZERO_STRUCT(state->tmp);
255 tevent_req_done(req);
258 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo_recv(struct tevent_req *req,
259 TALLOC_CTX *mem_ctx,
260 WERROR *result)
262 struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
263 req, struct rpccli_wkssvc_NetWkstaSetInfo_state);
264 NTSTATUS status;
266 if (tevent_req_is_nterror(req, &status)) {
267 tevent_req_received(req);
268 return status;
271 /* Steal possbile out parameters to the callers context */
272 talloc_steal(mem_ctx, state->out_mem_ctx);
274 /* Return result */
275 *result = state->orig.out.result;
277 tevent_req_received(req);
278 return NT_STATUS_OK;
281 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
282 TALLOC_CTX *mem_ctx,
283 const char *server_name /* [in] [unique,charset(UTF16)] */,
284 uint32_t level /* [in] */,
285 union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */,
286 uint32_t *parm_error /* [in,out] [ref] */,
287 WERROR *werror)
289 struct wkssvc_NetWkstaSetInfo r;
290 NTSTATUS status;
292 /* In parameters */
293 r.in.server_name = server_name;
294 r.in.level = level;
295 r.in.info = info;
296 r.in.parm_error = parm_error;
298 status = cli->dispatch(cli,
299 mem_ctx,
300 &ndr_table_wkssvc,
301 NDR_WKSSVC_NETWKSTASETINFO,
302 &r);
304 if (!NT_STATUS_IS_OK(status)) {
305 return status;
308 if (NT_STATUS_IS_ERR(status)) {
309 return status;
312 /* Return variables */
313 *parm_error = *r.out.parm_error;
315 /* Return result */
316 if (werror) {
317 *werror = r.out.result;
320 return werror_to_ntstatus(r.out.result);
323 struct rpccli_wkssvc_NetWkstaEnumUsers_state {
324 struct wkssvc_NetWkstaEnumUsers orig;
325 struct wkssvc_NetWkstaEnumUsers tmp;
326 TALLOC_CTX *out_mem_ctx;
327 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
330 static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq);
332 struct tevent_req *rpccli_wkssvc_NetWkstaEnumUsers_send(TALLOC_CTX *mem_ctx,
333 struct tevent_context *ev,
334 struct rpc_pipe_client *cli,
335 const char *_server_name /* [in] [unique,charset(UTF16)] */,
336 struct wkssvc_NetWkstaEnumUsersInfo *_info /* [in,out] [ref] */,
337 uint32_t _prefmaxlen /* [in] */,
338 uint32_t *_entries_read /* [out] [ref] */,
339 uint32_t *_resume_handle /* [in,out] [unique] */)
341 struct tevent_req *req;
342 struct rpccli_wkssvc_NetWkstaEnumUsers_state *state;
343 struct tevent_req *subreq;
345 req = tevent_req_create(mem_ctx, &state,
346 struct rpccli_wkssvc_NetWkstaEnumUsers_state);
347 if (req == NULL) {
348 return NULL;
350 state->out_mem_ctx = NULL;
351 state->dispatch_recv = cli->dispatch_recv;
353 /* In parameters */
354 state->orig.in.server_name = _server_name;
355 state->orig.in.info = _info;
356 state->orig.in.prefmaxlen = _prefmaxlen;
357 state->orig.in.resume_handle = _resume_handle;
359 /* Out parameters */
360 state->orig.out.info = _info;
361 state->orig.out.entries_read = _entries_read;
362 state->orig.out.resume_handle = _resume_handle;
364 /* Result */
365 ZERO_STRUCT(state->orig.out.result);
367 state->out_mem_ctx = talloc_named_const(state, 0,
368 "rpccli_wkssvc_NetWkstaEnumUsers_out_memory");
369 if (tevent_req_nomem(state->out_mem_ctx, req)) {
370 return tevent_req_post(req, ev);
373 /* make a temporary copy, that we pass to the dispatch function */
374 state->tmp = state->orig;
376 subreq = cli->dispatch_send(state, ev, cli,
377 &ndr_table_wkssvc,
378 NDR_WKSSVC_NETWKSTAENUMUSERS,
379 &state->tmp);
380 if (tevent_req_nomem(subreq, req)) {
381 return tevent_req_post(req, ev);
383 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaEnumUsers_done, req);
384 return req;
387 static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq)
389 struct tevent_req *req = tevent_req_callback_data(
390 subreq, struct tevent_req);
391 struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
392 req, struct rpccli_wkssvc_NetWkstaEnumUsers_state);
393 NTSTATUS status;
394 TALLOC_CTX *mem_ctx;
396 if (state->out_mem_ctx) {
397 mem_ctx = state->out_mem_ctx;
398 } else {
399 mem_ctx = state;
402 status = state->dispatch_recv(subreq, mem_ctx);
403 TALLOC_FREE(subreq);
404 if (!NT_STATUS_IS_OK(status)) {
405 tevent_req_nterror(req, status);
406 return;
409 /* Copy out parameters */
410 *state->orig.out.info = *state->tmp.out.info;
411 *state->orig.out.entries_read = *state->tmp.out.entries_read;
412 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
413 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
416 /* Copy result */
417 state->orig.out.result = state->tmp.out.result;
419 /* Reset temporary structure */
420 ZERO_STRUCT(state->tmp);
422 tevent_req_done(req);
425 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers_recv(struct tevent_req *req,
426 TALLOC_CTX *mem_ctx,
427 WERROR *result)
429 struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
430 req, struct rpccli_wkssvc_NetWkstaEnumUsers_state);
431 NTSTATUS status;
433 if (tevent_req_is_nterror(req, &status)) {
434 tevent_req_received(req);
435 return status;
438 /* Steal possbile out parameters to the callers context */
439 talloc_steal(mem_ctx, state->out_mem_ctx);
441 /* Return result */
442 *result = state->orig.out.result;
444 tevent_req_received(req);
445 return NT_STATUS_OK;
448 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
449 TALLOC_CTX *mem_ctx,
450 const char *server_name /* [in] [unique,charset(UTF16)] */,
451 struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */,
452 uint32_t prefmaxlen /* [in] */,
453 uint32_t *entries_read /* [out] [ref] */,
454 uint32_t *resume_handle /* [in,out] [unique] */,
455 WERROR *werror)
457 struct wkssvc_NetWkstaEnumUsers r;
458 NTSTATUS status;
460 /* In parameters */
461 r.in.server_name = server_name;
462 r.in.info = info;
463 r.in.prefmaxlen = prefmaxlen;
464 r.in.resume_handle = resume_handle;
466 status = cli->dispatch(cli,
467 mem_ctx,
468 &ndr_table_wkssvc,
469 NDR_WKSSVC_NETWKSTAENUMUSERS,
470 &r);
472 if (!NT_STATUS_IS_OK(status)) {
473 return status;
476 if (NT_STATUS_IS_ERR(status)) {
477 return status;
480 /* Return variables */
481 *info = *r.out.info;
482 *entries_read = *r.out.entries_read;
483 if (resume_handle && r.out.resume_handle) {
484 *resume_handle = *r.out.resume_handle;
487 /* Return result */
488 if (werror) {
489 *werror = r.out.result;
492 return werror_to_ntstatus(r.out.result);
495 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state {
496 struct wkssvc_NetrWkstaUserGetInfo orig;
497 struct wkssvc_NetrWkstaUserGetInfo tmp;
498 TALLOC_CTX *out_mem_ctx;
499 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
502 static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq);
504 struct tevent_req *rpccli_wkssvc_NetrWkstaUserGetInfo_send(TALLOC_CTX *mem_ctx,
505 struct tevent_context *ev,
506 struct rpc_pipe_client *cli,
507 const char *_unknown /* [in] [unique,charset(UTF16)] */,
508 uint32_t _level /* [in] */,
509 union wkssvc_NetrWkstaUserInfo *_info /* [out] [ref,switch_is(level)] */)
511 struct tevent_req *req;
512 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state;
513 struct tevent_req *subreq;
515 req = tevent_req_create(mem_ctx, &state,
516 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
517 if (req == NULL) {
518 return NULL;
520 state->out_mem_ctx = NULL;
521 state->dispatch_recv = cli->dispatch_recv;
523 /* In parameters */
524 state->orig.in.unknown = _unknown;
525 state->orig.in.level = _level;
527 /* Out parameters */
528 state->orig.out.info = _info;
530 /* Result */
531 ZERO_STRUCT(state->orig.out.result);
533 state->out_mem_ctx = talloc_named_const(state, 0,
534 "rpccli_wkssvc_NetrWkstaUserGetInfo_out_memory");
535 if (tevent_req_nomem(state->out_mem_ctx, req)) {
536 return tevent_req_post(req, ev);
539 /* make a temporary copy, that we pass to the dispatch function */
540 state->tmp = state->orig;
542 subreq = cli->dispatch_send(state, ev, cli,
543 &ndr_table_wkssvc,
544 NDR_WKSSVC_NETRWKSTAUSERGETINFO,
545 &state->tmp);
546 if (tevent_req_nomem(subreq, req)) {
547 return tevent_req_post(req, ev);
549 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserGetInfo_done, req);
550 return req;
553 static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq)
555 struct tevent_req *req = tevent_req_callback_data(
556 subreq, struct tevent_req);
557 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
558 req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
559 NTSTATUS status;
560 TALLOC_CTX *mem_ctx;
562 if (state->out_mem_ctx) {
563 mem_ctx = state->out_mem_ctx;
564 } else {
565 mem_ctx = state;
568 status = state->dispatch_recv(subreq, mem_ctx);
569 TALLOC_FREE(subreq);
570 if (!NT_STATUS_IS_OK(status)) {
571 tevent_req_nterror(req, status);
572 return;
575 /* Copy out parameters */
576 *state->orig.out.info = *state->tmp.out.info;
578 /* Copy result */
579 state->orig.out.result = state->tmp.out.result;
581 /* Reset temporary structure */
582 ZERO_STRUCT(state->tmp);
584 tevent_req_done(req);
587 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo_recv(struct tevent_req *req,
588 TALLOC_CTX *mem_ctx,
589 WERROR *result)
591 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
592 req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
593 NTSTATUS status;
595 if (tevent_req_is_nterror(req, &status)) {
596 tevent_req_received(req);
597 return status;
600 /* Steal possbile out parameters to the callers context */
601 talloc_steal(mem_ctx, state->out_mem_ctx);
603 /* Return result */
604 *result = state->orig.out.result;
606 tevent_req_received(req);
607 return NT_STATUS_OK;
610 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli,
611 TALLOC_CTX *mem_ctx,
612 const char *unknown /* [in] [unique,charset(UTF16)] */,
613 uint32_t level /* [in] */,
614 union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */,
615 WERROR *werror)
617 struct wkssvc_NetrWkstaUserGetInfo r;
618 NTSTATUS status;
620 /* In parameters */
621 r.in.unknown = unknown;
622 r.in.level = level;
624 status = cli->dispatch(cli,
625 mem_ctx,
626 &ndr_table_wkssvc,
627 NDR_WKSSVC_NETRWKSTAUSERGETINFO,
628 &r);
630 if (!NT_STATUS_IS_OK(status)) {
631 return status;
634 if (NT_STATUS_IS_ERR(status)) {
635 return status;
638 /* Return variables */
639 *info = *r.out.info;
641 /* Return result */
642 if (werror) {
643 *werror = r.out.result;
646 return werror_to_ntstatus(r.out.result);
649 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state {
650 struct wkssvc_NetrWkstaUserSetInfo orig;
651 struct wkssvc_NetrWkstaUserSetInfo tmp;
652 TALLOC_CTX *out_mem_ctx;
653 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
656 static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq);
658 struct tevent_req *rpccli_wkssvc_NetrWkstaUserSetInfo_send(TALLOC_CTX *mem_ctx,
659 struct tevent_context *ev,
660 struct rpc_pipe_client *cli,
661 const char *_unknown /* [in] [unique,charset(UTF16)] */,
662 uint32_t _level /* [in] */,
663 union wkssvc_NetrWkstaUserInfo *_info /* [in] [ref,switch_is(level)] */,
664 uint32_t *_parm_err /* [in,out] [unique] */)
666 struct tevent_req *req;
667 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state;
668 struct tevent_req *subreq;
670 req = tevent_req_create(mem_ctx, &state,
671 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
672 if (req == NULL) {
673 return NULL;
675 state->out_mem_ctx = NULL;
676 state->dispatch_recv = cli->dispatch_recv;
678 /* In parameters */
679 state->orig.in.unknown = _unknown;
680 state->orig.in.level = _level;
681 state->orig.in.info = _info;
682 state->orig.in.parm_err = _parm_err;
684 /* Out parameters */
685 state->orig.out.parm_err = _parm_err;
687 /* Result */
688 ZERO_STRUCT(state->orig.out.result);
690 state->out_mem_ctx = talloc_named_const(state, 0,
691 "rpccli_wkssvc_NetrWkstaUserSetInfo_out_memory");
692 if (tevent_req_nomem(state->out_mem_ctx, req)) {
693 return tevent_req_post(req, ev);
696 /* make a temporary copy, that we pass to the dispatch function */
697 state->tmp = state->orig;
699 subreq = cli->dispatch_send(state, ev, cli,
700 &ndr_table_wkssvc,
701 NDR_WKSSVC_NETRWKSTAUSERSETINFO,
702 &state->tmp);
703 if (tevent_req_nomem(subreq, req)) {
704 return tevent_req_post(req, ev);
706 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserSetInfo_done, req);
707 return req;
710 static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq)
712 struct tevent_req *req = tevent_req_callback_data(
713 subreq, struct tevent_req);
714 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
715 req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
716 NTSTATUS status;
717 TALLOC_CTX *mem_ctx;
719 if (state->out_mem_ctx) {
720 mem_ctx = state->out_mem_ctx;
721 } else {
722 mem_ctx = state;
725 status = state->dispatch_recv(subreq, mem_ctx);
726 TALLOC_FREE(subreq);
727 if (!NT_STATUS_IS_OK(status)) {
728 tevent_req_nterror(req, status);
729 return;
732 /* Copy out parameters */
733 if (state->orig.out.parm_err && state->tmp.out.parm_err) {
734 *state->orig.out.parm_err = *state->tmp.out.parm_err;
737 /* Copy result */
738 state->orig.out.result = state->tmp.out.result;
740 /* Reset temporary structure */
741 ZERO_STRUCT(state->tmp);
743 tevent_req_done(req);
746 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo_recv(struct tevent_req *req,
747 TALLOC_CTX *mem_ctx,
748 WERROR *result)
750 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
751 req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
752 NTSTATUS status;
754 if (tevent_req_is_nterror(req, &status)) {
755 tevent_req_received(req);
756 return status;
759 /* Steal possbile out parameters to the callers context */
760 talloc_steal(mem_ctx, state->out_mem_ctx);
762 /* Return result */
763 *result = state->orig.out.result;
765 tevent_req_received(req);
766 return NT_STATUS_OK;
769 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
770 TALLOC_CTX *mem_ctx,
771 const char *unknown /* [in] [unique,charset(UTF16)] */,
772 uint32_t level /* [in] */,
773 union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */,
774 uint32_t *parm_err /* [in,out] [unique] */,
775 WERROR *werror)
777 struct wkssvc_NetrWkstaUserSetInfo r;
778 NTSTATUS status;
780 /* In parameters */
781 r.in.unknown = unknown;
782 r.in.level = level;
783 r.in.info = info;
784 r.in.parm_err = parm_err;
786 status = cli->dispatch(cli,
787 mem_ctx,
788 &ndr_table_wkssvc,
789 NDR_WKSSVC_NETRWKSTAUSERSETINFO,
790 &r);
792 if (!NT_STATUS_IS_OK(status)) {
793 return status;
796 if (NT_STATUS_IS_ERR(status)) {
797 return status;
800 /* Return variables */
801 if (parm_err && r.out.parm_err) {
802 *parm_err = *r.out.parm_err;
805 /* Return result */
806 if (werror) {
807 *werror = r.out.result;
810 return werror_to_ntstatus(r.out.result);
813 struct rpccli_wkssvc_NetWkstaTransportEnum_state {
814 struct wkssvc_NetWkstaTransportEnum orig;
815 struct wkssvc_NetWkstaTransportEnum tmp;
816 TALLOC_CTX *out_mem_ctx;
817 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
820 static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq);
822 struct tevent_req *rpccli_wkssvc_NetWkstaTransportEnum_send(TALLOC_CTX *mem_ctx,
823 struct tevent_context *ev,
824 struct rpc_pipe_client *cli,
825 const char *_server_name /* [in] [unique,charset(UTF16)] */,
826 struct wkssvc_NetWkstaTransportInfo *_info /* [in,out] [ref] */,
827 uint32_t _max_buffer /* [in] */,
828 uint32_t *_total_entries /* [out] [ref] */,
829 uint32_t *_resume_handle /* [in,out] [unique] */)
831 struct tevent_req *req;
832 struct rpccli_wkssvc_NetWkstaTransportEnum_state *state;
833 struct tevent_req *subreq;
835 req = tevent_req_create(mem_ctx, &state,
836 struct rpccli_wkssvc_NetWkstaTransportEnum_state);
837 if (req == NULL) {
838 return NULL;
840 state->out_mem_ctx = NULL;
841 state->dispatch_recv = cli->dispatch_recv;
843 /* In parameters */
844 state->orig.in.server_name = _server_name;
845 state->orig.in.info = _info;
846 state->orig.in.max_buffer = _max_buffer;
847 state->orig.in.resume_handle = _resume_handle;
849 /* Out parameters */
850 state->orig.out.info = _info;
851 state->orig.out.total_entries = _total_entries;
852 state->orig.out.resume_handle = _resume_handle;
854 /* Result */
855 ZERO_STRUCT(state->orig.out.result);
857 state->out_mem_ctx = talloc_named_const(state, 0,
858 "rpccli_wkssvc_NetWkstaTransportEnum_out_memory");
859 if (tevent_req_nomem(state->out_mem_ctx, req)) {
860 return tevent_req_post(req, ev);
863 /* make a temporary copy, that we pass to the dispatch function */
864 state->tmp = state->orig;
866 subreq = cli->dispatch_send(state, ev, cli,
867 &ndr_table_wkssvc,
868 NDR_WKSSVC_NETWKSTATRANSPORTENUM,
869 &state->tmp);
870 if (tevent_req_nomem(subreq, req)) {
871 return tevent_req_post(req, ev);
873 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaTransportEnum_done, req);
874 return req;
877 static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq)
879 struct tevent_req *req = tevent_req_callback_data(
880 subreq, struct tevent_req);
881 struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
882 req, struct rpccli_wkssvc_NetWkstaTransportEnum_state);
883 NTSTATUS status;
884 TALLOC_CTX *mem_ctx;
886 if (state->out_mem_ctx) {
887 mem_ctx = state->out_mem_ctx;
888 } else {
889 mem_ctx = state;
892 status = state->dispatch_recv(subreq, mem_ctx);
893 TALLOC_FREE(subreq);
894 if (!NT_STATUS_IS_OK(status)) {
895 tevent_req_nterror(req, status);
896 return;
899 /* Copy out parameters */
900 *state->orig.out.info = *state->tmp.out.info;
901 *state->orig.out.total_entries = *state->tmp.out.total_entries;
902 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
903 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
906 /* Copy result */
907 state->orig.out.result = state->tmp.out.result;
909 /* Reset temporary structure */
910 ZERO_STRUCT(state->tmp);
912 tevent_req_done(req);
915 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum_recv(struct tevent_req *req,
916 TALLOC_CTX *mem_ctx,
917 WERROR *result)
919 struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
920 req, struct rpccli_wkssvc_NetWkstaTransportEnum_state);
921 NTSTATUS status;
923 if (tevent_req_is_nterror(req, &status)) {
924 tevent_req_received(req);
925 return status;
928 /* Steal possbile out parameters to the callers context */
929 talloc_steal(mem_ctx, state->out_mem_ctx);
931 /* Return result */
932 *result = state->orig.out.result;
934 tevent_req_received(req);
935 return NT_STATUS_OK;
938 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
939 TALLOC_CTX *mem_ctx,
940 const char *server_name /* [in] [unique,charset(UTF16)] */,
941 struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */,
942 uint32_t max_buffer /* [in] */,
943 uint32_t *total_entries /* [out] [ref] */,
944 uint32_t *resume_handle /* [in,out] [unique] */,
945 WERROR *werror)
947 struct wkssvc_NetWkstaTransportEnum r;
948 NTSTATUS status;
950 /* In parameters */
951 r.in.server_name = server_name;
952 r.in.info = info;
953 r.in.max_buffer = max_buffer;
954 r.in.resume_handle = resume_handle;
956 status = cli->dispatch(cli,
957 mem_ctx,
958 &ndr_table_wkssvc,
959 NDR_WKSSVC_NETWKSTATRANSPORTENUM,
960 &r);
962 if (!NT_STATUS_IS_OK(status)) {
963 return status;
966 if (NT_STATUS_IS_ERR(status)) {
967 return status;
970 /* Return variables */
971 *info = *r.out.info;
972 *total_entries = *r.out.total_entries;
973 if (resume_handle && r.out.resume_handle) {
974 *resume_handle = *r.out.resume_handle;
977 /* Return result */
978 if (werror) {
979 *werror = r.out.result;
982 return werror_to_ntstatus(r.out.result);
985 struct rpccli_wkssvc_NetrWkstaTransportAdd_state {
986 struct wkssvc_NetrWkstaTransportAdd orig;
987 struct wkssvc_NetrWkstaTransportAdd tmp;
988 TALLOC_CTX *out_mem_ctx;
989 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
992 static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq);
994 struct tevent_req *rpccli_wkssvc_NetrWkstaTransportAdd_send(TALLOC_CTX *mem_ctx,
995 struct tevent_context *ev,
996 struct rpc_pipe_client *cli,
997 const char *_server_name /* [in] [unique,charset(UTF16)] */,
998 uint32_t _level /* [in] */,
999 struct wkssvc_NetWkstaTransportInfo0 *_info0 /* [in] [ref] */,
1000 uint32_t *_parm_err /* [in,out] [unique] */)
1002 struct tevent_req *req;
1003 struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state;
1004 struct tevent_req *subreq;
1006 req = tevent_req_create(mem_ctx, &state,
1007 struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1008 if (req == NULL) {
1009 return NULL;
1011 state->out_mem_ctx = NULL;
1012 state->dispatch_recv = cli->dispatch_recv;
1014 /* In parameters */
1015 state->orig.in.server_name = _server_name;
1016 state->orig.in.level = _level;
1017 state->orig.in.info0 = _info0;
1018 state->orig.in.parm_err = _parm_err;
1020 /* Out parameters */
1021 state->orig.out.parm_err = _parm_err;
1023 /* Result */
1024 ZERO_STRUCT(state->orig.out.result);
1026 state->out_mem_ctx = talloc_named_const(state, 0,
1027 "rpccli_wkssvc_NetrWkstaTransportAdd_out_memory");
1028 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1029 return tevent_req_post(req, ev);
1032 /* make a temporary copy, that we pass to the dispatch function */
1033 state->tmp = state->orig;
1035 subreq = cli->dispatch_send(state, ev, cli,
1036 &ndr_table_wkssvc,
1037 NDR_WKSSVC_NETRWKSTATRANSPORTADD,
1038 &state->tmp);
1039 if (tevent_req_nomem(subreq, req)) {
1040 return tevent_req_post(req, ev);
1042 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportAdd_done, req);
1043 return req;
1046 static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq)
1048 struct tevent_req *req = tevent_req_callback_data(
1049 subreq, struct tevent_req);
1050 struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
1051 req, struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1052 NTSTATUS status;
1053 TALLOC_CTX *mem_ctx;
1055 if (state->out_mem_ctx) {
1056 mem_ctx = state->out_mem_ctx;
1057 } else {
1058 mem_ctx = state;
1061 status = state->dispatch_recv(subreq, mem_ctx);
1062 TALLOC_FREE(subreq);
1063 if (!NT_STATUS_IS_OK(status)) {
1064 tevent_req_nterror(req, status);
1065 return;
1068 /* Copy out parameters */
1069 if (state->orig.out.parm_err && state->tmp.out.parm_err) {
1070 *state->orig.out.parm_err = *state->tmp.out.parm_err;
1073 /* Copy result */
1074 state->orig.out.result = state->tmp.out.result;
1076 /* Reset temporary structure */
1077 ZERO_STRUCT(state->tmp);
1079 tevent_req_done(req);
1082 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd_recv(struct tevent_req *req,
1083 TALLOC_CTX *mem_ctx,
1084 WERROR *result)
1086 struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
1087 req, struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1088 NTSTATUS status;
1090 if (tevent_req_is_nterror(req, &status)) {
1091 tevent_req_received(req);
1092 return status;
1095 /* Steal possbile out parameters to the callers context */
1096 talloc_steal(mem_ctx, state->out_mem_ctx);
1098 /* Return result */
1099 *result = state->orig.out.result;
1101 tevent_req_received(req);
1102 return NT_STATUS_OK;
1105 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
1106 TALLOC_CTX *mem_ctx,
1107 const char *server_name /* [in] [unique,charset(UTF16)] */,
1108 uint32_t level /* [in] */,
1109 struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */,
1110 uint32_t *parm_err /* [in,out] [unique] */,
1111 WERROR *werror)
1113 struct wkssvc_NetrWkstaTransportAdd r;
1114 NTSTATUS status;
1116 /* In parameters */
1117 r.in.server_name = server_name;
1118 r.in.level = level;
1119 r.in.info0 = info0;
1120 r.in.parm_err = parm_err;
1122 status = cli->dispatch(cli,
1123 mem_ctx,
1124 &ndr_table_wkssvc,
1125 NDR_WKSSVC_NETRWKSTATRANSPORTADD,
1126 &r);
1128 if (!NT_STATUS_IS_OK(status)) {
1129 return status;
1132 if (NT_STATUS_IS_ERR(status)) {
1133 return status;
1136 /* Return variables */
1137 if (parm_err && r.out.parm_err) {
1138 *parm_err = *r.out.parm_err;
1141 /* Return result */
1142 if (werror) {
1143 *werror = r.out.result;
1146 return werror_to_ntstatus(r.out.result);
1149 struct rpccli_wkssvc_NetrWkstaTransportDel_state {
1150 struct wkssvc_NetrWkstaTransportDel orig;
1151 struct wkssvc_NetrWkstaTransportDel tmp;
1152 TALLOC_CTX *out_mem_ctx;
1153 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1156 static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq);
1158 struct tevent_req *rpccli_wkssvc_NetrWkstaTransportDel_send(TALLOC_CTX *mem_ctx,
1159 struct tevent_context *ev,
1160 struct rpc_pipe_client *cli,
1161 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1162 const char *_transport_name /* [in] [unique,charset(UTF16)] */,
1163 uint32_t _unknown3 /* [in] */)
1165 struct tevent_req *req;
1166 struct rpccli_wkssvc_NetrWkstaTransportDel_state *state;
1167 struct tevent_req *subreq;
1169 req = tevent_req_create(mem_ctx, &state,
1170 struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1171 if (req == NULL) {
1172 return NULL;
1174 state->out_mem_ctx = NULL;
1175 state->dispatch_recv = cli->dispatch_recv;
1177 /* In parameters */
1178 state->orig.in.server_name = _server_name;
1179 state->orig.in.transport_name = _transport_name;
1180 state->orig.in.unknown3 = _unknown3;
1182 /* Out parameters */
1184 /* Result */
1185 ZERO_STRUCT(state->orig.out.result);
1187 /* make a temporary copy, that we pass to the dispatch function */
1188 state->tmp = state->orig;
1190 subreq = cli->dispatch_send(state, ev, cli,
1191 &ndr_table_wkssvc,
1192 NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
1193 &state->tmp);
1194 if (tevent_req_nomem(subreq, req)) {
1195 return tevent_req_post(req, ev);
1197 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportDel_done, req);
1198 return req;
1201 static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq)
1203 struct tevent_req *req = tevent_req_callback_data(
1204 subreq, struct tevent_req);
1205 struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
1206 req, struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1207 NTSTATUS status;
1208 TALLOC_CTX *mem_ctx;
1210 if (state->out_mem_ctx) {
1211 mem_ctx = state->out_mem_ctx;
1212 } else {
1213 mem_ctx = state;
1216 status = state->dispatch_recv(subreq, mem_ctx);
1217 TALLOC_FREE(subreq);
1218 if (!NT_STATUS_IS_OK(status)) {
1219 tevent_req_nterror(req, status);
1220 return;
1223 /* Copy out parameters */
1225 /* Copy result */
1226 state->orig.out.result = state->tmp.out.result;
1228 /* Reset temporary structure */
1229 ZERO_STRUCT(state->tmp);
1231 tevent_req_done(req);
1234 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel_recv(struct tevent_req *req,
1235 TALLOC_CTX *mem_ctx,
1236 WERROR *result)
1238 struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
1239 req, struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1240 NTSTATUS status;
1242 if (tevent_req_is_nterror(req, &status)) {
1243 tevent_req_received(req);
1244 return status;
1247 /* Steal possbile out parameters to the callers context */
1248 talloc_steal(mem_ctx, state->out_mem_ctx);
1250 /* Return result */
1251 *result = state->orig.out.result;
1253 tevent_req_received(req);
1254 return NT_STATUS_OK;
1257 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli,
1258 TALLOC_CTX *mem_ctx,
1259 const char *server_name /* [in] [unique,charset(UTF16)] */,
1260 const char *transport_name /* [in] [unique,charset(UTF16)] */,
1261 uint32_t unknown3 /* [in] */,
1262 WERROR *werror)
1264 struct wkssvc_NetrWkstaTransportDel r;
1265 NTSTATUS status;
1267 /* In parameters */
1268 r.in.server_name = server_name;
1269 r.in.transport_name = transport_name;
1270 r.in.unknown3 = unknown3;
1272 status = cli->dispatch(cli,
1273 mem_ctx,
1274 &ndr_table_wkssvc,
1275 NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
1276 &r);
1278 if (!NT_STATUS_IS_OK(status)) {
1279 return status;
1282 if (NT_STATUS_IS_ERR(status)) {
1283 return status;
1286 /* Return variables */
1288 /* Return result */
1289 if (werror) {
1290 *werror = r.out.result;
1293 return werror_to_ntstatus(r.out.result);
1296 struct rpccli_wkssvc_NetrUseAdd_state {
1297 struct wkssvc_NetrUseAdd orig;
1298 struct wkssvc_NetrUseAdd tmp;
1299 TALLOC_CTX *out_mem_ctx;
1300 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1303 static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq);
1305 struct tevent_req *rpccli_wkssvc_NetrUseAdd_send(TALLOC_CTX *mem_ctx,
1306 struct tevent_context *ev,
1307 struct rpc_pipe_client *cli,
1308 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1309 uint32_t _level /* [in] */,
1310 union wkssvc_NetrUseGetInfoCtr *_ctr /* [in] [ref,switch_is(level)] */,
1311 uint32_t *_parm_err /* [in,out] [unique] */)
1313 struct tevent_req *req;
1314 struct rpccli_wkssvc_NetrUseAdd_state *state;
1315 struct tevent_req *subreq;
1317 req = tevent_req_create(mem_ctx, &state,
1318 struct rpccli_wkssvc_NetrUseAdd_state);
1319 if (req == NULL) {
1320 return NULL;
1322 state->out_mem_ctx = NULL;
1323 state->dispatch_recv = cli->dispatch_recv;
1325 /* In parameters */
1326 state->orig.in.server_name = _server_name;
1327 state->orig.in.level = _level;
1328 state->orig.in.ctr = _ctr;
1329 state->orig.in.parm_err = _parm_err;
1331 /* Out parameters */
1332 state->orig.out.parm_err = _parm_err;
1334 /* Result */
1335 ZERO_STRUCT(state->orig.out.result);
1337 state->out_mem_ctx = talloc_named_const(state, 0,
1338 "rpccli_wkssvc_NetrUseAdd_out_memory");
1339 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1340 return tevent_req_post(req, ev);
1343 /* make a temporary copy, that we pass to the dispatch function */
1344 state->tmp = state->orig;
1346 subreq = cli->dispatch_send(state, ev, cli,
1347 &ndr_table_wkssvc,
1348 NDR_WKSSVC_NETRUSEADD,
1349 &state->tmp);
1350 if (tevent_req_nomem(subreq, req)) {
1351 return tevent_req_post(req, ev);
1353 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseAdd_done, req);
1354 return req;
1357 static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq)
1359 struct tevent_req *req = tevent_req_callback_data(
1360 subreq, struct tevent_req);
1361 struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
1362 req, struct rpccli_wkssvc_NetrUseAdd_state);
1363 NTSTATUS status;
1364 TALLOC_CTX *mem_ctx;
1366 if (state->out_mem_ctx) {
1367 mem_ctx = state->out_mem_ctx;
1368 } else {
1369 mem_ctx = state;
1372 status = state->dispatch_recv(subreq, mem_ctx);
1373 TALLOC_FREE(subreq);
1374 if (!NT_STATUS_IS_OK(status)) {
1375 tevent_req_nterror(req, status);
1376 return;
1379 /* Copy out parameters */
1380 if (state->orig.out.parm_err && state->tmp.out.parm_err) {
1381 *state->orig.out.parm_err = *state->tmp.out.parm_err;
1384 /* Copy result */
1385 state->orig.out.result = state->tmp.out.result;
1387 /* Reset temporary structure */
1388 ZERO_STRUCT(state->tmp);
1390 tevent_req_done(req);
1393 NTSTATUS rpccli_wkssvc_NetrUseAdd_recv(struct tevent_req *req,
1394 TALLOC_CTX *mem_ctx,
1395 WERROR *result)
1397 struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
1398 req, struct rpccli_wkssvc_NetrUseAdd_state);
1399 NTSTATUS status;
1401 if (tevent_req_is_nterror(req, &status)) {
1402 tevent_req_received(req);
1403 return status;
1406 /* Steal possbile out parameters to the callers context */
1407 talloc_steal(mem_ctx, state->out_mem_ctx);
1409 /* Return result */
1410 *result = state->orig.out.result;
1412 tevent_req_received(req);
1413 return NT_STATUS_OK;
1416 NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
1417 TALLOC_CTX *mem_ctx,
1418 const char *server_name /* [in] [unique,charset(UTF16)] */,
1419 uint32_t level /* [in] */,
1420 union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */,
1421 uint32_t *parm_err /* [in,out] [unique] */,
1422 WERROR *werror)
1424 struct wkssvc_NetrUseAdd r;
1425 NTSTATUS status;
1427 /* In parameters */
1428 r.in.server_name = server_name;
1429 r.in.level = level;
1430 r.in.ctr = ctr;
1431 r.in.parm_err = parm_err;
1433 status = cli->dispatch(cli,
1434 mem_ctx,
1435 &ndr_table_wkssvc,
1436 NDR_WKSSVC_NETRUSEADD,
1437 &r);
1439 if (!NT_STATUS_IS_OK(status)) {
1440 return status;
1443 if (NT_STATUS_IS_ERR(status)) {
1444 return status;
1447 /* Return variables */
1448 if (parm_err && r.out.parm_err) {
1449 *parm_err = *r.out.parm_err;
1452 /* Return result */
1453 if (werror) {
1454 *werror = r.out.result;
1457 return werror_to_ntstatus(r.out.result);
1460 struct rpccli_wkssvc_NetrUseGetInfo_state {
1461 struct wkssvc_NetrUseGetInfo orig;
1462 struct wkssvc_NetrUseGetInfo tmp;
1463 TALLOC_CTX *out_mem_ctx;
1464 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1467 static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq);
1469 struct tevent_req *rpccli_wkssvc_NetrUseGetInfo_send(TALLOC_CTX *mem_ctx,
1470 struct tevent_context *ev,
1471 struct rpc_pipe_client *cli,
1472 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1473 const char *_use_name /* [in] [ref,charset(UTF16)] */,
1474 uint32_t _level /* [in] */,
1475 union wkssvc_NetrUseGetInfoCtr *_ctr /* [out] [ref,switch_is(level)] */)
1477 struct tevent_req *req;
1478 struct rpccli_wkssvc_NetrUseGetInfo_state *state;
1479 struct tevent_req *subreq;
1481 req = tevent_req_create(mem_ctx, &state,
1482 struct rpccli_wkssvc_NetrUseGetInfo_state);
1483 if (req == NULL) {
1484 return NULL;
1486 state->out_mem_ctx = NULL;
1487 state->dispatch_recv = cli->dispatch_recv;
1489 /* In parameters */
1490 state->orig.in.server_name = _server_name;
1491 state->orig.in.use_name = _use_name;
1492 state->orig.in.level = _level;
1494 /* Out parameters */
1495 state->orig.out.ctr = _ctr;
1497 /* Result */
1498 ZERO_STRUCT(state->orig.out.result);
1500 state->out_mem_ctx = talloc_named_const(state, 0,
1501 "rpccli_wkssvc_NetrUseGetInfo_out_memory");
1502 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1503 return tevent_req_post(req, ev);
1506 /* make a temporary copy, that we pass to the dispatch function */
1507 state->tmp = state->orig;
1509 subreq = cli->dispatch_send(state, ev, cli,
1510 &ndr_table_wkssvc,
1511 NDR_WKSSVC_NETRUSEGETINFO,
1512 &state->tmp);
1513 if (tevent_req_nomem(subreq, req)) {
1514 return tevent_req_post(req, ev);
1516 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseGetInfo_done, req);
1517 return req;
1520 static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq)
1522 struct tevent_req *req = tevent_req_callback_data(
1523 subreq, struct tevent_req);
1524 struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
1525 req, struct rpccli_wkssvc_NetrUseGetInfo_state);
1526 NTSTATUS status;
1527 TALLOC_CTX *mem_ctx;
1529 if (state->out_mem_ctx) {
1530 mem_ctx = state->out_mem_ctx;
1531 } else {
1532 mem_ctx = state;
1535 status = state->dispatch_recv(subreq, mem_ctx);
1536 TALLOC_FREE(subreq);
1537 if (!NT_STATUS_IS_OK(status)) {
1538 tevent_req_nterror(req, status);
1539 return;
1542 /* Copy out parameters */
1543 *state->orig.out.ctr = *state->tmp.out.ctr;
1545 /* Copy result */
1546 state->orig.out.result = state->tmp.out.result;
1548 /* Reset temporary structure */
1549 ZERO_STRUCT(state->tmp);
1551 tevent_req_done(req);
1554 NTSTATUS rpccli_wkssvc_NetrUseGetInfo_recv(struct tevent_req *req,
1555 TALLOC_CTX *mem_ctx,
1556 WERROR *result)
1558 struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
1559 req, struct rpccli_wkssvc_NetrUseGetInfo_state);
1560 NTSTATUS status;
1562 if (tevent_req_is_nterror(req, &status)) {
1563 tevent_req_received(req);
1564 return status;
1567 /* Steal possbile out parameters to the callers context */
1568 talloc_steal(mem_ctx, state->out_mem_ctx);
1570 /* Return result */
1571 *result = state->orig.out.result;
1573 tevent_req_received(req);
1574 return NT_STATUS_OK;
1577 NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
1578 TALLOC_CTX *mem_ctx,
1579 const char *server_name /* [in] [unique,charset(UTF16)] */,
1580 const char *use_name /* [in] [ref,charset(UTF16)] */,
1581 uint32_t level /* [in] */,
1582 union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */,
1583 WERROR *werror)
1585 struct wkssvc_NetrUseGetInfo r;
1586 NTSTATUS status;
1588 /* In parameters */
1589 r.in.server_name = server_name;
1590 r.in.use_name = use_name;
1591 r.in.level = level;
1593 status = cli->dispatch(cli,
1594 mem_ctx,
1595 &ndr_table_wkssvc,
1596 NDR_WKSSVC_NETRUSEGETINFO,
1597 &r);
1599 if (!NT_STATUS_IS_OK(status)) {
1600 return status;
1603 if (NT_STATUS_IS_ERR(status)) {
1604 return status;
1607 /* Return variables */
1608 *ctr = *r.out.ctr;
1610 /* Return result */
1611 if (werror) {
1612 *werror = r.out.result;
1615 return werror_to_ntstatus(r.out.result);
1618 struct rpccli_wkssvc_NetrUseDel_state {
1619 struct wkssvc_NetrUseDel orig;
1620 struct wkssvc_NetrUseDel tmp;
1621 TALLOC_CTX *out_mem_ctx;
1622 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1625 static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq);
1627 struct tevent_req *rpccli_wkssvc_NetrUseDel_send(TALLOC_CTX *mem_ctx,
1628 struct tevent_context *ev,
1629 struct rpc_pipe_client *cli,
1630 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1631 const char *_use_name /* [in] [ref,charset(UTF16)] */,
1632 uint32_t _force_cond /* [in] */)
1634 struct tevent_req *req;
1635 struct rpccli_wkssvc_NetrUseDel_state *state;
1636 struct tevent_req *subreq;
1638 req = tevent_req_create(mem_ctx, &state,
1639 struct rpccli_wkssvc_NetrUseDel_state);
1640 if (req == NULL) {
1641 return NULL;
1643 state->out_mem_ctx = NULL;
1644 state->dispatch_recv = cli->dispatch_recv;
1646 /* In parameters */
1647 state->orig.in.server_name = _server_name;
1648 state->orig.in.use_name = _use_name;
1649 state->orig.in.force_cond = _force_cond;
1651 /* Out parameters */
1653 /* Result */
1654 ZERO_STRUCT(state->orig.out.result);
1656 /* make a temporary copy, that we pass to the dispatch function */
1657 state->tmp = state->orig;
1659 subreq = cli->dispatch_send(state, ev, cli,
1660 &ndr_table_wkssvc,
1661 NDR_WKSSVC_NETRUSEDEL,
1662 &state->tmp);
1663 if (tevent_req_nomem(subreq, req)) {
1664 return tevent_req_post(req, ev);
1666 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseDel_done, req);
1667 return req;
1670 static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq)
1672 struct tevent_req *req = tevent_req_callback_data(
1673 subreq, struct tevent_req);
1674 struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
1675 req, struct rpccli_wkssvc_NetrUseDel_state);
1676 NTSTATUS status;
1677 TALLOC_CTX *mem_ctx;
1679 if (state->out_mem_ctx) {
1680 mem_ctx = state->out_mem_ctx;
1681 } else {
1682 mem_ctx = state;
1685 status = state->dispatch_recv(subreq, mem_ctx);
1686 TALLOC_FREE(subreq);
1687 if (!NT_STATUS_IS_OK(status)) {
1688 tevent_req_nterror(req, status);
1689 return;
1692 /* Copy out parameters */
1694 /* Copy result */
1695 state->orig.out.result = state->tmp.out.result;
1697 /* Reset temporary structure */
1698 ZERO_STRUCT(state->tmp);
1700 tevent_req_done(req);
1703 NTSTATUS rpccli_wkssvc_NetrUseDel_recv(struct tevent_req *req,
1704 TALLOC_CTX *mem_ctx,
1705 WERROR *result)
1707 struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
1708 req, struct rpccli_wkssvc_NetrUseDel_state);
1709 NTSTATUS status;
1711 if (tevent_req_is_nterror(req, &status)) {
1712 tevent_req_received(req);
1713 return status;
1716 /* Steal possbile out parameters to the callers context */
1717 talloc_steal(mem_ctx, state->out_mem_ctx);
1719 /* Return result */
1720 *result = state->orig.out.result;
1722 tevent_req_received(req);
1723 return NT_STATUS_OK;
1726 NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
1727 TALLOC_CTX *mem_ctx,
1728 const char *server_name /* [in] [unique,charset(UTF16)] */,
1729 const char *use_name /* [in] [ref,charset(UTF16)] */,
1730 uint32_t force_cond /* [in] */,
1731 WERROR *werror)
1733 struct wkssvc_NetrUseDel r;
1734 NTSTATUS status;
1736 /* In parameters */
1737 r.in.server_name = server_name;
1738 r.in.use_name = use_name;
1739 r.in.force_cond = force_cond;
1741 status = cli->dispatch(cli,
1742 mem_ctx,
1743 &ndr_table_wkssvc,
1744 NDR_WKSSVC_NETRUSEDEL,
1745 &r);
1747 if (!NT_STATUS_IS_OK(status)) {
1748 return status;
1751 if (NT_STATUS_IS_ERR(status)) {
1752 return status;
1755 /* Return variables */
1757 /* Return result */
1758 if (werror) {
1759 *werror = r.out.result;
1762 return werror_to_ntstatus(r.out.result);
1765 struct rpccli_wkssvc_NetrUseEnum_state {
1766 struct wkssvc_NetrUseEnum orig;
1767 struct wkssvc_NetrUseEnum tmp;
1768 TALLOC_CTX *out_mem_ctx;
1769 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1772 static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq);
1774 struct tevent_req *rpccli_wkssvc_NetrUseEnum_send(TALLOC_CTX *mem_ctx,
1775 struct tevent_context *ev,
1776 struct rpc_pipe_client *cli,
1777 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1778 struct wkssvc_NetrUseEnumInfo *_info /* [in,out] [ref] */,
1779 uint32_t _prefmaxlen /* [in] */,
1780 uint32_t *_entries_read /* [out] [ref] */,
1781 uint32_t *_resume_handle /* [in,out] [unique] */)
1783 struct tevent_req *req;
1784 struct rpccli_wkssvc_NetrUseEnum_state *state;
1785 struct tevent_req *subreq;
1787 req = tevent_req_create(mem_ctx, &state,
1788 struct rpccli_wkssvc_NetrUseEnum_state);
1789 if (req == NULL) {
1790 return NULL;
1792 state->out_mem_ctx = NULL;
1793 state->dispatch_recv = cli->dispatch_recv;
1795 /* In parameters */
1796 state->orig.in.server_name = _server_name;
1797 state->orig.in.info = _info;
1798 state->orig.in.prefmaxlen = _prefmaxlen;
1799 state->orig.in.resume_handle = _resume_handle;
1801 /* Out parameters */
1802 state->orig.out.info = _info;
1803 state->orig.out.entries_read = _entries_read;
1804 state->orig.out.resume_handle = _resume_handle;
1806 /* Result */
1807 ZERO_STRUCT(state->orig.out.result);
1809 state->out_mem_ctx = talloc_named_const(state, 0,
1810 "rpccli_wkssvc_NetrUseEnum_out_memory");
1811 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1812 return tevent_req_post(req, ev);
1815 /* make a temporary copy, that we pass to the dispatch function */
1816 state->tmp = state->orig;
1818 subreq = cli->dispatch_send(state, ev, cli,
1819 &ndr_table_wkssvc,
1820 NDR_WKSSVC_NETRUSEENUM,
1821 &state->tmp);
1822 if (tevent_req_nomem(subreq, req)) {
1823 return tevent_req_post(req, ev);
1825 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseEnum_done, req);
1826 return req;
1829 static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq)
1831 struct tevent_req *req = tevent_req_callback_data(
1832 subreq, struct tevent_req);
1833 struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
1834 req, struct rpccli_wkssvc_NetrUseEnum_state);
1835 NTSTATUS status;
1836 TALLOC_CTX *mem_ctx;
1838 if (state->out_mem_ctx) {
1839 mem_ctx = state->out_mem_ctx;
1840 } else {
1841 mem_ctx = state;
1844 status = state->dispatch_recv(subreq, mem_ctx);
1845 TALLOC_FREE(subreq);
1846 if (!NT_STATUS_IS_OK(status)) {
1847 tevent_req_nterror(req, status);
1848 return;
1851 /* Copy out parameters */
1852 *state->orig.out.info = *state->tmp.out.info;
1853 *state->orig.out.entries_read = *state->tmp.out.entries_read;
1854 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
1855 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
1858 /* Copy result */
1859 state->orig.out.result = state->tmp.out.result;
1861 /* Reset temporary structure */
1862 ZERO_STRUCT(state->tmp);
1864 tevent_req_done(req);
1867 NTSTATUS rpccli_wkssvc_NetrUseEnum_recv(struct tevent_req *req,
1868 TALLOC_CTX *mem_ctx,
1869 WERROR *result)
1871 struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
1872 req, struct rpccli_wkssvc_NetrUseEnum_state);
1873 NTSTATUS status;
1875 if (tevent_req_is_nterror(req, &status)) {
1876 tevent_req_received(req);
1877 return status;
1880 /* Steal possbile out parameters to the callers context */
1881 talloc_steal(mem_ctx, state->out_mem_ctx);
1883 /* Return result */
1884 *result = state->orig.out.result;
1886 tevent_req_received(req);
1887 return NT_STATUS_OK;
1890 NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
1891 TALLOC_CTX *mem_ctx,
1892 const char *server_name /* [in] [unique,charset(UTF16)] */,
1893 struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */,
1894 uint32_t prefmaxlen /* [in] */,
1895 uint32_t *entries_read /* [out] [ref] */,
1896 uint32_t *resume_handle /* [in,out] [unique] */,
1897 WERROR *werror)
1899 struct wkssvc_NetrUseEnum r;
1900 NTSTATUS status;
1902 /* In parameters */
1903 r.in.server_name = server_name;
1904 r.in.info = info;
1905 r.in.prefmaxlen = prefmaxlen;
1906 r.in.resume_handle = resume_handle;
1908 status = cli->dispatch(cli,
1909 mem_ctx,
1910 &ndr_table_wkssvc,
1911 NDR_WKSSVC_NETRUSEENUM,
1912 &r);
1914 if (!NT_STATUS_IS_OK(status)) {
1915 return status;
1918 if (NT_STATUS_IS_ERR(status)) {
1919 return status;
1922 /* Return variables */
1923 *info = *r.out.info;
1924 *entries_read = *r.out.entries_read;
1925 if (resume_handle && r.out.resume_handle) {
1926 *resume_handle = *r.out.resume_handle;
1929 /* Return result */
1930 if (werror) {
1931 *werror = r.out.result;
1934 return werror_to_ntstatus(r.out.result);
1937 struct rpccli_wkssvc_NetrMessageBufferSend_state {
1938 struct wkssvc_NetrMessageBufferSend orig;
1939 struct wkssvc_NetrMessageBufferSend tmp;
1940 TALLOC_CTX *out_mem_ctx;
1941 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1944 static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq);
1946 struct tevent_req *rpccli_wkssvc_NetrMessageBufferSend_send(TALLOC_CTX *mem_ctx,
1947 struct tevent_context *ev,
1948 struct rpc_pipe_client *cli,
1949 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1950 const char *_message_name /* [in] [ref,charset(UTF16)] */,
1951 const char *_message_sender_name /* [in] [unique,charset(UTF16)] */,
1952 uint8_t *_message_buffer /* [in] [ref,size_is(message_size)] */,
1953 uint32_t _message_size /* [in] */)
1955 struct tevent_req *req;
1956 struct rpccli_wkssvc_NetrMessageBufferSend_state *state;
1957 struct tevent_req *subreq;
1959 req = tevent_req_create(mem_ctx, &state,
1960 struct rpccli_wkssvc_NetrMessageBufferSend_state);
1961 if (req == NULL) {
1962 return NULL;
1964 state->out_mem_ctx = NULL;
1965 state->dispatch_recv = cli->dispatch_recv;
1967 /* In parameters */
1968 state->orig.in.server_name = _server_name;
1969 state->orig.in.message_name = _message_name;
1970 state->orig.in.message_sender_name = _message_sender_name;
1971 state->orig.in.message_buffer = _message_buffer;
1972 state->orig.in.message_size = _message_size;
1974 /* Out parameters */
1976 /* Result */
1977 ZERO_STRUCT(state->orig.out.result);
1979 /* make a temporary copy, that we pass to the dispatch function */
1980 state->tmp = state->orig;
1982 subreq = cli->dispatch_send(state, ev, cli,
1983 &ndr_table_wkssvc,
1984 NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
1985 &state->tmp);
1986 if (tevent_req_nomem(subreq, req)) {
1987 return tevent_req_post(req, ev);
1989 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrMessageBufferSend_done, req);
1990 return req;
1993 static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq)
1995 struct tevent_req *req = tevent_req_callback_data(
1996 subreq, struct tevent_req);
1997 struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
1998 req, struct rpccli_wkssvc_NetrMessageBufferSend_state);
1999 NTSTATUS status;
2000 TALLOC_CTX *mem_ctx;
2002 if (state->out_mem_ctx) {
2003 mem_ctx = state->out_mem_ctx;
2004 } else {
2005 mem_ctx = state;
2008 status = state->dispatch_recv(subreq, mem_ctx);
2009 TALLOC_FREE(subreq);
2010 if (!NT_STATUS_IS_OK(status)) {
2011 tevent_req_nterror(req, status);
2012 return;
2015 /* Copy out parameters */
2017 /* Copy result */
2018 state->orig.out.result = state->tmp.out.result;
2020 /* Reset temporary structure */
2021 ZERO_STRUCT(state->tmp);
2023 tevent_req_done(req);
2026 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend_recv(struct tevent_req *req,
2027 TALLOC_CTX *mem_ctx,
2028 WERROR *result)
2030 struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
2031 req, struct rpccli_wkssvc_NetrMessageBufferSend_state);
2032 NTSTATUS status;
2034 if (tevent_req_is_nterror(req, &status)) {
2035 tevent_req_received(req);
2036 return status;
2039 /* Steal possbile out parameters to the callers context */
2040 talloc_steal(mem_ctx, state->out_mem_ctx);
2042 /* Return result */
2043 *result = state->orig.out.result;
2045 tevent_req_received(req);
2046 return NT_STATUS_OK;
2049 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
2050 TALLOC_CTX *mem_ctx,
2051 const char *server_name /* [in] [unique,charset(UTF16)] */,
2052 const char *message_name /* [in] [ref,charset(UTF16)] */,
2053 const char *message_sender_name /* [in] [unique,charset(UTF16)] */,
2054 uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */,
2055 uint32_t message_size /* [in] */,
2056 WERROR *werror)
2058 struct wkssvc_NetrMessageBufferSend r;
2059 NTSTATUS status;
2061 /* In parameters */
2062 r.in.server_name = server_name;
2063 r.in.message_name = message_name;
2064 r.in.message_sender_name = message_sender_name;
2065 r.in.message_buffer = message_buffer;
2066 r.in.message_size = message_size;
2068 status = cli->dispatch(cli,
2069 mem_ctx,
2070 &ndr_table_wkssvc,
2071 NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
2072 &r);
2074 if (!NT_STATUS_IS_OK(status)) {
2075 return status;
2078 if (NT_STATUS_IS_ERR(status)) {
2079 return status;
2082 /* Return variables */
2084 /* Return result */
2085 if (werror) {
2086 *werror = r.out.result;
2089 return werror_to_ntstatus(r.out.result);
2092 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state {
2093 struct wkssvc_NetrWorkstationStatisticsGet orig;
2094 struct wkssvc_NetrWorkstationStatisticsGet tmp;
2095 TALLOC_CTX *out_mem_ctx;
2096 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2099 static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq);
2101 struct tevent_req *rpccli_wkssvc_NetrWorkstationStatisticsGet_send(TALLOC_CTX *mem_ctx,
2102 struct tevent_context *ev,
2103 struct rpc_pipe_client *cli,
2104 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2105 const char *_unknown2 /* [in] [unique,charset(UTF16)] */,
2106 uint32_t _unknown3 /* [in] */,
2107 uint32_t _unknown4 /* [in] */,
2108 struct wkssvc_NetrWorkstationStatistics **_info /* [out] [ref] */)
2110 struct tevent_req *req;
2111 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state;
2112 struct tevent_req *subreq;
2114 req = tevent_req_create(mem_ctx, &state,
2115 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2116 if (req == NULL) {
2117 return NULL;
2119 state->out_mem_ctx = NULL;
2120 state->dispatch_recv = cli->dispatch_recv;
2122 /* In parameters */
2123 state->orig.in.server_name = _server_name;
2124 state->orig.in.unknown2 = _unknown2;
2125 state->orig.in.unknown3 = _unknown3;
2126 state->orig.in.unknown4 = _unknown4;
2128 /* Out parameters */
2129 state->orig.out.info = _info;
2131 /* Result */
2132 ZERO_STRUCT(state->orig.out.result);
2134 state->out_mem_ctx = talloc_named_const(state, 0,
2135 "rpccli_wkssvc_NetrWorkstationStatisticsGet_out_memory");
2136 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2137 return tevent_req_post(req, ev);
2140 /* make a temporary copy, that we pass to the dispatch function */
2141 state->tmp = state->orig;
2143 subreq = cli->dispatch_send(state, ev, cli,
2144 &ndr_table_wkssvc,
2145 NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
2146 &state->tmp);
2147 if (tevent_req_nomem(subreq, req)) {
2148 return tevent_req_post(req, ev);
2150 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWorkstationStatisticsGet_done, req);
2151 return req;
2154 static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq)
2156 struct tevent_req *req = tevent_req_callback_data(
2157 subreq, struct tevent_req);
2158 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
2159 req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2160 NTSTATUS status;
2161 TALLOC_CTX *mem_ctx;
2163 if (state->out_mem_ctx) {
2164 mem_ctx = state->out_mem_ctx;
2165 } else {
2166 mem_ctx = state;
2169 status = state->dispatch_recv(subreq, mem_ctx);
2170 TALLOC_FREE(subreq);
2171 if (!NT_STATUS_IS_OK(status)) {
2172 tevent_req_nterror(req, status);
2173 return;
2176 /* Copy out parameters */
2177 *state->orig.out.info = *state->tmp.out.info;
2179 /* Copy result */
2180 state->orig.out.result = state->tmp.out.result;
2182 /* Reset temporary structure */
2183 ZERO_STRUCT(state->tmp);
2185 tevent_req_done(req);
2188 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet_recv(struct tevent_req *req,
2189 TALLOC_CTX *mem_ctx,
2190 WERROR *result)
2192 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
2193 req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2194 NTSTATUS status;
2196 if (tevent_req_is_nterror(req, &status)) {
2197 tevent_req_received(req);
2198 return status;
2201 /* Steal possbile out parameters to the callers context */
2202 talloc_steal(mem_ctx, state->out_mem_ctx);
2204 /* Return result */
2205 *result = state->orig.out.result;
2207 tevent_req_received(req);
2208 return NT_STATUS_OK;
2211 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
2212 TALLOC_CTX *mem_ctx,
2213 const char *server_name /* [in] [unique,charset(UTF16)] */,
2214 const char *unknown2 /* [in] [unique,charset(UTF16)] */,
2215 uint32_t unknown3 /* [in] */,
2216 uint32_t unknown4 /* [in] */,
2217 struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */,
2218 WERROR *werror)
2220 struct wkssvc_NetrWorkstationStatisticsGet r;
2221 NTSTATUS status;
2223 /* In parameters */
2224 r.in.server_name = server_name;
2225 r.in.unknown2 = unknown2;
2226 r.in.unknown3 = unknown3;
2227 r.in.unknown4 = unknown4;
2229 status = cli->dispatch(cli,
2230 mem_ctx,
2231 &ndr_table_wkssvc,
2232 NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
2233 &r);
2235 if (!NT_STATUS_IS_OK(status)) {
2236 return status;
2239 if (NT_STATUS_IS_ERR(status)) {
2240 return status;
2243 /* Return variables */
2244 *info = *r.out.info;
2246 /* Return result */
2247 if (werror) {
2248 *werror = r.out.result;
2251 return werror_to_ntstatus(r.out.result);
2254 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state {
2255 struct wkssvc_NetrLogonDomainNameAdd orig;
2256 struct wkssvc_NetrLogonDomainNameAdd tmp;
2257 TALLOC_CTX *out_mem_ctx;
2258 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2261 static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq);
2263 struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameAdd_send(TALLOC_CTX *mem_ctx,
2264 struct tevent_context *ev,
2265 struct rpc_pipe_client *cli,
2266 const char *_domain_name /* [in] [ref,charset(UTF16)] */)
2268 struct tevent_req *req;
2269 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state;
2270 struct tevent_req *subreq;
2272 req = tevent_req_create(mem_ctx, &state,
2273 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2274 if (req == NULL) {
2275 return NULL;
2277 state->out_mem_ctx = NULL;
2278 state->dispatch_recv = cli->dispatch_recv;
2280 /* In parameters */
2281 state->orig.in.domain_name = _domain_name;
2283 /* Out parameters */
2285 /* Result */
2286 ZERO_STRUCT(state->orig.out.result);
2288 /* make a temporary copy, that we pass to the dispatch function */
2289 state->tmp = state->orig;
2291 subreq = cli->dispatch_send(state, ev, cli,
2292 &ndr_table_wkssvc,
2293 NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
2294 &state->tmp);
2295 if (tevent_req_nomem(subreq, req)) {
2296 return tevent_req_post(req, ev);
2298 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameAdd_done, req);
2299 return req;
2302 static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq)
2304 struct tevent_req *req = tevent_req_callback_data(
2305 subreq, struct tevent_req);
2306 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
2307 req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2308 NTSTATUS status;
2309 TALLOC_CTX *mem_ctx;
2311 if (state->out_mem_ctx) {
2312 mem_ctx = state->out_mem_ctx;
2313 } else {
2314 mem_ctx = state;
2317 status = state->dispatch_recv(subreq, mem_ctx);
2318 TALLOC_FREE(subreq);
2319 if (!NT_STATUS_IS_OK(status)) {
2320 tevent_req_nterror(req, status);
2321 return;
2324 /* Copy out parameters */
2326 /* Copy result */
2327 state->orig.out.result = state->tmp.out.result;
2329 /* Reset temporary structure */
2330 ZERO_STRUCT(state->tmp);
2332 tevent_req_done(req);
2335 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd_recv(struct tevent_req *req,
2336 TALLOC_CTX *mem_ctx,
2337 WERROR *result)
2339 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
2340 req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2341 NTSTATUS status;
2343 if (tevent_req_is_nterror(req, &status)) {
2344 tevent_req_received(req);
2345 return status;
2348 /* Steal possbile out parameters to the callers context */
2349 talloc_steal(mem_ctx, state->out_mem_ctx);
2351 /* Return result */
2352 *result = state->orig.out.result;
2354 tevent_req_received(req);
2355 return NT_STATUS_OK;
2358 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli,
2359 TALLOC_CTX *mem_ctx,
2360 const char *domain_name /* [in] [ref,charset(UTF16)] */,
2361 WERROR *werror)
2363 struct wkssvc_NetrLogonDomainNameAdd r;
2364 NTSTATUS status;
2366 /* In parameters */
2367 r.in.domain_name = domain_name;
2369 status = cli->dispatch(cli,
2370 mem_ctx,
2371 &ndr_table_wkssvc,
2372 NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
2373 &r);
2375 if (!NT_STATUS_IS_OK(status)) {
2376 return status;
2379 if (NT_STATUS_IS_ERR(status)) {
2380 return status;
2383 /* Return variables */
2385 /* Return result */
2386 if (werror) {
2387 *werror = r.out.result;
2390 return werror_to_ntstatus(r.out.result);
2393 struct rpccli_wkssvc_NetrLogonDomainNameDel_state {
2394 struct wkssvc_NetrLogonDomainNameDel orig;
2395 struct wkssvc_NetrLogonDomainNameDel tmp;
2396 TALLOC_CTX *out_mem_ctx;
2397 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2400 static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq);
2402 struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameDel_send(TALLOC_CTX *mem_ctx,
2403 struct tevent_context *ev,
2404 struct rpc_pipe_client *cli,
2405 const char *_domain_name /* [in] [ref,charset(UTF16)] */)
2407 struct tevent_req *req;
2408 struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state;
2409 struct tevent_req *subreq;
2411 req = tevent_req_create(mem_ctx, &state,
2412 struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2413 if (req == NULL) {
2414 return NULL;
2416 state->out_mem_ctx = NULL;
2417 state->dispatch_recv = cli->dispatch_recv;
2419 /* In parameters */
2420 state->orig.in.domain_name = _domain_name;
2422 /* Out parameters */
2424 /* Result */
2425 ZERO_STRUCT(state->orig.out.result);
2427 /* make a temporary copy, that we pass to the dispatch function */
2428 state->tmp = state->orig;
2430 subreq = cli->dispatch_send(state, ev, cli,
2431 &ndr_table_wkssvc,
2432 NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
2433 &state->tmp);
2434 if (tevent_req_nomem(subreq, req)) {
2435 return tevent_req_post(req, ev);
2437 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameDel_done, req);
2438 return req;
2441 static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq)
2443 struct tevent_req *req = tevent_req_callback_data(
2444 subreq, struct tevent_req);
2445 struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
2446 req, struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2447 NTSTATUS status;
2448 TALLOC_CTX *mem_ctx;
2450 if (state->out_mem_ctx) {
2451 mem_ctx = state->out_mem_ctx;
2452 } else {
2453 mem_ctx = state;
2456 status = state->dispatch_recv(subreq, mem_ctx);
2457 TALLOC_FREE(subreq);
2458 if (!NT_STATUS_IS_OK(status)) {
2459 tevent_req_nterror(req, status);
2460 return;
2463 /* Copy out parameters */
2465 /* Copy result */
2466 state->orig.out.result = state->tmp.out.result;
2468 /* Reset temporary structure */
2469 ZERO_STRUCT(state->tmp);
2471 tevent_req_done(req);
2474 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel_recv(struct tevent_req *req,
2475 TALLOC_CTX *mem_ctx,
2476 WERROR *result)
2478 struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
2479 req, struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2480 NTSTATUS status;
2482 if (tevent_req_is_nterror(req, &status)) {
2483 tevent_req_received(req);
2484 return status;
2487 /* Steal possbile out parameters to the callers context */
2488 talloc_steal(mem_ctx, state->out_mem_ctx);
2490 /* Return result */
2491 *result = state->orig.out.result;
2493 tevent_req_received(req);
2494 return NT_STATUS_OK;
2497 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli,
2498 TALLOC_CTX *mem_ctx,
2499 const char *domain_name /* [in] [ref,charset(UTF16)] */,
2500 WERROR *werror)
2502 struct wkssvc_NetrLogonDomainNameDel r;
2503 NTSTATUS status;
2505 /* In parameters */
2506 r.in.domain_name = domain_name;
2508 status = cli->dispatch(cli,
2509 mem_ctx,
2510 &ndr_table_wkssvc,
2511 NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
2512 &r);
2514 if (!NT_STATUS_IS_OK(status)) {
2515 return status;
2518 if (NT_STATUS_IS_ERR(status)) {
2519 return status;
2522 /* Return variables */
2524 /* Return result */
2525 if (werror) {
2526 *werror = r.out.result;
2529 return werror_to_ntstatus(r.out.result);
2532 struct rpccli_wkssvc_NetrJoinDomain_state {
2533 struct wkssvc_NetrJoinDomain orig;
2534 struct wkssvc_NetrJoinDomain tmp;
2535 TALLOC_CTX *out_mem_ctx;
2536 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2539 static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq);
2541 struct tevent_req *rpccli_wkssvc_NetrJoinDomain_send(TALLOC_CTX *mem_ctx,
2542 struct tevent_context *ev,
2543 struct rpc_pipe_client *cli,
2544 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2545 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
2546 const char *_account_ou /* [in] [unique,charset(UTF16)] */,
2547 const char *_Account /* [in] [unique,charset(UTF16)] */,
2548 const char *_password /* [in] [unique,charset(UTF16)] */,
2549 uint32_t _join_flags /* [in] */)
2551 struct tevent_req *req;
2552 struct rpccli_wkssvc_NetrJoinDomain_state *state;
2553 struct tevent_req *subreq;
2555 req = tevent_req_create(mem_ctx, &state,
2556 struct rpccli_wkssvc_NetrJoinDomain_state);
2557 if (req == NULL) {
2558 return NULL;
2560 state->out_mem_ctx = NULL;
2561 state->dispatch_recv = cli->dispatch_recv;
2563 /* In parameters */
2564 state->orig.in.server_name = _server_name;
2565 state->orig.in.domain_name = _domain_name;
2566 state->orig.in.account_ou = _account_ou;
2567 state->orig.in.Account = _Account;
2568 state->orig.in.password = _password;
2569 state->orig.in.join_flags = _join_flags;
2571 /* Out parameters */
2573 /* Result */
2574 ZERO_STRUCT(state->orig.out.result);
2576 /* make a temporary copy, that we pass to the dispatch function */
2577 state->tmp = state->orig;
2579 subreq = cli->dispatch_send(state, ev, cli,
2580 &ndr_table_wkssvc,
2581 NDR_WKSSVC_NETRJOINDOMAIN,
2582 &state->tmp);
2583 if (tevent_req_nomem(subreq, req)) {
2584 return tevent_req_post(req, ev);
2586 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain_done, req);
2587 return req;
2590 static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq)
2592 struct tevent_req *req = tevent_req_callback_data(
2593 subreq, struct tevent_req);
2594 struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
2595 req, struct rpccli_wkssvc_NetrJoinDomain_state);
2596 NTSTATUS status;
2597 TALLOC_CTX *mem_ctx;
2599 if (state->out_mem_ctx) {
2600 mem_ctx = state->out_mem_ctx;
2601 } else {
2602 mem_ctx = state;
2605 status = state->dispatch_recv(subreq, mem_ctx);
2606 TALLOC_FREE(subreq);
2607 if (!NT_STATUS_IS_OK(status)) {
2608 tevent_req_nterror(req, status);
2609 return;
2612 /* Copy out parameters */
2614 /* Copy result */
2615 state->orig.out.result = state->tmp.out.result;
2617 /* Reset temporary structure */
2618 ZERO_STRUCT(state->tmp);
2620 tevent_req_done(req);
2623 NTSTATUS rpccli_wkssvc_NetrJoinDomain_recv(struct tevent_req *req,
2624 TALLOC_CTX *mem_ctx,
2625 WERROR *result)
2627 struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
2628 req, struct rpccli_wkssvc_NetrJoinDomain_state);
2629 NTSTATUS status;
2631 if (tevent_req_is_nterror(req, &status)) {
2632 tevent_req_received(req);
2633 return status;
2636 /* Steal possbile out parameters to the callers context */
2637 talloc_steal(mem_ctx, state->out_mem_ctx);
2639 /* Return result */
2640 *result = state->orig.out.result;
2642 tevent_req_received(req);
2643 return NT_STATUS_OK;
2646 NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
2647 TALLOC_CTX *mem_ctx,
2648 const char *server_name /* [in] [unique,charset(UTF16)] */,
2649 const char *domain_name /* [in] [ref,charset(UTF16)] */,
2650 const char *account_ou /* [in] [unique,charset(UTF16)] */,
2651 const char *Account /* [in] [unique,charset(UTF16)] */,
2652 const char *password /* [in] [unique,charset(UTF16)] */,
2653 uint32_t join_flags /* [in] */,
2654 WERROR *werror)
2656 struct wkssvc_NetrJoinDomain r;
2657 NTSTATUS status;
2659 /* In parameters */
2660 r.in.server_name = server_name;
2661 r.in.domain_name = domain_name;
2662 r.in.account_ou = account_ou;
2663 r.in.Account = Account;
2664 r.in.password = password;
2665 r.in.join_flags = join_flags;
2667 status = cli->dispatch(cli,
2668 mem_ctx,
2669 &ndr_table_wkssvc,
2670 NDR_WKSSVC_NETRJOINDOMAIN,
2671 &r);
2673 if (!NT_STATUS_IS_OK(status)) {
2674 return status;
2677 if (NT_STATUS_IS_ERR(status)) {
2678 return status;
2681 /* Return variables */
2683 /* Return result */
2684 if (werror) {
2685 *werror = r.out.result;
2688 return werror_to_ntstatus(r.out.result);
2691 struct rpccli_wkssvc_NetrUnjoinDomain_state {
2692 struct wkssvc_NetrUnjoinDomain orig;
2693 struct wkssvc_NetrUnjoinDomain tmp;
2694 TALLOC_CTX *out_mem_ctx;
2695 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2698 static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq);
2700 struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain_send(TALLOC_CTX *mem_ctx,
2701 struct tevent_context *ev,
2702 struct rpc_pipe_client *cli,
2703 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2704 const char *_Account /* [in] [unique,charset(UTF16)] */,
2705 const char *_password /* [in] [unique,charset(UTF16)] */,
2706 uint32_t _unjoin_flags /* [in] */)
2708 struct tevent_req *req;
2709 struct rpccli_wkssvc_NetrUnjoinDomain_state *state;
2710 struct tevent_req *subreq;
2712 req = tevent_req_create(mem_ctx, &state,
2713 struct rpccli_wkssvc_NetrUnjoinDomain_state);
2714 if (req == NULL) {
2715 return NULL;
2717 state->out_mem_ctx = NULL;
2718 state->dispatch_recv = cli->dispatch_recv;
2720 /* In parameters */
2721 state->orig.in.server_name = _server_name;
2722 state->orig.in.Account = _Account;
2723 state->orig.in.password = _password;
2724 state->orig.in.unjoin_flags = _unjoin_flags;
2726 /* Out parameters */
2728 /* Result */
2729 ZERO_STRUCT(state->orig.out.result);
2731 /* make a temporary copy, that we pass to the dispatch function */
2732 state->tmp = state->orig;
2734 subreq = cli->dispatch_send(state, ev, cli,
2735 &ndr_table_wkssvc,
2736 NDR_WKSSVC_NETRUNJOINDOMAIN,
2737 &state->tmp);
2738 if (tevent_req_nomem(subreq, req)) {
2739 return tevent_req_post(req, ev);
2741 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain_done, req);
2742 return req;
2745 static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq)
2747 struct tevent_req *req = tevent_req_callback_data(
2748 subreq, struct tevent_req);
2749 struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
2750 req, struct rpccli_wkssvc_NetrUnjoinDomain_state);
2751 NTSTATUS status;
2752 TALLOC_CTX *mem_ctx;
2754 if (state->out_mem_ctx) {
2755 mem_ctx = state->out_mem_ctx;
2756 } else {
2757 mem_ctx = state;
2760 status = state->dispatch_recv(subreq, mem_ctx);
2761 TALLOC_FREE(subreq);
2762 if (!NT_STATUS_IS_OK(status)) {
2763 tevent_req_nterror(req, status);
2764 return;
2767 /* Copy out parameters */
2769 /* Copy result */
2770 state->orig.out.result = state->tmp.out.result;
2772 /* Reset temporary structure */
2773 ZERO_STRUCT(state->tmp);
2775 tevent_req_done(req);
2778 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain_recv(struct tevent_req *req,
2779 TALLOC_CTX *mem_ctx,
2780 WERROR *result)
2782 struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
2783 req, struct rpccli_wkssvc_NetrUnjoinDomain_state);
2784 NTSTATUS status;
2786 if (tevent_req_is_nterror(req, &status)) {
2787 tevent_req_received(req);
2788 return status;
2791 /* Steal possbile out parameters to the callers context */
2792 talloc_steal(mem_ctx, state->out_mem_ctx);
2794 /* Return result */
2795 *result = state->orig.out.result;
2797 tevent_req_received(req);
2798 return NT_STATUS_OK;
2801 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
2802 TALLOC_CTX *mem_ctx,
2803 const char *server_name /* [in] [unique,charset(UTF16)] */,
2804 const char *Account /* [in] [unique,charset(UTF16)] */,
2805 const char *password /* [in] [unique,charset(UTF16)] */,
2806 uint32_t unjoin_flags /* [in] */,
2807 WERROR *werror)
2809 struct wkssvc_NetrUnjoinDomain r;
2810 NTSTATUS status;
2812 /* In parameters */
2813 r.in.server_name = server_name;
2814 r.in.Account = Account;
2815 r.in.password = password;
2816 r.in.unjoin_flags = unjoin_flags;
2818 status = cli->dispatch(cli,
2819 mem_ctx,
2820 &ndr_table_wkssvc,
2821 NDR_WKSSVC_NETRUNJOINDOMAIN,
2822 &r);
2824 if (!NT_STATUS_IS_OK(status)) {
2825 return status;
2828 if (NT_STATUS_IS_ERR(status)) {
2829 return status;
2832 /* Return variables */
2834 /* Return result */
2835 if (werror) {
2836 *werror = r.out.result;
2839 return werror_to_ntstatus(r.out.result);
2842 struct rpccli_wkssvc_NetrRenameMachineInDomain_state {
2843 struct wkssvc_NetrRenameMachineInDomain orig;
2844 struct wkssvc_NetrRenameMachineInDomain tmp;
2845 TALLOC_CTX *out_mem_ctx;
2846 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2849 static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq);
2851 struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain_send(TALLOC_CTX *mem_ctx,
2852 struct tevent_context *ev,
2853 struct rpc_pipe_client *cli,
2854 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2855 const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
2856 const char *_Account /* [in] [unique,charset(UTF16)] */,
2857 const char *_password /* [in] [unique,charset(UTF16)] */,
2858 uint32_t _RenameOptions /* [in] */)
2860 struct tevent_req *req;
2861 struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state;
2862 struct tevent_req *subreq;
2864 req = tevent_req_create(mem_ctx, &state,
2865 struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
2866 if (req == NULL) {
2867 return NULL;
2869 state->out_mem_ctx = NULL;
2870 state->dispatch_recv = cli->dispatch_recv;
2872 /* In parameters */
2873 state->orig.in.server_name = _server_name;
2874 state->orig.in.NewMachineName = _NewMachineName;
2875 state->orig.in.Account = _Account;
2876 state->orig.in.password = _password;
2877 state->orig.in.RenameOptions = _RenameOptions;
2879 /* Out parameters */
2881 /* Result */
2882 ZERO_STRUCT(state->orig.out.result);
2884 /* make a temporary copy, that we pass to the dispatch function */
2885 state->tmp = state->orig;
2887 subreq = cli->dispatch_send(state, ev, cli,
2888 &ndr_table_wkssvc,
2889 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
2890 &state->tmp);
2891 if (tevent_req_nomem(subreq, req)) {
2892 return tevent_req_post(req, ev);
2894 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain_done, req);
2895 return req;
2898 static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq)
2900 struct tevent_req *req = tevent_req_callback_data(
2901 subreq, struct tevent_req);
2902 struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
2903 req, struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
2904 NTSTATUS status;
2905 TALLOC_CTX *mem_ctx;
2907 if (state->out_mem_ctx) {
2908 mem_ctx = state->out_mem_ctx;
2909 } else {
2910 mem_ctx = state;
2913 status = state->dispatch_recv(subreq, mem_ctx);
2914 TALLOC_FREE(subreq);
2915 if (!NT_STATUS_IS_OK(status)) {
2916 tevent_req_nterror(req, status);
2917 return;
2920 /* Copy out parameters */
2922 /* Copy result */
2923 state->orig.out.result = state->tmp.out.result;
2925 /* Reset temporary structure */
2926 ZERO_STRUCT(state->tmp);
2928 tevent_req_done(req);
2931 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain_recv(struct tevent_req *req,
2932 TALLOC_CTX *mem_ctx,
2933 WERROR *result)
2935 struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
2936 req, struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
2937 NTSTATUS status;
2939 if (tevent_req_is_nterror(req, &status)) {
2940 tevent_req_received(req);
2941 return status;
2944 /* Steal possbile out parameters to the callers context */
2945 talloc_steal(mem_ctx, state->out_mem_ctx);
2947 /* Return result */
2948 *result = state->orig.out.result;
2950 tevent_req_received(req);
2951 return NT_STATUS_OK;
2954 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
2955 TALLOC_CTX *mem_ctx,
2956 const char *server_name /* [in] [unique,charset(UTF16)] */,
2957 const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
2958 const char *Account /* [in] [unique,charset(UTF16)] */,
2959 const char *password /* [in] [unique,charset(UTF16)] */,
2960 uint32_t RenameOptions /* [in] */,
2961 WERROR *werror)
2963 struct wkssvc_NetrRenameMachineInDomain r;
2964 NTSTATUS status;
2966 /* In parameters */
2967 r.in.server_name = server_name;
2968 r.in.NewMachineName = NewMachineName;
2969 r.in.Account = Account;
2970 r.in.password = password;
2971 r.in.RenameOptions = RenameOptions;
2973 status = cli->dispatch(cli,
2974 mem_ctx,
2975 &ndr_table_wkssvc,
2976 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
2977 &r);
2979 if (!NT_STATUS_IS_OK(status)) {
2980 return status;
2983 if (NT_STATUS_IS_ERR(status)) {
2984 return status;
2987 /* Return variables */
2989 /* Return result */
2990 if (werror) {
2991 *werror = r.out.result;
2994 return werror_to_ntstatus(r.out.result);
2997 struct rpccli_wkssvc_NetrValidateName_state {
2998 struct wkssvc_NetrValidateName orig;
2999 struct wkssvc_NetrValidateName tmp;
3000 TALLOC_CTX *out_mem_ctx;
3001 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3004 static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq);
3006 struct tevent_req *rpccli_wkssvc_NetrValidateName_send(TALLOC_CTX *mem_ctx,
3007 struct tevent_context *ev,
3008 struct rpc_pipe_client *cli,
3009 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3010 const char *_name /* [in] [ref,charset(UTF16)] */,
3011 const char *_Account /* [in] [unique,charset(UTF16)] */,
3012 const char *_Password /* [in] [unique,charset(UTF16)] */,
3013 enum wkssvc_NetValidateNameType _name_type /* [in] */)
3015 struct tevent_req *req;
3016 struct rpccli_wkssvc_NetrValidateName_state *state;
3017 struct tevent_req *subreq;
3019 req = tevent_req_create(mem_ctx, &state,
3020 struct rpccli_wkssvc_NetrValidateName_state);
3021 if (req == NULL) {
3022 return NULL;
3024 state->out_mem_ctx = NULL;
3025 state->dispatch_recv = cli->dispatch_recv;
3027 /* In parameters */
3028 state->orig.in.server_name = _server_name;
3029 state->orig.in.name = _name;
3030 state->orig.in.Account = _Account;
3031 state->orig.in.Password = _Password;
3032 state->orig.in.name_type = _name_type;
3034 /* Out parameters */
3036 /* Result */
3037 ZERO_STRUCT(state->orig.out.result);
3039 /* make a temporary copy, that we pass to the dispatch function */
3040 state->tmp = state->orig;
3042 subreq = cli->dispatch_send(state, ev, cli,
3043 &ndr_table_wkssvc,
3044 NDR_WKSSVC_NETRVALIDATENAME,
3045 &state->tmp);
3046 if (tevent_req_nomem(subreq, req)) {
3047 return tevent_req_post(req, ev);
3049 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName_done, req);
3050 return req;
3053 static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq)
3055 struct tevent_req *req = tevent_req_callback_data(
3056 subreq, struct tevent_req);
3057 struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
3058 req, struct rpccli_wkssvc_NetrValidateName_state);
3059 NTSTATUS status;
3060 TALLOC_CTX *mem_ctx;
3062 if (state->out_mem_ctx) {
3063 mem_ctx = state->out_mem_ctx;
3064 } else {
3065 mem_ctx = state;
3068 status = state->dispatch_recv(subreq, mem_ctx);
3069 TALLOC_FREE(subreq);
3070 if (!NT_STATUS_IS_OK(status)) {
3071 tevent_req_nterror(req, status);
3072 return;
3075 /* Copy out parameters */
3077 /* Copy result */
3078 state->orig.out.result = state->tmp.out.result;
3080 /* Reset temporary structure */
3081 ZERO_STRUCT(state->tmp);
3083 tevent_req_done(req);
3086 NTSTATUS rpccli_wkssvc_NetrValidateName_recv(struct tevent_req *req,
3087 TALLOC_CTX *mem_ctx,
3088 WERROR *result)
3090 struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
3091 req, struct rpccli_wkssvc_NetrValidateName_state);
3092 NTSTATUS status;
3094 if (tevent_req_is_nterror(req, &status)) {
3095 tevent_req_received(req);
3096 return status;
3099 /* Steal possbile out parameters to the callers context */
3100 talloc_steal(mem_ctx, state->out_mem_ctx);
3102 /* Return result */
3103 *result = state->orig.out.result;
3105 tevent_req_received(req);
3106 return NT_STATUS_OK;
3109 NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
3110 TALLOC_CTX *mem_ctx,
3111 const char *server_name /* [in] [unique,charset(UTF16)] */,
3112 const char *name /* [in] [ref,charset(UTF16)] */,
3113 const char *Account /* [in] [unique,charset(UTF16)] */,
3114 const char *Password /* [in] [unique,charset(UTF16)] */,
3115 enum wkssvc_NetValidateNameType name_type /* [in] */,
3116 WERROR *werror)
3118 struct wkssvc_NetrValidateName r;
3119 NTSTATUS status;
3121 /* In parameters */
3122 r.in.server_name = server_name;
3123 r.in.name = name;
3124 r.in.Account = Account;
3125 r.in.Password = Password;
3126 r.in.name_type = name_type;
3128 status = cli->dispatch(cli,
3129 mem_ctx,
3130 &ndr_table_wkssvc,
3131 NDR_WKSSVC_NETRVALIDATENAME,
3132 &r);
3134 if (!NT_STATUS_IS_OK(status)) {
3135 return status;
3138 if (NT_STATUS_IS_ERR(status)) {
3139 return status;
3142 /* Return variables */
3144 /* Return result */
3145 if (werror) {
3146 *werror = r.out.result;
3149 return werror_to_ntstatus(r.out.result);
3152 struct rpccli_wkssvc_NetrGetJoinInformation_state {
3153 struct wkssvc_NetrGetJoinInformation orig;
3154 struct wkssvc_NetrGetJoinInformation tmp;
3155 TALLOC_CTX *out_mem_ctx;
3156 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3159 static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq);
3161 struct tevent_req *rpccli_wkssvc_NetrGetJoinInformation_send(TALLOC_CTX *mem_ctx,
3162 struct tevent_context *ev,
3163 struct rpc_pipe_client *cli,
3164 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3165 const char **_name_buffer /* [in,out] [ref,charset(UTF16)] */,
3166 enum wkssvc_NetJoinStatus *_name_type /* [out] [ref] */)
3168 struct tevent_req *req;
3169 struct rpccli_wkssvc_NetrGetJoinInformation_state *state;
3170 struct tevent_req *subreq;
3172 req = tevent_req_create(mem_ctx, &state,
3173 struct rpccli_wkssvc_NetrGetJoinInformation_state);
3174 if (req == NULL) {
3175 return NULL;
3177 state->out_mem_ctx = NULL;
3178 state->dispatch_recv = cli->dispatch_recv;
3180 /* In parameters */
3181 state->orig.in.server_name = _server_name;
3182 state->orig.in.name_buffer = _name_buffer;
3184 /* Out parameters */
3185 state->orig.out.name_buffer = _name_buffer;
3186 state->orig.out.name_type = _name_type;
3188 /* Result */
3189 ZERO_STRUCT(state->orig.out.result);
3191 state->out_mem_ctx = talloc_named_const(state, 0,
3192 "rpccli_wkssvc_NetrGetJoinInformation_out_memory");
3193 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3194 return tevent_req_post(req, ev);
3197 /* make a temporary copy, that we pass to the dispatch function */
3198 state->tmp = state->orig;
3200 subreq = cli->dispatch_send(state, ev, cli,
3201 &ndr_table_wkssvc,
3202 NDR_WKSSVC_NETRGETJOININFORMATION,
3203 &state->tmp);
3204 if (tevent_req_nomem(subreq, req)) {
3205 return tevent_req_post(req, ev);
3207 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinInformation_done, req);
3208 return req;
3211 static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq)
3213 struct tevent_req *req = tevent_req_callback_data(
3214 subreq, struct tevent_req);
3215 struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
3216 req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
3217 NTSTATUS status;
3218 TALLOC_CTX *mem_ctx;
3220 if (state->out_mem_ctx) {
3221 mem_ctx = state->out_mem_ctx;
3222 } else {
3223 mem_ctx = state;
3226 status = state->dispatch_recv(subreq, mem_ctx);
3227 TALLOC_FREE(subreq);
3228 if (!NT_STATUS_IS_OK(status)) {
3229 tevent_req_nterror(req, status);
3230 return;
3233 /* Copy out parameters */
3234 *state->orig.out.name_buffer = *state->tmp.out.name_buffer;
3235 *state->orig.out.name_type = *state->tmp.out.name_type;
3237 /* Copy result */
3238 state->orig.out.result = state->tmp.out.result;
3240 /* Reset temporary structure */
3241 ZERO_STRUCT(state->tmp);
3243 tevent_req_done(req);
3246 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation_recv(struct tevent_req *req,
3247 TALLOC_CTX *mem_ctx,
3248 WERROR *result)
3250 struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
3251 req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
3252 NTSTATUS status;
3254 if (tevent_req_is_nterror(req, &status)) {
3255 tevent_req_received(req);
3256 return status;
3259 /* Steal possbile out parameters to the callers context */
3260 talloc_steal(mem_ctx, state->out_mem_ctx);
3262 /* Return result */
3263 *result = state->orig.out.result;
3265 tevent_req_received(req);
3266 return NT_STATUS_OK;
3269 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli,
3270 TALLOC_CTX *mem_ctx,
3271 const char *server_name /* [in] [unique,charset(UTF16)] */,
3272 const char **name_buffer /* [in,out] [ref,charset(UTF16)] */,
3273 enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */,
3274 WERROR *werror)
3276 struct wkssvc_NetrGetJoinInformation r;
3277 NTSTATUS status;
3279 /* In parameters */
3280 r.in.server_name = server_name;
3281 r.in.name_buffer = name_buffer;
3283 status = cli->dispatch(cli,
3284 mem_ctx,
3285 &ndr_table_wkssvc,
3286 NDR_WKSSVC_NETRGETJOININFORMATION,
3287 &r);
3289 if (!NT_STATUS_IS_OK(status)) {
3290 return status;
3293 if (NT_STATUS_IS_ERR(status)) {
3294 return status;
3297 /* Return variables */
3298 *name_buffer = *r.out.name_buffer;
3299 *name_type = *r.out.name_type;
3301 /* Return result */
3302 if (werror) {
3303 *werror = r.out.result;
3306 return werror_to_ntstatus(r.out.result);
3309 struct rpccli_wkssvc_NetrGetJoinableOus_state {
3310 struct wkssvc_NetrGetJoinableOus orig;
3311 struct wkssvc_NetrGetJoinableOus tmp;
3312 TALLOC_CTX *out_mem_ctx;
3313 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3316 static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq);
3318 struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus_send(TALLOC_CTX *mem_ctx,
3319 struct tevent_context *ev,
3320 struct rpc_pipe_client *cli,
3321 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3322 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
3323 const char *_Account /* [in] [unique,charset(UTF16)] */,
3324 const char *_unknown /* [in] [unique,charset(UTF16)] */,
3325 uint32_t *_num_ous /* [in,out] [ref] */,
3326 const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
3328 struct tevent_req *req;
3329 struct rpccli_wkssvc_NetrGetJoinableOus_state *state;
3330 struct tevent_req *subreq;
3332 req = tevent_req_create(mem_ctx, &state,
3333 struct rpccli_wkssvc_NetrGetJoinableOus_state);
3334 if (req == NULL) {
3335 return NULL;
3337 state->out_mem_ctx = NULL;
3338 state->dispatch_recv = cli->dispatch_recv;
3340 /* In parameters */
3341 state->orig.in.server_name = _server_name;
3342 state->orig.in.domain_name = _domain_name;
3343 state->orig.in.Account = _Account;
3344 state->orig.in.unknown = _unknown;
3345 state->orig.in.num_ous = _num_ous;
3347 /* Out parameters */
3348 state->orig.out.num_ous = _num_ous;
3349 state->orig.out.ous = _ous;
3351 /* Result */
3352 ZERO_STRUCT(state->orig.out.result);
3354 state->out_mem_ctx = talloc_named_const(state, 0,
3355 "rpccli_wkssvc_NetrGetJoinableOus_out_memory");
3356 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3357 return tevent_req_post(req, ev);
3360 /* make a temporary copy, that we pass to the dispatch function */
3361 state->tmp = state->orig;
3363 subreq = cli->dispatch_send(state, ev, cli,
3364 &ndr_table_wkssvc,
3365 NDR_WKSSVC_NETRGETJOINABLEOUS,
3366 &state->tmp);
3367 if (tevent_req_nomem(subreq, req)) {
3368 return tevent_req_post(req, ev);
3370 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus_done, req);
3371 return req;
3374 static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq)
3376 struct tevent_req *req = tevent_req_callback_data(
3377 subreq, struct tevent_req);
3378 struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
3379 req, struct rpccli_wkssvc_NetrGetJoinableOus_state);
3380 NTSTATUS status;
3381 TALLOC_CTX *mem_ctx;
3383 if (state->out_mem_ctx) {
3384 mem_ctx = state->out_mem_ctx;
3385 } else {
3386 mem_ctx = state;
3389 status = state->dispatch_recv(subreq, mem_ctx);
3390 TALLOC_FREE(subreq);
3391 if (!NT_STATUS_IS_OK(status)) {
3392 tevent_req_nterror(req, status);
3393 return;
3396 /* Copy out parameters */
3397 *state->orig.out.num_ous = *state->tmp.out.num_ous;
3398 *state->orig.out.ous = *state->tmp.out.ous;
3400 /* Copy result */
3401 state->orig.out.result = state->tmp.out.result;
3403 /* Reset temporary structure */
3404 ZERO_STRUCT(state->tmp);
3406 tevent_req_done(req);
3409 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus_recv(struct tevent_req *req,
3410 TALLOC_CTX *mem_ctx,
3411 WERROR *result)
3413 struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
3414 req, struct rpccli_wkssvc_NetrGetJoinableOus_state);
3415 NTSTATUS status;
3417 if (tevent_req_is_nterror(req, &status)) {
3418 tevent_req_received(req);
3419 return status;
3422 /* Steal possbile out parameters to the callers context */
3423 talloc_steal(mem_ctx, state->out_mem_ctx);
3425 /* Return result */
3426 *result = state->orig.out.result;
3428 tevent_req_received(req);
3429 return NT_STATUS_OK;
3432 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
3433 TALLOC_CTX *mem_ctx,
3434 const char *server_name /* [in] [unique,charset(UTF16)] */,
3435 const char *domain_name /* [in] [ref,charset(UTF16)] */,
3436 const char *Account /* [in] [unique,charset(UTF16)] */,
3437 const char *unknown /* [in] [unique,charset(UTF16)] */,
3438 uint32_t *num_ous /* [in,out] [ref] */,
3439 const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
3440 WERROR *werror)
3442 struct wkssvc_NetrGetJoinableOus r;
3443 NTSTATUS status;
3445 /* In parameters */
3446 r.in.server_name = server_name;
3447 r.in.domain_name = domain_name;
3448 r.in.Account = Account;
3449 r.in.unknown = unknown;
3450 r.in.num_ous = num_ous;
3452 status = cli->dispatch(cli,
3453 mem_ctx,
3454 &ndr_table_wkssvc,
3455 NDR_WKSSVC_NETRGETJOINABLEOUS,
3456 &r);
3458 if (!NT_STATUS_IS_OK(status)) {
3459 return status;
3462 if (NT_STATUS_IS_ERR(status)) {
3463 return status;
3466 /* Return variables */
3467 *num_ous = *r.out.num_ous;
3468 *ous = *r.out.ous;
3470 /* Return result */
3471 if (werror) {
3472 *werror = r.out.result;
3475 return werror_to_ntstatus(r.out.result);
3478 struct rpccli_wkssvc_NetrJoinDomain2_state {
3479 struct wkssvc_NetrJoinDomain2 orig;
3480 struct wkssvc_NetrJoinDomain2 tmp;
3481 TALLOC_CTX *out_mem_ctx;
3482 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3485 static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq);
3487 struct tevent_req *rpccli_wkssvc_NetrJoinDomain2_send(TALLOC_CTX *mem_ctx,
3488 struct tevent_context *ev,
3489 struct rpc_pipe_client *cli,
3490 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3491 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
3492 const char *_account_ou /* [in] [unique,charset(UTF16)] */,
3493 const char *_admin_account /* [in] [unique,charset(UTF16)] */,
3494 struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
3495 uint32_t _join_flags /* [in] */)
3497 struct tevent_req *req;
3498 struct rpccli_wkssvc_NetrJoinDomain2_state *state;
3499 struct tevent_req *subreq;
3501 req = tevent_req_create(mem_ctx, &state,
3502 struct rpccli_wkssvc_NetrJoinDomain2_state);
3503 if (req == NULL) {
3504 return NULL;
3506 state->out_mem_ctx = NULL;
3507 state->dispatch_recv = cli->dispatch_recv;
3509 /* In parameters */
3510 state->orig.in.server_name = _server_name;
3511 state->orig.in.domain_name = _domain_name;
3512 state->orig.in.account_ou = _account_ou;
3513 state->orig.in.admin_account = _admin_account;
3514 state->orig.in.encrypted_password = _encrypted_password;
3515 state->orig.in.join_flags = _join_flags;
3517 /* Out parameters */
3519 /* Result */
3520 ZERO_STRUCT(state->orig.out.result);
3522 /* make a temporary copy, that we pass to the dispatch function */
3523 state->tmp = state->orig;
3525 subreq = cli->dispatch_send(state, ev, cli,
3526 &ndr_table_wkssvc,
3527 NDR_WKSSVC_NETRJOINDOMAIN2,
3528 &state->tmp);
3529 if (tevent_req_nomem(subreq, req)) {
3530 return tevent_req_post(req, ev);
3532 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain2_done, req);
3533 return req;
3536 static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq)
3538 struct tevent_req *req = tevent_req_callback_data(
3539 subreq, struct tevent_req);
3540 struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
3541 req, struct rpccli_wkssvc_NetrJoinDomain2_state);
3542 NTSTATUS status;
3543 TALLOC_CTX *mem_ctx;
3545 if (state->out_mem_ctx) {
3546 mem_ctx = state->out_mem_ctx;
3547 } else {
3548 mem_ctx = state;
3551 status = state->dispatch_recv(subreq, mem_ctx);
3552 TALLOC_FREE(subreq);
3553 if (!NT_STATUS_IS_OK(status)) {
3554 tevent_req_nterror(req, status);
3555 return;
3558 /* Copy out parameters */
3560 /* Copy result */
3561 state->orig.out.result = state->tmp.out.result;
3563 /* Reset temporary structure */
3564 ZERO_STRUCT(state->tmp);
3566 tevent_req_done(req);
3569 NTSTATUS rpccli_wkssvc_NetrJoinDomain2_recv(struct tevent_req *req,
3570 TALLOC_CTX *mem_ctx,
3571 WERROR *result)
3573 struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
3574 req, struct rpccli_wkssvc_NetrJoinDomain2_state);
3575 NTSTATUS status;
3577 if (tevent_req_is_nterror(req, &status)) {
3578 tevent_req_received(req);
3579 return status;
3582 /* Steal possbile out parameters to the callers context */
3583 talloc_steal(mem_ctx, state->out_mem_ctx);
3585 /* Return result */
3586 *result = state->orig.out.result;
3588 tevent_req_received(req);
3589 return NT_STATUS_OK;
3592 NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
3593 TALLOC_CTX *mem_ctx,
3594 const char *server_name /* [in] [unique,charset(UTF16)] */,
3595 const char *domain_name /* [in] [ref,charset(UTF16)] */,
3596 const char *account_ou /* [in] [unique,charset(UTF16)] */,
3597 const char *admin_account /* [in] [unique,charset(UTF16)] */,
3598 struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
3599 uint32_t join_flags /* [in] */,
3600 WERROR *werror)
3602 struct wkssvc_NetrJoinDomain2 r;
3603 NTSTATUS status;
3605 /* In parameters */
3606 r.in.server_name = server_name;
3607 r.in.domain_name = domain_name;
3608 r.in.account_ou = account_ou;
3609 r.in.admin_account = admin_account;
3610 r.in.encrypted_password = encrypted_password;
3611 r.in.join_flags = join_flags;
3613 status = cli->dispatch(cli,
3614 mem_ctx,
3615 &ndr_table_wkssvc,
3616 NDR_WKSSVC_NETRJOINDOMAIN2,
3617 &r);
3619 if (!NT_STATUS_IS_OK(status)) {
3620 return status;
3623 if (NT_STATUS_IS_ERR(status)) {
3624 return status;
3627 /* Return variables */
3629 /* Return result */
3630 if (werror) {
3631 *werror = r.out.result;
3634 return werror_to_ntstatus(r.out.result);
3637 struct rpccli_wkssvc_NetrUnjoinDomain2_state {
3638 struct wkssvc_NetrUnjoinDomain2 orig;
3639 struct wkssvc_NetrUnjoinDomain2 tmp;
3640 TALLOC_CTX *out_mem_ctx;
3641 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3644 static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq);
3646 struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain2_send(TALLOC_CTX *mem_ctx,
3647 struct tevent_context *ev,
3648 struct rpc_pipe_client *cli,
3649 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3650 const char *_account /* [in] [unique,charset(UTF16)] */,
3651 struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
3652 uint32_t _unjoin_flags /* [in] */)
3654 struct tevent_req *req;
3655 struct rpccli_wkssvc_NetrUnjoinDomain2_state *state;
3656 struct tevent_req *subreq;
3658 req = tevent_req_create(mem_ctx, &state,
3659 struct rpccli_wkssvc_NetrUnjoinDomain2_state);
3660 if (req == NULL) {
3661 return NULL;
3663 state->out_mem_ctx = NULL;
3664 state->dispatch_recv = cli->dispatch_recv;
3666 /* In parameters */
3667 state->orig.in.server_name = _server_name;
3668 state->orig.in.account = _account;
3669 state->orig.in.encrypted_password = _encrypted_password;
3670 state->orig.in.unjoin_flags = _unjoin_flags;
3672 /* Out parameters */
3674 /* Result */
3675 ZERO_STRUCT(state->orig.out.result);
3677 /* make a temporary copy, that we pass to the dispatch function */
3678 state->tmp = state->orig;
3680 subreq = cli->dispatch_send(state, ev, cli,
3681 &ndr_table_wkssvc,
3682 NDR_WKSSVC_NETRUNJOINDOMAIN2,
3683 &state->tmp);
3684 if (tevent_req_nomem(subreq, req)) {
3685 return tevent_req_post(req, ev);
3687 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain2_done, req);
3688 return req;
3691 static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq)
3693 struct tevent_req *req = tevent_req_callback_data(
3694 subreq, struct tevent_req);
3695 struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
3696 req, struct rpccli_wkssvc_NetrUnjoinDomain2_state);
3697 NTSTATUS status;
3698 TALLOC_CTX *mem_ctx;
3700 if (state->out_mem_ctx) {
3701 mem_ctx = state->out_mem_ctx;
3702 } else {
3703 mem_ctx = state;
3706 status = state->dispatch_recv(subreq, mem_ctx);
3707 TALLOC_FREE(subreq);
3708 if (!NT_STATUS_IS_OK(status)) {
3709 tevent_req_nterror(req, status);
3710 return;
3713 /* Copy out parameters */
3715 /* Copy result */
3716 state->orig.out.result = state->tmp.out.result;
3718 /* Reset temporary structure */
3719 ZERO_STRUCT(state->tmp);
3721 tevent_req_done(req);
3724 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2_recv(struct tevent_req *req,
3725 TALLOC_CTX *mem_ctx,
3726 WERROR *result)
3728 struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
3729 req, struct rpccli_wkssvc_NetrUnjoinDomain2_state);
3730 NTSTATUS status;
3732 if (tevent_req_is_nterror(req, &status)) {
3733 tevent_req_received(req);
3734 return status;
3737 /* Steal possbile out parameters to the callers context */
3738 talloc_steal(mem_ctx, state->out_mem_ctx);
3740 /* Return result */
3741 *result = state->orig.out.result;
3743 tevent_req_received(req);
3744 return NT_STATUS_OK;
3747 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
3748 TALLOC_CTX *mem_ctx,
3749 const char *server_name /* [in] [unique,charset(UTF16)] */,
3750 const char *account /* [in] [unique,charset(UTF16)] */,
3751 struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
3752 uint32_t unjoin_flags /* [in] */,
3753 WERROR *werror)
3755 struct wkssvc_NetrUnjoinDomain2 r;
3756 NTSTATUS status;
3758 /* In parameters */
3759 r.in.server_name = server_name;
3760 r.in.account = account;
3761 r.in.encrypted_password = encrypted_password;
3762 r.in.unjoin_flags = unjoin_flags;
3764 status = cli->dispatch(cli,
3765 mem_ctx,
3766 &ndr_table_wkssvc,
3767 NDR_WKSSVC_NETRUNJOINDOMAIN2,
3768 &r);
3770 if (!NT_STATUS_IS_OK(status)) {
3771 return status;
3774 if (NT_STATUS_IS_ERR(status)) {
3775 return status;
3778 /* Return variables */
3780 /* Return result */
3781 if (werror) {
3782 *werror = r.out.result;
3785 return werror_to_ntstatus(r.out.result);
3788 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state {
3789 struct wkssvc_NetrRenameMachineInDomain2 orig;
3790 struct wkssvc_NetrRenameMachineInDomain2 tmp;
3791 TALLOC_CTX *out_mem_ctx;
3792 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3795 static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq);
3797 struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain2_send(TALLOC_CTX *mem_ctx,
3798 struct tevent_context *ev,
3799 struct rpc_pipe_client *cli,
3800 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3801 const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
3802 const char *_Account /* [in] [unique,charset(UTF16)] */,
3803 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
3804 uint32_t _RenameOptions /* [in] */)
3806 struct tevent_req *req;
3807 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state;
3808 struct tevent_req *subreq;
3810 req = tevent_req_create(mem_ctx, &state,
3811 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
3812 if (req == NULL) {
3813 return NULL;
3815 state->out_mem_ctx = NULL;
3816 state->dispatch_recv = cli->dispatch_recv;
3818 /* In parameters */
3819 state->orig.in.server_name = _server_name;
3820 state->orig.in.NewMachineName = _NewMachineName;
3821 state->orig.in.Account = _Account;
3822 state->orig.in.EncryptedPassword = _EncryptedPassword;
3823 state->orig.in.RenameOptions = _RenameOptions;
3825 /* Out parameters */
3827 /* Result */
3828 ZERO_STRUCT(state->orig.out.result);
3830 /* make a temporary copy, that we pass to the dispatch function */
3831 state->tmp = state->orig;
3833 subreq = cli->dispatch_send(state, ev, cli,
3834 &ndr_table_wkssvc,
3835 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
3836 &state->tmp);
3837 if (tevent_req_nomem(subreq, req)) {
3838 return tevent_req_post(req, ev);
3840 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain2_done, req);
3841 return req;
3844 static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq)
3846 struct tevent_req *req = tevent_req_callback_data(
3847 subreq, struct tevent_req);
3848 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
3849 req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
3850 NTSTATUS status;
3851 TALLOC_CTX *mem_ctx;
3853 if (state->out_mem_ctx) {
3854 mem_ctx = state->out_mem_ctx;
3855 } else {
3856 mem_ctx = state;
3859 status = state->dispatch_recv(subreq, mem_ctx);
3860 TALLOC_FREE(subreq);
3861 if (!NT_STATUS_IS_OK(status)) {
3862 tevent_req_nterror(req, status);
3863 return;
3866 /* Copy out parameters */
3868 /* Copy result */
3869 state->orig.out.result = state->tmp.out.result;
3871 /* Reset temporary structure */
3872 ZERO_STRUCT(state->tmp);
3874 tevent_req_done(req);
3877 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2_recv(struct tevent_req *req,
3878 TALLOC_CTX *mem_ctx,
3879 WERROR *result)
3881 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
3882 req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
3883 NTSTATUS status;
3885 if (tevent_req_is_nterror(req, &status)) {
3886 tevent_req_received(req);
3887 return status;
3890 /* Steal possbile out parameters to the callers context */
3891 talloc_steal(mem_ctx, state->out_mem_ctx);
3893 /* Return result */
3894 *result = state->orig.out.result;
3896 tevent_req_received(req);
3897 return NT_STATUS_OK;
3900 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
3901 TALLOC_CTX *mem_ctx,
3902 const char *server_name /* [in] [unique,charset(UTF16)] */,
3903 const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
3904 const char *Account /* [in] [unique,charset(UTF16)] */,
3905 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
3906 uint32_t RenameOptions /* [in] */,
3907 WERROR *werror)
3909 struct wkssvc_NetrRenameMachineInDomain2 r;
3910 NTSTATUS status;
3912 /* In parameters */
3913 r.in.server_name = server_name;
3914 r.in.NewMachineName = NewMachineName;
3915 r.in.Account = Account;
3916 r.in.EncryptedPassword = EncryptedPassword;
3917 r.in.RenameOptions = RenameOptions;
3919 status = cli->dispatch(cli,
3920 mem_ctx,
3921 &ndr_table_wkssvc,
3922 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
3923 &r);
3925 if (!NT_STATUS_IS_OK(status)) {
3926 return status;
3929 if (NT_STATUS_IS_ERR(status)) {
3930 return status;
3933 /* Return variables */
3935 /* Return result */
3936 if (werror) {
3937 *werror = r.out.result;
3940 return werror_to_ntstatus(r.out.result);
3943 struct rpccli_wkssvc_NetrValidateName2_state {
3944 struct wkssvc_NetrValidateName2 orig;
3945 struct wkssvc_NetrValidateName2 tmp;
3946 TALLOC_CTX *out_mem_ctx;
3947 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3950 static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq);
3952 struct tevent_req *rpccli_wkssvc_NetrValidateName2_send(TALLOC_CTX *mem_ctx,
3953 struct tevent_context *ev,
3954 struct rpc_pipe_client *cli,
3955 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3956 const char *_name /* [in] [ref,charset(UTF16)] */,
3957 const char *_Account /* [in] [unique,charset(UTF16)] */,
3958 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
3959 enum wkssvc_NetValidateNameType _name_type /* [in] */)
3961 struct tevent_req *req;
3962 struct rpccli_wkssvc_NetrValidateName2_state *state;
3963 struct tevent_req *subreq;
3965 req = tevent_req_create(mem_ctx, &state,
3966 struct rpccli_wkssvc_NetrValidateName2_state);
3967 if (req == NULL) {
3968 return NULL;
3970 state->out_mem_ctx = NULL;
3971 state->dispatch_recv = cli->dispatch_recv;
3973 /* In parameters */
3974 state->orig.in.server_name = _server_name;
3975 state->orig.in.name = _name;
3976 state->orig.in.Account = _Account;
3977 state->orig.in.EncryptedPassword = _EncryptedPassword;
3978 state->orig.in.name_type = _name_type;
3980 /* Out parameters */
3982 /* Result */
3983 ZERO_STRUCT(state->orig.out.result);
3985 /* make a temporary copy, that we pass to the dispatch function */
3986 state->tmp = state->orig;
3988 subreq = cli->dispatch_send(state, ev, cli,
3989 &ndr_table_wkssvc,
3990 NDR_WKSSVC_NETRVALIDATENAME2,
3991 &state->tmp);
3992 if (tevent_req_nomem(subreq, req)) {
3993 return tevent_req_post(req, ev);
3995 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName2_done, req);
3996 return req;
3999 static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq)
4001 struct tevent_req *req = tevent_req_callback_data(
4002 subreq, struct tevent_req);
4003 struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
4004 req, struct rpccli_wkssvc_NetrValidateName2_state);
4005 NTSTATUS status;
4006 TALLOC_CTX *mem_ctx;
4008 if (state->out_mem_ctx) {
4009 mem_ctx = state->out_mem_ctx;
4010 } else {
4011 mem_ctx = state;
4014 status = state->dispatch_recv(subreq, mem_ctx);
4015 TALLOC_FREE(subreq);
4016 if (!NT_STATUS_IS_OK(status)) {
4017 tevent_req_nterror(req, status);
4018 return;
4021 /* Copy out parameters */
4023 /* Copy result */
4024 state->orig.out.result = state->tmp.out.result;
4026 /* Reset temporary structure */
4027 ZERO_STRUCT(state->tmp);
4029 tevent_req_done(req);
4032 NTSTATUS rpccli_wkssvc_NetrValidateName2_recv(struct tevent_req *req,
4033 TALLOC_CTX *mem_ctx,
4034 WERROR *result)
4036 struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
4037 req, struct rpccli_wkssvc_NetrValidateName2_state);
4038 NTSTATUS status;
4040 if (tevent_req_is_nterror(req, &status)) {
4041 tevent_req_received(req);
4042 return status;
4045 /* Steal possbile out parameters to the callers context */
4046 talloc_steal(mem_ctx, state->out_mem_ctx);
4048 /* Return result */
4049 *result = state->orig.out.result;
4051 tevent_req_received(req);
4052 return NT_STATUS_OK;
4055 NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
4056 TALLOC_CTX *mem_ctx,
4057 const char *server_name /* [in] [unique,charset(UTF16)] */,
4058 const char *name /* [in] [ref,charset(UTF16)] */,
4059 const char *Account /* [in] [unique,charset(UTF16)] */,
4060 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4061 enum wkssvc_NetValidateNameType name_type /* [in] */,
4062 WERROR *werror)
4064 struct wkssvc_NetrValidateName2 r;
4065 NTSTATUS status;
4067 /* In parameters */
4068 r.in.server_name = server_name;
4069 r.in.name = name;
4070 r.in.Account = Account;
4071 r.in.EncryptedPassword = EncryptedPassword;
4072 r.in.name_type = name_type;
4074 status = cli->dispatch(cli,
4075 mem_ctx,
4076 &ndr_table_wkssvc,
4077 NDR_WKSSVC_NETRVALIDATENAME2,
4078 &r);
4080 if (!NT_STATUS_IS_OK(status)) {
4081 return status;
4084 if (NT_STATUS_IS_ERR(status)) {
4085 return status;
4088 /* Return variables */
4090 /* Return result */
4091 if (werror) {
4092 *werror = r.out.result;
4095 return werror_to_ntstatus(r.out.result);
4098 struct rpccli_wkssvc_NetrGetJoinableOus2_state {
4099 struct wkssvc_NetrGetJoinableOus2 orig;
4100 struct wkssvc_NetrGetJoinableOus2 tmp;
4101 TALLOC_CTX *out_mem_ctx;
4102 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4105 static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq);
4107 struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus2_send(TALLOC_CTX *mem_ctx,
4108 struct tevent_context *ev,
4109 struct rpc_pipe_client *cli,
4110 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4111 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
4112 const char *_Account /* [in] [unique,charset(UTF16)] */,
4113 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4114 uint32_t *_num_ous /* [in,out] [ref] */,
4115 const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
4117 struct tevent_req *req;
4118 struct rpccli_wkssvc_NetrGetJoinableOus2_state *state;
4119 struct tevent_req *subreq;
4121 req = tevent_req_create(mem_ctx, &state,
4122 struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4123 if (req == NULL) {
4124 return NULL;
4126 state->out_mem_ctx = NULL;
4127 state->dispatch_recv = cli->dispatch_recv;
4129 /* In parameters */
4130 state->orig.in.server_name = _server_name;
4131 state->orig.in.domain_name = _domain_name;
4132 state->orig.in.Account = _Account;
4133 state->orig.in.EncryptedPassword = _EncryptedPassword;
4134 state->orig.in.num_ous = _num_ous;
4136 /* Out parameters */
4137 state->orig.out.num_ous = _num_ous;
4138 state->orig.out.ous = _ous;
4140 /* Result */
4141 ZERO_STRUCT(state->orig.out.result);
4143 state->out_mem_ctx = talloc_named_const(state, 0,
4144 "rpccli_wkssvc_NetrGetJoinableOus2_out_memory");
4145 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4146 return tevent_req_post(req, ev);
4149 /* make a temporary copy, that we pass to the dispatch function */
4150 state->tmp = state->orig;
4152 subreq = cli->dispatch_send(state, ev, cli,
4153 &ndr_table_wkssvc,
4154 NDR_WKSSVC_NETRGETJOINABLEOUS2,
4155 &state->tmp);
4156 if (tevent_req_nomem(subreq, req)) {
4157 return tevent_req_post(req, ev);
4159 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus2_done, req);
4160 return req;
4163 static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq)
4165 struct tevent_req *req = tevent_req_callback_data(
4166 subreq, struct tevent_req);
4167 struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
4168 req, struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4169 NTSTATUS status;
4170 TALLOC_CTX *mem_ctx;
4172 if (state->out_mem_ctx) {
4173 mem_ctx = state->out_mem_ctx;
4174 } else {
4175 mem_ctx = state;
4178 status = state->dispatch_recv(subreq, mem_ctx);
4179 TALLOC_FREE(subreq);
4180 if (!NT_STATUS_IS_OK(status)) {
4181 tevent_req_nterror(req, status);
4182 return;
4185 /* Copy out parameters */
4186 *state->orig.out.num_ous = *state->tmp.out.num_ous;
4187 *state->orig.out.ous = *state->tmp.out.ous;
4189 /* Copy result */
4190 state->orig.out.result = state->tmp.out.result;
4192 /* Reset temporary structure */
4193 ZERO_STRUCT(state->tmp);
4195 tevent_req_done(req);
4198 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2_recv(struct tevent_req *req,
4199 TALLOC_CTX *mem_ctx,
4200 WERROR *result)
4202 struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
4203 req, struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4204 NTSTATUS status;
4206 if (tevent_req_is_nterror(req, &status)) {
4207 tevent_req_received(req);
4208 return status;
4211 /* Steal possbile out parameters to the callers context */
4212 talloc_steal(mem_ctx, state->out_mem_ctx);
4214 /* Return result */
4215 *result = state->orig.out.result;
4217 tevent_req_received(req);
4218 return NT_STATUS_OK;
4221 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
4222 TALLOC_CTX *mem_ctx,
4223 const char *server_name /* [in] [unique,charset(UTF16)] */,
4224 const char *domain_name /* [in] [ref,charset(UTF16)] */,
4225 const char *Account /* [in] [unique,charset(UTF16)] */,
4226 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4227 uint32_t *num_ous /* [in,out] [ref] */,
4228 const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
4229 WERROR *werror)
4231 struct wkssvc_NetrGetJoinableOus2 r;
4232 NTSTATUS status;
4234 /* In parameters */
4235 r.in.server_name = server_name;
4236 r.in.domain_name = domain_name;
4237 r.in.Account = Account;
4238 r.in.EncryptedPassword = EncryptedPassword;
4239 r.in.num_ous = num_ous;
4241 status = cli->dispatch(cli,
4242 mem_ctx,
4243 &ndr_table_wkssvc,
4244 NDR_WKSSVC_NETRGETJOINABLEOUS2,
4245 &r);
4247 if (!NT_STATUS_IS_OK(status)) {
4248 return status;
4251 if (NT_STATUS_IS_ERR(status)) {
4252 return status;
4255 /* Return variables */
4256 *num_ous = *r.out.num_ous;
4257 *ous = *r.out.ous;
4259 /* Return result */
4260 if (werror) {
4261 *werror = r.out.result;
4264 return werror_to_ntstatus(r.out.result);
4267 struct rpccli_wkssvc_NetrAddAlternateComputerName_state {
4268 struct wkssvc_NetrAddAlternateComputerName orig;
4269 struct wkssvc_NetrAddAlternateComputerName tmp;
4270 TALLOC_CTX *out_mem_ctx;
4271 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4274 static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq);
4276 struct tevent_req *rpccli_wkssvc_NetrAddAlternateComputerName_send(TALLOC_CTX *mem_ctx,
4277 struct tevent_context *ev,
4278 struct rpc_pipe_client *cli,
4279 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4280 const char *_NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
4281 const char *_Account /* [in] [unique,charset(UTF16)] */,
4282 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4283 uint32_t _Reserved /* [in] */)
4285 struct tevent_req *req;
4286 struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state;
4287 struct tevent_req *subreq;
4289 req = tevent_req_create(mem_ctx, &state,
4290 struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4291 if (req == NULL) {
4292 return NULL;
4294 state->out_mem_ctx = NULL;
4295 state->dispatch_recv = cli->dispatch_recv;
4297 /* In parameters */
4298 state->orig.in.server_name = _server_name;
4299 state->orig.in.NewAlternateMachineName = _NewAlternateMachineName;
4300 state->orig.in.Account = _Account;
4301 state->orig.in.EncryptedPassword = _EncryptedPassword;
4302 state->orig.in.Reserved = _Reserved;
4304 /* Out parameters */
4306 /* Result */
4307 ZERO_STRUCT(state->orig.out.result);
4309 /* make a temporary copy, that we pass to the dispatch function */
4310 state->tmp = state->orig;
4312 subreq = cli->dispatch_send(state, ev, cli,
4313 &ndr_table_wkssvc,
4314 NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
4315 &state->tmp);
4316 if (tevent_req_nomem(subreq, req)) {
4317 return tevent_req_post(req, ev);
4319 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrAddAlternateComputerName_done, req);
4320 return req;
4323 static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq)
4325 struct tevent_req *req = tevent_req_callback_data(
4326 subreq, struct tevent_req);
4327 struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
4328 req, struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4329 NTSTATUS status;
4330 TALLOC_CTX *mem_ctx;
4332 if (state->out_mem_ctx) {
4333 mem_ctx = state->out_mem_ctx;
4334 } else {
4335 mem_ctx = state;
4338 status = state->dispatch_recv(subreq, mem_ctx);
4339 TALLOC_FREE(subreq);
4340 if (!NT_STATUS_IS_OK(status)) {
4341 tevent_req_nterror(req, status);
4342 return;
4345 /* Copy out parameters */
4347 /* Copy result */
4348 state->orig.out.result = state->tmp.out.result;
4350 /* Reset temporary structure */
4351 ZERO_STRUCT(state->tmp);
4353 tevent_req_done(req);
4356 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName_recv(struct tevent_req *req,
4357 TALLOC_CTX *mem_ctx,
4358 WERROR *result)
4360 struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
4361 req, struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4362 NTSTATUS status;
4364 if (tevent_req_is_nterror(req, &status)) {
4365 tevent_req_received(req);
4366 return status;
4369 /* Steal possbile out parameters to the callers context */
4370 talloc_steal(mem_ctx, state->out_mem_ctx);
4372 /* Return result */
4373 *result = state->orig.out.result;
4375 tevent_req_received(req);
4376 return NT_STATUS_OK;
4379 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
4380 TALLOC_CTX *mem_ctx,
4381 const char *server_name /* [in] [unique,charset(UTF16)] */,
4382 const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
4383 const char *Account /* [in] [unique,charset(UTF16)] */,
4384 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4385 uint32_t Reserved /* [in] */,
4386 WERROR *werror)
4388 struct wkssvc_NetrAddAlternateComputerName r;
4389 NTSTATUS status;
4391 /* In parameters */
4392 r.in.server_name = server_name;
4393 r.in.NewAlternateMachineName = NewAlternateMachineName;
4394 r.in.Account = Account;
4395 r.in.EncryptedPassword = EncryptedPassword;
4396 r.in.Reserved = Reserved;
4398 status = cli->dispatch(cli,
4399 mem_ctx,
4400 &ndr_table_wkssvc,
4401 NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
4402 &r);
4404 if (!NT_STATUS_IS_OK(status)) {
4405 return status;
4408 if (NT_STATUS_IS_ERR(status)) {
4409 return status;
4412 /* Return variables */
4414 /* Return result */
4415 if (werror) {
4416 *werror = r.out.result;
4419 return werror_to_ntstatus(r.out.result);
4422 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state {
4423 struct wkssvc_NetrRemoveAlternateComputerName orig;
4424 struct wkssvc_NetrRemoveAlternateComputerName tmp;
4425 TALLOC_CTX *out_mem_ctx;
4426 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4429 static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq);
4431 struct tevent_req *rpccli_wkssvc_NetrRemoveAlternateComputerName_send(TALLOC_CTX *mem_ctx,
4432 struct tevent_context *ev,
4433 struct rpc_pipe_client *cli,
4434 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4435 const char *_AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
4436 const char *_Account /* [in] [unique,charset(UTF16)] */,
4437 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4438 uint32_t _Reserved /* [in] */)
4440 struct tevent_req *req;
4441 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state;
4442 struct tevent_req *subreq;
4444 req = tevent_req_create(mem_ctx, &state,
4445 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4446 if (req == NULL) {
4447 return NULL;
4449 state->out_mem_ctx = NULL;
4450 state->dispatch_recv = cli->dispatch_recv;
4452 /* In parameters */
4453 state->orig.in.server_name = _server_name;
4454 state->orig.in.AlternateMachineNameToRemove = _AlternateMachineNameToRemove;
4455 state->orig.in.Account = _Account;
4456 state->orig.in.EncryptedPassword = _EncryptedPassword;
4457 state->orig.in.Reserved = _Reserved;
4459 /* Out parameters */
4461 /* Result */
4462 ZERO_STRUCT(state->orig.out.result);
4464 /* make a temporary copy, that we pass to the dispatch function */
4465 state->tmp = state->orig;
4467 subreq = cli->dispatch_send(state, ev, cli,
4468 &ndr_table_wkssvc,
4469 NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
4470 &state->tmp);
4471 if (tevent_req_nomem(subreq, req)) {
4472 return tevent_req_post(req, ev);
4474 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRemoveAlternateComputerName_done, req);
4475 return req;
4478 static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq)
4480 struct tevent_req *req = tevent_req_callback_data(
4481 subreq, struct tevent_req);
4482 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
4483 req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4484 NTSTATUS status;
4485 TALLOC_CTX *mem_ctx;
4487 if (state->out_mem_ctx) {
4488 mem_ctx = state->out_mem_ctx;
4489 } else {
4490 mem_ctx = state;
4493 status = state->dispatch_recv(subreq, mem_ctx);
4494 TALLOC_FREE(subreq);
4495 if (!NT_STATUS_IS_OK(status)) {
4496 tevent_req_nterror(req, status);
4497 return;
4500 /* Copy out parameters */
4502 /* Copy result */
4503 state->orig.out.result = state->tmp.out.result;
4505 /* Reset temporary structure */
4506 ZERO_STRUCT(state->tmp);
4508 tevent_req_done(req);
4511 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName_recv(struct tevent_req *req,
4512 TALLOC_CTX *mem_ctx,
4513 WERROR *result)
4515 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
4516 req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4517 NTSTATUS status;
4519 if (tevent_req_is_nterror(req, &status)) {
4520 tevent_req_received(req);
4521 return status;
4524 /* Steal possbile out parameters to the callers context */
4525 talloc_steal(mem_ctx, state->out_mem_ctx);
4527 /* Return result */
4528 *result = state->orig.out.result;
4530 tevent_req_received(req);
4531 return NT_STATUS_OK;
4534 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli,
4535 TALLOC_CTX *mem_ctx,
4536 const char *server_name /* [in] [unique,charset(UTF16)] */,
4537 const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
4538 const char *Account /* [in] [unique,charset(UTF16)] */,
4539 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4540 uint32_t Reserved /* [in] */,
4541 WERROR *werror)
4543 struct wkssvc_NetrRemoveAlternateComputerName r;
4544 NTSTATUS status;
4546 /* In parameters */
4547 r.in.server_name = server_name;
4548 r.in.AlternateMachineNameToRemove = AlternateMachineNameToRemove;
4549 r.in.Account = Account;
4550 r.in.EncryptedPassword = EncryptedPassword;
4551 r.in.Reserved = Reserved;
4553 status = cli->dispatch(cli,
4554 mem_ctx,
4555 &ndr_table_wkssvc,
4556 NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
4557 &r);
4559 if (!NT_STATUS_IS_OK(status)) {
4560 return status;
4563 if (NT_STATUS_IS_ERR(status)) {
4564 return status;
4567 /* Return variables */
4569 /* Return result */
4570 if (werror) {
4571 *werror = r.out.result;
4574 return werror_to_ntstatus(r.out.result);
4577 struct rpccli_wkssvc_NetrSetPrimaryComputername_state {
4578 struct wkssvc_NetrSetPrimaryComputername orig;
4579 struct wkssvc_NetrSetPrimaryComputername tmp;
4580 TALLOC_CTX *out_mem_ctx;
4581 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4584 static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq);
4586 struct tevent_req *rpccli_wkssvc_NetrSetPrimaryComputername_send(TALLOC_CTX *mem_ctx,
4587 struct tevent_context *ev,
4588 struct rpc_pipe_client *cli,
4589 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4590 const char *_primary_name /* [in] [unique,charset(UTF16)] */,
4591 const char *_Account /* [in] [unique,charset(UTF16)] */,
4592 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4593 uint32_t _Reserved /* [in] */)
4595 struct tevent_req *req;
4596 struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state;
4597 struct tevent_req *subreq;
4599 req = tevent_req_create(mem_ctx, &state,
4600 struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
4601 if (req == NULL) {
4602 return NULL;
4604 state->out_mem_ctx = NULL;
4605 state->dispatch_recv = cli->dispatch_recv;
4607 /* In parameters */
4608 state->orig.in.server_name = _server_name;
4609 state->orig.in.primary_name = _primary_name;
4610 state->orig.in.Account = _Account;
4611 state->orig.in.EncryptedPassword = _EncryptedPassword;
4612 state->orig.in.Reserved = _Reserved;
4614 /* Out parameters */
4616 /* Result */
4617 ZERO_STRUCT(state->orig.out.result);
4619 /* make a temporary copy, that we pass to the dispatch function */
4620 state->tmp = state->orig;
4622 subreq = cli->dispatch_send(state, ev, cli,
4623 &ndr_table_wkssvc,
4624 NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
4625 &state->tmp);
4626 if (tevent_req_nomem(subreq, req)) {
4627 return tevent_req_post(req, ev);
4629 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrSetPrimaryComputername_done, req);
4630 return req;
4633 static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq)
4635 struct tevent_req *req = tevent_req_callback_data(
4636 subreq, struct tevent_req);
4637 struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
4638 req, struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
4639 NTSTATUS status;
4640 TALLOC_CTX *mem_ctx;
4642 if (state->out_mem_ctx) {
4643 mem_ctx = state->out_mem_ctx;
4644 } else {
4645 mem_ctx = state;
4648 status = state->dispatch_recv(subreq, mem_ctx);
4649 TALLOC_FREE(subreq);
4650 if (!NT_STATUS_IS_OK(status)) {
4651 tevent_req_nterror(req, status);
4652 return;
4655 /* Copy out parameters */
4657 /* Copy result */
4658 state->orig.out.result = state->tmp.out.result;
4660 /* Reset temporary structure */
4661 ZERO_STRUCT(state->tmp);
4663 tevent_req_done(req);
4666 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername_recv(struct tevent_req *req,
4667 TALLOC_CTX *mem_ctx,
4668 WERROR *result)
4670 struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
4671 req, struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
4672 NTSTATUS status;
4674 if (tevent_req_is_nterror(req, &status)) {
4675 tevent_req_received(req);
4676 return status;
4679 /* Steal possbile out parameters to the callers context */
4680 talloc_steal(mem_ctx, state->out_mem_ctx);
4682 /* Return result */
4683 *result = state->orig.out.result;
4685 tevent_req_received(req);
4686 return NT_STATUS_OK;
4689 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
4690 TALLOC_CTX *mem_ctx,
4691 const char *server_name /* [in] [unique,charset(UTF16)] */,
4692 const char *primary_name /* [in] [unique,charset(UTF16)] */,
4693 const char *Account /* [in] [unique,charset(UTF16)] */,
4694 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4695 uint32_t Reserved /* [in] */,
4696 WERROR *werror)
4698 struct wkssvc_NetrSetPrimaryComputername r;
4699 NTSTATUS status;
4701 /* In parameters */
4702 r.in.server_name = server_name;
4703 r.in.primary_name = primary_name;
4704 r.in.Account = Account;
4705 r.in.EncryptedPassword = EncryptedPassword;
4706 r.in.Reserved = Reserved;
4708 status = cli->dispatch(cli,
4709 mem_ctx,
4710 &ndr_table_wkssvc,
4711 NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
4712 &r);
4714 if (!NT_STATUS_IS_OK(status)) {
4715 return status;
4718 if (NT_STATUS_IS_ERR(status)) {
4719 return status;
4722 /* Return variables */
4724 /* Return result */
4725 if (werror) {
4726 *werror = r.out.result;
4729 return werror_to_ntstatus(r.out.result);
4732 struct rpccli_wkssvc_NetrEnumerateComputerNames_state {
4733 struct wkssvc_NetrEnumerateComputerNames orig;
4734 struct wkssvc_NetrEnumerateComputerNames tmp;
4735 TALLOC_CTX *out_mem_ctx;
4736 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4739 static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq);
4741 struct tevent_req *rpccli_wkssvc_NetrEnumerateComputerNames_send(TALLOC_CTX *mem_ctx,
4742 struct tevent_context *ev,
4743 struct rpc_pipe_client *cli,
4744 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4745 enum wkssvc_ComputerNameType _name_type /* [in] */,
4746 uint32_t _Reserved /* [in] */,
4747 struct wkssvc_ComputerNamesCtr **_ctr /* [out] [ref] */)
4749 struct tevent_req *req;
4750 struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state;
4751 struct tevent_req *subreq;
4753 req = tevent_req_create(mem_ctx, &state,
4754 struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
4755 if (req == NULL) {
4756 return NULL;
4758 state->out_mem_ctx = NULL;
4759 state->dispatch_recv = cli->dispatch_recv;
4761 /* In parameters */
4762 state->orig.in.server_name = _server_name;
4763 state->orig.in.name_type = _name_type;
4764 state->orig.in.Reserved = _Reserved;
4766 /* Out parameters */
4767 state->orig.out.ctr = _ctr;
4769 /* Result */
4770 ZERO_STRUCT(state->orig.out.result);
4772 state->out_mem_ctx = talloc_named_const(state, 0,
4773 "rpccli_wkssvc_NetrEnumerateComputerNames_out_memory");
4774 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4775 return tevent_req_post(req, ev);
4778 /* make a temporary copy, that we pass to the dispatch function */
4779 state->tmp = state->orig;
4781 subreq = cli->dispatch_send(state, ev, cli,
4782 &ndr_table_wkssvc,
4783 NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
4784 &state->tmp);
4785 if (tevent_req_nomem(subreq, req)) {
4786 return tevent_req_post(req, ev);
4788 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrEnumerateComputerNames_done, req);
4789 return req;
4792 static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq)
4794 struct tevent_req *req = tevent_req_callback_data(
4795 subreq, struct tevent_req);
4796 struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
4797 req, struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
4798 NTSTATUS status;
4799 TALLOC_CTX *mem_ctx;
4801 if (state->out_mem_ctx) {
4802 mem_ctx = state->out_mem_ctx;
4803 } else {
4804 mem_ctx = state;
4807 status = state->dispatch_recv(subreq, mem_ctx);
4808 TALLOC_FREE(subreq);
4809 if (!NT_STATUS_IS_OK(status)) {
4810 tevent_req_nterror(req, status);
4811 return;
4814 /* Copy out parameters */
4815 *state->orig.out.ctr = *state->tmp.out.ctr;
4817 /* Copy result */
4818 state->orig.out.result = state->tmp.out.result;
4820 /* Reset temporary structure */
4821 ZERO_STRUCT(state->tmp);
4823 tevent_req_done(req);
4826 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames_recv(struct tevent_req *req,
4827 TALLOC_CTX *mem_ctx,
4828 WERROR *result)
4830 struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
4831 req, struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
4832 NTSTATUS status;
4834 if (tevent_req_is_nterror(req, &status)) {
4835 tevent_req_received(req);
4836 return status;
4839 /* Steal possbile out parameters to the callers context */
4840 talloc_steal(mem_ctx, state->out_mem_ctx);
4842 /* Return result */
4843 *result = state->orig.out.result;
4845 tevent_req_received(req);
4846 return NT_STATUS_OK;
4849 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli,
4850 TALLOC_CTX *mem_ctx,
4851 const char *server_name /* [in] [unique,charset(UTF16)] */,
4852 enum wkssvc_ComputerNameType name_type /* [in] */,
4853 uint32_t Reserved /* [in] */,
4854 struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */,
4855 WERROR *werror)
4857 struct wkssvc_NetrEnumerateComputerNames r;
4858 NTSTATUS status;
4860 /* In parameters */
4861 r.in.server_name = server_name;
4862 r.in.name_type = name_type;
4863 r.in.Reserved = Reserved;
4865 status = cli->dispatch(cli,
4866 mem_ctx,
4867 &ndr_table_wkssvc,
4868 NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
4869 &r);
4871 if (!NT_STATUS_IS_OK(status)) {
4872 return status;
4875 if (NT_STATUS_IS_ERR(status)) {
4876 return status;
4879 /* Return variables */
4880 *ctr = *r.out.ctr;
4882 /* Return result */
4883 if (werror) {
4884 *werror = r.out.result;
4887 return werror_to_ntstatus(r.out.result);