Line data Source code
1 : /* client functions auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include <tevent.h>
5 : #include "lib/util/tevent_ntstatus.h"
6 : #include "bin/default/librpc/gen_ndr/ndr_browser.h"
7 : #include "bin/default/librpc/gen_ndr/ndr_browser_c.h"
8 :
9 : /* browser - client functions generated by pidl */
10 :
11 : struct dcerpc_BrowserrQueryOtherDomains_r_state {
12 : TALLOC_CTX *out_mem_ctx;
13 : };
14 :
15 : static void dcerpc_BrowserrQueryOtherDomains_r_done(struct tevent_req *subreq);
16 :
17 0 : struct tevent_req *dcerpc_BrowserrQueryOtherDomains_r_send(TALLOC_CTX *mem_ctx,
18 : struct tevent_context *ev,
19 : struct dcerpc_binding_handle *h,
20 : struct BrowserrQueryOtherDomains *r)
21 : {
22 0 : struct tevent_req *req;
23 0 : struct dcerpc_BrowserrQueryOtherDomains_r_state *state;
24 0 : struct tevent_req *subreq;
25 :
26 0 : req = tevent_req_create(mem_ctx, &state,
27 : struct dcerpc_BrowserrQueryOtherDomains_r_state);
28 0 : if (req == NULL) {
29 0 : return NULL;
30 : }
31 :
32 0 : state->out_mem_ctx = talloc_new(state);
33 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
34 0 : return tevent_req_post(req, ev);
35 : }
36 :
37 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
38 : NULL, &ndr_table_browser,
39 0 : NDR_BROWSERRQUERYOTHERDOMAINS, state->out_mem_ctx, r);
40 0 : if (tevent_req_nomem(subreq, req)) {
41 0 : return tevent_req_post(req, ev);
42 : }
43 0 : tevent_req_set_callback(subreq, dcerpc_BrowserrQueryOtherDomains_r_done, req);
44 :
45 0 : return req;
46 : }
47 :
48 0 : static void dcerpc_BrowserrQueryOtherDomains_r_done(struct tevent_req *subreq)
49 : {
50 0 : struct tevent_req *req =
51 0 : tevent_req_callback_data(subreq,
52 : struct tevent_req);
53 0 : NTSTATUS status;
54 :
55 0 : status = dcerpc_binding_handle_call_recv(subreq);
56 0 : TALLOC_FREE(subreq);
57 0 : if (tevent_req_nterror(req, status)) {
58 0 : return;
59 : }
60 :
61 0 : tevent_req_done(req);
62 : }
63 :
64 0 : NTSTATUS dcerpc_BrowserrQueryOtherDomains_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
65 : {
66 0 : struct dcerpc_BrowserrQueryOtherDomains_r_state *state =
67 0 : tevent_req_data(req,
68 : struct dcerpc_BrowserrQueryOtherDomains_r_state);
69 0 : NTSTATUS status;
70 :
71 0 : if (tevent_req_is_nterror(req, &status)) {
72 0 : tevent_req_received(req);
73 0 : return status;
74 : }
75 :
76 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
77 :
78 0 : tevent_req_received(req);
79 0 : return NT_STATUS_OK;
80 : }
81 :
82 24 : NTSTATUS dcerpc_BrowserrQueryOtherDomains_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct BrowserrQueryOtherDomains *r)
83 : {
84 0 : NTSTATUS status;
85 :
86 24 : status = dcerpc_binding_handle_call(h,
87 : NULL, &ndr_table_browser,
88 : NDR_BROWSERRQUERYOTHERDOMAINS, mem_ctx, r);
89 :
90 24 : return status;
91 : }
92 :
93 : struct dcerpc_BrowserrQueryOtherDomains_state {
94 : struct BrowserrQueryOtherDomains orig;
95 : struct BrowserrQueryOtherDomains tmp;
96 : TALLOC_CTX *out_mem_ctx;
97 : };
98 :
99 : static void dcerpc_BrowserrQueryOtherDomains_done(struct tevent_req *subreq);
100 :
101 0 : struct tevent_req *dcerpc_BrowserrQueryOtherDomains_send(TALLOC_CTX *mem_ctx,
102 : struct tevent_context *ev,
103 : struct dcerpc_binding_handle *h,
104 : const char *_server_unc /* [in] [charset(UTF16),unique] */,
105 : struct BrowserrSrvInfo *_info /* [in,out] [ref] */,
106 : uint32_t *_total_entries /* [out] [ref] */)
107 : {
108 0 : struct tevent_req *req;
109 0 : struct dcerpc_BrowserrQueryOtherDomains_state *state;
110 0 : struct tevent_req *subreq;
111 :
112 0 : req = tevent_req_create(mem_ctx, &state,
113 : struct dcerpc_BrowserrQueryOtherDomains_state);
114 0 : if (req == NULL) {
115 0 : return NULL;
116 : }
117 0 : state->out_mem_ctx = NULL;
118 :
119 : /* In parameters */
120 0 : state->orig.in.server_unc = _server_unc;
121 0 : state->orig.in.info = _info;
122 :
123 : /* Out parameters */
124 0 : state->orig.out.info = _info;
125 0 : state->orig.out.total_entries = _total_entries;
126 :
127 : /* Result */
128 0 : NDR_ZERO_STRUCT(state->orig.out.result);
129 :
130 0 : state->out_mem_ctx = talloc_named_const(state, 0,
131 : "dcerpc_BrowserrQueryOtherDomains_out_memory");
132 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
133 0 : return tevent_req_post(req, ev);
134 : }
135 :
136 : /* make a temporary copy, that we pass to the dispatch function */
137 0 : state->tmp = state->orig;
138 :
139 0 : subreq = dcerpc_BrowserrQueryOtherDomains_r_send(state, ev, h, &state->tmp);
140 0 : if (tevent_req_nomem(subreq, req)) {
141 0 : return tevent_req_post(req, ev);
142 : }
143 0 : tevent_req_set_callback(subreq, dcerpc_BrowserrQueryOtherDomains_done, req);
144 0 : return req;
145 : }
146 :
147 0 : static void dcerpc_BrowserrQueryOtherDomains_done(struct tevent_req *subreq)
148 : {
149 0 : struct tevent_req *req = tevent_req_callback_data(
150 : subreq, struct tevent_req);
151 0 : struct dcerpc_BrowserrQueryOtherDomains_state *state = tevent_req_data(
152 : req, struct dcerpc_BrowserrQueryOtherDomains_state);
153 0 : NTSTATUS status;
154 0 : TALLOC_CTX *mem_ctx;
155 :
156 0 : if (state->out_mem_ctx) {
157 0 : mem_ctx = state->out_mem_ctx;
158 : } else {
159 0 : mem_ctx = state;
160 : }
161 :
162 0 : status = dcerpc_BrowserrQueryOtherDomains_r_recv(subreq, mem_ctx);
163 0 : TALLOC_FREE(subreq);
164 0 : if (tevent_req_nterror(req, status)) {
165 0 : return;
166 : }
167 :
168 : /* Copy out parameters */
169 0 : *state->orig.out.info = *state->tmp.out.info;
170 0 : *state->orig.out.total_entries = *state->tmp.out.total_entries;
171 :
172 : /* Copy result */
173 0 : state->orig.out.result = state->tmp.out.result;
174 :
175 : /* Reset temporary structure */
176 0 : NDR_ZERO_STRUCT(state->tmp);
177 :
178 0 : tevent_req_done(req);
179 : }
180 :
181 0 : NTSTATUS dcerpc_BrowserrQueryOtherDomains_recv(struct tevent_req *req,
182 : TALLOC_CTX *mem_ctx,
183 : WERROR *result)
184 : {
185 0 : struct dcerpc_BrowserrQueryOtherDomains_state *state = tevent_req_data(
186 : req, struct dcerpc_BrowserrQueryOtherDomains_state);
187 0 : NTSTATUS status;
188 :
189 0 : if (tevent_req_is_nterror(req, &status)) {
190 0 : tevent_req_received(req);
191 0 : return status;
192 : }
193 :
194 : /* Steal possible out parameters to the callers context */
195 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
196 :
197 : /* Return result */
198 0 : *result = state->orig.out.result;
199 :
200 0 : tevent_req_received(req);
201 0 : return NT_STATUS_OK;
202 : }
203 :
204 0 : NTSTATUS dcerpc_BrowserrQueryOtherDomains(struct dcerpc_binding_handle *h,
205 : TALLOC_CTX *mem_ctx,
206 : const char *_server_unc /* [in] [charset(UTF16),unique] */,
207 : struct BrowserrSrvInfo *_info /* [in,out] [ref] */,
208 : uint32_t *_total_entries /* [out] [ref] */,
209 : WERROR *result)
210 : {
211 0 : struct BrowserrQueryOtherDomains r;
212 0 : NTSTATUS status;
213 :
214 : /* In parameters */
215 0 : r.in.server_unc = _server_unc;
216 0 : r.in.info = _info;
217 :
218 : /* Out parameters */
219 0 : r.out.info = _info;
220 0 : r.out.total_entries = _total_entries;
221 :
222 : /* Result */
223 0 : NDR_ZERO_STRUCT(r.out.result);
224 :
225 0 : status = dcerpc_BrowserrQueryOtherDomains_r(h, mem_ctx, &r);
226 0 : if (!NT_STATUS_IS_OK(status)) {
227 0 : return status;
228 : }
229 :
230 : /* Return variables */
231 0 : *_info = *r.out.info;
232 0 : *_total_entries = *r.out.total_entries;
233 :
234 : /* Return result */
235 0 : *result = r.out.result;
236 :
237 0 : return NT_STATUS_OK;
238 : }
239 :
|