1 /* client functions auto-generated by pidl */
5 #include "lib/util/tevent_ntstatus.h"
6 #include "bin/default/librpc/gen_ndr/ndr_dfs.h"
7 #include "bin/default/librpc/gen_ndr/ndr_dfs_c.h"
9 /* netdfs - client functions generated by pidl */
11 struct dcerpc_dfs_GetManagerVersion_r_state {
12 TALLOC_CTX *out_mem_ctx;
15 static void dcerpc_dfs_GetManagerVersion_r_done(struct tevent_req *subreq);
17 struct tevent_req *dcerpc_dfs_GetManagerVersion_r_send(TALLOC_CTX *mem_ctx,
18 struct tevent_context *ev,
19 struct dcerpc_binding_handle *h,
20 struct dfs_GetManagerVersion *r)
22 struct tevent_req *req;
23 struct dcerpc_dfs_GetManagerVersion_r_state *state;
24 struct tevent_req *subreq;
26 req = tevent_req_create(mem_ctx, &state,
27 struct dcerpc_dfs_GetManagerVersion_r_state);
32 state->out_mem_ctx = talloc_new(state);
33 if (tevent_req_nomem(state->out_mem_ctx, req)) {
34 return tevent_req_post(req, ev);
37 subreq = dcerpc_binding_handle_call_send(state, ev, h,
38 NULL, &ndr_table_netdfs,
39 NDR_DFS_GETMANAGERVERSION, state->out_mem_ctx, r);
40 if (tevent_req_nomem(subreq, req)) {
41 return tevent_req_post(req, ev);
43 tevent_req_set_callback(subreq, dcerpc_dfs_GetManagerVersion_r_done, req);
48 static void dcerpc_dfs_GetManagerVersion_r_done(struct tevent_req *subreq)
50 struct tevent_req *req =
51 tevent_req_callback_data(subreq,
55 status = dcerpc_binding_handle_call_recv(subreq);
57 if (tevent_req_nterror(req, status)) {
64 NTSTATUS dcerpc_dfs_GetManagerVersion_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
66 struct dcerpc_dfs_GetManagerVersion_r_state *state =
68 struct dcerpc_dfs_GetManagerVersion_r_state);
71 if (tevent_req_is_nterror(req, &status)) {
72 tevent_req_received(req);
76 talloc_steal(mem_ctx, state->out_mem_ctx);
78 tevent_req_received(req);
82 NTSTATUS dcerpc_dfs_GetManagerVersion_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetManagerVersion *r)
86 status = dcerpc_binding_handle_call(h,
87 NULL, &ndr_table_netdfs,
88 NDR_DFS_GETMANAGERVERSION, mem_ctx, r);
93 struct dcerpc_dfs_GetManagerVersion_state {
94 struct dfs_GetManagerVersion orig;
95 struct dfs_GetManagerVersion tmp;
96 TALLOC_CTX *out_mem_ctx;
99 static void dcerpc_dfs_GetManagerVersion_done(struct tevent_req *subreq);
101 struct tevent_req *dcerpc_dfs_GetManagerVersion_send(TALLOC_CTX *mem_ctx,
102 struct tevent_context *ev,
103 struct dcerpc_binding_handle *h,
104 enum dfs_ManagerVersion *_version /* [out] [ref] */)
106 struct tevent_req *req;
107 struct dcerpc_dfs_GetManagerVersion_state *state;
108 struct tevent_req *subreq;
110 req = tevent_req_create(mem_ctx, &state,
111 struct dcerpc_dfs_GetManagerVersion_state);
115 state->out_mem_ctx = NULL;
120 state->orig.out.version = _version;
122 state->out_mem_ctx = talloc_named_const(state, 0,
123 "dcerpc_dfs_GetManagerVersion_out_memory");
124 if (tevent_req_nomem(state->out_mem_ctx, req)) {
125 return tevent_req_post(req, ev);
128 /* make a temporary copy, that we pass to the dispatch function */
129 state->tmp = state->orig;
131 subreq = dcerpc_dfs_GetManagerVersion_r_send(state, ev, h, &state->tmp);
132 if (tevent_req_nomem(subreq, req)) {
133 return tevent_req_post(req, ev);
135 tevent_req_set_callback(subreq, dcerpc_dfs_GetManagerVersion_done, req);
139 static void dcerpc_dfs_GetManagerVersion_done(struct tevent_req *subreq)
141 struct tevent_req *req = tevent_req_callback_data(
142 subreq, struct tevent_req);
143 struct dcerpc_dfs_GetManagerVersion_state *state = tevent_req_data(
144 req, struct dcerpc_dfs_GetManagerVersion_state);
148 if (state->out_mem_ctx) {
149 mem_ctx = state->out_mem_ctx;
154 status = dcerpc_dfs_GetManagerVersion_r_recv(subreq, mem_ctx);
156 if (tevent_req_nterror(req, status)) {
160 /* Copy out parameters */
161 *state->orig.out.version = *state->tmp.out.version;
163 /* Reset temporary structure */
164 ZERO_STRUCT(state->tmp);
166 tevent_req_done(req);
169 NTSTATUS dcerpc_dfs_GetManagerVersion_recv(struct tevent_req *req,
172 struct dcerpc_dfs_GetManagerVersion_state *state = tevent_req_data(
173 req, struct dcerpc_dfs_GetManagerVersion_state);
176 if (tevent_req_is_nterror(req, &status)) {
177 tevent_req_received(req);
181 /* Steal possible out parameters to the callers context */
182 talloc_steal(mem_ctx, state->out_mem_ctx);
184 tevent_req_received(req);
188 NTSTATUS dcerpc_dfs_GetManagerVersion(struct dcerpc_binding_handle *h,
190 enum dfs_ManagerVersion *_version /* [out] [ref] */)
192 struct dfs_GetManagerVersion r;
197 status = dcerpc_dfs_GetManagerVersion_r(h, mem_ctx, &r);
198 if (!NT_STATUS_IS_OK(status)) {
202 /* Return variables */
203 *_version = *r.out.version;
210 struct dcerpc_dfs_Add_r_state {
211 TALLOC_CTX *out_mem_ctx;
214 static void dcerpc_dfs_Add_r_done(struct tevent_req *subreq);
216 struct tevent_req *dcerpc_dfs_Add_r_send(TALLOC_CTX *mem_ctx,
217 struct tevent_context *ev,
218 struct dcerpc_binding_handle *h,
221 struct tevent_req *req;
222 struct dcerpc_dfs_Add_r_state *state;
223 struct tevent_req *subreq;
225 req = tevent_req_create(mem_ctx, &state,
226 struct dcerpc_dfs_Add_r_state);
231 state->out_mem_ctx = NULL;
233 subreq = dcerpc_binding_handle_call_send(state, ev, h,
234 NULL, &ndr_table_netdfs,
235 NDR_DFS_ADD, state, r);
236 if (tevent_req_nomem(subreq, req)) {
237 return tevent_req_post(req, ev);
239 tevent_req_set_callback(subreq, dcerpc_dfs_Add_r_done, req);
244 static void dcerpc_dfs_Add_r_done(struct tevent_req *subreq)
246 struct tevent_req *req =
247 tevent_req_callback_data(subreq,
251 status = dcerpc_binding_handle_call_recv(subreq);
253 if (tevent_req_nterror(req, status)) {
257 tevent_req_done(req);
260 NTSTATUS dcerpc_dfs_Add_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
262 struct dcerpc_dfs_Add_r_state *state =
264 struct dcerpc_dfs_Add_r_state);
267 if (tevent_req_is_nterror(req, &status)) {
268 tevent_req_received(req);
272 talloc_steal(mem_ctx, state->out_mem_ctx);
274 tevent_req_received(req);
278 NTSTATUS dcerpc_dfs_Add_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Add *r)
282 status = dcerpc_binding_handle_call(h,
283 NULL, &ndr_table_netdfs,
284 NDR_DFS_ADD, mem_ctx, r);
289 struct dcerpc_dfs_Add_state {
292 TALLOC_CTX *out_mem_ctx;
295 static void dcerpc_dfs_Add_done(struct tevent_req *subreq);
297 struct tevent_req *dcerpc_dfs_Add_send(TALLOC_CTX *mem_ctx,
298 struct tevent_context *ev,
299 struct dcerpc_binding_handle *h,
300 const char *_path /* [in] [ref,charset(UTF16)] */,
301 const char *_server /* [in] [ref,charset(UTF16)] */,
302 const char *_share /* [in] [unique,charset(UTF16)] */,
303 const char *_comment /* [in] [unique,charset(UTF16)] */,
304 uint32_t _flags /* [in] */)
306 struct tevent_req *req;
307 struct dcerpc_dfs_Add_state *state;
308 struct tevent_req *subreq;
310 req = tevent_req_create(mem_ctx, &state,
311 struct dcerpc_dfs_Add_state);
315 state->out_mem_ctx = NULL;
318 state->orig.in.path = _path;
319 state->orig.in.server = _server;
320 state->orig.in.share = _share;
321 state->orig.in.comment = _comment;
322 state->orig.in.flags = _flags;
327 ZERO_STRUCT(state->orig.out.result);
329 /* make a temporary copy, that we pass to the dispatch function */
330 state->tmp = state->orig;
332 subreq = dcerpc_dfs_Add_r_send(state, ev, h, &state->tmp);
333 if (tevent_req_nomem(subreq, req)) {
334 return tevent_req_post(req, ev);
336 tevent_req_set_callback(subreq, dcerpc_dfs_Add_done, req);
340 static void dcerpc_dfs_Add_done(struct tevent_req *subreq)
342 struct tevent_req *req = tevent_req_callback_data(
343 subreq, struct tevent_req);
344 struct dcerpc_dfs_Add_state *state = tevent_req_data(
345 req, struct dcerpc_dfs_Add_state);
349 if (state->out_mem_ctx) {
350 mem_ctx = state->out_mem_ctx;
355 status = dcerpc_dfs_Add_r_recv(subreq, mem_ctx);
357 if (tevent_req_nterror(req, status)) {
361 /* Copy out parameters */
364 state->orig.out.result = state->tmp.out.result;
366 /* Reset temporary structure */
367 ZERO_STRUCT(state->tmp);
369 tevent_req_done(req);
372 NTSTATUS dcerpc_dfs_Add_recv(struct tevent_req *req,
376 struct dcerpc_dfs_Add_state *state = tevent_req_data(
377 req, struct dcerpc_dfs_Add_state);
380 if (tevent_req_is_nterror(req, &status)) {
381 tevent_req_received(req);
385 /* Steal possible out parameters to the callers context */
386 talloc_steal(mem_ctx, state->out_mem_ctx);
389 *result = state->orig.out.result;
391 tevent_req_received(req);
395 NTSTATUS dcerpc_dfs_Add(struct dcerpc_binding_handle *h,
397 const char *_path /* [in] [ref,charset(UTF16)] */,
398 const char *_server /* [in] [ref,charset(UTF16)] */,
399 const char *_share /* [in] [unique,charset(UTF16)] */,
400 const char *_comment /* [in] [unique,charset(UTF16)] */,
401 uint32_t _flags /* [in] */,
409 r.in.server = _server;
411 r.in.comment = _comment;
414 status = dcerpc_dfs_Add_r(h, mem_ctx, &r);
415 if (!NT_STATUS_IS_OK(status)) {
419 /* Return variables */
422 *result = r.out.result;
427 struct dcerpc_dfs_Remove_r_state {
428 TALLOC_CTX *out_mem_ctx;
431 static void dcerpc_dfs_Remove_r_done(struct tevent_req *subreq);
433 struct tevent_req *dcerpc_dfs_Remove_r_send(TALLOC_CTX *mem_ctx,
434 struct tevent_context *ev,
435 struct dcerpc_binding_handle *h,
436 struct dfs_Remove *r)
438 struct tevent_req *req;
439 struct dcerpc_dfs_Remove_r_state *state;
440 struct tevent_req *subreq;
442 req = tevent_req_create(mem_ctx, &state,
443 struct dcerpc_dfs_Remove_r_state);
448 state->out_mem_ctx = NULL;
450 subreq = dcerpc_binding_handle_call_send(state, ev, h,
451 NULL, &ndr_table_netdfs,
452 NDR_DFS_REMOVE, state, r);
453 if (tevent_req_nomem(subreq, req)) {
454 return tevent_req_post(req, ev);
456 tevent_req_set_callback(subreq, dcerpc_dfs_Remove_r_done, req);
461 static void dcerpc_dfs_Remove_r_done(struct tevent_req *subreq)
463 struct tevent_req *req =
464 tevent_req_callback_data(subreq,
468 status = dcerpc_binding_handle_call_recv(subreq);
470 if (tevent_req_nterror(req, status)) {
474 tevent_req_done(req);
477 NTSTATUS dcerpc_dfs_Remove_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
479 struct dcerpc_dfs_Remove_r_state *state =
481 struct dcerpc_dfs_Remove_r_state);
484 if (tevent_req_is_nterror(req, &status)) {
485 tevent_req_received(req);
489 talloc_steal(mem_ctx, state->out_mem_ctx);
491 tevent_req_received(req);
495 NTSTATUS dcerpc_dfs_Remove_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Remove *r)
499 status = dcerpc_binding_handle_call(h,
500 NULL, &ndr_table_netdfs,
501 NDR_DFS_REMOVE, mem_ctx, r);
506 struct dcerpc_dfs_Remove_state {
507 struct dfs_Remove orig;
508 struct dfs_Remove tmp;
509 TALLOC_CTX *out_mem_ctx;
512 static void dcerpc_dfs_Remove_done(struct tevent_req *subreq);
514 struct tevent_req *dcerpc_dfs_Remove_send(TALLOC_CTX *mem_ctx,
515 struct tevent_context *ev,
516 struct dcerpc_binding_handle *h,
517 const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
518 const char *_servername /* [in] [unique,charset(UTF16)] */,
519 const char *_sharename /* [in] [unique,charset(UTF16)] */)
521 struct tevent_req *req;
522 struct dcerpc_dfs_Remove_state *state;
523 struct tevent_req *subreq;
525 req = tevent_req_create(mem_ctx, &state,
526 struct dcerpc_dfs_Remove_state);
530 state->out_mem_ctx = NULL;
533 state->orig.in.dfs_entry_path = _dfs_entry_path;
534 state->orig.in.servername = _servername;
535 state->orig.in.sharename = _sharename;
540 ZERO_STRUCT(state->orig.out.result);
542 /* make a temporary copy, that we pass to the dispatch function */
543 state->tmp = state->orig;
545 subreq = dcerpc_dfs_Remove_r_send(state, ev, h, &state->tmp);
546 if (tevent_req_nomem(subreq, req)) {
547 return tevent_req_post(req, ev);
549 tevent_req_set_callback(subreq, dcerpc_dfs_Remove_done, req);
553 static void dcerpc_dfs_Remove_done(struct tevent_req *subreq)
555 struct tevent_req *req = tevent_req_callback_data(
556 subreq, struct tevent_req);
557 struct dcerpc_dfs_Remove_state *state = tevent_req_data(
558 req, struct dcerpc_dfs_Remove_state);
562 if (state->out_mem_ctx) {
563 mem_ctx = state->out_mem_ctx;
568 status = dcerpc_dfs_Remove_r_recv(subreq, mem_ctx);
570 if (tevent_req_nterror(req, status)) {
574 /* Copy out parameters */
577 state->orig.out.result = state->tmp.out.result;
579 /* Reset temporary structure */
580 ZERO_STRUCT(state->tmp);
582 tevent_req_done(req);
585 NTSTATUS dcerpc_dfs_Remove_recv(struct tevent_req *req,
589 struct dcerpc_dfs_Remove_state *state = tevent_req_data(
590 req, struct dcerpc_dfs_Remove_state);
593 if (tevent_req_is_nterror(req, &status)) {
594 tevent_req_received(req);
598 /* Steal possible out parameters to the callers context */
599 talloc_steal(mem_ctx, state->out_mem_ctx);
602 *result = state->orig.out.result;
604 tevent_req_received(req);
608 NTSTATUS dcerpc_dfs_Remove(struct dcerpc_binding_handle *h,
610 const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
611 const char *_servername /* [in] [unique,charset(UTF16)] */,
612 const char *_sharename /* [in] [unique,charset(UTF16)] */,
619 r.in.dfs_entry_path = _dfs_entry_path;
620 r.in.servername = _servername;
621 r.in.sharename = _sharename;
623 status = dcerpc_dfs_Remove_r(h, mem_ctx, &r);
624 if (!NT_STATUS_IS_OK(status)) {
628 /* Return variables */
631 *result = r.out.result;
636 struct dcerpc_dfs_SetInfo_r_state {
637 TALLOC_CTX *out_mem_ctx;
640 static void dcerpc_dfs_SetInfo_r_done(struct tevent_req *subreq);
642 struct tevent_req *dcerpc_dfs_SetInfo_r_send(TALLOC_CTX *mem_ctx,
643 struct tevent_context *ev,
644 struct dcerpc_binding_handle *h,
645 struct dfs_SetInfo *r)
647 struct tevent_req *req;
648 struct dcerpc_dfs_SetInfo_r_state *state;
649 struct tevent_req *subreq;
651 req = tevent_req_create(mem_ctx, &state,
652 struct dcerpc_dfs_SetInfo_r_state);
657 state->out_mem_ctx = NULL;
659 subreq = dcerpc_binding_handle_call_send(state, ev, h,
660 NULL, &ndr_table_netdfs,
661 NDR_DFS_SETINFO, state, r);
662 if (tevent_req_nomem(subreq, req)) {
663 return tevent_req_post(req, ev);
665 tevent_req_set_callback(subreq, dcerpc_dfs_SetInfo_r_done, req);
670 static void dcerpc_dfs_SetInfo_r_done(struct tevent_req *subreq)
672 struct tevent_req *req =
673 tevent_req_callback_data(subreq,
677 status = dcerpc_binding_handle_call_recv(subreq);
679 if (tevent_req_nterror(req, status)) {
683 tevent_req_done(req);
686 NTSTATUS dcerpc_dfs_SetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
688 struct dcerpc_dfs_SetInfo_r_state *state =
690 struct dcerpc_dfs_SetInfo_r_state);
693 if (tevent_req_is_nterror(req, &status)) {
694 tevent_req_received(req);
698 talloc_steal(mem_ctx, state->out_mem_ctx);
700 tevent_req_received(req);
704 NTSTATUS dcerpc_dfs_SetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_SetInfo *r)
708 status = dcerpc_binding_handle_call(h,
709 NULL, &ndr_table_netdfs,
710 NDR_DFS_SETINFO, mem_ctx, r);
715 struct dcerpc_dfs_SetInfo_state {
716 struct dfs_SetInfo orig;
717 struct dfs_SetInfo tmp;
718 TALLOC_CTX *out_mem_ctx;
721 static void dcerpc_dfs_SetInfo_done(struct tevent_req *subreq);
723 struct tevent_req *dcerpc_dfs_SetInfo_send(TALLOC_CTX *mem_ctx,
724 struct tevent_context *ev,
725 struct dcerpc_binding_handle *h,
726 const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
727 const char *_servername /* [in] [unique,charset(UTF16)] */,
728 const char *_sharename /* [in] [unique,charset(UTF16)] */,
729 uint32_t _level /* [in] */,
730 union dfs_Info *_info /* [in] [ref,switch_is(level)] */)
732 struct tevent_req *req;
733 struct dcerpc_dfs_SetInfo_state *state;
734 struct tevent_req *subreq;
736 req = tevent_req_create(mem_ctx, &state,
737 struct dcerpc_dfs_SetInfo_state);
741 state->out_mem_ctx = NULL;
744 state->orig.in.dfs_entry_path = _dfs_entry_path;
745 state->orig.in.servername = _servername;
746 state->orig.in.sharename = _sharename;
747 state->orig.in.level = _level;
748 state->orig.in.info = _info;
753 ZERO_STRUCT(state->orig.out.result);
755 /* make a temporary copy, that we pass to the dispatch function */
756 state->tmp = state->orig;
758 subreq = dcerpc_dfs_SetInfo_r_send(state, ev, h, &state->tmp);
759 if (tevent_req_nomem(subreq, req)) {
760 return tevent_req_post(req, ev);
762 tevent_req_set_callback(subreq, dcerpc_dfs_SetInfo_done, req);
766 static void dcerpc_dfs_SetInfo_done(struct tevent_req *subreq)
768 struct tevent_req *req = tevent_req_callback_data(
769 subreq, struct tevent_req);
770 struct dcerpc_dfs_SetInfo_state *state = tevent_req_data(
771 req, struct dcerpc_dfs_SetInfo_state);
775 if (state->out_mem_ctx) {
776 mem_ctx = state->out_mem_ctx;
781 status = dcerpc_dfs_SetInfo_r_recv(subreq, mem_ctx);
783 if (tevent_req_nterror(req, status)) {
787 /* Copy out parameters */
790 state->orig.out.result = state->tmp.out.result;
792 /* Reset temporary structure */
793 ZERO_STRUCT(state->tmp);
795 tevent_req_done(req);
798 NTSTATUS dcerpc_dfs_SetInfo_recv(struct tevent_req *req,
802 struct dcerpc_dfs_SetInfo_state *state = tevent_req_data(
803 req, struct dcerpc_dfs_SetInfo_state);
806 if (tevent_req_is_nterror(req, &status)) {
807 tevent_req_received(req);
811 /* Steal possible out parameters to the callers context */
812 talloc_steal(mem_ctx, state->out_mem_ctx);
815 *result = state->orig.out.result;
817 tevent_req_received(req);
821 NTSTATUS dcerpc_dfs_SetInfo(struct dcerpc_binding_handle *h,
823 const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
824 const char *_servername /* [in] [unique,charset(UTF16)] */,
825 const char *_sharename /* [in] [unique,charset(UTF16)] */,
826 uint32_t _level /* [in] */,
827 union dfs_Info *_info /* [in] [ref,switch_is(level)] */,
830 struct dfs_SetInfo r;
834 r.in.dfs_entry_path = _dfs_entry_path;
835 r.in.servername = _servername;
836 r.in.sharename = _sharename;
840 status = dcerpc_dfs_SetInfo_r(h, mem_ctx, &r);
841 if (!NT_STATUS_IS_OK(status)) {
845 /* Return variables */
848 *result = r.out.result;
853 struct dcerpc_dfs_GetInfo_r_state {
854 TALLOC_CTX *out_mem_ctx;
857 static void dcerpc_dfs_GetInfo_r_done(struct tevent_req *subreq);
859 struct tevent_req *dcerpc_dfs_GetInfo_r_send(TALLOC_CTX *mem_ctx,
860 struct tevent_context *ev,
861 struct dcerpc_binding_handle *h,
862 struct dfs_GetInfo *r)
864 struct tevent_req *req;
865 struct dcerpc_dfs_GetInfo_r_state *state;
866 struct tevent_req *subreq;
868 req = tevent_req_create(mem_ctx, &state,
869 struct dcerpc_dfs_GetInfo_r_state);
874 state->out_mem_ctx = talloc_new(state);
875 if (tevent_req_nomem(state->out_mem_ctx, req)) {
876 return tevent_req_post(req, ev);
879 subreq = dcerpc_binding_handle_call_send(state, ev, h,
880 NULL, &ndr_table_netdfs,
881 NDR_DFS_GETINFO, state->out_mem_ctx, r);
882 if (tevent_req_nomem(subreq, req)) {
883 return tevent_req_post(req, ev);
885 tevent_req_set_callback(subreq, dcerpc_dfs_GetInfo_r_done, req);
890 static void dcerpc_dfs_GetInfo_r_done(struct tevent_req *subreq)
892 struct tevent_req *req =
893 tevent_req_callback_data(subreq,
897 status = dcerpc_binding_handle_call_recv(subreq);
899 if (tevent_req_nterror(req, status)) {
903 tevent_req_done(req);
906 NTSTATUS dcerpc_dfs_GetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
908 struct dcerpc_dfs_GetInfo_r_state *state =
910 struct dcerpc_dfs_GetInfo_r_state);
913 if (tevent_req_is_nterror(req, &status)) {
914 tevent_req_received(req);
918 talloc_steal(mem_ctx, state->out_mem_ctx);
920 tevent_req_received(req);
924 NTSTATUS dcerpc_dfs_GetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetInfo *r)
928 status = dcerpc_binding_handle_call(h,
929 NULL, &ndr_table_netdfs,
930 NDR_DFS_GETINFO, mem_ctx, r);
935 struct dcerpc_dfs_GetInfo_state {
936 struct dfs_GetInfo orig;
937 struct dfs_GetInfo tmp;
938 TALLOC_CTX *out_mem_ctx;
941 static void dcerpc_dfs_GetInfo_done(struct tevent_req *subreq);
943 struct tevent_req *dcerpc_dfs_GetInfo_send(TALLOC_CTX *mem_ctx,
944 struct tevent_context *ev,
945 struct dcerpc_binding_handle *h,
946 const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
947 const char *_servername /* [in] [unique,charset(UTF16)] */,
948 const char *_sharename /* [in] [unique,charset(UTF16)] */,
949 uint32_t _level /* [in] */,
950 union dfs_Info *_info /* [out] [ref,switch_is(level)] */)
952 struct tevent_req *req;
953 struct dcerpc_dfs_GetInfo_state *state;
954 struct tevent_req *subreq;
956 req = tevent_req_create(mem_ctx, &state,
957 struct dcerpc_dfs_GetInfo_state);
961 state->out_mem_ctx = NULL;
964 state->orig.in.dfs_entry_path = _dfs_entry_path;
965 state->orig.in.servername = _servername;
966 state->orig.in.sharename = _sharename;
967 state->orig.in.level = _level;
970 state->orig.out.info = _info;
973 ZERO_STRUCT(state->orig.out.result);
975 state->out_mem_ctx = talloc_named_const(state, 0,
976 "dcerpc_dfs_GetInfo_out_memory");
977 if (tevent_req_nomem(state->out_mem_ctx, req)) {
978 return tevent_req_post(req, ev);
981 /* make a temporary copy, that we pass to the dispatch function */
982 state->tmp = state->orig;
984 subreq = dcerpc_dfs_GetInfo_r_send(state, ev, h, &state->tmp);
985 if (tevent_req_nomem(subreq, req)) {
986 return tevent_req_post(req, ev);
988 tevent_req_set_callback(subreq, dcerpc_dfs_GetInfo_done, req);
992 static void dcerpc_dfs_GetInfo_done(struct tevent_req *subreq)
994 struct tevent_req *req = tevent_req_callback_data(
995 subreq, struct tevent_req);
996 struct dcerpc_dfs_GetInfo_state *state = tevent_req_data(
997 req, struct dcerpc_dfs_GetInfo_state);
1001 if (state->out_mem_ctx) {
1002 mem_ctx = state->out_mem_ctx;
1007 status = dcerpc_dfs_GetInfo_r_recv(subreq, mem_ctx);
1008 TALLOC_FREE(subreq);
1009 if (tevent_req_nterror(req, status)) {
1013 /* Copy out parameters */
1014 *state->orig.out.info = *state->tmp.out.info;
1017 state->orig.out.result = state->tmp.out.result;
1019 /* Reset temporary structure */
1020 ZERO_STRUCT(state->tmp);
1022 tevent_req_done(req);
1025 NTSTATUS dcerpc_dfs_GetInfo_recv(struct tevent_req *req,
1026 TALLOC_CTX *mem_ctx,
1029 struct dcerpc_dfs_GetInfo_state *state = tevent_req_data(
1030 req, struct dcerpc_dfs_GetInfo_state);
1033 if (tevent_req_is_nterror(req, &status)) {
1034 tevent_req_received(req);
1038 /* Steal possible out parameters to the callers context */
1039 talloc_steal(mem_ctx, state->out_mem_ctx);
1042 *result = state->orig.out.result;
1044 tevent_req_received(req);
1045 return NT_STATUS_OK;
1048 NTSTATUS dcerpc_dfs_GetInfo(struct dcerpc_binding_handle *h,
1049 TALLOC_CTX *mem_ctx,
1050 const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
1051 const char *_servername /* [in] [unique,charset(UTF16)] */,
1052 const char *_sharename /* [in] [unique,charset(UTF16)] */,
1053 uint32_t _level /* [in] */,
1054 union dfs_Info *_info /* [out] [ref,switch_is(level)] */,
1057 struct dfs_GetInfo r;
1061 r.in.dfs_entry_path = _dfs_entry_path;
1062 r.in.servername = _servername;
1063 r.in.sharename = _sharename;
1064 r.in.level = _level;
1066 status = dcerpc_dfs_GetInfo_r(h, mem_ctx, &r);
1067 if (!NT_STATUS_IS_OK(status)) {
1071 /* Return variables */
1072 *_info = *r.out.info;
1075 *result = r.out.result;
1077 return NT_STATUS_OK;
1080 struct dcerpc_dfs_Enum_r_state {
1081 TALLOC_CTX *out_mem_ctx;
1084 static void dcerpc_dfs_Enum_r_done(struct tevent_req *subreq);
1086 struct tevent_req *dcerpc_dfs_Enum_r_send(TALLOC_CTX *mem_ctx,
1087 struct tevent_context *ev,
1088 struct dcerpc_binding_handle *h,
1091 struct tevent_req *req;
1092 struct dcerpc_dfs_Enum_r_state *state;
1093 struct tevent_req *subreq;
1095 req = tevent_req_create(mem_ctx, &state,
1096 struct dcerpc_dfs_Enum_r_state);
1101 state->out_mem_ctx = talloc_new(state);
1102 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1103 return tevent_req_post(req, ev);
1106 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1107 NULL, &ndr_table_netdfs,
1108 NDR_DFS_ENUM, state->out_mem_ctx, r);
1109 if (tevent_req_nomem(subreq, req)) {
1110 return tevent_req_post(req, ev);
1112 tevent_req_set_callback(subreq, dcerpc_dfs_Enum_r_done, req);
1117 static void dcerpc_dfs_Enum_r_done(struct tevent_req *subreq)
1119 struct tevent_req *req =
1120 tevent_req_callback_data(subreq,
1124 status = dcerpc_binding_handle_call_recv(subreq);
1125 TALLOC_FREE(subreq);
1126 if (tevent_req_nterror(req, status)) {
1130 tevent_req_done(req);
1133 NTSTATUS dcerpc_dfs_Enum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1135 struct dcerpc_dfs_Enum_r_state *state =
1136 tevent_req_data(req,
1137 struct dcerpc_dfs_Enum_r_state);
1140 if (tevent_req_is_nterror(req, &status)) {
1141 tevent_req_received(req);
1145 talloc_steal(mem_ctx, state->out_mem_ctx);
1147 tevent_req_received(req);
1148 return NT_STATUS_OK;
1151 NTSTATUS dcerpc_dfs_Enum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Enum *r)
1155 status = dcerpc_binding_handle_call(h,
1156 NULL, &ndr_table_netdfs,
1157 NDR_DFS_ENUM, mem_ctx, r);
1162 struct dcerpc_dfs_Enum_state {
1163 struct dfs_Enum orig;
1164 struct dfs_Enum tmp;
1165 TALLOC_CTX *out_mem_ctx;
1168 static void dcerpc_dfs_Enum_done(struct tevent_req *subreq);
1170 struct tevent_req *dcerpc_dfs_Enum_send(TALLOC_CTX *mem_ctx,
1171 struct tevent_context *ev,
1172 struct dcerpc_binding_handle *h,
1173 uint32_t _level /* [in] */,
1174 uint32_t _bufsize /* [in] */,
1175 struct dfs_EnumStruct *_info /* [in,out] [unique] */,
1176 uint32_t *_total /* [in,out] [unique] */)
1178 struct tevent_req *req;
1179 struct dcerpc_dfs_Enum_state *state;
1180 struct tevent_req *subreq;
1182 req = tevent_req_create(mem_ctx, &state,
1183 struct dcerpc_dfs_Enum_state);
1187 state->out_mem_ctx = NULL;
1190 state->orig.in.level = _level;
1191 state->orig.in.bufsize = _bufsize;
1192 state->orig.in.info = _info;
1193 state->orig.in.total = _total;
1195 /* Out parameters */
1196 state->orig.out.info = _info;
1197 state->orig.out.total = _total;
1200 ZERO_STRUCT(state->orig.out.result);
1202 state->out_mem_ctx = talloc_named_const(state, 0,
1203 "dcerpc_dfs_Enum_out_memory");
1204 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1205 return tevent_req_post(req, ev);
1208 /* make a temporary copy, that we pass to the dispatch function */
1209 state->tmp = state->orig;
1211 subreq = dcerpc_dfs_Enum_r_send(state, ev, h, &state->tmp);
1212 if (tevent_req_nomem(subreq, req)) {
1213 return tevent_req_post(req, ev);
1215 tevent_req_set_callback(subreq, dcerpc_dfs_Enum_done, req);
1219 static void dcerpc_dfs_Enum_done(struct tevent_req *subreq)
1221 struct tevent_req *req = tevent_req_callback_data(
1222 subreq, struct tevent_req);
1223 struct dcerpc_dfs_Enum_state *state = tevent_req_data(
1224 req, struct dcerpc_dfs_Enum_state);
1226 TALLOC_CTX *mem_ctx;
1228 if (state->out_mem_ctx) {
1229 mem_ctx = state->out_mem_ctx;
1234 status = dcerpc_dfs_Enum_r_recv(subreq, mem_ctx);
1235 TALLOC_FREE(subreq);
1236 if (tevent_req_nterror(req, status)) {
1240 /* Copy out parameters */
1241 if (state->orig.out.info && state->tmp.out.info) {
1242 *state->orig.out.info = *state->tmp.out.info;
1244 if (state->orig.out.total && state->tmp.out.total) {
1245 *state->orig.out.total = *state->tmp.out.total;
1249 state->orig.out.result = state->tmp.out.result;
1251 /* Reset temporary structure */
1252 ZERO_STRUCT(state->tmp);
1254 tevent_req_done(req);
1257 NTSTATUS dcerpc_dfs_Enum_recv(struct tevent_req *req,
1258 TALLOC_CTX *mem_ctx,
1261 struct dcerpc_dfs_Enum_state *state = tevent_req_data(
1262 req, struct dcerpc_dfs_Enum_state);
1265 if (tevent_req_is_nterror(req, &status)) {
1266 tevent_req_received(req);
1270 /* Steal possible out parameters to the callers context */
1271 talloc_steal(mem_ctx, state->out_mem_ctx);
1274 *result = state->orig.out.result;
1276 tevent_req_received(req);
1277 return NT_STATUS_OK;
1280 NTSTATUS dcerpc_dfs_Enum(struct dcerpc_binding_handle *h,
1281 TALLOC_CTX *mem_ctx,
1282 uint32_t _level /* [in] */,
1283 uint32_t _bufsize /* [in] */,
1284 struct dfs_EnumStruct *_info /* [in,out] [unique] */,
1285 uint32_t *_total /* [in,out] [unique] */,
1292 r.in.level = _level;
1293 r.in.bufsize = _bufsize;
1295 r.in.total = _total;
1297 status = dcerpc_dfs_Enum_r(h, mem_ctx, &r);
1298 if (!NT_STATUS_IS_OK(status)) {
1302 /* Return variables */
1303 if (_info && r.out.info) {
1304 *_info = *r.out.info;
1306 if (_total && r.out.total) {
1307 *_total = *r.out.total;
1311 *result = r.out.result;
1313 return NT_STATUS_OK;
1316 struct dcerpc_dfs_AddFtRoot_r_state {
1317 TALLOC_CTX *out_mem_ctx;
1320 static void dcerpc_dfs_AddFtRoot_r_done(struct tevent_req *subreq);
1322 struct tevent_req *dcerpc_dfs_AddFtRoot_r_send(TALLOC_CTX *mem_ctx,
1323 struct tevent_context *ev,
1324 struct dcerpc_binding_handle *h,
1325 struct dfs_AddFtRoot *r)
1327 struct tevent_req *req;
1328 struct dcerpc_dfs_AddFtRoot_r_state *state;
1329 struct tevent_req *subreq;
1331 req = tevent_req_create(mem_ctx, &state,
1332 struct dcerpc_dfs_AddFtRoot_r_state);
1337 state->out_mem_ctx = talloc_new(state);
1338 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1339 return tevent_req_post(req, ev);
1342 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1343 NULL, &ndr_table_netdfs,
1344 NDR_DFS_ADDFTROOT, state->out_mem_ctx, r);
1345 if (tevent_req_nomem(subreq, req)) {
1346 return tevent_req_post(req, ev);
1348 tevent_req_set_callback(subreq, dcerpc_dfs_AddFtRoot_r_done, req);
1353 static void dcerpc_dfs_AddFtRoot_r_done(struct tevent_req *subreq)
1355 struct tevent_req *req =
1356 tevent_req_callback_data(subreq,
1360 status = dcerpc_binding_handle_call_recv(subreq);
1361 TALLOC_FREE(subreq);
1362 if (tevent_req_nterror(req, status)) {
1366 tevent_req_done(req);
1369 NTSTATUS dcerpc_dfs_AddFtRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1371 struct dcerpc_dfs_AddFtRoot_r_state *state =
1372 tevent_req_data(req,
1373 struct dcerpc_dfs_AddFtRoot_r_state);
1376 if (tevent_req_is_nterror(req, &status)) {
1377 tevent_req_received(req);
1381 talloc_steal(mem_ctx, state->out_mem_ctx);
1383 tevent_req_received(req);
1384 return NT_STATUS_OK;
1387 NTSTATUS dcerpc_dfs_AddFtRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddFtRoot *r)
1391 status = dcerpc_binding_handle_call(h,
1392 NULL, &ndr_table_netdfs,
1393 NDR_DFS_ADDFTROOT, mem_ctx, r);
1398 struct dcerpc_dfs_AddFtRoot_state {
1399 struct dfs_AddFtRoot orig;
1400 struct dfs_AddFtRoot tmp;
1401 TALLOC_CTX *out_mem_ctx;
1404 static void dcerpc_dfs_AddFtRoot_done(struct tevent_req *subreq);
1406 struct tevent_req *dcerpc_dfs_AddFtRoot_send(TALLOC_CTX *mem_ctx,
1407 struct tevent_context *ev,
1408 struct dcerpc_binding_handle *h,
1409 const char *_servername /* [in] [charset(UTF16)] */,
1410 const char *_dns_servername /* [in] [charset(UTF16)] */,
1411 const char *_dfsname /* [in] [charset(UTF16)] */,
1412 const char *_rootshare /* [in] [charset(UTF16)] */,
1413 const char *_comment /* [in] [charset(UTF16)] */,
1414 const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
1415 uint8_t _unknown1 /* [in] */,
1416 uint32_t _flags /* [in] */,
1417 struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */)
1419 struct tevent_req *req;
1420 struct dcerpc_dfs_AddFtRoot_state *state;
1421 struct tevent_req *subreq;
1423 req = tevent_req_create(mem_ctx, &state,
1424 struct dcerpc_dfs_AddFtRoot_state);
1428 state->out_mem_ctx = NULL;
1431 state->orig.in.servername = _servername;
1432 state->orig.in.dns_servername = _dns_servername;
1433 state->orig.in.dfsname = _dfsname;
1434 state->orig.in.rootshare = _rootshare;
1435 state->orig.in.comment = _comment;
1436 state->orig.in.dfs_config_dn = _dfs_config_dn;
1437 state->orig.in.unknown1 = _unknown1;
1438 state->orig.in.flags = _flags;
1439 state->orig.in.unknown2 = _unknown2;
1441 /* Out parameters */
1442 state->orig.out.unknown2 = _unknown2;
1445 ZERO_STRUCT(state->orig.out.result);
1447 state->out_mem_ctx = talloc_named_const(state, 0,
1448 "dcerpc_dfs_AddFtRoot_out_memory");
1449 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1450 return tevent_req_post(req, ev);
1453 /* make a temporary copy, that we pass to the dispatch function */
1454 state->tmp = state->orig;
1456 subreq = dcerpc_dfs_AddFtRoot_r_send(state, ev, h, &state->tmp);
1457 if (tevent_req_nomem(subreq, req)) {
1458 return tevent_req_post(req, ev);
1460 tevent_req_set_callback(subreq, dcerpc_dfs_AddFtRoot_done, req);
1464 static void dcerpc_dfs_AddFtRoot_done(struct tevent_req *subreq)
1466 struct tevent_req *req = tevent_req_callback_data(
1467 subreq, struct tevent_req);
1468 struct dcerpc_dfs_AddFtRoot_state *state = tevent_req_data(
1469 req, struct dcerpc_dfs_AddFtRoot_state);
1471 TALLOC_CTX *mem_ctx;
1473 if (state->out_mem_ctx) {
1474 mem_ctx = state->out_mem_ctx;
1479 status = dcerpc_dfs_AddFtRoot_r_recv(subreq, mem_ctx);
1480 TALLOC_FREE(subreq);
1481 if (tevent_req_nterror(req, status)) {
1485 /* Copy out parameters */
1486 if (state->orig.out.unknown2 && state->tmp.out.unknown2) {
1487 *state->orig.out.unknown2 = *state->tmp.out.unknown2;
1491 state->orig.out.result = state->tmp.out.result;
1493 /* Reset temporary structure */
1494 ZERO_STRUCT(state->tmp);
1496 tevent_req_done(req);
1499 NTSTATUS dcerpc_dfs_AddFtRoot_recv(struct tevent_req *req,
1500 TALLOC_CTX *mem_ctx,
1503 struct dcerpc_dfs_AddFtRoot_state *state = tevent_req_data(
1504 req, struct dcerpc_dfs_AddFtRoot_state);
1507 if (tevent_req_is_nterror(req, &status)) {
1508 tevent_req_received(req);
1512 /* Steal possible out parameters to the callers context */
1513 talloc_steal(mem_ctx, state->out_mem_ctx);
1516 *result = state->orig.out.result;
1518 tevent_req_received(req);
1519 return NT_STATUS_OK;
1522 NTSTATUS dcerpc_dfs_AddFtRoot(struct dcerpc_binding_handle *h,
1523 TALLOC_CTX *mem_ctx,
1524 const char *_servername /* [in] [charset(UTF16)] */,
1525 const char *_dns_servername /* [in] [charset(UTF16)] */,
1526 const char *_dfsname /* [in] [charset(UTF16)] */,
1527 const char *_rootshare /* [in] [charset(UTF16)] */,
1528 const char *_comment /* [in] [charset(UTF16)] */,
1529 const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
1530 uint8_t _unknown1 /* [in] */,
1531 uint32_t _flags /* [in] */,
1532 struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */,
1535 struct dfs_AddFtRoot r;
1539 r.in.servername = _servername;
1540 r.in.dns_servername = _dns_servername;
1541 r.in.dfsname = _dfsname;
1542 r.in.rootshare = _rootshare;
1543 r.in.comment = _comment;
1544 r.in.dfs_config_dn = _dfs_config_dn;
1545 r.in.unknown1 = _unknown1;
1546 r.in.flags = _flags;
1547 r.in.unknown2 = _unknown2;
1549 status = dcerpc_dfs_AddFtRoot_r(h, mem_ctx, &r);
1550 if (!NT_STATUS_IS_OK(status)) {
1554 /* Return variables */
1555 if (_unknown2 && r.out.unknown2) {
1556 *_unknown2 = *r.out.unknown2;
1560 *result = r.out.result;
1562 return NT_STATUS_OK;
1565 struct dcerpc_dfs_RemoveFtRoot_r_state {
1566 TALLOC_CTX *out_mem_ctx;
1569 static void dcerpc_dfs_RemoveFtRoot_r_done(struct tevent_req *subreq);
1571 struct tevent_req *dcerpc_dfs_RemoveFtRoot_r_send(TALLOC_CTX *mem_ctx,
1572 struct tevent_context *ev,
1573 struct dcerpc_binding_handle *h,
1574 struct dfs_RemoveFtRoot *r)
1576 struct tevent_req *req;
1577 struct dcerpc_dfs_RemoveFtRoot_r_state *state;
1578 struct tevent_req *subreq;
1580 req = tevent_req_create(mem_ctx, &state,
1581 struct dcerpc_dfs_RemoveFtRoot_r_state);
1586 state->out_mem_ctx = talloc_new(state);
1587 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1588 return tevent_req_post(req, ev);
1591 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1592 NULL, &ndr_table_netdfs,
1593 NDR_DFS_REMOVEFTROOT, state->out_mem_ctx, r);
1594 if (tevent_req_nomem(subreq, req)) {
1595 return tevent_req_post(req, ev);
1597 tevent_req_set_callback(subreq, dcerpc_dfs_RemoveFtRoot_r_done, req);
1602 static void dcerpc_dfs_RemoveFtRoot_r_done(struct tevent_req *subreq)
1604 struct tevent_req *req =
1605 tevent_req_callback_data(subreq,
1609 status = dcerpc_binding_handle_call_recv(subreq);
1610 TALLOC_FREE(subreq);
1611 if (tevent_req_nterror(req, status)) {
1615 tevent_req_done(req);
1618 NTSTATUS dcerpc_dfs_RemoveFtRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1620 struct dcerpc_dfs_RemoveFtRoot_r_state *state =
1621 tevent_req_data(req,
1622 struct dcerpc_dfs_RemoveFtRoot_r_state);
1625 if (tevent_req_is_nterror(req, &status)) {
1626 tevent_req_received(req);
1630 talloc_steal(mem_ctx, state->out_mem_ctx);
1632 tevent_req_received(req);
1633 return NT_STATUS_OK;
1636 NTSTATUS dcerpc_dfs_RemoveFtRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_RemoveFtRoot *r)
1640 status = dcerpc_binding_handle_call(h,
1641 NULL, &ndr_table_netdfs,
1642 NDR_DFS_REMOVEFTROOT, mem_ctx, r);
1647 struct dcerpc_dfs_RemoveFtRoot_state {
1648 struct dfs_RemoveFtRoot orig;
1649 struct dfs_RemoveFtRoot tmp;
1650 TALLOC_CTX *out_mem_ctx;
1653 static void dcerpc_dfs_RemoveFtRoot_done(struct tevent_req *subreq);
1655 struct tevent_req *dcerpc_dfs_RemoveFtRoot_send(TALLOC_CTX *mem_ctx,
1656 struct tevent_context *ev,
1657 struct dcerpc_binding_handle *h,
1658 const char *_servername /* [in] [charset(UTF16)] */,
1659 const char *_dns_servername /* [in] [charset(UTF16)] */,
1660 const char *_dfsname /* [in] [charset(UTF16)] */,
1661 const char *_rootshare /* [in] [charset(UTF16)] */,
1662 uint32_t _flags /* [in] */,
1663 struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */)
1665 struct tevent_req *req;
1666 struct dcerpc_dfs_RemoveFtRoot_state *state;
1667 struct tevent_req *subreq;
1669 req = tevent_req_create(mem_ctx, &state,
1670 struct dcerpc_dfs_RemoveFtRoot_state);
1674 state->out_mem_ctx = NULL;
1677 state->orig.in.servername = _servername;
1678 state->orig.in.dns_servername = _dns_servername;
1679 state->orig.in.dfsname = _dfsname;
1680 state->orig.in.rootshare = _rootshare;
1681 state->orig.in.flags = _flags;
1682 state->orig.in.unknown = _unknown;
1684 /* Out parameters */
1685 state->orig.out.unknown = _unknown;
1688 ZERO_STRUCT(state->orig.out.result);
1690 state->out_mem_ctx = talloc_named_const(state, 0,
1691 "dcerpc_dfs_RemoveFtRoot_out_memory");
1692 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1693 return tevent_req_post(req, ev);
1696 /* make a temporary copy, that we pass to the dispatch function */
1697 state->tmp = state->orig;
1699 subreq = dcerpc_dfs_RemoveFtRoot_r_send(state, ev, h, &state->tmp);
1700 if (tevent_req_nomem(subreq, req)) {
1701 return tevent_req_post(req, ev);
1703 tevent_req_set_callback(subreq, dcerpc_dfs_RemoveFtRoot_done, req);
1707 static void dcerpc_dfs_RemoveFtRoot_done(struct tevent_req *subreq)
1709 struct tevent_req *req = tevent_req_callback_data(
1710 subreq, struct tevent_req);
1711 struct dcerpc_dfs_RemoveFtRoot_state *state = tevent_req_data(
1712 req, struct dcerpc_dfs_RemoveFtRoot_state);
1714 TALLOC_CTX *mem_ctx;
1716 if (state->out_mem_ctx) {
1717 mem_ctx = state->out_mem_ctx;
1722 status = dcerpc_dfs_RemoveFtRoot_r_recv(subreq, mem_ctx);
1723 TALLOC_FREE(subreq);
1724 if (tevent_req_nterror(req, status)) {
1728 /* Copy out parameters */
1729 if (state->orig.out.unknown && state->tmp.out.unknown) {
1730 *state->orig.out.unknown = *state->tmp.out.unknown;
1734 state->orig.out.result = state->tmp.out.result;
1736 /* Reset temporary structure */
1737 ZERO_STRUCT(state->tmp);
1739 tevent_req_done(req);
1742 NTSTATUS dcerpc_dfs_RemoveFtRoot_recv(struct tevent_req *req,
1743 TALLOC_CTX *mem_ctx,
1746 struct dcerpc_dfs_RemoveFtRoot_state *state = tevent_req_data(
1747 req, struct dcerpc_dfs_RemoveFtRoot_state);
1750 if (tevent_req_is_nterror(req, &status)) {
1751 tevent_req_received(req);
1755 /* Steal possible out parameters to the callers context */
1756 talloc_steal(mem_ctx, state->out_mem_ctx);
1759 *result = state->orig.out.result;
1761 tevent_req_received(req);
1762 return NT_STATUS_OK;
1765 NTSTATUS dcerpc_dfs_RemoveFtRoot(struct dcerpc_binding_handle *h,
1766 TALLOC_CTX *mem_ctx,
1767 const char *_servername /* [in] [charset(UTF16)] */,
1768 const char *_dns_servername /* [in] [charset(UTF16)] */,
1769 const char *_dfsname /* [in] [charset(UTF16)] */,
1770 const char *_rootshare /* [in] [charset(UTF16)] */,
1771 uint32_t _flags /* [in] */,
1772 struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */,
1775 struct dfs_RemoveFtRoot r;
1779 r.in.servername = _servername;
1780 r.in.dns_servername = _dns_servername;
1781 r.in.dfsname = _dfsname;
1782 r.in.rootshare = _rootshare;
1783 r.in.flags = _flags;
1784 r.in.unknown = _unknown;
1786 status = dcerpc_dfs_RemoveFtRoot_r(h, mem_ctx, &r);
1787 if (!NT_STATUS_IS_OK(status)) {
1791 /* Return variables */
1792 if (_unknown && r.out.unknown) {
1793 *_unknown = *r.out.unknown;
1797 *result = r.out.result;
1799 return NT_STATUS_OK;
1802 struct dcerpc_dfs_AddStdRoot_r_state {
1803 TALLOC_CTX *out_mem_ctx;
1806 static void dcerpc_dfs_AddStdRoot_r_done(struct tevent_req *subreq);
1808 struct tevent_req *dcerpc_dfs_AddStdRoot_r_send(TALLOC_CTX *mem_ctx,
1809 struct tevent_context *ev,
1810 struct dcerpc_binding_handle *h,
1811 struct dfs_AddStdRoot *r)
1813 struct tevent_req *req;
1814 struct dcerpc_dfs_AddStdRoot_r_state *state;
1815 struct tevent_req *subreq;
1817 req = tevent_req_create(mem_ctx, &state,
1818 struct dcerpc_dfs_AddStdRoot_r_state);
1823 state->out_mem_ctx = NULL;
1825 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1826 NULL, &ndr_table_netdfs,
1827 NDR_DFS_ADDSTDROOT, state, r);
1828 if (tevent_req_nomem(subreq, req)) {
1829 return tevent_req_post(req, ev);
1831 tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRoot_r_done, req);
1836 static void dcerpc_dfs_AddStdRoot_r_done(struct tevent_req *subreq)
1838 struct tevent_req *req =
1839 tevent_req_callback_data(subreq,
1843 status = dcerpc_binding_handle_call_recv(subreq);
1844 TALLOC_FREE(subreq);
1845 if (tevent_req_nterror(req, status)) {
1849 tevent_req_done(req);
1852 NTSTATUS dcerpc_dfs_AddStdRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1854 struct dcerpc_dfs_AddStdRoot_r_state *state =
1855 tevent_req_data(req,
1856 struct dcerpc_dfs_AddStdRoot_r_state);
1859 if (tevent_req_is_nterror(req, &status)) {
1860 tevent_req_received(req);
1864 talloc_steal(mem_ctx, state->out_mem_ctx);
1866 tevent_req_received(req);
1867 return NT_STATUS_OK;
1870 NTSTATUS dcerpc_dfs_AddStdRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddStdRoot *r)
1874 status = dcerpc_binding_handle_call(h,
1875 NULL, &ndr_table_netdfs,
1876 NDR_DFS_ADDSTDROOT, mem_ctx, r);
1881 struct dcerpc_dfs_AddStdRoot_state {
1882 struct dfs_AddStdRoot orig;
1883 struct dfs_AddStdRoot tmp;
1884 TALLOC_CTX *out_mem_ctx;
1887 static void dcerpc_dfs_AddStdRoot_done(struct tevent_req *subreq);
1889 struct tevent_req *dcerpc_dfs_AddStdRoot_send(TALLOC_CTX *mem_ctx,
1890 struct tevent_context *ev,
1891 struct dcerpc_binding_handle *h,
1892 const char *_servername /* [in] [charset(UTF16)] */,
1893 const char *_rootshare /* [in] [charset(UTF16)] */,
1894 const char *_comment /* [in] [charset(UTF16)] */,
1895 uint32_t _flags /* [in] */)
1897 struct tevent_req *req;
1898 struct dcerpc_dfs_AddStdRoot_state *state;
1899 struct tevent_req *subreq;
1901 req = tevent_req_create(mem_ctx, &state,
1902 struct dcerpc_dfs_AddStdRoot_state);
1906 state->out_mem_ctx = NULL;
1909 state->orig.in.servername = _servername;
1910 state->orig.in.rootshare = _rootshare;
1911 state->orig.in.comment = _comment;
1912 state->orig.in.flags = _flags;
1914 /* Out parameters */
1917 ZERO_STRUCT(state->orig.out.result);
1919 /* make a temporary copy, that we pass to the dispatch function */
1920 state->tmp = state->orig;
1922 subreq = dcerpc_dfs_AddStdRoot_r_send(state, ev, h, &state->tmp);
1923 if (tevent_req_nomem(subreq, req)) {
1924 return tevent_req_post(req, ev);
1926 tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRoot_done, req);
1930 static void dcerpc_dfs_AddStdRoot_done(struct tevent_req *subreq)
1932 struct tevent_req *req = tevent_req_callback_data(
1933 subreq, struct tevent_req);
1934 struct dcerpc_dfs_AddStdRoot_state *state = tevent_req_data(
1935 req, struct dcerpc_dfs_AddStdRoot_state);
1937 TALLOC_CTX *mem_ctx;
1939 if (state->out_mem_ctx) {
1940 mem_ctx = state->out_mem_ctx;
1945 status = dcerpc_dfs_AddStdRoot_r_recv(subreq, mem_ctx);
1946 TALLOC_FREE(subreq);
1947 if (tevent_req_nterror(req, status)) {
1951 /* Copy out parameters */
1954 state->orig.out.result = state->tmp.out.result;
1956 /* Reset temporary structure */
1957 ZERO_STRUCT(state->tmp);
1959 tevent_req_done(req);
1962 NTSTATUS dcerpc_dfs_AddStdRoot_recv(struct tevent_req *req,
1963 TALLOC_CTX *mem_ctx,
1966 struct dcerpc_dfs_AddStdRoot_state *state = tevent_req_data(
1967 req, struct dcerpc_dfs_AddStdRoot_state);
1970 if (tevent_req_is_nterror(req, &status)) {
1971 tevent_req_received(req);
1975 /* Steal possible out parameters to the callers context */
1976 talloc_steal(mem_ctx, state->out_mem_ctx);
1979 *result = state->orig.out.result;
1981 tevent_req_received(req);
1982 return NT_STATUS_OK;
1985 NTSTATUS dcerpc_dfs_AddStdRoot(struct dcerpc_binding_handle *h,
1986 TALLOC_CTX *mem_ctx,
1987 const char *_servername /* [in] [charset(UTF16)] */,
1988 const char *_rootshare /* [in] [charset(UTF16)] */,
1989 const char *_comment /* [in] [charset(UTF16)] */,
1990 uint32_t _flags /* [in] */,
1993 struct dfs_AddStdRoot r;
1997 r.in.servername = _servername;
1998 r.in.rootshare = _rootshare;
1999 r.in.comment = _comment;
2000 r.in.flags = _flags;
2002 status = dcerpc_dfs_AddStdRoot_r(h, mem_ctx, &r);
2003 if (!NT_STATUS_IS_OK(status)) {
2007 /* Return variables */
2010 *result = r.out.result;
2012 return NT_STATUS_OK;
2015 struct dcerpc_dfs_RemoveStdRoot_r_state {
2016 TALLOC_CTX *out_mem_ctx;
2019 static void dcerpc_dfs_RemoveStdRoot_r_done(struct tevent_req *subreq);
2021 struct tevent_req *dcerpc_dfs_RemoveStdRoot_r_send(TALLOC_CTX *mem_ctx,
2022 struct tevent_context *ev,
2023 struct dcerpc_binding_handle *h,
2024 struct dfs_RemoveStdRoot *r)
2026 struct tevent_req *req;
2027 struct dcerpc_dfs_RemoveStdRoot_r_state *state;
2028 struct tevent_req *subreq;
2030 req = tevent_req_create(mem_ctx, &state,
2031 struct dcerpc_dfs_RemoveStdRoot_r_state);
2036 state->out_mem_ctx = NULL;
2038 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2039 NULL, &ndr_table_netdfs,
2040 NDR_DFS_REMOVESTDROOT, state, r);
2041 if (tevent_req_nomem(subreq, req)) {
2042 return tevent_req_post(req, ev);
2044 tevent_req_set_callback(subreq, dcerpc_dfs_RemoveStdRoot_r_done, req);
2049 static void dcerpc_dfs_RemoveStdRoot_r_done(struct tevent_req *subreq)
2051 struct tevent_req *req =
2052 tevent_req_callback_data(subreq,
2056 status = dcerpc_binding_handle_call_recv(subreq);
2057 TALLOC_FREE(subreq);
2058 if (tevent_req_nterror(req, status)) {
2062 tevent_req_done(req);
2065 NTSTATUS dcerpc_dfs_RemoveStdRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2067 struct dcerpc_dfs_RemoveStdRoot_r_state *state =
2068 tevent_req_data(req,
2069 struct dcerpc_dfs_RemoveStdRoot_r_state);
2072 if (tevent_req_is_nterror(req, &status)) {
2073 tevent_req_received(req);
2077 talloc_steal(mem_ctx, state->out_mem_ctx);
2079 tevent_req_received(req);
2080 return NT_STATUS_OK;
2083 NTSTATUS dcerpc_dfs_RemoveStdRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_RemoveStdRoot *r)
2087 status = dcerpc_binding_handle_call(h,
2088 NULL, &ndr_table_netdfs,
2089 NDR_DFS_REMOVESTDROOT, mem_ctx, r);
2094 struct dcerpc_dfs_RemoveStdRoot_state {
2095 struct dfs_RemoveStdRoot orig;
2096 struct dfs_RemoveStdRoot tmp;
2097 TALLOC_CTX *out_mem_ctx;
2100 static void dcerpc_dfs_RemoveStdRoot_done(struct tevent_req *subreq);
2102 struct tevent_req *dcerpc_dfs_RemoveStdRoot_send(TALLOC_CTX *mem_ctx,
2103 struct tevent_context *ev,
2104 struct dcerpc_binding_handle *h,
2105 const char *_servername /* [in] [charset(UTF16)] */,
2106 const char *_rootshare /* [in] [charset(UTF16)] */,
2107 uint32_t _flags /* [in] */)
2109 struct tevent_req *req;
2110 struct dcerpc_dfs_RemoveStdRoot_state *state;
2111 struct tevent_req *subreq;
2113 req = tevent_req_create(mem_ctx, &state,
2114 struct dcerpc_dfs_RemoveStdRoot_state);
2118 state->out_mem_ctx = NULL;
2121 state->orig.in.servername = _servername;
2122 state->orig.in.rootshare = _rootshare;
2123 state->orig.in.flags = _flags;
2125 /* Out parameters */
2128 ZERO_STRUCT(state->orig.out.result);
2130 /* make a temporary copy, that we pass to the dispatch function */
2131 state->tmp = state->orig;
2133 subreq = dcerpc_dfs_RemoveStdRoot_r_send(state, ev, h, &state->tmp);
2134 if (tevent_req_nomem(subreq, req)) {
2135 return tevent_req_post(req, ev);
2137 tevent_req_set_callback(subreq, dcerpc_dfs_RemoveStdRoot_done, req);
2141 static void dcerpc_dfs_RemoveStdRoot_done(struct tevent_req *subreq)
2143 struct tevent_req *req = tevent_req_callback_data(
2144 subreq, struct tevent_req);
2145 struct dcerpc_dfs_RemoveStdRoot_state *state = tevent_req_data(
2146 req, struct dcerpc_dfs_RemoveStdRoot_state);
2148 TALLOC_CTX *mem_ctx;
2150 if (state->out_mem_ctx) {
2151 mem_ctx = state->out_mem_ctx;
2156 status = dcerpc_dfs_RemoveStdRoot_r_recv(subreq, mem_ctx);
2157 TALLOC_FREE(subreq);
2158 if (tevent_req_nterror(req, status)) {
2162 /* Copy out parameters */
2165 state->orig.out.result = state->tmp.out.result;
2167 /* Reset temporary structure */
2168 ZERO_STRUCT(state->tmp);
2170 tevent_req_done(req);
2173 NTSTATUS dcerpc_dfs_RemoveStdRoot_recv(struct tevent_req *req,
2174 TALLOC_CTX *mem_ctx,
2177 struct dcerpc_dfs_RemoveStdRoot_state *state = tevent_req_data(
2178 req, struct dcerpc_dfs_RemoveStdRoot_state);
2181 if (tevent_req_is_nterror(req, &status)) {
2182 tevent_req_received(req);
2186 /* Steal possible out parameters to the callers context */
2187 talloc_steal(mem_ctx, state->out_mem_ctx);
2190 *result = state->orig.out.result;
2192 tevent_req_received(req);
2193 return NT_STATUS_OK;
2196 NTSTATUS dcerpc_dfs_RemoveStdRoot(struct dcerpc_binding_handle *h,
2197 TALLOC_CTX *mem_ctx,
2198 const char *_servername /* [in] [charset(UTF16)] */,
2199 const char *_rootshare /* [in] [charset(UTF16)] */,
2200 uint32_t _flags /* [in] */,
2203 struct dfs_RemoveStdRoot r;
2207 r.in.servername = _servername;
2208 r.in.rootshare = _rootshare;
2209 r.in.flags = _flags;
2211 status = dcerpc_dfs_RemoveStdRoot_r(h, mem_ctx, &r);
2212 if (!NT_STATUS_IS_OK(status)) {
2216 /* Return variables */
2219 *result = r.out.result;
2221 return NT_STATUS_OK;
2224 struct dcerpc_dfs_ManagerInitialize_r_state {
2225 TALLOC_CTX *out_mem_ctx;
2228 static void dcerpc_dfs_ManagerInitialize_r_done(struct tevent_req *subreq);
2230 struct tevent_req *dcerpc_dfs_ManagerInitialize_r_send(TALLOC_CTX *mem_ctx,
2231 struct tevent_context *ev,
2232 struct dcerpc_binding_handle *h,
2233 struct dfs_ManagerInitialize *r)
2235 struct tevent_req *req;
2236 struct dcerpc_dfs_ManagerInitialize_r_state *state;
2237 struct tevent_req *subreq;
2239 req = tevent_req_create(mem_ctx, &state,
2240 struct dcerpc_dfs_ManagerInitialize_r_state);
2245 state->out_mem_ctx = NULL;
2247 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2248 NULL, &ndr_table_netdfs,
2249 NDR_DFS_MANAGERINITIALIZE, state, r);
2250 if (tevent_req_nomem(subreq, req)) {
2251 return tevent_req_post(req, ev);
2253 tevent_req_set_callback(subreq, dcerpc_dfs_ManagerInitialize_r_done, req);
2258 static void dcerpc_dfs_ManagerInitialize_r_done(struct tevent_req *subreq)
2260 struct tevent_req *req =
2261 tevent_req_callback_data(subreq,
2265 status = dcerpc_binding_handle_call_recv(subreq);
2266 TALLOC_FREE(subreq);
2267 if (tevent_req_nterror(req, status)) {
2271 tevent_req_done(req);
2274 NTSTATUS dcerpc_dfs_ManagerInitialize_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2276 struct dcerpc_dfs_ManagerInitialize_r_state *state =
2277 tevent_req_data(req,
2278 struct dcerpc_dfs_ManagerInitialize_r_state);
2281 if (tevent_req_is_nterror(req, &status)) {
2282 tevent_req_received(req);
2286 talloc_steal(mem_ctx, state->out_mem_ctx);
2288 tevent_req_received(req);
2289 return NT_STATUS_OK;
2292 NTSTATUS dcerpc_dfs_ManagerInitialize_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_ManagerInitialize *r)
2296 status = dcerpc_binding_handle_call(h,
2297 NULL, &ndr_table_netdfs,
2298 NDR_DFS_MANAGERINITIALIZE, mem_ctx, r);
2303 struct dcerpc_dfs_ManagerInitialize_state {
2304 struct dfs_ManagerInitialize orig;
2305 struct dfs_ManagerInitialize tmp;
2306 TALLOC_CTX *out_mem_ctx;
2309 static void dcerpc_dfs_ManagerInitialize_done(struct tevent_req *subreq);
2311 struct tevent_req *dcerpc_dfs_ManagerInitialize_send(TALLOC_CTX *mem_ctx,
2312 struct tevent_context *ev,
2313 struct dcerpc_binding_handle *h,
2314 const char *_servername /* [in] [ref,charset(UTF16)] */,
2315 uint32_t _flags /* [in] */)
2317 struct tevent_req *req;
2318 struct dcerpc_dfs_ManagerInitialize_state *state;
2319 struct tevent_req *subreq;
2321 req = tevent_req_create(mem_ctx, &state,
2322 struct dcerpc_dfs_ManagerInitialize_state);
2326 state->out_mem_ctx = NULL;
2329 state->orig.in.servername = _servername;
2330 state->orig.in.flags = _flags;
2332 /* Out parameters */
2335 ZERO_STRUCT(state->orig.out.result);
2337 /* make a temporary copy, that we pass to the dispatch function */
2338 state->tmp = state->orig;
2340 subreq = dcerpc_dfs_ManagerInitialize_r_send(state, ev, h, &state->tmp);
2341 if (tevent_req_nomem(subreq, req)) {
2342 return tevent_req_post(req, ev);
2344 tevent_req_set_callback(subreq, dcerpc_dfs_ManagerInitialize_done, req);
2348 static void dcerpc_dfs_ManagerInitialize_done(struct tevent_req *subreq)
2350 struct tevent_req *req = tevent_req_callback_data(
2351 subreq, struct tevent_req);
2352 struct dcerpc_dfs_ManagerInitialize_state *state = tevent_req_data(
2353 req, struct dcerpc_dfs_ManagerInitialize_state);
2355 TALLOC_CTX *mem_ctx;
2357 if (state->out_mem_ctx) {
2358 mem_ctx = state->out_mem_ctx;
2363 status = dcerpc_dfs_ManagerInitialize_r_recv(subreq, mem_ctx);
2364 TALLOC_FREE(subreq);
2365 if (tevent_req_nterror(req, status)) {
2369 /* Copy out parameters */
2372 state->orig.out.result = state->tmp.out.result;
2374 /* Reset temporary structure */
2375 ZERO_STRUCT(state->tmp);
2377 tevent_req_done(req);
2380 NTSTATUS dcerpc_dfs_ManagerInitialize_recv(struct tevent_req *req,
2381 TALLOC_CTX *mem_ctx,
2384 struct dcerpc_dfs_ManagerInitialize_state *state = tevent_req_data(
2385 req, struct dcerpc_dfs_ManagerInitialize_state);
2388 if (tevent_req_is_nterror(req, &status)) {
2389 tevent_req_received(req);
2393 /* Steal possible out parameters to the callers context */
2394 talloc_steal(mem_ctx, state->out_mem_ctx);
2397 *result = state->orig.out.result;
2399 tevent_req_received(req);
2400 return NT_STATUS_OK;
2403 NTSTATUS dcerpc_dfs_ManagerInitialize(struct dcerpc_binding_handle *h,
2404 TALLOC_CTX *mem_ctx,
2405 const char *_servername /* [in] [ref,charset(UTF16)] */,
2406 uint32_t _flags /* [in] */,
2409 struct dfs_ManagerInitialize r;
2413 r.in.servername = _servername;
2414 r.in.flags = _flags;
2416 status = dcerpc_dfs_ManagerInitialize_r(h, mem_ctx, &r);
2417 if (!NT_STATUS_IS_OK(status)) {
2421 /* Return variables */
2424 *result = r.out.result;
2426 return NT_STATUS_OK;
2429 struct dcerpc_dfs_AddStdRootForced_r_state {
2430 TALLOC_CTX *out_mem_ctx;
2433 static void dcerpc_dfs_AddStdRootForced_r_done(struct tevent_req *subreq);
2435 struct tevent_req *dcerpc_dfs_AddStdRootForced_r_send(TALLOC_CTX *mem_ctx,
2436 struct tevent_context *ev,
2437 struct dcerpc_binding_handle *h,
2438 struct dfs_AddStdRootForced *r)
2440 struct tevent_req *req;
2441 struct dcerpc_dfs_AddStdRootForced_r_state *state;
2442 struct tevent_req *subreq;
2444 req = tevent_req_create(mem_ctx, &state,
2445 struct dcerpc_dfs_AddStdRootForced_r_state);
2450 state->out_mem_ctx = NULL;
2452 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2453 NULL, &ndr_table_netdfs,
2454 NDR_DFS_ADDSTDROOTFORCED, state, r);
2455 if (tevent_req_nomem(subreq, req)) {
2456 return tevent_req_post(req, ev);
2458 tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRootForced_r_done, req);
2463 static void dcerpc_dfs_AddStdRootForced_r_done(struct tevent_req *subreq)
2465 struct tevent_req *req =
2466 tevent_req_callback_data(subreq,
2470 status = dcerpc_binding_handle_call_recv(subreq);
2471 TALLOC_FREE(subreq);
2472 if (tevent_req_nterror(req, status)) {
2476 tevent_req_done(req);
2479 NTSTATUS dcerpc_dfs_AddStdRootForced_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2481 struct dcerpc_dfs_AddStdRootForced_r_state *state =
2482 tevent_req_data(req,
2483 struct dcerpc_dfs_AddStdRootForced_r_state);
2486 if (tevent_req_is_nterror(req, &status)) {
2487 tevent_req_received(req);
2491 talloc_steal(mem_ctx, state->out_mem_ctx);
2493 tevent_req_received(req);
2494 return NT_STATUS_OK;
2497 NTSTATUS dcerpc_dfs_AddStdRootForced_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddStdRootForced *r)
2501 status = dcerpc_binding_handle_call(h,
2502 NULL, &ndr_table_netdfs,
2503 NDR_DFS_ADDSTDROOTFORCED, mem_ctx, r);
2508 struct dcerpc_dfs_AddStdRootForced_state {
2509 struct dfs_AddStdRootForced orig;
2510 struct dfs_AddStdRootForced tmp;
2511 TALLOC_CTX *out_mem_ctx;
2514 static void dcerpc_dfs_AddStdRootForced_done(struct tevent_req *subreq);
2516 struct tevent_req *dcerpc_dfs_AddStdRootForced_send(TALLOC_CTX *mem_ctx,
2517 struct tevent_context *ev,
2518 struct dcerpc_binding_handle *h,
2519 const char *_servername /* [in] [charset(UTF16)] */,
2520 const char *_rootshare /* [in] [charset(UTF16)] */,
2521 const char *_comment /* [in] [charset(UTF16)] */,
2522 const char *_store /* [in] [charset(UTF16)] */)
2524 struct tevent_req *req;
2525 struct dcerpc_dfs_AddStdRootForced_state *state;
2526 struct tevent_req *subreq;
2528 req = tevent_req_create(mem_ctx, &state,
2529 struct dcerpc_dfs_AddStdRootForced_state);
2533 state->out_mem_ctx = NULL;
2536 state->orig.in.servername = _servername;
2537 state->orig.in.rootshare = _rootshare;
2538 state->orig.in.comment = _comment;
2539 state->orig.in.store = _store;
2541 /* Out parameters */
2544 ZERO_STRUCT(state->orig.out.result);
2546 /* make a temporary copy, that we pass to the dispatch function */
2547 state->tmp = state->orig;
2549 subreq = dcerpc_dfs_AddStdRootForced_r_send(state, ev, h, &state->tmp);
2550 if (tevent_req_nomem(subreq, req)) {
2551 return tevent_req_post(req, ev);
2553 tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRootForced_done, req);
2557 static void dcerpc_dfs_AddStdRootForced_done(struct tevent_req *subreq)
2559 struct tevent_req *req = tevent_req_callback_data(
2560 subreq, struct tevent_req);
2561 struct dcerpc_dfs_AddStdRootForced_state *state = tevent_req_data(
2562 req, struct dcerpc_dfs_AddStdRootForced_state);
2564 TALLOC_CTX *mem_ctx;
2566 if (state->out_mem_ctx) {
2567 mem_ctx = state->out_mem_ctx;
2572 status = dcerpc_dfs_AddStdRootForced_r_recv(subreq, mem_ctx);
2573 TALLOC_FREE(subreq);
2574 if (tevent_req_nterror(req, status)) {
2578 /* Copy out parameters */
2581 state->orig.out.result = state->tmp.out.result;
2583 /* Reset temporary structure */
2584 ZERO_STRUCT(state->tmp);
2586 tevent_req_done(req);
2589 NTSTATUS dcerpc_dfs_AddStdRootForced_recv(struct tevent_req *req,
2590 TALLOC_CTX *mem_ctx,
2593 struct dcerpc_dfs_AddStdRootForced_state *state = tevent_req_data(
2594 req, struct dcerpc_dfs_AddStdRootForced_state);
2597 if (tevent_req_is_nterror(req, &status)) {
2598 tevent_req_received(req);
2602 /* Steal possible out parameters to the callers context */
2603 talloc_steal(mem_ctx, state->out_mem_ctx);
2606 *result = state->orig.out.result;
2608 tevent_req_received(req);
2609 return NT_STATUS_OK;
2612 NTSTATUS dcerpc_dfs_AddStdRootForced(struct dcerpc_binding_handle *h,
2613 TALLOC_CTX *mem_ctx,
2614 const char *_servername /* [in] [charset(UTF16)] */,
2615 const char *_rootshare /* [in] [charset(UTF16)] */,
2616 const char *_comment /* [in] [charset(UTF16)] */,
2617 const char *_store /* [in] [charset(UTF16)] */,
2620 struct dfs_AddStdRootForced r;
2624 r.in.servername = _servername;
2625 r.in.rootshare = _rootshare;
2626 r.in.comment = _comment;
2627 r.in.store = _store;
2629 status = dcerpc_dfs_AddStdRootForced_r(h, mem_ctx, &r);
2630 if (!NT_STATUS_IS_OK(status)) {
2634 /* Return variables */
2637 *result = r.out.result;
2639 return NT_STATUS_OK;
2642 struct dcerpc_dfs_GetDcAddress_r_state {
2643 TALLOC_CTX *out_mem_ctx;
2646 static void dcerpc_dfs_GetDcAddress_r_done(struct tevent_req *subreq);
2648 struct tevent_req *dcerpc_dfs_GetDcAddress_r_send(TALLOC_CTX *mem_ctx,
2649 struct tevent_context *ev,
2650 struct dcerpc_binding_handle *h,
2651 struct dfs_GetDcAddress *r)
2653 struct tevent_req *req;
2654 struct dcerpc_dfs_GetDcAddress_r_state *state;
2655 struct tevent_req *subreq;
2657 req = tevent_req_create(mem_ctx, &state,
2658 struct dcerpc_dfs_GetDcAddress_r_state);
2663 state->out_mem_ctx = talloc_new(state);
2664 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2665 return tevent_req_post(req, ev);
2668 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2669 NULL, &ndr_table_netdfs,
2670 NDR_DFS_GETDCADDRESS, state->out_mem_ctx, r);
2671 if (tevent_req_nomem(subreq, req)) {
2672 return tevent_req_post(req, ev);
2674 tevent_req_set_callback(subreq, dcerpc_dfs_GetDcAddress_r_done, req);
2679 static void dcerpc_dfs_GetDcAddress_r_done(struct tevent_req *subreq)
2681 struct tevent_req *req =
2682 tevent_req_callback_data(subreq,
2686 status = dcerpc_binding_handle_call_recv(subreq);
2687 TALLOC_FREE(subreq);
2688 if (tevent_req_nterror(req, status)) {
2692 tevent_req_done(req);
2695 NTSTATUS dcerpc_dfs_GetDcAddress_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2697 struct dcerpc_dfs_GetDcAddress_r_state *state =
2698 tevent_req_data(req,
2699 struct dcerpc_dfs_GetDcAddress_r_state);
2702 if (tevent_req_is_nterror(req, &status)) {
2703 tevent_req_received(req);
2707 talloc_steal(mem_ctx, state->out_mem_ctx);
2709 tevent_req_received(req);
2710 return NT_STATUS_OK;
2713 NTSTATUS dcerpc_dfs_GetDcAddress_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetDcAddress *r)
2717 status = dcerpc_binding_handle_call(h,
2718 NULL, &ndr_table_netdfs,
2719 NDR_DFS_GETDCADDRESS, mem_ctx, r);
2724 struct dcerpc_dfs_GetDcAddress_state {
2725 struct dfs_GetDcAddress orig;
2726 struct dfs_GetDcAddress tmp;
2727 TALLOC_CTX *out_mem_ctx;
2730 static void dcerpc_dfs_GetDcAddress_done(struct tevent_req *subreq);
2732 struct tevent_req *dcerpc_dfs_GetDcAddress_send(TALLOC_CTX *mem_ctx,
2733 struct tevent_context *ev,
2734 struct dcerpc_binding_handle *h,
2735 const char *_servername /* [in] [charset(UTF16)] */,
2736 const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
2737 uint8_t *_is_root /* [in,out] [ref] */,
2738 uint32_t *_ttl /* [in,out] [ref] */)
2740 struct tevent_req *req;
2741 struct dcerpc_dfs_GetDcAddress_state *state;
2742 struct tevent_req *subreq;
2744 req = tevent_req_create(mem_ctx, &state,
2745 struct dcerpc_dfs_GetDcAddress_state);
2749 state->out_mem_ctx = NULL;
2752 state->orig.in.servername = _servername;
2753 state->orig.in.server_fullname = _server_fullname;
2754 state->orig.in.is_root = _is_root;
2755 state->orig.in.ttl = _ttl;
2757 /* Out parameters */
2758 state->orig.out.server_fullname = _server_fullname;
2759 state->orig.out.is_root = _is_root;
2760 state->orig.out.ttl = _ttl;
2763 ZERO_STRUCT(state->orig.out.result);
2765 state->out_mem_ctx = talloc_named_const(state, 0,
2766 "dcerpc_dfs_GetDcAddress_out_memory");
2767 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2768 return tevent_req_post(req, ev);
2771 /* make a temporary copy, that we pass to the dispatch function */
2772 state->tmp = state->orig;
2774 subreq = dcerpc_dfs_GetDcAddress_r_send(state, ev, h, &state->tmp);
2775 if (tevent_req_nomem(subreq, req)) {
2776 return tevent_req_post(req, ev);
2778 tevent_req_set_callback(subreq, dcerpc_dfs_GetDcAddress_done, req);
2782 static void dcerpc_dfs_GetDcAddress_done(struct tevent_req *subreq)
2784 struct tevent_req *req = tevent_req_callback_data(
2785 subreq, struct tevent_req);
2786 struct dcerpc_dfs_GetDcAddress_state *state = tevent_req_data(
2787 req, struct dcerpc_dfs_GetDcAddress_state);
2789 TALLOC_CTX *mem_ctx;
2791 if (state->out_mem_ctx) {
2792 mem_ctx = state->out_mem_ctx;
2797 status = dcerpc_dfs_GetDcAddress_r_recv(subreq, mem_ctx);
2798 TALLOC_FREE(subreq);
2799 if (tevent_req_nterror(req, status)) {
2803 /* Copy out parameters */
2804 *state->orig.out.server_fullname = *state->tmp.out.server_fullname;
2805 *state->orig.out.is_root = *state->tmp.out.is_root;
2806 *state->orig.out.ttl = *state->tmp.out.ttl;
2809 state->orig.out.result = state->tmp.out.result;
2811 /* Reset temporary structure */
2812 ZERO_STRUCT(state->tmp);
2814 tevent_req_done(req);
2817 NTSTATUS dcerpc_dfs_GetDcAddress_recv(struct tevent_req *req,
2818 TALLOC_CTX *mem_ctx,
2821 struct dcerpc_dfs_GetDcAddress_state *state = tevent_req_data(
2822 req, struct dcerpc_dfs_GetDcAddress_state);
2825 if (tevent_req_is_nterror(req, &status)) {
2826 tevent_req_received(req);
2830 /* Steal possible out parameters to the callers context */
2831 talloc_steal(mem_ctx, state->out_mem_ctx);
2834 *result = state->orig.out.result;
2836 tevent_req_received(req);
2837 return NT_STATUS_OK;
2840 NTSTATUS dcerpc_dfs_GetDcAddress(struct dcerpc_binding_handle *h,
2841 TALLOC_CTX *mem_ctx,
2842 const char *_servername /* [in] [charset(UTF16)] */,
2843 const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
2844 uint8_t *_is_root /* [in,out] [ref] */,
2845 uint32_t *_ttl /* [in,out] [ref] */,
2848 struct dfs_GetDcAddress r;
2852 r.in.servername = _servername;
2853 r.in.server_fullname = _server_fullname;
2854 r.in.is_root = _is_root;
2857 status = dcerpc_dfs_GetDcAddress_r(h, mem_ctx, &r);
2858 if (!NT_STATUS_IS_OK(status)) {
2862 /* Return variables */
2863 *_server_fullname = *r.out.server_fullname;
2864 *_is_root = *r.out.is_root;
2868 *result = r.out.result;
2870 return NT_STATUS_OK;
2873 struct dcerpc_dfs_SetDcAddress_r_state {
2874 TALLOC_CTX *out_mem_ctx;
2877 static void dcerpc_dfs_SetDcAddress_r_done(struct tevent_req *subreq);
2879 struct tevent_req *dcerpc_dfs_SetDcAddress_r_send(TALLOC_CTX *mem_ctx,
2880 struct tevent_context *ev,
2881 struct dcerpc_binding_handle *h,
2882 struct dfs_SetDcAddress *r)
2884 struct tevent_req *req;
2885 struct dcerpc_dfs_SetDcAddress_r_state *state;
2886 struct tevent_req *subreq;
2888 req = tevent_req_create(mem_ctx, &state,
2889 struct dcerpc_dfs_SetDcAddress_r_state);
2894 state->out_mem_ctx = NULL;
2896 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2897 NULL, &ndr_table_netdfs,
2898 NDR_DFS_SETDCADDRESS, state, r);
2899 if (tevent_req_nomem(subreq, req)) {
2900 return tevent_req_post(req, ev);
2902 tevent_req_set_callback(subreq, dcerpc_dfs_SetDcAddress_r_done, req);
2907 static void dcerpc_dfs_SetDcAddress_r_done(struct tevent_req *subreq)
2909 struct tevent_req *req =
2910 tevent_req_callback_data(subreq,
2914 status = dcerpc_binding_handle_call_recv(subreq);
2915 TALLOC_FREE(subreq);
2916 if (tevent_req_nterror(req, status)) {
2920 tevent_req_done(req);
2923 NTSTATUS dcerpc_dfs_SetDcAddress_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2925 struct dcerpc_dfs_SetDcAddress_r_state *state =
2926 tevent_req_data(req,
2927 struct dcerpc_dfs_SetDcAddress_r_state);
2930 if (tevent_req_is_nterror(req, &status)) {
2931 tevent_req_received(req);
2935 talloc_steal(mem_ctx, state->out_mem_ctx);
2937 tevent_req_received(req);
2938 return NT_STATUS_OK;
2941 NTSTATUS dcerpc_dfs_SetDcAddress_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_SetDcAddress *r)
2945 status = dcerpc_binding_handle_call(h,
2946 NULL, &ndr_table_netdfs,
2947 NDR_DFS_SETDCADDRESS, mem_ctx, r);
2952 struct dcerpc_dfs_SetDcAddress_state {
2953 struct dfs_SetDcAddress orig;
2954 struct dfs_SetDcAddress tmp;
2955 TALLOC_CTX *out_mem_ctx;
2958 static void dcerpc_dfs_SetDcAddress_done(struct tevent_req *subreq);
2960 struct tevent_req *dcerpc_dfs_SetDcAddress_send(TALLOC_CTX *mem_ctx,
2961 struct tevent_context *ev,
2962 struct dcerpc_binding_handle *h,
2963 const char *_servername /* [in] [charset(UTF16)] */,
2964 const char *_server_fullname /* [in] [charset(UTF16)] */,
2965 uint32_t _flags /* [in] */,
2966 uint32_t _ttl /* [in] */)
2968 struct tevent_req *req;
2969 struct dcerpc_dfs_SetDcAddress_state *state;
2970 struct tevent_req *subreq;
2972 req = tevent_req_create(mem_ctx, &state,
2973 struct dcerpc_dfs_SetDcAddress_state);
2977 state->out_mem_ctx = NULL;
2980 state->orig.in.servername = _servername;
2981 state->orig.in.server_fullname = _server_fullname;
2982 state->orig.in.flags = _flags;
2983 state->orig.in.ttl = _ttl;
2985 /* Out parameters */
2988 ZERO_STRUCT(state->orig.out.result);
2990 /* make a temporary copy, that we pass to the dispatch function */
2991 state->tmp = state->orig;
2993 subreq = dcerpc_dfs_SetDcAddress_r_send(state, ev, h, &state->tmp);
2994 if (tevent_req_nomem(subreq, req)) {
2995 return tevent_req_post(req, ev);
2997 tevent_req_set_callback(subreq, dcerpc_dfs_SetDcAddress_done, req);
3001 static void dcerpc_dfs_SetDcAddress_done(struct tevent_req *subreq)
3003 struct tevent_req *req = tevent_req_callback_data(
3004 subreq, struct tevent_req);
3005 struct dcerpc_dfs_SetDcAddress_state *state = tevent_req_data(
3006 req, struct dcerpc_dfs_SetDcAddress_state);
3008 TALLOC_CTX *mem_ctx;
3010 if (state->out_mem_ctx) {
3011 mem_ctx = state->out_mem_ctx;
3016 status = dcerpc_dfs_SetDcAddress_r_recv(subreq, mem_ctx);
3017 TALLOC_FREE(subreq);
3018 if (tevent_req_nterror(req, status)) {
3022 /* Copy out parameters */
3025 state->orig.out.result = state->tmp.out.result;
3027 /* Reset temporary structure */
3028 ZERO_STRUCT(state->tmp);
3030 tevent_req_done(req);
3033 NTSTATUS dcerpc_dfs_SetDcAddress_recv(struct tevent_req *req,
3034 TALLOC_CTX *mem_ctx,
3037 struct dcerpc_dfs_SetDcAddress_state *state = tevent_req_data(
3038 req, struct dcerpc_dfs_SetDcAddress_state);
3041 if (tevent_req_is_nterror(req, &status)) {
3042 tevent_req_received(req);
3046 /* Steal possible out parameters to the callers context */
3047 talloc_steal(mem_ctx, state->out_mem_ctx);
3050 *result = state->orig.out.result;
3052 tevent_req_received(req);
3053 return NT_STATUS_OK;
3056 NTSTATUS dcerpc_dfs_SetDcAddress(struct dcerpc_binding_handle *h,
3057 TALLOC_CTX *mem_ctx,
3058 const char *_servername /* [in] [charset(UTF16)] */,
3059 const char *_server_fullname /* [in] [charset(UTF16)] */,
3060 uint32_t _flags /* [in] */,
3061 uint32_t _ttl /* [in] */,
3064 struct dfs_SetDcAddress r;
3068 r.in.servername = _servername;
3069 r.in.server_fullname = _server_fullname;
3070 r.in.flags = _flags;
3073 status = dcerpc_dfs_SetDcAddress_r(h, mem_ctx, &r);
3074 if (!NT_STATUS_IS_OK(status)) {
3078 /* Return variables */
3081 *result = r.out.result;
3083 return NT_STATUS_OK;
3086 struct dcerpc_dfs_FlushFtTable_r_state {
3087 TALLOC_CTX *out_mem_ctx;
3090 static void dcerpc_dfs_FlushFtTable_r_done(struct tevent_req *subreq);
3092 struct tevent_req *dcerpc_dfs_FlushFtTable_r_send(TALLOC_CTX *mem_ctx,
3093 struct tevent_context *ev,
3094 struct dcerpc_binding_handle *h,
3095 struct dfs_FlushFtTable *r)
3097 struct tevent_req *req;
3098 struct dcerpc_dfs_FlushFtTable_r_state *state;
3099 struct tevent_req *subreq;
3101 req = tevent_req_create(mem_ctx, &state,
3102 struct dcerpc_dfs_FlushFtTable_r_state);
3107 state->out_mem_ctx = NULL;
3109 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3110 NULL, &ndr_table_netdfs,
3111 NDR_DFS_FLUSHFTTABLE, state, r);
3112 if (tevent_req_nomem(subreq, req)) {
3113 return tevent_req_post(req, ev);
3115 tevent_req_set_callback(subreq, dcerpc_dfs_FlushFtTable_r_done, req);
3120 static void dcerpc_dfs_FlushFtTable_r_done(struct tevent_req *subreq)
3122 struct tevent_req *req =
3123 tevent_req_callback_data(subreq,
3127 status = dcerpc_binding_handle_call_recv(subreq);
3128 TALLOC_FREE(subreq);
3129 if (tevent_req_nterror(req, status)) {
3133 tevent_req_done(req);
3136 NTSTATUS dcerpc_dfs_FlushFtTable_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3138 struct dcerpc_dfs_FlushFtTable_r_state *state =
3139 tevent_req_data(req,
3140 struct dcerpc_dfs_FlushFtTable_r_state);
3143 if (tevent_req_is_nterror(req, &status)) {
3144 tevent_req_received(req);
3148 talloc_steal(mem_ctx, state->out_mem_ctx);
3150 tevent_req_received(req);
3151 return NT_STATUS_OK;
3154 NTSTATUS dcerpc_dfs_FlushFtTable_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_FlushFtTable *r)
3158 status = dcerpc_binding_handle_call(h,
3159 NULL, &ndr_table_netdfs,
3160 NDR_DFS_FLUSHFTTABLE, mem_ctx, r);
3165 struct dcerpc_dfs_FlushFtTable_state {
3166 struct dfs_FlushFtTable orig;
3167 struct dfs_FlushFtTable tmp;
3168 TALLOC_CTX *out_mem_ctx;
3171 static void dcerpc_dfs_FlushFtTable_done(struct tevent_req *subreq);
3173 struct tevent_req *dcerpc_dfs_FlushFtTable_send(TALLOC_CTX *mem_ctx,
3174 struct tevent_context *ev,
3175 struct dcerpc_binding_handle *h,
3176 const char *_servername /* [in] [charset(UTF16)] */,
3177 const char *_rootshare /* [in] [charset(UTF16)] */)
3179 struct tevent_req *req;
3180 struct dcerpc_dfs_FlushFtTable_state *state;
3181 struct tevent_req *subreq;
3183 req = tevent_req_create(mem_ctx, &state,
3184 struct dcerpc_dfs_FlushFtTable_state);
3188 state->out_mem_ctx = NULL;
3191 state->orig.in.servername = _servername;
3192 state->orig.in.rootshare = _rootshare;
3194 /* Out parameters */
3197 ZERO_STRUCT(state->orig.out.result);
3199 /* make a temporary copy, that we pass to the dispatch function */
3200 state->tmp = state->orig;
3202 subreq = dcerpc_dfs_FlushFtTable_r_send(state, ev, h, &state->tmp);
3203 if (tevent_req_nomem(subreq, req)) {
3204 return tevent_req_post(req, ev);
3206 tevent_req_set_callback(subreq, dcerpc_dfs_FlushFtTable_done, req);
3210 static void dcerpc_dfs_FlushFtTable_done(struct tevent_req *subreq)
3212 struct tevent_req *req = tevent_req_callback_data(
3213 subreq, struct tevent_req);
3214 struct dcerpc_dfs_FlushFtTable_state *state = tevent_req_data(
3215 req, struct dcerpc_dfs_FlushFtTable_state);
3217 TALLOC_CTX *mem_ctx;
3219 if (state->out_mem_ctx) {
3220 mem_ctx = state->out_mem_ctx;
3225 status = dcerpc_dfs_FlushFtTable_r_recv(subreq, mem_ctx);
3226 TALLOC_FREE(subreq);
3227 if (tevent_req_nterror(req, status)) {
3231 /* Copy out parameters */
3234 state->orig.out.result = state->tmp.out.result;
3236 /* Reset temporary structure */
3237 ZERO_STRUCT(state->tmp);
3239 tevent_req_done(req);
3242 NTSTATUS dcerpc_dfs_FlushFtTable_recv(struct tevent_req *req,
3243 TALLOC_CTX *mem_ctx,
3246 struct dcerpc_dfs_FlushFtTable_state *state = tevent_req_data(
3247 req, struct dcerpc_dfs_FlushFtTable_state);
3250 if (tevent_req_is_nterror(req, &status)) {
3251 tevent_req_received(req);
3255 /* Steal possible out parameters to the callers context */
3256 talloc_steal(mem_ctx, state->out_mem_ctx);
3259 *result = state->orig.out.result;
3261 tevent_req_received(req);
3262 return NT_STATUS_OK;
3265 NTSTATUS dcerpc_dfs_FlushFtTable(struct dcerpc_binding_handle *h,
3266 TALLOC_CTX *mem_ctx,
3267 const char *_servername /* [in] [charset(UTF16)] */,
3268 const char *_rootshare /* [in] [charset(UTF16)] */,
3271 struct dfs_FlushFtTable r;
3275 r.in.servername = _servername;
3276 r.in.rootshare = _rootshare;
3278 status = dcerpc_dfs_FlushFtTable_r(h, mem_ctx, &r);
3279 if (!NT_STATUS_IS_OK(status)) {
3283 /* Return variables */
3286 *result = r.out.result;
3288 return NT_STATUS_OK;
3291 struct dcerpc_dfs_EnumEx_r_state {
3292 TALLOC_CTX *out_mem_ctx;
3295 static void dcerpc_dfs_EnumEx_r_done(struct tevent_req *subreq);
3297 struct tevent_req *dcerpc_dfs_EnumEx_r_send(TALLOC_CTX *mem_ctx,
3298 struct tevent_context *ev,
3299 struct dcerpc_binding_handle *h,
3300 struct dfs_EnumEx *r)
3302 struct tevent_req *req;
3303 struct dcerpc_dfs_EnumEx_r_state *state;
3304 struct tevent_req *subreq;
3306 req = tevent_req_create(mem_ctx, &state,
3307 struct dcerpc_dfs_EnumEx_r_state);
3312 state->out_mem_ctx = talloc_new(state);
3313 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3314 return tevent_req_post(req, ev);
3317 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3318 NULL, &ndr_table_netdfs,
3319 NDR_DFS_ENUMEX, state->out_mem_ctx, r);
3320 if (tevent_req_nomem(subreq, req)) {
3321 return tevent_req_post(req, ev);
3323 tevent_req_set_callback(subreq, dcerpc_dfs_EnumEx_r_done, req);
3328 static void dcerpc_dfs_EnumEx_r_done(struct tevent_req *subreq)
3330 struct tevent_req *req =
3331 tevent_req_callback_data(subreq,
3335 status = dcerpc_binding_handle_call_recv(subreq);
3336 TALLOC_FREE(subreq);
3337 if (tevent_req_nterror(req, status)) {
3341 tevent_req_done(req);
3344 NTSTATUS dcerpc_dfs_EnumEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3346 struct dcerpc_dfs_EnumEx_r_state *state =
3347 tevent_req_data(req,
3348 struct dcerpc_dfs_EnumEx_r_state);
3351 if (tevent_req_is_nterror(req, &status)) {
3352 tevent_req_received(req);
3356 talloc_steal(mem_ctx, state->out_mem_ctx);
3358 tevent_req_received(req);
3359 return NT_STATUS_OK;
3362 NTSTATUS dcerpc_dfs_EnumEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_EnumEx *r)
3366 status = dcerpc_binding_handle_call(h,
3367 NULL, &ndr_table_netdfs,
3368 NDR_DFS_ENUMEX, mem_ctx, r);
3373 struct dcerpc_dfs_EnumEx_state {
3374 struct dfs_EnumEx orig;
3375 struct dfs_EnumEx tmp;
3376 TALLOC_CTX *out_mem_ctx;
3379 static void dcerpc_dfs_EnumEx_done(struct tevent_req *subreq);
3381 struct tevent_req *dcerpc_dfs_EnumEx_send(TALLOC_CTX *mem_ctx,
3382 struct tevent_context *ev,
3383 struct dcerpc_binding_handle *h,
3384 const char *_dfs_name /* [in] [charset(UTF16)] */,
3385 uint32_t _level /* [in] */,
3386 uint32_t _bufsize /* [in] */,
3387 struct dfs_EnumStruct *_info /* [in,out] [unique] */,
3388 uint32_t *_total /* [in,out] [unique] */)
3390 struct tevent_req *req;
3391 struct dcerpc_dfs_EnumEx_state *state;
3392 struct tevent_req *subreq;
3394 req = tevent_req_create(mem_ctx, &state,
3395 struct dcerpc_dfs_EnumEx_state);
3399 state->out_mem_ctx = NULL;
3402 state->orig.in.dfs_name = _dfs_name;
3403 state->orig.in.level = _level;
3404 state->orig.in.bufsize = _bufsize;
3405 state->orig.in.info = _info;
3406 state->orig.in.total = _total;
3408 /* Out parameters */
3409 state->orig.out.info = _info;
3410 state->orig.out.total = _total;
3413 ZERO_STRUCT(state->orig.out.result);
3415 state->out_mem_ctx = talloc_named_const(state, 0,
3416 "dcerpc_dfs_EnumEx_out_memory");
3417 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3418 return tevent_req_post(req, ev);
3421 /* make a temporary copy, that we pass to the dispatch function */
3422 state->tmp = state->orig;
3424 subreq = dcerpc_dfs_EnumEx_r_send(state, ev, h, &state->tmp);
3425 if (tevent_req_nomem(subreq, req)) {
3426 return tevent_req_post(req, ev);
3428 tevent_req_set_callback(subreq, dcerpc_dfs_EnumEx_done, req);
3432 static void dcerpc_dfs_EnumEx_done(struct tevent_req *subreq)
3434 struct tevent_req *req = tevent_req_callback_data(
3435 subreq, struct tevent_req);
3436 struct dcerpc_dfs_EnumEx_state *state = tevent_req_data(
3437 req, struct dcerpc_dfs_EnumEx_state);
3439 TALLOC_CTX *mem_ctx;
3441 if (state->out_mem_ctx) {
3442 mem_ctx = state->out_mem_ctx;
3447 status = dcerpc_dfs_EnumEx_r_recv(subreq, mem_ctx);
3448 TALLOC_FREE(subreq);
3449 if (tevent_req_nterror(req, status)) {
3453 /* Copy out parameters */
3454 if (state->orig.out.info && state->tmp.out.info) {
3455 *state->orig.out.info = *state->tmp.out.info;
3457 if (state->orig.out.total && state->tmp.out.total) {
3458 *state->orig.out.total = *state->tmp.out.total;
3462 state->orig.out.result = state->tmp.out.result;
3464 /* Reset temporary structure */
3465 ZERO_STRUCT(state->tmp);
3467 tevent_req_done(req);
3470 NTSTATUS dcerpc_dfs_EnumEx_recv(struct tevent_req *req,
3471 TALLOC_CTX *mem_ctx,
3474 struct dcerpc_dfs_EnumEx_state *state = tevent_req_data(
3475 req, struct dcerpc_dfs_EnumEx_state);
3478 if (tevent_req_is_nterror(req, &status)) {
3479 tevent_req_received(req);
3483 /* Steal possible out parameters to the callers context */
3484 talloc_steal(mem_ctx, state->out_mem_ctx);
3487 *result = state->orig.out.result;
3489 tevent_req_received(req);
3490 return NT_STATUS_OK;
3493 NTSTATUS dcerpc_dfs_EnumEx(struct dcerpc_binding_handle *h,
3494 TALLOC_CTX *mem_ctx,
3495 const char *_dfs_name /* [in] [charset(UTF16)] */,
3496 uint32_t _level /* [in] */,
3497 uint32_t _bufsize /* [in] */,
3498 struct dfs_EnumStruct *_info /* [in,out] [unique] */,
3499 uint32_t *_total /* [in,out] [unique] */,
3502 struct dfs_EnumEx r;
3506 r.in.dfs_name = _dfs_name;
3507 r.in.level = _level;
3508 r.in.bufsize = _bufsize;
3510 r.in.total = _total;
3512 status = dcerpc_dfs_EnumEx_r(h, mem_ctx, &r);
3513 if (!NT_STATUS_IS_OK(status)) {
3517 /* Return variables */
3518 if (_info && r.out.info) {
3519 *_info = *r.out.info;
3521 if (_total && r.out.total) {
3522 *_total = *r.out.total;
3526 *result = r.out.result;
3528 return NT_STATUS_OK;