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_mdssvc.h"
7 : #include "bin/default/librpc/gen_ndr/ndr_mdssvc_c.h"
8 :
9 : /* mdssvc - client functions generated by pidl */
10 :
11 : struct dcerpc_mdssvc_open_r_state {
12 : TALLOC_CTX *out_mem_ctx;
13 : };
14 :
15 : static void dcerpc_mdssvc_open_r_done(struct tevent_req *subreq);
16 :
17 10 : struct tevent_req *dcerpc_mdssvc_open_r_send(TALLOC_CTX *mem_ctx,
18 : struct tevent_context *ev,
19 : struct dcerpc_binding_handle *h,
20 : struct mdssvc_open *r)
21 : {
22 0 : struct tevent_req *req;
23 0 : struct dcerpc_mdssvc_open_r_state *state;
24 0 : struct tevent_req *subreq;
25 :
26 10 : req = tevent_req_create(mem_ctx, &state,
27 : struct dcerpc_mdssvc_open_r_state);
28 10 : if (req == NULL) {
29 0 : return NULL;
30 : }
31 :
32 10 : state->out_mem_ctx = talloc_new(state);
33 10 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
34 0 : return tevent_req_post(req, ev);
35 : }
36 :
37 10 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
38 : NULL, &ndr_table_mdssvc,
39 10 : NDR_MDSSVC_OPEN, state->out_mem_ctx, r);
40 10 : if (tevent_req_nomem(subreq, req)) {
41 0 : return tevent_req_post(req, ev);
42 : }
43 10 : tevent_req_set_callback(subreq, dcerpc_mdssvc_open_r_done, req);
44 :
45 10 : return req;
46 : }
47 :
48 10 : static void dcerpc_mdssvc_open_r_done(struct tevent_req *subreq)
49 : {
50 0 : struct tevent_req *req =
51 10 : tevent_req_callback_data(subreq,
52 : struct tevent_req);
53 0 : NTSTATUS status;
54 :
55 10 : status = dcerpc_binding_handle_call_recv(subreq);
56 10 : TALLOC_FREE(subreq);
57 10 : if (tevent_req_nterror(req, status)) {
58 0 : return;
59 : }
60 :
61 10 : tevent_req_done(req);
62 : }
63 :
64 10 : NTSTATUS dcerpc_mdssvc_open_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
65 : {
66 0 : struct dcerpc_mdssvc_open_r_state *state =
67 10 : tevent_req_data(req,
68 : struct dcerpc_mdssvc_open_r_state);
69 0 : NTSTATUS status;
70 :
71 10 : if (tevent_req_is_nterror(req, &status)) {
72 0 : tevent_req_received(req);
73 0 : return status;
74 : }
75 :
76 10 : talloc_steal(mem_ctx, state->out_mem_ctx);
77 :
78 10 : tevent_req_received(req);
79 10 : return NT_STATUS_OK;
80 : }
81 :
82 14 : NTSTATUS dcerpc_mdssvc_open_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mdssvc_open *r)
83 : {
84 0 : NTSTATUS status;
85 :
86 14 : status = dcerpc_binding_handle_call(h,
87 : NULL, &ndr_table_mdssvc,
88 : NDR_MDSSVC_OPEN, mem_ctx, r);
89 :
90 14 : return status;
91 : }
92 :
93 : struct dcerpc_mdssvc_open_state {
94 : struct mdssvc_open orig;
95 : struct mdssvc_open tmp;
96 : TALLOC_CTX *out_mem_ctx;
97 : };
98 :
99 : static void dcerpc_mdssvc_open_done(struct tevent_req *subreq);
100 :
101 10 : struct tevent_req *dcerpc_mdssvc_open_send(TALLOC_CTX *mem_ctx,
102 : struct tevent_context *ev,
103 : struct dcerpc_binding_handle *h,
104 : uint32_t *_device_id /* [in,out] [ref] */,
105 : uint32_t *_unkn2 /* [in,out] [ref] */,
106 : uint32_t *_unkn3 /* [in,out] [ref] */,
107 : const char *_share_mount_path /* [in] [charset(UTF8),size_is(1025)] */,
108 : const char *_share_name /* [in] [charset(UTF8),size_is(1025)] */,
109 : const char *_share_path /* [out] [charset(UTF8),size_is(1025)] */,
110 : struct policy_handle *_handle /* [out] [ref] */)
111 : {
112 0 : struct tevent_req *req;
113 0 : struct dcerpc_mdssvc_open_state *state;
114 0 : struct tevent_req *subreq;
115 :
116 10 : req = tevent_req_create(mem_ctx, &state,
117 : struct dcerpc_mdssvc_open_state);
118 10 : if (req == NULL) {
119 0 : return NULL;
120 : }
121 10 : state->out_mem_ctx = NULL;
122 :
123 : /* In parameters */
124 10 : state->orig.in.device_id = _device_id;
125 10 : state->orig.in.unkn2 = _unkn2;
126 10 : state->orig.in.unkn3 = _unkn3;
127 10 : state->orig.in.share_mount_path = _share_mount_path;
128 10 : state->orig.in.share_name = _share_name;
129 :
130 : /* Out parameters */
131 10 : state->orig.out.device_id = _device_id;
132 10 : state->orig.out.unkn2 = _unkn2;
133 10 : state->orig.out.unkn3 = _unkn3;
134 10 : state->orig.out.share_path = _share_path;
135 10 : state->orig.out.handle = _handle;
136 :
137 10 : state->out_mem_ctx = talloc_named_const(state, 0,
138 : "dcerpc_mdssvc_open_out_memory");
139 10 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
140 0 : return tevent_req_post(req, ev);
141 : }
142 :
143 : /* make a temporary copy, that we pass to the dispatch function */
144 10 : state->tmp = state->orig;
145 :
146 10 : subreq = dcerpc_mdssvc_open_r_send(state, ev, h, &state->tmp);
147 10 : if (tevent_req_nomem(subreq, req)) {
148 0 : return tevent_req_post(req, ev);
149 : }
150 10 : tevent_req_set_callback(subreq, dcerpc_mdssvc_open_done, req);
151 10 : return req;
152 : }
153 :
154 10 : static void dcerpc_mdssvc_open_done(struct tevent_req *subreq)
155 : {
156 10 : struct tevent_req *req = tevent_req_callback_data(
157 : subreq, struct tevent_req);
158 10 : struct dcerpc_mdssvc_open_state *state = tevent_req_data(
159 : req, struct dcerpc_mdssvc_open_state);
160 0 : NTSTATUS status;
161 0 : TALLOC_CTX *mem_ctx;
162 :
163 10 : if (state->out_mem_ctx) {
164 10 : mem_ctx = state->out_mem_ctx;
165 : } else {
166 0 : mem_ctx = state;
167 : }
168 :
169 10 : status = dcerpc_mdssvc_open_r_recv(subreq, mem_ctx);
170 10 : TALLOC_FREE(subreq);
171 10 : if (tevent_req_nterror(req, status)) {
172 0 : return;
173 : }
174 :
175 : /* Copy out parameters */
176 10 : *state->orig.out.device_id = *state->tmp.out.device_id;
177 10 : *state->orig.out.unkn2 = *state->tmp.out.unkn2;
178 10 : *state->orig.out.unkn3 = *state->tmp.out.unkn3;
179 : {
180 0 : size_t _copy_len_share_path;
181 10 : _copy_len_share_path = ndr_charset_length(state->tmp.out.share_path, CH_UNIX);
182 10 : if (_copy_len_share_path > 1025) {
183 0 : tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
184 0 : return;
185 : }
186 10 : if (state->orig.out.share_path != state->tmp.out.share_path) {
187 10 : memcpy(discard_const_p(uint8_t *, state->orig.out.share_path), state->tmp.out.share_path, _copy_len_share_path * sizeof(*state->orig.out.share_path));
188 : }
189 : }
190 10 : *state->orig.out.handle = *state->tmp.out.handle;
191 :
192 : /* Reset temporary structure */
193 10 : NDR_ZERO_STRUCT(state->tmp);
194 :
195 10 : tevent_req_done(req);
196 : }
197 :
198 10 : NTSTATUS dcerpc_mdssvc_open_recv(struct tevent_req *req,
199 : TALLOC_CTX *mem_ctx)
200 : {
201 10 : struct dcerpc_mdssvc_open_state *state = tevent_req_data(
202 : req, struct dcerpc_mdssvc_open_state);
203 0 : NTSTATUS status;
204 :
205 10 : if (tevent_req_is_nterror(req, &status)) {
206 0 : tevent_req_received(req);
207 0 : return status;
208 : }
209 :
210 : /* Steal possible out parameters to the callers context */
211 10 : talloc_steal(mem_ctx, state->out_mem_ctx);
212 :
213 10 : tevent_req_received(req);
214 10 : return NT_STATUS_OK;
215 : }
216 :
217 14 : NTSTATUS dcerpc_mdssvc_open(struct dcerpc_binding_handle *h,
218 : TALLOC_CTX *mem_ctx,
219 : uint32_t *_device_id /* [in,out] [ref] */,
220 : uint32_t *_unkn2 /* [in,out] [ref] */,
221 : uint32_t *_unkn3 /* [in,out] [ref] */,
222 : const char *_share_mount_path /* [in] [charset(UTF8),size_is(1025)] */,
223 : const char *_share_name /* [in] [charset(UTF8),size_is(1025)] */,
224 : const char *_share_path /* [out] [charset(UTF8),size_is(1025)] */,
225 : struct policy_handle *_handle /* [out] [ref] */)
226 : {
227 0 : struct mdssvc_open r;
228 0 : NTSTATUS status;
229 :
230 : /* In parameters */
231 14 : r.in.device_id = _device_id;
232 14 : r.in.unkn2 = _unkn2;
233 14 : r.in.unkn3 = _unkn3;
234 14 : r.in.share_mount_path = _share_mount_path;
235 14 : r.in.share_name = _share_name;
236 :
237 : /* Out parameters */
238 14 : r.out.device_id = _device_id;
239 14 : r.out.unkn2 = _unkn2;
240 14 : r.out.unkn3 = _unkn3;
241 14 : r.out.share_path = _share_path;
242 14 : r.out.handle = _handle;
243 :
244 14 : status = dcerpc_mdssvc_open_r(h, mem_ctx, &r);
245 14 : if (!NT_STATUS_IS_OK(status)) {
246 0 : return status;
247 : }
248 :
249 : /* Return variables */
250 14 : *_device_id = *r.out.device_id;
251 14 : *_unkn2 = *r.out.unkn2;
252 14 : *_unkn3 = *r.out.unkn3;
253 : {
254 0 : size_t _copy_len_share_path;
255 14 : _copy_len_share_path = ndr_charset_length(r.out.share_path, CH_UNIX);
256 14 : if (_copy_len_share_path > 1025) {
257 0 : return NT_STATUS_INVALID_NETWORK_RESPONSE;
258 : }
259 14 : if (_share_path != r.out.share_path) {
260 14 : memcpy(discard_const_p(uint8_t *, _share_path), r.out.share_path, _copy_len_share_path * sizeof(*_share_path));
261 : }
262 : }
263 14 : *_handle = *r.out.handle;
264 :
265 : /* Return result */
266 :
267 14 : return NT_STATUS_OK;
268 : }
269 :
270 : struct dcerpc_mdssvc_unknown1_r_state {
271 : TALLOC_CTX *out_mem_ctx;
272 : };
273 :
274 : static void dcerpc_mdssvc_unknown1_r_done(struct tevent_req *subreq);
275 :
276 10 : struct tevent_req *dcerpc_mdssvc_unknown1_r_send(TALLOC_CTX *mem_ctx,
277 : struct tevent_context *ev,
278 : struct dcerpc_binding_handle *h,
279 : struct mdssvc_unknown1 *r)
280 : {
281 0 : struct tevent_req *req;
282 0 : struct dcerpc_mdssvc_unknown1_r_state *state;
283 0 : struct tevent_req *subreq;
284 :
285 10 : req = tevent_req_create(mem_ctx, &state,
286 : struct dcerpc_mdssvc_unknown1_r_state);
287 10 : if (req == NULL) {
288 0 : return NULL;
289 : }
290 :
291 10 : state->out_mem_ctx = talloc_new(state);
292 10 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
293 0 : return tevent_req_post(req, ev);
294 : }
295 :
296 10 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
297 : NULL, &ndr_table_mdssvc,
298 10 : NDR_MDSSVC_UNKNOWN1, state->out_mem_ctx, r);
299 10 : if (tevent_req_nomem(subreq, req)) {
300 0 : return tevent_req_post(req, ev);
301 : }
302 10 : tevent_req_set_callback(subreq, dcerpc_mdssvc_unknown1_r_done, req);
303 :
304 10 : return req;
305 : }
306 :
307 10 : static void dcerpc_mdssvc_unknown1_r_done(struct tevent_req *subreq)
308 : {
309 0 : struct tevent_req *req =
310 10 : tevent_req_callback_data(subreq,
311 : struct tevent_req);
312 0 : NTSTATUS status;
313 :
314 10 : status = dcerpc_binding_handle_call_recv(subreq);
315 10 : TALLOC_FREE(subreq);
316 10 : if (tevent_req_nterror(req, status)) {
317 0 : return;
318 : }
319 :
320 10 : tevent_req_done(req);
321 : }
322 :
323 10 : NTSTATUS dcerpc_mdssvc_unknown1_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
324 : {
325 0 : struct dcerpc_mdssvc_unknown1_r_state *state =
326 10 : tevent_req_data(req,
327 : struct dcerpc_mdssvc_unknown1_r_state);
328 0 : NTSTATUS status;
329 :
330 10 : if (tevent_req_is_nterror(req, &status)) {
331 0 : tevent_req_received(req);
332 0 : return status;
333 : }
334 :
335 10 : talloc_steal(mem_ctx, state->out_mem_ctx);
336 :
337 10 : tevent_req_received(req);
338 10 : return NT_STATUS_OK;
339 : }
340 :
341 12 : NTSTATUS dcerpc_mdssvc_unknown1_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mdssvc_unknown1 *r)
342 : {
343 0 : NTSTATUS status;
344 :
345 12 : status = dcerpc_binding_handle_call(h,
346 : NULL, &ndr_table_mdssvc,
347 : NDR_MDSSVC_UNKNOWN1, mem_ctx, r);
348 :
349 12 : return status;
350 : }
351 :
352 : struct dcerpc_mdssvc_unknown1_state {
353 : struct mdssvc_unknown1 orig;
354 : struct mdssvc_unknown1 tmp;
355 : TALLOC_CTX *out_mem_ctx;
356 : };
357 :
358 : static void dcerpc_mdssvc_unknown1_done(struct tevent_req *subreq);
359 :
360 10 : struct tevent_req *dcerpc_mdssvc_unknown1_send(TALLOC_CTX *mem_ctx,
361 : struct tevent_context *ev,
362 : struct dcerpc_binding_handle *h,
363 : struct policy_handle *_handle /* [in] [ref] */,
364 : uint32_t _unkn1 /* [in] */,
365 : uint32_t _device_id /* [in] */,
366 : uint32_t _unkn3 /* [in] */,
367 : uint32_t _unkn4 /* [in] */,
368 : uint32_t _uid /* [in] */,
369 : uint32_t _gid /* [in] */,
370 : uint32_t *_status /* [out] [ref] */,
371 : uint32_t *_flags /* [out] [ref] */,
372 : uint32_t *_unkn7 /* [out] [ref] */)
373 : {
374 0 : struct tevent_req *req;
375 0 : struct dcerpc_mdssvc_unknown1_state *state;
376 0 : struct tevent_req *subreq;
377 :
378 10 : req = tevent_req_create(mem_ctx, &state,
379 : struct dcerpc_mdssvc_unknown1_state);
380 10 : if (req == NULL) {
381 0 : return NULL;
382 : }
383 10 : state->out_mem_ctx = NULL;
384 :
385 : /* In parameters */
386 10 : state->orig.in.handle = _handle;
387 10 : state->orig.in.unkn1 = _unkn1;
388 10 : state->orig.in.device_id = _device_id;
389 10 : state->orig.in.unkn3 = _unkn3;
390 10 : state->orig.in.unkn4 = _unkn4;
391 10 : state->orig.in.uid = _uid;
392 10 : state->orig.in.gid = _gid;
393 :
394 : /* Out parameters */
395 10 : state->orig.out.status = _status;
396 10 : state->orig.out.flags = _flags;
397 10 : state->orig.out.unkn7 = _unkn7;
398 :
399 10 : state->out_mem_ctx = talloc_named_const(state, 0,
400 : "dcerpc_mdssvc_unknown1_out_memory");
401 10 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
402 0 : return tevent_req_post(req, ev);
403 : }
404 :
405 : /* make a temporary copy, that we pass to the dispatch function */
406 10 : state->tmp = state->orig;
407 :
408 10 : subreq = dcerpc_mdssvc_unknown1_r_send(state, ev, h, &state->tmp);
409 10 : if (tevent_req_nomem(subreq, req)) {
410 0 : return tevent_req_post(req, ev);
411 : }
412 10 : tevent_req_set_callback(subreq, dcerpc_mdssvc_unknown1_done, req);
413 10 : return req;
414 : }
415 :
416 10 : static void dcerpc_mdssvc_unknown1_done(struct tevent_req *subreq)
417 : {
418 10 : struct tevent_req *req = tevent_req_callback_data(
419 : subreq, struct tevent_req);
420 10 : struct dcerpc_mdssvc_unknown1_state *state = tevent_req_data(
421 : req, struct dcerpc_mdssvc_unknown1_state);
422 0 : NTSTATUS status;
423 0 : TALLOC_CTX *mem_ctx;
424 :
425 10 : if (state->out_mem_ctx) {
426 10 : mem_ctx = state->out_mem_ctx;
427 : } else {
428 0 : mem_ctx = state;
429 : }
430 :
431 10 : status = dcerpc_mdssvc_unknown1_r_recv(subreq, mem_ctx);
432 10 : TALLOC_FREE(subreq);
433 10 : if (tevent_req_nterror(req, status)) {
434 0 : return;
435 : }
436 :
437 : /* Copy out parameters */
438 10 : *state->orig.out.status = *state->tmp.out.status;
439 10 : *state->orig.out.flags = *state->tmp.out.flags;
440 10 : *state->orig.out.unkn7 = *state->tmp.out.unkn7;
441 :
442 : /* Reset temporary structure */
443 10 : NDR_ZERO_STRUCT(state->tmp);
444 :
445 10 : tevent_req_done(req);
446 : }
447 :
448 10 : NTSTATUS dcerpc_mdssvc_unknown1_recv(struct tevent_req *req,
449 : TALLOC_CTX *mem_ctx)
450 : {
451 10 : struct dcerpc_mdssvc_unknown1_state *state = tevent_req_data(
452 : req, struct dcerpc_mdssvc_unknown1_state);
453 0 : NTSTATUS status;
454 :
455 10 : if (tevent_req_is_nterror(req, &status)) {
456 0 : tevent_req_received(req);
457 0 : return status;
458 : }
459 :
460 : /* Steal possible out parameters to the callers context */
461 10 : talloc_steal(mem_ctx, state->out_mem_ctx);
462 :
463 10 : tevent_req_received(req);
464 10 : return NT_STATUS_OK;
465 : }
466 :
467 12 : NTSTATUS dcerpc_mdssvc_unknown1(struct dcerpc_binding_handle *h,
468 : TALLOC_CTX *mem_ctx,
469 : struct policy_handle *_handle /* [in] [ref] */,
470 : uint32_t _unkn1 /* [in] */,
471 : uint32_t _device_id /* [in] */,
472 : uint32_t _unkn3 /* [in] */,
473 : uint32_t _unkn4 /* [in] */,
474 : uint32_t _uid /* [in] */,
475 : uint32_t _gid /* [in] */,
476 : uint32_t *_status /* [out] [ref] */,
477 : uint32_t *_flags /* [out] [ref] */,
478 : uint32_t *_unkn7 /* [out] [ref] */)
479 : {
480 0 : struct mdssvc_unknown1 r;
481 0 : NTSTATUS status;
482 :
483 : /* In parameters */
484 12 : r.in.handle = _handle;
485 12 : r.in.unkn1 = _unkn1;
486 12 : r.in.device_id = _device_id;
487 12 : r.in.unkn3 = _unkn3;
488 12 : r.in.unkn4 = _unkn4;
489 12 : r.in.uid = _uid;
490 12 : r.in.gid = _gid;
491 :
492 : /* Out parameters */
493 12 : r.out.status = _status;
494 12 : r.out.flags = _flags;
495 12 : r.out.unkn7 = _unkn7;
496 :
497 12 : status = dcerpc_mdssvc_unknown1_r(h, mem_ctx, &r);
498 12 : if (!NT_STATUS_IS_OK(status)) {
499 2 : return status;
500 : }
501 :
502 : /* Return variables */
503 10 : *_status = *r.out.status;
504 10 : *_flags = *r.out.flags;
505 10 : *_unkn7 = *r.out.unkn7;
506 :
507 : /* Return result */
508 :
509 10 : return NT_STATUS_OK;
510 : }
511 :
512 : struct dcerpc_mdssvc_cmd_r_state {
513 : TALLOC_CTX *out_mem_ctx;
514 : };
515 :
516 : static void dcerpc_mdssvc_cmd_r_done(struct tevent_req *subreq);
517 :
518 56 : struct tevent_req *dcerpc_mdssvc_cmd_r_send(TALLOC_CTX *mem_ctx,
519 : struct tevent_context *ev,
520 : struct dcerpc_binding_handle *h,
521 : struct mdssvc_cmd *r)
522 : {
523 0 : struct tevent_req *req;
524 0 : struct dcerpc_mdssvc_cmd_r_state *state;
525 0 : struct tevent_req *subreq;
526 :
527 56 : req = tevent_req_create(mem_ctx, &state,
528 : struct dcerpc_mdssvc_cmd_r_state);
529 56 : if (req == NULL) {
530 0 : return NULL;
531 : }
532 :
533 56 : state->out_mem_ctx = talloc_new(state);
534 56 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
535 0 : return tevent_req_post(req, ev);
536 : }
537 :
538 56 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
539 : NULL, &ndr_table_mdssvc,
540 56 : NDR_MDSSVC_CMD, state->out_mem_ctx, r);
541 56 : if (tevent_req_nomem(subreq, req)) {
542 0 : return tevent_req_post(req, ev);
543 : }
544 56 : tevent_req_set_callback(subreq, dcerpc_mdssvc_cmd_r_done, req);
545 :
546 56 : return req;
547 : }
548 :
549 56 : static void dcerpc_mdssvc_cmd_r_done(struct tevent_req *subreq)
550 : {
551 0 : struct tevent_req *req =
552 56 : tevent_req_callback_data(subreq,
553 : struct tevent_req);
554 0 : NTSTATUS status;
555 :
556 56 : status = dcerpc_binding_handle_call_recv(subreq);
557 56 : TALLOC_FREE(subreq);
558 56 : if (tevent_req_nterror(req, status)) {
559 0 : return;
560 : }
561 :
562 56 : tevent_req_done(req);
563 : }
564 :
565 56 : NTSTATUS dcerpc_mdssvc_cmd_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
566 : {
567 0 : struct dcerpc_mdssvc_cmd_r_state *state =
568 56 : tevent_req_data(req,
569 : struct dcerpc_mdssvc_cmd_r_state);
570 0 : NTSTATUS status;
571 :
572 56 : if (tevent_req_is_nterror(req, &status)) {
573 0 : tevent_req_received(req);
574 0 : return status;
575 : }
576 :
577 56 : talloc_steal(mem_ctx, state->out_mem_ctx);
578 :
579 56 : tevent_req_received(req);
580 56 : return NT_STATUS_OK;
581 : }
582 :
583 8 : NTSTATUS dcerpc_mdssvc_cmd_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mdssvc_cmd *r)
584 : {
585 0 : NTSTATUS status;
586 :
587 8 : status = dcerpc_binding_handle_call(h,
588 : NULL, &ndr_table_mdssvc,
589 : NDR_MDSSVC_CMD, mem_ctx, r);
590 :
591 8 : return status;
592 : }
593 :
594 : struct dcerpc_mdssvc_cmd_state {
595 : struct mdssvc_cmd orig;
596 : struct mdssvc_cmd tmp;
597 : TALLOC_CTX *out_mem_ctx;
598 : };
599 :
600 : static void dcerpc_mdssvc_cmd_done(struct tevent_req *subreq);
601 :
602 56 : struct tevent_req *dcerpc_mdssvc_cmd_send(TALLOC_CTX *mem_ctx,
603 : struct tevent_context *ev,
604 : struct dcerpc_binding_handle *h,
605 : struct policy_handle *_handle /* [in] [ref] */,
606 : uint32_t _unkn1 /* [in] */,
607 : uint32_t _device_id /* [in] */,
608 : uint32_t _unkn3 /* [in] */,
609 : uint32_t _next_fragment /* [in] */,
610 : uint32_t _flags /* [in] */,
611 : struct mdssvc_blob _request_blob /* [in] */,
612 : uint32_t _unkn5 /* [in] */,
613 : uint32_t _max_fragment_size1 /* [in] */,
614 : uint32_t _unkn6 /* [in] */,
615 : uint32_t _max_fragment_size2 /* [in] */,
616 : uint32_t _unkn7 /* [in] */,
617 : uint32_t _unkn8 /* [in] */,
618 : uint32_t *_fragment /* [out] [ref] */,
619 : struct mdssvc_blob *_response_blob /* [out] [ref] */,
620 : uint32_t *_unkn9 /* [out] [ref] */)
621 : {
622 0 : struct tevent_req *req;
623 0 : struct dcerpc_mdssvc_cmd_state *state;
624 0 : struct tevent_req *subreq;
625 :
626 56 : req = tevent_req_create(mem_ctx, &state,
627 : struct dcerpc_mdssvc_cmd_state);
628 56 : if (req == NULL) {
629 0 : return NULL;
630 : }
631 56 : state->out_mem_ctx = NULL;
632 :
633 : /* In parameters */
634 56 : state->orig.in.handle = _handle;
635 56 : state->orig.in.unkn1 = _unkn1;
636 56 : state->orig.in.device_id = _device_id;
637 56 : state->orig.in.unkn3 = _unkn3;
638 56 : state->orig.in.next_fragment = _next_fragment;
639 56 : state->orig.in.flags = _flags;
640 56 : state->orig.in.request_blob = _request_blob;
641 56 : state->orig.in.unkn5 = _unkn5;
642 56 : state->orig.in.max_fragment_size1 = _max_fragment_size1;
643 56 : state->orig.in.unkn6 = _unkn6;
644 56 : state->orig.in.max_fragment_size2 = _max_fragment_size2;
645 56 : state->orig.in.unkn7 = _unkn7;
646 56 : state->orig.in.unkn8 = _unkn8;
647 :
648 : /* Out parameters */
649 56 : state->orig.out.fragment = _fragment;
650 56 : state->orig.out.response_blob = _response_blob;
651 56 : state->orig.out.unkn9 = _unkn9;
652 :
653 56 : state->out_mem_ctx = talloc_named_const(state, 0,
654 : "dcerpc_mdssvc_cmd_out_memory");
655 56 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
656 0 : return tevent_req_post(req, ev);
657 : }
658 :
659 : /* make a temporary copy, that we pass to the dispatch function */
660 56 : state->tmp = state->orig;
661 :
662 56 : subreq = dcerpc_mdssvc_cmd_r_send(state, ev, h, &state->tmp);
663 56 : if (tevent_req_nomem(subreq, req)) {
664 0 : return tevent_req_post(req, ev);
665 : }
666 56 : tevent_req_set_callback(subreq, dcerpc_mdssvc_cmd_done, req);
667 56 : return req;
668 : }
669 :
670 56 : static void dcerpc_mdssvc_cmd_done(struct tevent_req *subreq)
671 : {
672 56 : struct tevent_req *req = tevent_req_callback_data(
673 : subreq, struct tevent_req);
674 56 : struct dcerpc_mdssvc_cmd_state *state = tevent_req_data(
675 : req, struct dcerpc_mdssvc_cmd_state);
676 0 : NTSTATUS status;
677 0 : TALLOC_CTX *mem_ctx;
678 :
679 56 : if (state->out_mem_ctx) {
680 56 : mem_ctx = state->out_mem_ctx;
681 : } else {
682 0 : mem_ctx = state;
683 : }
684 :
685 56 : status = dcerpc_mdssvc_cmd_r_recv(subreq, mem_ctx);
686 56 : TALLOC_FREE(subreq);
687 56 : if (tevent_req_nterror(req, status)) {
688 0 : return;
689 : }
690 :
691 : /* Copy out parameters */
692 56 : *state->orig.out.fragment = *state->tmp.out.fragment;
693 56 : *state->orig.out.response_blob = *state->tmp.out.response_blob;
694 56 : *state->orig.out.unkn9 = *state->tmp.out.unkn9;
695 :
696 : /* Reset temporary structure */
697 56 : NDR_ZERO_STRUCT(state->tmp);
698 :
699 56 : tevent_req_done(req);
700 : }
701 :
702 56 : NTSTATUS dcerpc_mdssvc_cmd_recv(struct tevent_req *req,
703 : TALLOC_CTX *mem_ctx)
704 : {
705 56 : struct dcerpc_mdssvc_cmd_state *state = tevent_req_data(
706 : req, struct dcerpc_mdssvc_cmd_state);
707 0 : NTSTATUS status;
708 :
709 56 : if (tevent_req_is_nterror(req, &status)) {
710 0 : tevent_req_received(req);
711 0 : return status;
712 : }
713 :
714 : /* Steal possible out parameters to the callers context */
715 56 : talloc_steal(mem_ctx, state->out_mem_ctx);
716 :
717 56 : tevent_req_received(req);
718 56 : return NT_STATUS_OK;
719 : }
720 :
721 8 : NTSTATUS dcerpc_mdssvc_cmd(struct dcerpc_binding_handle *h,
722 : TALLOC_CTX *mem_ctx,
723 : struct policy_handle *_handle /* [in] [ref] */,
724 : uint32_t _unkn1 /* [in] */,
725 : uint32_t _device_id /* [in] */,
726 : uint32_t _unkn3 /* [in] */,
727 : uint32_t _next_fragment /* [in] */,
728 : uint32_t _flags /* [in] */,
729 : struct mdssvc_blob _request_blob /* [in] */,
730 : uint32_t _unkn5 /* [in] */,
731 : uint32_t _max_fragment_size1 /* [in] */,
732 : uint32_t _unkn6 /* [in] */,
733 : uint32_t _max_fragment_size2 /* [in] */,
734 : uint32_t _unkn7 /* [in] */,
735 : uint32_t _unkn8 /* [in] */,
736 : uint32_t *_fragment /* [out] [ref] */,
737 : struct mdssvc_blob *_response_blob /* [out] [ref] */,
738 : uint32_t *_unkn9 /* [out] [ref] */)
739 : {
740 0 : struct mdssvc_cmd r;
741 0 : NTSTATUS status;
742 :
743 : /* In parameters */
744 8 : r.in.handle = _handle;
745 8 : r.in.unkn1 = _unkn1;
746 8 : r.in.device_id = _device_id;
747 8 : r.in.unkn3 = _unkn3;
748 8 : r.in.next_fragment = _next_fragment;
749 8 : r.in.flags = _flags;
750 8 : r.in.request_blob = _request_blob;
751 8 : r.in.unkn5 = _unkn5;
752 8 : r.in.max_fragment_size1 = _max_fragment_size1;
753 8 : r.in.unkn6 = _unkn6;
754 8 : r.in.max_fragment_size2 = _max_fragment_size2;
755 8 : r.in.unkn7 = _unkn7;
756 8 : r.in.unkn8 = _unkn8;
757 :
758 : /* Out parameters */
759 8 : r.out.fragment = _fragment;
760 8 : r.out.response_blob = _response_blob;
761 8 : r.out.unkn9 = _unkn9;
762 :
763 8 : status = dcerpc_mdssvc_cmd_r(h, mem_ctx, &r);
764 8 : if (!NT_STATUS_IS_OK(status)) {
765 2 : return status;
766 : }
767 :
768 : /* Return variables */
769 6 : *_fragment = *r.out.fragment;
770 6 : *_response_blob = *r.out.response_blob;
771 6 : *_unkn9 = *r.out.unkn9;
772 :
773 : /* Return result */
774 :
775 6 : return NT_STATUS_OK;
776 : }
777 :
778 : struct dcerpc_mdssvc_close_r_state {
779 : TALLOC_CTX *out_mem_ctx;
780 : };
781 :
782 : static void dcerpc_mdssvc_close_r_done(struct tevent_req *subreq);
783 :
784 10 : struct tevent_req *dcerpc_mdssvc_close_r_send(TALLOC_CTX *mem_ctx,
785 : struct tevent_context *ev,
786 : struct dcerpc_binding_handle *h,
787 : struct mdssvc_close *r)
788 : {
789 0 : struct tevent_req *req;
790 0 : struct dcerpc_mdssvc_close_r_state *state;
791 0 : struct tevent_req *subreq;
792 :
793 10 : req = tevent_req_create(mem_ctx, &state,
794 : struct dcerpc_mdssvc_close_r_state);
795 10 : if (req == NULL) {
796 0 : return NULL;
797 : }
798 :
799 10 : state->out_mem_ctx = talloc_new(state);
800 10 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
801 0 : return tevent_req_post(req, ev);
802 : }
803 :
804 10 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
805 : NULL, &ndr_table_mdssvc,
806 10 : NDR_MDSSVC_CLOSE, state->out_mem_ctx, r);
807 10 : if (tevent_req_nomem(subreq, req)) {
808 0 : return tevent_req_post(req, ev);
809 : }
810 10 : tevent_req_set_callback(subreq, dcerpc_mdssvc_close_r_done, req);
811 :
812 10 : return req;
813 : }
814 :
815 10 : static void dcerpc_mdssvc_close_r_done(struct tevent_req *subreq)
816 : {
817 0 : struct tevent_req *req =
818 10 : tevent_req_callback_data(subreq,
819 : struct tevent_req);
820 0 : NTSTATUS status;
821 :
822 10 : status = dcerpc_binding_handle_call_recv(subreq);
823 10 : TALLOC_FREE(subreq);
824 10 : if (tevent_req_nterror(req, status)) {
825 0 : return;
826 : }
827 :
828 10 : tevent_req_done(req);
829 : }
830 :
831 10 : NTSTATUS dcerpc_mdssvc_close_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
832 : {
833 0 : struct dcerpc_mdssvc_close_r_state *state =
834 10 : tevent_req_data(req,
835 : struct dcerpc_mdssvc_close_r_state);
836 0 : NTSTATUS status;
837 :
838 10 : if (tevent_req_is_nterror(req, &status)) {
839 0 : tevent_req_received(req);
840 0 : return status;
841 : }
842 :
843 10 : talloc_steal(mem_ctx, state->out_mem_ctx);
844 :
845 10 : tevent_req_received(req);
846 10 : return NT_STATUS_OK;
847 : }
848 :
849 8 : NTSTATUS dcerpc_mdssvc_close_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct mdssvc_close *r)
850 : {
851 0 : NTSTATUS status;
852 :
853 8 : status = dcerpc_binding_handle_call(h,
854 : NULL, &ndr_table_mdssvc,
855 : NDR_MDSSVC_CLOSE, mem_ctx, r);
856 :
857 8 : return status;
858 : }
859 :
860 : struct dcerpc_mdssvc_close_state {
861 : struct mdssvc_close orig;
862 : struct mdssvc_close tmp;
863 : TALLOC_CTX *out_mem_ctx;
864 : };
865 :
866 : static void dcerpc_mdssvc_close_done(struct tevent_req *subreq);
867 :
868 10 : struct tevent_req *dcerpc_mdssvc_close_send(TALLOC_CTX *mem_ctx,
869 : struct tevent_context *ev,
870 : struct dcerpc_binding_handle *h,
871 : struct policy_handle *_in_handle /* [in] [ref] */,
872 : uint32_t _unkn1 /* [in] */,
873 : uint32_t _device_id /* [in] */,
874 : uint32_t _unkn2 /* [in] */,
875 : uint32_t _unkn3 /* [in] */,
876 : struct policy_handle *_out_handle /* [out] [ref] */,
877 : uint32_t *_status /* [out] [ref] */)
878 : {
879 0 : struct tevent_req *req;
880 0 : struct dcerpc_mdssvc_close_state *state;
881 0 : struct tevent_req *subreq;
882 :
883 10 : req = tevent_req_create(mem_ctx, &state,
884 : struct dcerpc_mdssvc_close_state);
885 10 : if (req == NULL) {
886 0 : return NULL;
887 : }
888 10 : state->out_mem_ctx = NULL;
889 :
890 : /* In parameters */
891 10 : state->orig.in.in_handle = _in_handle;
892 10 : state->orig.in.unkn1 = _unkn1;
893 10 : state->orig.in.device_id = _device_id;
894 10 : state->orig.in.unkn2 = _unkn2;
895 10 : state->orig.in.unkn3 = _unkn3;
896 :
897 : /* Out parameters */
898 10 : state->orig.out.out_handle = _out_handle;
899 10 : state->orig.out.status = _status;
900 :
901 10 : state->out_mem_ctx = talloc_named_const(state, 0,
902 : "dcerpc_mdssvc_close_out_memory");
903 10 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
904 0 : return tevent_req_post(req, ev);
905 : }
906 :
907 : /* make a temporary copy, that we pass to the dispatch function */
908 10 : state->tmp = state->orig;
909 :
910 10 : subreq = dcerpc_mdssvc_close_r_send(state, ev, h, &state->tmp);
911 10 : if (tevent_req_nomem(subreq, req)) {
912 0 : return tevent_req_post(req, ev);
913 : }
914 10 : tevent_req_set_callback(subreq, dcerpc_mdssvc_close_done, req);
915 10 : return req;
916 : }
917 :
918 10 : static void dcerpc_mdssvc_close_done(struct tevent_req *subreq)
919 : {
920 10 : struct tevent_req *req = tevent_req_callback_data(
921 : subreq, struct tevent_req);
922 10 : struct dcerpc_mdssvc_close_state *state = tevent_req_data(
923 : req, struct dcerpc_mdssvc_close_state);
924 0 : NTSTATUS status;
925 0 : TALLOC_CTX *mem_ctx;
926 :
927 10 : if (state->out_mem_ctx) {
928 10 : mem_ctx = state->out_mem_ctx;
929 : } else {
930 0 : mem_ctx = state;
931 : }
932 :
933 10 : status = dcerpc_mdssvc_close_r_recv(subreq, mem_ctx);
934 10 : TALLOC_FREE(subreq);
935 10 : if (tevent_req_nterror(req, status)) {
936 0 : return;
937 : }
938 :
939 : /* Copy out parameters */
940 10 : *state->orig.out.out_handle = *state->tmp.out.out_handle;
941 10 : *state->orig.out.status = *state->tmp.out.status;
942 :
943 : /* Reset temporary structure */
944 10 : NDR_ZERO_STRUCT(state->tmp);
945 :
946 10 : tevent_req_done(req);
947 : }
948 :
949 10 : NTSTATUS dcerpc_mdssvc_close_recv(struct tevent_req *req,
950 : TALLOC_CTX *mem_ctx)
951 : {
952 10 : struct dcerpc_mdssvc_close_state *state = tevent_req_data(
953 : req, struct dcerpc_mdssvc_close_state);
954 0 : NTSTATUS status;
955 :
956 10 : if (tevent_req_is_nterror(req, &status)) {
957 0 : tevent_req_received(req);
958 0 : return status;
959 : }
960 :
961 : /* Steal possible out parameters to the callers context */
962 10 : talloc_steal(mem_ctx, state->out_mem_ctx);
963 :
964 10 : tevent_req_received(req);
965 10 : return NT_STATUS_OK;
966 : }
967 :
968 8 : NTSTATUS dcerpc_mdssvc_close(struct dcerpc_binding_handle *h,
969 : TALLOC_CTX *mem_ctx,
970 : struct policy_handle *_in_handle /* [in] [ref] */,
971 : uint32_t _unkn1 /* [in] */,
972 : uint32_t _device_id /* [in] */,
973 : uint32_t _unkn2 /* [in] */,
974 : uint32_t _unkn3 /* [in] */,
975 : struct policy_handle *_out_handle /* [out] [ref] */,
976 : uint32_t *_status /* [out] [ref] */)
977 : {
978 0 : struct mdssvc_close r;
979 0 : NTSTATUS status;
980 :
981 : /* In parameters */
982 8 : r.in.in_handle = _in_handle;
983 8 : r.in.unkn1 = _unkn1;
984 8 : r.in.device_id = _device_id;
985 8 : r.in.unkn2 = _unkn2;
986 8 : r.in.unkn3 = _unkn3;
987 :
988 : /* Out parameters */
989 8 : r.out.out_handle = _out_handle;
990 8 : r.out.status = _status;
991 :
992 8 : status = dcerpc_mdssvc_close_r(h, mem_ctx, &r);
993 8 : if (!NT_STATUS_IS_OK(status)) {
994 2 : return status;
995 : }
996 :
997 : /* Return variables */
998 6 : *_out_handle = *r.out.out_handle;
999 6 : *_status = *r.out.status;
1000 :
1001 : /* Return result */
1002 :
1003 6 : return NT_STATUS_OK;
1004 : }
1005 :
|