s3-libads: Use a reducing page size to try and cope with a slow LDAP server
[Samba.git] / librpc / gen_ndr / cli_epmapper.c
blobfcfefbcfaca397c445620924be3887a1ab3871e8
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_epmapper.h"
9 struct rpccli_epm_Insert_state {
10 struct epm_Insert orig;
11 struct epm_Insert tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_epm_Insert_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_epm_Insert_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint32_t _num_ents /* [in] */,
22 struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */,
23 uint32_t _replace /* [in] */)
25 struct tevent_req *req;
26 struct rpccli_epm_Insert_state *state;
27 struct tevent_req *subreq;
29 req = tevent_req_create(mem_ctx, &state,
30 struct rpccli_epm_Insert_state);
31 if (req == NULL) {
32 return NULL;
34 state->out_mem_ctx = NULL;
35 state->dispatch_recv = cli->dispatch_recv;
37 /* In parameters */
38 state->orig.in.num_ents = _num_ents;
39 state->orig.in.entries = _entries;
40 state->orig.in.replace = _replace;
42 /* Out parameters */
44 /* Result */
45 ZERO_STRUCT(state->orig.out.result);
47 /* make a temporary copy, that we pass to the dispatch function */
48 state->tmp = state->orig;
50 subreq = cli->dispatch_send(state, ev, cli,
51 &ndr_table_epmapper,
52 NDR_EPM_INSERT,
53 &state->tmp);
54 if (tevent_req_nomem(subreq, req)) {
55 return tevent_req_post(req, ev);
57 tevent_req_set_callback(subreq, rpccli_epm_Insert_done, req);
58 return req;
61 static void rpccli_epm_Insert_done(struct tevent_req *subreq)
63 struct tevent_req *req = tevent_req_callback_data(
64 subreq, struct tevent_req);
65 struct rpccli_epm_Insert_state *state = tevent_req_data(
66 req, struct rpccli_epm_Insert_state);
67 NTSTATUS status;
68 TALLOC_CTX *mem_ctx;
70 if (state->out_mem_ctx) {
71 mem_ctx = state->out_mem_ctx;
72 } else {
73 mem_ctx = state;
76 status = state->dispatch_recv(subreq, mem_ctx);
77 TALLOC_FREE(subreq);
78 if (!NT_STATUS_IS_OK(status)) {
79 tevent_req_nterror(req, status);
80 return;
83 /* Copy out parameters */
85 /* Copy result */
86 state->orig.out.result = state->tmp.out.result;
88 /* Reset temporary structure */
89 ZERO_STRUCT(state->tmp);
91 tevent_req_done(req);
94 NTSTATUS rpccli_epm_Insert_recv(struct tevent_req *req,
95 TALLOC_CTX *mem_ctx,
96 uint32 *result)
98 struct rpccli_epm_Insert_state *state = tevent_req_data(
99 req, struct rpccli_epm_Insert_state);
100 NTSTATUS status;
102 if (tevent_req_is_nterror(req, &status)) {
103 tevent_req_received(req);
104 return status;
107 /* Steal possbile out parameters to the callers context */
108 talloc_steal(mem_ctx, state->out_mem_ctx);
110 /* Return result */
111 *result = state->orig.out.result;
113 tevent_req_received(req);
114 return NT_STATUS_OK;
117 NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli,
118 TALLOC_CTX *mem_ctx,
119 uint32_t num_ents /* [in] */,
120 struct epm_entry_t *entries /* [in] [size_is(num_ents)] */,
121 uint32_t replace /* [in] */)
123 struct epm_Insert r;
124 NTSTATUS status;
126 /* In parameters */
127 r.in.num_ents = num_ents;
128 r.in.entries = entries;
129 r.in.replace = replace;
131 status = cli->dispatch(cli,
132 mem_ctx,
133 &ndr_table_epmapper,
134 NDR_EPM_INSERT,
135 &r);
137 if (!NT_STATUS_IS_OK(status)) {
138 return status;
141 if (NT_STATUS_IS_ERR(status)) {
142 return status;
145 /* Return variables */
147 /* Return result */
148 return NT_STATUS_OK;
151 struct rpccli_epm_Delete_state {
152 struct epm_Delete orig;
153 struct epm_Delete tmp;
154 TALLOC_CTX *out_mem_ctx;
155 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
158 static void rpccli_epm_Delete_done(struct tevent_req *subreq);
160 struct tevent_req *rpccli_epm_Delete_send(TALLOC_CTX *mem_ctx,
161 struct tevent_context *ev,
162 struct rpc_pipe_client *cli,
163 uint32_t _num_ents /* [in] */,
164 struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */)
166 struct tevent_req *req;
167 struct rpccli_epm_Delete_state *state;
168 struct tevent_req *subreq;
170 req = tevent_req_create(mem_ctx, &state,
171 struct rpccli_epm_Delete_state);
172 if (req == NULL) {
173 return NULL;
175 state->out_mem_ctx = NULL;
176 state->dispatch_recv = cli->dispatch_recv;
178 /* In parameters */
179 state->orig.in.num_ents = _num_ents;
180 state->orig.in.entries = _entries;
182 /* Out parameters */
184 /* Result */
185 ZERO_STRUCT(state->orig.out.result);
187 /* make a temporary copy, that we pass to the dispatch function */
188 state->tmp = state->orig;
190 subreq = cli->dispatch_send(state, ev, cli,
191 &ndr_table_epmapper,
192 NDR_EPM_DELETE,
193 &state->tmp);
194 if (tevent_req_nomem(subreq, req)) {
195 return tevent_req_post(req, ev);
197 tevent_req_set_callback(subreq, rpccli_epm_Delete_done, req);
198 return req;
201 static void rpccli_epm_Delete_done(struct tevent_req *subreq)
203 struct tevent_req *req = tevent_req_callback_data(
204 subreq, struct tevent_req);
205 struct rpccli_epm_Delete_state *state = tevent_req_data(
206 req, struct rpccli_epm_Delete_state);
207 NTSTATUS status;
208 TALLOC_CTX *mem_ctx;
210 if (state->out_mem_ctx) {
211 mem_ctx = state->out_mem_ctx;
212 } else {
213 mem_ctx = state;
216 status = state->dispatch_recv(subreq, mem_ctx);
217 TALLOC_FREE(subreq);
218 if (!NT_STATUS_IS_OK(status)) {
219 tevent_req_nterror(req, status);
220 return;
223 /* Copy out parameters */
225 /* Copy result */
226 state->orig.out.result = state->tmp.out.result;
228 /* Reset temporary structure */
229 ZERO_STRUCT(state->tmp);
231 tevent_req_done(req);
234 NTSTATUS rpccli_epm_Delete_recv(struct tevent_req *req,
235 TALLOC_CTX *mem_ctx,
236 uint32 *result)
238 struct rpccli_epm_Delete_state *state = tevent_req_data(
239 req, struct rpccli_epm_Delete_state);
240 NTSTATUS status;
242 if (tevent_req_is_nterror(req, &status)) {
243 tevent_req_received(req);
244 return status;
247 /* Steal possbile out parameters to the callers context */
248 talloc_steal(mem_ctx, state->out_mem_ctx);
250 /* Return result */
251 *result = state->orig.out.result;
253 tevent_req_received(req);
254 return NT_STATUS_OK;
257 NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli,
258 TALLOC_CTX *mem_ctx,
259 uint32_t num_ents /* [in] */,
260 struct epm_entry_t *entries /* [in] [size_is(num_ents)] */)
262 struct epm_Delete r;
263 NTSTATUS status;
265 /* In parameters */
266 r.in.num_ents = num_ents;
267 r.in.entries = entries;
269 status = cli->dispatch(cli,
270 mem_ctx,
271 &ndr_table_epmapper,
272 NDR_EPM_DELETE,
273 &r);
275 if (!NT_STATUS_IS_OK(status)) {
276 return status;
279 if (NT_STATUS_IS_ERR(status)) {
280 return status;
283 /* Return variables */
285 /* Return result */
286 return NT_STATUS_OK;
289 struct rpccli_epm_Lookup_state {
290 struct epm_Lookup orig;
291 struct epm_Lookup tmp;
292 TALLOC_CTX *out_mem_ctx;
293 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
296 static void rpccli_epm_Lookup_done(struct tevent_req *subreq);
298 struct tevent_req *rpccli_epm_Lookup_send(TALLOC_CTX *mem_ctx,
299 struct tevent_context *ev,
300 struct rpc_pipe_client *cli,
301 uint32_t _inquiry_type /* [in] */,
302 struct GUID *_object /* [in] [ptr] */,
303 struct rpc_if_id_t *_interface_id /* [in] [ptr] */,
304 uint32_t _vers_option /* [in] */,
305 struct policy_handle *_entry_handle /* [in,out] [ref] */,
306 uint32_t _max_ents /* [in] */,
307 uint32_t *_num_ents /* [out] [ref] */,
308 struct epm_entry_t *_entries /* [out] [length_is(*num_ents),size_is(max_ents)] */)
310 struct tevent_req *req;
311 struct rpccli_epm_Lookup_state *state;
312 struct tevent_req *subreq;
314 req = tevent_req_create(mem_ctx, &state,
315 struct rpccli_epm_Lookup_state);
316 if (req == NULL) {
317 return NULL;
319 state->out_mem_ctx = NULL;
320 state->dispatch_recv = cli->dispatch_recv;
322 /* In parameters */
323 state->orig.in.inquiry_type = _inquiry_type;
324 state->orig.in.object = _object;
325 state->orig.in.interface_id = _interface_id;
326 state->orig.in.vers_option = _vers_option;
327 state->orig.in.entry_handle = _entry_handle;
328 state->orig.in.max_ents = _max_ents;
330 /* Out parameters */
331 state->orig.out.entry_handle = _entry_handle;
332 state->orig.out.num_ents = _num_ents;
333 state->orig.out.entries = _entries;
335 /* Result */
336 ZERO_STRUCT(state->orig.out.result);
338 state->out_mem_ctx = talloc_named_const(state, 0,
339 "rpccli_epm_Lookup_out_memory");
340 if (tevent_req_nomem(state->out_mem_ctx, req)) {
341 return tevent_req_post(req, ev);
344 /* make a temporary copy, that we pass to the dispatch function */
345 state->tmp = state->orig;
347 subreq = cli->dispatch_send(state, ev, cli,
348 &ndr_table_epmapper,
349 NDR_EPM_LOOKUP,
350 &state->tmp);
351 if (tevent_req_nomem(subreq, req)) {
352 return tevent_req_post(req, ev);
354 tevent_req_set_callback(subreq, rpccli_epm_Lookup_done, req);
355 return req;
358 static void rpccli_epm_Lookup_done(struct tevent_req *subreq)
360 struct tevent_req *req = tevent_req_callback_data(
361 subreq, struct tevent_req);
362 struct rpccli_epm_Lookup_state *state = tevent_req_data(
363 req, struct rpccli_epm_Lookup_state);
364 NTSTATUS status;
365 TALLOC_CTX *mem_ctx;
367 if (state->out_mem_ctx) {
368 mem_ctx = state->out_mem_ctx;
369 } else {
370 mem_ctx = state;
373 status = state->dispatch_recv(subreq, mem_ctx);
374 TALLOC_FREE(subreq);
375 if (!NT_STATUS_IS_OK(status)) {
376 tevent_req_nterror(req, status);
377 return;
380 /* Copy out parameters */
381 *state->orig.out.entry_handle = *state->tmp.out.entry_handle;
382 *state->orig.out.num_ents = *state->tmp.out.num_ents;
383 if ((*state->tmp.out.num_ents) > (state->tmp.in.max_ents)) {
384 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
385 return;
387 memcpy(state->orig.out.entries, state->tmp.out.entries, (*state->tmp.out.num_ents) * sizeof(*state->orig.out.entries));
389 /* Copy result */
390 state->orig.out.result = state->tmp.out.result;
392 /* Reset temporary structure */
393 ZERO_STRUCT(state->tmp);
395 tevent_req_done(req);
398 NTSTATUS rpccli_epm_Lookup_recv(struct tevent_req *req,
399 TALLOC_CTX *mem_ctx,
400 uint32 *result)
402 struct rpccli_epm_Lookup_state *state = tevent_req_data(
403 req, struct rpccli_epm_Lookup_state);
404 NTSTATUS status;
406 if (tevent_req_is_nterror(req, &status)) {
407 tevent_req_received(req);
408 return status;
411 /* Steal possbile out parameters to the callers context */
412 talloc_steal(mem_ctx, state->out_mem_ctx);
414 /* Return result */
415 *result = state->orig.out.result;
417 tevent_req_received(req);
418 return NT_STATUS_OK;
421 NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli,
422 TALLOC_CTX *mem_ctx,
423 uint32_t inquiry_type /* [in] */,
424 struct GUID *object /* [in] [ptr] */,
425 struct rpc_if_id_t *interface_id /* [in] [ptr] */,
426 uint32_t vers_option /* [in] */,
427 struct policy_handle *entry_handle /* [in,out] [ref] */,
428 uint32_t max_ents /* [in] */,
429 uint32_t *num_ents /* [out] [ref] */,
430 struct epm_entry_t *entries /* [out] [length_is(*num_ents),size_is(max_ents)] */)
432 struct epm_Lookup r;
433 NTSTATUS status;
435 /* In parameters */
436 r.in.inquiry_type = inquiry_type;
437 r.in.object = object;
438 r.in.interface_id = interface_id;
439 r.in.vers_option = vers_option;
440 r.in.entry_handle = entry_handle;
441 r.in.max_ents = max_ents;
443 status = cli->dispatch(cli,
444 mem_ctx,
445 &ndr_table_epmapper,
446 NDR_EPM_LOOKUP,
447 &r);
449 if (!NT_STATUS_IS_OK(status)) {
450 return status;
453 if (NT_STATUS_IS_ERR(status)) {
454 return status;
457 /* Return variables */
458 *entry_handle = *r.out.entry_handle;
459 *num_ents = *r.out.num_ents;
460 if ((*r.out.num_ents) > (r.in.max_ents)) {
461 return NT_STATUS_INVALID_NETWORK_RESPONSE;
463 memcpy(entries, r.out.entries, (*r.out.num_ents) * sizeof(*entries));
465 /* Return result */
466 return NT_STATUS_OK;
469 struct rpccli_epm_Map_state {
470 struct epm_Map orig;
471 struct epm_Map tmp;
472 TALLOC_CTX *out_mem_ctx;
473 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
476 static void rpccli_epm_Map_done(struct tevent_req *subreq);
478 struct tevent_req *rpccli_epm_Map_send(TALLOC_CTX *mem_ctx,
479 struct tevent_context *ev,
480 struct rpc_pipe_client *cli,
481 struct GUID *_object /* [in] [ptr] */,
482 struct epm_twr_t *_map_tower /* [in] [ptr] */,
483 struct policy_handle *_entry_handle /* [in,out] [ref] */,
484 uint32_t _max_towers /* [in] */,
485 uint32_t *_num_towers /* [out] [ref] */,
486 struct epm_twr_p_t *_towers /* [out] [length_is(*num_towers),size_is(max_towers)] */)
488 struct tevent_req *req;
489 struct rpccli_epm_Map_state *state;
490 struct tevent_req *subreq;
492 req = tevent_req_create(mem_ctx, &state,
493 struct rpccli_epm_Map_state);
494 if (req == NULL) {
495 return NULL;
497 state->out_mem_ctx = NULL;
498 state->dispatch_recv = cli->dispatch_recv;
500 /* In parameters */
501 state->orig.in.object = _object;
502 state->orig.in.map_tower = _map_tower;
503 state->orig.in.entry_handle = _entry_handle;
504 state->orig.in.max_towers = _max_towers;
506 /* Out parameters */
507 state->orig.out.entry_handle = _entry_handle;
508 state->orig.out.num_towers = _num_towers;
509 state->orig.out.towers = _towers;
511 /* Result */
512 ZERO_STRUCT(state->orig.out.result);
514 state->out_mem_ctx = talloc_named_const(state, 0,
515 "rpccli_epm_Map_out_memory");
516 if (tevent_req_nomem(state->out_mem_ctx, req)) {
517 return tevent_req_post(req, ev);
520 /* make a temporary copy, that we pass to the dispatch function */
521 state->tmp = state->orig;
523 subreq = cli->dispatch_send(state, ev, cli,
524 &ndr_table_epmapper,
525 NDR_EPM_MAP,
526 &state->tmp);
527 if (tevent_req_nomem(subreq, req)) {
528 return tevent_req_post(req, ev);
530 tevent_req_set_callback(subreq, rpccli_epm_Map_done, req);
531 return req;
534 static void rpccli_epm_Map_done(struct tevent_req *subreq)
536 struct tevent_req *req = tevent_req_callback_data(
537 subreq, struct tevent_req);
538 struct rpccli_epm_Map_state *state = tevent_req_data(
539 req, struct rpccli_epm_Map_state);
540 NTSTATUS status;
541 TALLOC_CTX *mem_ctx;
543 if (state->out_mem_ctx) {
544 mem_ctx = state->out_mem_ctx;
545 } else {
546 mem_ctx = state;
549 status = state->dispatch_recv(subreq, mem_ctx);
550 TALLOC_FREE(subreq);
551 if (!NT_STATUS_IS_OK(status)) {
552 tevent_req_nterror(req, status);
553 return;
556 /* Copy out parameters */
557 *state->orig.out.entry_handle = *state->tmp.out.entry_handle;
558 *state->orig.out.num_towers = *state->tmp.out.num_towers;
559 if ((*state->tmp.out.num_towers) > (state->tmp.in.max_towers)) {
560 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
561 return;
563 memcpy(state->orig.out.towers, state->tmp.out.towers, (*state->tmp.out.num_towers) * sizeof(*state->orig.out.towers));
565 /* Copy result */
566 state->orig.out.result = state->tmp.out.result;
568 /* Reset temporary structure */
569 ZERO_STRUCT(state->tmp);
571 tevent_req_done(req);
574 NTSTATUS rpccli_epm_Map_recv(struct tevent_req *req,
575 TALLOC_CTX *mem_ctx,
576 uint32 *result)
578 struct rpccli_epm_Map_state *state = tevent_req_data(
579 req, struct rpccli_epm_Map_state);
580 NTSTATUS status;
582 if (tevent_req_is_nterror(req, &status)) {
583 tevent_req_received(req);
584 return status;
587 /* Steal possbile out parameters to the callers context */
588 talloc_steal(mem_ctx, state->out_mem_ctx);
590 /* Return result */
591 *result = state->orig.out.result;
593 tevent_req_received(req);
594 return NT_STATUS_OK;
597 NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli,
598 TALLOC_CTX *mem_ctx,
599 struct GUID *object /* [in] [ptr] */,
600 struct epm_twr_t *map_tower /* [in] [ptr] */,
601 struct policy_handle *entry_handle /* [in,out] [ref] */,
602 uint32_t max_towers /* [in] */,
603 uint32_t *num_towers /* [out] [ref] */,
604 struct epm_twr_p_t *towers /* [out] [length_is(*num_towers),size_is(max_towers)] */)
606 struct epm_Map r;
607 NTSTATUS status;
609 /* In parameters */
610 r.in.object = object;
611 r.in.map_tower = map_tower;
612 r.in.entry_handle = entry_handle;
613 r.in.max_towers = max_towers;
615 status = cli->dispatch(cli,
616 mem_ctx,
617 &ndr_table_epmapper,
618 NDR_EPM_MAP,
619 &r);
621 if (!NT_STATUS_IS_OK(status)) {
622 return status;
625 if (NT_STATUS_IS_ERR(status)) {
626 return status;
629 /* Return variables */
630 *entry_handle = *r.out.entry_handle;
631 *num_towers = *r.out.num_towers;
632 if ((*r.out.num_towers) > (r.in.max_towers)) {
633 return NT_STATUS_INVALID_NETWORK_RESPONSE;
635 memcpy(towers, r.out.towers, (*r.out.num_towers) * sizeof(*towers));
637 /* Return result */
638 return NT_STATUS_OK;
641 struct rpccli_epm_LookupHandleFree_state {
642 struct epm_LookupHandleFree orig;
643 struct epm_LookupHandleFree tmp;
644 TALLOC_CTX *out_mem_ctx;
645 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
648 static void rpccli_epm_LookupHandleFree_done(struct tevent_req *subreq);
650 struct tevent_req *rpccli_epm_LookupHandleFree_send(TALLOC_CTX *mem_ctx,
651 struct tevent_context *ev,
652 struct rpc_pipe_client *cli,
653 struct policy_handle *_entry_handle /* [in,out] [ref] */)
655 struct tevent_req *req;
656 struct rpccli_epm_LookupHandleFree_state *state;
657 struct tevent_req *subreq;
659 req = tevent_req_create(mem_ctx, &state,
660 struct rpccli_epm_LookupHandleFree_state);
661 if (req == NULL) {
662 return NULL;
664 state->out_mem_ctx = NULL;
665 state->dispatch_recv = cli->dispatch_recv;
667 /* In parameters */
668 state->orig.in.entry_handle = _entry_handle;
670 /* Out parameters */
671 state->orig.out.entry_handle = _entry_handle;
673 /* Result */
674 ZERO_STRUCT(state->orig.out.result);
676 state->out_mem_ctx = talloc_named_const(state, 0,
677 "rpccli_epm_LookupHandleFree_out_memory");
678 if (tevent_req_nomem(state->out_mem_ctx, req)) {
679 return tevent_req_post(req, ev);
682 /* make a temporary copy, that we pass to the dispatch function */
683 state->tmp = state->orig;
685 subreq = cli->dispatch_send(state, ev, cli,
686 &ndr_table_epmapper,
687 NDR_EPM_LOOKUPHANDLEFREE,
688 &state->tmp);
689 if (tevent_req_nomem(subreq, req)) {
690 return tevent_req_post(req, ev);
692 tevent_req_set_callback(subreq, rpccli_epm_LookupHandleFree_done, req);
693 return req;
696 static void rpccli_epm_LookupHandleFree_done(struct tevent_req *subreq)
698 struct tevent_req *req = tevent_req_callback_data(
699 subreq, struct tevent_req);
700 struct rpccli_epm_LookupHandleFree_state *state = tevent_req_data(
701 req, struct rpccli_epm_LookupHandleFree_state);
702 NTSTATUS status;
703 TALLOC_CTX *mem_ctx;
705 if (state->out_mem_ctx) {
706 mem_ctx = state->out_mem_ctx;
707 } else {
708 mem_ctx = state;
711 status = state->dispatch_recv(subreq, mem_ctx);
712 TALLOC_FREE(subreq);
713 if (!NT_STATUS_IS_OK(status)) {
714 tevent_req_nterror(req, status);
715 return;
718 /* Copy out parameters */
719 *state->orig.out.entry_handle = *state->tmp.out.entry_handle;
721 /* Copy result */
722 state->orig.out.result = state->tmp.out.result;
724 /* Reset temporary structure */
725 ZERO_STRUCT(state->tmp);
727 tevent_req_done(req);
730 NTSTATUS rpccli_epm_LookupHandleFree_recv(struct tevent_req *req,
731 TALLOC_CTX *mem_ctx,
732 uint32 *result)
734 struct rpccli_epm_LookupHandleFree_state *state = tevent_req_data(
735 req, struct rpccli_epm_LookupHandleFree_state);
736 NTSTATUS status;
738 if (tevent_req_is_nterror(req, &status)) {
739 tevent_req_received(req);
740 return status;
743 /* Steal possbile out parameters to the callers context */
744 talloc_steal(mem_ctx, state->out_mem_ctx);
746 /* Return result */
747 *result = state->orig.out.result;
749 tevent_req_received(req);
750 return NT_STATUS_OK;
753 NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli,
754 TALLOC_CTX *mem_ctx,
755 struct policy_handle *entry_handle /* [in,out] [ref] */)
757 struct epm_LookupHandleFree r;
758 NTSTATUS status;
760 /* In parameters */
761 r.in.entry_handle = entry_handle;
763 status = cli->dispatch(cli,
764 mem_ctx,
765 &ndr_table_epmapper,
766 NDR_EPM_LOOKUPHANDLEFREE,
767 &r);
769 if (!NT_STATUS_IS_OK(status)) {
770 return status;
773 if (NT_STATUS_IS_ERR(status)) {
774 return status;
777 /* Return variables */
778 *entry_handle = *r.out.entry_handle;
780 /* Return result */
781 return NT_STATUS_OK;
784 struct rpccli_epm_InqObject_state {
785 struct epm_InqObject orig;
786 struct epm_InqObject tmp;
787 TALLOC_CTX *out_mem_ctx;
788 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
791 static void rpccli_epm_InqObject_done(struct tevent_req *subreq);
793 struct tevent_req *rpccli_epm_InqObject_send(TALLOC_CTX *mem_ctx,
794 struct tevent_context *ev,
795 struct rpc_pipe_client *cli,
796 struct GUID *_epm_object /* [in] [ref] */)
798 struct tevent_req *req;
799 struct rpccli_epm_InqObject_state *state;
800 struct tevent_req *subreq;
802 req = tevent_req_create(mem_ctx, &state,
803 struct rpccli_epm_InqObject_state);
804 if (req == NULL) {
805 return NULL;
807 state->out_mem_ctx = NULL;
808 state->dispatch_recv = cli->dispatch_recv;
810 /* In parameters */
811 state->orig.in.epm_object = _epm_object;
813 /* Out parameters */
815 /* Result */
816 ZERO_STRUCT(state->orig.out.result);
818 /* make a temporary copy, that we pass to the dispatch function */
819 state->tmp = state->orig;
821 subreq = cli->dispatch_send(state, ev, cli,
822 &ndr_table_epmapper,
823 NDR_EPM_INQOBJECT,
824 &state->tmp);
825 if (tevent_req_nomem(subreq, req)) {
826 return tevent_req_post(req, ev);
828 tevent_req_set_callback(subreq, rpccli_epm_InqObject_done, req);
829 return req;
832 static void rpccli_epm_InqObject_done(struct tevent_req *subreq)
834 struct tevent_req *req = tevent_req_callback_data(
835 subreq, struct tevent_req);
836 struct rpccli_epm_InqObject_state *state = tevent_req_data(
837 req, struct rpccli_epm_InqObject_state);
838 NTSTATUS status;
839 TALLOC_CTX *mem_ctx;
841 if (state->out_mem_ctx) {
842 mem_ctx = state->out_mem_ctx;
843 } else {
844 mem_ctx = state;
847 status = state->dispatch_recv(subreq, mem_ctx);
848 TALLOC_FREE(subreq);
849 if (!NT_STATUS_IS_OK(status)) {
850 tevent_req_nterror(req, status);
851 return;
854 /* Copy out parameters */
856 /* Copy result */
857 state->orig.out.result = state->tmp.out.result;
859 /* Reset temporary structure */
860 ZERO_STRUCT(state->tmp);
862 tevent_req_done(req);
865 NTSTATUS rpccli_epm_InqObject_recv(struct tevent_req *req,
866 TALLOC_CTX *mem_ctx,
867 uint32 *result)
869 struct rpccli_epm_InqObject_state *state = tevent_req_data(
870 req, struct rpccli_epm_InqObject_state);
871 NTSTATUS status;
873 if (tevent_req_is_nterror(req, &status)) {
874 tevent_req_received(req);
875 return status;
878 /* Steal possbile out parameters to the callers context */
879 talloc_steal(mem_ctx, state->out_mem_ctx);
881 /* Return result */
882 *result = state->orig.out.result;
884 tevent_req_received(req);
885 return NT_STATUS_OK;
888 NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli,
889 TALLOC_CTX *mem_ctx,
890 struct GUID *epm_object /* [in] [ref] */)
892 struct epm_InqObject r;
893 NTSTATUS status;
895 /* In parameters */
896 r.in.epm_object = epm_object;
898 status = cli->dispatch(cli,
899 mem_ctx,
900 &ndr_table_epmapper,
901 NDR_EPM_INQOBJECT,
902 &r);
904 if (!NT_STATUS_IS_OK(status)) {
905 return status;
908 if (NT_STATUS_IS_ERR(status)) {
909 return status;
912 /* Return variables */
914 /* Return result */
915 return NT_STATUS_OK;
918 struct rpccli_epm_MgmtDelete_state {
919 struct epm_MgmtDelete orig;
920 struct epm_MgmtDelete tmp;
921 TALLOC_CTX *out_mem_ctx;
922 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
925 static void rpccli_epm_MgmtDelete_done(struct tevent_req *subreq);
927 struct tevent_req *rpccli_epm_MgmtDelete_send(TALLOC_CTX *mem_ctx,
928 struct tevent_context *ev,
929 struct rpc_pipe_client *cli,
930 uint32_t _object_speced /* [in] */,
931 struct GUID *_object /* [in] [ptr] */,
932 struct epm_twr_t *_tower /* [in] [ptr] */)
934 struct tevent_req *req;
935 struct rpccli_epm_MgmtDelete_state *state;
936 struct tevent_req *subreq;
938 req = tevent_req_create(mem_ctx, &state,
939 struct rpccli_epm_MgmtDelete_state);
940 if (req == NULL) {
941 return NULL;
943 state->out_mem_ctx = NULL;
944 state->dispatch_recv = cli->dispatch_recv;
946 /* In parameters */
947 state->orig.in.object_speced = _object_speced;
948 state->orig.in.object = _object;
949 state->orig.in.tower = _tower;
951 /* Out parameters */
953 /* Result */
954 ZERO_STRUCT(state->orig.out.result);
956 /* make a temporary copy, that we pass to the dispatch function */
957 state->tmp = state->orig;
959 subreq = cli->dispatch_send(state, ev, cli,
960 &ndr_table_epmapper,
961 NDR_EPM_MGMTDELETE,
962 &state->tmp);
963 if (tevent_req_nomem(subreq, req)) {
964 return tevent_req_post(req, ev);
966 tevent_req_set_callback(subreq, rpccli_epm_MgmtDelete_done, req);
967 return req;
970 static void rpccli_epm_MgmtDelete_done(struct tevent_req *subreq)
972 struct tevent_req *req = tevent_req_callback_data(
973 subreq, struct tevent_req);
974 struct rpccli_epm_MgmtDelete_state *state = tevent_req_data(
975 req, struct rpccli_epm_MgmtDelete_state);
976 NTSTATUS status;
977 TALLOC_CTX *mem_ctx;
979 if (state->out_mem_ctx) {
980 mem_ctx = state->out_mem_ctx;
981 } else {
982 mem_ctx = state;
985 status = state->dispatch_recv(subreq, mem_ctx);
986 TALLOC_FREE(subreq);
987 if (!NT_STATUS_IS_OK(status)) {
988 tevent_req_nterror(req, status);
989 return;
992 /* Copy out parameters */
994 /* Copy result */
995 state->orig.out.result = state->tmp.out.result;
997 /* Reset temporary structure */
998 ZERO_STRUCT(state->tmp);
1000 tevent_req_done(req);
1003 NTSTATUS rpccli_epm_MgmtDelete_recv(struct tevent_req *req,
1004 TALLOC_CTX *mem_ctx,
1005 uint32 *result)
1007 struct rpccli_epm_MgmtDelete_state *state = tevent_req_data(
1008 req, struct rpccli_epm_MgmtDelete_state);
1009 NTSTATUS status;
1011 if (tevent_req_is_nterror(req, &status)) {
1012 tevent_req_received(req);
1013 return status;
1016 /* Steal possbile out parameters to the callers context */
1017 talloc_steal(mem_ctx, state->out_mem_ctx);
1019 /* Return result */
1020 *result = state->orig.out.result;
1022 tevent_req_received(req);
1023 return NT_STATUS_OK;
1026 NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli,
1027 TALLOC_CTX *mem_ctx,
1028 uint32_t object_speced /* [in] */,
1029 struct GUID *object /* [in] [ptr] */,
1030 struct epm_twr_t *tower /* [in] [ptr] */)
1032 struct epm_MgmtDelete r;
1033 NTSTATUS status;
1035 /* In parameters */
1036 r.in.object_speced = object_speced;
1037 r.in.object = object;
1038 r.in.tower = tower;
1040 status = cli->dispatch(cli,
1041 mem_ctx,
1042 &ndr_table_epmapper,
1043 NDR_EPM_MGMTDELETE,
1044 &r);
1046 if (!NT_STATUS_IS_OK(status)) {
1047 return status;
1050 if (NT_STATUS_IS_ERR(status)) {
1051 return status;
1054 /* Return variables */
1056 /* Return result */
1057 return NT_STATUS_OK;
1060 struct rpccli_epm_MapAuth_state {
1061 struct epm_MapAuth orig;
1062 struct epm_MapAuth tmp;
1063 TALLOC_CTX *out_mem_ctx;
1064 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1067 static void rpccli_epm_MapAuth_done(struct tevent_req *subreq);
1069 struct tevent_req *rpccli_epm_MapAuth_send(TALLOC_CTX *mem_ctx,
1070 struct tevent_context *ev,
1071 struct rpc_pipe_client *cli)
1073 struct tevent_req *req;
1074 struct rpccli_epm_MapAuth_state *state;
1075 struct tevent_req *subreq;
1077 req = tevent_req_create(mem_ctx, &state,
1078 struct rpccli_epm_MapAuth_state);
1079 if (req == NULL) {
1080 return NULL;
1082 state->out_mem_ctx = NULL;
1083 state->dispatch_recv = cli->dispatch_recv;
1085 /* In parameters */
1087 /* Out parameters */
1089 /* Result */
1090 ZERO_STRUCT(state->orig.out.result);
1092 /* make a temporary copy, that we pass to the dispatch function */
1093 state->tmp = state->orig;
1095 subreq = cli->dispatch_send(state, ev, cli,
1096 &ndr_table_epmapper,
1097 NDR_EPM_MAPAUTH,
1098 &state->tmp);
1099 if (tevent_req_nomem(subreq, req)) {
1100 return tevent_req_post(req, ev);
1102 tevent_req_set_callback(subreq, rpccli_epm_MapAuth_done, req);
1103 return req;
1106 static void rpccli_epm_MapAuth_done(struct tevent_req *subreq)
1108 struct tevent_req *req = tevent_req_callback_data(
1109 subreq, struct tevent_req);
1110 struct rpccli_epm_MapAuth_state *state = tevent_req_data(
1111 req, struct rpccli_epm_MapAuth_state);
1112 NTSTATUS status;
1113 TALLOC_CTX *mem_ctx;
1115 if (state->out_mem_ctx) {
1116 mem_ctx = state->out_mem_ctx;
1117 } else {
1118 mem_ctx = state;
1121 status = state->dispatch_recv(subreq, mem_ctx);
1122 TALLOC_FREE(subreq);
1123 if (!NT_STATUS_IS_OK(status)) {
1124 tevent_req_nterror(req, status);
1125 return;
1128 /* Copy out parameters */
1130 /* Copy result */
1131 state->orig.out.result = state->tmp.out.result;
1133 /* Reset temporary structure */
1134 ZERO_STRUCT(state->tmp);
1136 tevent_req_done(req);
1139 NTSTATUS rpccli_epm_MapAuth_recv(struct tevent_req *req,
1140 TALLOC_CTX *mem_ctx,
1141 uint32 *result)
1143 struct rpccli_epm_MapAuth_state *state = tevent_req_data(
1144 req, struct rpccli_epm_MapAuth_state);
1145 NTSTATUS status;
1147 if (tevent_req_is_nterror(req, &status)) {
1148 tevent_req_received(req);
1149 return status;
1152 /* Steal possbile out parameters to the callers context */
1153 talloc_steal(mem_ctx, state->out_mem_ctx);
1155 /* Return result */
1156 *result = state->orig.out.result;
1158 tevent_req_received(req);
1159 return NT_STATUS_OK;
1162 NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli,
1163 TALLOC_CTX *mem_ctx)
1165 struct epm_MapAuth r;
1166 NTSTATUS status;
1168 /* In parameters */
1170 status = cli->dispatch(cli,
1171 mem_ctx,
1172 &ndr_table_epmapper,
1173 NDR_EPM_MAPAUTH,
1174 &r);
1176 if (!NT_STATUS_IS_OK(status)) {
1177 return status;
1180 if (NT_STATUS_IS_ERR(status)) {
1181 return status;
1184 /* Return variables */
1186 /* Return result */
1187 return NT_STATUS_OK;