1 /* client functions auto-generated by pidl */
5 #include "lib/util/tevent_ntstatus.h"
6 #include "librpc/gen_ndr/ndr_srvsvc.h"
7 #include "librpc/gen_ndr/ndr_srvsvc_c.h"
9 /* srvsvc - client functions generated by pidl */
11 struct dcerpc_srvsvc_NetCharDevEnum_r_state {
12 TALLOC_CTX *out_mem_ctx;
15 static void dcerpc_srvsvc_NetCharDevEnum_r_done(struct tevent_req *subreq);
17 struct tevent_req *dcerpc_srvsvc_NetCharDevEnum_r_send(TALLOC_CTX *mem_ctx,
18 struct tevent_context *ev,
19 struct dcerpc_binding_handle *h,
20 struct srvsvc_NetCharDevEnum *r)
22 struct tevent_req *req;
23 struct dcerpc_srvsvc_NetCharDevEnum_r_state *state;
24 struct tevent_req *subreq;
26 req = tevent_req_create(mem_ctx, &state,
27 struct dcerpc_srvsvc_NetCharDevEnum_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_srvsvc,
39 NDR_SRVSVC_NETCHARDEVENUM, 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_srvsvc_NetCharDevEnum_r_done, req);
48 static void dcerpc_srvsvc_NetCharDevEnum_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);
56 if (!NT_STATUS_IS_OK(status)) {
57 tevent_req_nterror(req, status);
64 NTSTATUS dcerpc_srvsvc_NetCharDevEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
66 struct dcerpc_srvsvc_NetCharDevEnum_r_state *state =
68 struct dcerpc_srvsvc_NetCharDevEnum_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_srvsvc_NetCharDevEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevEnum *r)
86 status = dcerpc_binding_handle_call(h,
87 NULL, &ndr_table_srvsvc,
88 NDR_SRVSVC_NETCHARDEVENUM, mem_ctx, r);
93 NTSTATUS dcerpc_srvsvc_NetCharDevEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevEnum *r)
97 status = dcerpc_srvsvc_NetCharDevEnum_r(p->binding_handle, mem_ctx, r);
99 if (NT_STATUS_IS_RPC(status)) {
100 status = NT_STATUS_NET_WRITE_FAULT;
106 struct dcerpc_srvsvc_NetCharDevEnum_state {
107 struct srvsvc_NetCharDevEnum orig;
108 struct srvsvc_NetCharDevEnum tmp;
109 TALLOC_CTX *out_mem_ctx;
112 static void dcerpc_srvsvc_NetCharDevEnum_done(struct tevent_req *subreq);
114 struct tevent_req *dcerpc_srvsvc_NetCharDevEnum_send(TALLOC_CTX *mem_ctx,
115 struct tevent_context *ev,
116 struct dcerpc_binding_handle *h,
117 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
118 struct srvsvc_NetCharDevInfoCtr *_info_ctr /* [in,out] [ref] */,
119 uint32_t _max_buffer /* [in] */,
120 uint32_t *_totalentries /* [out] [ref] */,
121 uint32_t *_resume_handle /* [in,out] [unique] */)
123 struct tevent_req *req;
124 struct dcerpc_srvsvc_NetCharDevEnum_state *state;
125 struct tevent_req *subreq;
127 req = tevent_req_create(mem_ctx, &state,
128 struct dcerpc_srvsvc_NetCharDevEnum_state);
132 state->out_mem_ctx = NULL;
135 state->orig.in.server_unc = _server_unc;
136 state->orig.in.info_ctr = _info_ctr;
137 state->orig.in.max_buffer = _max_buffer;
138 state->orig.in.resume_handle = _resume_handle;
141 state->orig.out.info_ctr = _info_ctr;
142 state->orig.out.totalentries = _totalentries;
143 state->orig.out.resume_handle = _resume_handle;
146 ZERO_STRUCT(state->orig.out.result);
148 state->out_mem_ctx = talloc_named_const(state, 0,
149 "dcerpc_srvsvc_NetCharDevEnum_out_memory");
150 if (tevent_req_nomem(state->out_mem_ctx, req)) {
151 return tevent_req_post(req, ev);
154 /* make a temporary copy, that we pass to the dispatch function */
155 state->tmp = state->orig;
157 subreq = dcerpc_srvsvc_NetCharDevEnum_r_send(state, ev, h, &state->tmp);
158 if (tevent_req_nomem(subreq, req)) {
159 return tevent_req_post(req, ev);
161 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevEnum_done, req);
165 static void dcerpc_srvsvc_NetCharDevEnum_done(struct tevent_req *subreq)
167 struct tevent_req *req = tevent_req_callback_data(
168 subreq, struct tevent_req);
169 struct dcerpc_srvsvc_NetCharDevEnum_state *state = tevent_req_data(
170 req, struct dcerpc_srvsvc_NetCharDevEnum_state);
174 if (state->out_mem_ctx) {
175 mem_ctx = state->out_mem_ctx;
180 status = dcerpc_srvsvc_NetCharDevEnum_r_recv(subreq, mem_ctx);
182 if (!NT_STATUS_IS_OK(status)) {
183 tevent_req_nterror(req, status);
187 /* Copy out parameters */
188 *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
189 *state->orig.out.totalentries = *state->tmp.out.totalentries;
190 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
191 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
195 state->orig.out.result = state->tmp.out.result;
197 /* Reset temporary structure */
198 ZERO_STRUCT(state->tmp);
200 tevent_req_done(req);
203 NTSTATUS dcerpc_srvsvc_NetCharDevEnum_recv(struct tevent_req *req,
207 struct dcerpc_srvsvc_NetCharDevEnum_state *state = tevent_req_data(
208 req, struct dcerpc_srvsvc_NetCharDevEnum_state);
211 if (tevent_req_is_nterror(req, &status)) {
212 tevent_req_received(req);
216 /* Steal possible out parameters to the callers context */
217 talloc_steal(mem_ctx, state->out_mem_ctx);
220 *result = state->orig.out.result;
222 tevent_req_received(req);
226 NTSTATUS dcerpc_srvsvc_NetCharDevEnum(struct dcerpc_binding_handle *h,
228 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
229 struct srvsvc_NetCharDevInfoCtr *_info_ctr /* [in,out] [ref] */,
230 uint32_t _max_buffer /* [in] */,
231 uint32_t *_totalentries /* [out] [ref] */,
232 uint32_t *_resume_handle /* [in,out] [unique] */,
235 struct srvsvc_NetCharDevEnum r;
239 r.in.server_unc = _server_unc;
240 r.in.info_ctr = _info_ctr;
241 r.in.max_buffer = _max_buffer;
242 r.in.resume_handle = _resume_handle;
244 status = dcerpc_srvsvc_NetCharDevEnum_r(h, mem_ctx, &r);
245 if (!NT_STATUS_IS_OK(status)) {
249 /* Return variables */
250 *_info_ctr = *r.out.info_ctr;
251 *_totalentries = *r.out.totalentries;
252 if (_resume_handle && r.out.resume_handle) {
253 *_resume_handle = *r.out.resume_handle;
257 *result = r.out.result;
262 struct dcerpc_srvsvc_NetCharDevGetInfo_r_state {
263 TALLOC_CTX *out_mem_ctx;
266 static void dcerpc_srvsvc_NetCharDevGetInfo_r_done(struct tevent_req *subreq);
268 struct tevent_req *dcerpc_srvsvc_NetCharDevGetInfo_r_send(TALLOC_CTX *mem_ctx,
269 struct tevent_context *ev,
270 struct dcerpc_binding_handle *h,
271 struct srvsvc_NetCharDevGetInfo *r)
273 struct tevent_req *req;
274 struct dcerpc_srvsvc_NetCharDevGetInfo_r_state *state;
275 struct tevent_req *subreq;
277 req = tevent_req_create(mem_ctx, &state,
278 struct dcerpc_srvsvc_NetCharDevGetInfo_r_state);
283 state->out_mem_ctx = talloc_new(state);
284 if (tevent_req_nomem(state->out_mem_ctx, req)) {
285 return tevent_req_post(req, ev);
288 subreq = dcerpc_binding_handle_call_send(state, ev, h,
289 NULL, &ndr_table_srvsvc,
290 NDR_SRVSVC_NETCHARDEVGETINFO, state->out_mem_ctx, r);
291 if (tevent_req_nomem(subreq, req)) {
292 return tevent_req_post(req, ev);
294 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevGetInfo_r_done, req);
299 static void dcerpc_srvsvc_NetCharDevGetInfo_r_done(struct tevent_req *subreq)
301 struct tevent_req *req =
302 tevent_req_callback_data(subreq,
306 status = dcerpc_binding_handle_call_recv(subreq);
307 if (!NT_STATUS_IS_OK(status)) {
308 tevent_req_nterror(req, status);
312 tevent_req_done(req);
315 NTSTATUS dcerpc_srvsvc_NetCharDevGetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
317 struct dcerpc_srvsvc_NetCharDevGetInfo_r_state *state =
319 struct dcerpc_srvsvc_NetCharDevGetInfo_r_state);
322 if (tevent_req_is_nterror(req, &status)) {
323 tevent_req_received(req);
327 talloc_steal(mem_ctx, state->out_mem_ctx);
329 tevent_req_received(req);
333 NTSTATUS dcerpc_srvsvc_NetCharDevGetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevGetInfo *r)
337 status = dcerpc_binding_handle_call(h,
338 NULL, &ndr_table_srvsvc,
339 NDR_SRVSVC_NETCHARDEVGETINFO, mem_ctx, r);
344 NTSTATUS dcerpc_srvsvc_NetCharDevGetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevGetInfo *r)
348 status = dcerpc_srvsvc_NetCharDevGetInfo_r(p->binding_handle, mem_ctx, r);
350 if (NT_STATUS_IS_RPC(status)) {
351 status = NT_STATUS_NET_WRITE_FAULT;
357 struct dcerpc_srvsvc_NetCharDevGetInfo_state {
358 struct srvsvc_NetCharDevGetInfo orig;
359 struct srvsvc_NetCharDevGetInfo tmp;
360 TALLOC_CTX *out_mem_ctx;
363 static void dcerpc_srvsvc_NetCharDevGetInfo_done(struct tevent_req *subreq);
365 struct tevent_req *dcerpc_srvsvc_NetCharDevGetInfo_send(TALLOC_CTX *mem_ctx,
366 struct tevent_context *ev,
367 struct dcerpc_binding_handle *h,
368 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
369 const char *_device_name /* [in] [charset(UTF16)] */,
370 uint32_t _level /* [in] */,
371 union srvsvc_NetCharDevInfo *_info /* [out] [ref,switch_is(level)] */)
373 struct tevent_req *req;
374 struct dcerpc_srvsvc_NetCharDevGetInfo_state *state;
375 struct tevent_req *subreq;
377 req = tevent_req_create(mem_ctx, &state,
378 struct dcerpc_srvsvc_NetCharDevGetInfo_state);
382 state->out_mem_ctx = NULL;
385 state->orig.in.server_unc = _server_unc;
386 state->orig.in.device_name = _device_name;
387 state->orig.in.level = _level;
390 state->orig.out.info = _info;
393 ZERO_STRUCT(state->orig.out.result);
395 state->out_mem_ctx = talloc_named_const(state, 0,
396 "dcerpc_srvsvc_NetCharDevGetInfo_out_memory");
397 if (tevent_req_nomem(state->out_mem_ctx, req)) {
398 return tevent_req_post(req, ev);
401 /* make a temporary copy, that we pass to the dispatch function */
402 state->tmp = state->orig;
404 subreq = dcerpc_srvsvc_NetCharDevGetInfo_r_send(state, ev, h, &state->tmp);
405 if (tevent_req_nomem(subreq, req)) {
406 return tevent_req_post(req, ev);
408 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevGetInfo_done, req);
412 static void dcerpc_srvsvc_NetCharDevGetInfo_done(struct tevent_req *subreq)
414 struct tevent_req *req = tevent_req_callback_data(
415 subreq, struct tevent_req);
416 struct dcerpc_srvsvc_NetCharDevGetInfo_state *state = tevent_req_data(
417 req, struct dcerpc_srvsvc_NetCharDevGetInfo_state);
421 if (state->out_mem_ctx) {
422 mem_ctx = state->out_mem_ctx;
427 status = dcerpc_srvsvc_NetCharDevGetInfo_r_recv(subreq, mem_ctx);
429 if (!NT_STATUS_IS_OK(status)) {
430 tevent_req_nterror(req, status);
434 /* Copy out parameters */
435 *state->orig.out.info = *state->tmp.out.info;
438 state->orig.out.result = state->tmp.out.result;
440 /* Reset temporary structure */
441 ZERO_STRUCT(state->tmp);
443 tevent_req_done(req);
446 NTSTATUS dcerpc_srvsvc_NetCharDevGetInfo_recv(struct tevent_req *req,
450 struct dcerpc_srvsvc_NetCharDevGetInfo_state *state = tevent_req_data(
451 req, struct dcerpc_srvsvc_NetCharDevGetInfo_state);
454 if (tevent_req_is_nterror(req, &status)) {
455 tevent_req_received(req);
459 /* Steal possible out parameters to the callers context */
460 talloc_steal(mem_ctx, state->out_mem_ctx);
463 *result = state->orig.out.result;
465 tevent_req_received(req);
469 NTSTATUS dcerpc_srvsvc_NetCharDevGetInfo(struct dcerpc_binding_handle *h,
471 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
472 const char *_device_name /* [in] [charset(UTF16)] */,
473 uint32_t _level /* [in] */,
474 union srvsvc_NetCharDevInfo *_info /* [out] [ref,switch_is(level)] */,
477 struct srvsvc_NetCharDevGetInfo r;
481 r.in.server_unc = _server_unc;
482 r.in.device_name = _device_name;
485 status = dcerpc_srvsvc_NetCharDevGetInfo_r(h, mem_ctx, &r);
486 if (!NT_STATUS_IS_OK(status)) {
490 /* Return variables */
491 *_info = *r.out.info;
494 *result = r.out.result;
499 struct dcerpc_srvsvc_NetCharDevControl_r_state {
500 TALLOC_CTX *out_mem_ctx;
503 static void dcerpc_srvsvc_NetCharDevControl_r_done(struct tevent_req *subreq);
505 struct tevent_req *dcerpc_srvsvc_NetCharDevControl_r_send(TALLOC_CTX *mem_ctx,
506 struct tevent_context *ev,
507 struct dcerpc_binding_handle *h,
508 struct srvsvc_NetCharDevControl *r)
510 struct tevent_req *req;
511 struct dcerpc_srvsvc_NetCharDevControl_r_state *state;
512 struct tevent_req *subreq;
514 req = tevent_req_create(mem_ctx, &state,
515 struct dcerpc_srvsvc_NetCharDevControl_r_state);
520 state->out_mem_ctx = NULL;
521 subreq = dcerpc_binding_handle_call_send(state, ev, h,
522 NULL, &ndr_table_srvsvc,
523 NDR_SRVSVC_NETCHARDEVCONTROL, state, r);
524 if (tevent_req_nomem(subreq, req)) {
525 return tevent_req_post(req, ev);
527 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevControl_r_done, req);
532 static void dcerpc_srvsvc_NetCharDevControl_r_done(struct tevent_req *subreq)
534 struct tevent_req *req =
535 tevent_req_callback_data(subreq,
539 status = dcerpc_binding_handle_call_recv(subreq);
540 if (!NT_STATUS_IS_OK(status)) {
541 tevent_req_nterror(req, status);
545 tevent_req_done(req);
548 NTSTATUS dcerpc_srvsvc_NetCharDevControl_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
550 struct dcerpc_srvsvc_NetCharDevControl_r_state *state =
552 struct dcerpc_srvsvc_NetCharDevControl_r_state);
555 if (tevent_req_is_nterror(req, &status)) {
556 tevent_req_received(req);
560 talloc_steal(mem_ctx, state->out_mem_ctx);
562 tevent_req_received(req);
566 NTSTATUS dcerpc_srvsvc_NetCharDevControl_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevControl *r)
570 status = dcerpc_binding_handle_call(h,
571 NULL, &ndr_table_srvsvc,
572 NDR_SRVSVC_NETCHARDEVCONTROL, mem_ctx, r);
577 NTSTATUS dcerpc_srvsvc_NetCharDevControl_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevControl *r)
581 status = dcerpc_srvsvc_NetCharDevControl_r(p->binding_handle, mem_ctx, r);
583 if (NT_STATUS_IS_RPC(status)) {
584 status = NT_STATUS_NET_WRITE_FAULT;
590 struct dcerpc_srvsvc_NetCharDevControl_state {
591 struct srvsvc_NetCharDevControl orig;
592 struct srvsvc_NetCharDevControl tmp;
593 TALLOC_CTX *out_mem_ctx;
596 static void dcerpc_srvsvc_NetCharDevControl_done(struct tevent_req *subreq);
598 struct tevent_req *dcerpc_srvsvc_NetCharDevControl_send(TALLOC_CTX *mem_ctx,
599 struct tevent_context *ev,
600 struct dcerpc_binding_handle *h,
601 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
602 const char *_device_name /* [in] [charset(UTF16)] */,
603 uint32_t _opcode /* [in] */)
605 struct tevent_req *req;
606 struct dcerpc_srvsvc_NetCharDevControl_state *state;
607 struct tevent_req *subreq;
609 req = tevent_req_create(mem_ctx, &state,
610 struct dcerpc_srvsvc_NetCharDevControl_state);
614 state->out_mem_ctx = NULL;
617 state->orig.in.server_unc = _server_unc;
618 state->orig.in.device_name = _device_name;
619 state->orig.in.opcode = _opcode;
624 ZERO_STRUCT(state->orig.out.result);
626 /* make a temporary copy, that we pass to the dispatch function */
627 state->tmp = state->orig;
629 subreq = dcerpc_srvsvc_NetCharDevControl_r_send(state, ev, h, &state->tmp);
630 if (tevent_req_nomem(subreq, req)) {
631 return tevent_req_post(req, ev);
633 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevControl_done, req);
637 static void dcerpc_srvsvc_NetCharDevControl_done(struct tevent_req *subreq)
639 struct tevent_req *req = tevent_req_callback_data(
640 subreq, struct tevent_req);
641 struct dcerpc_srvsvc_NetCharDevControl_state *state = tevent_req_data(
642 req, struct dcerpc_srvsvc_NetCharDevControl_state);
646 if (state->out_mem_ctx) {
647 mem_ctx = state->out_mem_ctx;
652 status = dcerpc_srvsvc_NetCharDevControl_r_recv(subreq, mem_ctx);
654 if (!NT_STATUS_IS_OK(status)) {
655 tevent_req_nterror(req, status);
659 /* Copy out parameters */
662 state->orig.out.result = state->tmp.out.result;
664 /* Reset temporary structure */
665 ZERO_STRUCT(state->tmp);
667 tevent_req_done(req);
670 NTSTATUS dcerpc_srvsvc_NetCharDevControl_recv(struct tevent_req *req,
674 struct dcerpc_srvsvc_NetCharDevControl_state *state = tevent_req_data(
675 req, struct dcerpc_srvsvc_NetCharDevControl_state);
678 if (tevent_req_is_nterror(req, &status)) {
679 tevent_req_received(req);
683 /* Steal possible out parameters to the callers context */
684 talloc_steal(mem_ctx, state->out_mem_ctx);
687 *result = state->orig.out.result;
689 tevent_req_received(req);
693 NTSTATUS dcerpc_srvsvc_NetCharDevControl(struct dcerpc_binding_handle *h,
695 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
696 const char *_device_name /* [in] [charset(UTF16)] */,
697 uint32_t _opcode /* [in] */,
700 struct srvsvc_NetCharDevControl r;
704 r.in.server_unc = _server_unc;
705 r.in.device_name = _device_name;
706 r.in.opcode = _opcode;
708 status = dcerpc_srvsvc_NetCharDevControl_r(h, mem_ctx, &r);
709 if (!NT_STATUS_IS_OK(status)) {
713 /* Return variables */
716 *result = r.out.result;
721 struct dcerpc_srvsvc_NetCharDevQEnum_r_state {
722 TALLOC_CTX *out_mem_ctx;
725 static void dcerpc_srvsvc_NetCharDevQEnum_r_done(struct tevent_req *subreq);
727 struct tevent_req *dcerpc_srvsvc_NetCharDevQEnum_r_send(TALLOC_CTX *mem_ctx,
728 struct tevent_context *ev,
729 struct dcerpc_binding_handle *h,
730 struct srvsvc_NetCharDevQEnum *r)
732 struct tevent_req *req;
733 struct dcerpc_srvsvc_NetCharDevQEnum_r_state *state;
734 struct tevent_req *subreq;
736 req = tevent_req_create(mem_ctx, &state,
737 struct dcerpc_srvsvc_NetCharDevQEnum_r_state);
742 state->out_mem_ctx = talloc_new(state);
743 if (tevent_req_nomem(state->out_mem_ctx, req)) {
744 return tevent_req_post(req, ev);
747 subreq = dcerpc_binding_handle_call_send(state, ev, h,
748 NULL, &ndr_table_srvsvc,
749 NDR_SRVSVC_NETCHARDEVQENUM, state->out_mem_ctx, r);
750 if (tevent_req_nomem(subreq, req)) {
751 return tevent_req_post(req, ev);
753 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQEnum_r_done, req);
758 static void dcerpc_srvsvc_NetCharDevQEnum_r_done(struct tevent_req *subreq)
760 struct tevent_req *req =
761 tevent_req_callback_data(subreq,
765 status = dcerpc_binding_handle_call_recv(subreq);
766 if (!NT_STATUS_IS_OK(status)) {
767 tevent_req_nterror(req, status);
771 tevent_req_done(req);
774 NTSTATUS dcerpc_srvsvc_NetCharDevQEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
776 struct dcerpc_srvsvc_NetCharDevQEnum_r_state *state =
778 struct dcerpc_srvsvc_NetCharDevQEnum_r_state);
781 if (tevent_req_is_nterror(req, &status)) {
782 tevent_req_received(req);
786 talloc_steal(mem_ctx, state->out_mem_ctx);
788 tevent_req_received(req);
792 NTSTATUS dcerpc_srvsvc_NetCharDevQEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQEnum *r)
796 status = dcerpc_binding_handle_call(h,
797 NULL, &ndr_table_srvsvc,
798 NDR_SRVSVC_NETCHARDEVQENUM, mem_ctx, r);
803 NTSTATUS dcerpc_srvsvc_NetCharDevQEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQEnum *r)
807 status = dcerpc_srvsvc_NetCharDevQEnum_r(p->binding_handle, mem_ctx, r);
809 if (NT_STATUS_IS_RPC(status)) {
810 status = NT_STATUS_NET_WRITE_FAULT;
816 struct dcerpc_srvsvc_NetCharDevQEnum_state {
817 struct srvsvc_NetCharDevQEnum orig;
818 struct srvsvc_NetCharDevQEnum tmp;
819 TALLOC_CTX *out_mem_ctx;
822 static void dcerpc_srvsvc_NetCharDevQEnum_done(struct tevent_req *subreq);
824 struct tevent_req *dcerpc_srvsvc_NetCharDevQEnum_send(TALLOC_CTX *mem_ctx,
825 struct tevent_context *ev,
826 struct dcerpc_binding_handle *h,
827 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
828 const char *_user /* [in] [unique,charset(UTF16)] */,
829 struct srvsvc_NetCharDevQInfoCtr *_info_ctr /* [in,out] [ref] */,
830 uint32_t _max_buffer /* [in] */,
831 uint32_t *_totalentries /* [out] [ref] */,
832 uint32_t *_resume_handle /* [in,out] [unique] */)
834 struct tevent_req *req;
835 struct dcerpc_srvsvc_NetCharDevQEnum_state *state;
836 struct tevent_req *subreq;
838 req = tevent_req_create(mem_ctx, &state,
839 struct dcerpc_srvsvc_NetCharDevQEnum_state);
843 state->out_mem_ctx = NULL;
846 state->orig.in.server_unc = _server_unc;
847 state->orig.in.user = _user;
848 state->orig.in.info_ctr = _info_ctr;
849 state->orig.in.max_buffer = _max_buffer;
850 state->orig.in.resume_handle = _resume_handle;
853 state->orig.out.info_ctr = _info_ctr;
854 state->orig.out.totalentries = _totalentries;
855 state->orig.out.resume_handle = _resume_handle;
858 ZERO_STRUCT(state->orig.out.result);
860 state->out_mem_ctx = talloc_named_const(state, 0,
861 "dcerpc_srvsvc_NetCharDevQEnum_out_memory");
862 if (tevent_req_nomem(state->out_mem_ctx, req)) {
863 return tevent_req_post(req, ev);
866 /* make a temporary copy, that we pass to the dispatch function */
867 state->tmp = state->orig;
869 subreq = dcerpc_srvsvc_NetCharDevQEnum_r_send(state, ev, h, &state->tmp);
870 if (tevent_req_nomem(subreq, req)) {
871 return tevent_req_post(req, ev);
873 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQEnum_done, req);
877 static void dcerpc_srvsvc_NetCharDevQEnum_done(struct tevent_req *subreq)
879 struct tevent_req *req = tevent_req_callback_data(
880 subreq, struct tevent_req);
881 struct dcerpc_srvsvc_NetCharDevQEnum_state *state = tevent_req_data(
882 req, struct dcerpc_srvsvc_NetCharDevQEnum_state);
886 if (state->out_mem_ctx) {
887 mem_ctx = state->out_mem_ctx;
892 status = dcerpc_srvsvc_NetCharDevQEnum_r_recv(subreq, mem_ctx);
894 if (!NT_STATUS_IS_OK(status)) {
895 tevent_req_nterror(req, status);
899 /* Copy out parameters */
900 *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
901 *state->orig.out.totalentries = *state->tmp.out.totalentries;
902 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
903 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
907 state->orig.out.result = state->tmp.out.result;
909 /* Reset temporary structure */
910 ZERO_STRUCT(state->tmp);
912 tevent_req_done(req);
915 NTSTATUS dcerpc_srvsvc_NetCharDevQEnum_recv(struct tevent_req *req,
919 struct dcerpc_srvsvc_NetCharDevQEnum_state *state = tevent_req_data(
920 req, struct dcerpc_srvsvc_NetCharDevQEnum_state);
923 if (tevent_req_is_nterror(req, &status)) {
924 tevent_req_received(req);
928 /* Steal possible out parameters to the callers context */
929 talloc_steal(mem_ctx, state->out_mem_ctx);
932 *result = state->orig.out.result;
934 tevent_req_received(req);
938 NTSTATUS dcerpc_srvsvc_NetCharDevQEnum(struct dcerpc_binding_handle *h,
940 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
941 const char *_user /* [in] [unique,charset(UTF16)] */,
942 struct srvsvc_NetCharDevQInfoCtr *_info_ctr /* [in,out] [ref] */,
943 uint32_t _max_buffer /* [in] */,
944 uint32_t *_totalentries /* [out] [ref] */,
945 uint32_t *_resume_handle /* [in,out] [unique] */,
948 struct srvsvc_NetCharDevQEnum r;
952 r.in.server_unc = _server_unc;
954 r.in.info_ctr = _info_ctr;
955 r.in.max_buffer = _max_buffer;
956 r.in.resume_handle = _resume_handle;
958 status = dcerpc_srvsvc_NetCharDevQEnum_r(h, mem_ctx, &r);
959 if (!NT_STATUS_IS_OK(status)) {
963 /* Return variables */
964 *_info_ctr = *r.out.info_ctr;
965 *_totalentries = *r.out.totalentries;
966 if (_resume_handle && r.out.resume_handle) {
967 *_resume_handle = *r.out.resume_handle;
971 *result = r.out.result;
976 struct dcerpc_srvsvc_NetCharDevQGetInfo_r_state {
977 TALLOC_CTX *out_mem_ctx;
980 static void dcerpc_srvsvc_NetCharDevQGetInfo_r_done(struct tevent_req *subreq);
982 struct tevent_req *dcerpc_srvsvc_NetCharDevQGetInfo_r_send(TALLOC_CTX *mem_ctx,
983 struct tevent_context *ev,
984 struct dcerpc_binding_handle *h,
985 struct srvsvc_NetCharDevQGetInfo *r)
987 struct tevent_req *req;
988 struct dcerpc_srvsvc_NetCharDevQGetInfo_r_state *state;
989 struct tevent_req *subreq;
991 req = tevent_req_create(mem_ctx, &state,
992 struct dcerpc_srvsvc_NetCharDevQGetInfo_r_state);
997 state->out_mem_ctx = talloc_new(state);
998 if (tevent_req_nomem(state->out_mem_ctx, req)) {
999 return tevent_req_post(req, ev);
1002 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1003 NULL, &ndr_table_srvsvc,
1004 NDR_SRVSVC_NETCHARDEVQGETINFO, state->out_mem_ctx, r);
1005 if (tevent_req_nomem(subreq, req)) {
1006 return tevent_req_post(req, ev);
1008 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQGetInfo_r_done, req);
1013 static void dcerpc_srvsvc_NetCharDevQGetInfo_r_done(struct tevent_req *subreq)
1015 struct tevent_req *req =
1016 tevent_req_callback_data(subreq,
1020 status = dcerpc_binding_handle_call_recv(subreq);
1021 if (!NT_STATUS_IS_OK(status)) {
1022 tevent_req_nterror(req, status);
1026 tevent_req_done(req);
1029 NTSTATUS dcerpc_srvsvc_NetCharDevQGetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1031 struct dcerpc_srvsvc_NetCharDevQGetInfo_r_state *state =
1032 tevent_req_data(req,
1033 struct dcerpc_srvsvc_NetCharDevQGetInfo_r_state);
1036 if (tevent_req_is_nterror(req, &status)) {
1037 tevent_req_received(req);
1041 talloc_steal(mem_ctx, state->out_mem_ctx);
1043 tevent_req_received(req);
1044 return NT_STATUS_OK;
1047 NTSTATUS dcerpc_srvsvc_NetCharDevQGetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQGetInfo *r)
1051 status = dcerpc_binding_handle_call(h,
1052 NULL, &ndr_table_srvsvc,
1053 NDR_SRVSVC_NETCHARDEVQGETINFO, mem_ctx, r);
1058 NTSTATUS dcerpc_srvsvc_NetCharDevQGetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQGetInfo *r)
1062 status = dcerpc_srvsvc_NetCharDevQGetInfo_r(p->binding_handle, mem_ctx, r);
1064 if (NT_STATUS_IS_RPC(status)) {
1065 status = NT_STATUS_NET_WRITE_FAULT;
1071 struct dcerpc_srvsvc_NetCharDevQGetInfo_state {
1072 struct srvsvc_NetCharDevQGetInfo orig;
1073 struct srvsvc_NetCharDevQGetInfo tmp;
1074 TALLOC_CTX *out_mem_ctx;
1077 static void dcerpc_srvsvc_NetCharDevQGetInfo_done(struct tevent_req *subreq);
1079 struct tevent_req *dcerpc_srvsvc_NetCharDevQGetInfo_send(TALLOC_CTX *mem_ctx,
1080 struct tevent_context *ev,
1081 struct dcerpc_binding_handle *h,
1082 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1083 const char *_queue_name /* [in] [charset(UTF16)] */,
1084 const char *_user /* [in] [charset(UTF16)] */,
1085 uint32_t _level /* [in] */,
1086 union srvsvc_NetCharDevQInfo *_info /* [out] [ref,switch_is(level)] */)
1088 struct tevent_req *req;
1089 struct dcerpc_srvsvc_NetCharDevQGetInfo_state *state;
1090 struct tevent_req *subreq;
1092 req = tevent_req_create(mem_ctx, &state,
1093 struct dcerpc_srvsvc_NetCharDevQGetInfo_state);
1097 state->out_mem_ctx = NULL;
1100 state->orig.in.server_unc = _server_unc;
1101 state->orig.in.queue_name = _queue_name;
1102 state->orig.in.user = _user;
1103 state->orig.in.level = _level;
1105 /* Out parameters */
1106 state->orig.out.info = _info;
1109 ZERO_STRUCT(state->orig.out.result);
1111 state->out_mem_ctx = talloc_named_const(state, 0,
1112 "dcerpc_srvsvc_NetCharDevQGetInfo_out_memory");
1113 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1114 return tevent_req_post(req, ev);
1117 /* make a temporary copy, that we pass to the dispatch function */
1118 state->tmp = state->orig;
1120 subreq = dcerpc_srvsvc_NetCharDevQGetInfo_r_send(state, ev, h, &state->tmp);
1121 if (tevent_req_nomem(subreq, req)) {
1122 return tevent_req_post(req, ev);
1124 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQGetInfo_done, req);
1128 static void dcerpc_srvsvc_NetCharDevQGetInfo_done(struct tevent_req *subreq)
1130 struct tevent_req *req = tevent_req_callback_data(
1131 subreq, struct tevent_req);
1132 struct dcerpc_srvsvc_NetCharDevQGetInfo_state *state = tevent_req_data(
1133 req, struct dcerpc_srvsvc_NetCharDevQGetInfo_state);
1135 TALLOC_CTX *mem_ctx;
1137 if (state->out_mem_ctx) {
1138 mem_ctx = state->out_mem_ctx;
1143 status = dcerpc_srvsvc_NetCharDevQGetInfo_r_recv(subreq, mem_ctx);
1144 TALLOC_FREE(subreq);
1145 if (!NT_STATUS_IS_OK(status)) {
1146 tevent_req_nterror(req, status);
1150 /* Copy out parameters */
1151 *state->orig.out.info = *state->tmp.out.info;
1154 state->orig.out.result = state->tmp.out.result;
1156 /* Reset temporary structure */
1157 ZERO_STRUCT(state->tmp);
1159 tevent_req_done(req);
1162 NTSTATUS dcerpc_srvsvc_NetCharDevQGetInfo_recv(struct tevent_req *req,
1163 TALLOC_CTX *mem_ctx,
1166 struct dcerpc_srvsvc_NetCharDevQGetInfo_state *state = tevent_req_data(
1167 req, struct dcerpc_srvsvc_NetCharDevQGetInfo_state);
1170 if (tevent_req_is_nterror(req, &status)) {
1171 tevent_req_received(req);
1175 /* Steal possible out parameters to the callers context */
1176 talloc_steal(mem_ctx, state->out_mem_ctx);
1179 *result = state->orig.out.result;
1181 tevent_req_received(req);
1182 return NT_STATUS_OK;
1185 NTSTATUS dcerpc_srvsvc_NetCharDevQGetInfo(struct dcerpc_binding_handle *h,
1186 TALLOC_CTX *mem_ctx,
1187 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1188 const char *_queue_name /* [in] [charset(UTF16)] */,
1189 const char *_user /* [in] [charset(UTF16)] */,
1190 uint32_t _level /* [in] */,
1191 union srvsvc_NetCharDevQInfo *_info /* [out] [ref,switch_is(level)] */,
1194 struct srvsvc_NetCharDevQGetInfo r;
1198 r.in.server_unc = _server_unc;
1199 r.in.queue_name = _queue_name;
1201 r.in.level = _level;
1203 status = dcerpc_srvsvc_NetCharDevQGetInfo_r(h, mem_ctx, &r);
1204 if (!NT_STATUS_IS_OK(status)) {
1208 /* Return variables */
1209 *_info = *r.out.info;
1212 *result = r.out.result;
1214 return NT_STATUS_OK;
1217 struct dcerpc_srvsvc_NetCharDevQSetInfo_r_state {
1218 TALLOC_CTX *out_mem_ctx;
1221 static void dcerpc_srvsvc_NetCharDevQSetInfo_r_done(struct tevent_req *subreq);
1223 struct tevent_req *dcerpc_srvsvc_NetCharDevQSetInfo_r_send(TALLOC_CTX *mem_ctx,
1224 struct tevent_context *ev,
1225 struct dcerpc_binding_handle *h,
1226 struct srvsvc_NetCharDevQSetInfo *r)
1228 struct tevent_req *req;
1229 struct dcerpc_srvsvc_NetCharDevQSetInfo_r_state *state;
1230 struct tevent_req *subreq;
1232 req = tevent_req_create(mem_ctx, &state,
1233 struct dcerpc_srvsvc_NetCharDevQSetInfo_r_state);
1238 state->out_mem_ctx = talloc_new(state);
1239 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1240 return tevent_req_post(req, ev);
1243 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1244 NULL, &ndr_table_srvsvc,
1245 NDR_SRVSVC_NETCHARDEVQSETINFO, state->out_mem_ctx, r);
1246 if (tevent_req_nomem(subreq, req)) {
1247 return tevent_req_post(req, ev);
1249 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQSetInfo_r_done, req);
1254 static void dcerpc_srvsvc_NetCharDevQSetInfo_r_done(struct tevent_req *subreq)
1256 struct tevent_req *req =
1257 tevent_req_callback_data(subreq,
1261 status = dcerpc_binding_handle_call_recv(subreq);
1262 if (!NT_STATUS_IS_OK(status)) {
1263 tevent_req_nterror(req, status);
1267 tevent_req_done(req);
1270 NTSTATUS dcerpc_srvsvc_NetCharDevQSetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1272 struct dcerpc_srvsvc_NetCharDevQSetInfo_r_state *state =
1273 tevent_req_data(req,
1274 struct dcerpc_srvsvc_NetCharDevQSetInfo_r_state);
1277 if (tevent_req_is_nterror(req, &status)) {
1278 tevent_req_received(req);
1282 talloc_steal(mem_ctx, state->out_mem_ctx);
1284 tevent_req_received(req);
1285 return NT_STATUS_OK;
1288 NTSTATUS dcerpc_srvsvc_NetCharDevQSetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQSetInfo *r)
1292 status = dcerpc_binding_handle_call(h,
1293 NULL, &ndr_table_srvsvc,
1294 NDR_SRVSVC_NETCHARDEVQSETINFO, mem_ctx, r);
1299 NTSTATUS dcerpc_srvsvc_NetCharDevQSetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQSetInfo *r)
1303 status = dcerpc_srvsvc_NetCharDevQSetInfo_r(p->binding_handle, mem_ctx, r);
1305 if (NT_STATUS_IS_RPC(status)) {
1306 status = NT_STATUS_NET_WRITE_FAULT;
1312 struct dcerpc_srvsvc_NetCharDevQSetInfo_state {
1313 struct srvsvc_NetCharDevQSetInfo orig;
1314 struct srvsvc_NetCharDevQSetInfo tmp;
1315 TALLOC_CTX *out_mem_ctx;
1318 static void dcerpc_srvsvc_NetCharDevQSetInfo_done(struct tevent_req *subreq);
1320 struct tevent_req *dcerpc_srvsvc_NetCharDevQSetInfo_send(TALLOC_CTX *mem_ctx,
1321 struct tevent_context *ev,
1322 struct dcerpc_binding_handle *h,
1323 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1324 const char *_queue_name /* [in] [charset(UTF16)] */,
1325 uint32_t _level /* [in] */,
1326 union srvsvc_NetCharDevQInfo _info /* [in] [switch_is(level)] */,
1327 uint32_t *_parm_error /* [in,out] [unique] */)
1329 struct tevent_req *req;
1330 struct dcerpc_srvsvc_NetCharDevQSetInfo_state *state;
1331 struct tevent_req *subreq;
1333 req = tevent_req_create(mem_ctx, &state,
1334 struct dcerpc_srvsvc_NetCharDevQSetInfo_state);
1338 state->out_mem_ctx = NULL;
1341 state->orig.in.server_unc = _server_unc;
1342 state->orig.in.queue_name = _queue_name;
1343 state->orig.in.level = _level;
1344 state->orig.in.info = _info;
1345 state->orig.in.parm_error = _parm_error;
1347 /* Out parameters */
1348 state->orig.out.parm_error = _parm_error;
1351 ZERO_STRUCT(state->orig.out.result);
1353 state->out_mem_ctx = talloc_named_const(state, 0,
1354 "dcerpc_srvsvc_NetCharDevQSetInfo_out_memory");
1355 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1356 return tevent_req_post(req, ev);
1359 /* make a temporary copy, that we pass to the dispatch function */
1360 state->tmp = state->orig;
1362 subreq = dcerpc_srvsvc_NetCharDevQSetInfo_r_send(state, ev, h, &state->tmp);
1363 if (tevent_req_nomem(subreq, req)) {
1364 return tevent_req_post(req, ev);
1366 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQSetInfo_done, req);
1370 static void dcerpc_srvsvc_NetCharDevQSetInfo_done(struct tevent_req *subreq)
1372 struct tevent_req *req = tevent_req_callback_data(
1373 subreq, struct tevent_req);
1374 struct dcerpc_srvsvc_NetCharDevQSetInfo_state *state = tevent_req_data(
1375 req, struct dcerpc_srvsvc_NetCharDevQSetInfo_state);
1377 TALLOC_CTX *mem_ctx;
1379 if (state->out_mem_ctx) {
1380 mem_ctx = state->out_mem_ctx;
1385 status = dcerpc_srvsvc_NetCharDevQSetInfo_r_recv(subreq, mem_ctx);
1386 TALLOC_FREE(subreq);
1387 if (!NT_STATUS_IS_OK(status)) {
1388 tevent_req_nterror(req, status);
1392 /* Copy out parameters */
1393 if (state->orig.out.parm_error && state->tmp.out.parm_error) {
1394 *state->orig.out.parm_error = *state->tmp.out.parm_error;
1398 state->orig.out.result = state->tmp.out.result;
1400 /* Reset temporary structure */
1401 ZERO_STRUCT(state->tmp);
1403 tevent_req_done(req);
1406 NTSTATUS dcerpc_srvsvc_NetCharDevQSetInfo_recv(struct tevent_req *req,
1407 TALLOC_CTX *mem_ctx,
1410 struct dcerpc_srvsvc_NetCharDevQSetInfo_state *state = tevent_req_data(
1411 req, struct dcerpc_srvsvc_NetCharDevQSetInfo_state);
1414 if (tevent_req_is_nterror(req, &status)) {
1415 tevent_req_received(req);
1419 /* Steal possible out parameters to the callers context */
1420 talloc_steal(mem_ctx, state->out_mem_ctx);
1423 *result = state->orig.out.result;
1425 tevent_req_received(req);
1426 return NT_STATUS_OK;
1429 NTSTATUS dcerpc_srvsvc_NetCharDevQSetInfo(struct dcerpc_binding_handle *h,
1430 TALLOC_CTX *mem_ctx,
1431 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1432 const char *_queue_name /* [in] [charset(UTF16)] */,
1433 uint32_t _level /* [in] */,
1434 union srvsvc_NetCharDevQInfo _info /* [in] [switch_is(level)] */,
1435 uint32_t *_parm_error /* [in,out] [unique] */,
1438 struct srvsvc_NetCharDevQSetInfo r;
1442 r.in.server_unc = _server_unc;
1443 r.in.queue_name = _queue_name;
1444 r.in.level = _level;
1446 r.in.parm_error = _parm_error;
1448 status = dcerpc_srvsvc_NetCharDevQSetInfo_r(h, mem_ctx, &r);
1449 if (!NT_STATUS_IS_OK(status)) {
1453 /* Return variables */
1454 if (_parm_error && r.out.parm_error) {
1455 *_parm_error = *r.out.parm_error;
1459 *result = r.out.result;
1461 return NT_STATUS_OK;
1464 struct dcerpc_srvsvc_NetCharDevQPurge_r_state {
1465 TALLOC_CTX *out_mem_ctx;
1468 static void dcerpc_srvsvc_NetCharDevQPurge_r_done(struct tevent_req *subreq);
1470 struct tevent_req *dcerpc_srvsvc_NetCharDevQPurge_r_send(TALLOC_CTX *mem_ctx,
1471 struct tevent_context *ev,
1472 struct dcerpc_binding_handle *h,
1473 struct srvsvc_NetCharDevQPurge *r)
1475 struct tevent_req *req;
1476 struct dcerpc_srvsvc_NetCharDevQPurge_r_state *state;
1477 struct tevent_req *subreq;
1479 req = tevent_req_create(mem_ctx, &state,
1480 struct dcerpc_srvsvc_NetCharDevQPurge_r_state);
1485 state->out_mem_ctx = NULL;
1486 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1487 NULL, &ndr_table_srvsvc,
1488 NDR_SRVSVC_NETCHARDEVQPURGE, state, r);
1489 if (tevent_req_nomem(subreq, req)) {
1490 return tevent_req_post(req, ev);
1492 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQPurge_r_done, req);
1497 static void dcerpc_srvsvc_NetCharDevQPurge_r_done(struct tevent_req *subreq)
1499 struct tevent_req *req =
1500 tevent_req_callback_data(subreq,
1504 status = dcerpc_binding_handle_call_recv(subreq);
1505 if (!NT_STATUS_IS_OK(status)) {
1506 tevent_req_nterror(req, status);
1510 tevent_req_done(req);
1513 NTSTATUS dcerpc_srvsvc_NetCharDevQPurge_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1515 struct dcerpc_srvsvc_NetCharDevQPurge_r_state *state =
1516 tevent_req_data(req,
1517 struct dcerpc_srvsvc_NetCharDevQPurge_r_state);
1520 if (tevent_req_is_nterror(req, &status)) {
1521 tevent_req_received(req);
1525 talloc_steal(mem_ctx, state->out_mem_ctx);
1527 tevent_req_received(req);
1528 return NT_STATUS_OK;
1531 NTSTATUS dcerpc_srvsvc_NetCharDevQPurge_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQPurge *r)
1535 status = dcerpc_binding_handle_call(h,
1536 NULL, &ndr_table_srvsvc,
1537 NDR_SRVSVC_NETCHARDEVQPURGE, mem_ctx, r);
1542 NTSTATUS dcerpc_srvsvc_NetCharDevQPurge_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQPurge *r)
1546 status = dcerpc_srvsvc_NetCharDevQPurge_r(p->binding_handle, mem_ctx, r);
1548 if (NT_STATUS_IS_RPC(status)) {
1549 status = NT_STATUS_NET_WRITE_FAULT;
1555 struct dcerpc_srvsvc_NetCharDevQPurge_state {
1556 struct srvsvc_NetCharDevQPurge orig;
1557 struct srvsvc_NetCharDevQPurge tmp;
1558 TALLOC_CTX *out_mem_ctx;
1561 static void dcerpc_srvsvc_NetCharDevQPurge_done(struct tevent_req *subreq);
1563 struct tevent_req *dcerpc_srvsvc_NetCharDevQPurge_send(TALLOC_CTX *mem_ctx,
1564 struct tevent_context *ev,
1565 struct dcerpc_binding_handle *h,
1566 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1567 const char *_queue_name /* [in] [charset(UTF16)] */)
1569 struct tevent_req *req;
1570 struct dcerpc_srvsvc_NetCharDevQPurge_state *state;
1571 struct tevent_req *subreq;
1573 req = tevent_req_create(mem_ctx, &state,
1574 struct dcerpc_srvsvc_NetCharDevQPurge_state);
1578 state->out_mem_ctx = NULL;
1581 state->orig.in.server_unc = _server_unc;
1582 state->orig.in.queue_name = _queue_name;
1584 /* Out parameters */
1587 ZERO_STRUCT(state->orig.out.result);
1589 /* make a temporary copy, that we pass to the dispatch function */
1590 state->tmp = state->orig;
1592 subreq = dcerpc_srvsvc_NetCharDevQPurge_r_send(state, ev, h, &state->tmp);
1593 if (tevent_req_nomem(subreq, req)) {
1594 return tevent_req_post(req, ev);
1596 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQPurge_done, req);
1600 static void dcerpc_srvsvc_NetCharDevQPurge_done(struct tevent_req *subreq)
1602 struct tevent_req *req = tevent_req_callback_data(
1603 subreq, struct tevent_req);
1604 struct dcerpc_srvsvc_NetCharDevQPurge_state *state = tevent_req_data(
1605 req, struct dcerpc_srvsvc_NetCharDevQPurge_state);
1607 TALLOC_CTX *mem_ctx;
1609 if (state->out_mem_ctx) {
1610 mem_ctx = state->out_mem_ctx;
1615 status = dcerpc_srvsvc_NetCharDevQPurge_r_recv(subreq, mem_ctx);
1616 TALLOC_FREE(subreq);
1617 if (!NT_STATUS_IS_OK(status)) {
1618 tevent_req_nterror(req, status);
1622 /* Copy out parameters */
1625 state->orig.out.result = state->tmp.out.result;
1627 /* Reset temporary structure */
1628 ZERO_STRUCT(state->tmp);
1630 tevent_req_done(req);
1633 NTSTATUS dcerpc_srvsvc_NetCharDevQPurge_recv(struct tevent_req *req,
1634 TALLOC_CTX *mem_ctx,
1637 struct dcerpc_srvsvc_NetCharDevQPurge_state *state = tevent_req_data(
1638 req, struct dcerpc_srvsvc_NetCharDevQPurge_state);
1641 if (tevent_req_is_nterror(req, &status)) {
1642 tevent_req_received(req);
1646 /* Steal possible out parameters to the callers context */
1647 talloc_steal(mem_ctx, state->out_mem_ctx);
1650 *result = state->orig.out.result;
1652 tevent_req_received(req);
1653 return NT_STATUS_OK;
1656 NTSTATUS dcerpc_srvsvc_NetCharDevQPurge(struct dcerpc_binding_handle *h,
1657 TALLOC_CTX *mem_ctx,
1658 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1659 const char *_queue_name /* [in] [charset(UTF16)] */,
1662 struct srvsvc_NetCharDevQPurge r;
1666 r.in.server_unc = _server_unc;
1667 r.in.queue_name = _queue_name;
1669 status = dcerpc_srvsvc_NetCharDevQPurge_r(h, mem_ctx, &r);
1670 if (!NT_STATUS_IS_OK(status)) {
1674 /* Return variables */
1677 *result = r.out.result;
1679 return NT_STATUS_OK;
1682 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_r_state {
1683 TALLOC_CTX *out_mem_ctx;
1686 static void dcerpc_srvsvc_NetCharDevQPurgeSelf_r_done(struct tevent_req *subreq);
1688 struct tevent_req *dcerpc_srvsvc_NetCharDevQPurgeSelf_r_send(TALLOC_CTX *mem_ctx,
1689 struct tevent_context *ev,
1690 struct dcerpc_binding_handle *h,
1691 struct srvsvc_NetCharDevQPurgeSelf *r)
1693 struct tevent_req *req;
1694 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_r_state *state;
1695 struct tevent_req *subreq;
1697 req = tevent_req_create(mem_ctx, &state,
1698 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_r_state);
1703 state->out_mem_ctx = NULL;
1704 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1705 NULL, &ndr_table_srvsvc,
1706 NDR_SRVSVC_NETCHARDEVQPURGESELF, state, r);
1707 if (tevent_req_nomem(subreq, req)) {
1708 return tevent_req_post(req, ev);
1710 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQPurgeSelf_r_done, req);
1715 static void dcerpc_srvsvc_NetCharDevQPurgeSelf_r_done(struct tevent_req *subreq)
1717 struct tevent_req *req =
1718 tevent_req_callback_data(subreq,
1722 status = dcerpc_binding_handle_call_recv(subreq);
1723 if (!NT_STATUS_IS_OK(status)) {
1724 tevent_req_nterror(req, status);
1728 tevent_req_done(req);
1731 NTSTATUS dcerpc_srvsvc_NetCharDevQPurgeSelf_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1733 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_r_state *state =
1734 tevent_req_data(req,
1735 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_r_state);
1738 if (tevent_req_is_nterror(req, &status)) {
1739 tevent_req_received(req);
1743 talloc_steal(mem_ctx, state->out_mem_ctx);
1745 tevent_req_received(req);
1746 return NT_STATUS_OK;
1749 NTSTATUS dcerpc_srvsvc_NetCharDevQPurgeSelf_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQPurgeSelf *r)
1753 status = dcerpc_binding_handle_call(h,
1754 NULL, &ndr_table_srvsvc,
1755 NDR_SRVSVC_NETCHARDEVQPURGESELF, mem_ctx, r);
1760 NTSTATUS dcerpc_srvsvc_NetCharDevQPurgeSelf_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetCharDevQPurgeSelf *r)
1764 status = dcerpc_srvsvc_NetCharDevQPurgeSelf_r(p->binding_handle, mem_ctx, r);
1766 if (NT_STATUS_IS_RPC(status)) {
1767 status = NT_STATUS_NET_WRITE_FAULT;
1773 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_state {
1774 struct srvsvc_NetCharDevQPurgeSelf orig;
1775 struct srvsvc_NetCharDevQPurgeSelf tmp;
1776 TALLOC_CTX *out_mem_ctx;
1779 static void dcerpc_srvsvc_NetCharDevQPurgeSelf_done(struct tevent_req *subreq);
1781 struct tevent_req *dcerpc_srvsvc_NetCharDevQPurgeSelf_send(TALLOC_CTX *mem_ctx,
1782 struct tevent_context *ev,
1783 struct dcerpc_binding_handle *h,
1784 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1785 const char *_queue_name /* [in] [charset(UTF16)] */,
1786 const char *_computer_name /* [in] [charset(UTF16)] */)
1788 struct tevent_req *req;
1789 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_state *state;
1790 struct tevent_req *subreq;
1792 req = tevent_req_create(mem_ctx, &state,
1793 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_state);
1797 state->out_mem_ctx = NULL;
1800 state->orig.in.server_unc = _server_unc;
1801 state->orig.in.queue_name = _queue_name;
1802 state->orig.in.computer_name = _computer_name;
1804 /* Out parameters */
1807 ZERO_STRUCT(state->orig.out.result);
1809 /* make a temporary copy, that we pass to the dispatch function */
1810 state->tmp = state->orig;
1812 subreq = dcerpc_srvsvc_NetCharDevQPurgeSelf_r_send(state, ev, h, &state->tmp);
1813 if (tevent_req_nomem(subreq, req)) {
1814 return tevent_req_post(req, ev);
1816 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetCharDevQPurgeSelf_done, req);
1820 static void dcerpc_srvsvc_NetCharDevQPurgeSelf_done(struct tevent_req *subreq)
1822 struct tevent_req *req = tevent_req_callback_data(
1823 subreq, struct tevent_req);
1824 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_state *state = tevent_req_data(
1825 req, struct dcerpc_srvsvc_NetCharDevQPurgeSelf_state);
1827 TALLOC_CTX *mem_ctx;
1829 if (state->out_mem_ctx) {
1830 mem_ctx = state->out_mem_ctx;
1835 status = dcerpc_srvsvc_NetCharDevQPurgeSelf_r_recv(subreq, mem_ctx);
1836 TALLOC_FREE(subreq);
1837 if (!NT_STATUS_IS_OK(status)) {
1838 tevent_req_nterror(req, status);
1842 /* Copy out parameters */
1845 state->orig.out.result = state->tmp.out.result;
1847 /* Reset temporary structure */
1848 ZERO_STRUCT(state->tmp);
1850 tevent_req_done(req);
1853 NTSTATUS dcerpc_srvsvc_NetCharDevQPurgeSelf_recv(struct tevent_req *req,
1854 TALLOC_CTX *mem_ctx,
1857 struct dcerpc_srvsvc_NetCharDevQPurgeSelf_state *state = tevent_req_data(
1858 req, struct dcerpc_srvsvc_NetCharDevQPurgeSelf_state);
1861 if (tevent_req_is_nterror(req, &status)) {
1862 tevent_req_received(req);
1866 /* Steal possible out parameters to the callers context */
1867 talloc_steal(mem_ctx, state->out_mem_ctx);
1870 *result = state->orig.out.result;
1872 tevent_req_received(req);
1873 return NT_STATUS_OK;
1876 NTSTATUS dcerpc_srvsvc_NetCharDevQPurgeSelf(struct dcerpc_binding_handle *h,
1877 TALLOC_CTX *mem_ctx,
1878 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
1879 const char *_queue_name /* [in] [charset(UTF16)] */,
1880 const char *_computer_name /* [in] [charset(UTF16)] */,
1883 struct srvsvc_NetCharDevQPurgeSelf r;
1887 r.in.server_unc = _server_unc;
1888 r.in.queue_name = _queue_name;
1889 r.in.computer_name = _computer_name;
1891 status = dcerpc_srvsvc_NetCharDevQPurgeSelf_r(h, mem_ctx, &r);
1892 if (!NT_STATUS_IS_OK(status)) {
1896 /* Return variables */
1899 *result = r.out.result;
1901 return NT_STATUS_OK;
1904 struct dcerpc_srvsvc_NetConnEnum_r_state {
1905 TALLOC_CTX *out_mem_ctx;
1908 static void dcerpc_srvsvc_NetConnEnum_r_done(struct tevent_req *subreq);
1910 struct tevent_req *dcerpc_srvsvc_NetConnEnum_r_send(TALLOC_CTX *mem_ctx,
1911 struct tevent_context *ev,
1912 struct dcerpc_binding_handle *h,
1913 struct srvsvc_NetConnEnum *r)
1915 struct tevent_req *req;
1916 struct dcerpc_srvsvc_NetConnEnum_r_state *state;
1917 struct tevent_req *subreq;
1919 req = tevent_req_create(mem_ctx, &state,
1920 struct dcerpc_srvsvc_NetConnEnum_r_state);
1925 state->out_mem_ctx = talloc_new(state);
1926 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1927 return tevent_req_post(req, ev);
1930 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1931 NULL, &ndr_table_srvsvc,
1932 NDR_SRVSVC_NETCONNENUM, state->out_mem_ctx, r);
1933 if (tevent_req_nomem(subreq, req)) {
1934 return tevent_req_post(req, ev);
1936 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetConnEnum_r_done, req);
1941 static void dcerpc_srvsvc_NetConnEnum_r_done(struct tevent_req *subreq)
1943 struct tevent_req *req =
1944 tevent_req_callback_data(subreq,
1948 status = dcerpc_binding_handle_call_recv(subreq);
1949 if (!NT_STATUS_IS_OK(status)) {
1950 tevent_req_nterror(req, status);
1954 tevent_req_done(req);
1957 NTSTATUS dcerpc_srvsvc_NetConnEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1959 struct dcerpc_srvsvc_NetConnEnum_r_state *state =
1960 tevent_req_data(req,
1961 struct dcerpc_srvsvc_NetConnEnum_r_state);
1964 if (tevent_req_is_nterror(req, &status)) {
1965 tevent_req_received(req);
1969 talloc_steal(mem_ctx, state->out_mem_ctx);
1971 tevent_req_received(req);
1972 return NT_STATUS_OK;
1975 NTSTATUS dcerpc_srvsvc_NetConnEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetConnEnum *r)
1979 status = dcerpc_binding_handle_call(h,
1980 NULL, &ndr_table_srvsvc,
1981 NDR_SRVSVC_NETCONNENUM, mem_ctx, r);
1986 NTSTATUS dcerpc_srvsvc_NetConnEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetConnEnum *r)
1990 status = dcerpc_srvsvc_NetConnEnum_r(p->binding_handle, mem_ctx, r);
1992 if (NT_STATUS_IS_RPC(status)) {
1993 status = NT_STATUS_NET_WRITE_FAULT;
1999 struct dcerpc_srvsvc_NetConnEnum_state {
2000 struct srvsvc_NetConnEnum orig;
2001 struct srvsvc_NetConnEnum tmp;
2002 TALLOC_CTX *out_mem_ctx;
2005 static void dcerpc_srvsvc_NetConnEnum_done(struct tevent_req *subreq);
2007 struct tevent_req *dcerpc_srvsvc_NetConnEnum_send(TALLOC_CTX *mem_ctx,
2008 struct tevent_context *ev,
2009 struct dcerpc_binding_handle *h,
2010 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2011 const char *_path /* [in] [unique,charset(UTF16)] */,
2012 struct srvsvc_NetConnInfoCtr *_info_ctr /* [in,out] [ref] */,
2013 uint32_t _max_buffer /* [in] */,
2014 uint32_t *_totalentries /* [out] [ref] */,
2015 uint32_t *_resume_handle /* [in,out] [unique] */)
2017 struct tevent_req *req;
2018 struct dcerpc_srvsvc_NetConnEnum_state *state;
2019 struct tevent_req *subreq;
2021 req = tevent_req_create(mem_ctx, &state,
2022 struct dcerpc_srvsvc_NetConnEnum_state);
2026 state->out_mem_ctx = NULL;
2029 state->orig.in.server_unc = _server_unc;
2030 state->orig.in.path = _path;
2031 state->orig.in.info_ctr = _info_ctr;
2032 state->orig.in.max_buffer = _max_buffer;
2033 state->orig.in.resume_handle = _resume_handle;
2035 /* Out parameters */
2036 state->orig.out.info_ctr = _info_ctr;
2037 state->orig.out.totalentries = _totalentries;
2038 state->orig.out.resume_handle = _resume_handle;
2041 ZERO_STRUCT(state->orig.out.result);
2043 state->out_mem_ctx = talloc_named_const(state, 0,
2044 "dcerpc_srvsvc_NetConnEnum_out_memory");
2045 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2046 return tevent_req_post(req, ev);
2049 /* make a temporary copy, that we pass to the dispatch function */
2050 state->tmp = state->orig;
2052 subreq = dcerpc_srvsvc_NetConnEnum_r_send(state, ev, h, &state->tmp);
2053 if (tevent_req_nomem(subreq, req)) {
2054 return tevent_req_post(req, ev);
2056 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetConnEnum_done, req);
2060 static void dcerpc_srvsvc_NetConnEnum_done(struct tevent_req *subreq)
2062 struct tevent_req *req = tevent_req_callback_data(
2063 subreq, struct tevent_req);
2064 struct dcerpc_srvsvc_NetConnEnum_state *state = tevent_req_data(
2065 req, struct dcerpc_srvsvc_NetConnEnum_state);
2067 TALLOC_CTX *mem_ctx;
2069 if (state->out_mem_ctx) {
2070 mem_ctx = state->out_mem_ctx;
2075 status = dcerpc_srvsvc_NetConnEnum_r_recv(subreq, mem_ctx);
2076 TALLOC_FREE(subreq);
2077 if (!NT_STATUS_IS_OK(status)) {
2078 tevent_req_nterror(req, status);
2082 /* Copy out parameters */
2083 *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
2084 *state->orig.out.totalentries = *state->tmp.out.totalentries;
2085 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
2086 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2090 state->orig.out.result = state->tmp.out.result;
2092 /* Reset temporary structure */
2093 ZERO_STRUCT(state->tmp);
2095 tevent_req_done(req);
2098 NTSTATUS dcerpc_srvsvc_NetConnEnum_recv(struct tevent_req *req,
2099 TALLOC_CTX *mem_ctx,
2102 struct dcerpc_srvsvc_NetConnEnum_state *state = tevent_req_data(
2103 req, struct dcerpc_srvsvc_NetConnEnum_state);
2106 if (tevent_req_is_nterror(req, &status)) {
2107 tevent_req_received(req);
2111 /* Steal possible out parameters to the callers context */
2112 talloc_steal(mem_ctx, state->out_mem_ctx);
2115 *result = state->orig.out.result;
2117 tevent_req_received(req);
2118 return NT_STATUS_OK;
2121 NTSTATUS dcerpc_srvsvc_NetConnEnum(struct dcerpc_binding_handle *h,
2122 TALLOC_CTX *mem_ctx,
2123 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2124 const char *_path /* [in] [unique,charset(UTF16)] */,
2125 struct srvsvc_NetConnInfoCtr *_info_ctr /* [in,out] [ref] */,
2126 uint32_t _max_buffer /* [in] */,
2127 uint32_t *_totalentries /* [out] [ref] */,
2128 uint32_t *_resume_handle /* [in,out] [unique] */,
2131 struct srvsvc_NetConnEnum r;
2135 r.in.server_unc = _server_unc;
2137 r.in.info_ctr = _info_ctr;
2138 r.in.max_buffer = _max_buffer;
2139 r.in.resume_handle = _resume_handle;
2141 status = dcerpc_srvsvc_NetConnEnum_r(h, mem_ctx, &r);
2142 if (!NT_STATUS_IS_OK(status)) {
2146 /* Return variables */
2147 *_info_ctr = *r.out.info_ctr;
2148 *_totalentries = *r.out.totalentries;
2149 if (_resume_handle && r.out.resume_handle) {
2150 *_resume_handle = *r.out.resume_handle;
2154 *result = r.out.result;
2156 return NT_STATUS_OK;
2159 struct dcerpc_srvsvc_NetFileEnum_r_state {
2160 TALLOC_CTX *out_mem_ctx;
2163 static void dcerpc_srvsvc_NetFileEnum_r_done(struct tevent_req *subreq);
2165 struct tevent_req *dcerpc_srvsvc_NetFileEnum_r_send(TALLOC_CTX *mem_ctx,
2166 struct tevent_context *ev,
2167 struct dcerpc_binding_handle *h,
2168 struct srvsvc_NetFileEnum *r)
2170 struct tevent_req *req;
2171 struct dcerpc_srvsvc_NetFileEnum_r_state *state;
2172 struct tevent_req *subreq;
2174 req = tevent_req_create(mem_ctx, &state,
2175 struct dcerpc_srvsvc_NetFileEnum_r_state);
2180 state->out_mem_ctx = talloc_new(state);
2181 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2182 return tevent_req_post(req, ev);
2185 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2186 NULL, &ndr_table_srvsvc,
2187 NDR_SRVSVC_NETFILEENUM, state->out_mem_ctx, r);
2188 if (tevent_req_nomem(subreq, req)) {
2189 return tevent_req_post(req, ev);
2191 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetFileEnum_r_done, req);
2196 static void dcerpc_srvsvc_NetFileEnum_r_done(struct tevent_req *subreq)
2198 struct tevent_req *req =
2199 tevent_req_callback_data(subreq,
2203 status = dcerpc_binding_handle_call_recv(subreq);
2204 if (!NT_STATUS_IS_OK(status)) {
2205 tevent_req_nterror(req, status);
2209 tevent_req_done(req);
2212 NTSTATUS dcerpc_srvsvc_NetFileEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2214 struct dcerpc_srvsvc_NetFileEnum_r_state *state =
2215 tevent_req_data(req,
2216 struct dcerpc_srvsvc_NetFileEnum_r_state);
2219 if (tevent_req_is_nterror(req, &status)) {
2220 tevent_req_received(req);
2224 talloc_steal(mem_ctx, state->out_mem_ctx);
2226 tevent_req_received(req);
2227 return NT_STATUS_OK;
2230 NTSTATUS dcerpc_srvsvc_NetFileEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetFileEnum *r)
2234 status = dcerpc_binding_handle_call(h,
2235 NULL, &ndr_table_srvsvc,
2236 NDR_SRVSVC_NETFILEENUM, mem_ctx, r);
2241 NTSTATUS dcerpc_srvsvc_NetFileEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetFileEnum *r)
2245 status = dcerpc_srvsvc_NetFileEnum_r(p->binding_handle, mem_ctx, r);
2247 if (NT_STATUS_IS_RPC(status)) {
2248 status = NT_STATUS_NET_WRITE_FAULT;
2254 struct dcerpc_srvsvc_NetFileEnum_state {
2255 struct srvsvc_NetFileEnum orig;
2256 struct srvsvc_NetFileEnum tmp;
2257 TALLOC_CTX *out_mem_ctx;
2260 static void dcerpc_srvsvc_NetFileEnum_done(struct tevent_req *subreq);
2262 struct tevent_req *dcerpc_srvsvc_NetFileEnum_send(TALLOC_CTX *mem_ctx,
2263 struct tevent_context *ev,
2264 struct dcerpc_binding_handle *h,
2265 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2266 const char *_path /* [in] [unique,charset(UTF16)] */,
2267 const char *_user /* [in] [unique,charset(UTF16)] */,
2268 struct srvsvc_NetFileInfoCtr *_info_ctr /* [in,out] [ref] */,
2269 uint32_t _max_buffer /* [in] */,
2270 uint32_t *_totalentries /* [out] [ref] */,
2271 uint32_t *_resume_handle /* [in,out] [unique] */)
2273 struct tevent_req *req;
2274 struct dcerpc_srvsvc_NetFileEnum_state *state;
2275 struct tevent_req *subreq;
2277 req = tevent_req_create(mem_ctx, &state,
2278 struct dcerpc_srvsvc_NetFileEnum_state);
2282 state->out_mem_ctx = NULL;
2285 state->orig.in.server_unc = _server_unc;
2286 state->orig.in.path = _path;
2287 state->orig.in.user = _user;
2288 state->orig.in.info_ctr = _info_ctr;
2289 state->orig.in.max_buffer = _max_buffer;
2290 state->orig.in.resume_handle = _resume_handle;
2292 /* Out parameters */
2293 state->orig.out.info_ctr = _info_ctr;
2294 state->orig.out.totalentries = _totalentries;
2295 state->orig.out.resume_handle = _resume_handle;
2298 ZERO_STRUCT(state->orig.out.result);
2300 state->out_mem_ctx = talloc_named_const(state, 0,
2301 "dcerpc_srvsvc_NetFileEnum_out_memory");
2302 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2303 return tevent_req_post(req, ev);
2306 /* make a temporary copy, that we pass to the dispatch function */
2307 state->tmp = state->orig;
2309 subreq = dcerpc_srvsvc_NetFileEnum_r_send(state, ev, h, &state->tmp);
2310 if (tevent_req_nomem(subreq, req)) {
2311 return tevent_req_post(req, ev);
2313 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetFileEnum_done, req);
2317 static void dcerpc_srvsvc_NetFileEnum_done(struct tevent_req *subreq)
2319 struct tevent_req *req = tevent_req_callback_data(
2320 subreq, struct tevent_req);
2321 struct dcerpc_srvsvc_NetFileEnum_state *state = tevent_req_data(
2322 req, struct dcerpc_srvsvc_NetFileEnum_state);
2324 TALLOC_CTX *mem_ctx;
2326 if (state->out_mem_ctx) {
2327 mem_ctx = state->out_mem_ctx;
2332 status = dcerpc_srvsvc_NetFileEnum_r_recv(subreq, mem_ctx);
2333 TALLOC_FREE(subreq);
2334 if (!NT_STATUS_IS_OK(status)) {
2335 tevent_req_nterror(req, status);
2339 /* Copy out parameters */
2340 *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
2341 *state->orig.out.totalentries = *state->tmp.out.totalentries;
2342 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
2343 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2347 state->orig.out.result = state->tmp.out.result;
2349 /* Reset temporary structure */
2350 ZERO_STRUCT(state->tmp);
2352 tevent_req_done(req);
2355 NTSTATUS dcerpc_srvsvc_NetFileEnum_recv(struct tevent_req *req,
2356 TALLOC_CTX *mem_ctx,
2359 struct dcerpc_srvsvc_NetFileEnum_state *state = tevent_req_data(
2360 req, struct dcerpc_srvsvc_NetFileEnum_state);
2363 if (tevent_req_is_nterror(req, &status)) {
2364 tevent_req_received(req);
2368 /* Steal possible out parameters to the callers context */
2369 talloc_steal(mem_ctx, state->out_mem_ctx);
2372 *result = state->orig.out.result;
2374 tevent_req_received(req);
2375 return NT_STATUS_OK;
2378 NTSTATUS dcerpc_srvsvc_NetFileEnum(struct dcerpc_binding_handle *h,
2379 TALLOC_CTX *mem_ctx,
2380 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2381 const char *_path /* [in] [unique,charset(UTF16)] */,
2382 const char *_user /* [in] [unique,charset(UTF16)] */,
2383 struct srvsvc_NetFileInfoCtr *_info_ctr /* [in,out] [ref] */,
2384 uint32_t _max_buffer /* [in] */,
2385 uint32_t *_totalentries /* [out] [ref] */,
2386 uint32_t *_resume_handle /* [in,out] [unique] */,
2389 struct srvsvc_NetFileEnum r;
2393 r.in.server_unc = _server_unc;
2396 r.in.info_ctr = _info_ctr;
2397 r.in.max_buffer = _max_buffer;
2398 r.in.resume_handle = _resume_handle;
2400 status = dcerpc_srvsvc_NetFileEnum_r(h, mem_ctx, &r);
2401 if (!NT_STATUS_IS_OK(status)) {
2405 /* Return variables */
2406 *_info_ctr = *r.out.info_ctr;
2407 *_totalentries = *r.out.totalentries;
2408 if (_resume_handle && r.out.resume_handle) {
2409 *_resume_handle = *r.out.resume_handle;
2413 *result = r.out.result;
2415 return NT_STATUS_OK;
2418 struct dcerpc_srvsvc_NetFileGetInfo_r_state {
2419 TALLOC_CTX *out_mem_ctx;
2422 static void dcerpc_srvsvc_NetFileGetInfo_r_done(struct tevent_req *subreq);
2424 struct tevent_req *dcerpc_srvsvc_NetFileGetInfo_r_send(TALLOC_CTX *mem_ctx,
2425 struct tevent_context *ev,
2426 struct dcerpc_binding_handle *h,
2427 struct srvsvc_NetFileGetInfo *r)
2429 struct tevent_req *req;
2430 struct dcerpc_srvsvc_NetFileGetInfo_r_state *state;
2431 struct tevent_req *subreq;
2433 req = tevent_req_create(mem_ctx, &state,
2434 struct dcerpc_srvsvc_NetFileGetInfo_r_state);
2439 state->out_mem_ctx = talloc_new(state);
2440 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2441 return tevent_req_post(req, ev);
2444 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2445 NULL, &ndr_table_srvsvc,
2446 NDR_SRVSVC_NETFILEGETINFO, state->out_mem_ctx, r);
2447 if (tevent_req_nomem(subreq, req)) {
2448 return tevent_req_post(req, ev);
2450 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetFileGetInfo_r_done, req);
2455 static void dcerpc_srvsvc_NetFileGetInfo_r_done(struct tevent_req *subreq)
2457 struct tevent_req *req =
2458 tevent_req_callback_data(subreq,
2462 status = dcerpc_binding_handle_call_recv(subreq);
2463 if (!NT_STATUS_IS_OK(status)) {
2464 tevent_req_nterror(req, status);
2468 tevent_req_done(req);
2471 NTSTATUS dcerpc_srvsvc_NetFileGetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2473 struct dcerpc_srvsvc_NetFileGetInfo_r_state *state =
2474 tevent_req_data(req,
2475 struct dcerpc_srvsvc_NetFileGetInfo_r_state);
2478 if (tevent_req_is_nterror(req, &status)) {
2479 tevent_req_received(req);
2483 talloc_steal(mem_ctx, state->out_mem_ctx);
2485 tevent_req_received(req);
2486 return NT_STATUS_OK;
2489 NTSTATUS dcerpc_srvsvc_NetFileGetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetFileGetInfo *r)
2493 status = dcerpc_binding_handle_call(h,
2494 NULL, &ndr_table_srvsvc,
2495 NDR_SRVSVC_NETFILEGETINFO, mem_ctx, r);
2500 NTSTATUS dcerpc_srvsvc_NetFileGetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetFileGetInfo *r)
2504 status = dcerpc_srvsvc_NetFileGetInfo_r(p->binding_handle, mem_ctx, r);
2506 if (NT_STATUS_IS_RPC(status)) {
2507 status = NT_STATUS_NET_WRITE_FAULT;
2513 struct dcerpc_srvsvc_NetFileGetInfo_state {
2514 struct srvsvc_NetFileGetInfo orig;
2515 struct srvsvc_NetFileGetInfo tmp;
2516 TALLOC_CTX *out_mem_ctx;
2519 static void dcerpc_srvsvc_NetFileGetInfo_done(struct tevent_req *subreq);
2521 struct tevent_req *dcerpc_srvsvc_NetFileGetInfo_send(TALLOC_CTX *mem_ctx,
2522 struct tevent_context *ev,
2523 struct dcerpc_binding_handle *h,
2524 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2525 uint32_t _fid /* [in] */,
2526 uint32_t _level /* [in] */,
2527 union srvsvc_NetFileInfo *_info /* [out] [ref,switch_is(level)] */)
2529 struct tevent_req *req;
2530 struct dcerpc_srvsvc_NetFileGetInfo_state *state;
2531 struct tevent_req *subreq;
2533 req = tevent_req_create(mem_ctx, &state,
2534 struct dcerpc_srvsvc_NetFileGetInfo_state);
2538 state->out_mem_ctx = NULL;
2541 state->orig.in.server_unc = _server_unc;
2542 state->orig.in.fid = _fid;
2543 state->orig.in.level = _level;
2545 /* Out parameters */
2546 state->orig.out.info = _info;
2549 ZERO_STRUCT(state->orig.out.result);
2551 state->out_mem_ctx = talloc_named_const(state, 0,
2552 "dcerpc_srvsvc_NetFileGetInfo_out_memory");
2553 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2554 return tevent_req_post(req, ev);
2557 /* make a temporary copy, that we pass to the dispatch function */
2558 state->tmp = state->orig;
2560 subreq = dcerpc_srvsvc_NetFileGetInfo_r_send(state, ev, h, &state->tmp);
2561 if (tevent_req_nomem(subreq, req)) {
2562 return tevent_req_post(req, ev);
2564 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetFileGetInfo_done, req);
2568 static void dcerpc_srvsvc_NetFileGetInfo_done(struct tevent_req *subreq)
2570 struct tevent_req *req = tevent_req_callback_data(
2571 subreq, struct tevent_req);
2572 struct dcerpc_srvsvc_NetFileGetInfo_state *state = tevent_req_data(
2573 req, struct dcerpc_srvsvc_NetFileGetInfo_state);
2575 TALLOC_CTX *mem_ctx;
2577 if (state->out_mem_ctx) {
2578 mem_ctx = state->out_mem_ctx;
2583 status = dcerpc_srvsvc_NetFileGetInfo_r_recv(subreq, mem_ctx);
2584 TALLOC_FREE(subreq);
2585 if (!NT_STATUS_IS_OK(status)) {
2586 tevent_req_nterror(req, status);
2590 /* Copy out parameters */
2591 *state->orig.out.info = *state->tmp.out.info;
2594 state->orig.out.result = state->tmp.out.result;
2596 /* Reset temporary structure */
2597 ZERO_STRUCT(state->tmp);
2599 tevent_req_done(req);
2602 NTSTATUS dcerpc_srvsvc_NetFileGetInfo_recv(struct tevent_req *req,
2603 TALLOC_CTX *mem_ctx,
2606 struct dcerpc_srvsvc_NetFileGetInfo_state *state = tevent_req_data(
2607 req, struct dcerpc_srvsvc_NetFileGetInfo_state);
2610 if (tevent_req_is_nterror(req, &status)) {
2611 tevent_req_received(req);
2615 /* Steal possible out parameters to the callers context */
2616 talloc_steal(mem_ctx, state->out_mem_ctx);
2619 *result = state->orig.out.result;
2621 tevent_req_received(req);
2622 return NT_STATUS_OK;
2625 NTSTATUS dcerpc_srvsvc_NetFileGetInfo(struct dcerpc_binding_handle *h,
2626 TALLOC_CTX *mem_ctx,
2627 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2628 uint32_t _fid /* [in] */,
2629 uint32_t _level /* [in] */,
2630 union srvsvc_NetFileInfo *_info /* [out] [ref,switch_is(level)] */,
2633 struct srvsvc_NetFileGetInfo r;
2637 r.in.server_unc = _server_unc;
2639 r.in.level = _level;
2641 status = dcerpc_srvsvc_NetFileGetInfo_r(h, mem_ctx, &r);
2642 if (!NT_STATUS_IS_OK(status)) {
2646 /* Return variables */
2647 *_info = *r.out.info;
2650 *result = r.out.result;
2652 return NT_STATUS_OK;
2655 struct dcerpc_srvsvc_NetFileClose_r_state {
2656 TALLOC_CTX *out_mem_ctx;
2659 static void dcerpc_srvsvc_NetFileClose_r_done(struct tevent_req *subreq);
2661 struct tevent_req *dcerpc_srvsvc_NetFileClose_r_send(TALLOC_CTX *mem_ctx,
2662 struct tevent_context *ev,
2663 struct dcerpc_binding_handle *h,
2664 struct srvsvc_NetFileClose *r)
2666 struct tevent_req *req;
2667 struct dcerpc_srvsvc_NetFileClose_r_state *state;
2668 struct tevent_req *subreq;
2670 req = tevent_req_create(mem_ctx, &state,
2671 struct dcerpc_srvsvc_NetFileClose_r_state);
2676 state->out_mem_ctx = NULL;
2677 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2678 NULL, &ndr_table_srvsvc,
2679 NDR_SRVSVC_NETFILECLOSE, state, r);
2680 if (tevent_req_nomem(subreq, req)) {
2681 return tevent_req_post(req, ev);
2683 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetFileClose_r_done, req);
2688 static void dcerpc_srvsvc_NetFileClose_r_done(struct tevent_req *subreq)
2690 struct tevent_req *req =
2691 tevent_req_callback_data(subreq,
2695 status = dcerpc_binding_handle_call_recv(subreq);
2696 if (!NT_STATUS_IS_OK(status)) {
2697 tevent_req_nterror(req, status);
2701 tevent_req_done(req);
2704 NTSTATUS dcerpc_srvsvc_NetFileClose_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2706 struct dcerpc_srvsvc_NetFileClose_r_state *state =
2707 tevent_req_data(req,
2708 struct dcerpc_srvsvc_NetFileClose_r_state);
2711 if (tevent_req_is_nterror(req, &status)) {
2712 tevent_req_received(req);
2716 talloc_steal(mem_ctx, state->out_mem_ctx);
2718 tevent_req_received(req);
2719 return NT_STATUS_OK;
2722 NTSTATUS dcerpc_srvsvc_NetFileClose_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetFileClose *r)
2726 status = dcerpc_binding_handle_call(h,
2727 NULL, &ndr_table_srvsvc,
2728 NDR_SRVSVC_NETFILECLOSE, mem_ctx, r);
2733 NTSTATUS dcerpc_srvsvc_NetFileClose_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetFileClose *r)
2737 status = dcerpc_srvsvc_NetFileClose_r(p->binding_handle, mem_ctx, r);
2739 if (NT_STATUS_IS_RPC(status)) {
2740 status = NT_STATUS_NET_WRITE_FAULT;
2746 struct dcerpc_srvsvc_NetFileClose_state {
2747 struct srvsvc_NetFileClose orig;
2748 struct srvsvc_NetFileClose tmp;
2749 TALLOC_CTX *out_mem_ctx;
2752 static void dcerpc_srvsvc_NetFileClose_done(struct tevent_req *subreq);
2754 struct tevent_req *dcerpc_srvsvc_NetFileClose_send(TALLOC_CTX *mem_ctx,
2755 struct tevent_context *ev,
2756 struct dcerpc_binding_handle *h,
2757 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2758 uint32_t _fid /* [in] */)
2760 struct tevent_req *req;
2761 struct dcerpc_srvsvc_NetFileClose_state *state;
2762 struct tevent_req *subreq;
2764 req = tevent_req_create(mem_ctx, &state,
2765 struct dcerpc_srvsvc_NetFileClose_state);
2769 state->out_mem_ctx = NULL;
2772 state->orig.in.server_unc = _server_unc;
2773 state->orig.in.fid = _fid;
2775 /* Out parameters */
2778 ZERO_STRUCT(state->orig.out.result);
2780 /* make a temporary copy, that we pass to the dispatch function */
2781 state->tmp = state->orig;
2783 subreq = dcerpc_srvsvc_NetFileClose_r_send(state, ev, h, &state->tmp);
2784 if (tevent_req_nomem(subreq, req)) {
2785 return tevent_req_post(req, ev);
2787 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetFileClose_done, req);
2791 static void dcerpc_srvsvc_NetFileClose_done(struct tevent_req *subreq)
2793 struct tevent_req *req = tevent_req_callback_data(
2794 subreq, struct tevent_req);
2795 struct dcerpc_srvsvc_NetFileClose_state *state = tevent_req_data(
2796 req, struct dcerpc_srvsvc_NetFileClose_state);
2798 TALLOC_CTX *mem_ctx;
2800 if (state->out_mem_ctx) {
2801 mem_ctx = state->out_mem_ctx;
2806 status = dcerpc_srvsvc_NetFileClose_r_recv(subreq, mem_ctx);
2807 TALLOC_FREE(subreq);
2808 if (!NT_STATUS_IS_OK(status)) {
2809 tevent_req_nterror(req, status);
2813 /* Copy out parameters */
2816 state->orig.out.result = state->tmp.out.result;
2818 /* Reset temporary structure */
2819 ZERO_STRUCT(state->tmp);
2821 tevent_req_done(req);
2824 NTSTATUS dcerpc_srvsvc_NetFileClose_recv(struct tevent_req *req,
2825 TALLOC_CTX *mem_ctx,
2828 struct dcerpc_srvsvc_NetFileClose_state *state = tevent_req_data(
2829 req, struct dcerpc_srvsvc_NetFileClose_state);
2832 if (tevent_req_is_nterror(req, &status)) {
2833 tevent_req_received(req);
2837 /* Steal possible out parameters to the callers context */
2838 talloc_steal(mem_ctx, state->out_mem_ctx);
2841 *result = state->orig.out.result;
2843 tevent_req_received(req);
2844 return NT_STATUS_OK;
2847 NTSTATUS dcerpc_srvsvc_NetFileClose(struct dcerpc_binding_handle *h,
2848 TALLOC_CTX *mem_ctx,
2849 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2850 uint32_t _fid /* [in] */,
2853 struct srvsvc_NetFileClose r;
2857 r.in.server_unc = _server_unc;
2860 status = dcerpc_srvsvc_NetFileClose_r(h, mem_ctx, &r);
2861 if (!NT_STATUS_IS_OK(status)) {
2865 /* Return variables */
2868 *result = r.out.result;
2870 return NT_STATUS_OK;
2873 struct dcerpc_srvsvc_NetSessEnum_r_state {
2874 TALLOC_CTX *out_mem_ctx;
2877 static void dcerpc_srvsvc_NetSessEnum_r_done(struct tevent_req *subreq);
2879 struct tevent_req *dcerpc_srvsvc_NetSessEnum_r_send(TALLOC_CTX *mem_ctx,
2880 struct tevent_context *ev,
2881 struct dcerpc_binding_handle *h,
2882 struct srvsvc_NetSessEnum *r)
2884 struct tevent_req *req;
2885 struct dcerpc_srvsvc_NetSessEnum_r_state *state;
2886 struct tevent_req *subreq;
2888 req = tevent_req_create(mem_ctx, &state,
2889 struct dcerpc_srvsvc_NetSessEnum_r_state);
2894 state->out_mem_ctx = talloc_new(state);
2895 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2896 return tevent_req_post(req, ev);
2899 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2900 NULL, &ndr_table_srvsvc,
2901 NDR_SRVSVC_NETSESSENUM, state->out_mem_ctx, r);
2902 if (tevent_req_nomem(subreq, req)) {
2903 return tevent_req_post(req, ev);
2905 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSessEnum_r_done, req);
2910 static void dcerpc_srvsvc_NetSessEnum_r_done(struct tevent_req *subreq)
2912 struct tevent_req *req =
2913 tevent_req_callback_data(subreq,
2917 status = dcerpc_binding_handle_call_recv(subreq);
2918 if (!NT_STATUS_IS_OK(status)) {
2919 tevent_req_nterror(req, status);
2923 tevent_req_done(req);
2926 NTSTATUS dcerpc_srvsvc_NetSessEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2928 struct dcerpc_srvsvc_NetSessEnum_r_state *state =
2929 tevent_req_data(req,
2930 struct dcerpc_srvsvc_NetSessEnum_r_state);
2933 if (tevent_req_is_nterror(req, &status)) {
2934 tevent_req_received(req);
2938 talloc_steal(mem_ctx, state->out_mem_ctx);
2940 tevent_req_received(req);
2941 return NT_STATUS_OK;
2944 NTSTATUS dcerpc_srvsvc_NetSessEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetSessEnum *r)
2948 status = dcerpc_binding_handle_call(h,
2949 NULL, &ndr_table_srvsvc,
2950 NDR_SRVSVC_NETSESSENUM, mem_ctx, r);
2955 NTSTATUS dcerpc_srvsvc_NetSessEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetSessEnum *r)
2959 status = dcerpc_srvsvc_NetSessEnum_r(p->binding_handle, mem_ctx, r);
2961 if (NT_STATUS_IS_RPC(status)) {
2962 status = NT_STATUS_NET_WRITE_FAULT;
2968 struct dcerpc_srvsvc_NetSessEnum_state {
2969 struct srvsvc_NetSessEnum orig;
2970 struct srvsvc_NetSessEnum tmp;
2971 TALLOC_CTX *out_mem_ctx;
2974 static void dcerpc_srvsvc_NetSessEnum_done(struct tevent_req *subreq);
2976 struct tevent_req *dcerpc_srvsvc_NetSessEnum_send(TALLOC_CTX *mem_ctx,
2977 struct tevent_context *ev,
2978 struct dcerpc_binding_handle *h,
2979 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
2980 const char *_client /* [in] [unique,charset(UTF16)] */,
2981 const char *_user /* [in] [unique,charset(UTF16)] */,
2982 struct srvsvc_NetSessInfoCtr *_info_ctr /* [in,out] [ref] */,
2983 uint32_t _max_buffer /* [in] */,
2984 uint32_t *_totalentries /* [out] [ref] */,
2985 uint32_t *_resume_handle /* [in,out] [unique] */)
2987 struct tevent_req *req;
2988 struct dcerpc_srvsvc_NetSessEnum_state *state;
2989 struct tevent_req *subreq;
2991 req = tevent_req_create(mem_ctx, &state,
2992 struct dcerpc_srvsvc_NetSessEnum_state);
2996 state->out_mem_ctx = NULL;
2999 state->orig.in.server_unc = _server_unc;
3000 state->orig.in.client = _client;
3001 state->orig.in.user = _user;
3002 state->orig.in.info_ctr = _info_ctr;
3003 state->orig.in.max_buffer = _max_buffer;
3004 state->orig.in.resume_handle = _resume_handle;
3006 /* Out parameters */
3007 state->orig.out.info_ctr = _info_ctr;
3008 state->orig.out.totalentries = _totalentries;
3009 state->orig.out.resume_handle = _resume_handle;
3012 ZERO_STRUCT(state->orig.out.result);
3014 state->out_mem_ctx = talloc_named_const(state, 0,
3015 "dcerpc_srvsvc_NetSessEnum_out_memory");
3016 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3017 return tevent_req_post(req, ev);
3020 /* make a temporary copy, that we pass to the dispatch function */
3021 state->tmp = state->orig;
3023 subreq = dcerpc_srvsvc_NetSessEnum_r_send(state, ev, h, &state->tmp);
3024 if (tevent_req_nomem(subreq, req)) {
3025 return tevent_req_post(req, ev);
3027 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSessEnum_done, req);
3031 static void dcerpc_srvsvc_NetSessEnum_done(struct tevent_req *subreq)
3033 struct tevent_req *req = tevent_req_callback_data(
3034 subreq, struct tevent_req);
3035 struct dcerpc_srvsvc_NetSessEnum_state *state = tevent_req_data(
3036 req, struct dcerpc_srvsvc_NetSessEnum_state);
3038 TALLOC_CTX *mem_ctx;
3040 if (state->out_mem_ctx) {
3041 mem_ctx = state->out_mem_ctx;
3046 status = dcerpc_srvsvc_NetSessEnum_r_recv(subreq, mem_ctx);
3047 TALLOC_FREE(subreq);
3048 if (!NT_STATUS_IS_OK(status)) {
3049 tevent_req_nterror(req, status);
3053 /* Copy out parameters */
3054 *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
3055 *state->orig.out.totalentries = *state->tmp.out.totalentries;
3056 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
3057 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
3061 state->orig.out.result = state->tmp.out.result;
3063 /* Reset temporary structure */
3064 ZERO_STRUCT(state->tmp);
3066 tevent_req_done(req);
3069 NTSTATUS dcerpc_srvsvc_NetSessEnum_recv(struct tevent_req *req,
3070 TALLOC_CTX *mem_ctx,
3073 struct dcerpc_srvsvc_NetSessEnum_state *state = tevent_req_data(
3074 req, struct dcerpc_srvsvc_NetSessEnum_state);
3077 if (tevent_req_is_nterror(req, &status)) {
3078 tevent_req_received(req);
3082 /* Steal possible out parameters to the callers context */
3083 talloc_steal(mem_ctx, state->out_mem_ctx);
3086 *result = state->orig.out.result;
3088 tevent_req_received(req);
3089 return NT_STATUS_OK;
3092 NTSTATUS dcerpc_srvsvc_NetSessEnum(struct dcerpc_binding_handle *h,
3093 TALLOC_CTX *mem_ctx,
3094 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3095 const char *_client /* [in] [unique,charset(UTF16)] */,
3096 const char *_user /* [in] [unique,charset(UTF16)] */,
3097 struct srvsvc_NetSessInfoCtr *_info_ctr /* [in,out] [ref] */,
3098 uint32_t _max_buffer /* [in] */,
3099 uint32_t *_totalentries /* [out] [ref] */,
3100 uint32_t *_resume_handle /* [in,out] [unique] */,
3103 struct srvsvc_NetSessEnum r;
3107 r.in.server_unc = _server_unc;
3108 r.in.client = _client;
3110 r.in.info_ctr = _info_ctr;
3111 r.in.max_buffer = _max_buffer;
3112 r.in.resume_handle = _resume_handle;
3114 status = dcerpc_srvsvc_NetSessEnum_r(h, mem_ctx, &r);
3115 if (!NT_STATUS_IS_OK(status)) {
3119 /* Return variables */
3120 *_info_ctr = *r.out.info_ctr;
3121 *_totalentries = *r.out.totalentries;
3122 if (_resume_handle && r.out.resume_handle) {
3123 *_resume_handle = *r.out.resume_handle;
3127 *result = r.out.result;
3129 return NT_STATUS_OK;
3132 struct dcerpc_srvsvc_NetSessDel_r_state {
3133 TALLOC_CTX *out_mem_ctx;
3136 static void dcerpc_srvsvc_NetSessDel_r_done(struct tevent_req *subreq);
3138 struct tevent_req *dcerpc_srvsvc_NetSessDel_r_send(TALLOC_CTX *mem_ctx,
3139 struct tevent_context *ev,
3140 struct dcerpc_binding_handle *h,
3141 struct srvsvc_NetSessDel *r)
3143 struct tevent_req *req;
3144 struct dcerpc_srvsvc_NetSessDel_r_state *state;
3145 struct tevent_req *subreq;
3147 req = tevent_req_create(mem_ctx, &state,
3148 struct dcerpc_srvsvc_NetSessDel_r_state);
3153 state->out_mem_ctx = NULL;
3154 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3155 NULL, &ndr_table_srvsvc,
3156 NDR_SRVSVC_NETSESSDEL, state, r);
3157 if (tevent_req_nomem(subreq, req)) {
3158 return tevent_req_post(req, ev);
3160 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSessDel_r_done, req);
3165 static void dcerpc_srvsvc_NetSessDel_r_done(struct tevent_req *subreq)
3167 struct tevent_req *req =
3168 tevent_req_callback_data(subreq,
3172 status = dcerpc_binding_handle_call_recv(subreq);
3173 if (!NT_STATUS_IS_OK(status)) {
3174 tevent_req_nterror(req, status);
3178 tevent_req_done(req);
3181 NTSTATUS dcerpc_srvsvc_NetSessDel_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3183 struct dcerpc_srvsvc_NetSessDel_r_state *state =
3184 tevent_req_data(req,
3185 struct dcerpc_srvsvc_NetSessDel_r_state);
3188 if (tevent_req_is_nterror(req, &status)) {
3189 tevent_req_received(req);
3193 talloc_steal(mem_ctx, state->out_mem_ctx);
3195 tevent_req_received(req);
3196 return NT_STATUS_OK;
3199 NTSTATUS dcerpc_srvsvc_NetSessDel_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetSessDel *r)
3203 status = dcerpc_binding_handle_call(h,
3204 NULL, &ndr_table_srvsvc,
3205 NDR_SRVSVC_NETSESSDEL, mem_ctx, r);
3210 NTSTATUS dcerpc_srvsvc_NetSessDel_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetSessDel *r)
3214 status = dcerpc_srvsvc_NetSessDel_r(p->binding_handle, mem_ctx, r);
3216 if (NT_STATUS_IS_RPC(status)) {
3217 status = NT_STATUS_NET_WRITE_FAULT;
3223 struct dcerpc_srvsvc_NetSessDel_state {
3224 struct srvsvc_NetSessDel orig;
3225 struct srvsvc_NetSessDel tmp;
3226 TALLOC_CTX *out_mem_ctx;
3229 static void dcerpc_srvsvc_NetSessDel_done(struct tevent_req *subreq);
3231 struct tevent_req *dcerpc_srvsvc_NetSessDel_send(TALLOC_CTX *mem_ctx,
3232 struct tevent_context *ev,
3233 struct dcerpc_binding_handle *h,
3234 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3235 const char *_client /* [in] [unique,charset(UTF16)] */,
3236 const char *_user /* [in] [unique,charset(UTF16)] */)
3238 struct tevent_req *req;
3239 struct dcerpc_srvsvc_NetSessDel_state *state;
3240 struct tevent_req *subreq;
3242 req = tevent_req_create(mem_ctx, &state,
3243 struct dcerpc_srvsvc_NetSessDel_state);
3247 state->out_mem_ctx = NULL;
3250 state->orig.in.server_unc = _server_unc;
3251 state->orig.in.client = _client;
3252 state->orig.in.user = _user;
3254 /* Out parameters */
3257 ZERO_STRUCT(state->orig.out.result);
3259 /* make a temporary copy, that we pass to the dispatch function */
3260 state->tmp = state->orig;
3262 subreq = dcerpc_srvsvc_NetSessDel_r_send(state, ev, h, &state->tmp);
3263 if (tevent_req_nomem(subreq, req)) {
3264 return tevent_req_post(req, ev);
3266 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSessDel_done, req);
3270 static void dcerpc_srvsvc_NetSessDel_done(struct tevent_req *subreq)
3272 struct tevent_req *req = tevent_req_callback_data(
3273 subreq, struct tevent_req);
3274 struct dcerpc_srvsvc_NetSessDel_state *state = tevent_req_data(
3275 req, struct dcerpc_srvsvc_NetSessDel_state);
3277 TALLOC_CTX *mem_ctx;
3279 if (state->out_mem_ctx) {
3280 mem_ctx = state->out_mem_ctx;
3285 status = dcerpc_srvsvc_NetSessDel_r_recv(subreq, mem_ctx);
3286 TALLOC_FREE(subreq);
3287 if (!NT_STATUS_IS_OK(status)) {
3288 tevent_req_nterror(req, status);
3292 /* Copy out parameters */
3295 state->orig.out.result = state->tmp.out.result;
3297 /* Reset temporary structure */
3298 ZERO_STRUCT(state->tmp);
3300 tevent_req_done(req);
3303 NTSTATUS dcerpc_srvsvc_NetSessDel_recv(struct tevent_req *req,
3304 TALLOC_CTX *mem_ctx,
3307 struct dcerpc_srvsvc_NetSessDel_state *state = tevent_req_data(
3308 req, struct dcerpc_srvsvc_NetSessDel_state);
3311 if (tevent_req_is_nterror(req, &status)) {
3312 tevent_req_received(req);
3316 /* Steal possible out parameters to the callers context */
3317 talloc_steal(mem_ctx, state->out_mem_ctx);
3320 *result = state->orig.out.result;
3322 tevent_req_received(req);
3323 return NT_STATUS_OK;
3326 NTSTATUS dcerpc_srvsvc_NetSessDel(struct dcerpc_binding_handle *h,
3327 TALLOC_CTX *mem_ctx,
3328 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3329 const char *_client /* [in] [unique,charset(UTF16)] */,
3330 const char *_user /* [in] [unique,charset(UTF16)] */,
3333 struct srvsvc_NetSessDel r;
3337 r.in.server_unc = _server_unc;
3338 r.in.client = _client;
3341 status = dcerpc_srvsvc_NetSessDel_r(h, mem_ctx, &r);
3342 if (!NT_STATUS_IS_OK(status)) {
3346 /* Return variables */
3349 *result = r.out.result;
3351 return NT_STATUS_OK;
3354 struct dcerpc_srvsvc_NetShareAdd_r_state {
3355 TALLOC_CTX *out_mem_ctx;
3358 static void dcerpc_srvsvc_NetShareAdd_r_done(struct tevent_req *subreq);
3360 struct tevent_req *dcerpc_srvsvc_NetShareAdd_r_send(TALLOC_CTX *mem_ctx,
3361 struct tevent_context *ev,
3362 struct dcerpc_binding_handle *h,
3363 struct srvsvc_NetShareAdd *r)
3365 struct tevent_req *req;
3366 struct dcerpc_srvsvc_NetShareAdd_r_state *state;
3367 struct tevent_req *subreq;
3369 req = tevent_req_create(mem_ctx, &state,
3370 struct dcerpc_srvsvc_NetShareAdd_r_state);
3375 state->out_mem_ctx = talloc_new(state);
3376 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3377 return tevent_req_post(req, ev);
3380 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3381 NULL, &ndr_table_srvsvc,
3382 NDR_SRVSVC_NETSHAREADD, state->out_mem_ctx, r);
3383 if (tevent_req_nomem(subreq, req)) {
3384 return tevent_req_post(req, ev);
3386 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareAdd_r_done, req);
3391 static void dcerpc_srvsvc_NetShareAdd_r_done(struct tevent_req *subreq)
3393 struct tevent_req *req =
3394 tevent_req_callback_data(subreq,
3398 status = dcerpc_binding_handle_call_recv(subreq);
3399 if (!NT_STATUS_IS_OK(status)) {
3400 tevent_req_nterror(req, status);
3404 tevent_req_done(req);
3407 NTSTATUS dcerpc_srvsvc_NetShareAdd_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3409 struct dcerpc_srvsvc_NetShareAdd_r_state *state =
3410 tevent_req_data(req,
3411 struct dcerpc_srvsvc_NetShareAdd_r_state);
3414 if (tevent_req_is_nterror(req, &status)) {
3415 tevent_req_received(req);
3419 talloc_steal(mem_ctx, state->out_mem_ctx);
3421 tevent_req_received(req);
3422 return NT_STATUS_OK;
3425 NTSTATUS dcerpc_srvsvc_NetShareAdd_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareAdd *r)
3429 status = dcerpc_binding_handle_call(h,
3430 NULL, &ndr_table_srvsvc,
3431 NDR_SRVSVC_NETSHAREADD, mem_ctx, r);
3436 NTSTATUS dcerpc_srvsvc_NetShareAdd_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareAdd *r)
3440 status = dcerpc_srvsvc_NetShareAdd_r(p->binding_handle, mem_ctx, r);
3442 if (NT_STATUS_IS_RPC(status)) {
3443 status = NT_STATUS_NET_WRITE_FAULT;
3449 struct dcerpc_srvsvc_NetShareAdd_state {
3450 struct srvsvc_NetShareAdd orig;
3451 struct srvsvc_NetShareAdd tmp;
3452 TALLOC_CTX *out_mem_ctx;
3455 static void dcerpc_srvsvc_NetShareAdd_done(struct tevent_req *subreq);
3457 struct tevent_req *dcerpc_srvsvc_NetShareAdd_send(TALLOC_CTX *mem_ctx,
3458 struct tevent_context *ev,
3459 struct dcerpc_binding_handle *h,
3460 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3461 uint32_t _level /* [in] */,
3462 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
3463 uint32_t *_parm_error /* [in,out] [unique] */)
3465 struct tevent_req *req;
3466 struct dcerpc_srvsvc_NetShareAdd_state *state;
3467 struct tevent_req *subreq;
3469 req = tevent_req_create(mem_ctx, &state,
3470 struct dcerpc_srvsvc_NetShareAdd_state);
3474 state->out_mem_ctx = NULL;
3477 state->orig.in.server_unc = _server_unc;
3478 state->orig.in.level = _level;
3479 state->orig.in.info = _info;
3480 state->orig.in.parm_error = _parm_error;
3482 /* Out parameters */
3483 state->orig.out.parm_error = _parm_error;
3486 ZERO_STRUCT(state->orig.out.result);
3488 state->out_mem_ctx = talloc_named_const(state, 0,
3489 "dcerpc_srvsvc_NetShareAdd_out_memory");
3490 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3491 return tevent_req_post(req, ev);
3494 /* make a temporary copy, that we pass to the dispatch function */
3495 state->tmp = state->orig;
3497 subreq = dcerpc_srvsvc_NetShareAdd_r_send(state, ev, h, &state->tmp);
3498 if (tevent_req_nomem(subreq, req)) {
3499 return tevent_req_post(req, ev);
3501 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareAdd_done, req);
3505 static void dcerpc_srvsvc_NetShareAdd_done(struct tevent_req *subreq)
3507 struct tevent_req *req = tevent_req_callback_data(
3508 subreq, struct tevent_req);
3509 struct dcerpc_srvsvc_NetShareAdd_state *state = tevent_req_data(
3510 req, struct dcerpc_srvsvc_NetShareAdd_state);
3512 TALLOC_CTX *mem_ctx;
3514 if (state->out_mem_ctx) {
3515 mem_ctx = state->out_mem_ctx;
3520 status = dcerpc_srvsvc_NetShareAdd_r_recv(subreq, mem_ctx);
3521 TALLOC_FREE(subreq);
3522 if (!NT_STATUS_IS_OK(status)) {
3523 tevent_req_nterror(req, status);
3527 /* Copy out parameters */
3528 if (state->orig.out.parm_error && state->tmp.out.parm_error) {
3529 *state->orig.out.parm_error = *state->tmp.out.parm_error;
3533 state->orig.out.result = state->tmp.out.result;
3535 /* Reset temporary structure */
3536 ZERO_STRUCT(state->tmp);
3538 tevent_req_done(req);
3541 NTSTATUS dcerpc_srvsvc_NetShareAdd_recv(struct tevent_req *req,
3542 TALLOC_CTX *mem_ctx,
3545 struct dcerpc_srvsvc_NetShareAdd_state *state = tevent_req_data(
3546 req, struct dcerpc_srvsvc_NetShareAdd_state);
3549 if (tevent_req_is_nterror(req, &status)) {
3550 tevent_req_received(req);
3554 /* Steal possible out parameters to the callers context */
3555 talloc_steal(mem_ctx, state->out_mem_ctx);
3558 *result = state->orig.out.result;
3560 tevent_req_received(req);
3561 return NT_STATUS_OK;
3564 NTSTATUS dcerpc_srvsvc_NetShareAdd(struct dcerpc_binding_handle *h,
3565 TALLOC_CTX *mem_ctx,
3566 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3567 uint32_t _level /* [in] */,
3568 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
3569 uint32_t *_parm_error /* [in,out] [unique] */,
3572 struct srvsvc_NetShareAdd r;
3576 r.in.server_unc = _server_unc;
3577 r.in.level = _level;
3579 r.in.parm_error = _parm_error;
3581 status = dcerpc_srvsvc_NetShareAdd_r(h, mem_ctx, &r);
3582 if (!NT_STATUS_IS_OK(status)) {
3586 /* Return variables */
3587 if (_parm_error && r.out.parm_error) {
3588 *_parm_error = *r.out.parm_error;
3592 *result = r.out.result;
3594 return NT_STATUS_OK;
3597 struct dcerpc_srvsvc_NetShareEnumAll_r_state {
3598 TALLOC_CTX *out_mem_ctx;
3601 static void dcerpc_srvsvc_NetShareEnumAll_r_done(struct tevent_req *subreq);
3603 struct tevent_req *dcerpc_srvsvc_NetShareEnumAll_r_send(TALLOC_CTX *mem_ctx,
3604 struct tevent_context *ev,
3605 struct dcerpc_binding_handle *h,
3606 struct srvsvc_NetShareEnumAll *r)
3608 struct tevent_req *req;
3609 struct dcerpc_srvsvc_NetShareEnumAll_r_state *state;
3610 struct tevent_req *subreq;
3612 req = tevent_req_create(mem_ctx, &state,
3613 struct dcerpc_srvsvc_NetShareEnumAll_r_state);
3618 state->out_mem_ctx = talloc_new(state);
3619 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3620 return tevent_req_post(req, ev);
3623 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3624 NULL, &ndr_table_srvsvc,
3625 NDR_SRVSVC_NETSHAREENUMALL, state->out_mem_ctx, r);
3626 if (tevent_req_nomem(subreq, req)) {
3627 return tevent_req_post(req, ev);
3629 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareEnumAll_r_done, req);
3634 static void dcerpc_srvsvc_NetShareEnumAll_r_done(struct tevent_req *subreq)
3636 struct tevent_req *req =
3637 tevent_req_callback_data(subreq,
3641 status = dcerpc_binding_handle_call_recv(subreq);
3642 if (!NT_STATUS_IS_OK(status)) {
3643 tevent_req_nterror(req, status);
3647 tevent_req_done(req);
3650 NTSTATUS dcerpc_srvsvc_NetShareEnumAll_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3652 struct dcerpc_srvsvc_NetShareEnumAll_r_state *state =
3653 tevent_req_data(req,
3654 struct dcerpc_srvsvc_NetShareEnumAll_r_state);
3657 if (tevent_req_is_nterror(req, &status)) {
3658 tevent_req_received(req);
3662 talloc_steal(mem_ctx, state->out_mem_ctx);
3664 tevent_req_received(req);
3665 return NT_STATUS_OK;
3668 NTSTATUS dcerpc_srvsvc_NetShareEnumAll_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareEnumAll *r)
3672 status = dcerpc_binding_handle_call(h,
3673 NULL, &ndr_table_srvsvc,
3674 NDR_SRVSVC_NETSHAREENUMALL, mem_ctx, r);
3679 NTSTATUS dcerpc_srvsvc_NetShareEnumAll_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareEnumAll *r)
3683 status = dcerpc_srvsvc_NetShareEnumAll_r(p->binding_handle, mem_ctx, r);
3685 if (NT_STATUS_IS_RPC(status)) {
3686 status = NT_STATUS_NET_WRITE_FAULT;
3692 struct dcerpc_srvsvc_NetShareEnumAll_state {
3693 struct srvsvc_NetShareEnumAll orig;
3694 struct srvsvc_NetShareEnumAll tmp;
3695 TALLOC_CTX *out_mem_ctx;
3698 static void dcerpc_srvsvc_NetShareEnumAll_done(struct tevent_req *subreq);
3700 struct tevent_req *dcerpc_srvsvc_NetShareEnumAll_send(TALLOC_CTX *mem_ctx,
3701 struct tevent_context *ev,
3702 struct dcerpc_binding_handle *h,
3703 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3704 struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
3705 uint32_t _max_buffer /* [in] */,
3706 uint32_t *_totalentries /* [out] [ref] */,
3707 uint32_t *_resume_handle /* [in,out] [unique] */)
3709 struct tevent_req *req;
3710 struct dcerpc_srvsvc_NetShareEnumAll_state *state;
3711 struct tevent_req *subreq;
3713 req = tevent_req_create(mem_ctx, &state,
3714 struct dcerpc_srvsvc_NetShareEnumAll_state);
3718 state->out_mem_ctx = NULL;
3721 state->orig.in.server_unc = _server_unc;
3722 state->orig.in.info_ctr = _info_ctr;
3723 state->orig.in.max_buffer = _max_buffer;
3724 state->orig.in.resume_handle = _resume_handle;
3726 /* Out parameters */
3727 state->orig.out.info_ctr = _info_ctr;
3728 state->orig.out.totalentries = _totalentries;
3729 state->orig.out.resume_handle = _resume_handle;
3732 ZERO_STRUCT(state->orig.out.result);
3734 state->out_mem_ctx = talloc_named_const(state, 0,
3735 "dcerpc_srvsvc_NetShareEnumAll_out_memory");
3736 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3737 return tevent_req_post(req, ev);
3740 /* make a temporary copy, that we pass to the dispatch function */
3741 state->tmp = state->orig;
3743 subreq = dcerpc_srvsvc_NetShareEnumAll_r_send(state, ev, h, &state->tmp);
3744 if (tevent_req_nomem(subreq, req)) {
3745 return tevent_req_post(req, ev);
3747 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareEnumAll_done, req);
3751 static void dcerpc_srvsvc_NetShareEnumAll_done(struct tevent_req *subreq)
3753 struct tevent_req *req = tevent_req_callback_data(
3754 subreq, struct tevent_req);
3755 struct dcerpc_srvsvc_NetShareEnumAll_state *state = tevent_req_data(
3756 req, struct dcerpc_srvsvc_NetShareEnumAll_state);
3758 TALLOC_CTX *mem_ctx;
3760 if (state->out_mem_ctx) {
3761 mem_ctx = state->out_mem_ctx;
3766 status = dcerpc_srvsvc_NetShareEnumAll_r_recv(subreq, mem_ctx);
3767 TALLOC_FREE(subreq);
3768 if (!NT_STATUS_IS_OK(status)) {
3769 tevent_req_nterror(req, status);
3773 /* Copy out parameters */
3774 *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
3775 *state->orig.out.totalentries = *state->tmp.out.totalentries;
3776 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
3777 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
3781 state->orig.out.result = state->tmp.out.result;
3783 /* Reset temporary structure */
3784 ZERO_STRUCT(state->tmp);
3786 tevent_req_done(req);
3789 NTSTATUS dcerpc_srvsvc_NetShareEnumAll_recv(struct tevent_req *req,
3790 TALLOC_CTX *mem_ctx,
3793 struct dcerpc_srvsvc_NetShareEnumAll_state *state = tevent_req_data(
3794 req, struct dcerpc_srvsvc_NetShareEnumAll_state);
3797 if (tevent_req_is_nterror(req, &status)) {
3798 tevent_req_received(req);
3802 /* Steal possible out parameters to the callers context */
3803 talloc_steal(mem_ctx, state->out_mem_ctx);
3806 *result = state->orig.out.result;
3808 tevent_req_received(req);
3809 return NT_STATUS_OK;
3812 NTSTATUS dcerpc_srvsvc_NetShareEnumAll(struct dcerpc_binding_handle *h,
3813 TALLOC_CTX *mem_ctx,
3814 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3815 struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
3816 uint32_t _max_buffer /* [in] */,
3817 uint32_t *_totalentries /* [out] [ref] */,
3818 uint32_t *_resume_handle /* [in,out] [unique] */,
3821 struct srvsvc_NetShareEnumAll r;
3825 r.in.server_unc = _server_unc;
3826 r.in.info_ctr = _info_ctr;
3827 r.in.max_buffer = _max_buffer;
3828 r.in.resume_handle = _resume_handle;
3830 status = dcerpc_srvsvc_NetShareEnumAll_r(h, mem_ctx, &r);
3831 if (!NT_STATUS_IS_OK(status)) {
3835 /* Return variables */
3836 *_info_ctr = *r.out.info_ctr;
3837 *_totalentries = *r.out.totalentries;
3838 if (_resume_handle && r.out.resume_handle) {
3839 *_resume_handle = *r.out.resume_handle;
3843 *result = r.out.result;
3845 return NT_STATUS_OK;
3848 struct dcerpc_srvsvc_NetShareGetInfo_r_state {
3849 TALLOC_CTX *out_mem_ctx;
3852 static void dcerpc_srvsvc_NetShareGetInfo_r_done(struct tevent_req *subreq);
3854 struct tevent_req *dcerpc_srvsvc_NetShareGetInfo_r_send(TALLOC_CTX *mem_ctx,
3855 struct tevent_context *ev,
3856 struct dcerpc_binding_handle *h,
3857 struct srvsvc_NetShareGetInfo *r)
3859 struct tevent_req *req;
3860 struct dcerpc_srvsvc_NetShareGetInfo_r_state *state;
3861 struct tevent_req *subreq;
3863 req = tevent_req_create(mem_ctx, &state,
3864 struct dcerpc_srvsvc_NetShareGetInfo_r_state);
3869 state->out_mem_ctx = talloc_new(state);
3870 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3871 return tevent_req_post(req, ev);
3874 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3875 NULL, &ndr_table_srvsvc,
3876 NDR_SRVSVC_NETSHAREGETINFO, state->out_mem_ctx, r);
3877 if (tevent_req_nomem(subreq, req)) {
3878 return tevent_req_post(req, ev);
3880 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareGetInfo_r_done, req);
3885 static void dcerpc_srvsvc_NetShareGetInfo_r_done(struct tevent_req *subreq)
3887 struct tevent_req *req =
3888 tevent_req_callback_data(subreq,
3892 status = dcerpc_binding_handle_call_recv(subreq);
3893 if (!NT_STATUS_IS_OK(status)) {
3894 tevent_req_nterror(req, status);
3898 tevent_req_done(req);
3901 NTSTATUS dcerpc_srvsvc_NetShareGetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3903 struct dcerpc_srvsvc_NetShareGetInfo_r_state *state =
3904 tevent_req_data(req,
3905 struct dcerpc_srvsvc_NetShareGetInfo_r_state);
3908 if (tevent_req_is_nterror(req, &status)) {
3909 tevent_req_received(req);
3913 talloc_steal(mem_ctx, state->out_mem_ctx);
3915 tevent_req_received(req);
3916 return NT_STATUS_OK;
3919 NTSTATUS dcerpc_srvsvc_NetShareGetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareGetInfo *r)
3923 status = dcerpc_binding_handle_call(h,
3924 NULL, &ndr_table_srvsvc,
3925 NDR_SRVSVC_NETSHAREGETINFO, mem_ctx, r);
3930 NTSTATUS dcerpc_srvsvc_NetShareGetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareGetInfo *r)
3934 status = dcerpc_srvsvc_NetShareGetInfo_r(p->binding_handle, mem_ctx, r);
3936 if (NT_STATUS_IS_RPC(status)) {
3937 status = NT_STATUS_NET_WRITE_FAULT;
3943 struct dcerpc_srvsvc_NetShareGetInfo_state {
3944 struct srvsvc_NetShareGetInfo orig;
3945 struct srvsvc_NetShareGetInfo tmp;
3946 TALLOC_CTX *out_mem_ctx;
3949 static void dcerpc_srvsvc_NetShareGetInfo_done(struct tevent_req *subreq);
3951 struct tevent_req *dcerpc_srvsvc_NetShareGetInfo_send(TALLOC_CTX *mem_ctx,
3952 struct tevent_context *ev,
3953 struct dcerpc_binding_handle *h,
3954 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
3955 const char *_share_name /* [in] [charset(UTF16)] */,
3956 uint32_t _level /* [in] */,
3957 union srvsvc_NetShareInfo *_info /* [out] [ref,switch_is(level)] */)
3959 struct tevent_req *req;
3960 struct dcerpc_srvsvc_NetShareGetInfo_state *state;
3961 struct tevent_req *subreq;
3963 req = tevent_req_create(mem_ctx, &state,
3964 struct dcerpc_srvsvc_NetShareGetInfo_state);
3968 state->out_mem_ctx = NULL;
3971 state->orig.in.server_unc = _server_unc;
3972 state->orig.in.share_name = _share_name;
3973 state->orig.in.level = _level;
3975 /* Out parameters */
3976 state->orig.out.info = _info;
3979 ZERO_STRUCT(state->orig.out.result);
3981 state->out_mem_ctx = talloc_named_const(state, 0,
3982 "dcerpc_srvsvc_NetShareGetInfo_out_memory");
3983 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3984 return tevent_req_post(req, ev);
3987 /* make a temporary copy, that we pass to the dispatch function */
3988 state->tmp = state->orig;
3990 subreq = dcerpc_srvsvc_NetShareGetInfo_r_send(state, ev, h, &state->tmp);
3991 if (tevent_req_nomem(subreq, req)) {
3992 return tevent_req_post(req, ev);
3994 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareGetInfo_done, req);
3998 static void dcerpc_srvsvc_NetShareGetInfo_done(struct tevent_req *subreq)
4000 struct tevent_req *req = tevent_req_callback_data(
4001 subreq, struct tevent_req);
4002 struct dcerpc_srvsvc_NetShareGetInfo_state *state = tevent_req_data(
4003 req, struct dcerpc_srvsvc_NetShareGetInfo_state);
4005 TALLOC_CTX *mem_ctx;
4007 if (state->out_mem_ctx) {
4008 mem_ctx = state->out_mem_ctx;
4013 status = dcerpc_srvsvc_NetShareGetInfo_r_recv(subreq, mem_ctx);
4014 TALLOC_FREE(subreq);
4015 if (!NT_STATUS_IS_OK(status)) {
4016 tevent_req_nterror(req, status);
4020 /* Copy out parameters */
4021 *state->orig.out.info = *state->tmp.out.info;
4024 state->orig.out.result = state->tmp.out.result;
4026 /* Reset temporary structure */
4027 ZERO_STRUCT(state->tmp);
4029 tevent_req_done(req);
4032 NTSTATUS dcerpc_srvsvc_NetShareGetInfo_recv(struct tevent_req *req,
4033 TALLOC_CTX *mem_ctx,
4036 struct dcerpc_srvsvc_NetShareGetInfo_state *state = tevent_req_data(
4037 req, struct dcerpc_srvsvc_NetShareGetInfo_state);
4040 if (tevent_req_is_nterror(req, &status)) {
4041 tevent_req_received(req);
4045 /* Steal possible out parameters to the callers context */
4046 talloc_steal(mem_ctx, state->out_mem_ctx);
4049 *result = state->orig.out.result;
4051 tevent_req_received(req);
4052 return NT_STATUS_OK;
4055 NTSTATUS dcerpc_srvsvc_NetShareGetInfo(struct dcerpc_binding_handle *h,
4056 TALLOC_CTX *mem_ctx,
4057 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4058 const char *_share_name /* [in] [charset(UTF16)] */,
4059 uint32_t _level /* [in] */,
4060 union srvsvc_NetShareInfo *_info /* [out] [ref,switch_is(level)] */,
4063 struct srvsvc_NetShareGetInfo r;
4067 r.in.server_unc = _server_unc;
4068 r.in.share_name = _share_name;
4069 r.in.level = _level;
4071 status = dcerpc_srvsvc_NetShareGetInfo_r(h, mem_ctx, &r);
4072 if (!NT_STATUS_IS_OK(status)) {
4076 /* Return variables */
4077 *_info = *r.out.info;
4080 *result = r.out.result;
4082 return NT_STATUS_OK;
4085 struct dcerpc_srvsvc_NetShareSetInfo_r_state {
4086 TALLOC_CTX *out_mem_ctx;
4089 static void dcerpc_srvsvc_NetShareSetInfo_r_done(struct tevent_req *subreq);
4091 struct tevent_req *dcerpc_srvsvc_NetShareSetInfo_r_send(TALLOC_CTX *mem_ctx,
4092 struct tevent_context *ev,
4093 struct dcerpc_binding_handle *h,
4094 struct srvsvc_NetShareSetInfo *r)
4096 struct tevent_req *req;
4097 struct dcerpc_srvsvc_NetShareSetInfo_r_state *state;
4098 struct tevent_req *subreq;
4100 req = tevent_req_create(mem_ctx, &state,
4101 struct dcerpc_srvsvc_NetShareSetInfo_r_state);
4106 state->out_mem_ctx = talloc_new(state);
4107 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4108 return tevent_req_post(req, ev);
4111 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4112 NULL, &ndr_table_srvsvc,
4113 NDR_SRVSVC_NETSHARESETINFO, state->out_mem_ctx, r);
4114 if (tevent_req_nomem(subreq, req)) {
4115 return tevent_req_post(req, ev);
4117 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareSetInfo_r_done, req);
4122 static void dcerpc_srvsvc_NetShareSetInfo_r_done(struct tevent_req *subreq)
4124 struct tevent_req *req =
4125 tevent_req_callback_data(subreq,
4129 status = dcerpc_binding_handle_call_recv(subreq);
4130 if (!NT_STATUS_IS_OK(status)) {
4131 tevent_req_nterror(req, status);
4135 tevent_req_done(req);
4138 NTSTATUS dcerpc_srvsvc_NetShareSetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4140 struct dcerpc_srvsvc_NetShareSetInfo_r_state *state =
4141 tevent_req_data(req,
4142 struct dcerpc_srvsvc_NetShareSetInfo_r_state);
4145 if (tevent_req_is_nterror(req, &status)) {
4146 tevent_req_received(req);
4150 talloc_steal(mem_ctx, state->out_mem_ctx);
4152 tevent_req_received(req);
4153 return NT_STATUS_OK;
4156 NTSTATUS dcerpc_srvsvc_NetShareSetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareSetInfo *r)
4160 status = dcerpc_binding_handle_call(h,
4161 NULL, &ndr_table_srvsvc,
4162 NDR_SRVSVC_NETSHARESETINFO, mem_ctx, r);
4167 NTSTATUS dcerpc_srvsvc_NetShareSetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareSetInfo *r)
4171 status = dcerpc_srvsvc_NetShareSetInfo_r(p->binding_handle, mem_ctx, r);
4173 if (NT_STATUS_IS_RPC(status)) {
4174 status = NT_STATUS_NET_WRITE_FAULT;
4180 struct dcerpc_srvsvc_NetShareSetInfo_state {
4181 struct srvsvc_NetShareSetInfo orig;
4182 struct srvsvc_NetShareSetInfo tmp;
4183 TALLOC_CTX *out_mem_ctx;
4186 static void dcerpc_srvsvc_NetShareSetInfo_done(struct tevent_req *subreq);
4188 struct tevent_req *dcerpc_srvsvc_NetShareSetInfo_send(TALLOC_CTX *mem_ctx,
4189 struct tevent_context *ev,
4190 struct dcerpc_binding_handle *h,
4191 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4192 const char *_share_name /* [in] [charset(UTF16)] */,
4193 uint32_t _level /* [in] */,
4194 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
4195 uint32_t *_parm_error /* [in,out] [unique] */)
4197 struct tevent_req *req;
4198 struct dcerpc_srvsvc_NetShareSetInfo_state *state;
4199 struct tevent_req *subreq;
4201 req = tevent_req_create(mem_ctx, &state,
4202 struct dcerpc_srvsvc_NetShareSetInfo_state);
4206 state->out_mem_ctx = NULL;
4209 state->orig.in.server_unc = _server_unc;
4210 state->orig.in.share_name = _share_name;
4211 state->orig.in.level = _level;
4212 state->orig.in.info = _info;
4213 state->orig.in.parm_error = _parm_error;
4215 /* Out parameters */
4216 state->orig.out.parm_error = _parm_error;
4219 ZERO_STRUCT(state->orig.out.result);
4221 state->out_mem_ctx = talloc_named_const(state, 0,
4222 "dcerpc_srvsvc_NetShareSetInfo_out_memory");
4223 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4224 return tevent_req_post(req, ev);
4227 /* make a temporary copy, that we pass to the dispatch function */
4228 state->tmp = state->orig;
4230 subreq = dcerpc_srvsvc_NetShareSetInfo_r_send(state, ev, h, &state->tmp);
4231 if (tevent_req_nomem(subreq, req)) {
4232 return tevent_req_post(req, ev);
4234 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareSetInfo_done, req);
4238 static void dcerpc_srvsvc_NetShareSetInfo_done(struct tevent_req *subreq)
4240 struct tevent_req *req = tevent_req_callback_data(
4241 subreq, struct tevent_req);
4242 struct dcerpc_srvsvc_NetShareSetInfo_state *state = tevent_req_data(
4243 req, struct dcerpc_srvsvc_NetShareSetInfo_state);
4245 TALLOC_CTX *mem_ctx;
4247 if (state->out_mem_ctx) {
4248 mem_ctx = state->out_mem_ctx;
4253 status = dcerpc_srvsvc_NetShareSetInfo_r_recv(subreq, mem_ctx);
4254 TALLOC_FREE(subreq);
4255 if (!NT_STATUS_IS_OK(status)) {
4256 tevent_req_nterror(req, status);
4260 /* Copy out parameters */
4261 if (state->orig.out.parm_error && state->tmp.out.parm_error) {
4262 *state->orig.out.parm_error = *state->tmp.out.parm_error;
4266 state->orig.out.result = state->tmp.out.result;
4268 /* Reset temporary structure */
4269 ZERO_STRUCT(state->tmp);
4271 tevent_req_done(req);
4274 NTSTATUS dcerpc_srvsvc_NetShareSetInfo_recv(struct tevent_req *req,
4275 TALLOC_CTX *mem_ctx,
4278 struct dcerpc_srvsvc_NetShareSetInfo_state *state = tevent_req_data(
4279 req, struct dcerpc_srvsvc_NetShareSetInfo_state);
4282 if (tevent_req_is_nterror(req, &status)) {
4283 tevent_req_received(req);
4287 /* Steal possible out parameters to the callers context */
4288 talloc_steal(mem_ctx, state->out_mem_ctx);
4291 *result = state->orig.out.result;
4293 tevent_req_received(req);
4294 return NT_STATUS_OK;
4297 NTSTATUS dcerpc_srvsvc_NetShareSetInfo(struct dcerpc_binding_handle *h,
4298 TALLOC_CTX *mem_ctx,
4299 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4300 const char *_share_name /* [in] [charset(UTF16)] */,
4301 uint32_t _level /* [in] */,
4302 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
4303 uint32_t *_parm_error /* [in,out] [unique] */,
4306 struct srvsvc_NetShareSetInfo r;
4310 r.in.server_unc = _server_unc;
4311 r.in.share_name = _share_name;
4312 r.in.level = _level;
4314 r.in.parm_error = _parm_error;
4316 status = dcerpc_srvsvc_NetShareSetInfo_r(h, mem_ctx, &r);
4317 if (!NT_STATUS_IS_OK(status)) {
4321 /* Return variables */
4322 if (_parm_error && r.out.parm_error) {
4323 *_parm_error = *r.out.parm_error;
4327 *result = r.out.result;
4329 return NT_STATUS_OK;
4332 struct dcerpc_srvsvc_NetShareDel_r_state {
4333 TALLOC_CTX *out_mem_ctx;
4336 static void dcerpc_srvsvc_NetShareDel_r_done(struct tevent_req *subreq);
4338 struct tevent_req *dcerpc_srvsvc_NetShareDel_r_send(TALLOC_CTX *mem_ctx,
4339 struct tevent_context *ev,
4340 struct dcerpc_binding_handle *h,
4341 struct srvsvc_NetShareDel *r)
4343 struct tevent_req *req;
4344 struct dcerpc_srvsvc_NetShareDel_r_state *state;
4345 struct tevent_req *subreq;
4347 req = tevent_req_create(mem_ctx, &state,
4348 struct dcerpc_srvsvc_NetShareDel_r_state);
4353 state->out_mem_ctx = NULL;
4354 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4355 NULL, &ndr_table_srvsvc,
4356 NDR_SRVSVC_NETSHAREDEL, state, r);
4357 if (tevent_req_nomem(subreq, req)) {
4358 return tevent_req_post(req, ev);
4360 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDel_r_done, req);
4365 static void dcerpc_srvsvc_NetShareDel_r_done(struct tevent_req *subreq)
4367 struct tevent_req *req =
4368 tevent_req_callback_data(subreq,
4372 status = dcerpc_binding_handle_call_recv(subreq);
4373 if (!NT_STATUS_IS_OK(status)) {
4374 tevent_req_nterror(req, status);
4378 tevent_req_done(req);
4381 NTSTATUS dcerpc_srvsvc_NetShareDel_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4383 struct dcerpc_srvsvc_NetShareDel_r_state *state =
4384 tevent_req_data(req,
4385 struct dcerpc_srvsvc_NetShareDel_r_state);
4388 if (tevent_req_is_nterror(req, &status)) {
4389 tevent_req_received(req);
4393 talloc_steal(mem_ctx, state->out_mem_ctx);
4395 tevent_req_received(req);
4396 return NT_STATUS_OK;
4399 NTSTATUS dcerpc_srvsvc_NetShareDel_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDel *r)
4403 status = dcerpc_binding_handle_call(h,
4404 NULL, &ndr_table_srvsvc,
4405 NDR_SRVSVC_NETSHAREDEL, mem_ctx, r);
4410 NTSTATUS dcerpc_srvsvc_NetShareDel_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDel *r)
4414 status = dcerpc_srvsvc_NetShareDel_r(p->binding_handle, mem_ctx, r);
4416 if (NT_STATUS_IS_RPC(status)) {
4417 status = NT_STATUS_NET_WRITE_FAULT;
4423 struct dcerpc_srvsvc_NetShareDel_state {
4424 struct srvsvc_NetShareDel orig;
4425 struct srvsvc_NetShareDel tmp;
4426 TALLOC_CTX *out_mem_ctx;
4429 static void dcerpc_srvsvc_NetShareDel_done(struct tevent_req *subreq);
4431 struct tevent_req *dcerpc_srvsvc_NetShareDel_send(TALLOC_CTX *mem_ctx,
4432 struct tevent_context *ev,
4433 struct dcerpc_binding_handle *h,
4434 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4435 const char *_share_name /* [in] [charset(UTF16)] */,
4436 uint32_t _reserved /* [in] */)
4438 struct tevent_req *req;
4439 struct dcerpc_srvsvc_NetShareDel_state *state;
4440 struct tevent_req *subreq;
4442 req = tevent_req_create(mem_ctx, &state,
4443 struct dcerpc_srvsvc_NetShareDel_state);
4447 state->out_mem_ctx = NULL;
4450 state->orig.in.server_unc = _server_unc;
4451 state->orig.in.share_name = _share_name;
4452 state->orig.in.reserved = _reserved;
4454 /* Out parameters */
4457 ZERO_STRUCT(state->orig.out.result);
4459 /* make a temporary copy, that we pass to the dispatch function */
4460 state->tmp = state->orig;
4462 subreq = dcerpc_srvsvc_NetShareDel_r_send(state, ev, h, &state->tmp);
4463 if (tevent_req_nomem(subreq, req)) {
4464 return tevent_req_post(req, ev);
4466 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDel_done, req);
4470 static void dcerpc_srvsvc_NetShareDel_done(struct tevent_req *subreq)
4472 struct tevent_req *req = tevent_req_callback_data(
4473 subreq, struct tevent_req);
4474 struct dcerpc_srvsvc_NetShareDel_state *state = tevent_req_data(
4475 req, struct dcerpc_srvsvc_NetShareDel_state);
4477 TALLOC_CTX *mem_ctx;
4479 if (state->out_mem_ctx) {
4480 mem_ctx = state->out_mem_ctx;
4485 status = dcerpc_srvsvc_NetShareDel_r_recv(subreq, mem_ctx);
4486 TALLOC_FREE(subreq);
4487 if (!NT_STATUS_IS_OK(status)) {
4488 tevent_req_nterror(req, status);
4492 /* Copy out parameters */
4495 state->orig.out.result = state->tmp.out.result;
4497 /* Reset temporary structure */
4498 ZERO_STRUCT(state->tmp);
4500 tevent_req_done(req);
4503 NTSTATUS dcerpc_srvsvc_NetShareDel_recv(struct tevent_req *req,
4504 TALLOC_CTX *mem_ctx,
4507 struct dcerpc_srvsvc_NetShareDel_state *state = tevent_req_data(
4508 req, struct dcerpc_srvsvc_NetShareDel_state);
4511 if (tevent_req_is_nterror(req, &status)) {
4512 tevent_req_received(req);
4516 /* Steal possible out parameters to the callers context */
4517 talloc_steal(mem_ctx, state->out_mem_ctx);
4520 *result = state->orig.out.result;
4522 tevent_req_received(req);
4523 return NT_STATUS_OK;
4526 NTSTATUS dcerpc_srvsvc_NetShareDel(struct dcerpc_binding_handle *h,
4527 TALLOC_CTX *mem_ctx,
4528 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4529 const char *_share_name /* [in] [charset(UTF16)] */,
4530 uint32_t _reserved /* [in] */,
4533 struct srvsvc_NetShareDel r;
4537 r.in.server_unc = _server_unc;
4538 r.in.share_name = _share_name;
4539 r.in.reserved = _reserved;
4541 status = dcerpc_srvsvc_NetShareDel_r(h, mem_ctx, &r);
4542 if (!NT_STATUS_IS_OK(status)) {
4546 /* Return variables */
4549 *result = r.out.result;
4551 return NT_STATUS_OK;
4554 struct dcerpc_srvsvc_NetShareDelSticky_r_state {
4555 TALLOC_CTX *out_mem_ctx;
4558 static void dcerpc_srvsvc_NetShareDelSticky_r_done(struct tevent_req *subreq);
4560 struct tevent_req *dcerpc_srvsvc_NetShareDelSticky_r_send(TALLOC_CTX *mem_ctx,
4561 struct tevent_context *ev,
4562 struct dcerpc_binding_handle *h,
4563 struct srvsvc_NetShareDelSticky *r)
4565 struct tevent_req *req;
4566 struct dcerpc_srvsvc_NetShareDelSticky_r_state *state;
4567 struct tevent_req *subreq;
4569 req = tevent_req_create(mem_ctx, &state,
4570 struct dcerpc_srvsvc_NetShareDelSticky_r_state);
4575 state->out_mem_ctx = NULL;
4576 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4577 NULL, &ndr_table_srvsvc,
4578 NDR_SRVSVC_NETSHAREDELSTICKY, state, r);
4579 if (tevent_req_nomem(subreq, req)) {
4580 return tevent_req_post(req, ev);
4582 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDelSticky_r_done, req);
4587 static void dcerpc_srvsvc_NetShareDelSticky_r_done(struct tevent_req *subreq)
4589 struct tevent_req *req =
4590 tevent_req_callback_data(subreq,
4594 status = dcerpc_binding_handle_call_recv(subreq);
4595 if (!NT_STATUS_IS_OK(status)) {
4596 tevent_req_nterror(req, status);
4600 tevent_req_done(req);
4603 NTSTATUS dcerpc_srvsvc_NetShareDelSticky_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4605 struct dcerpc_srvsvc_NetShareDelSticky_r_state *state =
4606 tevent_req_data(req,
4607 struct dcerpc_srvsvc_NetShareDelSticky_r_state);
4610 if (tevent_req_is_nterror(req, &status)) {
4611 tevent_req_received(req);
4615 talloc_steal(mem_ctx, state->out_mem_ctx);
4617 tevent_req_received(req);
4618 return NT_STATUS_OK;
4621 NTSTATUS dcerpc_srvsvc_NetShareDelSticky_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDelSticky *r)
4625 status = dcerpc_binding_handle_call(h,
4626 NULL, &ndr_table_srvsvc,
4627 NDR_SRVSVC_NETSHAREDELSTICKY, mem_ctx, r);
4632 NTSTATUS dcerpc_srvsvc_NetShareDelSticky_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDelSticky *r)
4636 status = dcerpc_srvsvc_NetShareDelSticky_r(p->binding_handle, mem_ctx, r);
4638 if (NT_STATUS_IS_RPC(status)) {
4639 status = NT_STATUS_NET_WRITE_FAULT;
4645 struct dcerpc_srvsvc_NetShareDelSticky_state {
4646 struct srvsvc_NetShareDelSticky orig;
4647 struct srvsvc_NetShareDelSticky tmp;
4648 TALLOC_CTX *out_mem_ctx;
4651 static void dcerpc_srvsvc_NetShareDelSticky_done(struct tevent_req *subreq);
4653 struct tevent_req *dcerpc_srvsvc_NetShareDelSticky_send(TALLOC_CTX *mem_ctx,
4654 struct tevent_context *ev,
4655 struct dcerpc_binding_handle *h,
4656 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4657 const char *_share_name /* [in] [charset(UTF16)] */,
4658 uint32_t _reserved /* [in] */)
4660 struct tevent_req *req;
4661 struct dcerpc_srvsvc_NetShareDelSticky_state *state;
4662 struct tevent_req *subreq;
4664 req = tevent_req_create(mem_ctx, &state,
4665 struct dcerpc_srvsvc_NetShareDelSticky_state);
4669 state->out_mem_ctx = NULL;
4672 state->orig.in.server_unc = _server_unc;
4673 state->orig.in.share_name = _share_name;
4674 state->orig.in.reserved = _reserved;
4676 /* Out parameters */
4679 ZERO_STRUCT(state->orig.out.result);
4681 /* make a temporary copy, that we pass to the dispatch function */
4682 state->tmp = state->orig;
4684 subreq = dcerpc_srvsvc_NetShareDelSticky_r_send(state, ev, h, &state->tmp);
4685 if (tevent_req_nomem(subreq, req)) {
4686 return tevent_req_post(req, ev);
4688 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDelSticky_done, req);
4692 static void dcerpc_srvsvc_NetShareDelSticky_done(struct tevent_req *subreq)
4694 struct tevent_req *req = tevent_req_callback_data(
4695 subreq, struct tevent_req);
4696 struct dcerpc_srvsvc_NetShareDelSticky_state *state = tevent_req_data(
4697 req, struct dcerpc_srvsvc_NetShareDelSticky_state);
4699 TALLOC_CTX *mem_ctx;
4701 if (state->out_mem_ctx) {
4702 mem_ctx = state->out_mem_ctx;
4707 status = dcerpc_srvsvc_NetShareDelSticky_r_recv(subreq, mem_ctx);
4708 TALLOC_FREE(subreq);
4709 if (!NT_STATUS_IS_OK(status)) {
4710 tevent_req_nterror(req, status);
4714 /* Copy out parameters */
4717 state->orig.out.result = state->tmp.out.result;
4719 /* Reset temporary structure */
4720 ZERO_STRUCT(state->tmp);
4722 tevent_req_done(req);
4725 NTSTATUS dcerpc_srvsvc_NetShareDelSticky_recv(struct tevent_req *req,
4726 TALLOC_CTX *mem_ctx,
4729 struct dcerpc_srvsvc_NetShareDelSticky_state *state = tevent_req_data(
4730 req, struct dcerpc_srvsvc_NetShareDelSticky_state);
4733 if (tevent_req_is_nterror(req, &status)) {
4734 tevent_req_received(req);
4738 /* Steal possible out parameters to the callers context */
4739 talloc_steal(mem_ctx, state->out_mem_ctx);
4742 *result = state->orig.out.result;
4744 tevent_req_received(req);
4745 return NT_STATUS_OK;
4748 NTSTATUS dcerpc_srvsvc_NetShareDelSticky(struct dcerpc_binding_handle *h,
4749 TALLOC_CTX *mem_ctx,
4750 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4751 const char *_share_name /* [in] [charset(UTF16)] */,
4752 uint32_t _reserved /* [in] */,
4755 struct srvsvc_NetShareDelSticky r;
4759 r.in.server_unc = _server_unc;
4760 r.in.share_name = _share_name;
4761 r.in.reserved = _reserved;
4763 status = dcerpc_srvsvc_NetShareDelSticky_r(h, mem_ctx, &r);
4764 if (!NT_STATUS_IS_OK(status)) {
4768 /* Return variables */
4771 *result = r.out.result;
4773 return NT_STATUS_OK;
4776 struct dcerpc_srvsvc_NetShareCheck_r_state {
4777 TALLOC_CTX *out_mem_ctx;
4780 static void dcerpc_srvsvc_NetShareCheck_r_done(struct tevent_req *subreq);
4782 struct tevent_req *dcerpc_srvsvc_NetShareCheck_r_send(TALLOC_CTX *mem_ctx,
4783 struct tevent_context *ev,
4784 struct dcerpc_binding_handle *h,
4785 struct srvsvc_NetShareCheck *r)
4787 struct tevent_req *req;
4788 struct dcerpc_srvsvc_NetShareCheck_r_state *state;
4789 struct tevent_req *subreq;
4791 req = tevent_req_create(mem_ctx, &state,
4792 struct dcerpc_srvsvc_NetShareCheck_r_state);
4797 state->out_mem_ctx = talloc_new(state);
4798 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4799 return tevent_req_post(req, ev);
4802 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4803 NULL, &ndr_table_srvsvc,
4804 NDR_SRVSVC_NETSHARECHECK, state->out_mem_ctx, r);
4805 if (tevent_req_nomem(subreq, req)) {
4806 return tevent_req_post(req, ev);
4808 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareCheck_r_done, req);
4813 static void dcerpc_srvsvc_NetShareCheck_r_done(struct tevent_req *subreq)
4815 struct tevent_req *req =
4816 tevent_req_callback_data(subreq,
4820 status = dcerpc_binding_handle_call_recv(subreq);
4821 if (!NT_STATUS_IS_OK(status)) {
4822 tevent_req_nterror(req, status);
4826 tevent_req_done(req);
4829 NTSTATUS dcerpc_srvsvc_NetShareCheck_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4831 struct dcerpc_srvsvc_NetShareCheck_r_state *state =
4832 tevent_req_data(req,
4833 struct dcerpc_srvsvc_NetShareCheck_r_state);
4836 if (tevent_req_is_nterror(req, &status)) {
4837 tevent_req_received(req);
4841 talloc_steal(mem_ctx, state->out_mem_ctx);
4843 tevent_req_received(req);
4844 return NT_STATUS_OK;
4847 NTSTATUS dcerpc_srvsvc_NetShareCheck_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareCheck *r)
4851 status = dcerpc_binding_handle_call(h,
4852 NULL, &ndr_table_srvsvc,
4853 NDR_SRVSVC_NETSHARECHECK, mem_ctx, r);
4858 NTSTATUS dcerpc_srvsvc_NetShareCheck_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareCheck *r)
4862 status = dcerpc_srvsvc_NetShareCheck_r(p->binding_handle, mem_ctx, r);
4864 if (NT_STATUS_IS_RPC(status)) {
4865 status = NT_STATUS_NET_WRITE_FAULT;
4871 struct dcerpc_srvsvc_NetShareCheck_state {
4872 struct srvsvc_NetShareCheck orig;
4873 struct srvsvc_NetShareCheck tmp;
4874 TALLOC_CTX *out_mem_ctx;
4877 static void dcerpc_srvsvc_NetShareCheck_done(struct tevent_req *subreq);
4879 struct tevent_req *dcerpc_srvsvc_NetShareCheck_send(TALLOC_CTX *mem_ctx,
4880 struct tevent_context *ev,
4881 struct dcerpc_binding_handle *h,
4882 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4883 const char *_device_name /* [in] [charset(UTF16)] */,
4884 enum srvsvc_ShareType *_type /* [out] [ref] */)
4886 struct tevent_req *req;
4887 struct dcerpc_srvsvc_NetShareCheck_state *state;
4888 struct tevent_req *subreq;
4890 req = tevent_req_create(mem_ctx, &state,
4891 struct dcerpc_srvsvc_NetShareCheck_state);
4895 state->out_mem_ctx = NULL;
4898 state->orig.in.server_unc = _server_unc;
4899 state->orig.in.device_name = _device_name;
4901 /* Out parameters */
4902 state->orig.out.type = _type;
4905 ZERO_STRUCT(state->orig.out.result);
4907 state->out_mem_ctx = talloc_named_const(state, 0,
4908 "dcerpc_srvsvc_NetShareCheck_out_memory");
4909 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4910 return tevent_req_post(req, ev);
4913 /* make a temporary copy, that we pass to the dispatch function */
4914 state->tmp = state->orig;
4916 subreq = dcerpc_srvsvc_NetShareCheck_r_send(state, ev, h, &state->tmp);
4917 if (tevent_req_nomem(subreq, req)) {
4918 return tevent_req_post(req, ev);
4920 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareCheck_done, req);
4924 static void dcerpc_srvsvc_NetShareCheck_done(struct tevent_req *subreq)
4926 struct tevent_req *req = tevent_req_callback_data(
4927 subreq, struct tevent_req);
4928 struct dcerpc_srvsvc_NetShareCheck_state *state = tevent_req_data(
4929 req, struct dcerpc_srvsvc_NetShareCheck_state);
4931 TALLOC_CTX *mem_ctx;
4933 if (state->out_mem_ctx) {
4934 mem_ctx = state->out_mem_ctx;
4939 status = dcerpc_srvsvc_NetShareCheck_r_recv(subreq, mem_ctx);
4940 TALLOC_FREE(subreq);
4941 if (!NT_STATUS_IS_OK(status)) {
4942 tevent_req_nterror(req, status);
4946 /* Copy out parameters */
4947 *state->orig.out.type = *state->tmp.out.type;
4950 state->orig.out.result = state->tmp.out.result;
4952 /* Reset temporary structure */
4953 ZERO_STRUCT(state->tmp);
4955 tevent_req_done(req);
4958 NTSTATUS dcerpc_srvsvc_NetShareCheck_recv(struct tevent_req *req,
4959 TALLOC_CTX *mem_ctx,
4962 struct dcerpc_srvsvc_NetShareCheck_state *state = tevent_req_data(
4963 req, struct dcerpc_srvsvc_NetShareCheck_state);
4966 if (tevent_req_is_nterror(req, &status)) {
4967 tevent_req_received(req);
4971 /* Steal possible out parameters to the callers context */
4972 talloc_steal(mem_ctx, state->out_mem_ctx);
4975 *result = state->orig.out.result;
4977 tevent_req_received(req);
4978 return NT_STATUS_OK;
4981 NTSTATUS dcerpc_srvsvc_NetShareCheck(struct dcerpc_binding_handle *h,
4982 TALLOC_CTX *mem_ctx,
4983 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
4984 const char *_device_name /* [in] [charset(UTF16)] */,
4985 enum srvsvc_ShareType *_type /* [out] [ref] */,
4988 struct srvsvc_NetShareCheck r;
4992 r.in.server_unc = _server_unc;
4993 r.in.device_name = _device_name;
4995 status = dcerpc_srvsvc_NetShareCheck_r(h, mem_ctx, &r);
4996 if (!NT_STATUS_IS_OK(status)) {
5000 /* Return variables */
5001 *_type = *r.out.type;
5004 *result = r.out.result;
5006 return NT_STATUS_OK;
5009 struct dcerpc_srvsvc_NetSrvGetInfo_r_state {
5010 TALLOC_CTX *out_mem_ctx;
5013 static void dcerpc_srvsvc_NetSrvGetInfo_r_done(struct tevent_req *subreq);
5015 struct tevent_req *dcerpc_srvsvc_NetSrvGetInfo_r_send(TALLOC_CTX *mem_ctx,
5016 struct tevent_context *ev,
5017 struct dcerpc_binding_handle *h,
5018 struct srvsvc_NetSrvGetInfo *r)
5020 struct tevent_req *req;
5021 struct dcerpc_srvsvc_NetSrvGetInfo_r_state *state;
5022 struct tevent_req *subreq;
5024 req = tevent_req_create(mem_ctx, &state,
5025 struct dcerpc_srvsvc_NetSrvGetInfo_r_state);
5030 state->out_mem_ctx = talloc_new(state);
5031 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5032 return tevent_req_post(req, ev);
5035 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5036 NULL, &ndr_table_srvsvc,
5037 NDR_SRVSVC_NETSRVGETINFO, state->out_mem_ctx, r);
5038 if (tevent_req_nomem(subreq, req)) {
5039 return tevent_req_post(req, ev);
5041 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSrvGetInfo_r_done, req);
5046 static void dcerpc_srvsvc_NetSrvGetInfo_r_done(struct tevent_req *subreq)
5048 struct tevent_req *req =
5049 tevent_req_callback_data(subreq,
5053 status = dcerpc_binding_handle_call_recv(subreq);
5054 if (!NT_STATUS_IS_OK(status)) {
5055 tevent_req_nterror(req, status);
5059 tevent_req_done(req);
5062 NTSTATUS dcerpc_srvsvc_NetSrvGetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5064 struct dcerpc_srvsvc_NetSrvGetInfo_r_state *state =
5065 tevent_req_data(req,
5066 struct dcerpc_srvsvc_NetSrvGetInfo_r_state);
5069 if (tevent_req_is_nterror(req, &status)) {
5070 tevent_req_received(req);
5074 talloc_steal(mem_ctx, state->out_mem_ctx);
5076 tevent_req_received(req);
5077 return NT_STATUS_OK;
5080 NTSTATUS dcerpc_srvsvc_NetSrvGetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetSrvGetInfo *r)
5084 status = dcerpc_binding_handle_call(h,
5085 NULL, &ndr_table_srvsvc,
5086 NDR_SRVSVC_NETSRVGETINFO, mem_ctx, r);
5091 NTSTATUS dcerpc_srvsvc_NetSrvGetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetSrvGetInfo *r)
5095 status = dcerpc_srvsvc_NetSrvGetInfo_r(p->binding_handle, mem_ctx, r);
5097 if (NT_STATUS_IS_RPC(status)) {
5098 status = NT_STATUS_NET_WRITE_FAULT;
5104 struct dcerpc_srvsvc_NetSrvGetInfo_state {
5105 struct srvsvc_NetSrvGetInfo orig;
5106 struct srvsvc_NetSrvGetInfo tmp;
5107 TALLOC_CTX *out_mem_ctx;
5110 static void dcerpc_srvsvc_NetSrvGetInfo_done(struct tevent_req *subreq);
5112 struct tevent_req *dcerpc_srvsvc_NetSrvGetInfo_send(TALLOC_CTX *mem_ctx,
5113 struct tevent_context *ev,
5114 struct dcerpc_binding_handle *h,
5115 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5116 uint32_t _level /* [in] */,
5117 union srvsvc_NetSrvInfo *_info /* [out] [ref,switch_is(level)] */)
5119 struct tevent_req *req;
5120 struct dcerpc_srvsvc_NetSrvGetInfo_state *state;
5121 struct tevent_req *subreq;
5123 req = tevent_req_create(mem_ctx, &state,
5124 struct dcerpc_srvsvc_NetSrvGetInfo_state);
5128 state->out_mem_ctx = NULL;
5131 state->orig.in.server_unc = _server_unc;
5132 state->orig.in.level = _level;
5134 /* Out parameters */
5135 state->orig.out.info = _info;
5138 ZERO_STRUCT(state->orig.out.result);
5140 state->out_mem_ctx = talloc_named_const(state, 0,
5141 "dcerpc_srvsvc_NetSrvGetInfo_out_memory");
5142 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5143 return tevent_req_post(req, ev);
5146 /* make a temporary copy, that we pass to the dispatch function */
5147 state->tmp = state->orig;
5149 subreq = dcerpc_srvsvc_NetSrvGetInfo_r_send(state, ev, h, &state->tmp);
5150 if (tevent_req_nomem(subreq, req)) {
5151 return tevent_req_post(req, ev);
5153 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSrvGetInfo_done, req);
5157 static void dcerpc_srvsvc_NetSrvGetInfo_done(struct tevent_req *subreq)
5159 struct tevent_req *req = tevent_req_callback_data(
5160 subreq, struct tevent_req);
5161 struct dcerpc_srvsvc_NetSrvGetInfo_state *state = tevent_req_data(
5162 req, struct dcerpc_srvsvc_NetSrvGetInfo_state);
5164 TALLOC_CTX *mem_ctx;
5166 if (state->out_mem_ctx) {
5167 mem_ctx = state->out_mem_ctx;
5172 status = dcerpc_srvsvc_NetSrvGetInfo_r_recv(subreq, mem_ctx);
5173 TALLOC_FREE(subreq);
5174 if (!NT_STATUS_IS_OK(status)) {
5175 tevent_req_nterror(req, status);
5179 /* Copy out parameters */
5180 *state->orig.out.info = *state->tmp.out.info;
5183 state->orig.out.result = state->tmp.out.result;
5185 /* Reset temporary structure */
5186 ZERO_STRUCT(state->tmp);
5188 tevent_req_done(req);
5191 NTSTATUS dcerpc_srvsvc_NetSrvGetInfo_recv(struct tevent_req *req,
5192 TALLOC_CTX *mem_ctx,
5195 struct dcerpc_srvsvc_NetSrvGetInfo_state *state = tevent_req_data(
5196 req, struct dcerpc_srvsvc_NetSrvGetInfo_state);
5199 if (tevent_req_is_nterror(req, &status)) {
5200 tevent_req_received(req);
5204 /* Steal possible out parameters to the callers context */
5205 talloc_steal(mem_ctx, state->out_mem_ctx);
5208 *result = state->orig.out.result;
5210 tevent_req_received(req);
5211 return NT_STATUS_OK;
5214 NTSTATUS dcerpc_srvsvc_NetSrvGetInfo(struct dcerpc_binding_handle *h,
5215 TALLOC_CTX *mem_ctx,
5216 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5217 uint32_t _level /* [in] */,
5218 union srvsvc_NetSrvInfo *_info /* [out] [ref,switch_is(level)] */,
5221 struct srvsvc_NetSrvGetInfo r;
5225 r.in.server_unc = _server_unc;
5226 r.in.level = _level;
5228 status = dcerpc_srvsvc_NetSrvGetInfo_r(h, mem_ctx, &r);
5229 if (!NT_STATUS_IS_OK(status)) {
5233 /* Return variables */
5234 *_info = *r.out.info;
5237 *result = r.out.result;
5239 return NT_STATUS_OK;
5242 struct dcerpc_srvsvc_NetSrvSetInfo_r_state {
5243 TALLOC_CTX *out_mem_ctx;
5246 static void dcerpc_srvsvc_NetSrvSetInfo_r_done(struct tevent_req *subreq);
5248 struct tevent_req *dcerpc_srvsvc_NetSrvSetInfo_r_send(TALLOC_CTX *mem_ctx,
5249 struct tevent_context *ev,
5250 struct dcerpc_binding_handle *h,
5251 struct srvsvc_NetSrvSetInfo *r)
5253 struct tevent_req *req;
5254 struct dcerpc_srvsvc_NetSrvSetInfo_r_state *state;
5255 struct tevent_req *subreq;
5257 req = tevent_req_create(mem_ctx, &state,
5258 struct dcerpc_srvsvc_NetSrvSetInfo_r_state);
5263 state->out_mem_ctx = talloc_new(state);
5264 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5265 return tevent_req_post(req, ev);
5268 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5269 NULL, &ndr_table_srvsvc,
5270 NDR_SRVSVC_NETSRVSETINFO, state->out_mem_ctx, r);
5271 if (tevent_req_nomem(subreq, req)) {
5272 return tevent_req_post(req, ev);
5274 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSrvSetInfo_r_done, req);
5279 static void dcerpc_srvsvc_NetSrvSetInfo_r_done(struct tevent_req *subreq)
5281 struct tevent_req *req =
5282 tevent_req_callback_data(subreq,
5286 status = dcerpc_binding_handle_call_recv(subreq);
5287 if (!NT_STATUS_IS_OK(status)) {
5288 tevent_req_nterror(req, status);
5292 tevent_req_done(req);
5295 NTSTATUS dcerpc_srvsvc_NetSrvSetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5297 struct dcerpc_srvsvc_NetSrvSetInfo_r_state *state =
5298 tevent_req_data(req,
5299 struct dcerpc_srvsvc_NetSrvSetInfo_r_state);
5302 if (tevent_req_is_nterror(req, &status)) {
5303 tevent_req_received(req);
5307 talloc_steal(mem_ctx, state->out_mem_ctx);
5309 tevent_req_received(req);
5310 return NT_STATUS_OK;
5313 NTSTATUS dcerpc_srvsvc_NetSrvSetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetSrvSetInfo *r)
5317 status = dcerpc_binding_handle_call(h,
5318 NULL, &ndr_table_srvsvc,
5319 NDR_SRVSVC_NETSRVSETINFO, mem_ctx, r);
5324 NTSTATUS dcerpc_srvsvc_NetSrvSetInfo_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetSrvSetInfo *r)
5328 status = dcerpc_srvsvc_NetSrvSetInfo_r(p->binding_handle, mem_ctx, r);
5330 if (NT_STATUS_IS_RPC(status)) {
5331 status = NT_STATUS_NET_WRITE_FAULT;
5337 struct dcerpc_srvsvc_NetSrvSetInfo_state {
5338 struct srvsvc_NetSrvSetInfo orig;
5339 struct srvsvc_NetSrvSetInfo tmp;
5340 TALLOC_CTX *out_mem_ctx;
5343 static void dcerpc_srvsvc_NetSrvSetInfo_done(struct tevent_req *subreq);
5345 struct tevent_req *dcerpc_srvsvc_NetSrvSetInfo_send(TALLOC_CTX *mem_ctx,
5346 struct tevent_context *ev,
5347 struct dcerpc_binding_handle *h,
5348 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5349 uint32_t _level /* [in] */,
5350 union srvsvc_NetSrvInfo *_info /* [in] [ref,switch_is(level)] */,
5351 uint32_t *_parm_error /* [in,out] [unique] */)
5353 struct tevent_req *req;
5354 struct dcerpc_srvsvc_NetSrvSetInfo_state *state;
5355 struct tevent_req *subreq;
5357 req = tevent_req_create(mem_ctx, &state,
5358 struct dcerpc_srvsvc_NetSrvSetInfo_state);
5362 state->out_mem_ctx = NULL;
5365 state->orig.in.server_unc = _server_unc;
5366 state->orig.in.level = _level;
5367 state->orig.in.info = _info;
5368 state->orig.in.parm_error = _parm_error;
5370 /* Out parameters */
5371 state->orig.out.parm_error = _parm_error;
5374 ZERO_STRUCT(state->orig.out.result);
5376 state->out_mem_ctx = talloc_named_const(state, 0,
5377 "dcerpc_srvsvc_NetSrvSetInfo_out_memory");
5378 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5379 return tevent_req_post(req, ev);
5382 /* make a temporary copy, that we pass to the dispatch function */
5383 state->tmp = state->orig;
5385 subreq = dcerpc_srvsvc_NetSrvSetInfo_r_send(state, ev, h, &state->tmp);
5386 if (tevent_req_nomem(subreq, req)) {
5387 return tevent_req_post(req, ev);
5389 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSrvSetInfo_done, req);
5393 static void dcerpc_srvsvc_NetSrvSetInfo_done(struct tevent_req *subreq)
5395 struct tevent_req *req = tevent_req_callback_data(
5396 subreq, struct tevent_req);
5397 struct dcerpc_srvsvc_NetSrvSetInfo_state *state = tevent_req_data(
5398 req, struct dcerpc_srvsvc_NetSrvSetInfo_state);
5400 TALLOC_CTX *mem_ctx;
5402 if (state->out_mem_ctx) {
5403 mem_ctx = state->out_mem_ctx;
5408 status = dcerpc_srvsvc_NetSrvSetInfo_r_recv(subreq, mem_ctx);
5409 TALLOC_FREE(subreq);
5410 if (!NT_STATUS_IS_OK(status)) {
5411 tevent_req_nterror(req, status);
5415 /* Copy out parameters */
5416 if (state->orig.out.parm_error && state->tmp.out.parm_error) {
5417 *state->orig.out.parm_error = *state->tmp.out.parm_error;
5421 state->orig.out.result = state->tmp.out.result;
5423 /* Reset temporary structure */
5424 ZERO_STRUCT(state->tmp);
5426 tevent_req_done(req);
5429 NTSTATUS dcerpc_srvsvc_NetSrvSetInfo_recv(struct tevent_req *req,
5430 TALLOC_CTX *mem_ctx,
5433 struct dcerpc_srvsvc_NetSrvSetInfo_state *state = tevent_req_data(
5434 req, struct dcerpc_srvsvc_NetSrvSetInfo_state);
5437 if (tevent_req_is_nterror(req, &status)) {
5438 tevent_req_received(req);
5442 /* Steal possible out parameters to the callers context */
5443 talloc_steal(mem_ctx, state->out_mem_ctx);
5446 *result = state->orig.out.result;
5448 tevent_req_received(req);
5449 return NT_STATUS_OK;
5452 NTSTATUS dcerpc_srvsvc_NetSrvSetInfo(struct dcerpc_binding_handle *h,
5453 TALLOC_CTX *mem_ctx,
5454 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5455 uint32_t _level /* [in] */,
5456 union srvsvc_NetSrvInfo *_info /* [in] [ref,switch_is(level)] */,
5457 uint32_t *_parm_error /* [in,out] [unique] */,
5460 struct srvsvc_NetSrvSetInfo r;
5464 r.in.server_unc = _server_unc;
5465 r.in.level = _level;
5467 r.in.parm_error = _parm_error;
5469 status = dcerpc_srvsvc_NetSrvSetInfo_r(h, mem_ctx, &r);
5470 if (!NT_STATUS_IS_OK(status)) {
5474 /* Return variables */
5475 if (_parm_error && r.out.parm_error) {
5476 *_parm_error = *r.out.parm_error;
5480 *result = r.out.result;
5482 return NT_STATUS_OK;
5485 struct dcerpc_srvsvc_NetDiskEnum_r_state {
5486 TALLOC_CTX *out_mem_ctx;
5489 static void dcerpc_srvsvc_NetDiskEnum_r_done(struct tevent_req *subreq);
5491 struct tevent_req *dcerpc_srvsvc_NetDiskEnum_r_send(TALLOC_CTX *mem_ctx,
5492 struct tevent_context *ev,
5493 struct dcerpc_binding_handle *h,
5494 struct srvsvc_NetDiskEnum *r)
5496 struct tevent_req *req;
5497 struct dcerpc_srvsvc_NetDiskEnum_r_state *state;
5498 struct tevent_req *subreq;
5500 req = tevent_req_create(mem_ctx, &state,
5501 struct dcerpc_srvsvc_NetDiskEnum_r_state);
5506 state->out_mem_ctx = talloc_new(state);
5507 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5508 return tevent_req_post(req, ev);
5511 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5512 NULL, &ndr_table_srvsvc,
5513 NDR_SRVSVC_NETDISKENUM, state->out_mem_ctx, r);
5514 if (tevent_req_nomem(subreq, req)) {
5515 return tevent_req_post(req, ev);
5517 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetDiskEnum_r_done, req);
5522 static void dcerpc_srvsvc_NetDiskEnum_r_done(struct tevent_req *subreq)
5524 struct tevent_req *req =
5525 tevent_req_callback_data(subreq,
5529 status = dcerpc_binding_handle_call_recv(subreq);
5530 if (!NT_STATUS_IS_OK(status)) {
5531 tevent_req_nterror(req, status);
5535 tevent_req_done(req);
5538 NTSTATUS dcerpc_srvsvc_NetDiskEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5540 struct dcerpc_srvsvc_NetDiskEnum_r_state *state =
5541 tevent_req_data(req,
5542 struct dcerpc_srvsvc_NetDiskEnum_r_state);
5545 if (tevent_req_is_nterror(req, &status)) {
5546 tevent_req_received(req);
5550 talloc_steal(mem_ctx, state->out_mem_ctx);
5552 tevent_req_received(req);
5553 return NT_STATUS_OK;
5556 NTSTATUS dcerpc_srvsvc_NetDiskEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetDiskEnum *r)
5560 status = dcerpc_binding_handle_call(h,
5561 NULL, &ndr_table_srvsvc,
5562 NDR_SRVSVC_NETDISKENUM, mem_ctx, r);
5567 NTSTATUS dcerpc_srvsvc_NetDiskEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetDiskEnum *r)
5571 status = dcerpc_srvsvc_NetDiskEnum_r(p->binding_handle, mem_ctx, r);
5573 if (NT_STATUS_IS_RPC(status)) {
5574 status = NT_STATUS_NET_WRITE_FAULT;
5580 struct dcerpc_srvsvc_NetDiskEnum_state {
5581 struct srvsvc_NetDiskEnum orig;
5582 struct srvsvc_NetDiskEnum tmp;
5583 TALLOC_CTX *out_mem_ctx;
5586 static void dcerpc_srvsvc_NetDiskEnum_done(struct tevent_req *subreq);
5588 struct tevent_req *dcerpc_srvsvc_NetDiskEnum_send(TALLOC_CTX *mem_ctx,
5589 struct tevent_context *ev,
5590 struct dcerpc_binding_handle *h,
5591 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5592 uint32_t _level /* [in] */,
5593 struct srvsvc_NetDiskInfo *_info /* [in,out] [ref] */,
5594 uint32_t _maxlen /* [in] */,
5595 uint32_t *_totalentries /* [out] [ref] */,
5596 uint32_t *_resume_handle /* [in,out] [unique] */)
5598 struct tevent_req *req;
5599 struct dcerpc_srvsvc_NetDiskEnum_state *state;
5600 struct tevent_req *subreq;
5602 req = tevent_req_create(mem_ctx, &state,
5603 struct dcerpc_srvsvc_NetDiskEnum_state);
5607 state->out_mem_ctx = NULL;
5610 state->orig.in.server_unc = _server_unc;
5611 state->orig.in.level = _level;
5612 state->orig.in.info = _info;
5613 state->orig.in.maxlen = _maxlen;
5614 state->orig.in.resume_handle = _resume_handle;
5616 /* Out parameters */
5617 state->orig.out.info = _info;
5618 state->orig.out.totalentries = _totalentries;
5619 state->orig.out.resume_handle = _resume_handle;
5622 ZERO_STRUCT(state->orig.out.result);
5624 state->out_mem_ctx = talloc_named_const(state, 0,
5625 "dcerpc_srvsvc_NetDiskEnum_out_memory");
5626 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5627 return tevent_req_post(req, ev);
5630 /* make a temporary copy, that we pass to the dispatch function */
5631 state->tmp = state->orig;
5633 subreq = dcerpc_srvsvc_NetDiskEnum_r_send(state, ev, h, &state->tmp);
5634 if (tevent_req_nomem(subreq, req)) {
5635 return tevent_req_post(req, ev);
5637 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetDiskEnum_done, req);
5641 static void dcerpc_srvsvc_NetDiskEnum_done(struct tevent_req *subreq)
5643 struct tevent_req *req = tevent_req_callback_data(
5644 subreq, struct tevent_req);
5645 struct dcerpc_srvsvc_NetDiskEnum_state *state = tevent_req_data(
5646 req, struct dcerpc_srvsvc_NetDiskEnum_state);
5648 TALLOC_CTX *mem_ctx;
5650 if (state->out_mem_ctx) {
5651 mem_ctx = state->out_mem_ctx;
5656 status = dcerpc_srvsvc_NetDiskEnum_r_recv(subreq, mem_ctx);
5657 TALLOC_FREE(subreq);
5658 if (!NT_STATUS_IS_OK(status)) {
5659 tevent_req_nterror(req, status);
5663 /* Copy out parameters */
5664 *state->orig.out.info = *state->tmp.out.info;
5665 *state->orig.out.totalentries = *state->tmp.out.totalentries;
5666 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
5667 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
5671 state->orig.out.result = state->tmp.out.result;
5673 /* Reset temporary structure */
5674 ZERO_STRUCT(state->tmp);
5676 tevent_req_done(req);
5679 NTSTATUS dcerpc_srvsvc_NetDiskEnum_recv(struct tevent_req *req,
5680 TALLOC_CTX *mem_ctx,
5683 struct dcerpc_srvsvc_NetDiskEnum_state *state = tevent_req_data(
5684 req, struct dcerpc_srvsvc_NetDiskEnum_state);
5687 if (tevent_req_is_nterror(req, &status)) {
5688 tevent_req_received(req);
5692 /* Steal possible out parameters to the callers context */
5693 talloc_steal(mem_ctx, state->out_mem_ctx);
5696 *result = state->orig.out.result;
5698 tevent_req_received(req);
5699 return NT_STATUS_OK;
5702 NTSTATUS dcerpc_srvsvc_NetDiskEnum(struct dcerpc_binding_handle *h,
5703 TALLOC_CTX *mem_ctx,
5704 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5705 uint32_t _level /* [in] */,
5706 struct srvsvc_NetDiskInfo *_info /* [in,out] [ref] */,
5707 uint32_t _maxlen /* [in] */,
5708 uint32_t *_totalentries /* [out] [ref] */,
5709 uint32_t *_resume_handle /* [in,out] [unique] */,
5712 struct srvsvc_NetDiskEnum r;
5716 r.in.server_unc = _server_unc;
5717 r.in.level = _level;
5719 r.in.maxlen = _maxlen;
5720 r.in.resume_handle = _resume_handle;
5722 status = dcerpc_srvsvc_NetDiskEnum_r(h, mem_ctx, &r);
5723 if (!NT_STATUS_IS_OK(status)) {
5727 /* Return variables */
5728 *_info = *r.out.info;
5729 *_totalentries = *r.out.totalentries;
5730 if (_resume_handle && r.out.resume_handle) {
5731 *_resume_handle = *r.out.resume_handle;
5735 *result = r.out.result;
5737 return NT_STATUS_OK;
5740 struct dcerpc_srvsvc_NetServerStatisticsGet_r_state {
5741 TALLOC_CTX *out_mem_ctx;
5744 static void dcerpc_srvsvc_NetServerStatisticsGet_r_done(struct tevent_req *subreq);
5746 struct tevent_req *dcerpc_srvsvc_NetServerStatisticsGet_r_send(TALLOC_CTX *mem_ctx,
5747 struct tevent_context *ev,
5748 struct dcerpc_binding_handle *h,
5749 struct srvsvc_NetServerStatisticsGet *r)
5751 struct tevent_req *req;
5752 struct dcerpc_srvsvc_NetServerStatisticsGet_r_state *state;
5753 struct tevent_req *subreq;
5755 req = tevent_req_create(mem_ctx, &state,
5756 struct dcerpc_srvsvc_NetServerStatisticsGet_r_state);
5761 state->out_mem_ctx = talloc_new(state);
5762 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5763 return tevent_req_post(req, ev);
5766 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5767 NULL, &ndr_table_srvsvc,
5768 NDR_SRVSVC_NETSERVERSTATISTICSGET, state->out_mem_ctx, r);
5769 if (tevent_req_nomem(subreq, req)) {
5770 return tevent_req_post(req, ev);
5772 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetServerStatisticsGet_r_done, req);
5777 static void dcerpc_srvsvc_NetServerStatisticsGet_r_done(struct tevent_req *subreq)
5779 struct tevent_req *req =
5780 tevent_req_callback_data(subreq,
5784 status = dcerpc_binding_handle_call_recv(subreq);
5785 if (!NT_STATUS_IS_OK(status)) {
5786 tevent_req_nterror(req, status);
5790 tevent_req_done(req);
5793 NTSTATUS dcerpc_srvsvc_NetServerStatisticsGet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5795 struct dcerpc_srvsvc_NetServerStatisticsGet_r_state *state =
5796 tevent_req_data(req,
5797 struct dcerpc_srvsvc_NetServerStatisticsGet_r_state);
5800 if (tevent_req_is_nterror(req, &status)) {
5801 tevent_req_received(req);
5805 talloc_steal(mem_ctx, state->out_mem_ctx);
5807 tevent_req_received(req);
5808 return NT_STATUS_OK;
5811 NTSTATUS dcerpc_srvsvc_NetServerStatisticsGet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetServerStatisticsGet *r)
5815 status = dcerpc_binding_handle_call(h,
5816 NULL, &ndr_table_srvsvc,
5817 NDR_SRVSVC_NETSERVERSTATISTICSGET, mem_ctx, r);
5822 NTSTATUS dcerpc_srvsvc_NetServerStatisticsGet_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetServerStatisticsGet *r)
5826 status = dcerpc_srvsvc_NetServerStatisticsGet_r(p->binding_handle, mem_ctx, r);
5828 if (NT_STATUS_IS_RPC(status)) {
5829 status = NT_STATUS_NET_WRITE_FAULT;
5835 struct dcerpc_srvsvc_NetServerStatisticsGet_state {
5836 struct srvsvc_NetServerStatisticsGet orig;
5837 struct srvsvc_NetServerStatisticsGet tmp;
5838 TALLOC_CTX *out_mem_ctx;
5841 static void dcerpc_srvsvc_NetServerStatisticsGet_done(struct tevent_req *subreq);
5843 struct tevent_req *dcerpc_srvsvc_NetServerStatisticsGet_send(TALLOC_CTX *mem_ctx,
5844 struct tevent_context *ev,
5845 struct dcerpc_binding_handle *h,
5846 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5847 const char *_service /* [in] [unique,charset(UTF16)] */,
5848 uint32_t _level /* [in] */,
5849 uint32_t _options /* [in] */,
5850 struct srvsvc_Statistics **_stats /* [out] [ref] */)
5852 struct tevent_req *req;
5853 struct dcerpc_srvsvc_NetServerStatisticsGet_state *state;
5854 struct tevent_req *subreq;
5856 req = tevent_req_create(mem_ctx, &state,
5857 struct dcerpc_srvsvc_NetServerStatisticsGet_state);
5861 state->out_mem_ctx = NULL;
5864 state->orig.in.server_unc = _server_unc;
5865 state->orig.in.service = _service;
5866 state->orig.in.level = _level;
5867 state->orig.in.options = _options;
5869 /* Out parameters */
5870 state->orig.out.stats = _stats;
5873 ZERO_STRUCT(state->orig.out.result);
5875 state->out_mem_ctx = talloc_named_const(state, 0,
5876 "dcerpc_srvsvc_NetServerStatisticsGet_out_memory");
5877 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5878 return tevent_req_post(req, ev);
5881 /* make a temporary copy, that we pass to the dispatch function */
5882 state->tmp = state->orig;
5884 subreq = dcerpc_srvsvc_NetServerStatisticsGet_r_send(state, ev, h, &state->tmp);
5885 if (tevent_req_nomem(subreq, req)) {
5886 return tevent_req_post(req, ev);
5888 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetServerStatisticsGet_done, req);
5892 static void dcerpc_srvsvc_NetServerStatisticsGet_done(struct tevent_req *subreq)
5894 struct tevent_req *req = tevent_req_callback_data(
5895 subreq, struct tevent_req);
5896 struct dcerpc_srvsvc_NetServerStatisticsGet_state *state = tevent_req_data(
5897 req, struct dcerpc_srvsvc_NetServerStatisticsGet_state);
5899 TALLOC_CTX *mem_ctx;
5901 if (state->out_mem_ctx) {
5902 mem_ctx = state->out_mem_ctx;
5907 status = dcerpc_srvsvc_NetServerStatisticsGet_r_recv(subreq, mem_ctx);
5908 TALLOC_FREE(subreq);
5909 if (!NT_STATUS_IS_OK(status)) {
5910 tevent_req_nterror(req, status);
5914 /* Copy out parameters */
5915 *state->orig.out.stats = *state->tmp.out.stats;
5918 state->orig.out.result = state->tmp.out.result;
5920 /* Reset temporary structure */
5921 ZERO_STRUCT(state->tmp);
5923 tevent_req_done(req);
5926 NTSTATUS dcerpc_srvsvc_NetServerStatisticsGet_recv(struct tevent_req *req,
5927 TALLOC_CTX *mem_ctx,
5930 struct dcerpc_srvsvc_NetServerStatisticsGet_state *state = tevent_req_data(
5931 req, struct dcerpc_srvsvc_NetServerStatisticsGet_state);
5934 if (tevent_req_is_nterror(req, &status)) {
5935 tevent_req_received(req);
5939 /* Steal possible out parameters to the callers context */
5940 talloc_steal(mem_ctx, state->out_mem_ctx);
5943 *result = state->orig.out.result;
5945 tevent_req_received(req);
5946 return NT_STATUS_OK;
5949 NTSTATUS dcerpc_srvsvc_NetServerStatisticsGet(struct dcerpc_binding_handle *h,
5950 TALLOC_CTX *mem_ctx,
5951 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
5952 const char *_service /* [in] [unique,charset(UTF16)] */,
5953 uint32_t _level /* [in] */,
5954 uint32_t _options /* [in] */,
5955 struct srvsvc_Statistics **_stats /* [out] [ref] */,
5958 struct srvsvc_NetServerStatisticsGet r;
5962 r.in.server_unc = _server_unc;
5963 r.in.service = _service;
5964 r.in.level = _level;
5965 r.in.options = _options;
5967 status = dcerpc_srvsvc_NetServerStatisticsGet_r(h, mem_ctx, &r);
5968 if (!NT_STATUS_IS_OK(status)) {
5972 /* Return variables */
5973 *_stats = *r.out.stats;
5976 *result = r.out.result;
5978 return NT_STATUS_OK;
5981 struct dcerpc_srvsvc_NetTransportAdd_r_state {
5982 TALLOC_CTX *out_mem_ctx;
5985 static void dcerpc_srvsvc_NetTransportAdd_r_done(struct tevent_req *subreq);
5987 struct tevent_req *dcerpc_srvsvc_NetTransportAdd_r_send(TALLOC_CTX *mem_ctx,
5988 struct tevent_context *ev,
5989 struct dcerpc_binding_handle *h,
5990 struct srvsvc_NetTransportAdd *r)
5992 struct tevent_req *req;
5993 struct dcerpc_srvsvc_NetTransportAdd_r_state *state;
5994 struct tevent_req *subreq;
5996 req = tevent_req_create(mem_ctx, &state,
5997 struct dcerpc_srvsvc_NetTransportAdd_r_state);
6002 state->out_mem_ctx = NULL;
6003 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6004 NULL, &ndr_table_srvsvc,
6005 NDR_SRVSVC_NETTRANSPORTADD, state, r);
6006 if (tevent_req_nomem(subreq, req)) {
6007 return tevent_req_post(req, ev);
6009 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetTransportAdd_r_done, req);
6014 static void dcerpc_srvsvc_NetTransportAdd_r_done(struct tevent_req *subreq)
6016 struct tevent_req *req =
6017 tevent_req_callback_data(subreq,
6021 status = dcerpc_binding_handle_call_recv(subreq);
6022 if (!NT_STATUS_IS_OK(status)) {
6023 tevent_req_nterror(req, status);
6027 tevent_req_done(req);
6030 NTSTATUS dcerpc_srvsvc_NetTransportAdd_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6032 struct dcerpc_srvsvc_NetTransportAdd_r_state *state =
6033 tevent_req_data(req,
6034 struct dcerpc_srvsvc_NetTransportAdd_r_state);
6037 if (tevent_req_is_nterror(req, &status)) {
6038 tevent_req_received(req);
6042 talloc_steal(mem_ctx, state->out_mem_ctx);
6044 tevent_req_received(req);
6045 return NT_STATUS_OK;
6048 NTSTATUS dcerpc_srvsvc_NetTransportAdd_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetTransportAdd *r)
6052 status = dcerpc_binding_handle_call(h,
6053 NULL, &ndr_table_srvsvc,
6054 NDR_SRVSVC_NETTRANSPORTADD, mem_ctx, r);
6059 NTSTATUS dcerpc_srvsvc_NetTransportAdd_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetTransportAdd *r)
6063 status = dcerpc_srvsvc_NetTransportAdd_r(p->binding_handle, mem_ctx, r);
6065 if (NT_STATUS_IS_RPC(status)) {
6066 status = NT_STATUS_NET_WRITE_FAULT;
6072 struct dcerpc_srvsvc_NetTransportAdd_state {
6073 struct srvsvc_NetTransportAdd orig;
6074 struct srvsvc_NetTransportAdd tmp;
6075 TALLOC_CTX *out_mem_ctx;
6078 static void dcerpc_srvsvc_NetTransportAdd_done(struct tevent_req *subreq);
6080 struct tevent_req *dcerpc_srvsvc_NetTransportAdd_send(TALLOC_CTX *mem_ctx,
6081 struct tevent_context *ev,
6082 struct dcerpc_binding_handle *h,
6083 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6084 uint32_t _level /* [in] */,
6085 union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */)
6087 struct tevent_req *req;
6088 struct dcerpc_srvsvc_NetTransportAdd_state *state;
6089 struct tevent_req *subreq;
6091 req = tevent_req_create(mem_ctx, &state,
6092 struct dcerpc_srvsvc_NetTransportAdd_state);
6096 state->out_mem_ctx = NULL;
6099 state->orig.in.server_unc = _server_unc;
6100 state->orig.in.level = _level;
6101 state->orig.in.info = _info;
6103 /* Out parameters */
6106 ZERO_STRUCT(state->orig.out.result);
6108 /* make a temporary copy, that we pass to the dispatch function */
6109 state->tmp = state->orig;
6111 subreq = dcerpc_srvsvc_NetTransportAdd_r_send(state, ev, h, &state->tmp);
6112 if (tevent_req_nomem(subreq, req)) {
6113 return tevent_req_post(req, ev);
6115 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetTransportAdd_done, req);
6119 static void dcerpc_srvsvc_NetTransportAdd_done(struct tevent_req *subreq)
6121 struct tevent_req *req = tevent_req_callback_data(
6122 subreq, struct tevent_req);
6123 struct dcerpc_srvsvc_NetTransportAdd_state *state = tevent_req_data(
6124 req, struct dcerpc_srvsvc_NetTransportAdd_state);
6126 TALLOC_CTX *mem_ctx;
6128 if (state->out_mem_ctx) {
6129 mem_ctx = state->out_mem_ctx;
6134 status = dcerpc_srvsvc_NetTransportAdd_r_recv(subreq, mem_ctx);
6135 TALLOC_FREE(subreq);
6136 if (!NT_STATUS_IS_OK(status)) {
6137 tevent_req_nterror(req, status);
6141 /* Copy out parameters */
6144 state->orig.out.result = state->tmp.out.result;
6146 /* Reset temporary structure */
6147 ZERO_STRUCT(state->tmp);
6149 tevent_req_done(req);
6152 NTSTATUS dcerpc_srvsvc_NetTransportAdd_recv(struct tevent_req *req,
6153 TALLOC_CTX *mem_ctx,
6156 struct dcerpc_srvsvc_NetTransportAdd_state *state = tevent_req_data(
6157 req, struct dcerpc_srvsvc_NetTransportAdd_state);
6160 if (tevent_req_is_nterror(req, &status)) {
6161 tevent_req_received(req);
6165 /* Steal possible out parameters to the callers context */
6166 talloc_steal(mem_ctx, state->out_mem_ctx);
6169 *result = state->orig.out.result;
6171 tevent_req_received(req);
6172 return NT_STATUS_OK;
6175 NTSTATUS dcerpc_srvsvc_NetTransportAdd(struct dcerpc_binding_handle *h,
6176 TALLOC_CTX *mem_ctx,
6177 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6178 uint32_t _level /* [in] */,
6179 union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */,
6182 struct srvsvc_NetTransportAdd r;
6186 r.in.server_unc = _server_unc;
6187 r.in.level = _level;
6190 status = dcerpc_srvsvc_NetTransportAdd_r(h, mem_ctx, &r);
6191 if (!NT_STATUS_IS_OK(status)) {
6195 /* Return variables */
6198 *result = r.out.result;
6200 return NT_STATUS_OK;
6203 struct dcerpc_srvsvc_NetTransportEnum_r_state {
6204 TALLOC_CTX *out_mem_ctx;
6207 static void dcerpc_srvsvc_NetTransportEnum_r_done(struct tevent_req *subreq);
6209 struct tevent_req *dcerpc_srvsvc_NetTransportEnum_r_send(TALLOC_CTX *mem_ctx,
6210 struct tevent_context *ev,
6211 struct dcerpc_binding_handle *h,
6212 struct srvsvc_NetTransportEnum *r)
6214 struct tevent_req *req;
6215 struct dcerpc_srvsvc_NetTransportEnum_r_state *state;
6216 struct tevent_req *subreq;
6218 req = tevent_req_create(mem_ctx, &state,
6219 struct dcerpc_srvsvc_NetTransportEnum_r_state);
6224 state->out_mem_ctx = talloc_new(state);
6225 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6226 return tevent_req_post(req, ev);
6229 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6230 NULL, &ndr_table_srvsvc,
6231 NDR_SRVSVC_NETTRANSPORTENUM, state->out_mem_ctx, r);
6232 if (tevent_req_nomem(subreq, req)) {
6233 return tevent_req_post(req, ev);
6235 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetTransportEnum_r_done, req);
6240 static void dcerpc_srvsvc_NetTransportEnum_r_done(struct tevent_req *subreq)
6242 struct tevent_req *req =
6243 tevent_req_callback_data(subreq,
6247 status = dcerpc_binding_handle_call_recv(subreq);
6248 if (!NT_STATUS_IS_OK(status)) {
6249 tevent_req_nterror(req, status);
6253 tevent_req_done(req);
6256 NTSTATUS dcerpc_srvsvc_NetTransportEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6258 struct dcerpc_srvsvc_NetTransportEnum_r_state *state =
6259 tevent_req_data(req,
6260 struct dcerpc_srvsvc_NetTransportEnum_r_state);
6263 if (tevent_req_is_nterror(req, &status)) {
6264 tevent_req_received(req);
6268 talloc_steal(mem_ctx, state->out_mem_ctx);
6270 tevent_req_received(req);
6271 return NT_STATUS_OK;
6274 NTSTATUS dcerpc_srvsvc_NetTransportEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetTransportEnum *r)
6278 status = dcerpc_binding_handle_call(h,
6279 NULL, &ndr_table_srvsvc,
6280 NDR_SRVSVC_NETTRANSPORTENUM, mem_ctx, r);
6285 NTSTATUS dcerpc_srvsvc_NetTransportEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetTransportEnum *r)
6289 status = dcerpc_srvsvc_NetTransportEnum_r(p->binding_handle, mem_ctx, r);
6291 if (NT_STATUS_IS_RPC(status)) {
6292 status = NT_STATUS_NET_WRITE_FAULT;
6298 struct dcerpc_srvsvc_NetTransportEnum_state {
6299 struct srvsvc_NetTransportEnum orig;
6300 struct srvsvc_NetTransportEnum tmp;
6301 TALLOC_CTX *out_mem_ctx;
6304 static void dcerpc_srvsvc_NetTransportEnum_done(struct tevent_req *subreq);
6306 struct tevent_req *dcerpc_srvsvc_NetTransportEnum_send(TALLOC_CTX *mem_ctx,
6307 struct tevent_context *ev,
6308 struct dcerpc_binding_handle *h,
6309 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6310 struct srvsvc_NetTransportInfoCtr *_transports /* [in,out] [ref] */,
6311 uint32_t _max_buffer /* [in] */,
6312 uint32_t *_totalentries /* [out] [ref] */,
6313 uint32_t *_resume_handle /* [in,out] [unique] */)
6315 struct tevent_req *req;
6316 struct dcerpc_srvsvc_NetTransportEnum_state *state;
6317 struct tevent_req *subreq;
6319 req = tevent_req_create(mem_ctx, &state,
6320 struct dcerpc_srvsvc_NetTransportEnum_state);
6324 state->out_mem_ctx = NULL;
6327 state->orig.in.server_unc = _server_unc;
6328 state->orig.in.transports = _transports;
6329 state->orig.in.max_buffer = _max_buffer;
6330 state->orig.in.resume_handle = _resume_handle;
6332 /* Out parameters */
6333 state->orig.out.transports = _transports;
6334 state->orig.out.totalentries = _totalentries;
6335 state->orig.out.resume_handle = _resume_handle;
6338 ZERO_STRUCT(state->orig.out.result);
6340 state->out_mem_ctx = talloc_named_const(state, 0,
6341 "dcerpc_srvsvc_NetTransportEnum_out_memory");
6342 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6343 return tevent_req_post(req, ev);
6346 /* make a temporary copy, that we pass to the dispatch function */
6347 state->tmp = state->orig;
6349 subreq = dcerpc_srvsvc_NetTransportEnum_r_send(state, ev, h, &state->tmp);
6350 if (tevent_req_nomem(subreq, req)) {
6351 return tevent_req_post(req, ev);
6353 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetTransportEnum_done, req);
6357 static void dcerpc_srvsvc_NetTransportEnum_done(struct tevent_req *subreq)
6359 struct tevent_req *req = tevent_req_callback_data(
6360 subreq, struct tevent_req);
6361 struct dcerpc_srvsvc_NetTransportEnum_state *state = tevent_req_data(
6362 req, struct dcerpc_srvsvc_NetTransportEnum_state);
6364 TALLOC_CTX *mem_ctx;
6366 if (state->out_mem_ctx) {
6367 mem_ctx = state->out_mem_ctx;
6372 status = dcerpc_srvsvc_NetTransportEnum_r_recv(subreq, mem_ctx);
6373 TALLOC_FREE(subreq);
6374 if (!NT_STATUS_IS_OK(status)) {
6375 tevent_req_nterror(req, status);
6379 /* Copy out parameters */
6380 *state->orig.out.transports = *state->tmp.out.transports;
6381 *state->orig.out.totalentries = *state->tmp.out.totalentries;
6382 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
6383 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
6387 state->orig.out.result = state->tmp.out.result;
6389 /* Reset temporary structure */
6390 ZERO_STRUCT(state->tmp);
6392 tevent_req_done(req);
6395 NTSTATUS dcerpc_srvsvc_NetTransportEnum_recv(struct tevent_req *req,
6396 TALLOC_CTX *mem_ctx,
6399 struct dcerpc_srvsvc_NetTransportEnum_state *state = tevent_req_data(
6400 req, struct dcerpc_srvsvc_NetTransportEnum_state);
6403 if (tevent_req_is_nterror(req, &status)) {
6404 tevent_req_received(req);
6408 /* Steal possible out parameters to the callers context */
6409 talloc_steal(mem_ctx, state->out_mem_ctx);
6412 *result = state->orig.out.result;
6414 tevent_req_received(req);
6415 return NT_STATUS_OK;
6418 NTSTATUS dcerpc_srvsvc_NetTransportEnum(struct dcerpc_binding_handle *h,
6419 TALLOC_CTX *mem_ctx,
6420 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6421 struct srvsvc_NetTransportInfoCtr *_transports /* [in,out] [ref] */,
6422 uint32_t _max_buffer /* [in] */,
6423 uint32_t *_totalentries /* [out] [ref] */,
6424 uint32_t *_resume_handle /* [in,out] [unique] */,
6427 struct srvsvc_NetTransportEnum r;
6431 r.in.server_unc = _server_unc;
6432 r.in.transports = _transports;
6433 r.in.max_buffer = _max_buffer;
6434 r.in.resume_handle = _resume_handle;
6436 status = dcerpc_srvsvc_NetTransportEnum_r(h, mem_ctx, &r);
6437 if (!NT_STATUS_IS_OK(status)) {
6441 /* Return variables */
6442 *_transports = *r.out.transports;
6443 *_totalentries = *r.out.totalentries;
6444 if (_resume_handle && r.out.resume_handle) {
6445 *_resume_handle = *r.out.resume_handle;
6449 *result = r.out.result;
6451 return NT_STATUS_OK;
6454 struct dcerpc_srvsvc_NetTransportDel_r_state {
6455 TALLOC_CTX *out_mem_ctx;
6458 static void dcerpc_srvsvc_NetTransportDel_r_done(struct tevent_req *subreq);
6460 struct tevent_req *dcerpc_srvsvc_NetTransportDel_r_send(TALLOC_CTX *mem_ctx,
6461 struct tevent_context *ev,
6462 struct dcerpc_binding_handle *h,
6463 struct srvsvc_NetTransportDel *r)
6465 struct tevent_req *req;
6466 struct dcerpc_srvsvc_NetTransportDel_r_state *state;
6467 struct tevent_req *subreq;
6469 req = tevent_req_create(mem_ctx, &state,
6470 struct dcerpc_srvsvc_NetTransportDel_r_state);
6475 state->out_mem_ctx = NULL;
6476 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6477 NULL, &ndr_table_srvsvc,
6478 NDR_SRVSVC_NETTRANSPORTDEL, state, r);
6479 if (tevent_req_nomem(subreq, req)) {
6480 return tevent_req_post(req, ev);
6482 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetTransportDel_r_done, req);
6487 static void dcerpc_srvsvc_NetTransportDel_r_done(struct tevent_req *subreq)
6489 struct tevent_req *req =
6490 tevent_req_callback_data(subreq,
6494 status = dcerpc_binding_handle_call_recv(subreq);
6495 if (!NT_STATUS_IS_OK(status)) {
6496 tevent_req_nterror(req, status);
6500 tevent_req_done(req);
6503 NTSTATUS dcerpc_srvsvc_NetTransportDel_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6505 struct dcerpc_srvsvc_NetTransportDel_r_state *state =
6506 tevent_req_data(req,
6507 struct dcerpc_srvsvc_NetTransportDel_r_state);
6510 if (tevent_req_is_nterror(req, &status)) {
6511 tevent_req_received(req);
6515 talloc_steal(mem_ctx, state->out_mem_ctx);
6517 tevent_req_received(req);
6518 return NT_STATUS_OK;
6521 NTSTATUS dcerpc_srvsvc_NetTransportDel_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetTransportDel *r)
6525 status = dcerpc_binding_handle_call(h,
6526 NULL, &ndr_table_srvsvc,
6527 NDR_SRVSVC_NETTRANSPORTDEL, mem_ctx, r);
6532 NTSTATUS dcerpc_srvsvc_NetTransportDel_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetTransportDel *r)
6536 status = dcerpc_srvsvc_NetTransportDel_r(p->binding_handle, mem_ctx, r);
6538 if (NT_STATUS_IS_RPC(status)) {
6539 status = NT_STATUS_NET_WRITE_FAULT;
6545 struct dcerpc_srvsvc_NetTransportDel_state {
6546 struct srvsvc_NetTransportDel orig;
6547 struct srvsvc_NetTransportDel tmp;
6548 TALLOC_CTX *out_mem_ctx;
6551 static void dcerpc_srvsvc_NetTransportDel_done(struct tevent_req *subreq);
6553 struct tevent_req *dcerpc_srvsvc_NetTransportDel_send(TALLOC_CTX *mem_ctx,
6554 struct tevent_context *ev,
6555 struct dcerpc_binding_handle *h,
6556 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6557 uint32_t _level /* [in] */,
6558 struct srvsvc_NetTransportInfo0 *_info0 /* [in] [ref] */)
6560 struct tevent_req *req;
6561 struct dcerpc_srvsvc_NetTransportDel_state *state;
6562 struct tevent_req *subreq;
6564 req = tevent_req_create(mem_ctx, &state,
6565 struct dcerpc_srvsvc_NetTransportDel_state);
6569 state->out_mem_ctx = NULL;
6572 state->orig.in.server_unc = _server_unc;
6573 state->orig.in.level = _level;
6574 state->orig.in.info0 = _info0;
6576 /* Out parameters */
6579 ZERO_STRUCT(state->orig.out.result);
6581 /* make a temporary copy, that we pass to the dispatch function */
6582 state->tmp = state->orig;
6584 subreq = dcerpc_srvsvc_NetTransportDel_r_send(state, ev, h, &state->tmp);
6585 if (tevent_req_nomem(subreq, req)) {
6586 return tevent_req_post(req, ev);
6588 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetTransportDel_done, req);
6592 static void dcerpc_srvsvc_NetTransportDel_done(struct tevent_req *subreq)
6594 struct tevent_req *req = tevent_req_callback_data(
6595 subreq, struct tevent_req);
6596 struct dcerpc_srvsvc_NetTransportDel_state *state = tevent_req_data(
6597 req, struct dcerpc_srvsvc_NetTransportDel_state);
6599 TALLOC_CTX *mem_ctx;
6601 if (state->out_mem_ctx) {
6602 mem_ctx = state->out_mem_ctx;
6607 status = dcerpc_srvsvc_NetTransportDel_r_recv(subreq, mem_ctx);
6608 TALLOC_FREE(subreq);
6609 if (!NT_STATUS_IS_OK(status)) {
6610 tevent_req_nterror(req, status);
6614 /* Copy out parameters */
6617 state->orig.out.result = state->tmp.out.result;
6619 /* Reset temporary structure */
6620 ZERO_STRUCT(state->tmp);
6622 tevent_req_done(req);
6625 NTSTATUS dcerpc_srvsvc_NetTransportDel_recv(struct tevent_req *req,
6626 TALLOC_CTX *mem_ctx,
6629 struct dcerpc_srvsvc_NetTransportDel_state *state = tevent_req_data(
6630 req, struct dcerpc_srvsvc_NetTransportDel_state);
6633 if (tevent_req_is_nterror(req, &status)) {
6634 tevent_req_received(req);
6638 /* Steal possible out parameters to the callers context */
6639 talloc_steal(mem_ctx, state->out_mem_ctx);
6642 *result = state->orig.out.result;
6644 tevent_req_received(req);
6645 return NT_STATUS_OK;
6648 NTSTATUS dcerpc_srvsvc_NetTransportDel(struct dcerpc_binding_handle *h,
6649 TALLOC_CTX *mem_ctx,
6650 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6651 uint32_t _level /* [in] */,
6652 struct srvsvc_NetTransportInfo0 *_info0 /* [in] [ref] */,
6655 struct srvsvc_NetTransportDel r;
6659 r.in.server_unc = _server_unc;
6660 r.in.level = _level;
6661 r.in.info0 = _info0;
6663 status = dcerpc_srvsvc_NetTransportDel_r(h, mem_ctx, &r);
6664 if (!NT_STATUS_IS_OK(status)) {
6668 /* Return variables */
6671 *result = r.out.result;
6673 return NT_STATUS_OK;
6676 struct dcerpc_srvsvc_NetRemoteTOD_r_state {
6677 TALLOC_CTX *out_mem_ctx;
6680 static void dcerpc_srvsvc_NetRemoteTOD_r_done(struct tevent_req *subreq);
6682 struct tevent_req *dcerpc_srvsvc_NetRemoteTOD_r_send(TALLOC_CTX *mem_ctx,
6683 struct tevent_context *ev,
6684 struct dcerpc_binding_handle *h,
6685 struct srvsvc_NetRemoteTOD *r)
6687 struct tevent_req *req;
6688 struct dcerpc_srvsvc_NetRemoteTOD_r_state *state;
6689 struct tevent_req *subreq;
6691 req = tevent_req_create(mem_ctx, &state,
6692 struct dcerpc_srvsvc_NetRemoteTOD_r_state);
6697 state->out_mem_ctx = talloc_new(state);
6698 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6699 return tevent_req_post(req, ev);
6702 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6703 NULL, &ndr_table_srvsvc,
6704 NDR_SRVSVC_NETREMOTETOD, state->out_mem_ctx, r);
6705 if (tevent_req_nomem(subreq, req)) {
6706 return tevent_req_post(req, ev);
6708 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetRemoteTOD_r_done, req);
6713 static void dcerpc_srvsvc_NetRemoteTOD_r_done(struct tevent_req *subreq)
6715 struct tevent_req *req =
6716 tevent_req_callback_data(subreq,
6720 status = dcerpc_binding_handle_call_recv(subreq);
6721 if (!NT_STATUS_IS_OK(status)) {
6722 tevent_req_nterror(req, status);
6726 tevent_req_done(req);
6729 NTSTATUS dcerpc_srvsvc_NetRemoteTOD_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6731 struct dcerpc_srvsvc_NetRemoteTOD_r_state *state =
6732 tevent_req_data(req,
6733 struct dcerpc_srvsvc_NetRemoteTOD_r_state);
6736 if (tevent_req_is_nterror(req, &status)) {
6737 tevent_req_received(req);
6741 talloc_steal(mem_ctx, state->out_mem_ctx);
6743 tevent_req_received(req);
6744 return NT_STATUS_OK;
6747 NTSTATUS dcerpc_srvsvc_NetRemoteTOD_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetRemoteTOD *r)
6751 status = dcerpc_binding_handle_call(h,
6752 NULL, &ndr_table_srvsvc,
6753 NDR_SRVSVC_NETREMOTETOD, mem_ctx, r);
6758 NTSTATUS dcerpc_srvsvc_NetRemoteTOD_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetRemoteTOD *r)
6762 status = dcerpc_srvsvc_NetRemoteTOD_r(p->binding_handle, mem_ctx, r);
6764 if (NT_STATUS_IS_RPC(status)) {
6765 status = NT_STATUS_NET_WRITE_FAULT;
6771 struct dcerpc_srvsvc_NetRemoteTOD_state {
6772 struct srvsvc_NetRemoteTOD orig;
6773 struct srvsvc_NetRemoteTOD tmp;
6774 TALLOC_CTX *out_mem_ctx;
6777 static void dcerpc_srvsvc_NetRemoteTOD_done(struct tevent_req *subreq);
6779 struct tevent_req *dcerpc_srvsvc_NetRemoteTOD_send(TALLOC_CTX *mem_ctx,
6780 struct tevent_context *ev,
6781 struct dcerpc_binding_handle *h,
6782 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6783 struct srvsvc_NetRemoteTODInfo **_info /* [out] [ref] */)
6785 struct tevent_req *req;
6786 struct dcerpc_srvsvc_NetRemoteTOD_state *state;
6787 struct tevent_req *subreq;
6789 req = tevent_req_create(mem_ctx, &state,
6790 struct dcerpc_srvsvc_NetRemoteTOD_state);
6794 state->out_mem_ctx = NULL;
6797 state->orig.in.server_unc = _server_unc;
6799 /* Out parameters */
6800 state->orig.out.info = _info;
6803 ZERO_STRUCT(state->orig.out.result);
6805 state->out_mem_ctx = talloc_named_const(state, 0,
6806 "dcerpc_srvsvc_NetRemoteTOD_out_memory");
6807 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6808 return tevent_req_post(req, ev);
6811 /* make a temporary copy, that we pass to the dispatch function */
6812 state->tmp = state->orig;
6814 subreq = dcerpc_srvsvc_NetRemoteTOD_r_send(state, ev, h, &state->tmp);
6815 if (tevent_req_nomem(subreq, req)) {
6816 return tevent_req_post(req, ev);
6818 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetRemoteTOD_done, req);
6822 static void dcerpc_srvsvc_NetRemoteTOD_done(struct tevent_req *subreq)
6824 struct tevent_req *req = tevent_req_callback_data(
6825 subreq, struct tevent_req);
6826 struct dcerpc_srvsvc_NetRemoteTOD_state *state = tevent_req_data(
6827 req, struct dcerpc_srvsvc_NetRemoteTOD_state);
6829 TALLOC_CTX *mem_ctx;
6831 if (state->out_mem_ctx) {
6832 mem_ctx = state->out_mem_ctx;
6837 status = dcerpc_srvsvc_NetRemoteTOD_r_recv(subreq, mem_ctx);
6838 TALLOC_FREE(subreq);
6839 if (!NT_STATUS_IS_OK(status)) {
6840 tevent_req_nterror(req, status);
6844 /* Copy out parameters */
6845 *state->orig.out.info = *state->tmp.out.info;
6848 state->orig.out.result = state->tmp.out.result;
6850 /* Reset temporary structure */
6851 ZERO_STRUCT(state->tmp);
6853 tevent_req_done(req);
6856 NTSTATUS dcerpc_srvsvc_NetRemoteTOD_recv(struct tevent_req *req,
6857 TALLOC_CTX *mem_ctx,
6860 struct dcerpc_srvsvc_NetRemoteTOD_state *state = tevent_req_data(
6861 req, struct dcerpc_srvsvc_NetRemoteTOD_state);
6864 if (tevent_req_is_nterror(req, &status)) {
6865 tevent_req_received(req);
6869 /* Steal possible out parameters to the callers context */
6870 talloc_steal(mem_ctx, state->out_mem_ctx);
6873 *result = state->orig.out.result;
6875 tevent_req_received(req);
6876 return NT_STATUS_OK;
6879 NTSTATUS dcerpc_srvsvc_NetRemoteTOD(struct dcerpc_binding_handle *h,
6880 TALLOC_CTX *mem_ctx,
6881 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
6882 struct srvsvc_NetRemoteTODInfo **_info /* [out] [ref] */,
6885 struct srvsvc_NetRemoteTOD r;
6889 r.in.server_unc = _server_unc;
6891 status = dcerpc_srvsvc_NetRemoteTOD_r(h, mem_ctx, &r);
6892 if (!NT_STATUS_IS_OK(status)) {
6896 /* Return variables */
6897 *_info = *r.out.info;
6900 *result = r.out.result;
6902 return NT_STATUS_OK;
6905 struct dcerpc_srvsvc_NetSetServiceBits_r_state {
6906 TALLOC_CTX *out_mem_ctx;
6909 static void dcerpc_srvsvc_NetSetServiceBits_r_done(struct tevent_req *subreq);
6911 struct tevent_req *dcerpc_srvsvc_NetSetServiceBits_r_send(TALLOC_CTX *mem_ctx,
6912 struct tevent_context *ev,
6913 struct dcerpc_binding_handle *h,
6914 struct srvsvc_NetSetServiceBits *r)
6916 struct tevent_req *req;
6917 struct dcerpc_srvsvc_NetSetServiceBits_r_state *state;
6918 struct tevent_req *subreq;
6920 req = tevent_req_create(mem_ctx, &state,
6921 struct dcerpc_srvsvc_NetSetServiceBits_r_state);
6926 state->out_mem_ctx = NULL;
6927 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6928 NULL, &ndr_table_srvsvc,
6929 NDR_SRVSVC_NETSETSERVICEBITS, state, r);
6930 if (tevent_req_nomem(subreq, req)) {
6931 return tevent_req_post(req, ev);
6933 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSetServiceBits_r_done, req);
6938 static void dcerpc_srvsvc_NetSetServiceBits_r_done(struct tevent_req *subreq)
6940 struct tevent_req *req =
6941 tevent_req_callback_data(subreq,
6945 status = dcerpc_binding_handle_call_recv(subreq);
6946 if (!NT_STATUS_IS_OK(status)) {
6947 tevent_req_nterror(req, status);
6951 tevent_req_done(req);
6954 NTSTATUS dcerpc_srvsvc_NetSetServiceBits_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6956 struct dcerpc_srvsvc_NetSetServiceBits_r_state *state =
6957 tevent_req_data(req,
6958 struct dcerpc_srvsvc_NetSetServiceBits_r_state);
6961 if (tevent_req_is_nterror(req, &status)) {
6962 tevent_req_received(req);
6966 talloc_steal(mem_ctx, state->out_mem_ctx);
6968 tevent_req_received(req);
6969 return NT_STATUS_OK;
6972 NTSTATUS dcerpc_srvsvc_NetSetServiceBits_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetSetServiceBits *r)
6976 status = dcerpc_binding_handle_call(h,
6977 NULL, &ndr_table_srvsvc,
6978 NDR_SRVSVC_NETSETSERVICEBITS, mem_ctx, r);
6983 NTSTATUS dcerpc_srvsvc_NetSetServiceBits_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetSetServiceBits *r)
6987 status = dcerpc_srvsvc_NetSetServiceBits_r(p->binding_handle, mem_ctx, r);
6989 if (NT_STATUS_IS_RPC(status)) {
6990 status = NT_STATUS_NET_WRITE_FAULT;
6996 struct dcerpc_srvsvc_NetSetServiceBits_state {
6997 struct srvsvc_NetSetServiceBits orig;
6998 struct srvsvc_NetSetServiceBits tmp;
6999 TALLOC_CTX *out_mem_ctx;
7002 static void dcerpc_srvsvc_NetSetServiceBits_done(struct tevent_req *subreq);
7004 struct tevent_req *dcerpc_srvsvc_NetSetServiceBits_send(TALLOC_CTX *mem_ctx,
7005 struct tevent_context *ev,
7006 struct dcerpc_binding_handle *h,
7007 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7008 const char *_transport /* [in] [unique,charset(UTF16)] */,
7009 uint32_t _servicebits /* [in] */,
7010 uint32_t _updateimmediately /* [in] */)
7012 struct tevent_req *req;
7013 struct dcerpc_srvsvc_NetSetServiceBits_state *state;
7014 struct tevent_req *subreq;
7016 req = tevent_req_create(mem_ctx, &state,
7017 struct dcerpc_srvsvc_NetSetServiceBits_state);
7021 state->out_mem_ctx = NULL;
7024 state->orig.in.server_unc = _server_unc;
7025 state->orig.in.transport = _transport;
7026 state->orig.in.servicebits = _servicebits;
7027 state->orig.in.updateimmediately = _updateimmediately;
7029 /* Out parameters */
7032 ZERO_STRUCT(state->orig.out.result);
7034 /* make a temporary copy, that we pass to the dispatch function */
7035 state->tmp = state->orig;
7037 subreq = dcerpc_srvsvc_NetSetServiceBits_r_send(state, ev, h, &state->tmp);
7038 if (tevent_req_nomem(subreq, req)) {
7039 return tevent_req_post(req, ev);
7041 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSetServiceBits_done, req);
7045 static void dcerpc_srvsvc_NetSetServiceBits_done(struct tevent_req *subreq)
7047 struct tevent_req *req = tevent_req_callback_data(
7048 subreq, struct tevent_req);
7049 struct dcerpc_srvsvc_NetSetServiceBits_state *state = tevent_req_data(
7050 req, struct dcerpc_srvsvc_NetSetServiceBits_state);
7052 TALLOC_CTX *mem_ctx;
7054 if (state->out_mem_ctx) {
7055 mem_ctx = state->out_mem_ctx;
7060 status = dcerpc_srvsvc_NetSetServiceBits_r_recv(subreq, mem_ctx);
7061 TALLOC_FREE(subreq);
7062 if (!NT_STATUS_IS_OK(status)) {
7063 tevent_req_nterror(req, status);
7067 /* Copy out parameters */
7070 state->orig.out.result = state->tmp.out.result;
7072 /* Reset temporary structure */
7073 ZERO_STRUCT(state->tmp);
7075 tevent_req_done(req);
7078 NTSTATUS dcerpc_srvsvc_NetSetServiceBits_recv(struct tevent_req *req,
7079 TALLOC_CTX *mem_ctx,
7082 struct dcerpc_srvsvc_NetSetServiceBits_state *state = tevent_req_data(
7083 req, struct dcerpc_srvsvc_NetSetServiceBits_state);
7086 if (tevent_req_is_nterror(req, &status)) {
7087 tevent_req_received(req);
7091 /* Steal possible out parameters to the callers context */
7092 talloc_steal(mem_ctx, state->out_mem_ctx);
7095 *result = state->orig.out.result;
7097 tevent_req_received(req);
7098 return NT_STATUS_OK;
7101 NTSTATUS dcerpc_srvsvc_NetSetServiceBits(struct dcerpc_binding_handle *h,
7102 TALLOC_CTX *mem_ctx,
7103 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7104 const char *_transport /* [in] [unique,charset(UTF16)] */,
7105 uint32_t _servicebits /* [in] */,
7106 uint32_t _updateimmediately /* [in] */,
7109 struct srvsvc_NetSetServiceBits r;
7113 r.in.server_unc = _server_unc;
7114 r.in.transport = _transport;
7115 r.in.servicebits = _servicebits;
7116 r.in.updateimmediately = _updateimmediately;
7118 status = dcerpc_srvsvc_NetSetServiceBits_r(h, mem_ctx, &r);
7119 if (!NT_STATUS_IS_OK(status)) {
7123 /* Return variables */
7126 *result = r.out.result;
7128 return NT_STATUS_OK;
7131 struct dcerpc_srvsvc_NetPathType_r_state {
7132 TALLOC_CTX *out_mem_ctx;
7135 static void dcerpc_srvsvc_NetPathType_r_done(struct tevent_req *subreq);
7137 struct tevent_req *dcerpc_srvsvc_NetPathType_r_send(TALLOC_CTX *mem_ctx,
7138 struct tevent_context *ev,
7139 struct dcerpc_binding_handle *h,
7140 struct srvsvc_NetPathType *r)
7142 struct tevent_req *req;
7143 struct dcerpc_srvsvc_NetPathType_r_state *state;
7144 struct tevent_req *subreq;
7146 req = tevent_req_create(mem_ctx, &state,
7147 struct dcerpc_srvsvc_NetPathType_r_state);
7152 state->out_mem_ctx = talloc_new(state);
7153 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7154 return tevent_req_post(req, ev);
7157 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7158 NULL, &ndr_table_srvsvc,
7159 NDR_SRVSVC_NETPATHTYPE, state->out_mem_ctx, r);
7160 if (tevent_req_nomem(subreq, req)) {
7161 return tevent_req_post(req, ev);
7163 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPathType_r_done, req);
7168 static void dcerpc_srvsvc_NetPathType_r_done(struct tevent_req *subreq)
7170 struct tevent_req *req =
7171 tevent_req_callback_data(subreq,
7175 status = dcerpc_binding_handle_call_recv(subreq);
7176 if (!NT_STATUS_IS_OK(status)) {
7177 tevent_req_nterror(req, status);
7181 tevent_req_done(req);
7184 NTSTATUS dcerpc_srvsvc_NetPathType_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7186 struct dcerpc_srvsvc_NetPathType_r_state *state =
7187 tevent_req_data(req,
7188 struct dcerpc_srvsvc_NetPathType_r_state);
7191 if (tevent_req_is_nterror(req, &status)) {
7192 tevent_req_received(req);
7196 talloc_steal(mem_ctx, state->out_mem_ctx);
7198 tevent_req_received(req);
7199 return NT_STATUS_OK;
7202 NTSTATUS dcerpc_srvsvc_NetPathType_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetPathType *r)
7206 status = dcerpc_binding_handle_call(h,
7207 NULL, &ndr_table_srvsvc,
7208 NDR_SRVSVC_NETPATHTYPE, mem_ctx, r);
7213 NTSTATUS dcerpc_srvsvc_NetPathType_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetPathType *r)
7217 status = dcerpc_srvsvc_NetPathType_r(p->binding_handle, mem_ctx, r);
7219 if (NT_STATUS_IS_RPC(status)) {
7220 status = NT_STATUS_NET_WRITE_FAULT;
7226 struct dcerpc_srvsvc_NetPathType_state {
7227 struct srvsvc_NetPathType orig;
7228 struct srvsvc_NetPathType tmp;
7229 TALLOC_CTX *out_mem_ctx;
7232 static void dcerpc_srvsvc_NetPathType_done(struct tevent_req *subreq);
7234 struct tevent_req *dcerpc_srvsvc_NetPathType_send(TALLOC_CTX *mem_ctx,
7235 struct tevent_context *ev,
7236 struct dcerpc_binding_handle *h,
7237 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7238 const char *_path /* [in] [charset(UTF16)] */,
7239 uint32_t _pathflags /* [in] */,
7240 uint32_t *_pathtype /* [out] [ref] */)
7242 struct tevent_req *req;
7243 struct dcerpc_srvsvc_NetPathType_state *state;
7244 struct tevent_req *subreq;
7246 req = tevent_req_create(mem_ctx, &state,
7247 struct dcerpc_srvsvc_NetPathType_state);
7251 state->out_mem_ctx = NULL;
7254 state->orig.in.server_unc = _server_unc;
7255 state->orig.in.path = _path;
7256 state->orig.in.pathflags = _pathflags;
7258 /* Out parameters */
7259 state->orig.out.pathtype = _pathtype;
7262 ZERO_STRUCT(state->orig.out.result);
7264 state->out_mem_ctx = talloc_named_const(state, 0,
7265 "dcerpc_srvsvc_NetPathType_out_memory");
7266 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7267 return tevent_req_post(req, ev);
7270 /* make a temporary copy, that we pass to the dispatch function */
7271 state->tmp = state->orig;
7273 subreq = dcerpc_srvsvc_NetPathType_r_send(state, ev, h, &state->tmp);
7274 if (tevent_req_nomem(subreq, req)) {
7275 return tevent_req_post(req, ev);
7277 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPathType_done, req);
7281 static void dcerpc_srvsvc_NetPathType_done(struct tevent_req *subreq)
7283 struct tevent_req *req = tevent_req_callback_data(
7284 subreq, struct tevent_req);
7285 struct dcerpc_srvsvc_NetPathType_state *state = tevent_req_data(
7286 req, struct dcerpc_srvsvc_NetPathType_state);
7288 TALLOC_CTX *mem_ctx;
7290 if (state->out_mem_ctx) {
7291 mem_ctx = state->out_mem_ctx;
7296 status = dcerpc_srvsvc_NetPathType_r_recv(subreq, mem_ctx);
7297 TALLOC_FREE(subreq);
7298 if (!NT_STATUS_IS_OK(status)) {
7299 tevent_req_nterror(req, status);
7303 /* Copy out parameters */
7304 *state->orig.out.pathtype = *state->tmp.out.pathtype;
7307 state->orig.out.result = state->tmp.out.result;
7309 /* Reset temporary structure */
7310 ZERO_STRUCT(state->tmp);
7312 tevent_req_done(req);
7315 NTSTATUS dcerpc_srvsvc_NetPathType_recv(struct tevent_req *req,
7316 TALLOC_CTX *mem_ctx,
7319 struct dcerpc_srvsvc_NetPathType_state *state = tevent_req_data(
7320 req, struct dcerpc_srvsvc_NetPathType_state);
7323 if (tevent_req_is_nterror(req, &status)) {
7324 tevent_req_received(req);
7328 /* Steal possible out parameters to the callers context */
7329 talloc_steal(mem_ctx, state->out_mem_ctx);
7332 *result = state->orig.out.result;
7334 tevent_req_received(req);
7335 return NT_STATUS_OK;
7338 NTSTATUS dcerpc_srvsvc_NetPathType(struct dcerpc_binding_handle *h,
7339 TALLOC_CTX *mem_ctx,
7340 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7341 const char *_path /* [in] [charset(UTF16)] */,
7342 uint32_t _pathflags /* [in] */,
7343 uint32_t *_pathtype /* [out] [ref] */,
7346 struct srvsvc_NetPathType r;
7350 r.in.server_unc = _server_unc;
7352 r.in.pathflags = _pathflags;
7354 status = dcerpc_srvsvc_NetPathType_r(h, mem_ctx, &r);
7355 if (!NT_STATUS_IS_OK(status)) {
7359 /* Return variables */
7360 *_pathtype = *r.out.pathtype;
7363 *result = r.out.result;
7365 return NT_STATUS_OK;
7368 struct dcerpc_srvsvc_NetPathCanonicalize_r_state {
7369 TALLOC_CTX *out_mem_ctx;
7372 static void dcerpc_srvsvc_NetPathCanonicalize_r_done(struct tevent_req *subreq);
7374 struct tevent_req *dcerpc_srvsvc_NetPathCanonicalize_r_send(TALLOC_CTX *mem_ctx,
7375 struct tevent_context *ev,
7376 struct dcerpc_binding_handle *h,
7377 struct srvsvc_NetPathCanonicalize *r)
7379 struct tevent_req *req;
7380 struct dcerpc_srvsvc_NetPathCanonicalize_r_state *state;
7381 struct tevent_req *subreq;
7383 req = tevent_req_create(mem_ctx, &state,
7384 struct dcerpc_srvsvc_NetPathCanonicalize_r_state);
7389 state->out_mem_ctx = talloc_new(state);
7390 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7391 return tevent_req_post(req, ev);
7394 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7395 NULL, &ndr_table_srvsvc,
7396 NDR_SRVSVC_NETPATHCANONICALIZE, state->out_mem_ctx, r);
7397 if (tevent_req_nomem(subreq, req)) {
7398 return tevent_req_post(req, ev);
7400 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPathCanonicalize_r_done, req);
7405 static void dcerpc_srvsvc_NetPathCanonicalize_r_done(struct tevent_req *subreq)
7407 struct tevent_req *req =
7408 tevent_req_callback_data(subreq,
7412 status = dcerpc_binding_handle_call_recv(subreq);
7413 if (!NT_STATUS_IS_OK(status)) {
7414 tevent_req_nterror(req, status);
7418 tevent_req_done(req);
7421 NTSTATUS dcerpc_srvsvc_NetPathCanonicalize_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7423 struct dcerpc_srvsvc_NetPathCanonicalize_r_state *state =
7424 tevent_req_data(req,
7425 struct dcerpc_srvsvc_NetPathCanonicalize_r_state);
7428 if (tevent_req_is_nterror(req, &status)) {
7429 tevent_req_received(req);
7433 talloc_steal(mem_ctx, state->out_mem_ctx);
7435 tevent_req_received(req);
7436 return NT_STATUS_OK;
7439 NTSTATUS dcerpc_srvsvc_NetPathCanonicalize_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetPathCanonicalize *r)
7443 status = dcerpc_binding_handle_call(h,
7444 NULL, &ndr_table_srvsvc,
7445 NDR_SRVSVC_NETPATHCANONICALIZE, mem_ctx, r);
7450 NTSTATUS dcerpc_srvsvc_NetPathCanonicalize_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetPathCanonicalize *r)
7454 status = dcerpc_srvsvc_NetPathCanonicalize_r(p->binding_handle, mem_ctx, r);
7456 if (NT_STATUS_IS_RPC(status)) {
7457 status = NT_STATUS_NET_WRITE_FAULT;
7463 struct dcerpc_srvsvc_NetPathCanonicalize_state {
7464 struct srvsvc_NetPathCanonicalize orig;
7465 struct srvsvc_NetPathCanonicalize tmp;
7466 TALLOC_CTX *out_mem_ctx;
7469 static void dcerpc_srvsvc_NetPathCanonicalize_done(struct tevent_req *subreq);
7471 struct tevent_req *dcerpc_srvsvc_NetPathCanonicalize_send(TALLOC_CTX *mem_ctx,
7472 struct tevent_context *ev,
7473 struct dcerpc_binding_handle *h,
7474 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7475 const char *_path /* [in] [charset(UTF16)] */,
7476 uint8_t *_can_path /* [out] [size_is(maxbuf)] */,
7477 uint32_t _maxbuf /* [in] */,
7478 const char *_prefix /* [in] [charset(UTF16)] */,
7479 uint32_t *_pathtype /* [in,out] [ref] */,
7480 uint32_t _pathflags /* [in] */)
7482 struct tevent_req *req;
7483 struct dcerpc_srvsvc_NetPathCanonicalize_state *state;
7484 struct tevent_req *subreq;
7486 req = tevent_req_create(mem_ctx, &state,
7487 struct dcerpc_srvsvc_NetPathCanonicalize_state);
7491 state->out_mem_ctx = NULL;
7494 state->orig.in.server_unc = _server_unc;
7495 state->orig.in.path = _path;
7496 state->orig.in.maxbuf = _maxbuf;
7497 state->orig.in.prefix = _prefix;
7498 state->orig.in.pathtype = _pathtype;
7499 state->orig.in.pathflags = _pathflags;
7501 /* Out parameters */
7502 state->orig.out.can_path = _can_path;
7503 state->orig.out.pathtype = _pathtype;
7506 ZERO_STRUCT(state->orig.out.result);
7508 state->out_mem_ctx = talloc_named_const(state, 0,
7509 "dcerpc_srvsvc_NetPathCanonicalize_out_memory");
7510 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7511 return tevent_req_post(req, ev);
7514 /* make a temporary copy, that we pass to the dispatch function */
7515 state->tmp = state->orig;
7517 subreq = dcerpc_srvsvc_NetPathCanonicalize_r_send(state, ev, h, &state->tmp);
7518 if (tevent_req_nomem(subreq, req)) {
7519 return tevent_req_post(req, ev);
7521 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPathCanonicalize_done, req);
7525 static void dcerpc_srvsvc_NetPathCanonicalize_done(struct tevent_req *subreq)
7527 struct tevent_req *req = tevent_req_callback_data(
7528 subreq, struct tevent_req);
7529 struct dcerpc_srvsvc_NetPathCanonicalize_state *state = tevent_req_data(
7530 req, struct dcerpc_srvsvc_NetPathCanonicalize_state);
7532 TALLOC_CTX *mem_ctx;
7534 if (state->out_mem_ctx) {
7535 mem_ctx = state->out_mem_ctx;
7540 status = dcerpc_srvsvc_NetPathCanonicalize_r_recv(subreq, mem_ctx);
7541 TALLOC_FREE(subreq);
7542 if (!NT_STATUS_IS_OK(status)) {
7543 tevent_req_nterror(req, status);
7547 /* Copy out parameters */
7549 size_t _copy_len_can_path;
7550 _copy_len_can_path = state->tmp.in.maxbuf;
7551 memcpy(state->orig.out.can_path, state->tmp.out.can_path, _copy_len_can_path * sizeof(*state->orig.out.can_path));
7553 *state->orig.out.pathtype = *state->tmp.out.pathtype;
7556 state->orig.out.result = state->tmp.out.result;
7558 /* Reset temporary structure */
7559 ZERO_STRUCT(state->tmp);
7561 tevent_req_done(req);
7564 NTSTATUS dcerpc_srvsvc_NetPathCanonicalize_recv(struct tevent_req *req,
7565 TALLOC_CTX *mem_ctx,
7568 struct dcerpc_srvsvc_NetPathCanonicalize_state *state = tevent_req_data(
7569 req, struct dcerpc_srvsvc_NetPathCanonicalize_state);
7572 if (tevent_req_is_nterror(req, &status)) {
7573 tevent_req_received(req);
7577 /* Steal possible out parameters to the callers context */
7578 talloc_steal(mem_ctx, state->out_mem_ctx);
7581 *result = state->orig.out.result;
7583 tevent_req_received(req);
7584 return NT_STATUS_OK;
7587 NTSTATUS dcerpc_srvsvc_NetPathCanonicalize(struct dcerpc_binding_handle *h,
7588 TALLOC_CTX *mem_ctx,
7589 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7590 const char *_path /* [in] [charset(UTF16)] */,
7591 uint8_t *_can_path /* [out] [size_is(maxbuf)] */,
7592 uint32_t _maxbuf /* [in] */,
7593 const char *_prefix /* [in] [charset(UTF16)] */,
7594 uint32_t *_pathtype /* [in,out] [ref] */,
7595 uint32_t _pathflags /* [in] */,
7598 struct srvsvc_NetPathCanonicalize r;
7602 r.in.server_unc = _server_unc;
7604 r.in.maxbuf = _maxbuf;
7605 r.in.prefix = _prefix;
7606 r.in.pathtype = _pathtype;
7607 r.in.pathflags = _pathflags;
7609 status = dcerpc_srvsvc_NetPathCanonicalize_r(h, mem_ctx, &r);
7610 if (!NT_STATUS_IS_OK(status)) {
7614 /* Return variables */
7616 size_t _copy_len_can_path;
7617 _copy_len_can_path = r.in.maxbuf;
7618 memcpy(_can_path, r.out.can_path, _copy_len_can_path * sizeof(*_can_path));
7620 *_pathtype = *r.out.pathtype;
7623 *result = r.out.result;
7625 return NT_STATUS_OK;
7628 struct dcerpc_srvsvc_NetPathCompare_r_state {
7629 TALLOC_CTX *out_mem_ctx;
7632 static void dcerpc_srvsvc_NetPathCompare_r_done(struct tevent_req *subreq);
7634 struct tevent_req *dcerpc_srvsvc_NetPathCompare_r_send(TALLOC_CTX *mem_ctx,
7635 struct tevent_context *ev,
7636 struct dcerpc_binding_handle *h,
7637 struct srvsvc_NetPathCompare *r)
7639 struct tevent_req *req;
7640 struct dcerpc_srvsvc_NetPathCompare_r_state *state;
7641 struct tevent_req *subreq;
7643 req = tevent_req_create(mem_ctx, &state,
7644 struct dcerpc_srvsvc_NetPathCompare_r_state);
7649 state->out_mem_ctx = NULL;
7650 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7651 NULL, &ndr_table_srvsvc,
7652 NDR_SRVSVC_NETPATHCOMPARE, state, r);
7653 if (tevent_req_nomem(subreq, req)) {
7654 return tevent_req_post(req, ev);
7656 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPathCompare_r_done, req);
7661 static void dcerpc_srvsvc_NetPathCompare_r_done(struct tevent_req *subreq)
7663 struct tevent_req *req =
7664 tevent_req_callback_data(subreq,
7668 status = dcerpc_binding_handle_call_recv(subreq);
7669 if (!NT_STATUS_IS_OK(status)) {
7670 tevent_req_nterror(req, status);
7674 tevent_req_done(req);
7677 NTSTATUS dcerpc_srvsvc_NetPathCompare_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7679 struct dcerpc_srvsvc_NetPathCompare_r_state *state =
7680 tevent_req_data(req,
7681 struct dcerpc_srvsvc_NetPathCompare_r_state);
7684 if (tevent_req_is_nterror(req, &status)) {
7685 tevent_req_received(req);
7689 talloc_steal(mem_ctx, state->out_mem_ctx);
7691 tevent_req_received(req);
7692 return NT_STATUS_OK;
7695 NTSTATUS dcerpc_srvsvc_NetPathCompare_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetPathCompare *r)
7699 status = dcerpc_binding_handle_call(h,
7700 NULL, &ndr_table_srvsvc,
7701 NDR_SRVSVC_NETPATHCOMPARE, mem_ctx, r);
7706 NTSTATUS dcerpc_srvsvc_NetPathCompare_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetPathCompare *r)
7710 status = dcerpc_srvsvc_NetPathCompare_r(p->binding_handle, mem_ctx, r);
7712 if (NT_STATUS_IS_RPC(status)) {
7713 status = NT_STATUS_NET_WRITE_FAULT;
7719 struct dcerpc_srvsvc_NetPathCompare_state {
7720 struct srvsvc_NetPathCompare orig;
7721 struct srvsvc_NetPathCompare tmp;
7722 TALLOC_CTX *out_mem_ctx;
7725 static void dcerpc_srvsvc_NetPathCompare_done(struct tevent_req *subreq);
7727 struct tevent_req *dcerpc_srvsvc_NetPathCompare_send(TALLOC_CTX *mem_ctx,
7728 struct tevent_context *ev,
7729 struct dcerpc_binding_handle *h,
7730 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7731 const char *_path1 /* [in] [charset(UTF16)] */,
7732 const char *_path2 /* [in] [charset(UTF16)] */,
7733 uint32_t _pathtype /* [in] */,
7734 uint32_t _pathflags /* [in] */)
7736 struct tevent_req *req;
7737 struct dcerpc_srvsvc_NetPathCompare_state *state;
7738 struct tevent_req *subreq;
7740 req = tevent_req_create(mem_ctx, &state,
7741 struct dcerpc_srvsvc_NetPathCompare_state);
7745 state->out_mem_ctx = NULL;
7748 state->orig.in.server_unc = _server_unc;
7749 state->orig.in.path1 = _path1;
7750 state->orig.in.path2 = _path2;
7751 state->orig.in.pathtype = _pathtype;
7752 state->orig.in.pathflags = _pathflags;
7754 /* Out parameters */
7757 ZERO_STRUCT(state->orig.out.result);
7759 /* make a temporary copy, that we pass to the dispatch function */
7760 state->tmp = state->orig;
7762 subreq = dcerpc_srvsvc_NetPathCompare_r_send(state, ev, h, &state->tmp);
7763 if (tevent_req_nomem(subreq, req)) {
7764 return tevent_req_post(req, ev);
7766 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPathCompare_done, req);
7770 static void dcerpc_srvsvc_NetPathCompare_done(struct tevent_req *subreq)
7772 struct tevent_req *req = tevent_req_callback_data(
7773 subreq, struct tevent_req);
7774 struct dcerpc_srvsvc_NetPathCompare_state *state = tevent_req_data(
7775 req, struct dcerpc_srvsvc_NetPathCompare_state);
7777 TALLOC_CTX *mem_ctx;
7779 if (state->out_mem_ctx) {
7780 mem_ctx = state->out_mem_ctx;
7785 status = dcerpc_srvsvc_NetPathCompare_r_recv(subreq, mem_ctx);
7786 TALLOC_FREE(subreq);
7787 if (!NT_STATUS_IS_OK(status)) {
7788 tevent_req_nterror(req, status);
7792 /* Copy out parameters */
7795 state->orig.out.result = state->tmp.out.result;
7797 /* Reset temporary structure */
7798 ZERO_STRUCT(state->tmp);
7800 tevent_req_done(req);
7803 NTSTATUS dcerpc_srvsvc_NetPathCompare_recv(struct tevent_req *req,
7804 TALLOC_CTX *mem_ctx,
7807 struct dcerpc_srvsvc_NetPathCompare_state *state = tevent_req_data(
7808 req, struct dcerpc_srvsvc_NetPathCompare_state);
7811 if (tevent_req_is_nterror(req, &status)) {
7812 tevent_req_received(req);
7816 /* Steal possible out parameters to the callers context */
7817 talloc_steal(mem_ctx, state->out_mem_ctx);
7820 *result = state->orig.out.result;
7822 tevent_req_received(req);
7823 return NT_STATUS_OK;
7826 NTSTATUS dcerpc_srvsvc_NetPathCompare(struct dcerpc_binding_handle *h,
7827 TALLOC_CTX *mem_ctx,
7828 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7829 const char *_path1 /* [in] [charset(UTF16)] */,
7830 const char *_path2 /* [in] [charset(UTF16)] */,
7831 uint32_t _pathtype /* [in] */,
7832 uint32_t _pathflags /* [in] */,
7835 struct srvsvc_NetPathCompare r;
7839 r.in.server_unc = _server_unc;
7840 r.in.path1 = _path1;
7841 r.in.path2 = _path2;
7842 r.in.pathtype = _pathtype;
7843 r.in.pathflags = _pathflags;
7845 status = dcerpc_srvsvc_NetPathCompare_r(h, mem_ctx, &r);
7846 if (!NT_STATUS_IS_OK(status)) {
7850 /* Return variables */
7853 *result = r.out.result;
7855 return NT_STATUS_OK;
7858 struct dcerpc_srvsvc_NetNameValidate_r_state {
7859 TALLOC_CTX *out_mem_ctx;
7862 static void dcerpc_srvsvc_NetNameValidate_r_done(struct tevent_req *subreq);
7864 struct tevent_req *dcerpc_srvsvc_NetNameValidate_r_send(TALLOC_CTX *mem_ctx,
7865 struct tevent_context *ev,
7866 struct dcerpc_binding_handle *h,
7867 struct srvsvc_NetNameValidate *r)
7869 struct tevent_req *req;
7870 struct dcerpc_srvsvc_NetNameValidate_r_state *state;
7871 struct tevent_req *subreq;
7873 req = tevent_req_create(mem_ctx, &state,
7874 struct dcerpc_srvsvc_NetNameValidate_r_state);
7879 state->out_mem_ctx = NULL;
7880 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7881 NULL, &ndr_table_srvsvc,
7882 NDR_SRVSVC_NETNAMEVALIDATE, state, r);
7883 if (tevent_req_nomem(subreq, req)) {
7884 return tevent_req_post(req, ev);
7886 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetNameValidate_r_done, req);
7891 static void dcerpc_srvsvc_NetNameValidate_r_done(struct tevent_req *subreq)
7893 struct tevent_req *req =
7894 tevent_req_callback_data(subreq,
7898 status = dcerpc_binding_handle_call_recv(subreq);
7899 if (!NT_STATUS_IS_OK(status)) {
7900 tevent_req_nterror(req, status);
7904 tevent_req_done(req);
7907 NTSTATUS dcerpc_srvsvc_NetNameValidate_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7909 struct dcerpc_srvsvc_NetNameValidate_r_state *state =
7910 tevent_req_data(req,
7911 struct dcerpc_srvsvc_NetNameValidate_r_state);
7914 if (tevent_req_is_nterror(req, &status)) {
7915 tevent_req_received(req);
7919 talloc_steal(mem_ctx, state->out_mem_ctx);
7921 tevent_req_received(req);
7922 return NT_STATUS_OK;
7925 NTSTATUS dcerpc_srvsvc_NetNameValidate_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetNameValidate *r)
7929 status = dcerpc_binding_handle_call(h,
7930 NULL, &ndr_table_srvsvc,
7931 NDR_SRVSVC_NETNAMEVALIDATE, mem_ctx, r);
7936 NTSTATUS dcerpc_srvsvc_NetNameValidate_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetNameValidate *r)
7940 status = dcerpc_srvsvc_NetNameValidate_r(p->binding_handle, mem_ctx, r);
7942 if (NT_STATUS_IS_RPC(status)) {
7943 status = NT_STATUS_NET_WRITE_FAULT;
7949 struct dcerpc_srvsvc_NetNameValidate_state {
7950 struct srvsvc_NetNameValidate orig;
7951 struct srvsvc_NetNameValidate tmp;
7952 TALLOC_CTX *out_mem_ctx;
7955 static void dcerpc_srvsvc_NetNameValidate_done(struct tevent_req *subreq);
7957 struct tevent_req *dcerpc_srvsvc_NetNameValidate_send(TALLOC_CTX *mem_ctx,
7958 struct tevent_context *ev,
7959 struct dcerpc_binding_handle *h,
7960 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
7961 const char *_name /* [in] [charset(UTF16)] */,
7962 uint32_t _name_type /* [in] */,
7963 uint32_t _flags /* [in] */)
7965 struct tevent_req *req;
7966 struct dcerpc_srvsvc_NetNameValidate_state *state;
7967 struct tevent_req *subreq;
7969 req = tevent_req_create(mem_ctx, &state,
7970 struct dcerpc_srvsvc_NetNameValidate_state);
7974 state->out_mem_ctx = NULL;
7977 state->orig.in.server_unc = _server_unc;
7978 state->orig.in.name = _name;
7979 state->orig.in.name_type = _name_type;
7980 state->orig.in.flags = _flags;
7982 /* Out parameters */
7985 ZERO_STRUCT(state->orig.out.result);
7987 /* make a temporary copy, that we pass to the dispatch function */
7988 state->tmp = state->orig;
7990 subreq = dcerpc_srvsvc_NetNameValidate_r_send(state, ev, h, &state->tmp);
7991 if (tevent_req_nomem(subreq, req)) {
7992 return tevent_req_post(req, ev);
7994 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetNameValidate_done, req);
7998 static void dcerpc_srvsvc_NetNameValidate_done(struct tevent_req *subreq)
8000 struct tevent_req *req = tevent_req_callback_data(
8001 subreq, struct tevent_req);
8002 struct dcerpc_srvsvc_NetNameValidate_state *state = tevent_req_data(
8003 req, struct dcerpc_srvsvc_NetNameValidate_state);
8005 TALLOC_CTX *mem_ctx;
8007 if (state->out_mem_ctx) {
8008 mem_ctx = state->out_mem_ctx;
8013 status = dcerpc_srvsvc_NetNameValidate_r_recv(subreq, mem_ctx);
8014 TALLOC_FREE(subreq);
8015 if (!NT_STATUS_IS_OK(status)) {
8016 tevent_req_nterror(req, status);
8020 /* Copy out parameters */
8023 state->orig.out.result = state->tmp.out.result;
8025 /* Reset temporary structure */
8026 ZERO_STRUCT(state->tmp);
8028 tevent_req_done(req);
8031 NTSTATUS dcerpc_srvsvc_NetNameValidate_recv(struct tevent_req *req,
8032 TALLOC_CTX *mem_ctx,
8035 struct dcerpc_srvsvc_NetNameValidate_state *state = tevent_req_data(
8036 req, struct dcerpc_srvsvc_NetNameValidate_state);
8039 if (tevent_req_is_nterror(req, &status)) {
8040 tevent_req_received(req);
8044 /* Steal possible out parameters to the callers context */
8045 talloc_steal(mem_ctx, state->out_mem_ctx);
8048 *result = state->orig.out.result;
8050 tevent_req_received(req);
8051 return NT_STATUS_OK;
8054 NTSTATUS dcerpc_srvsvc_NetNameValidate(struct dcerpc_binding_handle *h,
8055 TALLOC_CTX *mem_ctx,
8056 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
8057 const char *_name /* [in] [charset(UTF16)] */,
8058 uint32_t _name_type /* [in] */,
8059 uint32_t _flags /* [in] */,
8062 struct srvsvc_NetNameValidate r;
8066 r.in.server_unc = _server_unc;
8068 r.in.name_type = _name_type;
8069 r.in.flags = _flags;
8071 status = dcerpc_srvsvc_NetNameValidate_r(h, mem_ctx, &r);
8072 if (!NT_STATUS_IS_OK(status)) {
8076 /* Return variables */
8079 *result = r.out.result;
8081 return NT_STATUS_OK;
8084 struct dcerpc_srvsvc_NetPRNameCompare_r_state {
8085 TALLOC_CTX *out_mem_ctx;
8088 static void dcerpc_srvsvc_NetPRNameCompare_r_done(struct tevent_req *subreq);
8090 struct tevent_req *dcerpc_srvsvc_NetPRNameCompare_r_send(TALLOC_CTX *mem_ctx,
8091 struct tevent_context *ev,
8092 struct dcerpc_binding_handle *h,
8093 struct srvsvc_NetPRNameCompare *r)
8095 struct tevent_req *req;
8096 struct dcerpc_srvsvc_NetPRNameCompare_r_state *state;
8097 struct tevent_req *subreq;
8099 req = tevent_req_create(mem_ctx, &state,
8100 struct dcerpc_srvsvc_NetPRNameCompare_r_state);
8105 state->out_mem_ctx = NULL;
8106 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8107 NULL, &ndr_table_srvsvc,
8108 NDR_SRVSVC_NETPRNAMECOMPARE, state, r);
8109 if (tevent_req_nomem(subreq, req)) {
8110 return tevent_req_post(req, ev);
8112 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPRNameCompare_r_done, req);
8117 static void dcerpc_srvsvc_NetPRNameCompare_r_done(struct tevent_req *subreq)
8119 struct tevent_req *req =
8120 tevent_req_callback_data(subreq,
8124 status = dcerpc_binding_handle_call_recv(subreq);
8125 if (!NT_STATUS_IS_OK(status)) {
8126 tevent_req_nterror(req, status);
8130 tevent_req_done(req);
8133 NTSTATUS dcerpc_srvsvc_NetPRNameCompare_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8135 struct dcerpc_srvsvc_NetPRNameCompare_r_state *state =
8136 tevent_req_data(req,
8137 struct dcerpc_srvsvc_NetPRNameCompare_r_state);
8140 if (tevent_req_is_nterror(req, &status)) {
8141 tevent_req_received(req);
8145 talloc_steal(mem_ctx, state->out_mem_ctx);
8147 tevent_req_received(req);
8148 return NT_STATUS_OK;
8151 NTSTATUS dcerpc_srvsvc_NetPRNameCompare_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetPRNameCompare *r)
8155 status = dcerpc_binding_handle_call(h,
8156 NULL, &ndr_table_srvsvc,
8157 NDR_SRVSVC_NETPRNAMECOMPARE, mem_ctx, r);
8162 NTSTATUS dcerpc_srvsvc_NetPRNameCompare_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetPRNameCompare *r)
8166 status = dcerpc_srvsvc_NetPRNameCompare_r(p->binding_handle, mem_ctx, r);
8168 if (NT_STATUS_IS_RPC(status)) {
8169 status = NT_STATUS_NET_WRITE_FAULT;
8175 struct dcerpc_srvsvc_NetPRNameCompare_state {
8176 struct srvsvc_NetPRNameCompare orig;
8177 struct srvsvc_NetPRNameCompare tmp;
8178 TALLOC_CTX *out_mem_ctx;
8181 static void dcerpc_srvsvc_NetPRNameCompare_done(struct tevent_req *subreq);
8183 struct tevent_req *dcerpc_srvsvc_NetPRNameCompare_send(TALLOC_CTX *mem_ctx,
8184 struct tevent_context *ev,
8185 struct dcerpc_binding_handle *h,
8186 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
8187 const char *_name1 /* [in] [charset(UTF16)] */,
8188 const char *_name2 /* [in] [charset(UTF16)] */,
8189 uint32_t _name_type /* [in] */,
8190 uint32_t _flags /* [in] */)
8192 struct tevent_req *req;
8193 struct dcerpc_srvsvc_NetPRNameCompare_state *state;
8194 struct tevent_req *subreq;
8196 req = tevent_req_create(mem_ctx, &state,
8197 struct dcerpc_srvsvc_NetPRNameCompare_state);
8201 state->out_mem_ctx = NULL;
8204 state->orig.in.server_unc = _server_unc;
8205 state->orig.in.name1 = _name1;
8206 state->orig.in.name2 = _name2;
8207 state->orig.in.name_type = _name_type;
8208 state->orig.in.flags = _flags;
8210 /* Out parameters */
8213 ZERO_STRUCT(state->orig.out.result);
8215 /* make a temporary copy, that we pass to the dispatch function */
8216 state->tmp = state->orig;
8218 subreq = dcerpc_srvsvc_NetPRNameCompare_r_send(state, ev, h, &state->tmp);
8219 if (tevent_req_nomem(subreq, req)) {
8220 return tevent_req_post(req, ev);
8222 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetPRNameCompare_done, req);
8226 static void dcerpc_srvsvc_NetPRNameCompare_done(struct tevent_req *subreq)
8228 struct tevent_req *req = tevent_req_callback_data(
8229 subreq, struct tevent_req);
8230 struct dcerpc_srvsvc_NetPRNameCompare_state *state = tevent_req_data(
8231 req, struct dcerpc_srvsvc_NetPRNameCompare_state);
8233 TALLOC_CTX *mem_ctx;
8235 if (state->out_mem_ctx) {
8236 mem_ctx = state->out_mem_ctx;
8241 status = dcerpc_srvsvc_NetPRNameCompare_r_recv(subreq, mem_ctx);
8242 TALLOC_FREE(subreq);
8243 if (!NT_STATUS_IS_OK(status)) {
8244 tevent_req_nterror(req, status);
8248 /* Copy out parameters */
8251 state->orig.out.result = state->tmp.out.result;
8253 /* Reset temporary structure */
8254 ZERO_STRUCT(state->tmp);
8256 tevent_req_done(req);
8259 NTSTATUS dcerpc_srvsvc_NetPRNameCompare_recv(struct tevent_req *req,
8260 TALLOC_CTX *mem_ctx,
8263 struct dcerpc_srvsvc_NetPRNameCompare_state *state = tevent_req_data(
8264 req, struct dcerpc_srvsvc_NetPRNameCompare_state);
8267 if (tevent_req_is_nterror(req, &status)) {
8268 tevent_req_received(req);
8272 /* Steal possible out parameters to the callers context */
8273 talloc_steal(mem_ctx, state->out_mem_ctx);
8276 *result = state->orig.out.result;
8278 tevent_req_received(req);
8279 return NT_STATUS_OK;
8282 NTSTATUS dcerpc_srvsvc_NetPRNameCompare(struct dcerpc_binding_handle *h,
8283 TALLOC_CTX *mem_ctx,
8284 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
8285 const char *_name1 /* [in] [charset(UTF16)] */,
8286 const char *_name2 /* [in] [charset(UTF16)] */,
8287 uint32_t _name_type /* [in] */,
8288 uint32_t _flags /* [in] */,
8291 struct srvsvc_NetPRNameCompare r;
8295 r.in.server_unc = _server_unc;
8296 r.in.name1 = _name1;
8297 r.in.name2 = _name2;
8298 r.in.name_type = _name_type;
8299 r.in.flags = _flags;
8301 status = dcerpc_srvsvc_NetPRNameCompare_r(h, mem_ctx, &r);
8302 if (!NT_STATUS_IS_OK(status)) {
8306 /* Return variables */
8309 *result = r.out.result;
8311 return NT_STATUS_OK;
8314 struct dcerpc_srvsvc_NetShareEnum_r_state {
8315 TALLOC_CTX *out_mem_ctx;
8318 static void dcerpc_srvsvc_NetShareEnum_r_done(struct tevent_req *subreq);
8320 struct tevent_req *dcerpc_srvsvc_NetShareEnum_r_send(TALLOC_CTX *mem_ctx,
8321 struct tevent_context *ev,
8322 struct dcerpc_binding_handle *h,
8323 struct srvsvc_NetShareEnum *r)
8325 struct tevent_req *req;
8326 struct dcerpc_srvsvc_NetShareEnum_r_state *state;
8327 struct tevent_req *subreq;
8329 req = tevent_req_create(mem_ctx, &state,
8330 struct dcerpc_srvsvc_NetShareEnum_r_state);
8335 state->out_mem_ctx = talloc_new(state);
8336 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8337 return tevent_req_post(req, ev);
8340 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8341 NULL, &ndr_table_srvsvc,
8342 NDR_SRVSVC_NETSHAREENUM, state->out_mem_ctx, r);
8343 if (tevent_req_nomem(subreq, req)) {
8344 return tevent_req_post(req, ev);
8346 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareEnum_r_done, req);
8351 static void dcerpc_srvsvc_NetShareEnum_r_done(struct tevent_req *subreq)
8353 struct tevent_req *req =
8354 tevent_req_callback_data(subreq,
8358 status = dcerpc_binding_handle_call_recv(subreq);
8359 if (!NT_STATUS_IS_OK(status)) {
8360 tevent_req_nterror(req, status);
8364 tevent_req_done(req);
8367 NTSTATUS dcerpc_srvsvc_NetShareEnum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8369 struct dcerpc_srvsvc_NetShareEnum_r_state *state =
8370 tevent_req_data(req,
8371 struct dcerpc_srvsvc_NetShareEnum_r_state);
8374 if (tevent_req_is_nterror(req, &status)) {
8375 tevent_req_received(req);
8379 talloc_steal(mem_ctx, state->out_mem_ctx);
8381 tevent_req_received(req);
8382 return NT_STATUS_OK;
8385 NTSTATUS dcerpc_srvsvc_NetShareEnum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareEnum *r)
8389 status = dcerpc_binding_handle_call(h,
8390 NULL, &ndr_table_srvsvc,
8391 NDR_SRVSVC_NETSHAREENUM, mem_ctx, r);
8396 NTSTATUS dcerpc_srvsvc_NetShareEnum_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareEnum *r)
8400 status = dcerpc_srvsvc_NetShareEnum_r(p->binding_handle, mem_ctx, r);
8402 if (NT_STATUS_IS_RPC(status)) {
8403 status = NT_STATUS_NET_WRITE_FAULT;
8409 struct dcerpc_srvsvc_NetShareEnum_state {
8410 struct srvsvc_NetShareEnum orig;
8411 struct srvsvc_NetShareEnum tmp;
8412 TALLOC_CTX *out_mem_ctx;
8415 static void dcerpc_srvsvc_NetShareEnum_done(struct tevent_req *subreq);
8417 struct tevent_req *dcerpc_srvsvc_NetShareEnum_send(TALLOC_CTX *mem_ctx,
8418 struct tevent_context *ev,
8419 struct dcerpc_binding_handle *h,
8420 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
8421 struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
8422 uint32_t _max_buffer /* [in] */,
8423 uint32_t *_totalentries /* [out] [ref] */,
8424 uint32_t *_resume_handle /* [in,out] [unique] */)
8426 struct tevent_req *req;
8427 struct dcerpc_srvsvc_NetShareEnum_state *state;
8428 struct tevent_req *subreq;
8430 req = tevent_req_create(mem_ctx, &state,
8431 struct dcerpc_srvsvc_NetShareEnum_state);
8435 state->out_mem_ctx = NULL;
8438 state->orig.in.server_unc = _server_unc;
8439 state->orig.in.info_ctr = _info_ctr;
8440 state->orig.in.max_buffer = _max_buffer;
8441 state->orig.in.resume_handle = _resume_handle;
8443 /* Out parameters */
8444 state->orig.out.info_ctr = _info_ctr;
8445 state->orig.out.totalentries = _totalentries;
8446 state->orig.out.resume_handle = _resume_handle;
8449 ZERO_STRUCT(state->orig.out.result);
8451 state->out_mem_ctx = talloc_named_const(state, 0,
8452 "dcerpc_srvsvc_NetShareEnum_out_memory");
8453 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8454 return tevent_req_post(req, ev);
8457 /* make a temporary copy, that we pass to the dispatch function */
8458 state->tmp = state->orig;
8460 subreq = dcerpc_srvsvc_NetShareEnum_r_send(state, ev, h, &state->tmp);
8461 if (tevent_req_nomem(subreq, req)) {
8462 return tevent_req_post(req, ev);
8464 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareEnum_done, req);
8468 static void dcerpc_srvsvc_NetShareEnum_done(struct tevent_req *subreq)
8470 struct tevent_req *req = tevent_req_callback_data(
8471 subreq, struct tevent_req);
8472 struct dcerpc_srvsvc_NetShareEnum_state *state = tevent_req_data(
8473 req, struct dcerpc_srvsvc_NetShareEnum_state);
8475 TALLOC_CTX *mem_ctx;
8477 if (state->out_mem_ctx) {
8478 mem_ctx = state->out_mem_ctx;
8483 status = dcerpc_srvsvc_NetShareEnum_r_recv(subreq, mem_ctx);
8484 TALLOC_FREE(subreq);
8485 if (!NT_STATUS_IS_OK(status)) {
8486 tevent_req_nterror(req, status);
8490 /* Copy out parameters */
8491 *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
8492 *state->orig.out.totalentries = *state->tmp.out.totalentries;
8493 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
8494 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
8498 state->orig.out.result = state->tmp.out.result;
8500 /* Reset temporary structure */
8501 ZERO_STRUCT(state->tmp);
8503 tevent_req_done(req);
8506 NTSTATUS dcerpc_srvsvc_NetShareEnum_recv(struct tevent_req *req,
8507 TALLOC_CTX *mem_ctx,
8510 struct dcerpc_srvsvc_NetShareEnum_state *state = tevent_req_data(
8511 req, struct dcerpc_srvsvc_NetShareEnum_state);
8514 if (tevent_req_is_nterror(req, &status)) {
8515 tevent_req_received(req);
8519 /* Steal possible out parameters to the callers context */
8520 talloc_steal(mem_ctx, state->out_mem_ctx);
8523 *result = state->orig.out.result;
8525 tevent_req_received(req);
8526 return NT_STATUS_OK;
8529 NTSTATUS dcerpc_srvsvc_NetShareEnum(struct dcerpc_binding_handle *h,
8530 TALLOC_CTX *mem_ctx,
8531 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
8532 struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
8533 uint32_t _max_buffer /* [in] */,
8534 uint32_t *_totalentries /* [out] [ref] */,
8535 uint32_t *_resume_handle /* [in,out] [unique] */,
8538 struct srvsvc_NetShareEnum r;
8542 r.in.server_unc = _server_unc;
8543 r.in.info_ctr = _info_ctr;
8544 r.in.max_buffer = _max_buffer;
8545 r.in.resume_handle = _resume_handle;
8547 status = dcerpc_srvsvc_NetShareEnum_r(h, mem_ctx, &r);
8548 if (!NT_STATUS_IS_OK(status)) {
8552 /* Return variables */
8553 *_info_ctr = *r.out.info_ctr;
8554 *_totalentries = *r.out.totalentries;
8555 if (_resume_handle && r.out.resume_handle) {
8556 *_resume_handle = *r.out.resume_handle;
8560 *result = r.out.result;
8562 return NT_STATUS_OK;
8565 struct dcerpc_srvsvc_NetShareDelStart_r_state {
8566 TALLOC_CTX *out_mem_ctx;
8569 static void dcerpc_srvsvc_NetShareDelStart_r_done(struct tevent_req *subreq);
8571 struct tevent_req *dcerpc_srvsvc_NetShareDelStart_r_send(TALLOC_CTX *mem_ctx,
8572 struct tevent_context *ev,
8573 struct dcerpc_binding_handle *h,
8574 struct srvsvc_NetShareDelStart *r)
8576 struct tevent_req *req;
8577 struct dcerpc_srvsvc_NetShareDelStart_r_state *state;
8578 struct tevent_req *subreq;
8580 req = tevent_req_create(mem_ctx, &state,
8581 struct dcerpc_srvsvc_NetShareDelStart_r_state);
8586 state->out_mem_ctx = talloc_new(state);
8587 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8588 return tevent_req_post(req, ev);
8591 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8592 NULL, &ndr_table_srvsvc,
8593 NDR_SRVSVC_NETSHAREDELSTART, state->out_mem_ctx, r);
8594 if (tevent_req_nomem(subreq, req)) {
8595 return tevent_req_post(req, ev);
8597 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDelStart_r_done, req);
8602 static void dcerpc_srvsvc_NetShareDelStart_r_done(struct tevent_req *subreq)
8604 struct tevent_req *req =
8605 tevent_req_callback_data(subreq,
8609 status = dcerpc_binding_handle_call_recv(subreq);
8610 if (!NT_STATUS_IS_OK(status)) {
8611 tevent_req_nterror(req, status);
8615 tevent_req_done(req);
8618 NTSTATUS dcerpc_srvsvc_NetShareDelStart_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8620 struct dcerpc_srvsvc_NetShareDelStart_r_state *state =
8621 tevent_req_data(req,
8622 struct dcerpc_srvsvc_NetShareDelStart_r_state);
8625 if (tevent_req_is_nterror(req, &status)) {
8626 tevent_req_received(req);
8630 talloc_steal(mem_ctx, state->out_mem_ctx);
8632 tevent_req_received(req);
8633 return NT_STATUS_OK;
8636 NTSTATUS dcerpc_srvsvc_NetShareDelStart_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDelStart *r)
8640 status = dcerpc_binding_handle_call(h,
8641 NULL, &ndr_table_srvsvc,
8642 NDR_SRVSVC_NETSHAREDELSTART, mem_ctx, r);
8647 NTSTATUS dcerpc_srvsvc_NetShareDelStart_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDelStart *r)
8651 status = dcerpc_srvsvc_NetShareDelStart_r(p->binding_handle, mem_ctx, r);
8653 if (NT_STATUS_IS_RPC(status)) {
8654 status = NT_STATUS_NET_WRITE_FAULT;
8660 struct dcerpc_srvsvc_NetShareDelStart_state {
8661 struct srvsvc_NetShareDelStart orig;
8662 struct srvsvc_NetShareDelStart tmp;
8663 TALLOC_CTX *out_mem_ctx;
8666 static void dcerpc_srvsvc_NetShareDelStart_done(struct tevent_req *subreq);
8668 struct tevent_req *dcerpc_srvsvc_NetShareDelStart_send(TALLOC_CTX *mem_ctx,
8669 struct tevent_context *ev,
8670 struct dcerpc_binding_handle *h,
8671 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
8672 const char *_share /* [in] [charset(UTF16)] */,
8673 uint32_t _reserved /* [in] */,
8674 struct policy_handle *_hnd /* [out] [unique] */)
8676 struct tevent_req *req;
8677 struct dcerpc_srvsvc_NetShareDelStart_state *state;
8678 struct tevent_req *subreq;
8680 req = tevent_req_create(mem_ctx, &state,
8681 struct dcerpc_srvsvc_NetShareDelStart_state);
8685 state->out_mem_ctx = NULL;
8688 state->orig.in.server_unc = _server_unc;
8689 state->orig.in.share = _share;
8690 state->orig.in.reserved = _reserved;
8692 /* Out parameters */
8693 state->orig.out.hnd = _hnd;
8696 ZERO_STRUCT(state->orig.out.result);
8698 state->out_mem_ctx = talloc_named_const(state, 0,
8699 "dcerpc_srvsvc_NetShareDelStart_out_memory");
8700 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8701 return tevent_req_post(req, ev);
8704 /* make a temporary copy, that we pass to the dispatch function */
8705 state->tmp = state->orig;
8707 subreq = dcerpc_srvsvc_NetShareDelStart_r_send(state, ev, h, &state->tmp);
8708 if (tevent_req_nomem(subreq, req)) {
8709 return tevent_req_post(req, ev);
8711 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDelStart_done, req);
8715 static void dcerpc_srvsvc_NetShareDelStart_done(struct tevent_req *subreq)
8717 struct tevent_req *req = tevent_req_callback_data(
8718 subreq, struct tevent_req);
8719 struct dcerpc_srvsvc_NetShareDelStart_state *state = tevent_req_data(
8720 req, struct dcerpc_srvsvc_NetShareDelStart_state);
8722 TALLOC_CTX *mem_ctx;
8724 if (state->out_mem_ctx) {
8725 mem_ctx = state->out_mem_ctx;
8730 status = dcerpc_srvsvc_NetShareDelStart_r_recv(subreq, mem_ctx);
8731 TALLOC_FREE(subreq);
8732 if (!NT_STATUS_IS_OK(status)) {
8733 tevent_req_nterror(req, status);
8737 /* Copy out parameters */
8738 if (state->orig.out.hnd && state->tmp.out.hnd) {
8739 *state->orig.out.hnd = *state->tmp.out.hnd;
8743 state->orig.out.result = state->tmp.out.result;
8745 /* Reset temporary structure */
8746 ZERO_STRUCT(state->tmp);
8748 tevent_req_done(req);
8751 NTSTATUS dcerpc_srvsvc_NetShareDelStart_recv(struct tevent_req *req,
8752 TALLOC_CTX *mem_ctx,
8755 struct dcerpc_srvsvc_NetShareDelStart_state *state = tevent_req_data(
8756 req, struct dcerpc_srvsvc_NetShareDelStart_state);
8759 if (tevent_req_is_nterror(req, &status)) {
8760 tevent_req_received(req);
8764 /* Steal possible out parameters to the callers context */
8765 talloc_steal(mem_ctx, state->out_mem_ctx);
8768 *result = state->orig.out.result;
8770 tevent_req_received(req);
8771 return NT_STATUS_OK;
8774 NTSTATUS dcerpc_srvsvc_NetShareDelStart(struct dcerpc_binding_handle *h,
8775 TALLOC_CTX *mem_ctx,
8776 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
8777 const char *_share /* [in] [charset(UTF16)] */,
8778 uint32_t _reserved /* [in] */,
8779 struct policy_handle *_hnd /* [out] [unique] */,
8782 struct srvsvc_NetShareDelStart r;
8786 r.in.server_unc = _server_unc;
8787 r.in.share = _share;
8788 r.in.reserved = _reserved;
8790 status = dcerpc_srvsvc_NetShareDelStart_r(h, mem_ctx, &r);
8791 if (!NT_STATUS_IS_OK(status)) {
8795 /* Return variables */
8796 if (_hnd && r.out.hnd) {
8801 *result = r.out.result;
8803 return NT_STATUS_OK;
8806 struct dcerpc_srvsvc_NetShareDelCommit_r_state {
8807 TALLOC_CTX *out_mem_ctx;
8810 static void dcerpc_srvsvc_NetShareDelCommit_r_done(struct tevent_req *subreq);
8812 struct tevent_req *dcerpc_srvsvc_NetShareDelCommit_r_send(TALLOC_CTX *mem_ctx,
8813 struct tevent_context *ev,
8814 struct dcerpc_binding_handle *h,
8815 struct srvsvc_NetShareDelCommit *r)
8817 struct tevent_req *req;
8818 struct dcerpc_srvsvc_NetShareDelCommit_r_state *state;
8819 struct tevent_req *subreq;
8821 req = tevent_req_create(mem_ctx, &state,
8822 struct dcerpc_srvsvc_NetShareDelCommit_r_state);
8827 state->out_mem_ctx = talloc_new(state);
8828 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8829 return tevent_req_post(req, ev);
8832 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8833 NULL, &ndr_table_srvsvc,
8834 NDR_SRVSVC_NETSHAREDELCOMMIT, state->out_mem_ctx, r);
8835 if (tevent_req_nomem(subreq, req)) {
8836 return tevent_req_post(req, ev);
8838 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDelCommit_r_done, req);
8843 static void dcerpc_srvsvc_NetShareDelCommit_r_done(struct tevent_req *subreq)
8845 struct tevent_req *req =
8846 tevent_req_callback_data(subreq,
8850 status = dcerpc_binding_handle_call_recv(subreq);
8851 if (!NT_STATUS_IS_OK(status)) {
8852 tevent_req_nterror(req, status);
8856 tevent_req_done(req);
8859 NTSTATUS dcerpc_srvsvc_NetShareDelCommit_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8861 struct dcerpc_srvsvc_NetShareDelCommit_r_state *state =
8862 tevent_req_data(req,
8863 struct dcerpc_srvsvc_NetShareDelCommit_r_state);
8866 if (tevent_req_is_nterror(req, &status)) {
8867 tevent_req_received(req);
8871 talloc_steal(mem_ctx, state->out_mem_ctx);
8873 tevent_req_received(req);
8874 return NT_STATUS_OK;
8877 NTSTATUS dcerpc_srvsvc_NetShareDelCommit_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDelCommit *r)
8881 status = dcerpc_binding_handle_call(h,
8882 NULL, &ndr_table_srvsvc,
8883 NDR_SRVSVC_NETSHAREDELCOMMIT, mem_ctx, r);
8888 NTSTATUS dcerpc_srvsvc_NetShareDelCommit_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetShareDelCommit *r)
8892 status = dcerpc_srvsvc_NetShareDelCommit_r(p->binding_handle, mem_ctx, r);
8894 if (NT_STATUS_IS_RPC(status)) {
8895 status = NT_STATUS_NET_WRITE_FAULT;
8901 struct dcerpc_srvsvc_NetShareDelCommit_state {
8902 struct srvsvc_NetShareDelCommit orig;
8903 struct srvsvc_NetShareDelCommit tmp;
8904 TALLOC_CTX *out_mem_ctx;
8907 static void dcerpc_srvsvc_NetShareDelCommit_done(struct tevent_req *subreq);
8909 struct tevent_req *dcerpc_srvsvc_NetShareDelCommit_send(TALLOC_CTX *mem_ctx,
8910 struct tevent_context *ev,
8911 struct dcerpc_binding_handle *h,
8912 struct policy_handle *_hnd /* [in,out] [unique] */)
8914 struct tevent_req *req;
8915 struct dcerpc_srvsvc_NetShareDelCommit_state *state;
8916 struct tevent_req *subreq;
8918 req = tevent_req_create(mem_ctx, &state,
8919 struct dcerpc_srvsvc_NetShareDelCommit_state);
8923 state->out_mem_ctx = NULL;
8926 state->orig.in.hnd = _hnd;
8928 /* Out parameters */
8929 state->orig.out.hnd = _hnd;
8932 ZERO_STRUCT(state->orig.out.result);
8934 state->out_mem_ctx = talloc_named_const(state, 0,
8935 "dcerpc_srvsvc_NetShareDelCommit_out_memory");
8936 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8937 return tevent_req_post(req, ev);
8940 /* make a temporary copy, that we pass to the dispatch function */
8941 state->tmp = state->orig;
8943 subreq = dcerpc_srvsvc_NetShareDelCommit_r_send(state, ev, h, &state->tmp);
8944 if (tevent_req_nomem(subreq, req)) {
8945 return tevent_req_post(req, ev);
8947 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetShareDelCommit_done, req);
8951 static void dcerpc_srvsvc_NetShareDelCommit_done(struct tevent_req *subreq)
8953 struct tevent_req *req = tevent_req_callback_data(
8954 subreq, struct tevent_req);
8955 struct dcerpc_srvsvc_NetShareDelCommit_state *state = tevent_req_data(
8956 req, struct dcerpc_srvsvc_NetShareDelCommit_state);
8958 TALLOC_CTX *mem_ctx;
8960 if (state->out_mem_ctx) {
8961 mem_ctx = state->out_mem_ctx;
8966 status = dcerpc_srvsvc_NetShareDelCommit_r_recv(subreq, mem_ctx);
8967 TALLOC_FREE(subreq);
8968 if (!NT_STATUS_IS_OK(status)) {
8969 tevent_req_nterror(req, status);
8973 /* Copy out parameters */
8974 if (state->orig.out.hnd && state->tmp.out.hnd) {
8975 *state->orig.out.hnd = *state->tmp.out.hnd;
8979 state->orig.out.result = state->tmp.out.result;
8981 /* Reset temporary structure */
8982 ZERO_STRUCT(state->tmp);
8984 tevent_req_done(req);
8987 NTSTATUS dcerpc_srvsvc_NetShareDelCommit_recv(struct tevent_req *req,
8988 TALLOC_CTX *mem_ctx,
8991 struct dcerpc_srvsvc_NetShareDelCommit_state *state = tevent_req_data(
8992 req, struct dcerpc_srvsvc_NetShareDelCommit_state);
8995 if (tevent_req_is_nterror(req, &status)) {
8996 tevent_req_received(req);
9000 /* Steal possible out parameters to the callers context */
9001 talloc_steal(mem_ctx, state->out_mem_ctx);
9004 *result = state->orig.out.result;
9006 tevent_req_received(req);
9007 return NT_STATUS_OK;
9010 NTSTATUS dcerpc_srvsvc_NetShareDelCommit(struct dcerpc_binding_handle *h,
9011 TALLOC_CTX *mem_ctx,
9012 struct policy_handle *_hnd /* [in,out] [unique] */,
9015 struct srvsvc_NetShareDelCommit r;
9021 status = dcerpc_srvsvc_NetShareDelCommit_r(h, mem_ctx, &r);
9022 if (!NT_STATUS_IS_OK(status)) {
9026 /* Return variables */
9027 if (_hnd && r.out.hnd) {
9032 *result = r.out.result;
9034 return NT_STATUS_OK;
9037 struct dcerpc_srvsvc_NetGetFileSecurity_r_state {
9038 TALLOC_CTX *out_mem_ctx;
9041 static void dcerpc_srvsvc_NetGetFileSecurity_r_done(struct tevent_req *subreq);
9043 struct tevent_req *dcerpc_srvsvc_NetGetFileSecurity_r_send(TALLOC_CTX *mem_ctx,
9044 struct tevent_context *ev,
9045 struct dcerpc_binding_handle *h,
9046 struct srvsvc_NetGetFileSecurity *r)
9048 struct tevent_req *req;
9049 struct dcerpc_srvsvc_NetGetFileSecurity_r_state *state;
9050 struct tevent_req *subreq;
9052 req = tevent_req_create(mem_ctx, &state,
9053 struct dcerpc_srvsvc_NetGetFileSecurity_r_state);
9058 state->out_mem_ctx = talloc_new(state);
9059 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9060 return tevent_req_post(req, ev);
9063 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9064 NULL, &ndr_table_srvsvc,
9065 NDR_SRVSVC_NETGETFILESECURITY, state->out_mem_ctx, r);
9066 if (tevent_req_nomem(subreq, req)) {
9067 return tevent_req_post(req, ev);
9069 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetGetFileSecurity_r_done, req);
9074 static void dcerpc_srvsvc_NetGetFileSecurity_r_done(struct tevent_req *subreq)
9076 struct tevent_req *req =
9077 tevent_req_callback_data(subreq,
9081 status = dcerpc_binding_handle_call_recv(subreq);
9082 if (!NT_STATUS_IS_OK(status)) {
9083 tevent_req_nterror(req, status);
9087 tevent_req_done(req);
9090 NTSTATUS dcerpc_srvsvc_NetGetFileSecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9092 struct dcerpc_srvsvc_NetGetFileSecurity_r_state *state =
9093 tevent_req_data(req,
9094 struct dcerpc_srvsvc_NetGetFileSecurity_r_state);
9097 if (tevent_req_is_nterror(req, &status)) {
9098 tevent_req_received(req);
9102 talloc_steal(mem_ctx, state->out_mem_ctx);
9104 tevent_req_received(req);
9105 return NT_STATUS_OK;
9108 NTSTATUS dcerpc_srvsvc_NetGetFileSecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetGetFileSecurity *r)
9112 status = dcerpc_binding_handle_call(h,
9113 NULL, &ndr_table_srvsvc,
9114 NDR_SRVSVC_NETGETFILESECURITY, mem_ctx, r);
9119 NTSTATUS dcerpc_srvsvc_NetGetFileSecurity_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetGetFileSecurity *r)
9123 status = dcerpc_srvsvc_NetGetFileSecurity_r(p->binding_handle, mem_ctx, r);
9125 if (NT_STATUS_IS_RPC(status)) {
9126 status = NT_STATUS_NET_WRITE_FAULT;
9132 struct dcerpc_srvsvc_NetGetFileSecurity_state {
9133 struct srvsvc_NetGetFileSecurity orig;
9134 struct srvsvc_NetGetFileSecurity tmp;
9135 TALLOC_CTX *out_mem_ctx;
9138 static void dcerpc_srvsvc_NetGetFileSecurity_done(struct tevent_req *subreq);
9140 struct tevent_req *dcerpc_srvsvc_NetGetFileSecurity_send(TALLOC_CTX *mem_ctx,
9141 struct tevent_context *ev,
9142 struct dcerpc_binding_handle *h,
9143 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9144 const char *_share /* [in] [unique,charset(UTF16)] */,
9145 const char *_file /* [in] [charset(UTF16)] */,
9146 uint32_t _securityinformation /* [in] */,
9147 struct sec_desc_buf **_sd_buf /* [out] [ref] */)
9149 struct tevent_req *req;
9150 struct dcerpc_srvsvc_NetGetFileSecurity_state *state;
9151 struct tevent_req *subreq;
9153 req = tevent_req_create(mem_ctx, &state,
9154 struct dcerpc_srvsvc_NetGetFileSecurity_state);
9158 state->out_mem_ctx = NULL;
9161 state->orig.in.server_unc = _server_unc;
9162 state->orig.in.share = _share;
9163 state->orig.in.file = _file;
9164 state->orig.in.securityinformation = _securityinformation;
9166 /* Out parameters */
9167 state->orig.out.sd_buf = _sd_buf;
9170 ZERO_STRUCT(state->orig.out.result);
9172 state->out_mem_ctx = talloc_named_const(state, 0,
9173 "dcerpc_srvsvc_NetGetFileSecurity_out_memory");
9174 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9175 return tevent_req_post(req, ev);
9178 /* make a temporary copy, that we pass to the dispatch function */
9179 state->tmp = state->orig;
9181 subreq = dcerpc_srvsvc_NetGetFileSecurity_r_send(state, ev, h, &state->tmp);
9182 if (tevent_req_nomem(subreq, req)) {
9183 return tevent_req_post(req, ev);
9185 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetGetFileSecurity_done, req);
9189 static void dcerpc_srvsvc_NetGetFileSecurity_done(struct tevent_req *subreq)
9191 struct tevent_req *req = tevent_req_callback_data(
9192 subreq, struct tevent_req);
9193 struct dcerpc_srvsvc_NetGetFileSecurity_state *state = tevent_req_data(
9194 req, struct dcerpc_srvsvc_NetGetFileSecurity_state);
9196 TALLOC_CTX *mem_ctx;
9198 if (state->out_mem_ctx) {
9199 mem_ctx = state->out_mem_ctx;
9204 status = dcerpc_srvsvc_NetGetFileSecurity_r_recv(subreq, mem_ctx);
9205 TALLOC_FREE(subreq);
9206 if (!NT_STATUS_IS_OK(status)) {
9207 tevent_req_nterror(req, status);
9211 /* Copy out parameters */
9212 *state->orig.out.sd_buf = *state->tmp.out.sd_buf;
9215 state->orig.out.result = state->tmp.out.result;
9217 /* Reset temporary structure */
9218 ZERO_STRUCT(state->tmp);
9220 tevent_req_done(req);
9223 NTSTATUS dcerpc_srvsvc_NetGetFileSecurity_recv(struct tevent_req *req,
9224 TALLOC_CTX *mem_ctx,
9227 struct dcerpc_srvsvc_NetGetFileSecurity_state *state = tevent_req_data(
9228 req, struct dcerpc_srvsvc_NetGetFileSecurity_state);
9231 if (tevent_req_is_nterror(req, &status)) {
9232 tevent_req_received(req);
9236 /* Steal possible out parameters to the callers context */
9237 talloc_steal(mem_ctx, state->out_mem_ctx);
9240 *result = state->orig.out.result;
9242 tevent_req_received(req);
9243 return NT_STATUS_OK;
9246 NTSTATUS dcerpc_srvsvc_NetGetFileSecurity(struct dcerpc_binding_handle *h,
9247 TALLOC_CTX *mem_ctx,
9248 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9249 const char *_share /* [in] [unique,charset(UTF16)] */,
9250 const char *_file /* [in] [charset(UTF16)] */,
9251 uint32_t _securityinformation /* [in] */,
9252 struct sec_desc_buf **_sd_buf /* [out] [ref] */,
9255 struct srvsvc_NetGetFileSecurity r;
9259 r.in.server_unc = _server_unc;
9260 r.in.share = _share;
9262 r.in.securityinformation = _securityinformation;
9264 status = dcerpc_srvsvc_NetGetFileSecurity_r(h, mem_ctx, &r);
9265 if (!NT_STATUS_IS_OK(status)) {
9269 /* Return variables */
9270 *_sd_buf = *r.out.sd_buf;
9273 *result = r.out.result;
9275 return NT_STATUS_OK;
9278 struct dcerpc_srvsvc_NetSetFileSecurity_r_state {
9279 TALLOC_CTX *out_mem_ctx;
9282 static void dcerpc_srvsvc_NetSetFileSecurity_r_done(struct tevent_req *subreq);
9284 struct tevent_req *dcerpc_srvsvc_NetSetFileSecurity_r_send(TALLOC_CTX *mem_ctx,
9285 struct tevent_context *ev,
9286 struct dcerpc_binding_handle *h,
9287 struct srvsvc_NetSetFileSecurity *r)
9289 struct tevent_req *req;
9290 struct dcerpc_srvsvc_NetSetFileSecurity_r_state *state;
9291 struct tevent_req *subreq;
9293 req = tevent_req_create(mem_ctx, &state,
9294 struct dcerpc_srvsvc_NetSetFileSecurity_r_state);
9299 state->out_mem_ctx = NULL;
9300 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9301 NULL, &ndr_table_srvsvc,
9302 NDR_SRVSVC_NETSETFILESECURITY, state, r);
9303 if (tevent_req_nomem(subreq, req)) {
9304 return tevent_req_post(req, ev);
9306 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSetFileSecurity_r_done, req);
9311 static void dcerpc_srvsvc_NetSetFileSecurity_r_done(struct tevent_req *subreq)
9313 struct tevent_req *req =
9314 tevent_req_callback_data(subreq,
9318 status = dcerpc_binding_handle_call_recv(subreq);
9319 if (!NT_STATUS_IS_OK(status)) {
9320 tevent_req_nterror(req, status);
9324 tevent_req_done(req);
9327 NTSTATUS dcerpc_srvsvc_NetSetFileSecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9329 struct dcerpc_srvsvc_NetSetFileSecurity_r_state *state =
9330 tevent_req_data(req,
9331 struct dcerpc_srvsvc_NetSetFileSecurity_r_state);
9334 if (tevent_req_is_nterror(req, &status)) {
9335 tevent_req_received(req);
9339 talloc_steal(mem_ctx, state->out_mem_ctx);
9341 tevent_req_received(req);
9342 return NT_STATUS_OK;
9345 NTSTATUS dcerpc_srvsvc_NetSetFileSecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetSetFileSecurity *r)
9349 status = dcerpc_binding_handle_call(h,
9350 NULL, &ndr_table_srvsvc,
9351 NDR_SRVSVC_NETSETFILESECURITY, mem_ctx, r);
9356 NTSTATUS dcerpc_srvsvc_NetSetFileSecurity_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetSetFileSecurity *r)
9360 status = dcerpc_srvsvc_NetSetFileSecurity_r(p->binding_handle, mem_ctx, r);
9362 if (NT_STATUS_IS_RPC(status)) {
9363 status = NT_STATUS_NET_WRITE_FAULT;
9369 struct dcerpc_srvsvc_NetSetFileSecurity_state {
9370 struct srvsvc_NetSetFileSecurity orig;
9371 struct srvsvc_NetSetFileSecurity tmp;
9372 TALLOC_CTX *out_mem_ctx;
9375 static void dcerpc_srvsvc_NetSetFileSecurity_done(struct tevent_req *subreq);
9377 struct tevent_req *dcerpc_srvsvc_NetSetFileSecurity_send(TALLOC_CTX *mem_ctx,
9378 struct tevent_context *ev,
9379 struct dcerpc_binding_handle *h,
9380 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9381 const char *_share /* [in] [unique,charset(UTF16)] */,
9382 const char *_file /* [in] [charset(UTF16)] */,
9383 uint32_t _securityinformation /* [in] */,
9384 struct sec_desc_buf *_sd_buf /* [in] [ref] */)
9386 struct tevent_req *req;
9387 struct dcerpc_srvsvc_NetSetFileSecurity_state *state;
9388 struct tevent_req *subreq;
9390 req = tevent_req_create(mem_ctx, &state,
9391 struct dcerpc_srvsvc_NetSetFileSecurity_state);
9395 state->out_mem_ctx = NULL;
9398 state->orig.in.server_unc = _server_unc;
9399 state->orig.in.share = _share;
9400 state->orig.in.file = _file;
9401 state->orig.in.securityinformation = _securityinformation;
9402 state->orig.in.sd_buf = _sd_buf;
9404 /* Out parameters */
9407 ZERO_STRUCT(state->orig.out.result);
9409 /* make a temporary copy, that we pass to the dispatch function */
9410 state->tmp = state->orig;
9412 subreq = dcerpc_srvsvc_NetSetFileSecurity_r_send(state, ev, h, &state->tmp);
9413 if (tevent_req_nomem(subreq, req)) {
9414 return tevent_req_post(req, ev);
9416 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetSetFileSecurity_done, req);
9420 static void dcerpc_srvsvc_NetSetFileSecurity_done(struct tevent_req *subreq)
9422 struct tevent_req *req = tevent_req_callback_data(
9423 subreq, struct tevent_req);
9424 struct dcerpc_srvsvc_NetSetFileSecurity_state *state = tevent_req_data(
9425 req, struct dcerpc_srvsvc_NetSetFileSecurity_state);
9427 TALLOC_CTX *mem_ctx;
9429 if (state->out_mem_ctx) {
9430 mem_ctx = state->out_mem_ctx;
9435 status = dcerpc_srvsvc_NetSetFileSecurity_r_recv(subreq, mem_ctx);
9436 TALLOC_FREE(subreq);
9437 if (!NT_STATUS_IS_OK(status)) {
9438 tevent_req_nterror(req, status);
9442 /* Copy out parameters */
9445 state->orig.out.result = state->tmp.out.result;
9447 /* Reset temporary structure */
9448 ZERO_STRUCT(state->tmp);
9450 tevent_req_done(req);
9453 NTSTATUS dcerpc_srvsvc_NetSetFileSecurity_recv(struct tevent_req *req,
9454 TALLOC_CTX *mem_ctx,
9457 struct dcerpc_srvsvc_NetSetFileSecurity_state *state = tevent_req_data(
9458 req, struct dcerpc_srvsvc_NetSetFileSecurity_state);
9461 if (tevent_req_is_nterror(req, &status)) {
9462 tevent_req_received(req);
9466 /* Steal possible out parameters to the callers context */
9467 talloc_steal(mem_ctx, state->out_mem_ctx);
9470 *result = state->orig.out.result;
9472 tevent_req_received(req);
9473 return NT_STATUS_OK;
9476 NTSTATUS dcerpc_srvsvc_NetSetFileSecurity(struct dcerpc_binding_handle *h,
9477 TALLOC_CTX *mem_ctx,
9478 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9479 const char *_share /* [in] [unique,charset(UTF16)] */,
9480 const char *_file /* [in] [charset(UTF16)] */,
9481 uint32_t _securityinformation /* [in] */,
9482 struct sec_desc_buf *_sd_buf /* [in] [ref] */,
9485 struct srvsvc_NetSetFileSecurity r;
9489 r.in.server_unc = _server_unc;
9490 r.in.share = _share;
9492 r.in.securityinformation = _securityinformation;
9493 r.in.sd_buf = _sd_buf;
9495 status = dcerpc_srvsvc_NetSetFileSecurity_r(h, mem_ctx, &r);
9496 if (!NT_STATUS_IS_OK(status)) {
9500 /* Return variables */
9503 *result = r.out.result;
9505 return NT_STATUS_OK;
9508 struct dcerpc_srvsvc_NetServerTransportAddEx_r_state {
9509 TALLOC_CTX *out_mem_ctx;
9512 static void dcerpc_srvsvc_NetServerTransportAddEx_r_done(struct tevent_req *subreq);
9514 struct tevent_req *dcerpc_srvsvc_NetServerTransportAddEx_r_send(TALLOC_CTX *mem_ctx,
9515 struct tevent_context *ev,
9516 struct dcerpc_binding_handle *h,
9517 struct srvsvc_NetServerTransportAddEx *r)
9519 struct tevent_req *req;
9520 struct dcerpc_srvsvc_NetServerTransportAddEx_r_state *state;
9521 struct tevent_req *subreq;
9523 req = tevent_req_create(mem_ctx, &state,
9524 struct dcerpc_srvsvc_NetServerTransportAddEx_r_state);
9529 state->out_mem_ctx = NULL;
9530 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9531 NULL, &ndr_table_srvsvc,
9532 NDR_SRVSVC_NETSERVERTRANSPORTADDEX, state, r);
9533 if (tevent_req_nomem(subreq, req)) {
9534 return tevent_req_post(req, ev);
9536 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetServerTransportAddEx_r_done, req);
9541 static void dcerpc_srvsvc_NetServerTransportAddEx_r_done(struct tevent_req *subreq)
9543 struct tevent_req *req =
9544 tevent_req_callback_data(subreq,
9548 status = dcerpc_binding_handle_call_recv(subreq);
9549 if (!NT_STATUS_IS_OK(status)) {
9550 tevent_req_nterror(req, status);
9554 tevent_req_done(req);
9557 NTSTATUS dcerpc_srvsvc_NetServerTransportAddEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9559 struct dcerpc_srvsvc_NetServerTransportAddEx_r_state *state =
9560 tevent_req_data(req,
9561 struct dcerpc_srvsvc_NetServerTransportAddEx_r_state);
9564 if (tevent_req_is_nterror(req, &status)) {
9565 tevent_req_received(req);
9569 talloc_steal(mem_ctx, state->out_mem_ctx);
9571 tevent_req_received(req);
9572 return NT_STATUS_OK;
9575 NTSTATUS dcerpc_srvsvc_NetServerTransportAddEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetServerTransportAddEx *r)
9579 status = dcerpc_binding_handle_call(h,
9580 NULL, &ndr_table_srvsvc,
9581 NDR_SRVSVC_NETSERVERTRANSPORTADDEX, mem_ctx, r);
9586 NTSTATUS dcerpc_srvsvc_NetServerTransportAddEx_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetServerTransportAddEx *r)
9590 status = dcerpc_srvsvc_NetServerTransportAddEx_r(p->binding_handle, mem_ctx, r);
9592 if (NT_STATUS_IS_RPC(status)) {
9593 status = NT_STATUS_NET_WRITE_FAULT;
9599 struct dcerpc_srvsvc_NetServerTransportAddEx_state {
9600 struct srvsvc_NetServerTransportAddEx orig;
9601 struct srvsvc_NetServerTransportAddEx tmp;
9602 TALLOC_CTX *out_mem_ctx;
9605 static void dcerpc_srvsvc_NetServerTransportAddEx_done(struct tevent_req *subreq);
9607 struct tevent_req *dcerpc_srvsvc_NetServerTransportAddEx_send(TALLOC_CTX *mem_ctx,
9608 struct tevent_context *ev,
9609 struct dcerpc_binding_handle *h,
9610 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9611 uint32_t _level /* [in] */,
9612 union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */)
9614 struct tevent_req *req;
9615 struct dcerpc_srvsvc_NetServerTransportAddEx_state *state;
9616 struct tevent_req *subreq;
9618 req = tevent_req_create(mem_ctx, &state,
9619 struct dcerpc_srvsvc_NetServerTransportAddEx_state);
9623 state->out_mem_ctx = NULL;
9626 state->orig.in.server_unc = _server_unc;
9627 state->orig.in.level = _level;
9628 state->orig.in.info = _info;
9630 /* Out parameters */
9633 ZERO_STRUCT(state->orig.out.result);
9635 /* make a temporary copy, that we pass to the dispatch function */
9636 state->tmp = state->orig;
9638 subreq = dcerpc_srvsvc_NetServerTransportAddEx_r_send(state, ev, h, &state->tmp);
9639 if (tevent_req_nomem(subreq, req)) {
9640 return tevent_req_post(req, ev);
9642 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetServerTransportAddEx_done, req);
9646 static void dcerpc_srvsvc_NetServerTransportAddEx_done(struct tevent_req *subreq)
9648 struct tevent_req *req = tevent_req_callback_data(
9649 subreq, struct tevent_req);
9650 struct dcerpc_srvsvc_NetServerTransportAddEx_state *state = tevent_req_data(
9651 req, struct dcerpc_srvsvc_NetServerTransportAddEx_state);
9653 TALLOC_CTX *mem_ctx;
9655 if (state->out_mem_ctx) {
9656 mem_ctx = state->out_mem_ctx;
9661 status = dcerpc_srvsvc_NetServerTransportAddEx_r_recv(subreq, mem_ctx);
9662 TALLOC_FREE(subreq);
9663 if (!NT_STATUS_IS_OK(status)) {
9664 tevent_req_nterror(req, status);
9668 /* Copy out parameters */
9671 state->orig.out.result = state->tmp.out.result;
9673 /* Reset temporary structure */
9674 ZERO_STRUCT(state->tmp);
9676 tevent_req_done(req);
9679 NTSTATUS dcerpc_srvsvc_NetServerTransportAddEx_recv(struct tevent_req *req,
9680 TALLOC_CTX *mem_ctx,
9683 struct dcerpc_srvsvc_NetServerTransportAddEx_state *state = tevent_req_data(
9684 req, struct dcerpc_srvsvc_NetServerTransportAddEx_state);
9687 if (tevent_req_is_nterror(req, &status)) {
9688 tevent_req_received(req);
9692 /* Steal possible out parameters to the callers context */
9693 talloc_steal(mem_ctx, state->out_mem_ctx);
9696 *result = state->orig.out.result;
9698 tevent_req_received(req);
9699 return NT_STATUS_OK;
9702 NTSTATUS dcerpc_srvsvc_NetServerTransportAddEx(struct dcerpc_binding_handle *h,
9703 TALLOC_CTX *mem_ctx,
9704 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9705 uint32_t _level /* [in] */,
9706 union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */,
9709 struct srvsvc_NetServerTransportAddEx r;
9713 r.in.server_unc = _server_unc;
9714 r.in.level = _level;
9717 status = dcerpc_srvsvc_NetServerTransportAddEx_r(h, mem_ctx, &r);
9718 if (!NT_STATUS_IS_OK(status)) {
9722 /* Return variables */
9725 *result = r.out.result;
9727 return NT_STATUS_OK;
9730 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_r_state {
9731 TALLOC_CTX *out_mem_ctx;
9734 static void dcerpc_srvsvc_NetServerSetServiceBitsEx_r_done(struct tevent_req *subreq);
9736 struct tevent_req *dcerpc_srvsvc_NetServerSetServiceBitsEx_r_send(TALLOC_CTX *mem_ctx,
9737 struct tevent_context *ev,
9738 struct dcerpc_binding_handle *h,
9739 struct srvsvc_NetServerSetServiceBitsEx *r)
9741 struct tevent_req *req;
9742 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_r_state *state;
9743 struct tevent_req *subreq;
9745 req = tevent_req_create(mem_ctx, &state,
9746 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_r_state);
9751 state->out_mem_ctx = NULL;
9752 subreq = dcerpc_binding_handle_call_send(state, ev, h,
9753 NULL, &ndr_table_srvsvc,
9754 NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, state, r);
9755 if (tevent_req_nomem(subreq, req)) {
9756 return tevent_req_post(req, ev);
9758 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetServerSetServiceBitsEx_r_done, req);
9763 static void dcerpc_srvsvc_NetServerSetServiceBitsEx_r_done(struct tevent_req *subreq)
9765 struct tevent_req *req =
9766 tevent_req_callback_data(subreq,
9770 status = dcerpc_binding_handle_call_recv(subreq);
9771 if (!NT_STATUS_IS_OK(status)) {
9772 tevent_req_nterror(req, status);
9776 tevent_req_done(req);
9779 NTSTATUS dcerpc_srvsvc_NetServerSetServiceBitsEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9781 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_r_state *state =
9782 tevent_req_data(req,
9783 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_r_state);
9786 if (tevent_req_is_nterror(req, &status)) {
9787 tevent_req_received(req);
9791 talloc_steal(mem_ctx, state->out_mem_ctx);
9793 tevent_req_received(req);
9794 return NT_STATUS_OK;
9797 NTSTATUS dcerpc_srvsvc_NetServerSetServiceBitsEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct srvsvc_NetServerSetServiceBitsEx *r)
9801 status = dcerpc_binding_handle_call(h,
9802 NULL, &ndr_table_srvsvc,
9803 NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, mem_ctx, r);
9808 NTSTATUS dcerpc_srvsvc_NetServerSetServiceBitsEx_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct srvsvc_NetServerSetServiceBitsEx *r)
9812 status = dcerpc_srvsvc_NetServerSetServiceBitsEx_r(p->binding_handle, mem_ctx, r);
9814 if (NT_STATUS_IS_RPC(status)) {
9815 status = NT_STATUS_NET_WRITE_FAULT;
9821 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_state {
9822 struct srvsvc_NetServerSetServiceBitsEx orig;
9823 struct srvsvc_NetServerSetServiceBitsEx tmp;
9824 TALLOC_CTX *out_mem_ctx;
9827 static void dcerpc_srvsvc_NetServerSetServiceBitsEx_done(struct tevent_req *subreq);
9829 struct tevent_req *dcerpc_srvsvc_NetServerSetServiceBitsEx_send(TALLOC_CTX *mem_ctx,
9830 struct tevent_context *ev,
9831 struct dcerpc_binding_handle *h,
9832 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9833 const char *_emulated_server_unc /* [in] [unique,charset(UTF16)] */,
9834 const char *_transport /* [in] [unique,charset(UTF16)] */,
9835 uint32_t _servicebitsofinterest /* [in] */,
9836 uint32_t _servicebits /* [in] */,
9837 uint32_t _updateimmediately /* [in] */)
9839 struct tevent_req *req;
9840 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_state *state;
9841 struct tevent_req *subreq;
9843 req = tevent_req_create(mem_ctx, &state,
9844 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_state);
9848 state->out_mem_ctx = NULL;
9851 state->orig.in.server_unc = _server_unc;
9852 state->orig.in.emulated_server_unc = _emulated_server_unc;
9853 state->orig.in.transport = _transport;
9854 state->orig.in.servicebitsofinterest = _servicebitsofinterest;
9855 state->orig.in.servicebits = _servicebits;
9856 state->orig.in.updateimmediately = _updateimmediately;
9858 /* Out parameters */
9861 ZERO_STRUCT(state->orig.out.result);
9863 /* make a temporary copy, that we pass to the dispatch function */
9864 state->tmp = state->orig;
9866 subreq = dcerpc_srvsvc_NetServerSetServiceBitsEx_r_send(state, ev, h, &state->tmp);
9867 if (tevent_req_nomem(subreq, req)) {
9868 return tevent_req_post(req, ev);
9870 tevent_req_set_callback(subreq, dcerpc_srvsvc_NetServerSetServiceBitsEx_done, req);
9874 static void dcerpc_srvsvc_NetServerSetServiceBitsEx_done(struct tevent_req *subreq)
9876 struct tevent_req *req = tevent_req_callback_data(
9877 subreq, struct tevent_req);
9878 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_state *state = tevent_req_data(
9879 req, struct dcerpc_srvsvc_NetServerSetServiceBitsEx_state);
9881 TALLOC_CTX *mem_ctx;
9883 if (state->out_mem_ctx) {
9884 mem_ctx = state->out_mem_ctx;
9889 status = dcerpc_srvsvc_NetServerSetServiceBitsEx_r_recv(subreq, mem_ctx);
9890 TALLOC_FREE(subreq);
9891 if (!NT_STATUS_IS_OK(status)) {
9892 tevent_req_nterror(req, status);
9896 /* Copy out parameters */
9899 state->orig.out.result = state->tmp.out.result;
9901 /* Reset temporary structure */
9902 ZERO_STRUCT(state->tmp);
9904 tevent_req_done(req);
9907 NTSTATUS dcerpc_srvsvc_NetServerSetServiceBitsEx_recv(struct tevent_req *req,
9908 TALLOC_CTX *mem_ctx,
9911 struct dcerpc_srvsvc_NetServerSetServiceBitsEx_state *state = tevent_req_data(
9912 req, struct dcerpc_srvsvc_NetServerSetServiceBitsEx_state);
9915 if (tevent_req_is_nterror(req, &status)) {
9916 tevent_req_received(req);
9920 /* Steal possible out parameters to the callers context */
9921 talloc_steal(mem_ctx, state->out_mem_ctx);
9924 *result = state->orig.out.result;
9926 tevent_req_received(req);
9927 return NT_STATUS_OK;
9930 NTSTATUS dcerpc_srvsvc_NetServerSetServiceBitsEx(struct dcerpc_binding_handle *h,
9931 TALLOC_CTX *mem_ctx,
9932 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
9933 const char *_emulated_server_unc /* [in] [unique,charset(UTF16)] */,
9934 const char *_transport /* [in] [unique,charset(UTF16)] */,
9935 uint32_t _servicebitsofinterest /* [in] */,
9936 uint32_t _servicebits /* [in] */,
9937 uint32_t _updateimmediately /* [in] */,
9940 struct srvsvc_NetServerSetServiceBitsEx r;
9944 r.in.server_unc = _server_unc;
9945 r.in.emulated_server_unc = _emulated_server_unc;
9946 r.in.transport = _transport;
9947 r.in.servicebitsofinterest = _servicebitsofinterest;
9948 r.in.servicebits = _servicebits;
9949 r.in.updateimmediately = _updateimmediately;
9951 status = dcerpc_srvsvc_NetServerSetServiceBitsEx_r(h, mem_ctx, &r);
9952 if (!NT_STATUS_IS_OK(status)) {
9956 /* Return variables */
9959 *result = r.out.result;
9961 return NT_STATUS_OK;