Merge branch 'master' of /home/tridge/samba/git/combined
[Samba/aatanasov.git] / librpc / gen_ndr / cli_wkssvc.c
blobf40238af54639586af2db9e66215001f42ac55b2
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 if (DEBUGLEVEL >= 10) {
48 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &state->orig);
51 state->out_mem_ctx = talloc_named_const(state, 0,
52 "rpccli_wkssvc_NetWkstaGetInfo_out_memory");
53 if (tevent_req_nomem(state->out_mem_ctx, req)) {
54 return tevent_req_post(req, ev);
57 /* make a temporary copy, that we pass to the dispatch function */
58 state->tmp = state->orig;
60 subreq = cli->dispatch_send(state, ev, cli,
61 &ndr_table_wkssvc,
62 NDR_WKSSVC_NETWKSTAGETINFO,
63 &state->tmp);
64 if (tevent_req_nomem(subreq, req)) {
65 return tevent_req_post(req, ev);
67 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaGetInfo_done, req);
68 return req;
71 static void rpccli_wkssvc_NetWkstaGetInfo_done(struct tevent_req *subreq)
73 struct tevent_req *req = tevent_req_callback_data(
74 subreq, struct tevent_req);
75 struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
76 req, struct rpccli_wkssvc_NetWkstaGetInfo_state);
77 NTSTATUS status;
78 TALLOC_CTX *mem_ctx;
80 if (state->out_mem_ctx) {
81 mem_ctx = state->out_mem_ctx;
82 } else {
83 mem_ctx = state;
86 status = state->dispatch_recv(subreq, mem_ctx);
87 TALLOC_FREE(subreq);
88 if (!NT_STATUS_IS_OK(status)) {
89 tevent_req_nterror(req, status);
90 return;
93 /* Copy out parameters */
94 *state->orig.out.info = *state->tmp.out.info;
96 /* Copy result */
97 state->orig.out.result = state->tmp.out.result;
99 /* Reset temporary structure */
100 ZERO_STRUCT(state->tmp);
102 if (DEBUGLEVEL >= 10) {
103 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &state->orig);
106 tevent_req_done(req);
109 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo_recv(struct tevent_req *req,
110 TALLOC_CTX *mem_ctx,
111 WERROR *result)
113 struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
114 req, struct rpccli_wkssvc_NetWkstaGetInfo_state);
115 NTSTATUS status;
117 if (tevent_req_is_nterror(req, &status)) {
118 tevent_req_received(req);
119 return status;
122 /* Steal possbile out parameters to the callers context */
123 talloc_steal(mem_ctx, state->out_mem_ctx);
125 /* Return result */
126 *result = state->orig.out.result;
128 tevent_req_received(req);
129 return NT_STATUS_OK;
132 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli,
133 TALLOC_CTX *mem_ctx,
134 const char *server_name /* [in] [unique,charset(UTF16)] */,
135 uint32_t level /* [in] */,
136 union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */,
137 WERROR *werror)
139 struct wkssvc_NetWkstaGetInfo r;
140 NTSTATUS status;
142 /* In parameters */
143 r.in.server_name = server_name;
144 r.in.level = level;
146 if (DEBUGLEVEL >= 10) {
147 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &r);
150 status = cli->dispatch(cli,
151 mem_ctx,
152 &ndr_table_wkssvc,
153 NDR_WKSSVC_NETWKSTAGETINFO,
154 &r);
156 if (!NT_STATUS_IS_OK(status)) {
157 return status;
160 if (DEBUGLEVEL >= 10) {
161 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &r);
164 if (NT_STATUS_IS_ERR(status)) {
165 return status;
168 /* Return variables */
169 *info = *r.out.info;
171 /* Return result */
172 if (werror) {
173 *werror = r.out.result;
176 return werror_to_ntstatus(r.out.result);
179 struct rpccli_wkssvc_NetWkstaSetInfo_state {
180 struct wkssvc_NetWkstaSetInfo orig;
181 struct wkssvc_NetWkstaSetInfo tmp;
182 TALLOC_CTX *out_mem_ctx;
183 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
186 static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq);
188 struct tevent_req *rpccli_wkssvc_NetWkstaSetInfo_send(TALLOC_CTX *mem_ctx,
189 struct tevent_context *ev,
190 struct rpc_pipe_client *cli,
191 const char *_server_name /* [in] [unique,charset(UTF16)] */,
192 uint32_t _level /* [in] */,
193 union wkssvc_NetWkstaInfo *_info /* [in] [ref,switch_is(level)] */,
194 uint32_t *_parm_error /* [in,out] [ref] */)
196 struct tevent_req *req;
197 struct rpccli_wkssvc_NetWkstaSetInfo_state *state;
198 struct tevent_req *subreq;
200 req = tevent_req_create(mem_ctx, &state,
201 struct rpccli_wkssvc_NetWkstaSetInfo_state);
202 if (req == NULL) {
203 return NULL;
205 state->out_mem_ctx = NULL;
206 state->dispatch_recv = cli->dispatch_recv;
208 /* In parameters */
209 state->orig.in.server_name = _server_name;
210 state->orig.in.level = _level;
211 state->orig.in.info = _info;
212 state->orig.in.parm_error = _parm_error;
214 /* Out parameters */
215 state->orig.out.parm_error = _parm_error;
217 /* Result */
218 ZERO_STRUCT(state->orig.out.result);
220 if (DEBUGLEVEL >= 10) {
221 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &state->orig);
224 state->out_mem_ctx = talloc_named_const(state, 0,
225 "rpccli_wkssvc_NetWkstaSetInfo_out_memory");
226 if (tevent_req_nomem(state->out_mem_ctx, req)) {
227 return tevent_req_post(req, ev);
230 /* make a temporary copy, that we pass to the dispatch function */
231 state->tmp = state->orig;
233 subreq = cli->dispatch_send(state, ev, cli,
234 &ndr_table_wkssvc,
235 NDR_WKSSVC_NETWKSTASETINFO,
236 &state->tmp);
237 if (tevent_req_nomem(subreq, req)) {
238 return tevent_req_post(req, ev);
240 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaSetInfo_done, req);
241 return req;
244 static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq)
246 struct tevent_req *req = tevent_req_callback_data(
247 subreq, struct tevent_req);
248 struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
249 req, struct rpccli_wkssvc_NetWkstaSetInfo_state);
250 NTSTATUS status;
251 TALLOC_CTX *mem_ctx;
253 if (state->out_mem_ctx) {
254 mem_ctx = state->out_mem_ctx;
255 } else {
256 mem_ctx = state;
259 status = state->dispatch_recv(subreq, mem_ctx);
260 TALLOC_FREE(subreq);
261 if (!NT_STATUS_IS_OK(status)) {
262 tevent_req_nterror(req, status);
263 return;
266 /* Copy out parameters */
267 *state->orig.out.parm_error = *state->tmp.out.parm_error;
269 /* Copy result */
270 state->orig.out.result = state->tmp.out.result;
272 /* Reset temporary structure */
273 ZERO_STRUCT(state->tmp);
275 if (DEBUGLEVEL >= 10) {
276 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &state->orig);
279 tevent_req_done(req);
282 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo_recv(struct tevent_req *req,
283 TALLOC_CTX *mem_ctx,
284 WERROR *result)
286 struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
287 req, struct rpccli_wkssvc_NetWkstaSetInfo_state);
288 NTSTATUS status;
290 if (tevent_req_is_nterror(req, &status)) {
291 tevent_req_received(req);
292 return status;
295 /* Steal possbile out parameters to the callers context */
296 talloc_steal(mem_ctx, state->out_mem_ctx);
298 /* Return result */
299 *result = state->orig.out.result;
301 tevent_req_received(req);
302 return NT_STATUS_OK;
305 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
306 TALLOC_CTX *mem_ctx,
307 const char *server_name /* [in] [unique,charset(UTF16)] */,
308 uint32_t level /* [in] */,
309 union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */,
310 uint32_t *parm_error /* [in,out] [ref] */,
311 WERROR *werror)
313 struct wkssvc_NetWkstaSetInfo r;
314 NTSTATUS status;
316 /* In parameters */
317 r.in.server_name = server_name;
318 r.in.level = level;
319 r.in.info = info;
320 r.in.parm_error = parm_error;
322 if (DEBUGLEVEL >= 10) {
323 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &r);
326 status = cli->dispatch(cli,
327 mem_ctx,
328 &ndr_table_wkssvc,
329 NDR_WKSSVC_NETWKSTASETINFO,
330 &r);
332 if (!NT_STATUS_IS_OK(status)) {
333 return status;
336 if (DEBUGLEVEL >= 10) {
337 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &r);
340 if (NT_STATUS_IS_ERR(status)) {
341 return status;
344 /* Return variables */
345 *parm_error = *r.out.parm_error;
347 /* Return result */
348 if (werror) {
349 *werror = r.out.result;
352 return werror_to_ntstatus(r.out.result);
355 struct rpccli_wkssvc_NetWkstaEnumUsers_state {
356 struct wkssvc_NetWkstaEnumUsers orig;
357 struct wkssvc_NetWkstaEnumUsers tmp;
358 TALLOC_CTX *out_mem_ctx;
359 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
362 static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq);
364 struct tevent_req *rpccli_wkssvc_NetWkstaEnumUsers_send(TALLOC_CTX *mem_ctx,
365 struct tevent_context *ev,
366 struct rpc_pipe_client *cli,
367 const char *_server_name /* [in] [unique,charset(UTF16)] */,
368 struct wkssvc_NetWkstaEnumUsersInfo *_info /* [in,out] [ref] */,
369 uint32_t _prefmaxlen /* [in] */,
370 uint32_t *_entries_read /* [out] [ref] */,
371 uint32_t *_resume_handle /* [in,out] [unique] */)
373 struct tevent_req *req;
374 struct rpccli_wkssvc_NetWkstaEnumUsers_state *state;
375 struct tevent_req *subreq;
377 req = tevent_req_create(mem_ctx, &state,
378 struct rpccli_wkssvc_NetWkstaEnumUsers_state);
379 if (req == NULL) {
380 return NULL;
382 state->out_mem_ctx = NULL;
383 state->dispatch_recv = cli->dispatch_recv;
385 /* In parameters */
386 state->orig.in.server_name = _server_name;
387 state->orig.in.info = _info;
388 state->orig.in.prefmaxlen = _prefmaxlen;
389 state->orig.in.resume_handle = _resume_handle;
391 /* Out parameters */
392 state->orig.out.info = _info;
393 state->orig.out.entries_read = _entries_read;
394 state->orig.out.resume_handle = _resume_handle;
396 /* Result */
397 ZERO_STRUCT(state->orig.out.result);
399 if (DEBUGLEVEL >= 10) {
400 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &state->orig);
403 state->out_mem_ctx = talloc_named_const(state, 0,
404 "rpccli_wkssvc_NetWkstaEnumUsers_out_memory");
405 if (tevent_req_nomem(state->out_mem_ctx, req)) {
406 return tevent_req_post(req, ev);
409 /* make a temporary copy, that we pass to the dispatch function */
410 state->tmp = state->orig;
412 subreq = cli->dispatch_send(state, ev, cli,
413 &ndr_table_wkssvc,
414 NDR_WKSSVC_NETWKSTAENUMUSERS,
415 &state->tmp);
416 if (tevent_req_nomem(subreq, req)) {
417 return tevent_req_post(req, ev);
419 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaEnumUsers_done, req);
420 return req;
423 static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq)
425 struct tevent_req *req = tevent_req_callback_data(
426 subreq, struct tevent_req);
427 struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
428 req, struct rpccli_wkssvc_NetWkstaEnumUsers_state);
429 NTSTATUS status;
430 TALLOC_CTX *mem_ctx;
432 if (state->out_mem_ctx) {
433 mem_ctx = state->out_mem_ctx;
434 } else {
435 mem_ctx = state;
438 status = state->dispatch_recv(subreq, mem_ctx);
439 TALLOC_FREE(subreq);
440 if (!NT_STATUS_IS_OK(status)) {
441 tevent_req_nterror(req, status);
442 return;
445 /* Copy out parameters */
446 *state->orig.out.info = *state->tmp.out.info;
447 *state->orig.out.entries_read = *state->tmp.out.entries_read;
448 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
449 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
452 /* Copy result */
453 state->orig.out.result = state->tmp.out.result;
455 /* Reset temporary structure */
456 ZERO_STRUCT(state->tmp);
458 if (DEBUGLEVEL >= 10) {
459 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &state->orig);
462 tevent_req_done(req);
465 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers_recv(struct tevent_req *req,
466 TALLOC_CTX *mem_ctx,
467 WERROR *result)
469 struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
470 req, struct rpccli_wkssvc_NetWkstaEnumUsers_state);
471 NTSTATUS status;
473 if (tevent_req_is_nterror(req, &status)) {
474 tevent_req_received(req);
475 return status;
478 /* Steal possbile out parameters to the callers context */
479 talloc_steal(mem_ctx, state->out_mem_ctx);
481 /* Return result */
482 *result = state->orig.out.result;
484 tevent_req_received(req);
485 return NT_STATUS_OK;
488 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
489 TALLOC_CTX *mem_ctx,
490 const char *server_name /* [in] [unique,charset(UTF16)] */,
491 struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */,
492 uint32_t prefmaxlen /* [in] */,
493 uint32_t *entries_read /* [out] [ref] */,
494 uint32_t *resume_handle /* [in,out] [unique] */,
495 WERROR *werror)
497 struct wkssvc_NetWkstaEnumUsers r;
498 NTSTATUS status;
500 /* In parameters */
501 r.in.server_name = server_name;
502 r.in.info = info;
503 r.in.prefmaxlen = prefmaxlen;
504 r.in.resume_handle = resume_handle;
506 if (DEBUGLEVEL >= 10) {
507 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &r);
510 status = cli->dispatch(cli,
511 mem_ctx,
512 &ndr_table_wkssvc,
513 NDR_WKSSVC_NETWKSTAENUMUSERS,
514 &r);
516 if (!NT_STATUS_IS_OK(status)) {
517 return status;
520 if (DEBUGLEVEL >= 10) {
521 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &r);
524 if (NT_STATUS_IS_ERR(status)) {
525 return status;
528 /* Return variables */
529 *info = *r.out.info;
530 *entries_read = *r.out.entries_read;
531 if (resume_handle && r.out.resume_handle) {
532 *resume_handle = *r.out.resume_handle;
535 /* Return result */
536 if (werror) {
537 *werror = r.out.result;
540 return werror_to_ntstatus(r.out.result);
543 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state {
544 struct wkssvc_NetrWkstaUserGetInfo orig;
545 struct wkssvc_NetrWkstaUserGetInfo tmp;
546 TALLOC_CTX *out_mem_ctx;
547 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
550 static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq);
552 struct tevent_req *rpccli_wkssvc_NetrWkstaUserGetInfo_send(TALLOC_CTX *mem_ctx,
553 struct tevent_context *ev,
554 struct rpc_pipe_client *cli,
555 const char *_unknown /* [in] [unique,charset(UTF16)] */,
556 uint32_t _level /* [in] */,
557 union wkssvc_NetrWkstaUserInfo *_info /* [out] [ref,switch_is(level)] */)
559 struct tevent_req *req;
560 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state;
561 struct tevent_req *subreq;
563 req = tevent_req_create(mem_ctx, &state,
564 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
565 if (req == NULL) {
566 return NULL;
568 state->out_mem_ctx = NULL;
569 state->dispatch_recv = cli->dispatch_recv;
571 /* In parameters */
572 state->orig.in.unknown = _unknown;
573 state->orig.in.level = _level;
575 /* Out parameters */
576 state->orig.out.info = _info;
578 /* Result */
579 ZERO_STRUCT(state->orig.out.result);
581 if (DEBUGLEVEL >= 10) {
582 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &state->orig);
585 state->out_mem_ctx = talloc_named_const(state, 0,
586 "rpccli_wkssvc_NetrWkstaUserGetInfo_out_memory");
587 if (tevent_req_nomem(state->out_mem_ctx, req)) {
588 return tevent_req_post(req, ev);
591 /* make a temporary copy, that we pass to the dispatch function */
592 state->tmp = state->orig;
594 subreq = cli->dispatch_send(state, ev, cli,
595 &ndr_table_wkssvc,
596 NDR_WKSSVC_NETRWKSTAUSERGETINFO,
597 &state->tmp);
598 if (tevent_req_nomem(subreq, req)) {
599 return tevent_req_post(req, ev);
601 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserGetInfo_done, req);
602 return req;
605 static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq)
607 struct tevent_req *req = tevent_req_callback_data(
608 subreq, struct tevent_req);
609 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
610 req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
611 NTSTATUS status;
612 TALLOC_CTX *mem_ctx;
614 if (state->out_mem_ctx) {
615 mem_ctx = state->out_mem_ctx;
616 } else {
617 mem_ctx = state;
620 status = state->dispatch_recv(subreq, mem_ctx);
621 TALLOC_FREE(subreq);
622 if (!NT_STATUS_IS_OK(status)) {
623 tevent_req_nterror(req, status);
624 return;
627 /* Copy out parameters */
628 *state->orig.out.info = *state->tmp.out.info;
630 /* Copy result */
631 state->orig.out.result = state->tmp.out.result;
633 /* Reset temporary structure */
634 ZERO_STRUCT(state->tmp);
636 if (DEBUGLEVEL >= 10) {
637 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &state->orig);
640 tevent_req_done(req);
643 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo_recv(struct tevent_req *req,
644 TALLOC_CTX *mem_ctx,
645 WERROR *result)
647 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
648 req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
649 NTSTATUS status;
651 if (tevent_req_is_nterror(req, &status)) {
652 tevent_req_received(req);
653 return status;
656 /* Steal possbile out parameters to the callers context */
657 talloc_steal(mem_ctx, state->out_mem_ctx);
659 /* Return result */
660 *result = state->orig.out.result;
662 tevent_req_received(req);
663 return NT_STATUS_OK;
666 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli,
667 TALLOC_CTX *mem_ctx,
668 const char *unknown /* [in] [unique,charset(UTF16)] */,
669 uint32_t level /* [in] */,
670 union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */,
671 WERROR *werror)
673 struct wkssvc_NetrWkstaUserGetInfo r;
674 NTSTATUS status;
676 /* In parameters */
677 r.in.unknown = unknown;
678 r.in.level = level;
680 if (DEBUGLEVEL >= 10) {
681 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r);
684 status = cli->dispatch(cli,
685 mem_ctx,
686 &ndr_table_wkssvc,
687 NDR_WKSSVC_NETRWKSTAUSERGETINFO,
688 &r);
690 if (!NT_STATUS_IS_OK(status)) {
691 return status;
694 if (DEBUGLEVEL >= 10) {
695 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r);
698 if (NT_STATUS_IS_ERR(status)) {
699 return status;
702 /* Return variables */
703 *info = *r.out.info;
705 /* Return result */
706 if (werror) {
707 *werror = r.out.result;
710 return werror_to_ntstatus(r.out.result);
713 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state {
714 struct wkssvc_NetrWkstaUserSetInfo orig;
715 struct wkssvc_NetrWkstaUserSetInfo tmp;
716 TALLOC_CTX *out_mem_ctx;
717 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
720 static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq);
722 struct tevent_req *rpccli_wkssvc_NetrWkstaUserSetInfo_send(TALLOC_CTX *mem_ctx,
723 struct tevent_context *ev,
724 struct rpc_pipe_client *cli,
725 const char *_unknown /* [in] [unique,charset(UTF16)] */,
726 uint32_t _level /* [in] */,
727 union wkssvc_NetrWkstaUserInfo *_info /* [in] [ref,switch_is(level)] */,
728 uint32_t *_parm_err /* [in,out] [unique] */)
730 struct tevent_req *req;
731 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state;
732 struct tevent_req *subreq;
734 req = tevent_req_create(mem_ctx, &state,
735 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
736 if (req == NULL) {
737 return NULL;
739 state->out_mem_ctx = NULL;
740 state->dispatch_recv = cli->dispatch_recv;
742 /* In parameters */
743 state->orig.in.unknown = _unknown;
744 state->orig.in.level = _level;
745 state->orig.in.info = _info;
746 state->orig.in.parm_err = _parm_err;
748 /* Out parameters */
749 state->orig.out.parm_err = _parm_err;
751 /* Result */
752 ZERO_STRUCT(state->orig.out.result);
754 if (DEBUGLEVEL >= 10) {
755 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &state->orig);
758 state->out_mem_ctx = talloc_named_const(state, 0,
759 "rpccli_wkssvc_NetrWkstaUserSetInfo_out_memory");
760 if (tevent_req_nomem(state->out_mem_ctx, req)) {
761 return tevent_req_post(req, ev);
764 /* make a temporary copy, that we pass to the dispatch function */
765 state->tmp = state->orig;
767 subreq = cli->dispatch_send(state, ev, cli,
768 &ndr_table_wkssvc,
769 NDR_WKSSVC_NETRWKSTAUSERSETINFO,
770 &state->tmp);
771 if (tevent_req_nomem(subreq, req)) {
772 return tevent_req_post(req, ev);
774 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserSetInfo_done, req);
775 return req;
778 static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq)
780 struct tevent_req *req = tevent_req_callback_data(
781 subreq, struct tevent_req);
782 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
783 req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
784 NTSTATUS status;
785 TALLOC_CTX *mem_ctx;
787 if (state->out_mem_ctx) {
788 mem_ctx = state->out_mem_ctx;
789 } else {
790 mem_ctx = state;
793 status = state->dispatch_recv(subreq, mem_ctx);
794 TALLOC_FREE(subreq);
795 if (!NT_STATUS_IS_OK(status)) {
796 tevent_req_nterror(req, status);
797 return;
800 /* Copy out parameters */
801 if (state->orig.out.parm_err && state->tmp.out.parm_err) {
802 *state->orig.out.parm_err = *state->tmp.out.parm_err;
805 /* Copy result */
806 state->orig.out.result = state->tmp.out.result;
808 /* Reset temporary structure */
809 ZERO_STRUCT(state->tmp);
811 if (DEBUGLEVEL >= 10) {
812 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &state->orig);
815 tevent_req_done(req);
818 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo_recv(struct tevent_req *req,
819 TALLOC_CTX *mem_ctx,
820 WERROR *result)
822 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
823 req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
824 NTSTATUS status;
826 if (tevent_req_is_nterror(req, &status)) {
827 tevent_req_received(req);
828 return status;
831 /* Steal possbile out parameters to the callers context */
832 talloc_steal(mem_ctx, state->out_mem_ctx);
834 /* Return result */
835 *result = state->orig.out.result;
837 tevent_req_received(req);
838 return NT_STATUS_OK;
841 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
842 TALLOC_CTX *mem_ctx,
843 const char *unknown /* [in] [unique,charset(UTF16)] */,
844 uint32_t level /* [in] */,
845 union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */,
846 uint32_t *parm_err /* [in,out] [unique] */,
847 WERROR *werror)
849 struct wkssvc_NetrWkstaUserSetInfo r;
850 NTSTATUS status;
852 /* In parameters */
853 r.in.unknown = unknown;
854 r.in.level = level;
855 r.in.info = info;
856 r.in.parm_err = parm_err;
858 if (DEBUGLEVEL >= 10) {
859 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r);
862 status = cli->dispatch(cli,
863 mem_ctx,
864 &ndr_table_wkssvc,
865 NDR_WKSSVC_NETRWKSTAUSERSETINFO,
866 &r);
868 if (!NT_STATUS_IS_OK(status)) {
869 return status;
872 if (DEBUGLEVEL >= 10) {
873 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r);
876 if (NT_STATUS_IS_ERR(status)) {
877 return status;
880 /* Return variables */
881 if (parm_err && r.out.parm_err) {
882 *parm_err = *r.out.parm_err;
885 /* Return result */
886 if (werror) {
887 *werror = r.out.result;
890 return werror_to_ntstatus(r.out.result);
893 struct rpccli_wkssvc_NetWkstaTransportEnum_state {
894 struct wkssvc_NetWkstaTransportEnum orig;
895 struct wkssvc_NetWkstaTransportEnum tmp;
896 TALLOC_CTX *out_mem_ctx;
897 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
900 static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq);
902 struct tevent_req *rpccli_wkssvc_NetWkstaTransportEnum_send(TALLOC_CTX *mem_ctx,
903 struct tevent_context *ev,
904 struct rpc_pipe_client *cli,
905 const char *_server_name /* [in] [unique,charset(UTF16)] */,
906 struct wkssvc_NetWkstaTransportInfo *_info /* [in,out] [ref] */,
907 uint32_t _max_buffer /* [in] */,
908 uint32_t *_total_entries /* [out] [ref] */,
909 uint32_t *_resume_handle /* [in,out] [unique] */)
911 struct tevent_req *req;
912 struct rpccli_wkssvc_NetWkstaTransportEnum_state *state;
913 struct tevent_req *subreq;
915 req = tevent_req_create(mem_ctx, &state,
916 struct rpccli_wkssvc_NetWkstaTransportEnum_state);
917 if (req == NULL) {
918 return NULL;
920 state->out_mem_ctx = NULL;
921 state->dispatch_recv = cli->dispatch_recv;
923 /* In parameters */
924 state->orig.in.server_name = _server_name;
925 state->orig.in.info = _info;
926 state->orig.in.max_buffer = _max_buffer;
927 state->orig.in.resume_handle = _resume_handle;
929 /* Out parameters */
930 state->orig.out.info = _info;
931 state->orig.out.total_entries = _total_entries;
932 state->orig.out.resume_handle = _resume_handle;
934 /* Result */
935 ZERO_STRUCT(state->orig.out.result);
937 if (DEBUGLEVEL >= 10) {
938 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &state->orig);
941 state->out_mem_ctx = talloc_named_const(state, 0,
942 "rpccli_wkssvc_NetWkstaTransportEnum_out_memory");
943 if (tevent_req_nomem(state->out_mem_ctx, req)) {
944 return tevent_req_post(req, ev);
947 /* make a temporary copy, that we pass to the dispatch function */
948 state->tmp = state->orig;
950 subreq = cli->dispatch_send(state, ev, cli,
951 &ndr_table_wkssvc,
952 NDR_WKSSVC_NETWKSTATRANSPORTENUM,
953 &state->tmp);
954 if (tevent_req_nomem(subreq, req)) {
955 return tevent_req_post(req, ev);
957 tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaTransportEnum_done, req);
958 return req;
961 static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq)
963 struct tevent_req *req = tevent_req_callback_data(
964 subreq, struct tevent_req);
965 struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
966 req, struct rpccli_wkssvc_NetWkstaTransportEnum_state);
967 NTSTATUS status;
968 TALLOC_CTX *mem_ctx;
970 if (state->out_mem_ctx) {
971 mem_ctx = state->out_mem_ctx;
972 } else {
973 mem_ctx = state;
976 status = state->dispatch_recv(subreq, mem_ctx);
977 TALLOC_FREE(subreq);
978 if (!NT_STATUS_IS_OK(status)) {
979 tevent_req_nterror(req, status);
980 return;
983 /* Copy out parameters */
984 *state->orig.out.info = *state->tmp.out.info;
985 *state->orig.out.total_entries = *state->tmp.out.total_entries;
986 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
987 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
990 /* Copy result */
991 state->orig.out.result = state->tmp.out.result;
993 /* Reset temporary structure */
994 ZERO_STRUCT(state->tmp);
996 if (DEBUGLEVEL >= 10) {
997 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &state->orig);
1000 tevent_req_done(req);
1003 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum_recv(struct tevent_req *req,
1004 TALLOC_CTX *mem_ctx,
1005 WERROR *result)
1007 struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
1008 req, struct rpccli_wkssvc_NetWkstaTransportEnum_state);
1009 NTSTATUS status;
1011 if (tevent_req_is_nterror(req, &status)) {
1012 tevent_req_received(req);
1013 return status;
1016 /* Steal possbile out parameters to the callers context */
1017 talloc_steal(mem_ctx, state->out_mem_ctx);
1019 /* Return result */
1020 *result = state->orig.out.result;
1022 tevent_req_received(req);
1023 return NT_STATUS_OK;
1026 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
1027 TALLOC_CTX *mem_ctx,
1028 const char *server_name /* [in] [unique,charset(UTF16)] */,
1029 struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */,
1030 uint32_t max_buffer /* [in] */,
1031 uint32_t *total_entries /* [out] [ref] */,
1032 uint32_t *resume_handle /* [in,out] [unique] */,
1033 WERROR *werror)
1035 struct wkssvc_NetWkstaTransportEnum r;
1036 NTSTATUS status;
1038 /* In parameters */
1039 r.in.server_name = server_name;
1040 r.in.info = info;
1041 r.in.max_buffer = max_buffer;
1042 r.in.resume_handle = resume_handle;
1044 if (DEBUGLEVEL >= 10) {
1045 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
1048 status = cli->dispatch(cli,
1049 mem_ctx,
1050 &ndr_table_wkssvc,
1051 NDR_WKSSVC_NETWKSTATRANSPORTENUM,
1052 &r);
1054 if (!NT_STATUS_IS_OK(status)) {
1055 return status;
1058 if (DEBUGLEVEL >= 10) {
1059 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
1062 if (NT_STATUS_IS_ERR(status)) {
1063 return status;
1066 /* Return variables */
1067 *info = *r.out.info;
1068 *total_entries = *r.out.total_entries;
1069 if (resume_handle && r.out.resume_handle) {
1070 *resume_handle = *r.out.resume_handle;
1073 /* Return result */
1074 if (werror) {
1075 *werror = r.out.result;
1078 return werror_to_ntstatus(r.out.result);
1081 struct rpccli_wkssvc_NetrWkstaTransportAdd_state {
1082 struct wkssvc_NetrWkstaTransportAdd orig;
1083 struct wkssvc_NetrWkstaTransportAdd tmp;
1084 TALLOC_CTX *out_mem_ctx;
1085 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1088 static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq);
1090 struct tevent_req *rpccli_wkssvc_NetrWkstaTransportAdd_send(TALLOC_CTX *mem_ctx,
1091 struct tevent_context *ev,
1092 struct rpc_pipe_client *cli,
1093 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1094 uint32_t _level /* [in] */,
1095 struct wkssvc_NetWkstaTransportInfo0 *_info0 /* [in] [ref] */,
1096 uint32_t *_parm_err /* [in,out] [unique] */)
1098 struct tevent_req *req;
1099 struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state;
1100 struct tevent_req *subreq;
1102 req = tevent_req_create(mem_ctx, &state,
1103 struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1104 if (req == NULL) {
1105 return NULL;
1107 state->out_mem_ctx = NULL;
1108 state->dispatch_recv = cli->dispatch_recv;
1110 /* In parameters */
1111 state->orig.in.server_name = _server_name;
1112 state->orig.in.level = _level;
1113 state->orig.in.info0 = _info0;
1114 state->orig.in.parm_err = _parm_err;
1116 /* Out parameters */
1117 state->orig.out.parm_err = _parm_err;
1119 /* Result */
1120 ZERO_STRUCT(state->orig.out.result);
1122 if (DEBUGLEVEL >= 10) {
1123 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &state->orig);
1126 state->out_mem_ctx = talloc_named_const(state, 0,
1127 "rpccli_wkssvc_NetrWkstaTransportAdd_out_memory");
1128 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1129 return tevent_req_post(req, ev);
1132 /* make a temporary copy, that we pass to the dispatch function */
1133 state->tmp = state->orig;
1135 subreq = cli->dispatch_send(state, ev, cli,
1136 &ndr_table_wkssvc,
1137 NDR_WKSSVC_NETRWKSTATRANSPORTADD,
1138 &state->tmp);
1139 if (tevent_req_nomem(subreq, req)) {
1140 return tevent_req_post(req, ev);
1142 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportAdd_done, req);
1143 return req;
1146 static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq)
1148 struct tevent_req *req = tevent_req_callback_data(
1149 subreq, struct tevent_req);
1150 struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
1151 req, struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1152 NTSTATUS status;
1153 TALLOC_CTX *mem_ctx;
1155 if (state->out_mem_ctx) {
1156 mem_ctx = state->out_mem_ctx;
1157 } else {
1158 mem_ctx = state;
1161 status = state->dispatch_recv(subreq, mem_ctx);
1162 TALLOC_FREE(subreq);
1163 if (!NT_STATUS_IS_OK(status)) {
1164 tevent_req_nterror(req, status);
1165 return;
1168 /* Copy out parameters */
1169 if (state->orig.out.parm_err && state->tmp.out.parm_err) {
1170 *state->orig.out.parm_err = *state->tmp.out.parm_err;
1173 /* Copy result */
1174 state->orig.out.result = state->tmp.out.result;
1176 /* Reset temporary structure */
1177 ZERO_STRUCT(state->tmp);
1179 if (DEBUGLEVEL >= 10) {
1180 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &state->orig);
1183 tevent_req_done(req);
1186 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd_recv(struct tevent_req *req,
1187 TALLOC_CTX *mem_ctx,
1188 WERROR *result)
1190 struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
1191 req, struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1192 NTSTATUS status;
1194 if (tevent_req_is_nterror(req, &status)) {
1195 tevent_req_received(req);
1196 return status;
1199 /* Steal possbile out parameters to the callers context */
1200 talloc_steal(mem_ctx, state->out_mem_ctx);
1202 /* Return result */
1203 *result = state->orig.out.result;
1205 tevent_req_received(req);
1206 return NT_STATUS_OK;
1209 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
1210 TALLOC_CTX *mem_ctx,
1211 const char *server_name /* [in] [unique,charset(UTF16)] */,
1212 uint32_t level /* [in] */,
1213 struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */,
1214 uint32_t *parm_err /* [in,out] [unique] */,
1215 WERROR *werror)
1217 struct wkssvc_NetrWkstaTransportAdd r;
1218 NTSTATUS status;
1220 /* In parameters */
1221 r.in.server_name = server_name;
1222 r.in.level = level;
1223 r.in.info0 = info0;
1224 r.in.parm_err = parm_err;
1226 if (DEBUGLEVEL >= 10) {
1227 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &r);
1230 status = cli->dispatch(cli,
1231 mem_ctx,
1232 &ndr_table_wkssvc,
1233 NDR_WKSSVC_NETRWKSTATRANSPORTADD,
1234 &r);
1236 if (!NT_STATUS_IS_OK(status)) {
1237 return status;
1240 if (DEBUGLEVEL >= 10) {
1241 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &r);
1244 if (NT_STATUS_IS_ERR(status)) {
1245 return status;
1248 /* Return variables */
1249 if (parm_err && r.out.parm_err) {
1250 *parm_err = *r.out.parm_err;
1253 /* Return result */
1254 if (werror) {
1255 *werror = r.out.result;
1258 return werror_to_ntstatus(r.out.result);
1261 struct rpccli_wkssvc_NetrWkstaTransportDel_state {
1262 struct wkssvc_NetrWkstaTransportDel orig;
1263 struct wkssvc_NetrWkstaTransportDel tmp;
1264 TALLOC_CTX *out_mem_ctx;
1265 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1268 static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq);
1270 struct tevent_req *rpccli_wkssvc_NetrWkstaTransportDel_send(TALLOC_CTX *mem_ctx,
1271 struct tevent_context *ev,
1272 struct rpc_pipe_client *cli,
1273 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1274 const char *_transport_name /* [in] [unique,charset(UTF16)] */,
1275 uint32_t _unknown3 /* [in] */)
1277 struct tevent_req *req;
1278 struct rpccli_wkssvc_NetrWkstaTransportDel_state *state;
1279 struct tevent_req *subreq;
1281 req = tevent_req_create(mem_ctx, &state,
1282 struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1283 if (req == NULL) {
1284 return NULL;
1286 state->out_mem_ctx = NULL;
1287 state->dispatch_recv = cli->dispatch_recv;
1289 /* In parameters */
1290 state->orig.in.server_name = _server_name;
1291 state->orig.in.transport_name = _transport_name;
1292 state->orig.in.unknown3 = _unknown3;
1294 /* Out parameters */
1296 /* Result */
1297 ZERO_STRUCT(state->orig.out.result);
1299 if (DEBUGLEVEL >= 10) {
1300 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &state->orig);
1303 /* make a temporary copy, that we pass to the dispatch function */
1304 state->tmp = state->orig;
1306 subreq = cli->dispatch_send(state, ev, cli,
1307 &ndr_table_wkssvc,
1308 NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
1309 &state->tmp);
1310 if (tevent_req_nomem(subreq, req)) {
1311 return tevent_req_post(req, ev);
1313 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportDel_done, req);
1314 return req;
1317 static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq)
1319 struct tevent_req *req = tevent_req_callback_data(
1320 subreq, struct tevent_req);
1321 struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
1322 req, struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1323 NTSTATUS status;
1324 TALLOC_CTX *mem_ctx;
1326 if (state->out_mem_ctx) {
1327 mem_ctx = state->out_mem_ctx;
1328 } else {
1329 mem_ctx = state;
1332 status = state->dispatch_recv(subreq, mem_ctx);
1333 TALLOC_FREE(subreq);
1334 if (!NT_STATUS_IS_OK(status)) {
1335 tevent_req_nterror(req, status);
1336 return;
1339 /* Copy out parameters */
1341 /* Copy result */
1342 state->orig.out.result = state->tmp.out.result;
1344 /* Reset temporary structure */
1345 ZERO_STRUCT(state->tmp);
1347 if (DEBUGLEVEL >= 10) {
1348 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &state->orig);
1351 tevent_req_done(req);
1354 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel_recv(struct tevent_req *req,
1355 TALLOC_CTX *mem_ctx,
1356 WERROR *result)
1358 struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
1359 req, struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1360 NTSTATUS status;
1362 if (tevent_req_is_nterror(req, &status)) {
1363 tevent_req_received(req);
1364 return status;
1367 /* Steal possbile out parameters to the callers context */
1368 talloc_steal(mem_ctx, state->out_mem_ctx);
1370 /* Return result */
1371 *result = state->orig.out.result;
1373 tevent_req_received(req);
1374 return NT_STATUS_OK;
1377 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli,
1378 TALLOC_CTX *mem_ctx,
1379 const char *server_name /* [in] [unique,charset(UTF16)] */,
1380 const char *transport_name /* [in] [unique,charset(UTF16)] */,
1381 uint32_t unknown3 /* [in] */,
1382 WERROR *werror)
1384 struct wkssvc_NetrWkstaTransportDel r;
1385 NTSTATUS status;
1387 /* In parameters */
1388 r.in.server_name = server_name;
1389 r.in.transport_name = transport_name;
1390 r.in.unknown3 = unknown3;
1392 if (DEBUGLEVEL >= 10) {
1393 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &r);
1396 status = cli->dispatch(cli,
1397 mem_ctx,
1398 &ndr_table_wkssvc,
1399 NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
1400 &r);
1402 if (!NT_STATUS_IS_OK(status)) {
1403 return status;
1406 if (DEBUGLEVEL >= 10) {
1407 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &r);
1410 if (NT_STATUS_IS_ERR(status)) {
1411 return status;
1414 /* Return variables */
1416 /* Return result */
1417 if (werror) {
1418 *werror = r.out.result;
1421 return werror_to_ntstatus(r.out.result);
1424 struct rpccli_wkssvc_NetrUseAdd_state {
1425 struct wkssvc_NetrUseAdd orig;
1426 struct wkssvc_NetrUseAdd tmp;
1427 TALLOC_CTX *out_mem_ctx;
1428 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1431 static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq);
1433 struct tevent_req *rpccli_wkssvc_NetrUseAdd_send(TALLOC_CTX *mem_ctx,
1434 struct tevent_context *ev,
1435 struct rpc_pipe_client *cli,
1436 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1437 uint32_t _level /* [in] */,
1438 union wkssvc_NetrUseGetInfoCtr *_ctr /* [in] [ref,switch_is(level)] */,
1439 uint32_t *_parm_err /* [in,out] [unique] */)
1441 struct tevent_req *req;
1442 struct rpccli_wkssvc_NetrUseAdd_state *state;
1443 struct tevent_req *subreq;
1445 req = tevent_req_create(mem_ctx, &state,
1446 struct rpccli_wkssvc_NetrUseAdd_state);
1447 if (req == NULL) {
1448 return NULL;
1450 state->out_mem_ctx = NULL;
1451 state->dispatch_recv = cli->dispatch_recv;
1453 /* In parameters */
1454 state->orig.in.server_name = _server_name;
1455 state->orig.in.level = _level;
1456 state->orig.in.ctr = _ctr;
1457 state->orig.in.parm_err = _parm_err;
1459 /* Out parameters */
1460 state->orig.out.parm_err = _parm_err;
1462 /* Result */
1463 ZERO_STRUCT(state->orig.out.result);
1465 if (DEBUGLEVEL >= 10) {
1466 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &state->orig);
1469 state->out_mem_ctx = talloc_named_const(state, 0,
1470 "rpccli_wkssvc_NetrUseAdd_out_memory");
1471 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1472 return tevent_req_post(req, ev);
1475 /* make a temporary copy, that we pass to the dispatch function */
1476 state->tmp = state->orig;
1478 subreq = cli->dispatch_send(state, ev, cli,
1479 &ndr_table_wkssvc,
1480 NDR_WKSSVC_NETRUSEADD,
1481 &state->tmp);
1482 if (tevent_req_nomem(subreq, req)) {
1483 return tevent_req_post(req, ev);
1485 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseAdd_done, req);
1486 return req;
1489 static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq)
1491 struct tevent_req *req = tevent_req_callback_data(
1492 subreq, struct tevent_req);
1493 struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
1494 req, struct rpccli_wkssvc_NetrUseAdd_state);
1495 NTSTATUS status;
1496 TALLOC_CTX *mem_ctx;
1498 if (state->out_mem_ctx) {
1499 mem_ctx = state->out_mem_ctx;
1500 } else {
1501 mem_ctx = state;
1504 status = state->dispatch_recv(subreq, mem_ctx);
1505 TALLOC_FREE(subreq);
1506 if (!NT_STATUS_IS_OK(status)) {
1507 tevent_req_nterror(req, status);
1508 return;
1511 /* Copy out parameters */
1512 if (state->orig.out.parm_err && state->tmp.out.parm_err) {
1513 *state->orig.out.parm_err = *state->tmp.out.parm_err;
1516 /* Copy result */
1517 state->orig.out.result = state->tmp.out.result;
1519 /* Reset temporary structure */
1520 ZERO_STRUCT(state->tmp);
1522 if (DEBUGLEVEL >= 10) {
1523 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &state->orig);
1526 tevent_req_done(req);
1529 NTSTATUS rpccli_wkssvc_NetrUseAdd_recv(struct tevent_req *req,
1530 TALLOC_CTX *mem_ctx,
1531 WERROR *result)
1533 struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
1534 req, struct rpccli_wkssvc_NetrUseAdd_state);
1535 NTSTATUS status;
1537 if (tevent_req_is_nterror(req, &status)) {
1538 tevent_req_received(req);
1539 return status;
1542 /* Steal possbile out parameters to the callers context */
1543 talloc_steal(mem_ctx, state->out_mem_ctx);
1545 /* Return result */
1546 *result = state->orig.out.result;
1548 tevent_req_received(req);
1549 return NT_STATUS_OK;
1552 NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
1553 TALLOC_CTX *mem_ctx,
1554 const char *server_name /* [in] [unique,charset(UTF16)] */,
1555 uint32_t level /* [in] */,
1556 union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */,
1557 uint32_t *parm_err /* [in,out] [unique] */,
1558 WERROR *werror)
1560 struct wkssvc_NetrUseAdd r;
1561 NTSTATUS status;
1563 /* In parameters */
1564 r.in.server_name = server_name;
1565 r.in.level = level;
1566 r.in.ctr = ctr;
1567 r.in.parm_err = parm_err;
1569 if (DEBUGLEVEL >= 10) {
1570 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &r);
1573 status = cli->dispatch(cli,
1574 mem_ctx,
1575 &ndr_table_wkssvc,
1576 NDR_WKSSVC_NETRUSEADD,
1577 &r);
1579 if (!NT_STATUS_IS_OK(status)) {
1580 return status;
1583 if (DEBUGLEVEL >= 10) {
1584 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &r);
1587 if (NT_STATUS_IS_ERR(status)) {
1588 return status;
1591 /* Return variables */
1592 if (parm_err && r.out.parm_err) {
1593 *parm_err = *r.out.parm_err;
1596 /* Return result */
1597 if (werror) {
1598 *werror = r.out.result;
1601 return werror_to_ntstatus(r.out.result);
1604 struct rpccli_wkssvc_NetrUseGetInfo_state {
1605 struct wkssvc_NetrUseGetInfo orig;
1606 struct wkssvc_NetrUseGetInfo tmp;
1607 TALLOC_CTX *out_mem_ctx;
1608 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1611 static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq);
1613 struct tevent_req *rpccli_wkssvc_NetrUseGetInfo_send(TALLOC_CTX *mem_ctx,
1614 struct tevent_context *ev,
1615 struct rpc_pipe_client *cli,
1616 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1617 const char *_use_name /* [in] [ref,charset(UTF16)] */,
1618 uint32_t _level /* [in] */,
1619 union wkssvc_NetrUseGetInfoCtr *_ctr /* [out] [ref,switch_is(level)] */)
1621 struct tevent_req *req;
1622 struct rpccli_wkssvc_NetrUseGetInfo_state *state;
1623 struct tevent_req *subreq;
1625 req = tevent_req_create(mem_ctx, &state,
1626 struct rpccli_wkssvc_NetrUseGetInfo_state);
1627 if (req == NULL) {
1628 return NULL;
1630 state->out_mem_ctx = NULL;
1631 state->dispatch_recv = cli->dispatch_recv;
1633 /* In parameters */
1634 state->orig.in.server_name = _server_name;
1635 state->orig.in.use_name = _use_name;
1636 state->orig.in.level = _level;
1638 /* Out parameters */
1639 state->orig.out.ctr = _ctr;
1641 /* Result */
1642 ZERO_STRUCT(state->orig.out.result);
1644 if (DEBUGLEVEL >= 10) {
1645 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &state->orig);
1648 state->out_mem_ctx = talloc_named_const(state, 0,
1649 "rpccli_wkssvc_NetrUseGetInfo_out_memory");
1650 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1651 return tevent_req_post(req, ev);
1654 /* make a temporary copy, that we pass to the dispatch function */
1655 state->tmp = state->orig;
1657 subreq = cli->dispatch_send(state, ev, cli,
1658 &ndr_table_wkssvc,
1659 NDR_WKSSVC_NETRUSEGETINFO,
1660 &state->tmp);
1661 if (tevent_req_nomem(subreq, req)) {
1662 return tevent_req_post(req, ev);
1664 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseGetInfo_done, req);
1665 return req;
1668 static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq)
1670 struct tevent_req *req = tevent_req_callback_data(
1671 subreq, struct tevent_req);
1672 struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
1673 req, struct rpccli_wkssvc_NetrUseGetInfo_state);
1674 NTSTATUS status;
1675 TALLOC_CTX *mem_ctx;
1677 if (state->out_mem_ctx) {
1678 mem_ctx = state->out_mem_ctx;
1679 } else {
1680 mem_ctx = state;
1683 status = state->dispatch_recv(subreq, mem_ctx);
1684 TALLOC_FREE(subreq);
1685 if (!NT_STATUS_IS_OK(status)) {
1686 tevent_req_nterror(req, status);
1687 return;
1690 /* Copy out parameters */
1691 *state->orig.out.ctr = *state->tmp.out.ctr;
1693 /* Copy result */
1694 state->orig.out.result = state->tmp.out.result;
1696 /* Reset temporary structure */
1697 ZERO_STRUCT(state->tmp);
1699 if (DEBUGLEVEL >= 10) {
1700 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &state->orig);
1703 tevent_req_done(req);
1706 NTSTATUS rpccli_wkssvc_NetrUseGetInfo_recv(struct tevent_req *req,
1707 TALLOC_CTX *mem_ctx,
1708 WERROR *result)
1710 struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
1711 req, struct rpccli_wkssvc_NetrUseGetInfo_state);
1712 NTSTATUS status;
1714 if (tevent_req_is_nterror(req, &status)) {
1715 tevent_req_received(req);
1716 return status;
1719 /* Steal possbile out parameters to the callers context */
1720 talloc_steal(mem_ctx, state->out_mem_ctx);
1722 /* Return result */
1723 *result = state->orig.out.result;
1725 tevent_req_received(req);
1726 return NT_STATUS_OK;
1729 NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
1730 TALLOC_CTX *mem_ctx,
1731 const char *server_name /* [in] [unique,charset(UTF16)] */,
1732 const char *use_name /* [in] [ref,charset(UTF16)] */,
1733 uint32_t level /* [in] */,
1734 union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */,
1735 WERROR *werror)
1737 struct wkssvc_NetrUseGetInfo r;
1738 NTSTATUS status;
1740 /* In parameters */
1741 r.in.server_name = server_name;
1742 r.in.use_name = use_name;
1743 r.in.level = level;
1745 if (DEBUGLEVEL >= 10) {
1746 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &r);
1749 status = cli->dispatch(cli,
1750 mem_ctx,
1751 &ndr_table_wkssvc,
1752 NDR_WKSSVC_NETRUSEGETINFO,
1753 &r);
1755 if (!NT_STATUS_IS_OK(status)) {
1756 return status;
1759 if (DEBUGLEVEL >= 10) {
1760 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &r);
1763 if (NT_STATUS_IS_ERR(status)) {
1764 return status;
1767 /* Return variables */
1768 *ctr = *r.out.ctr;
1770 /* Return result */
1771 if (werror) {
1772 *werror = r.out.result;
1775 return werror_to_ntstatus(r.out.result);
1778 struct rpccli_wkssvc_NetrUseDel_state {
1779 struct wkssvc_NetrUseDel orig;
1780 struct wkssvc_NetrUseDel tmp;
1781 TALLOC_CTX *out_mem_ctx;
1782 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1785 static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq);
1787 struct tevent_req *rpccli_wkssvc_NetrUseDel_send(TALLOC_CTX *mem_ctx,
1788 struct tevent_context *ev,
1789 struct rpc_pipe_client *cli,
1790 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1791 const char *_use_name /* [in] [ref,charset(UTF16)] */,
1792 uint32_t _force_cond /* [in] */)
1794 struct tevent_req *req;
1795 struct rpccli_wkssvc_NetrUseDel_state *state;
1796 struct tevent_req *subreq;
1798 req = tevent_req_create(mem_ctx, &state,
1799 struct rpccli_wkssvc_NetrUseDel_state);
1800 if (req == NULL) {
1801 return NULL;
1803 state->out_mem_ctx = NULL;
1804 state->dispatch_recv = cli->dispatch_recv;
1806 /* In parameters */
1807 state->orig.in.server_name = _server_name;
1808 state->orig.in.use_name = _use_name;
1809 state->orig.in.force_cond = _force_cond;
1811 /* Out parameters */
1813 /* Result */
1814 ZERO_STRUCT(state->orig.out.result);
1816 if (DEBUGLEVEL >= 10) {
1817 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &state->orig);
1820 /* make a temporary copy, that we pass to the dispatch function */
1821 state->tmp = state->orig;
1823 subreq = cli->dispatch_send(state, ev, cli,
1824 &ndr_table_wkssvc,
1825 NDR_WKSSVC_NETRUSEDEL,
1826 &state->tmp);
1827 if (tevent_req_nomem(subreq, req)) {
1828 return tevent_req_post(req, ev);
1830 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseDel_done, req);
1831 return req;
1834 static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq)
1836 struct tevent_req *req = tevent_req_callback_data(
1837 subreq, struct tevent_req);
1838 struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
1839 req, struct rpccli_wkssvc_NetrUseDel_state);
1840 NTSTATUS status;
1841 TALLOC_CTX *mem_ctx;
1843 if (state->out_mem_ctx) {
1844 mem_ctx = state->out_mem_ctx;
1845 } else {
1846 mem_ctx = state;
1849 status = state->dispatch_recv(subreq, mem_ctx);
1850 TALLOC_FREE(subreq);
1851 if (!NT_STATUS_IS_OK(status)) {
1852 tevent_req_nterror(req, status);
1853 return;
1856 /* Copy out parameters */
1858 /* Copy result */
1859 state->orig.out.result = state->tmp.out.result;
1861 /* Reset temporary structure */
1862 ZERO_STRUCT(state->tmp);
1864 if (DEBUGLEVEL >= 10) {
1865 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &state->orig);
1868 tevent_req_done(req);
1871 NTSTATUS rpccli_wkssvc_NetrUseDel_recv(struct tevent_req *req,
1872 TALLOC_CTX *mem_ctx,
1873 WERROR *result)
1875 struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
1876 req, struct rpccli_wkssvc_NetrUseDel_state);
1877 NTSTATUS status;
1879 if (tevent_req_is_nterror(req, &status)) {
1880 tevent_req_received(req);
1881 return status;
1884 /* Steal possbile out parameters to the callers context */
1885 talloc_steal(mem_ctx, state->out_mem_ctx);
1887 /* Return result */
1888 *result = state->orig.out.result;
1890 tevent_req_received(req);
1891 return NT_STATUS_OK;
1894 NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
1895 TALLOC_CTX *mem_ctx,
1896 const char *server_name /* [in] [unique,charset(UTF16)] */,
1897 const char *use_name /* [in] [ref,charset(UTF16)] */,
1898 uint32_t force_cond /* [in] */,
1899 WERROR *werror)
1901 struct wkssvc_NetrUseDel r;
1902 NTSTATUS status;
1904 /* In parameters */
1905 r.in.server_name = server_name;
1906 r.in.use_name = use_name;
1907 r.in.force_cond = force_cond;
1909 if (DEBUGLEVEL >= 10) {
1910 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &r);
1913 status = cli->dispatch(cli,
1914 mem_ctx,
1915 &ndr_table_wkssvc,
1916 NDR_WKSSVC_NETRUSEDEL,
1917 &r);
1919 if (!NT_STATUS_IS_OK(status)) {
1920 return status;
1923 if (DEBUGLEVEL >= 10) {
1924 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &r);
1927 if (NT_STATUS_IS_ERR(status)) {
1928 return status;
1931 /* Return variables */
1933 /* Return result */
1934 if (werror) {
1935 *werror = r.out.result;
1938 return werror_to_ntstatus(r.out.result);
1941 struct rpccli_wkssvc_NetrUseEnum_state {
1942 struct wkssvc_NetrUseEnum orig;
1943 struct wkssvc_NetrUseEnum tmp;
1944 TALLOC_CTX *out_mem_ctx;
1945 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1948 static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq);
1950 struct tevent_req *rpccli_wkssvc_NetrUseEnum_send(TALLOC_CTX *mem_ctx,
1951 struct tevent_context *ev,
1952 struct rpc_pipe_client *cli,
1953 const char *_server_name /* [in] [unique,charset(UTF16)] */,
1954 struct wkssvc_NetrUseEnumInfo *_info /* [in,out] [ref] */,
1955 uint32_t _prefmaxlen /* [in] */,
1956 uint32_t *_entries_read /* [out] [ref] */,
1957 uint32_t *_resume_handle /* [in,out] [unique] */)
1959 struct tevent_req *req;
1960 struct rpccli_wkssvc_NetrUseEnum_state *state;
1961 struct tevent_req *subreq;
1963 req = tevent_req_create(mem_ctx, &state,
1964 struct rpccli_wkssvc_NetrUseEnum_state);
1965 if (req == NULL) {
1966 return NULL;
1968 state->out_mem_ctx = NULL;
1969 state->dispatch_recv = cli->dispatch_recv;
1971 /* In parameters */
1972 state->orig.in.server_name = _server_name;
1973 state->orig.in.info = _info;
1974 state->orig.in.prefmaxlen = _prefmaxlen;
1975 state->orig.in.resume_handle = _resume_handle;
1977 /* Out parameters */
1978 state->orig.out.info = _info;
1979 state->orig.out.entries_read = _entries_read;
1980 state->orig.out.resume_handle = _resume_handle;
1982 /* Result */
1983 ZERO_STRUCT(state->orig.out.result);
1985 if (DEBUGLEVEL >= 10) {
1986 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &state->orig);
1989 state->out_mem_ctx = talloc_named_const(state, 0,
1990 "rpccli_wkssvc_NetrUseEnum_out_memory");
1991 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1992 return tevent_req_post(req, ev);
1995 /* make a temporary copy, that we pass to the dispatch function */
1996 state->tmp = state->orig;
1998 subreq = cli->dispatch_send(state, ev, cli,
1999 &ndr_table_wkssvc,
2000 NDR_WKSSVC_NETRUSEENUM,
2001 &state->tmp);
2002 if (tevent_req_nomem(subreq, req)) {
2003 return tevent_req_post(req, ev);
2005 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseEnum_done, req);
2006 return req;
2009 static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq)
2011 struct tevent_req *req = tevent_req_callback_data(
2012 subreq, struct tevent_req);
2013 struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
2014 req, struct rpccli_wkssvc_NetrUseEnum_state);
2015 NTSTATUS status;
2016 TALLOC_CTX *mem_ctx;
2018 if (state->out_mem_ctx) {
2019 mem_ctx = state->out_mem_ctx;
2020 } else {
2021 mem_ctx = state;
2024 status = state->dispatch_recv(subreq, mem_ctx);
2025 TALLOC_FREE(subreq);
2026 if (!NT_STATUS_IS_OK(status)) {
2027 tevent_req_nterror(req, status);
2028 return;
2031 /* Copy out parameters */
2032 *state->orig.out.info = *state->tmp.out.info;
2033 *state->orig.out.entries_read = *state->tmp.out.entries_read;
2034 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
2035 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2038 /* Copy result */
2039 state->orig.out.result = state->tmp.out.result;
2041 /* Reset temporary structure */
2042 ZERO_STRUCT(state->tmp);
2044 if (DEBUGLEVEL >= 10) {
2045 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &state->orig);
2048 tevent_req_done(req);
2051 NTSTATUS rpccli_wkssvc_NetrUseEnum_recv(struct tevent_req *req,
2052 TALLOC_CTX *mem_ctx,
2053 WERROR *result)
2055 struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
2056 req, struct rpccli_wkssvc_NetrUseEnum_state);
2057 NTSTATUS status;
2059 if (tevent_req_is_nterror(req, &status)) {
2060 tevent_req_received(req);
2061 return status;
2064 /* Steal possbile out parameters to the callers context */
2065 talloc_steal(mem_ctx, state->out_mem_ctx);
2067 /* Return result */
2068 *result = state->orig.out.result;
2070 tevent_req_received(req);
2071 return NT_STATUS_OK;
2074 NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
2075 TALLOC_CTX *mem_ctx,
2076 const char *server_name /* [in] [unique,charset(UTF16)] */,
2077 struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */,
2078 uint32_t prefmaxlen /* [in] */,
2079 uint32_t *entries_read /* [out] [ref] */,
2080 uint32_t *resume_handle /* [in,out] [unique] */,
2081 WERROR *werror)
2083 struct wkssvc_NetrUseEnum r;
2084 NTSTATUS status;
2086 /* In parameters */
2087 r.in.server_name = server_name;
2088 r.in.info = info;
2089 r.in.prefmaxlen = prefmaxlen;
2090 r.in.resume_handle = resume_handle;
2092 if (DEBUGLEVEL >= 10) {
2093 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &r);
2096 status = cli->dispatch(cli,
2097 mem_ctx,
2098 &ndr_table_wkssvc,
2099 NDR_WKSSVC_NETRUSEENUM,
2100 &r);
2102 if (!NT_STATUS_IS_OK(status)) {
2103 return status;
2106 if (DEBUGLEVEL >= 10) {
2107 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &r);
2110 if (NT_STATUS_IS_ERR(status)) {
2111 return status;
2114 /* Return variables */
2115 *info = *r.out.info;
2116 *entries_read = *r.out.entries_read;
2117 if (resume_handle && r.out.resume_handle) {
2118 *resume_handle = *r.out.resume_handle;
2121 /* Return result */
2122 if (werror) {
2123 *werror = r.out.result;
2126 return werror_to_ntstatus(r.out.result);
2129 struct rpccli_wkssvc_NetrMessageBufferSend_state {
2130 struct wkssvc_NetrMessageBufferSend orig;
2131 struct wkssvc_NetrMessageBufferSend tmp;
2132 TALLOC_CTX *out_mem_ctx;
2133 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2136 static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq);
2138 struct tevent_req *rpccli_wkssvc_NetrMessageBufferSend_send(TALLOC_CTX *mem_ctx,
2139 struct tevent_context *ev,
2140 struct rpc_pipe_client *cli,
2141 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2142 const char *_message_name /* [in] [ref,charset(UTF16)] */,
2143 const char *_message_sender_name /* [in] [unique,charset(UTF16)] */,
2144 uint8_t *_message_buffer /* [in] [ref,size_is(message_size)] */,
2145 uint32_t _message_size /* [in] */)
2147 struct tevent_req *req;
2148 struct rpccli_wkssvc_NetrMessageBufferSend_state *state;
2149 struct tevent_req *subreq;
2151 req = tevent_req_create(mem_ctx, &state,
2152 struct rpccli_wkssvc_NetrMessageBufferSend_state);
2153 if (req == NULL) {
2154 return NULL;
2156 state->out_mem_ctx = NULL;
2157 state->dispatch_recv = cli->dispatch_recv;
2159 /* In parameters */
2160 state->orig.in.server_name = _server_name;
2161 state->orig.in.message_name = _message_name;
2162 state->orig.in.message_sender_name = _message_sender_name;
2163 state->orig.in.message_buffer = _message_buffer;
2164 state->orig.in.message_size = _message_size;
2166 /* Out parameters */
2168 /* Result */
2169 ZERO_STRUCT(state->orig.out.result);
2171 if (DEBUGLEVEL >= 10) {
2172 NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &state->orig);
2175 /* make a temporary copy, that we pass to the dispatch function */
2176 state->tmp = state->orig;
2178 subreq = cli->dispatch_send(state, ev, cli,
2179 &ndr_table_wkssvc,
2180 NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
2181 &state->tmp);
2182 if (tevent_req_nomem(subreq, req)) {
2183 return tevent_req_post(req, ev);
2185 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrMessageBufferSend_done, req);
2186 return req;
2189 static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq)
2191 struct tevent_req *req = tevent_req_callback_data(
2192 subreq, struct tevent_req);
2193 struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
2194 req, struct rpccli_wkssvc_NetrMessageBufferSend_state);
2195 NTSTATUS status;
2196 TALLOC_CTX *mem_ctx;
2198 if (state->out_mem_ctx) {
2199 mem_ctx = state->out_mem_ctx;
2200 } else {
2201 mem_ctx = state;
2204 status = state->dispatch_recv(subreq, mem_ctx);
2205 TALLOC_FREE(subreq);
2206 if (!NT_STATUS_IS_OK(status)) {
2207 tevent_req_nterror(req, status);
2208 return;
2211 /* Copy out parameters */
2213 /* Copy result */
2214 state->orig.out.result = state->tmp.out.result;
2216 /* Reset temporary structure */
2217 ZERO_STRUCT(state->tmp);
2219 if (DEBUGLEVEL >= 10) {
2220 NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &state->orig);
2223 tevent_req_done(req);
2226 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend_recv(struct tevent_req *req,
2227 TALLOC_CTX *mem_ctx,
2228 WERROR *result)
2230 struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
2231 req, struct rpccli_wkssvc_NetrMessageBufferSend_state);
2232 NTSTATUS status;
2234 if (tevent_req_is_nterror(req, &status)) {
2235 tevent_req_received(req);
2236 return status;
2239 /* Steal possbile out parameters to the callers context */
2240 talloc_steal(mem_ctx, state->out_mem_ctx);
2242 /* Return result */
2243 *result = state->orig.out.result;
2245 tevent_req_received(req);
2246 return NT_STATUS_OK;
2249 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
2250 TALLOC_CTX *mem_ctx,
2251 const char *server_name /* [in] [unique,charset(UTF16)] */,
2252 const char *message_name /* [in] [ref,charset(UTF16)] */,
2253 const char *message_sender_name /* [in] [unique,charset(UTF16)] */,
2254 uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */,
2255 uint32_t message_size /* [in] */,
2256 WERROR *werror)
2258 struct wkssvc_NetrMessageBufferSend r;
2259 NTSTATUS status;
2261 /* In parameters */
2262 r.in.server_name = server_name;
2263 r.in.message_name = message_name;
2264 r.in.message_sender_name = message_sender_name;
2265 r.in.message_buffer = message_buffer;
2266 r.in.message_size = message_size;
2268 if (DEBUGLEVEL >= 10) {
2269 NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &r);
2272 status = cli->dispatch(cli,
2273 mem_ctx,
2274 &ndr_table_wkssvc,
2275 NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
2276 &r);
2278 if (!NT_STATUS_IS_OK(status)) {
2279 return status;
2282 if (DEBUGLEVEL >= 10) {
2283 NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &r);
2286 if (NT_STATUS_IS_ERR(status)) {
2287 return status;
2290 /* Return variables */
2292 /* Return result */
2293 if (werror) {
2294 *werror = r.out.result;
2297 return werror_to_ntstatus(r.out.result);
2300 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state {
2301 struct wkssvc_NetrWorkstationStatisticsGet orig;
2302 struct wkssvc_NetrWorkstationStatisticsGet tmp;
2303 TALLOC_CTX *out_mem_ctx;
2304 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2307 static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq);
2309 struct tevent_req *rpccli_wkssvc_NetrWorkstationStatisticsGet_send(TALLOC_CTX *mem_ctx,
2310 struct tevent_context *ev,
2311 struct rpc_pipe_client *cli,
2312 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2313 const char *_unknown2 /* [in] [unique,charset(UTF16)] */,
2314 uint32_t _unknown3 /* [in] */,
2315 uint32_t _unknown4 /* [in] */,
2316 struct wkssvc_NetrWorkstationStatistics **_info /* [out] [ref] */)
2318 struct tevent_req *req;
2319 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state;
2320 struct tevent_req *subreq;
2322 req = tevent_req_create(mem_ctx, &state,
2323 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2324 if (req == NULL) {
2325 return NULL;
2327 state->out_mem_ctx = NULL;
2328 state->dispatch_recv = cli->dispatch_recv;
2330 /* In parameters */
2331 state->orig.in.server_name = _server_name;
2332 state->orig.in.unknown2 = _unknown2;
2333 state->orig.in.unknown3 = _unknown3;
2334 state->orig.in.unknown4 = _unknown4;
2336 /* Out parameters */
2337 state->orig.out.info = _info;
2339 /* Result */
2340 ZERO_STRUCT(state->orig.out.result);
2342 if (DEBUGLEVEL >= 10) {
2343 NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &state->orig);
2346 state->out_mem_ctx = talloc_named_const(state, 0,
2347 "rpccli_wkssvc_NetrWorkstationStatisticsGet_out_memory");
2348 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2349 return tevent_req_post(req, ev);
2352 /* make a temporary copy, that we pass to the dispatch function */
2353 state->tmp = state->orig;
2355 subreq = cli->dispatch_send(state, ev, cli,
2356 &ndr_table_wkssvc,
2357 NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
2358 &state->tmp);
2359 if (tevent_req_nomem(subreq, req)) {
2360 return tevent_req_post(req, ev);
2362 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWorkstationStatisticsGet_done, req);
2363 return req;
2366 static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq)
2368 struct tevent_req *req = tevent_req_callback_data(
2369 subreq, struct tevent_req);
2370 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
2371 req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2372 NTSTATUS status;
2373 TALLOC_CTX *mem_ctx;
2375 if (state->out_mem_ctx) {
2376 mem_ctx = state->out_mem_ctx;
2377 } else {
2378 mem_ctx = state;
2381 status = state->dispatch_recv(subreq, mem_ctx);
2382 TALLOC_FREE(subreq);
2383 if (!NT_STATUS_IS_OK(status)) {
2384 tevent_req_nterror(req, status);
2385 return;
2388 /* Copy out parameters */
2389 *state->orig.out.info = *state->tmp.out.info;
2391 /* Copy result */
2392 state->orig.out.result = state->tmp.out.result;
2394 /* Reset temporary structure */
2395 ZERO_STRUCT(state->tmp);
2397 if (DEBUGLEVEL >= 10) {
2398 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &state->orig);
2401 tevent_req_done(req);
2404 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet_recv(struct tevent_req *req,
2405 TALLOC_CTX *mem_ctx,
2406 WERROR *result)
2408 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
2409 req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2410 NTSTATUS status;
2412 if (tevent_req_is_nterror(req, &status)) {
2413 tevent_req_received(req);
2414 return status;
2417 /* Steal possbile out parameters to the callers context */
2418 talloc_steal(mem_ctx, state->out_mem_ctx);
2420 /* Return result */
2421 *result = state->orig.out.result;
2423 tevent_req_received(req);
2424 return NT_STATUS_OK;
2427 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
2428 TALLOC_CTX *mem_ctx,
2429 const char *server_name /* [in] [unique,charset(UTF16)] */,
2430 const char *unknown2 /* [in] [unique,charset(UTF16)] */,
2431 uint32_t unknown3 /* [in] */,
2432 uint32_t unknown4 /* [in] */,
2433 struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */,
2434 WERROR *werror)
2436 struct wkssvc_NetrWorkstationStatisticsGet r;
2437 NTSTATUS status;
2439 /* In parameters */
2440 r.in.server_name = server_name;
2441 r.in.unknown2 = unknown2;
2442 r.in.unknown3 = unknown3;
2443 r.in.unknown4 = unknown4;
2445 if (DEBUGLEVEL >= 10) {
2446 NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r);
2449 status = cli->dispatch(cli,
2450 mem_ctx,
2451 &ndr_table_wkssvc,
2452 NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
2453 &r);
2455 if (!NT_STATUS_IS_OK(status)) {
2456 return status;
2459 if (DEBUGLEVEL >= 10) {
2460 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r);
2463 if (NT_STATUS_IS_ERR(status)) {
2464 return status;
2467 /* Return variables */
2468 *info = *r.out.info;
2470 /* Return result */
2471 if (werror) {
2472 *werror = r.out.result;
2475 return werror_to_ntstatus(r.out.result);
2478 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state {
2479 struct wkssvc_NetrLogonDomainNameAdd orig;
2480 struct wkssvc_NetrLogonDomainNameAdd tmp;
2481 TALLOC_CTX *out_mem_ctx;
2482 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2485 static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq);
2487 struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameAdd_send(TALLOC_CTX *mem_ctx,
2488 struct tevent_context *ev,
2489 struct rpc_pipe_client *cli,
2490 const char *_domain_name /* [in] [ref,charset(UTF16)] */)
2492 struct tevent_req *req;
2493 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state;
2494 struct tevent_req *subreq;
2496 req = tevent_req_create(mem_ctx, &state,
2497 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2498 if (req == NULL) {
2499 return NULL;
2501 state->out_mem_ctx = NULL;
2502 state->dispatch_recv = cli->dispatch_recv;
2504 /* In parameters */
2505 state->orig.in.domain_name = _domain_name;
2507 /* Out parameters */
2509 /* Result */
2510 ZERO_STRUCT(state->orig.out.result);
2512 if (DEBUGLEVEL >= 10) {
2513 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &state->orig);
2516 /* make a temporary copy, that we pass to the dispatch function */
2517 state->tmp = state->orig;
2519 subreq = cli->dispatch_send(state, ev, cli,
2520 &ndr_table_wkssvc,
2521 NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
2522 &state->tmp);
2523 if (tevent_req_nomem(subreq, req)) {
2524 return tevent_req_post(req, ev);
2526 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameAdd_done, req);
2527 return req;
2530 static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq)
2532 struct tevent_req *req = tevent_req_callback_data(
2533 subreq, struct tevent_req);
2534 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
2535 req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2536 NTSTATUS status;
2537 TALLOC_CTX *mem_ctx;
2539 if (state->out_mem_ctx) {
2540 mem_ctx = state->out_mem_ctx;
2541 } else {
2542 mem_ctx = state;
2545 status = state->dispatch_recv(subreq, mem_ctx);
2546 TALLOC_FREE(subreq);
2547 if (!NT_STATUS_IS_OK(status)) {
2548 tevent_req_nterror(req, status);
2549 return;
2552 /* Copy out parameters */
2554 /* Copy result */
2555 state->orig.out.result = state->tmp.out.result;
2557 /* Reset temporary structure */
2558 ZERO_STRUCT(state->tmp);
2560 if (DEBUGLEVEL >= 10) {
2561 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &state->orig);
2564 tevent_req_done(req);
2567 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd_recv(struct tevent_req *req,
2568 TALLOC_CTX *mem_ctx,
2569 WERROR *result)
2571 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
2572 req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2573 NTSTATUS status;
2575 if (tevent_req_is_nterror(req, &status)) {
2576 tevent_req_received(req);
2577 return status;
2580 /* Steal possbile out parameters to the callers context */
2581 talloc_steal(mem_ctx, state->out_mem_ctx);
2583 /* Return result */
2584 *result = state->orig.out.result;
2586 tevent_req_received(req);
2587 return NT_STATUS_OK;
2590 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli,
2591 TALLOC_CTX *mem_ctx,
2592 const char *domain_name /* [in] [ref,charset(UTF16)] */,
2593 WERROR *werror)
2595 struct wkssvc_NetrLogonDomainNameAdd r;
2596 NTSTATUS status;
2598 /* In parameters */
2599 r.in.domain_name = domain_name;
2601 if (DEBUGLEVEL >= 10) {
2602 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r);
2605 status = cli->dispatch(cli,
2606 mem_ctx,
2607 &ndr_table_wkssvc,
2608 NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
2609 &r);
2611 if (!NT_STATUS_IS_OK(status)) {
2612 return status;
2615 if (DEBUGLEVEL >= 10) {
2616 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r);
2619 if (NT_STATUS_IS_ERR(status)) {
2620 return status;
2623 /* Return variables */
2625 /* Return result */
2626 if (werror) {
2627 *werror = r.out.result;
2630 return werror_to_ntstatus(r.out.result);
2633 struct rpccli_wkssvc_NetrLogonDomainNameDel_state {
2634 struct wkssvc_NetrLogonDomainNameDel orig;
2635 struct wkssvc_NetrLogonDomainNameDel tmp;
2636 TALLOC_CTX *out_mem_ctx;
2637 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2640 static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq);
2642 struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameDel_send(TALLOC_CTX *mem_ctx,
2643 struct tevent_context *ev,
2644 struct rpc_pipe_client *cli,
2645 const char *_domain_name /* [in] [ref,charset(UTF16)] */)
2647 struct tevent_req *req;
2648 struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state;
2649 struct tevent_req *subreq;
2651 req = tevent_req_create(mem_ctx, &state,
2652 struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2653 if (req == NULL) {
2654 return NULL;
2656 state->out_mem_ctx = NULL;
2657 state->dispatch_recv = cli->dispatch_recv;
2659 /* In parameters */
2660 state->orig.in.domain_name = _domain_name;
2662 /* Out parameters */
2664 /* Result */
2665 ZERO_STRUCT(state->orig.out.result);
2667 if (DEBUGLEVEL >= 10) {
2668 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &state->orig);
2671 /* make a temporary copy, that we pass to the dispatch function */
2672 state->tmp = state->orig;
2674 subreq = cli->dispatch_send(state, ev, cli,
2675 &ndr_table_wkssvc,
2676 NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
2677 &state->tmp);
2678 if (tevent_req_nomem(subreq, req)) {
2679 return tevent_req_post(req, ev);
2681 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameDel_done, req);
2682 return req;
2685 static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq)
2687 struct tevent_req *req = tevent_req_callback_data(
2688 subreq, struct tevent_req);
2689 struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
2690 req, struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2691 NTSTATUS status;
2692 TALLOC_CTX *mem_ctx;
2694 if (state->out_mem_ctx) {
2695 mem_ctx = state->out_mem_ctx;
2696 } else {
2697 mem_ctx = state;
2700 status = state->dispatch_recv(subreq, mem_ctx);
2701 TALLOC_FREE(subreq);
2702 if (!NT_STATUS_IS_OK(status)) {
2703 tevent_req_nterror(req, status);
2704 return;
2707 /* Copy out parameters */
2709 /* Copy result */
2710 state->orig.out.result = state->tmp.out.result;
2712 /* Reset temporary structure */
2713 ZERO_STRUCT(state->tmp);
2715 if (DEBUGLEVEL >= 10) {
2716 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &state->orig);
2719 tevent_req_done(req);
2722 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel_recv(struct tevent_req *req,
2723 TALLOC_CTX *mem_ctx,
2724 WERROR *result)
2726 struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
2727 req, struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2728 NTSTATUS status;
2730 if (tevent_req_is_nterror(req, &status)) {
2731 tevent_req_received(req);
2732 return status;
2735 /* Steal possbile out parameters to the callers context */
2736 talloc_steal(mem_ctx, state->out_mem_ctx);
2738 /* Return result */
2739 *result = state->orig.out.result;
2741 tevent_req_received(req);
2742 return NT_STATUS_OK;
2745 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli,
2746 TALLOC_CTX *mem_ctx,
2747 const char *domain_name /* [in] [ref,charset(UTF16)] */,
2748 WERROR *werror)
2750 struct wkssvc_NetrLogonDomainNameDel r;
2751 NTSTATUS status;
2753 /* In parameters */
2754 r.in.domain_name = domain_name;
2756 if (DEBUGLEVEL >= 10) {
2757 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &r);
2760 status = cli->dispatch(cli,
2761 mem_ctx,
2762 &ndr_table_wkssvc,
2763 NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
2764 &r);
2766 if (!NT_STATUS_IS_OK(status)) {
2767 return status;
2770 if (DEBUGLEVEL >= 10) {
2771 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &r);
2774 if (NT_STATUS_IS_ERR(status)) {
2775 return status;
2778 /* Return variables */
2780 /* Return result */
2781 if (werror) {
2782 *werror = r.out.result;
2785 return werror_to_ntstatus(r.out.result);
2788 struct rpccli_wkssvc_NetrJoinDomain_state {
2789 struct wkssvc_NetrJoinDomain orig;
2790 struct wkssvc_NetrJoinDomain tmp;
2791 TALLOC_CTX *out_mem_ctx;
2792 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2795 static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq);
2797 struct tevent_req *rpccli_wkssvc_NetrJoinDomain_send(TALLOC_CTX *mem_ctx,
2798 struct tevent_context *ev,
2799 struct rpc_pipe_client *cli,
2800 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2801 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
2802 const char *_account_ou /* [in] [unique,charset(UTF16)] */,
2803 const char *_Account /* [in] [unique,charset(UTF16)] */,
2804 const char *_password /* [in] [unique,charset(UTF16)] */,
2805 uint32_t _join_flags /* [in] */)
2807 struct tevent_req *req;
2808 struct rpccli_wkssvc_NetrJoinDomain_state *state;
2809 struct tevent_req *subreq;
2811 req = tevent_req_create(mem_ctx, &state,
2812 struct rpccli_wkssvc_NetrJoinDomain_state);
2813 if (req == NULL) {
2814 return NULL;
2816 state->out_mem_ctx = NULL;
2817 state->dispatch_recv = cli->dispatch_recv;
2819 /* In parameters */
2820 state->orig.in.server_name = _server_name;
2821 state->orig.in.domain_name = _domain_name;
2822 state->orig.in.account_ou = _account_ou;
2823 state->orig.in.Account = _Account;
2824 state->orig.in.password = _password;
2825 state->orig.in.join_flags = _join_flags;
2827 /* Out parameters */
2829 /* Result */
2830 ZERO_STRUCT(state->orig.out.result);
2832 if (DEBUGLEVEL >= 10) {
2833 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &state->orig);
2836 /* make a temporary copy, that we pass to the dispatch function */
2837 state->tmp = state->orig;
2839 subreq = cli->dispatch_send(state, ev, cli,
2840 &ndr_table_wkssvc,
2841 NDR_WKSSVC_NETRJOINDOMAIN,
2842 &state->tmp);
2843 if (tevent_req_nomem(subreq, req)) {
2844 return tevent_req_post(req, ev);
2846 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain_done, req);
2847 return req;
2850 static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq)
2852 struct tevent_req *req = tevent_req_callback_data(
2853 subreq, struct tevent_req);
2854 struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
2855 req, struct rpccli_wkssvc_NetrJoinDomain_state);
2856 NTSTATUS status;
2857 TALLOC_CTX *mem_ctx;
2859 if (state->out_mem_ctx) {
2860 mem_ctx = state->out_mem_ctx;
2861 } else {
2862 mem_ctx = state;
2865 status = state->dispatch_recv(subreq, mem_ctx);
2866 TALLOC_FREE(subreq);
2867 if (!NT_STATUS_IS_OK(status)) {
2868 tevent_req_nterror(req, status);
2869 return;
2872 /* Copy out parameters */
2874 /* Copy result */
2875 state->orig.out.result = state->tmp.out.result;
2877 /* Reset temporary structure */
2878 ZERO_STRUCT(state->tmp);
2880 if (DEBUGLEVEL >= 10) {
2881 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &state->orig);
2884 tevent_req_done(req);
2887 NTSTATUS rpccli_wkssvc_NetrJoinDomain_recv(struct tevent_req *req,
2888 TALLOC_CTX *mem_ctx,
2889 WERROR *result)
2891 struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
2892 req, struct rpccli_wkssvc_NetrJoinDomain_state);
2893 NTSTATUS status;
2895 if (tevent_req_is_nterror(req, &status)) {
2896 tevent_req_received(req);
2897 return status;
2900 /* Steal possbile out parameters to the callers context */
2901 talloc_steal(mem_ctx, state->out_mem_ctx);
2903 /* Return result */
2904 *result = state->orig.out.result;
2906 tevent_req_received(req);
2907 return NT_STATUS_OK;
2910 NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
2911 TALLOC_CTX *mem_ctx,
2912 const char *server_name /* [in] [unique,charset(UTF16)] */,
2913 const char *domain_name /* [in] [ref,charset(UTF16)] */,
2914 const char *account_ou /* [in] [unique,charset(UTF16)] */,
2915 const char *Account /* [in] [unique,charset(UTF16)] */,
2916 const char *password /* [in] [unique,charset(UTF16)] */,
2917 uint32_t join_flags /* [in] */,
2918 WERROR *werror)
2920 struct wkssvc_NetrJoinDomain r;
2921 NTSTATUS status;
2923 /* In parameters */
2924 r.in.server_name = server_name;
2925 r.in.domain_name = domain_name;
2926 r.in.account_ou = account_ou;
2927 r.in.Account = Account;
2928 r.in.password = password;
2929 r.in.join_flags = join_flags;
2931 if (DEBUGLEVEL >= 10) {
2932 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &r);
2935 status = cli->dispatch(cli,
2936 mem_ctx,
2937 &ndr_table_wkssvc,
2938 NDR_WKSSVC_NETRJOINDOMAIN,
2939 &r);
2941 if (!NT_STATUS_IS_OK(status)) {
2942 return status;
2945 if (DEBUGLEVEL >= 10) {
2946 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &r);
2949 if (NT_STATUS_IS_ERR(status)) {
2950 return status;
2953 /* Return variables */
2955 /* Return result */
2956 if (werror) {
2957 *werror = r.out.result;
2960 return werror_to_ntstatus(r.out.result);
2963 struct rpccli_wkssvc_NetrUnjoinDomain_state {
2964 struct wkssvc_NetrUnjoinDomain orig;
2965 struct wkssvc_NetrUnjoinDomain tmp;
2966 TALLOC_CTX *out_mem_ctx;
2967 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2970 static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq);
2972 struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain_send(TALLOC_CTX *mem_ctx,
2973 struct tevent_context *ev,
2974 struct rpc_pipe_client *cli,
2975 const char *_server_name /* [in] [unique,charset(UTF16)] */,
2976 const char *_Account /* [in] [unique,charset(UTF16)] */,
2977 const char *_password /* [in] [unique,charset(UTF16)] */,
2978 uint32_t _unjoin_flags /* [in] */)
2980 struct tevent_req *req;
2981 struct rpccli_wkssvc_NetrUnjoinDomain_state *state;
2982 struct tevent_req *subreq;
2984 req = tevent_req_create(mem_ctx, &state,
2985 struct rpccli_wkssvc_NetrUnjoinDomain_state);
2986 if (req == NULL) {
2987 return NULL;
2989 state->out_mem_ctx = NULL;
2990 state->dispatch_recv = cli->dispatch_recv;
2992 /* In parameters */
2993 state->orig.in.server_name = _server_name;
2994 state->orig.in.Account = _Account;
2995 state->orig.in.password = _password;
2996 state->orig.in.unjoin_flags = _unjoin_flags;
2998 /* Out parameters */
3000 /* Result */
3001 ZERO_STRUCT(state->orig.out.result);
3003 if (DEBUGLEVEL >= 10) {
3004 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &state->orig);
3007 /* make a temporary copy, that we pass to the dispatch function */
3008 state->tmp = state->orig;
3010 subreq = cli->dispatch_send(state, ev, cli,
3011 &ndr_table_wkssvc,
3012 NDR_WKSSVC_NETRUNJOINDOMAIN,
3013 &state->tmp);
3014 if (tevent_req_nomem(subreq, req)) {
3015 return tevent_req_post(req, ev);
3017 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain_done, req);
3018 return req;
3021 static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq)
3023 struct tevent_req *req = tevent_req_callback_data(
3024 subreq, struct tevent_req);
3025 struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
3026 req, struct rpccli_wkssvc_NetrUnjoinDomain_state);
3027 NTSTATUS status;
3028 TALLOC_CTX *mem_ctx;
3030 if (state->out_mem_ctx) {
3031 mem_ctx = state->out_mem_ctx;
3032 } else {
3033 mem_ctx = state;
3036 status = state->dispatch_recv(subreq, mem_ctx);
3037 TALLOC_FREE(subreq);
3038 if (!NT_STATUS_IS_OK(status)) {
3039 tevent_req_nterror(req, status);
3040 return;
3043 /* Copy out parameters */
3045 /* Copy result */
3046 state->orig.out.result = state->tmp.out.result;
3048 /* Reset temporary structure */
3049 ZERO_STRUCT(state->tmp);
3051 if (DEBUGLEVEL >= 10) {
3052 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &state->orig);
3055 tevent_req_done(req);
3058 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain_recv(struct tevent_req *req,
3059 TALLOC_CTX *mem_ctx,
3060 WERROR *result)
3062 struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
3063 req, struct rpccli_wkssvc_NetrUnjoinDomain_state);
3064 NTSTATUS status;
3066 if (tevent_req_is_nterror(req, &status)) {
3067 tevent_req_received(req);
3068 return status;
3071 /* Steal possbile out parameters to the callers context */
3072 talloc_steal(mem_ctx, state->out_mem_ctx);
3074 /* Return result */
3075 *result = state->orig.out.result;
3077 tevent_req_received(req);
3078 return NT_STATUS_OK;
3081 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
3082 TALLOC_CTX *mem_ctx,
3083 const char *server_name /* [in] [unique,charset(UTF16)] */,
3084 const char *Account /* [in] [unique,charset(UTF16)] */,
3085 const char *password /* [in] [unique,charset(UTF16)] */,
3086 uint32_t unjoin_flags /* [in] */,
3087 WERROR *werror)
3089 struct wkssvc_NetrUnjoinDomain r;
3090 NTSTATUS status;
3092 /* In parameters */
3093 r.in.server_name = server_name;
3094 r.in.Account = Account;
3095 r.in.password = password;
3096 r.in.unjoin_flags = unjoin_flags;
3098 if (DEBUGLEVEL >= 10) {
3099 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &r);
3102 status = cli->dispatch(cli,
3103 mem_ctx,
3104 &ndr_table_wkssvc,
3105 NDR_WKSSVC_NETRUNJOINDOMAIN,
3106 &r);
3108 if (!NT_STATUS_IS_OK(status)) {
3109 return status;
3112 if (DEBUGLEVEL >= 10) {
3113 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &r);
3116 if (NT_STATUS_IS_ERR(status)) {
3117 return status;
3120 /* Return variables */
3122 /* Return result */
3123 if (werror) {
3124 *werror = r.out.result;
3127 return werror_to_ntstatus(r.out.result);
3130 struct rpccli_wkssvc_NetrRenameMachineInDomain_state {
3131 struct wkssvc_NetrRenameMachineInDomain orig;
3132 struct wkssvc_NetrRenameMachineInDomain tmp;
3133 TALLOC_CTX *out_mem_ctx;
3134 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3137 static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq);
3139 struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain_send(TALLOC_CTX *mem_ctx,
3140 struct tevent_context *ev,
3141 struct rpc_pipe_client *cli,
3142 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3143 const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
3144 const char *_Account /* [in] [unique,charset(UTF16)] */,
3145 const char *_password /* [in] [unique,charset(UTF16)] */,
3146 uint32_t _RenameOptions /* [in] */)
3148 struct tevent_req *req;
3149 struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state;
3150 struct tevent_req *subreq;
3152 req = tevent_req_create(mem_ctx, &state,
3153 struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
3154 if (req == NULL) {
3155 return NULL;
3157 state->out_mem_ctx = NULL;
3158 state->dispatch_recv = cli->dispatch_recv;
3160 /* In parameters */
3161 state->orig.in.server_name = _server_name;
3162 state->orig.in.NewMachineName = _NewMachineName;
3163 state->orig.in.Account = _Account;
3164 state->orig.in.password = _password;
3165 state->orig.in.RenameOptions = _RenameOptions;
3167 /* Out parameters */
3169 /* Result */
3170 ZERO_STRUCT(state->orig.out.result);
3172 if (DEBUGLEVEL >= 10) {
3173 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &state->orig);
3176 /* make a temporary copy, that we pass to the dispatch function */
3177 state->tmp = state->orig;
3179 subreq = cli->dispatch_send(state, ev, cli,
3180 &ndr_table_wkssvc,
3181 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
3182 &state->tmp);
3183 if (tevent_req_nomem(subreq, req)) {
3184 return tevent_req_post(req, ev);
3186 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain_done, req);
3187 return req;
3190 static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq)
3192 struct tevent_req *req = tevent_req_callback_data(
3193 subreq, struct tevent_req);
3194 struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
3195 req, struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
3196 NTSTATUS status;
3197 TALLOC_CTX *mem_ctx;
3199 if (state->out_mem_ctx) {
3200 mem_ctx = state->out_mem_ctx;
3201 } else {
3202 mem_ctx = state;
3205 status = state->dispatch_recv(subreq, mem_ctx);
3206 TALLOC_FREE(subreq);
3207 if (!NT_STATUS_IS_OK(status)) {
3208 tevent_req_nterror(req, status);
3209 return;
3212 /* Copy out parameters */
3214 /* Copy result */
3215 state->orig.out.result = state->tmp.out.result;
3217 /* Reset temporary structure */
3218 ZERO_STRUCT(state->tmp);
3220 if (DEBUGLEVEL >= 10) {
3221 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &state->orig);
3224 tevent_req_done(req);
3227 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain_recv(struct tevent_req *req,
3228 TALLOC_CTX *mem_ctx,
3229 WERROR *result)
3231 struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
3232 req, struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
3233 NTSTATUS status;
3235 if (tevent_req_is_nterror(req, &status)) {
3236 tevent_req_received(req);
3237 return status;
3240 /* Steal possbile out parameters to the callers context */
3241 talloc_steal(mem_ctx, state->out_mem_ctx);
3243 /* Return result */
3244 *result = state->orig.out.result;
3246 tevent_req_received(req);
3247 return NT_STATUS_OK;
3250 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
3251 TALLOC_CTX *mem_ctx,
3252 const char *server_name /* [in] [unique,charset(UTF16)] */,
3253 const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
3254 const char *Account /* [in] [unique,charset(UTF16)] */,
3255 const char *password /* [in] [unique,charset(UTF16)] */,
3256 uint32_t RenameOptions /* [in] */,
3257 WERROR *werror)
3259 struct wkssvc_NetrRenameMachineInDomain r;
3260 NTSTATUS status;
3262 /* In parameters */
3263 r.in.server_name = server_name;
3264 r.in.NewMachineName = NewMachineName;
3265 r.in.Account = Account;
3266 r.in.password = password;
3267 r.in.RenameOptions = RenameOptions;
3269 if (DEBUGLEVEL >= 10) {
3270 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &r);
3273 status = cli->dispatch(cli,
3274 mem_ctx,
3275 &ndr_table_wkssvc,
3276 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
3277 &r);
3279 if (!NT_STATUS_IS_OK(status)) {
3280 return status;
3283 if (DEBUGLEVEL >= 10) {
3284 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &r);
3287 if (NT_STATUS_IS_ERR(status)) {
3288 return status;
3291 /* Return variables */
3293 /* Return result */
3294 if (werror) {
3295 *werror = r.out.result;
3298 return werror_to_ntstatus(r.out.result);
3301 struct rpccli_wkssvc_NetrValidateName_state {
3302 struct wkssvc_NetrValidateName orig;
3303 struct wkssvc_NetrValidateName tmp;
3304 TALLOC_CTX *out_mem_ctx;
3305 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3308 static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq);
3310 struct tevent_req *rpccli_wkssvc_NetrValidateName_send(TALLOC_CTX *mem_ctx,
3311 struct tevent_context *ev,
3312 struct rpc_pipe_client *cli,
3313 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3314 const char *_name /* [in] [ref,charset(UTF16)] */,
3315 const char *_Account /* [in] [unique,charset(UTF16)] */,
3316 const char *_Password /* [in] [unique,charset(UTF16)] */,
3317 enum wkssvc_NetValidateNameType _name_type /* [in] */)
3319 struct tevent_req *req;
3320 struct rpccli_wkssvc_NetrValidateName_state *state;
3321 struct tevent_req *subreq;
3323 req = tevent_req_create(mem_ctx, &state,
3324 struct rpccli_wkssvc_NetrValidateName_state);
3325 if (req == NULL) {
3326 return NULL;
3328 state->out_mem_ctx = NULL;
3329 state->dispatch_recv = cli->dispatch_recv;
3331 /* In parameters */
3332 state->orig.in.server_name = _server_name;
3333 state->orig.in.name = _name;
3334 state->orig.in.Account = _Account;
3335 state->orig.in.Password = _Password;
3336 state->orig.in.name_type = _name_type;
3338 /* Out parameters */
3340 /* Result */
3341 ZERO_STRUCT(state->orig.out.result);
3343 if (DEBUGLEVEL >= 10) {
3344 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &state->orig);
3347 /* make a temporary copy, that we pass to the dispatch function */
3348 state->tmp = state->orig;
3350 subreq = cli->dispatch_send(state, ev, cli,
3351 &ndr_table_wkssvc,
3352 NDR_WKSSVC_NETRVALIDATENAME,
3353 &state->tmp);
3354 if (tevent_req_nomem(subreq, req)) {
3355 return tevent_req_post(req, ev);
3357 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName_done, req);
3358 return req;
3361 static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq)
3363 struct tevent_req *req = tevent_req_callback_data(
3364 subreq, struct tevent_req);
3365 struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
3366 req, struct rpccli_wkssvc_NetrValidateName_state);
3367 NTSTATUS status;
3368 TALLOC_CTX *mem_ctx;
3370 if (state->out_mem_ctx) {
3371 mem_ctx = state->out_mem_ctx;
3372 } else {
3373 mem_ctx = state;
3376 status = state->dispatch_recv(subreq, mem_ctx);
3377 TALLOC_FREE(subreq);
3378 if (!NT_STATUS_IS_OK(status)) {
3379 tevent_req_nterror(req, status);
3380 return;
3383 /* Copy out parameters */
3385 /* Copy result */
3386 state->orig.out.result = state->tmp.out.result;
3388 /* Reset temporary structure */
3389 ZERO_STRUCT(state->tmp);
3391 if (DEBUGLEVEL >= 10) {
3392 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &state->orig);
3395 tevent_req_done(req);
3398 NTSTATUS rpccli_wkssvc_NetrValidateName_recv(struct tevent_req *req,
3399 TALLOC_CTX *mem_ctx,
3400 WERROR *result)
3402 struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
3403 req, struct rpccli_wkssvc_NetrValidateName_state);
3404 NTSTATUS status;
3406 if (tevent_req_is_nterror(req, &status)) {
3407 tevent_req_received(req);
3408 return status;
3411 /* Steal possbile out parameters to the callers context */
3412 talloc_steal(mem_ctx, state->out_mem_ctx);
3414 /* Return result */
3415 *result = state->orig.out.result;
3417 tevent_req_received(req);
3418 return NT_STATUS_OK;
3421 NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
3422 TALLOC_CTX *mem_ctx,
3423 const char *server_name /* [in] [unique,charset(UTF16)] */,
3424 const char *name /* [in] [ref,charset(UTF16)] */,
3425 const char *Account /* [in] [unique,charset(UTF16)] */,
3426 const char *Password /* [in] [unique,charset(UTF16)] */,
3427 enum wkssvc_NetValidateNameType name_type /* [in] */,
3428 WERROR *werror)
3430 struct wkssvc_NetrValidateName r;
3431 NTSTATUS status;
3433 /* In parameters */
3434 r.in.server_name = server_name;
3435 r.in.name = name;
3436 r.in.Account = Account;
3437 r.in.Password = Password;
3438 r.in.name_type = name_type;
3440 if (DEBUGLEVEL >= 10) {
3441 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &r);
3444 status = cli->dispatch(cli,
3445 mem_ctx,
3446 &ndr_table_wkssvc,
3447 NDR_WKSSVC_NETRVALIDATENAME,
3448 &r);
3450 if (!NT_STATUS_IS_OK(status)) {
3451 return status;
3454 if (DEBUGLEVEL >= 10) {
3455 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &r);
3458 if (NT_STATUS_IS_ERR(status)) {
3459 return status;
3462 /* Return variables */
3464 /* Return result */
3465 if (werror) {
3466 *werror = r.out.result;
3469 return werror_to_ntstatus(r.out.result);
3472 struct rpccli_wkssvc_NetrGetJoinInformation_state {
3473 struct wkssvc_NetrGetJoinInformation orig;
3474 struct wkssvc_NetrGetJoinInformation tmp;
3475 TALLOC_CTX *out_mem_ctx;
3476 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3479 static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq);
3481 struct tevent_req *rpccli_wkssvc_NetrGetJoinInformation_send(TALLOC_CTX *mem_ctx,
3482 struct tevent_context *ev,
3483 struct rpc_pipe_client *cli,
3484 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3485 const char **_name_buffer /* [in,out] [ref,charset(UTF16)] */,
3486 enum wkssvc_NetJoinStatus *_name_type /* [out] [ref] */)
3488 struct tevent_req *req;
3489 struct rpccli_wkssvc_NetrGetJoinInformation_state *state;
3490 struct tevent_req *subreq;
3492 req = tevent_req_create(mem_ctx, &state,
3493 struct rpccli_wkssvc_NetrGetJoinInformation_state);
3494 if (req == NULL) {
3495 return NULL;
3497 state->out_mem_ctx = NULL;
3498 state->dispatch_recv = cli->dispatch_recv;
3500 /* In parameters */
3501 state->orig.in.server_name = _server_name;
3502 state->orig.in.name_buffer = _name_buffer;
3504 /* Out parameters */
3505 state->orig.out.name_buffer = _name_buffer;
3506 state->orig.out.name_type = _name_type;
3508 /* Result */
3509 ZERO_STRUCT(state->orig.out.result);
3511 if (DEBUGLEVEL >= 10) {
3512 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &state->orig);
3515 state->out_mem_ctx = talloc_named_const(state, 0,
3516 "rpccli_wkssvc_NetrGetJoinInformation_out_memory");
3517 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3518 return tevent_req_post(req, ev);
3521 /* make a temporary copy, that we pass to the dispatch function */
3522 state->tmp = state->orig;
3524 subreq = cli->dispatch_send(state, ev, cli,
3525 &ndr_table_wkssvc,
3526 NDR_WKSSVC_NETRGETJOININFORMATION,
3527 &state->tmp);
3528 if (tevent_req_nomem(subreq, req)) {
3529 return tevent_req_post(req, ev);
3531 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinInformation_done, req);
3532 return req;
3535 static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq)
3537 struct tevent_req *req = tevent_req_callback_data(
3538 subreq, struct tevent_req);
3539 struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
3540 req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
3541 NTSTATUS status;
3542 TALLOC_CTX *mem_ctx;
3544 if (state->out_mem_ctx) {
3545 mem_ctx = state->out_mem_ctx;
3546 } else {
3547 mem_ctx = state;
3550 status = state->dispatch_recv(subreq, mem_ctx);
3551 TALLOC_FREE(subreq);
3552 if (!NT_STATUS_IS_OK(status)) {
3553 tevent_req_nterror(req, status);
3554 return;
3557 /* Copy out parameters */
3558 *state->orig.out.name_buffer = *state->tmp.out.name_buffer;
3559 *state->orig.out.name_type = *state->tmp.out.name_type;
3561 /* Copy result */
3562 state->orig.out.result = state->tmp.out.result;
3564 /* Reset temporary structure */
3565 ZERO_STRUCT(state->tmp);
3567 if (DEBUGLEVEL >= 10) {
3568 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &state->orig);
3571 tevent_req_done(req);
3574 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation_recv(struct tevent_req *req,
3575 TALLOC_CTX *mem_ctx,
3576 WERROR *result)
3578 struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
3579 req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
3580 NTSTATUS status;
3582 if (tevent_req_is_nterror(req, &status)) {
3583 tevent_req_received(req);
3584 return status;
3587 /* Steal possbile out parameters to the callers context */
3588 talloc_steal(mem_ctx, state->out_mem_ctx);
3590 /* Return result */
3591 *result = state->orig.out.result;
3593 tevent_req_received(req);
3594 return NT_STATUS_OK;
3597 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli,
3598 TALLOC_CTX *mem_ctx,
3599 const char *server_name /* [in] [unique,charset(UTF16)] */,
3600 const char **name_buffer /* [in,out] [ref,charset(UTF16)] */,
3601 enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */,
3602 WERROR *werror)
3604 struct wkssvc_NetrGetJoinInformation r;
3605 NTSTATUS status;
3607 /* In parameters */
3608 r.in.server_name = server_name;
3609 r.in.name_buffer = name_buffer;
3611 if (DEBUGLEVEL >= 10) {
3612 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &r);
3615 status = cli->dispatch(cli,
3616 mem_ctx,
3617 &ndr_table_wkssvc,
3618 NDR_WKSSVC_NETRGETJOININFORMATION,
3619 &r);
3621 if (!NT_STATUS_IS_OK(status)) {
3622 return status;
3625 if (DEBUGLEVEL >= 10) {
3626 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &r);
3629 if (NT_STATUS_IS_ERR(status)) {
3630 return status;
3633 /* Return variables */
3634 *name_buffer = *r.out.name_buffer;
3635 *name_type = *r.out.name_type;
3637 /* Return result */
3638 if (werror) {
3639 *werror = r.out.result;
3642 return werror_to_ntstatus(r.out.result);
3645 struct rpccli_wkssvc_NetrGetJoinableOus_state {
3646 struct wkssvc_NetrGetJoinableOus orig;
3647 struct wkssvc_NetrGetJoinableOus tmp;
3648 TALLOC_CTX *out_mem_ctx;
3649 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3652 static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq);
3654 struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus_send(TALLOC_CTX *mem_ctx,
3655 struct tevent_context *ev,
3656 struct rpc_pipe_client *cli,
3657 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3658 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
3659 const char *_Account /* [in] [unique,charset(UTF16)] */,
3660 const char *_unknown /* [in] [unique,charset(UTF16)] */,
3661 uint32_t *_num_ous /* [in,out] [ref] */,
3662 const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
3664 struct tevent_req *req;
3665 struct rpccli_wkssvc_NetrGetJoinableOus_state *state;
3666 struct tevent_req *subreq;
3668 req = tevent_req_create(mem_ctx, &state,
3669 struct rpccli_wkssvc_NetrGetJoinableOus_state);
3670 if (req == NULL) {
3671 return NULL;
3673 state->out_mem_ctx = NULL;
3674 state->dispatch_recv = cli->dispatch_recv;
3676 /* In parameters */
3677 state->orig.in.server_name = _server_name;
3678 state->orig.in.domain_name = _domain_name;
3679 state->orig.in.Account = _Account;
3680 state->orig.in.unknown = _unknown;
3681 state->orig.in.num_ous = _num_ous;
3683 /* Out parameters */
3684 state->orig.out.num_ous = _num_ous;
3685 state->orig.out.ous = _ous;
3687 /* Result */
3688 ZERO_STRUCT(state->orig.out.result);
3690 if (DEBUGLEVEL >= 10) {
3691 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &state->orig);
3694 state->out_mem_ctx = talloc_named_const(state, 0,
3695 "rpccli_wkssvc_NetrGetJoinableOus_out_memory");
3696 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3697 return tevent_req_post(req, ev);
3700 /* make a temporary copy, that we pass to the dispatch function */
3701 state->tmp = state->orig;
3703 subreq = cli->dispatch_send(state, ev, cli,
3704 &ndr_table_wkssvc,
3705 NDR_WKSSVC_NETRGETJOINABLEOUS,
3706 &state->tmp);
3707 if (tevent_req_nomem(subreq, req)) {
3708 return tevent_req_post(req, ev);
3710 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus_done, req);
3711 return req;
3714 static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq)
3716 struct tevent_req *req = tevent_req_callback_data(
3717 subreq, struct tevent_req);
3718 struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
3719 req, struct rpccli_wkssvc_NetrGetJoinableOus_state);
3720 NTSTATUS status;
3721 TALLOC_CTX *mem_ctx;
3723 if (state->out_mem_ctx) {
3724 mem_ctx = state->out_mem_ctx;
3725 } else {
3726 mem_ctx = state;
3729 status = state->dispatch_recv(subreq, mem_ctx);
3730 TALLOC_FREE(subreq);
3731 if (!NT_STATUS_IS_OK(status)) {
3732 tevent_req_nterror(req, status);
3733 return;
3736 /* Copy out parameters */
3737 *state->orig.out.num_ous = *state->tmp.out.num_ous;
3738 *state->orig.out.ous = *state->tmp.out.ous;
3740 /* Copy result */
3741 state->orig.out.result = state->tmp.out.result;
3743 /* Reset temporary structure */
3744 ZERO_STRUCT(state->tmp);
3746 if (DEBUGLEVEL >= 10) {
3747 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &state->orig);
3750 tevent_req_done(req);
3753 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus_recv(struct tevent_req *req,
3754 TALLOC_CTX *mem_ctx,
3755 WERROR *result)
3757 struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
3758 req, struct rpccli_wkssvc_NetrGetJoinableOus_state);
3759 NTSTATUS status;
3761 if (tevent_req_is_nterror(req, &status)) {
3762 tevent_req_received(req);
3763 return status;
3766 /* Steal possbile out parameters to the callers context */
3767 talloc_steal(mem_ctx, state->out_mem_ctx);
3769 /* Return result */
3770 *result = state->orig.out.result;
3772 tevent_req_received(req);
3773 return NT_STATUS_OK;
3776 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
3777 TALLOC_CTX *mem_ctx,
3778 const char *server_name /* [in] [unique,charset(UTF16)] */,
3779 const char *domain_name /* [in] [ref,charset(UTF16)] */,
3780 const char *Account /* [in] [unique,charset(UTF16)] */,
3781 const char *unknown /* [in] [unique,charset(UTF16)] */,
3782 uint32_t *num_ous /* [in,out] [ref] */,
3783 const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
3784 WERROR *werror)
3786 struct wkssvc_NetrGetJoinableOus r;
3787 NTSTATUS status;
3789 /* In parameters */
3790 r.in.server_name = server_name;
3791 r.in.domain_name = domain_name;
3792 r.in.Account = Account;
3793 r.in.unknown = unknown;
3794 r.in.num_ous = num_ous;
3796 if (DEBUGLEVEL >= 10) {
3797 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &r);
3800 status = cli->dispatch(cli,
3801 mem_ctx,
3802 &ndr_table_wkssvc,
3803 NDR_WKSSVC_NETRGETJOINABLEOUS,
3804 &r);
3806 if (!NT_STATUS_IS_OK(status)) {
3807 return status;
3810 if (DEBUGLEVEL >= 10) {
3811 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &r);
3814 if (NT_STATUS_IS_ERR(status)) {
3815 return status;
3818 /* Return variables */
3819 *num_ous = *r.out.num_ous;
3820 *ous = *r.out.ous;
3822 /* Return result */
3823 if (werror) {
3824 *werror = r.out.result;
3827 return werror_to_ntstatus(r.out.result);
3830 struct rpccli_wkssvc_NetrJoinDomain2_state {
3831 struct wkssvc_NetrJoinDomain2 orig;
3832 struct wkssvc_NetrJoinDomain2 tmp;
3833 TALLOC_CTX *out_mem_ctx;
3834 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3837 static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq);
3839 struct tevent_req *rpccli_wkssvc_NetrJoinDomain2_send(TALLOC_CTX *mem_ctx,
3840 struct tevent_context *ev,
3841 struct rpc_pipe_client *cli,
3842 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3843 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
3844 const char *_account_ou /* [in] [unique,charset(UTF16)] */,
3845 const char *_admin_account /* [in] [unique,charset(UTF16)] */,
3846 struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
3847 uint32_t _join_flags /* [in] */)
3849 struct tevent_req *req;
3850 struct rpccli_wkssvc_NetrJoinDomain2_state *state;
3851 struct tevent_req *subreq;
3853 req = tevent_req_create(mem_ctx, &state,
3854 struct rpccli_wkssvc_NetrJoinDomain2_state);
3855 if (req == NULL) {
3856 return NULL;
3858 state->out_mem_ctx = NULL;
3859 state->dispatch_recv = cli->dispatch_recv;
3861 /* In parameters */
3862 state->orig.in.server_name = _server_name;
3863 state->orig.in.domain_name = _domain_name;
3864 state->orig.in.account_ou = _account_ou;
3865 state->orig.in.admin_account = _admin_account;
3866 state->orig.in.encrypted_password = _encrypted_password;
3867 state->orig.in.join_flags = _join_flags;
3869 /* Out parameters */
3871 /* Result */
3872 ZERO_STRUCT(state->orig.out.result);
3874 if (DEBUGLEVEL >= 10) {
3875 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &state->orig);
3878 /* make a temporary copy, that we pass to the dispatch function */
3879 state->tmp = state->orig;
3881 subreq = cli->dispatch_send(state, ev, cli,
3882 &ndr_table_wkssvc,
3883 NDR_WKSSVC_NETRJOINDOMAIN2,
3884 &state->tmp);
3885 if (tevent_req_nomem(subreq, req)) {
3886 return tevent_req_post(req, ev);
3888 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain2_done, req);
3889 return req;
3892 static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq)
3894 struct tevent_req *req = tevent_req_callback_data(
3895 subreq, struct tevent_req);
3896 struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
3897 req, struct rpccli_wkssvc_NetrJoinDomain2_state);
3898 NTSTATUS status;
3899 TALLOC_CTX *mem_ctx;
3901 if (state->out_mem_ctx) {
3902 mem_ctx = state->out_mem_ctx;
3903 } else {
3904 mem_ctx = state;
3907 status = state->dispatch_recv(subreq, mem_ctx);
3908 TALLOC_FREE(subreq);
3909 if (!NT_STATUS_IS_OK(status)) {
3910 tevent_req_nterror(req, status);
3911 return;
3914 /* Copy out parameters */
3916 /* Copy result */
3917 state->orig.out.result = state->tmp.out.result;
3919 /* Reset temporary structure */
3920 ZERO_STRUCT(state->tmp);
3922 if (DEBUGLEVEL >= 10) {
3923 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &state->orig);
3926 tevent_req_done(req);
3929 NTSTATUS rpccli_wkssvc_NetrJoinDomain2_recv(struct tevent_req *req,
3930 TALLOC_CTX *mem_ctx,
3931 WERROR *result)
3933 struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
3934 req, struct rpccli_wkssvc_NetrJoinDomain2_state);
3935 NTSTATUS status;
3937 if (tevent_req_is_nterror(req, &status)) {
3938 tevent_req_received(req);
3939 return status;
3942 /* Steal possbile out parameters to the callers context */
3943 talloc_steal(mem_ctx, state->out_mem_ctx);
3945 /* Return result */
3946 *result = state->orig.out.result;
3948 tevent_req_received(req);
3949 return NT_STATUS_OK;
3952 NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
3953 TALLOC_CTX *mem_ctx,
3954 const char *server_name /* [in] [unique,charset(UTF16)] */,
3955 const char *domain_name /* [in] [ref,charset(UTF16)] */,
3956 const char *account_ou /* [in] [unique,charset(UTF16)] */,
3957 const char *admin_account /* [in] [unique,charset(UTF16)] */,
3958 struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
3959 uint32_t join_flags /* [in] */,
3960 WERROR *werror)
3962 struct wkssvc_NetrJoinDomain2 r;
3963 NTSTATUS status;
3965 /* In parameters */
3966 r.in.server_name = server_name;
3967 r.in.domain_name = domain_name;
3968 r.in.account_ou = account_ou;
3969 r.in.admin_account = admin_account;
3970 r.in.encrypted_password = encrypted_password;
3971 r.in.join_flags = join_flags;
3973 if (DEBUGLEVEL >= 10) {
3974 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &r);
3977 status = cli->dispatch(cli,
3978 mem_ctx,
3979 &ndr_table_wkssvc,
3980 NDR_WKSSVC_NETRJOINDOMAIN2,
3981 &r);
3983 if (!NT_STATUS_IS_OK(status)) {
3984 return status;
3987 if (DEBUGLEVEL >= 10) {
3988 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &r);
3991 if (NT_STATUS_IS_ERR(status)) {
3992 return status;
3995 /* Return variables */
3997 /* Return result */
3998 if (werror) {
3999 *werror = r.out.result;
4002 return werror_to_ntstatus(r.out.result);
4005 struct rpccli_wkssvc_NetrUnjoinDomain2_state {
4006 struct wkssvc_NetrUnjoinDomain2 orig;
4007 struct wkssvc_NetrUnjoinDomain2 tmp;
4008 TALLOC_CTX *out_mem_ctx;
4009 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4012 static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq);
4014 struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain2_send(TALLOC_CTX *mem_ctx,
4015 struct tevent_context *ev,
4016 struct rpc_pipe_client *cli,
4017 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4018 const char *_account /* [in] [unique,charset(UTF16)] */,
4019 struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
4020 uint32_t _unjoin_flags /* [in] */)
4022 struct tevent_req *req;
4023 struct rpccli_wkssvc_NetrUnjoinDomain2_state *state;
4024 struct tevent_req *subreq;
4026 req = tevent_req_create(mem_ctx, &state,
4027 struct rpccli_wkssvc_NetrUnjoinDomain2_state);
4028 if (req == NULL) {
4029 return NULL;
4031 state->out_mem_ctx = NULL;
4032 state->dispatch_recv = cli->dispatch_recv;
4034 /* In parameters */
4035 state->orig.in.server_name = _server_name;
4036 state->orig.in.account = _account;
4037 state->orig.in.encrypted_password = _encrypted_password;
4038 state->orig.in.unjoin_flags = _unjoin_flags;
4040 /* Out parameters */
4042 /* Result */
4043 ZERO_STRUCT(state->orig.out.result);
4045 if (DEBUGLEVEL >= 10) {
4046 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &state->orig);
4049 /* make a temporary copy, that we pass to the dispatch function */
4050 state->tmp = state->orig;
4052 subreq = cli->dispatch_send(state, ev, cli,
4053 &ndr_table_wkssvc,
4054 NDR_WKSSVC_NETRUNJOINDOMAIN2,
4055 &state->tmp);
4056 if (tevent_req_nomem(subreq, req)) {
4057 return tevent_req_post(req, ev);
4059 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain2_done, req);
4060 return req;
4063 static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq)
4065 struct tevent_req *req = tevent_req_callback_data(
4066 subreq, struct tevent_req);
4067 struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
4068 req, struct rpccli_wkssvc_NetrUnjoinDomain2_state);
4069 NTSTATUS status;
4070 TALLOC_CTX *mem_ctx;
4072 if (state->out_mem_ctx) {
4073 mem_ctx = state->out_mem_ctx;
4074 } else {
4075 mem_ctx = state;
4078 status = state->dispatch_recv(subreq, mem_ctx);
4079 TALLOC_FREE(subreq);
4080 if (!NT_STATUS_IS_OK(status)) {
4081 tevent_req_nterror(req, status);
4082 return;
4085 /* Copy out parameters */
4087 /* Copy result */
4088 state->orig.out.result = state->tmp.out.result;
4090 /* Reset temporary structure */
4091 ZERO_STRUCT(state->tmp);
4093 if (DEBUGLEVEL >= 10) {
4094 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &state->orig);
4097 tevent_req_done(req);
4100 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2_recv(struct tevent_req *req,
4101 TALLOC_CTX *mem_ctx,
4102 WERROR *result)
4104 struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
4105 req, struct rpccli_wkssvc_NetrUnjoinDomain2_state);
4106 NTSTATUS status;
4108 if (tevent_req_is_nterror(req, &status)) {
4109 tevent_req_received(req);
4110 return status;
4113 /* Steal possbile out parameters to the callers context */
4114 talloc_steal(mem_ctx, state->out_mem_ctx);
4116 /* Return result */
4117 *result = state->orig.out.result;
4119 tevent_req_received(req);
4120 return NT_STATUS_OK;
4123 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
4124 TALLOC_CTX *mem_ctx,
4125 const char *server_name /* [in] [unique,charset(UTF16)] */,
4126 const char *account /* [in] [unique,charset(UTF16)] */,
4127 struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
4128 uint32_t unjoin_flags /* [in] */,
4129 WERROR *werror)
4131 struct wkssvc_NetrUnjoinDomain2 r;
4132 NTSTATUS status;
4134 /* In parameters */
4135 r.in.server_name = server_name;
4136 r.in.account = account;
4137 r.in.encrypted_password = encrypted_password;
4138 r.in.unjoin_flags = unjoin_flags;
4140 if (DEBUGLEVEL >= 10) {
4141 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &r);
4144 status = cli->dispatch(cli,
4145 mem_ctx,
4146 &ndr_table_wkssvc,
4147 NDR_WKSSVC_NETRUNJOINDOMAIN2,
4148 &r);
4150 if (!NT_STATUS_IS_OK(status)) {
4151 return status;
4154 if (DEBUGLEVEL >= 10) {
4155 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &r);
4158 if (NT_STATUS_IS_ERR(status)) {
4159 return status;
4162 /* Return variables */
4164 /* Return result */
4165 if (werror) {
4166 *werror = r.out.result;
4169 return werror_to_ntstatus(r.out.result);
4172 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state {
4173 struct wkssvc_NetrRenameMachineInDomain2 orig;
4174 struct wkssvc_NetrRenameMachineInDomain2 tmp;
4175 TALLOC_CTX *out_mem_ctx;
4176 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4179 static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq);
4181 struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain2_send(TALLOC_CTX *mem_ctx,
4182 struct tevent_context *ev,
4183 struct rpc_pipe_client *cli,
4184 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4185 const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
4186 const char *_Account /* [in] [unique,charset(UTF16)] */,
4187 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4188 uint32_t _RenameOptions /* [in] */)
4190 struct tevent_req *req;
4191 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state;
4192 struct tevent_req *subreq;
4194 req = tevent_req_create(mem_ctx, &state,
4195 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
4196 if (req == NULL) {
4197 return NULL;
4199 state->out_mem_ctx = NULL;
4200 state->dispatch_recv = cli->dispatch_recv;
4202 /* In parameters */
4203 state->orig.in.server_name = _server_name;
4204 state->orig.in.NewMachineName = _NewMachineName;
4205 state->orig.in.Account = _Account;
4206 state->orig.in.EncryptedPassword = _EncryptedPassword;
4207 state->orig.in.RenameOptions = _RenameOptions;
4209 /* Out parameters */
4211 /* Result */
4212 ZERO_STRUCT(state->orig.out.result);
4214 if (DEBUGLEVEL >= 10) {
4215 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &state->orig);
4218 /* make a temporary copy, that we pass to the dispatch function */
4219 state->tmp = state->orig;
4221 subreq = cli->dispatch_send(state, ev, cli,
4222 &ndr_table_wkssvc,
4223 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
4224 &state->tmp);
4225 if (tevent_req_nomem(subreq, req)) {
4226 return tevent_req_post(req, ev);
4228 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain2_done, req);
4229 return req;
4232 static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq)
4234 struct tevent_req *req = tevent_req_callback_data(
4235 subreq, struct tevent_req);
4236 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
4237 req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
4238 NTSTATUS status;
4239 TALLOC_CTX *mem_ctx;
4241 if (state->out_mem_ctx) {
4242 mem_ctx = state->out_mem_ctx;
4243 } else {
4244 mem_ctx = state;
4247 status = state->dispatch_recv(subreq, mem_ctx);
4248 TALLOC_FREE(subreq);
4249 if (!NT_STATUS_IS_OK(status)) {
4250 tevent_req_nterror(req, status);
4251 return;
4254 /* Copy out parameters */
4256 /* Copy result */
4257 state->orig.out.result = state->tmp.out.result;
4259 /* Reset temporary structure */
4260 ZERO_STRUCT(state->tmp);
4262 if (DEBUGLEVEL >= 10) {
4263 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &state->orig);
4266 tevent_req_done(req);
4269 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2_recv(struct tevent_req *req,
4270 TALLOC_CTX *mem_ctx,
4271 WERROR *result)
4273 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
4274 req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
4275 NTSTATUS status;
4277 if (tevent_req_is_nterror(req, &status)) {
4278 tevent_req_received(req);
4279 return status;
4282 /* Steal possbile out parameters to the callers context */
4283 talloc_steal(mem_ctx, state->out_mem_ctx);
4285 /* Return result */
4286 *result = state->orig.out.result;
4288 tevent_req_received(req);
4289 return NT_STATUS_OK;
4292 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
4293 TALLOC_CTX *mem_ctx,
4294 const char *server_name /* [in] [unique,charset(UTF16)] */,
4295 const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
4296 const char *Account /* [in] [unique,charset(UTF16)] */,
4297 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4298 uint32_t RenameOptions /* [in] */,
4299 WERROR *werror)
4301 struct wkssvc_NetrRenameMachineInDomain2 r;
4302 NTSTATUS status;
4304 /* In parameters */
4305 r.in.server_name = server_name;
4306 r.in.NewMachineName = NewMachineName;
4307 r.in.Account = Account;
4308 r.in.EncryptedPassword = EncryptedPassword;
4309 r.in.RenameOptions = RenameOptions;
4311 if (DEBUGLEVEL >= 10) {
4312 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
4315 status = cli->dispatch(cli,
4316 mem_ctx,
4317 &ndr_table_wkssvc,
4318 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
4319 &r);
4321 if (!NT_STATUS_IS_OK(status)) {
4322 return status;
4325 if (DEBUGLEVEL >= 10) {
4326 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
4329 if (NT_STATUS_IS_ERR(status)) {
4330 return status;
4333 /* Return variables */
4335 /* Return result */
4336 if (werror) {
4337 *werror = r.out.result;
4340 return werror_to_ntstatus(r.out.result);
4343 struct rpccli_wkssvc_NetrValidateName2_state {
4344 struct wkssvc_NetrValidateName2 orig;
4345 struct wkssvc_NetrValidateName2 tmp;
4346 TALLOC_CTX *out_mem_ctx;
4347 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4350 static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq);
4352 struct tevent_req *rpccli_wkssvc_NetrValidateName2_send(TALLOC_CTX *mem_ctx,
4353 struct tevent_context *ev,
4354 struct rpc_pipe_client *cli,
4355 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4356 const char *_name /* [in] [ref,charset(UTF16)] */,
4357 const char *_Account /* [in] [unique,charset(UTF16)] */,
4358 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4359 enum wkssvc_NetValidateNameType _name_type /* [in] */)
4361 struct tevent_req *req;
4362 struct rpccli_wkssvc_NetrValidateName2_state *state;
4363 struct tevent_req *subreq;
4365 req = tevent_req_create(mem_ctx, &state,
4366 struct rpccli_wkssvc_NetrValidateName2_state);
4367 if (req == NULL) {
4368 return NULL;
4370 state->out_mem_ctx = NULL;
4371 state->dispatch_recv = cli->dispatch_recv;
4373 /* In parameters */
4374 state->orig.in.server_name = _server_name;
4375 state->orig.in.name = _name;
4376 state->orig.in.Account = _Account;
4377 state->orig.in.EncryptedPassword = _EncryptedPassword;
4378 state->orig.in.name_type = _name_type;
4380 /* Out parameters */
4382 /* Result */
4383 ZERO_STRUCT(state->orig.out.result);
4385 if (DEBUGLEVEL >= 10) {
4386 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &state->orig);
4389 /* make a temporary copy, that we pass to the dispatch function */
4390 state->tmp = state->orig;
4392 subreq = cli->dispatch_send(state, ev, cli,
4393 &ndr_table_wkssvc,
4394 NDR_WKSSVC_NETRVALIDATENAME2,
4395 &state->tmp);
4396 if (tevent_req_nomem(subreq, req)) {
4397 return tevent_req_post(req, ev);
4399 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName2_done, req);
4400 return req;
4403 static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq)
4405 struct tevent_req *req = tevent_req_callback_data(
4406 subreq, struct tevent_req);
4407 struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
4408 req, struct rpccli_wkssvc_NetrValidateName2_state);
4409 NTSTATUS status;
4410 TALLOC_CTX *mem_ctx;
4412 if (state->out_mem_ctx) {
4413 mem_ctx = state->out_mem_ctx;
4414 } else {
4415 mem_ctx = state;
4418 status = state->dispatch_recv(subreq, mem_ctx);
4419 TALLOC_FREE(subreq);
4420 if (!NT_STATUS_IS_OK(status)) {
4421 tevent_req_nterror(req, status);
4422 return;
4425 /* Copy out parameters */
4427 /* Copy result */
4428 state->orig.out.result = state->tmp.out.result;
4430 /* Reset temporary structure */
4431 ZERO_STRUCT(state->tmp);
4433 if (DEBUGLEVEL >= 10) {
4434 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &state->orig);
4437 tevent_req_done(req);
4440 NTSTATUS rpccli_wkssvc_NetrValidateName2_recv(struct tevent_req *req,
4441 TALLOC_CTX *mem_ctx,
4442 WERROR *result)
4444 struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
4445 req, struct rpccli_wkssvc_NetrValidateName2_state);
4446 NTSTATUS status;
4448 if (tevent_req_is_nterror(req, &status)) {
4449 tevent_req_received(req);
4450 return status;
4453 /* Steal possbile out parameters to the callers context */
4454 talloc_steal(mem_ctx, state->out_mem_ctx);
4456 /* Return result */
4457 *result = state->orig.out.result;
4459 tevent_req_received(req);
4460 return NT_STATUS_OK;
4463 NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
4464 TALLOC_CTX *mem_ctx,
4465 const char *server_name /* [in] [unique,charset(UTF16)] */,
4466 const char *name /* [in] [ref,charset(UTF16)] */,
4467 const char *Account /* [in] [unique,charset(UTF16)] */,
4468 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4469 enum wkssvc_NetValidateNameType name_type /* [in] */,
4470 WERROR *werror)
4472 struct wkssvc_NetrValidateName2 r;
4473 NTSTATUS status;
4475 /* In parameters */
4476 r.in.server_name = server_name;
4477 r.in.name = name;
4478 r.in.Account = Account;
4479 r.in.EncryptedPassword = EncryptedPassword;
4480 r.in.name_type = name_type;
4482 if (DEBUGLEVEL >= 10) {
4483 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &r);
4486 status = cli->dispatch(cli,
4487 mem_ctx,
4488 &ndr_table_wkssvc,
4489 NDR_WKSSVC_NETRVALIDATENAME2,
4490 &r);
4492 if (!NT_STATUS_IS_OK(status)) {
4493 return status;
4496 if (DEBUGLEVEL >= 10) {
4497 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &r);
4500 if (NT_STATUS_IS_ERR(status)) {
4501 return status;
4504 /* Return variables */
4506 /* Return result */
4507 if (werror) {
4508 *werror = r.out.result;
4511 return werror_to_ntstatus(r.out.result);
4514 struct rpccli_wkssvc_NetrGetJoinableOus2_state {
4515 struct wkssvc_NetrGetJoinableOus2 orig;
4516 struct wkssvc_NetrGetJoinableOus2 tmp;
4517 TALLOC_CTX *out_mem_ctx;
4518 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4521 static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq);
4523 struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus2_send(TALLOC_CTX *mem_ctx,
4524 struct tevent_context *ev,
4525 struct rpc_pipe_client *cli,
4526 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4527 const char *_domain_name /* [in] [ref,charset(UTF16)] */,
4528 const char *_Account /* [in] [unique,charset(UTF16)] */,
4529 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4530 uint32_t *_num_ous /* [in,out] [ref] */,
4531 const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
4533 struct tevent_req *req;
4534 struct rpccli_wkssvc_NetrGetJoinableOus2_state *state;
4535 struct tevent_req *subreq;
4537 req = tevent_req_create(mem_ctx, &state,
4538 struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4539 if (req == NULL) {
4540 return NULL;
4542 state->out_mem_ctx = NULL;
4543 state->dispatch_recv = cli->dispatch_recv;
4545 /* In parameters */
4546 state->orig.in.server_name = _server_name;
4547 state->orig.in.domain_name = _domain_name;
4548 state->orig.in.Account = _Account;
4549 state->orig.in.EncryptedPassword = _EncryptedPassword;
4550 state->orig.in.num_ous = _num_ous;
4552 /* Out parameters */
4553 state->orig.out.num_ous = _num_ous;
4554 state->orig.out.ous = _ous;
4556 /* Result */
4557 ZERO_STRUCT(state->orig.out.result);
4559 if (DEBUGLEVEL >= 10) {
4560 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &state->orig);
4563 state->out_mem_ctx = talloc_named_const(state, 0,
4564 "rpccli_wkssvc_NetrGetJoinableOus2_out_memory");
4565 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4566 return tevent_req_post(req, ev);
4569 /* make a temporary copy, that we pass to the dispatch function */
4570 state->tmp = state->orig;
4572 subreq = cli->dispatch_send(state, ev, cli,
4573 &ndr_table_wkssvc,
4574 NDR_WKSSVC_NETRGETJOINABLEOUS2,
4575 &state->tmp);
4576 if (tevent_req_nomem(subreq, req)) {
4577 return tevent_req_post(req, ev);
4579 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus2_done, req);
4580 return req;
4583 static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq)
4585 struct tevent_req *req = tevent_req_callback_data(
4586 subreq, struct tevent_req);
4587 struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
4588 req, struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4589 NTSTATUS status;
4590 TALLOC_CTX *mem_ctx;
4592 if (state->out_mem_ctx) {
4593 mem_ctx = state->out_mem_ctx;
4594 } else {
4595 mem_ctx = state;
4598 status = state->dispatch_recv(subreq, mem_ctx);
4599 TALLOC_FREE(subreq);
4600 if (!NT_STATUS_IS_OK(status)) {
4601 tevent_req_nterror(req, status);
4602 return;
4605 /* Copy out parameters */
4606 *state->orig.out.num_ous = *state->tmp.out.num_ous;
4607 *state->orig.out.ous = *state->tmp.out.ous;
4609 /* Copy result */
4610 state->orig.out.result = state->tmp.out.result;
4612 /* Reset temporary structure */
4613 ZERO_STRUCT(state->tmp);
4615 if (DEBUGLEVEL >= 10) {
4616 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &state->orig);
4619 tevent_req_done(req);
4622 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2_recv(struct tevent_req *req,
4623 TALLOC_CTX *mem_ctx,
4624 WERROR *result)
4626 struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
4627 req, struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4628 NTSTATUS status;
4630 if (tevent_req_is_nterror(req, &status)) {
4631 tevent_req_received(req);
4632 return status;
4635 /* Steal possbile out parameters to the callers context */
4636 talloc_steal(mem_ctx, state->out_mem_ctx);
4638 /* Return result */
4639 *result = state->orig.out.result;
4641 tevent_req_received(req);
4642 return NT_STATUS_OK;
4645 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
4646 TALLOC_CTX *mem_ctx,
4647 const char *server_name /* [in] [unique,charset(UTF16)] */,
4648 const char *domain_name /* [in] [ref,charset(UTF16)] */,
4649 const char *Account /* [in] [unique,charset(UTF16)] */,
4650 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4651 uint32_t *num_ous /* [in,out] [ref] */,
4652 const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
4653 WERROR *werror)
4655 struct wkssvc_NetrGetJoinableOus2 r;
4656 NTSTATUS status;
4658 /* In parameters */
4659 r.in.server_name = server_name;
4660 r.in.domain_name = domain_name;
4661 r.in.Account = Account;
4662 r.in.EncryptedPassword = EncryptedPassword;
4663 r.in.num_ous = num_ous;
4665 if (DEBUGLEVEL >= 10) {
4666 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &r);
4669 status = cli->dispatch(cli,
4670 mem_ctx,
4671 &ndr_table_wkssvc,
4672 NDR_WKSSVC_NETRGETJOINABLEOUS2,
4673 &r);
4675 if (!NT_STATUS_IS_OK(status)) {
4676 return status;
4679 if (DEBUGLEVEL >= 10) {
4680 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &r);
4683 if (NT_STATUS_IS_ERR(status)) {
4684 return status;
4687 /* Return variables */
4688 *num_ous = *r.out.num_ous;
4689 *ous = *r.out.ous;
4691 /* Return result */
4692 if (werror) {
4693 *werror = r.out.result;
4696 return werror_to_ntstatus(r.out.result);
4699 struct rpccli_wkssvc_NetrAddAlternateComputerName_state {
4700 struct wkssvc_NetrAddAlternateComputerName orig;
4701 struct wkssvc_NetrAddAlternateComputerName tmp;
4702 TALLOC_CTX *out_mem_ctx;
4703 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4706 static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq);
4708 struct tevent_req *rpccli_wkssvc_NetrAddAlternateComputerName_send(TALLOC_CTX *mem_ctx,
4709 struct tevent_context *ev,
4710 struct rpc_pipe_client *cli,
4711 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4712 const char *_NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
4713 const char *_Account /* [in] [unique,charset(UTF16)] */,
4714 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4715 uint32_t _Reserved /* [in] */)
4717 struct tevent_req *req;
4718 struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state;
4719 struct tevent_req *subreq;
4721 req = tevent_req_create(mem_ctx, &state,
4722 struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4723 if (req == NULL) {
4724 return NULL;
4726 state->out_mem_ctx = NULL;
4727 state->dispatch_recv = cli->dispatch_recv;
4729 /* In parameters */
4730 state->orig.in.server_name = _server_name;
4731 state->orig.in.NewAlternateMachineName = _NewAlternateMachineName;
4732 state->orig.in.Account = _Account;
4733 state->orig.in.EncryptedPassword = _EncryptedPassword;
4734 state->orig.in.Reserved = _Reserved;
4736 /* Out parameters */
4738 /* Result */
4739 ZERO_STRUCT(state->orig.out.result);
4741 if (DEBUGLEVEL >= 10) {
4742 NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &state->orig);
4745 /* make a temporary copy, that we pass to the dispatch function */
4746 state->tmp = state->orig;
4748 subreq = cli->dispatch_send(state, ev, cli,
4749 &ndr_table_wkssvc,
4750 NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
4751 &state->tmp);
4752 if (tevent_req_nomem(subreq, req)) {
4753 return tevent_req_post(req, ev);
4755 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrAddAlternateComputerName_done, req);
4756 return req;
4759 static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq)
4761 struct tevent_req *req = tevent_req_callback_data(
4762 subreq, struct tevent_req);
4763 struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
4764 req, struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4765 NTSTATUS status;
4766 TALLOC_CTX *mem_ctx;
4768 if (state->out_mem_ctx) {
4769 mem_ctx = state->out_mem_ctx;
4770 } else {
4771 mem_ctx = state;
4774 status = state->dispatch_recv(subreq, mem_ctx);
4775 TALLOC_FREE(subreq);
4776 if (!NT_STATUS_IS_OK(status)) {
4777 tevent_req_nterror(req, status);
4778 return;
4781 /* Copy out parameters */
4783 /* Copy result */
4784 state->orig.out.result = state->tmp.out.result;
4786 /* Reset temporary structure */
4787 ZERO_STRUCT(state->tmp);
4789 if (DEBUGLEVEL >= 10) {
4790 NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &state->orig);
4793 tevent_req_done(req);
4796 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName_recv(struct tevent_req *req,
4797 TALLOC_CTX *mem_ctx,
4798 WERROR *result)
4800 struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
4801 req, struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4802 NTSTATUS status;
4804 if (tevent_req_is_nterror(req, &status)) {
4805 tevent_req_received(req);
4806 return status;
4809 /* Steal possbile out parameters to the callers context */
4810 talloc_steal(mem_ctx, state->out_mem_ctx);
4812 /* Return result */
4813 *result = state->orig.out.result;
4815 tevent_req_received(req);
4816 return NT_STATUS_OK;
4819 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
4820 TALLOC_CTX *mem_ctx,
4821 const char *server_name /* [in] [unique,charset(UTF16)] */,
4822 const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
4823 const char *Account /* [in] [unique,charset(UTF16)] */,
4824 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4825 uint32_t Reserved /* [in] */,
4826 WERROR *werror)
4828 struct wkssvc_NetrAddAlternateComputerName r;
4829 NTSTATUS status;
4831 /* In parameters */
4832 r.in.server_name = server_name;
4833 r.in.NewAlternateMachineName = NewAlternateMachineName;
4834 r.in.Account = Account;
4835 r.in.EncryptedPassword = EncryptedPassword;
4836 r.in.Reserved = Reserved;
4838 if (DEBUGLEVEL >= 10) {
4839 NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &r);
4842 status = cli->dispatch(cli,
4843 mem_ctx,
4844 &ndr_table_wkssvc,
4845 NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
4846 &r);
4848 if (!NT_STATUS_IS_OK(status)) {
4849 return status;
4852 if (DEBUGLEVEL >= 10) {
4853 NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &r);
4856 if (NT_STATUS_IS_ERR(status)) {
4857 return status;
4860 /* Return variables */
4862 /* Return result */
4863 if (werror) {
4864 *werror = r.out.result;
4867 return werror_to_ntstatus(r.out.result);
4870 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state {
4871 struct wkssvc_NetrRemoveAlternateComputerName orig;
4872 struct wkssvc_NetrRemoveAlternateComputerName tmp;
4873 TALLOC_CTX *out_mem_ctx;
4874 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4877 static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq);
4879 struct tevent_req *rpccli_wkssvc_NetrRemoveAlternateComputerName_send(TALLOC_CTX *mem_ctx,
4880 struct tevent_context *ev,
4881 struct rpc_pipe_client *cli,
4882 const char *_server_name /* [in] [unique,charset(UTF16)] */,
4883 const char *_AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
4884 const char *_Account /* [in] [unique,charset(UTF16)] */,
4885 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4886 uint32_t _Reserved /* [in] */)
4888 struct tevent_req *req;
4889 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state;
4890 struct tevent_req *subreq;
4892 req = tevent_req_create(mem_ctx, &state,
4893 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4894 if (req == NULL) {
4895 return NULL;
4897 state->out_mem_ctx = NULL;
4898 state->dispatch_recv = cli->dispatch_recv;
4900 /* In parameters */
4901 state->orig.in.server_name = _server_name;
4902 state->orig.in.AlternateMachineNameToRemove = _AlternateMachineNameToRemove;
4903 state->orig.in.Account = _Account;
4904 state->orig.in.EncryptedPassword = _EncryptedPassword;
4905 state->orig.in.Reserved = _Reserved;
4907 /* Out parameters */
4909 /* Result */
4910 ZERO_STRUCT(state->orig.out.result);
4912 if (DEBUGLEVEL >= 10) {
4913 NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &state->orig);
4916 /* make a temporary copy, that we pass to the dispatch function */
4917 state->tmp = state->orig;
4919 subreq = cli->dispatch_send(state, ev, cli,
4920 &ndr_table_wkssvc,
4921 NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
4922 &state->tmp);
4923 if (tevent_req_nomem(subreq, req)) {
4924 return tevent_req_post(req, ev);
4926 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRemoveAlternateComputerName_done, req);
4927 return req;
4930 static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq)
4932 struct tevent_req *req = tevent_req_callback_data(
4933 subreq, struct tevent_req);
4934 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
4935 req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4936 NTSTATUS status;
4937 TALLOC_CTX *mem_ctx;
4939 if (state->out_mem_ctx) {
4940 mem_ctx = state->out_mem_ctx;
4941 } else {
4942 mem_ctx = state;
4945 status = state->dispatch_recv(subreq, mem_ctx);
4946 TALLOC_FREE(subreq);
4947 if (!NT_STATUS_IS_OK(status)) {
4948 tevent_req_nterror(req, status);
4949 return;
4952 /* Copy out parameters */
4954 /* Copy result */
4955 state->orig.out.result = state->tmp.out.result;
4957 /* Reset temporary structure */
4958 ZERO_STRUCT(state->tmp);
4960 if (DEBUGLEVEL >= 10) {
4961 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &state->orig);
4964 tevent_req_done(req);
4967 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName_recv(struct tevent_req *req,
4968 TALLOC_CTX *mem_ctx,
4969 WERROR *result)
4971 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
4972 req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4973 NTSTATUS status;
4975 if (tevent_req_is_nterror(req, &status)) {
4976 tevent_req_received(req);
4977 return status;
4980 /* Steal possbile out parameters to the callers context */
4981 talloc_steal(mem_ctx, state->out_mem_ctx);
4983 /* Return result */
4984 *result = state->orig.out.result;
4986 tevent_req_received(req);
4987 return NT_STATUS_OK;
4990 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli,
4991 TALLOC_CTX *mem_ctx,
4992 const char *server_name /* [in] [unique,charset(UTF16)] */,
4993 const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
4994 const char *Account /* [in] [unique,charset(UTF16)] */,
4995 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4996 uint32_t Reserved /* [in] */,
4997 WERROR *werror)
4999 struct wkssvc_NetrRemoveAlternateComputerName r;
5000 NTSTATUS status;
5002 /* In parameters */
5003 r.in.server_name = server_name;
5004 r.in.AlternateMachineNameToRemove = AlternateMachineNameToRemove;
5005 r.in.Account = Account;
5006 r.in.EncryptedPassword = EncryptedPassword;
5007 r.in.Reserved = Reserved;
5009 if (DEBUGLEVEL >= 10) {
5010 NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r);
5013 status = cli->dispatch(cli,
5014 mem_ctx,
5015 &ndr_table_wkssvc,
5016 NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
5017 &r);
5019 if (!NT_STATUS_IS_OK(status)) {
5020 return status;
5023 if (DEBUGLEVEL >= 10) {
5024 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r);
5027 if (NT_STATUS_IS_ERR(status)) {
5028 return status;
5031 /* Return variables */
5033 /* Return result */
5034 if (werror) {
5035 *werror = r.out.result;
5038 return werror_to_ntstatus(r.out.result);
5041 struct rpccli_wkssvc_NetrSetPrimaryComputername_state {
5042 struct wkssvc_NetrSetPrimaryComputername orig;
5043 struct wkssvc_NetrSetPrimaryComputername tmp;
5044 TALLOC_CTX *out_mem_ctx;
5045 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5048 static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq);
5050 struct tevent_req *rpccli_wkssvc_NetrSetPrimaryComputername_send(TALLOC_CTX *mem_ctx,
5051 struct tevent_context *ev,
5052 struct rpc_pipe_client *cli,
5053 const char *_server_name /* [in] [unique,charset(UTF16)] */,
5054 const char *_primary_name /* [in] [unique,charset(UTF16)] */,
5055 const char *_Account /* [in] [unique,charset(UTF16)] */,
5056 struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
5057 uint32_t _Reserved /* [in] */)
5059 struct tevent_req *req;
5060 struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state;
5061 struct tevent_req *subreq;
5063 req = tevent_req_create(mem_ctx, &state,
5064 struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
5065 if (req == NULL) {
5066 return NULL;
5068 state->out_mem_ctx = NULL;
5069 state->dispatch_recv = cli->dispatch_recv;
5071 /* In parameters */
5072 state->orig.in.server_name = _server_name;
5073 state->orig.in.primary_name = _primary_name;
5074 state->orig.in.Account = _Account;
5075 state->orig.in.EncryptedPassword = _EncryptedPassword;
5076 state->orig.in.Reserved = _Reserved;
5078 /* Out parameters */
5080 /* Result */
5081 ZERO_STRUCT(state->orig.out.result);
5083 if (DEBUGLEVEL >= 10) {
5084 NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &state->orig);
5087 /* make a temporary copy, that we pass to the dispatch function */
5088 state->tmp = state->orig;
5090 subreq = cli->dispatch_send(state, ev, cli,
5091 &ndr_table_wkssvc,
5092 NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
5093 &state->tmp);
5094 if (tevent_req_nomem(subreq, req)) {
5095 return tevent_req_post(req, ev);
5097 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrSetPrimaryComputername_done, req);
5098 return req;
5101 static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq)
5103 struct tevent_req *req = tevent_req_callback_data(
5104 subreq, struct tevent_req);
5105 struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
5106 req, struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
5107 NTSTATUS status;
5108 TALLOC_CTX *mem_ctx;
5110 if (state->out_mem_ctx) {
5111 mem_ctx = state->out_mem_ctx;
5112 } else {
5113 mem_ctx = state;
5116 status = state->dispatch_recv(subreq, mem_ctx);
5117 TALLOC_FREE(subreq);
5118 if (!NT_STATUS_IS_OK(status)) {
5119 tevent_req_nterror(req, status);
5120 return;
5123 /* Copy out parameters */
5125 /* Copy result */
5126 state->orig.out.result = state->tmp.out.result;
5128 /* Reset temporary structure */
5129 ZERO_STRUCT(state->tmp);
5131 if (DEBUGLEVEL >= 10) {
5132 NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &state->orig);
5135 tevent_req_done(req);
5138 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername_recv(struct tevent_req *req,
5139 TALLOC_CTX *mem_ctx,
5140 WERROR *result)
5142 struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
5143 req, struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
5144 NTSTATUS status;
5146 if (tevent_req_is_nterror(req, &status)) {
5147 tevent_req_received(req);
5148 return status;
5151 /* Steal possbile out parameters to the callers context */
5152 talloc_steal(mem_ctx, state->out_mem_ctx);
5154 /* Return result */
5155 *result = state->orig.out.result;
5157 tevent_req_received(req);
5158 return NT_STATUS_OK;
5161 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
5162 TALLOC_CTX *mem_ctx,
5163 const char *server_name /* [in] [unique,charset(UTF16)] */,
5164 const char *primary_name /* [in] [unique,charset(UTF16)] */,
5165 const char *Account /* [in] [unique,charset(UTF16)] */,
5166 struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
5167 uint32_t Reserved /* [in] */,
5168 WERROR *werror)
5170 struct wkssvc_NetrSetPrimaryComputername r;
5171 NTSTATUS status;
5173 /* In parameters */
5174 r.in.server_name = server_name;
5175 r.in.primary_name = primary_name;
5176 r.in.Account = Account;
5177 r.in.EncryptedPassword = EncryptedPassword;
5178 r.in.Reserved = Reserved;
5180 if (DEBUGLEVEL >= 10) {
5181 NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &r);
5184 status = cli->dispatch(cli,
5185 mem_ctx,
5186 &ndr_table_wkssvc,
5187 NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
5188 &r);
5190 if (!NT_STATUS_IS_OK(status)) {
5191 return status;
5194 if (DEBUGLEVEL >= 10) {
5195 NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &r);
5198 if (NT_STATUS_IS_ERR(status)) {
5199 return status;
5202 /* Return variables */
5204 /* Return result */
5205 if (werror) {
5206 *werror = r.out.result;
5209 return werror_to_ntstatus(r.out.result);
5212 struct rpccli_wkssvc_NetrEnumerateComputerNames_state {
5213 struct wkssvc_NetrEnumerateComputerNames orig;
5214 struct wkssvc_NetrEnumerateComputerNames tmp;
5215 TALLOC_CTX *out_mem_ctx;
5216 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5219 static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq);
5221 struct tevent_req *rpccli_wkssvc_NetrEnumerateComputerNames_send(TALLOC_CTX *mem_ctx,
5222 struct tevent_context *ev,
5223 struct rpc_pipe_client *cli,
5224 const char *_server_name /* [in] [unique,charset(UTF16)] */,
5225 enum wkssvc_ComputerNameType _name_type /* [in] */,
5226 uint32_t _Reserved /* [in] */,
5227 struct wkssvc_ComputerNamesCtr **_ctr /* [out] [ref] */)
5229 struct tevent_req *req;
5230 struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state;
5231 struct tevent_req *subreq;
5233 req = tevent_req_create(mem_ctx, &state,
5234 struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
5235 if (req == NULL) {
5236 return NULL;
5238 state->out_mem_ctx = NULL;
5239 state->dispatch_recv = cli->dispatch_recv;
5241 /* In parameters */
5242 state->orig.in.server_name = _server_name;
5243 state->orig.in.name_type = _name_type;
5244 state->orig.in.Reserved = _Reserved;
5246 /* Out parameters */
5247 state->orig.out.ctr = _ctr;
5249 /* Result */
5250 ZERO_STRUCT(state->orig.out.result);
5252 if (DEBUGLEVEL >= 10) {
5253 NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &state->orig);
5256 state->out_mem_ctx = talloc_named_const(state, 0,
5257 "rpccli_wkssvc_NetrEnumerateComputerNames_out_memory");
5258 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5259 return tevent_req_post(req, ev);
5262 /* make a temporary copy, that we pass to the dispatch function */
5263 state->tmp = state->orig;
5265 subreq = cli->dispatch_send(state, ev, cli,
5266 &ndr_table_wkssvc,
5267 NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
5268 &state->tmp);
5269 if (tevent_req_nomem(subreq, req)) {
5270 return tevent_req_post(req, ev);
5272 tevent_req_set_callback(subreq, rpccli_wkssvc_NetrEnumerateComputerNames_done, req);
5273 return req;
5276 static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq)
5278 struct tevent_req *req = tevent_req_callback_data(
5279 subreq, struct tevent_req);
5280 struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
5281 req, struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
5282 NTSTATUS status;
5283 TALLOC_CTX *mem_ctx;
5285 if (state->out_mem_ctx) {
5286 mem_ctx = state->out_mem_ctx;
5287 } else {
5288 mem_ctx = state;
5291 status = state->dispatch_recv(subreq, mem_ctx);
5292 TALLOC_FREE(subreq);
5293 if (!NT_STATUS_IS_OK(status)) {
5294 tevent_req_nterror(req, status);
5295 return;
5298 /* Copy out parameters */
5299 *state->orig.out.ctr = *state->tmp.out.ctr;
5301 /* Copy result */
5302 state->orig.out.result = state->tmp.out.result;
5304 /* Reset temporary structure */
5305 ZERO_STRUCT(state->tmp);
5307 if (DEBUGLEVEL >= 10) {
5308 NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &state->orig);
5311 tevent_req_done(req);
5314 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames_recv(struct tevent_req *req,
5315 TALLOC_CTX *mem_ctx,
5316 WERROR *result)
5318 struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
5319 req, struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
5320 NTSTATUS status;
5322 if (tevent_req_is_nterror(req, &status)) {
5323 tevent_req_received(req);
5324 return status;
5327 /* Steal possbile out parameters to the callers context */
5328 talloc_steal(mem_ctx, state->out_mem_ctx);
5330 /* Return result */
5331 *result = state->orig.out.result;
5333 tevent_req_received(req);
5334 return NT_STATUS_OK;
5337 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli,
5338 TALLOC_CTX *mem_ctx,
5339 const char *server_name /* [in] [unique,charset(UTF16)] */,
5340 enum wkssvc_ComputerNameType name_type /* [in] */,
5341 uint32_t Reserved /* [in] */,
5342 struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */,
5343 WERROR *werror)
5345 struct wkssvc_NetrEnumerateComputerNames r;
5346 NTSTATUS status;
5348 /* In parameters */
5349 r.in.server_name = server_name;
5350 r.in.name_type = name_type;
5351 r.in.Reserved = Reserved;
5353 if (DEBUGLEVEL >= 10) {
5354 NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &r);
5357 status = cli->dispatch(cli,
5358 mem_ctx,
5359 &ndr_table_wkssvc,
5360 NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
5361 &r);
5363 if (!NT_STATUS_IS_OK(status)) {
5364 return status;
5367 if (DEBUGLEVEL >= 10) {
5368 NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &r);
5371 if (NT_STATUS_IS_ERR(status)) {
5372 return status;
5375 /* Return variables */
5376 *ctr = *r.out.ctr;
5378 /* Return result */
5379 if (werror) {
5380 *werror = r.out.result;
5383 return werror_to_ntstatus(r.out.result);