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_ntsvcs.h"
7 : #include "bin/default/librpc/gen_ndr/ndr_ntsvcs_c.h"
8 :
9 : /* ntsvcs - client functions generated by pidl */
10 :
11 : struct dcerpc_PNP_GetVersion_r_state {
12 : TALLOC_CTX *out_mem_ctx;
13 : };
14 :
15 : static void dcerpc_PNP_GetVersion_r_done(struct tevent_req *subreq);
16 :
17 0 : struct tevent_req *dcerpc_PNP_GetVersion_r_send(TALLOC_CTX *mem_ctx,
18 : struct tevent_context *ev,
19 : struct dcerpc_binding_handle *h,
20 : struct PNP_GetVersion *r)
21 : {
22 0 : struct tevent_req *req;
23 0 : struct dcerpc_PNP_GetVersion_r_state *state;
24 0 : struct tevent_req *subreq;
25 :
26 0 : req = tevent_req_create(mem_ctx, &state,
27 : struct dcerpc_PNP_GetVersion_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_ntsvcs,
39 0 : NDR_PNP_GETVERSION, 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_PNP_GetVersion_r_done, req);
44 :
45 0 : return req;
46 : }
47 :
48 0 : static void dcerpc_PNP_GetVersion_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_PNP_GetVersion_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
65 : {
66 0 : struct dcerpc_PNP_GetVersion_r_state *state =
67 0 : tevent_req_data(req,
68 : struct dcerpc_PNP_GetVersion_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 4 : NTSTATUS dcerpc_PNP_GetVersion_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct PNP_GetVersion *r)
83 : {
84 0 : NTSTATUS status;
85 :
86 4 : status = dcerpc_binding_handle_call(h,
87 : NULL, &ndr_table_ntsvcs,
88 : NDR_PNP_GETVERSION, mem_ctx, r);
89 :
90 4 : return status;
91 : }
92 :
93 : struct dcerpc_PNP_GetVersion_state {
94 : struct PNP_GetVersion orig;
95 : struct PNP_GetVersion tmp;
96 : TALLOC_CTX *out_mem_ctx;
97 : };
98 :
99 : static void dcerpc_PNP_GetVersion_done(struct tevent_req *subreq);
100 :
101 0 : struct tevent_req *dcerpc_PNP_GetVersion_send(TALLOC_CTX *mem_ctx,
102 : struct tevent_context *ev,
103 : struct dcerpc_binding_handle *h,
104 : uint16_t *_version /* [out] [ref] */)
105 : {
106 0 : struct tevent_req *req;
107 0 : struct dcerpc_PNP_GetVersion_state *state;
108 0 : struct tevent_req *subreq;
109 :
110 0 : req = tevent_req_create(mem_ctx, &state,
111 : struct dcerpc_PNP_GetVersion_state);
112 0 : if (req == NULL) {
113 0 : return NULL;
114 : }
115 0 : state->out_mem_ctx = NULL;
116 :
117 : /* In parameters */
118 :
119 : /* Out parameters */
120 0 : state->orig.out.version = _version;
121 :
122 : /* Result */
123 0 : NDR_ZERO_STRUCT(state->orig.out.result);
124 :
125 0 : state->out_mem_ctx = talloc_named_const(state, 0,
126 : "dcerpc_PNP_GetVersion_out_memory");
127 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
128 0 : return tevent_req_post(req, ev);
129 : }
130 :
131 : /* make a temporary copy, that we pass to the dispatch function */
132 0 : state->tmp = state->orig;
133 :
134 0 : subreq = dcerpc_PNP_GetVersion_r_send(state, ev, h, &state->tmp);
135 0 : if (tevent_req_nomem(subreq, req)) {
136 0 : return tevent_req_post(req, ev);
137 : }
138 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetVersion_done, req);
139 0 : return req;
140 : }
141 :
142 0 : static void dcerpc_PNP_GetVersion_done(struct tevent_req *subreq)
143 : {
144 0 : struct tevent_req *req = tevent_req_callback_data(
145 : subreq, struct tevent_req);
146 0 : struct dcerpc_PNP_GetVersion_state *state = tevent_req_data(
147 : req, struct dcerpc_PNP_GetVersion_state);
148 0 : NTSTATUS status;
149 0 : TALLOC_CTX *mem_ctx;
150 :
151 0 : if (state->out_mem_ctx) {
152 0 : mem_ctx = state->out_mem_ctx;
153 : } else {
154 0 : mem_ctx = state;
155 : }
156 :
157 0 : status = dcerpc_PNP_GetVersion_r_recv(subreq, mem_ctx);
158 0 : TALLOC_FREE(subreq);
159 0 : if (tevent_req_nterror(req, status)) {
160 0 : return;
161 : }
162 :
163 : /* Copy out parameters */
164 0 : *state->orig.out.version = *state->tmp.out.version;
165 :
166 : /* Copy result */
167 0 : state->orig.out.result = state->tmp.out.result;
168 :
169 : /* Reset temporary structure */
170 0 : NDR_ZERO_STRUCT(state->tmp);
171 :
172 0 : tevent_req_done(req);
173 : }
174 :
175 0 : NTSTATUS dcerpc_PNP_GetVersion_recv(struct tevent_req *req,
176 : TALLOC_CTX *mem_ctx,
177 : WERROR *result)
178 : {
179 0 : struct dcerpc_PNP_GetVersion_state *state = tevent_req_data(
180 : req, struct dcerpc_PNP_GetVersion_state);
181 0 : NTSTATUS status;
182 :
183 0 : if (tevent_req_is_nterror(req, &status)) {
184 0 : tevent_req_received(req);
185 0 : return status;
186 : }
187 :
188 : /* Steal possible out parameters to the callers context */
189 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
190 :
191 : /* Return result */
192 0 : *result = state->orig.out.result;
193 :
194 0 : tevent_req_received(req);
195 0 : return NT_STATUS_OK;
196 : }
197 :
198 0 : NTSTATUS dcerpc_PNP_GetVersion(struct dcerpc_binding_handle *h,
199 : TALLOC_CTX *mem_ctx,
200 : uint16_t *_version /* [out] [ref] */,
201 : WERROR *result)
202 : {
203 0 : struct PNP_GetVersion r;
204 0 : NTSTATUS status;
205 :
206 : /* In parameters */
207 :
208 : /* Out parameters */
209 0 : r.out.version = _version;
210 :
211 : /* Result */
212 0 : NDR_ZERO_STRUCT(r.out.result);
213 :
214 0 : status = dcerpc_PNP_GetVersion_r(h, mem_ctx, &r);
215 0 : if (!NT_STATUS_IS_OK(status)) {
216 0 : return status;
217 : }
218 :
219 : /* Return variables */
220 0 : *_version = *r.out.version;
221 :
222 : /* Return result */
223 0 : *result = r.out.result;
224 :
225 0 : return NT_STATUS_OK;
226 : }
227 :
228 : struct dcerpc_PNP_ValidateDeviceInstance_r_state {
229 : TALLOC_CTX *out_mem_ctx;
230 : };
231 :
232 : static void dcerpc_PNP_ValidateDeviceInstance_r_done(struct tevent_req *subreq);
233 :
234 0 : struct tevent_req *dcerpc_PNP_ValidateDeviceInstance_r_send(TALLOC_CTX *mem_ctx,
235 : struct tevent_context *ev,
236 : struct dcerpc_binding_handle *h,
237 : struct PNP_ValidateDeviceInstance *r)
238 : {
239 0 : struct tevent_req *req;
240 0 : struct dcerpc_PNP_ValidateDeviceInstance_r_state *state;
241 0 : struct tevent_req *subreq;
242 :
243 0 : req = tevent_req_create(mem_ctx, &state,
244 : struct dcerpc_PNP_ValidateDeviceInstance_r_state);
245 0 : if (req == NULL) {
246 0 : return NULL;
247 : }
248 :
249 0 : state->out_mem_ctx = NULL;
250 :
251 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
252 : NULL, &ndr_table_ntsvcs,
253 : NDR_PNP_VALIDATEDEVICEINSTANCE, state, r);
254 0 : if (tevent_req_nomem(subreq, req)) {
255 0 : return tevent_req_post(req, ev);
256 : }
257 0 : tevent_req_set_callback(subreq, dcerpc_PNP_ValidateDeviceInstance_r_done, req);
258 :
259 0 : return req;
260 : }
261 :
262 0 : static void dcerpc_PNP_ValidateDeviceInstance_r_done(struct tevent_req *subreq)
263 : {
264 0 : struct tevent_req *req =
265 0 : tevent_req_callback_data(subreq,
266 : struct tevent_req);
267 0 : NTSTATUS status;
268 :
269 0 : status = dcerpc_binding_handle_call_recv(subreq);
270 0 : TALLOC_FREE(subreq);
271 0 : if (tevent_req_nterror(req, status)) {
272 0 : return;
273 : }
274 :
275 0 : tevent_req_done(req);
276 : }
277 :
278 0 : NTSTATUS dcerpc_PNP_ValidateDeviceInstance_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
279 : {
280 0 : struct dcerpc_PNP_ValidateDeviceInstance_r_state *state =
281 0 : tevent_req_data(req,
282 : struct dcerpc_PNP_ValidateDeviceInstance_r_state);
283 0 : NTSTATUS status;
284 :
285 0 : if (tevent_req_is_nterror(req, &status)) {
286 0 : tevent_req_received(req);
287 0 : return status;
288 : }
289 :
290 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
291 :
292 0 : tevent_req_received(req);
293 0 : return NT_STATUS_OK;
294 : }
295 :
296 0 : NTSTATUS dcerpc_PNP_ValidateDeviceInstance_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct PNP_ValidateDeviceInstance *r)
297 : {
298 0 : NTSTATUS status;
299 :
300 0 : status = dcerpc_binding_handle_call(h,
301 : NULL, &ndr_table_ntsvcs,
302 : NDR_PNP_VALIDATEDEVICEINSTANCE, mem_ctx, r);
303 :
304 0 : return status;
305 : }
306 :
307 : struct dcerpc_PNP_ValidateDeviceInstance_state {
308 : struct PNP_ValidateDeviceInstance orig;
309 : struct PNP_ValidateDeviceInstance tmp;
310 : TALLOC_CTX *out_mem_ctx;
311 : };
312 :
313 : static void dcerpc_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq);
314 :
315 0 : struct tevent_req *dcerpc_PNP_ValidateDeviceInstance_send(TALLOC_CTX *mem_ctx,
316 : struct tevent_context *ev,
317 : struct dcerpc_binding_handle *h,
318 : const char *_devicepath /* [in] [charset(UTF16),ref] */,
319 : uint32_t _flags /* [in] */)
320 : {
321 0 : struct tevent_req *req;
322 0 : struct dcerpc_PNP_ValidateDeviceInstance_state *state;
323 0 : struct tevent_req *subreq;
324 :
325 0 : req = tevent_req_create(mem_ctx, &state,
326 : struct dcerpc_PNP_ValidateDeviceInstance_state);
327 0 : if (req == NULL) {
328 0 : return NULL;
329 : }
330 0 : state->out_mem_ctx = NULL;
331 :
332 : /* In parameters */
333 0 : state->orig.in.devicepath = _devicepath;
334 0 : state->orig.in.flags = _flags;
335 :
336 : /* Out parameters */
337 :
338 : /* Result */
339 0 : NDR_ZERO_STRUCT(state->orig.out.result);
340 :
341 : /* make a temporary copy, that we pass to the dispatch function */
342 0 : state->tmp = state->orig;
343 :
344 0 : subreq = dcerpc_PNP_ValidateDeviceInstance_r_send(state, ev, h, &state->tmp);
345 0 : if (tevent_req_nomem(subreq, req)) {
346 0 : return tevent_req_post(req, ev);
347 : }
348 0 : tevent_req_set_callback(subreq, dcerpc_PNP_ValidateDeviceInstance_done, req);
349 0 : return req;
350 : }
351 :
352 0 : static void dcerpc_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq)
353 : {
354 0 : struct tevent_req *req = tevent_req_callback_data(
355 : subreq, struct tevent_req);
356 0 : struct dcerpc_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
357 : req, struct dcerpc_PNP_ValidateDeviceInstance_state);
358 0 : NTSTATUS status;
359 0 : TALLOC_CTX *mem_ctx;
360 :
361 0 : if (state->out_mem_ctx) {
362 0 : mem_ctx = state->out_mem_ctx;
363 : } else {
364 0 : mem_ctx = state;
365 : }
366 :
367 0 : status = dcerpc_PNP_ValidateDeviceInstance_r_recv(subreq, mem_ctx);
368 0 : TALLOC_FREE(subreq);
369 0 : if (tevent_req_nterror(req, status)) {
370 0 : return;
371 : }
372 :
373 : /* Copy out parameters */
374 :
375 : /* Copy result */
376 0 : state->orig.out.result = state->tmp.out.result;
377 :
378 : /* Reset temporary structure */
379 0 : NDR_ZERO_STRUCT(state->tmp);
380 :
381 0 : tevent_req_done(req);
382 : }
383 :
384 0 : NTSTATUS dcerpc_PNP_ValidateDeviceInstance_recv(struct tevent_req *req,
385 : TALLOC_CTX *mem_ctx,
386 : WERROR *result)
387 : {
388 0 : struct dcerpc_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
389 : req, struct dcerpc_PNP_ValidateDeviceInstance_state);
390 0 : NTSTATUS status;
391 :
392 0 : if (tevent_req_is_nterror(req, &status)) {
393 0 : tevent_req_received(req);
394 0 : return status;
395 : }
396 :
397 : /* Steal possible out parameters to the callers context */
398 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
399 :
400 : /* Return result */
401 0 : *result = state->orig.out.result;
402 :
403 0 : tevent_req_received(req);
404 0 : return NT_STATUS_OK;
405 : }
406 :
407 0 : NTSTATUS dcerpc_PNP_ValidateDeviceInstance(struct dcerpc_binding_handle *h,
408 : TALLOC_CTX *mem_ctx,
409 : const char *_devicepath /* [in] [charset(UTF16),ref] */,
410 : uint32_t _flags /* [in] */,
411 : WERROR *result)
412 : {
413 0 : struct PNP_ValidateDeviceInstance r;
414 0 : NTSTATUS status;
415 :
416 : /* In parameters */
417 0 : r.in.devicepath = _devicepath;
418 0 : r.in.flags = _flags;
419 :
420 : /* Out parameters */
421 :
422 : /* Result */
423 0 : NDR_ZERO_STRUCT(r.out.result);
424 :
425 0 : status = dcerpc_PNP_ValidateDeviceInstance_r(h, mem_ctx, &r);
426 0 : if (!NT_STATUS_IS_OK(status)) {
427 0 : return status;
428 : }
429 :
430 : /* Return variables */
431 :
432 : /* Return result */
433 0 : *result = r.out.result;
434 :
435 0 : return NT_STATUS_OK;
436 : }
437 :
438 : struct dcerpc_PNP_GetDeviceList_r_state {
439 : TALLOC_CTX *out_mem_ctx;
440 : };
441 :
442 : static void dcerpc_PNP_GetDeviceList_r_done(struct tevent_req *subreq);
443 :
444 0 : struct tevent_req *dcerpc_PNP_GetDeviceList_r_send(TALLOC_CTX *mem_ctx,
445 : struct tevent_context *ev,
446 : struct dcerpc_binding_handle *h,
447 : struct PNP_GetDeviceList *r)
448 : {
449 0 : struct tevent_req *req;
450 0 : struct dcerpc_PNP_GetDeviceList_r_state *state;
451 0 : struct tevent_req *subreq;
452 :
453 0 : req = tevent_req_create(mem_ctx, &state,
454 : struct dcerpc_PNP_GetDeviceList_r_state);
455 0 : if (req == NULL) {
456 0 : return NULL;
457 : }
458 :
459 0 : state->out_mem_ctx = talloc_new(state);
460 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
461 0 : return tevent_req_post(req, ev);
462 : }
463 :
464 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
465 : NULL, &ndr_table_ntsvcs,
466 0 : NDR_PNP_GETDEVICELIST, state->out_mem_ctx, r);
467 0 : if (tevent_req_nomem(subreq, req)) {
468 0 : return tevent_req_post(req, ev);
469 : }
470 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetDeviceList_r_done, req);
471 :
472 0 : return req;
473 : }
474 :
475 0 : static void dcerpc_PNP_GetDeviceList_r_done(struct tevent_req *subreq)
476 : {
477 0 : struct tevent_req *req =
478 0 : tevent_req_callback_data(subreq,
479 : struct tevent_req);
480 0 : NTSTATUS status;
481 :
482 0 : status = dcerpc_binding_handle_call_recv(subreq);
483 0 : TALLOC_FREE(subreq);
484 0 : if (tevent_req_nterror(req, status)) {
485 0 : return;
486 : }
487 :
488 0 : tevent_req_done(req);
489 : }
490 :
491 0 : NTSTATUS dcerpc_PNP_GetDeviceList_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
492 : {
493 0 : struct dcerpc_PNP_GetDeviceList_r_state *state =
494 0 : tevent_req_data(req,
495 : struct dcerpc_PNP_GetDeviceList_r_state);
496 0 : NTSTATUS status;
497 :
498 0 : if (tevent_req_is_nterror(req, &status)) {
499 0 : tevent_req_received(req);
500 0 : return status;
501 : }
502 :
503 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
504 :
505 0 : tevent_req_received(req);
506 0 : return NT_STATUS_OK;
507 : }
508 :
509 12 : NTSTATUS dcerpc_PNP_GetDeviceList_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct PNP_GetDeviceList *r)
510 : {
511 0 : NTSTATUS status;
512 :
513 12 : status = dcerpc_binding_handle_call(h,
514 : NULL, &ndr_table_ntsvcs,
515 : NDR_PNP_GETDEVICELIST, mem_ctx, r);
516 :
517 12 : return status;
518 : }
519 :
520 : struct dcerpc_PNP_GetDeviceList_state {
521 : struct PNP_GetDeviceList orig;
522 : struct PNP_GetDeviceList tmp;
523 : TALLOC_CTX *out_mem_ctx;
524 : };
525 :
526 : static void dcerpc_PNP_GetDeviceList_done(struct tevent_req *subreq);
527 :
528 0 : struct tevent_req *dcerpc_PNP_GetDeviceList_send(TALLOC_CTX *mem_ctx,
529 : struct tevent_context *ev,
530 : struct dcerpc_binding_handle *h,
531 : const char *_filter /* [in] [charset(UTF16),unique] */,
532 : uint16_t *_buffer /* [out] [length_is(*length),ref,size_is(*length)] */,
533 : uint32_t *_length /* [in,out] [ref] */,
534 : uint32_t _flags /* [in] */)
535 : {
536 0 : struct tevent_req *req;
537 0 : struct dcerpc_PNP_GetDeviceList_state *state;
538 0 : struct tevent_req *subreq;
539 :
540 0 : req = tevent_req_create(mem_ctx, &state,
541 : struct dcerpc_PNP_GetDeviceList_state);
542 0 : if (req == NULL) {
543 0 : return NULL;
544 : }
545 0 : state->out_mem_ctx = NULL;
546 :
547 : /* In parameters */
548 0 : state->orig.in.filter = _filter;
549 0 : state->orig.in.length = _length;
550 0 : state->orig.in.flags = _flags;
551 :
552 : /* Out parameters */
553 0 : state->orig.out.buffer = _buffer;
554 0 : state->orig.out.length = _length;
555 :
556 : /* Result */
557 0 : NDR_ZERO_STRUCT(state->orig.out.result);
558 :
559 0 : state->out_mem_ctx = talloc_named_const(state, 0,
560 : "dcerpc_PNP_GetDeviceList_out_memory");
561 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
562 0 : return tevent_req_post(req, ev);
563 : }
564 :
565 : /* make a temporary copy, that we pass to the dispatch function */
566 0 : state->tmp = state->orig;
567 :
568 0 : subreq = dcerpc_PNP_GetDeviceList_r_send(state, ev, h, &state->tmp);
569 0 : if (tevent_req_nomem(subreq, req)) {
570 0 : return tevent_req_post(req, ev);
571 : }
572 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetDeviceList_done, req);
573 0 : return req;
574 : }
575 :
576 0 : static void dcerpc_PNP_GetDeviceList_done(struct tevent_req *subreq)
577 : {
578 0 : struct tevent_req *req = tevent_req_callback_data(
579 : subreq, struct tevent_req);
580 0 : struct dcerpc_PNP_GetDeviceList_state *state = tevent_req_data(
581 : req, struct dcerpc_PNP_GetDeviceList_state);
582 0 : NTSTATUS status;
583 0 : TALLOC_CTX *mem_ctx;
584 :
585 0 : if (state->out_mem_ctx) {
586 0 : mem_ctx = state->out_mem_ctx;
587 : } else {
588 0 : mem_ctx = state;
589 : }
590 :
591 0 : status = dcerpc_PNP_GetDeviceList_r_recv(subreq, mem_ctx);
592 0 : TALLOC_FREE(subreq);
593 0 : if (tevent_req_nterror(req, status)) {
594 0 : return;
595 : }
596 :
597 : /* Copy out parameters */
598 : {
599 0 : size_t _copy_len_buffer;
600 0 : if ((*state->tmp.out.length) > (*state->tmp.in.length)) {
601 0 : tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
602 0 : return;
603 : }
604 0 : _copy_len_buffer = *state->tmp.out.length;
605 0 : if (state->orig.out.buffer != state->tmp.out.buffer) {
606 0 : memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
607 : }
608 : }
609 0 : *state->orig.out.length = *state->tmp.out.length;
610 :
611 : /* Copy result */
612 0 : state->orig.out.result = state->tmp.out.result;
613 :
614 : /* Reset temporary structure */
615 0 : NDR_ZERO_STRUCT(state->tmp);
616 :
617 0 : tevent_req_done(req);
618 : }
619 :
620 0 : NTSTATUS dcerpc_PNP_GetDeviceList_recv(struct tevent_req *req,
621 : TALLOC_CTX *mem_ctx,
622 : WERROR *result)
623 : {
624 0 : struct dcerpc_PNP_GetDeviceList_state *state = tevent_req_data(
625 : req, struct dcerpc_PNP_GetDeviceList_state);
626 0 : NTSTATUS status;
627 :
628 0 : if (tevent_req_is_nterror(req, &status)) {
629 0 : tevent_req_received(req);
630 0 : return status;
631 : }
632 :
633 : /* Steal possible out parameters to the callers context */
634 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
635 :
636 : /* Return result */
637 0 : *result = state->orig.out.result;
638 :
639 0 : tevent_req_received(req);
640 0 : return NT_STATUS_OK;
641 : }
642 :
643 0 : NTSTATUS dcerpc_PNP_GetDeviceList(struct dcerpc_binding_handle *h,
644 : TALLOC_CTX *mem_ctx,
645 : const char *_filter /* [in] [charset(UTF16),unique] */,
646 : uint16_t *_buffer /* [out] [length_is(*length),ref,size_is(*length)] */,
647 : uint32_t *_length /* [in,out] [ref] */,
648 : uint32_t _flags /* [in] */,
649 : WERROR *result)
650 : {
651 0 : struct PNP_GetDeviceList r;
652 0 : NTSTATUS status;
653 :
654 : /* In parameters */
655 0 : r.in.filter = _filter;
656 0 : r.in.length = _length;
657 0 : r.in.flags = _flags;
658 :
659 : /* Out parameters */
660 0 : r.out.buffer = _buffer;
661 0 : r.out.length = _length;
662 :
663 : /* Result */
664 0 : NDR_ZERO_STRUCT(r.out.result);
665 :
666 0 : status = dcerpc_PNP_GetDeviceList_r(h, mem_ctx, &r);
667 0 : if (!NT_STATUS_IS_OK(status)) {
668 0 : return status;
669 : }
670 :
671 : /* Return variables */
672 : {
673 0 : size_t _copy_len_buffer;
674 0 : if ((*r.out.length) > (*r.in.length)) {
675 0 : return NT_STATUS_INVALID_NETWORK_RESPONSE;
676 : }
677 0 : _copy_len_buffer = *r.out.length;
678 0 : if (_buffer != r.out.buffer) {
679 0 : memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
680 : }
681 : }
682 0 : *_length = *r.out.length;
683 :
684 : /* Return result */
685 0 : *result = r.out.result;
686 :
687 0 : return NT_STATUS_OK;
688 : }
689 :
690 : struct dcerpc_PNP_GetDeviceListSize_r_state {
691 : TALLOC_CTX *out_mem_ctx;
692 : };
693 :
694 : static void dcerpc_PNP_GetDeviceListSize_r_done(struct tevent_req *subreq);
695 :
696 0 : struct tevent_req *dcerpc_PNP_GetDeviceListSize_r_send(TALLOC_CTX *mem_ctx,
697 : struct tevent_context *ev,
698 : struct dcerpc_binding_handle *h,
699 : struct PNP_GetDeviceListSize *r)
700 : {
701 0 : struct tevent_req *req;
702 0 : struct dcerpc_PNP_GetDeviceListSize_r_state *state;
703 0 : struct tevent_req *subreq;
704 :
705 0 : req = tevent_req_create(mem_ctx, &state,
706 : struct dcerpc_PNP_GetDeviceListSize_r_state);
707 0 : if (req == NULL) {
708 0 : return NULL;
709 : }
710 :
711 0 : state->out_mem_ctx = talloc_new(state);
712 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
713 0 : return tevent_req_post(req, ev);
714 : }
715 :
716 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
717 : NULL, &ndr_table_ntsvcs,
718 0 : NDR_PNP_GETDEVICELISTSIZE, state->out_mem_ctx, r);
719 0 : if (tevent_req_nomem(subreq, req)) {
720 0 : return tevent_req_post(req, ev);
721 : }
722 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetDeviceListSize_r_done, req);
723 :
724 0 : return req;
725 : }
726 :
727 0 : static void dcerpc_PNP_GetDeviceListSize_r_done(struct tevent_req *subreq)
728 : {
729 0 : struct tevent_req *req =
730 0 : tevent_req_callback_data(subreq,
731 : struct tevent_req);
732 0 : NTSTATUS status;
733 :
734 0 : status = dcerpc_binding_handle_call_recv(subreq);
735 0 : TALLOC_FREE(subreq);
736 0 : if (tevent_req_nterror(req, status)) {
737 0 : return;
738 : }
739 :
740 0 : tevent_req_done(req);
741 : }
742 :
743 0 : NTSTATUS dcerpc_PNP_GetDeviceListSize_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
744 : {
745 0 : struct dcerpc_PNP_GetDeviceListSize_r_state *state =
746 0 : tevent_req_data(req,
747 : struct dcerpc_PNP_GetDeviceListSize_r_state);
748 0 : NTSTATUS status;
749 :
750 0 : if (tevent_req_is_nterror(req, &status)) {
751 0 : tevent_req_received(req);
752 0 : return status;
753 : }
754 :
755 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
756 :
757 0 : tevent_req_received(req);
758 0 : return NT_STATUS_OK;
759 : }
760 :
761 12 : NTSTATUS dcerpc_PNP_GetDeviceListSize_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct PNP_GetDeviceListSize *r)
762 : {
763 0 : NTSTATUS status;
764 :
765 12 : status = dcerpc_binding_handle_call(h,
766 : NULL, &ndr_table_ntsvcs,
767 : NDR_PNP_GETDEVICELISTSIZE, mem_ctx, r);
768 :
769 12 : return status;
770 : }
771 :
772 : struct dcerpc_PNP_GetDeviceListSize_state {
773 : struct PNP_GetDeviceListSize orig;
774 : struct PNP_GetDeviceListSize tmp;
775 : TALLOC_CTX *out_mem_ctx;
776 : };
777 :
778 : static void dcerpc_PNP_GetDeviceListSize_done(struct tevent_req *subreq);
779 :
780 0 : struct tevent_req *dcerpc_PNP_GetDeviceListSize_send(TALLOC_CTX *mem_ctx,
781 : struct tevent_context *ev,
782 : struct dcerpc_binding_handle *h,
783 : const char *_devicename /* [in] [charset(UTF16),unique] */,
784 : uint32_t *_size /* [out] [ref] */,
785 : uint32_t _flags /* [in] */)
786 : {
787 0 : struct tevent_req *req;
788 0 : struct dcerpc_PNP_GetDeviceListSize_state *state;
789 0 : struct tevent_req *subreq;
790 :
791 0 : req = tevent_req_create(mem_ctx, &state,
792 : struct dcerpc_PNP_GetDeviceListSize_state);
793 0 : if (req == NULL) {
794 0 : return NULL;
795 : }
796 0 : state->out_mem_ctx = NULL;
797 :
798 : /* In parameters */
799 0 : state->orig.in.devicename = _devicename;
800 0 : state->orig.in.flags = _flags;
801 :
802 : /* Out parameters */
803 0 : state->orig.out.size = _size;
804 :
805 : /* Result */
806 0 : NDR_ZERO_STRUCT(state->orig.out.result);
807 :
808 0 : state->out_mem_ctx = talloc_named_const(state, 0,
809 : "dcerpc_PNP_GetDeviceListSize_out_memory");
810 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
811 0 : return tevent_req_post(req, ev);
812 : }
813 :
814 : /* make a temporary copy, that we pass to the dispatch function */
815 0 : state->tmp = state->orig;
816 :
817 0 : subreq = dcerpc_PNP_GetDeviceListSize_r_send(state, ev, h, &state->tmp);
818 0 : if (tevent_req_nomem(subreq, req)) {
819 0 : return tevent_req_post(req, ev);
820 : }
821 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetDeviceListSize_done, req);
822 0 : return req;
823 : }
824 :
825 0 : static void dcerpc_PNP_GetDeviceListSize_done(struct tevent_req *subreq)
826 : {
827 0 : struct tevent_req *req = tevent_req_callback_data(
828 : subreq, struct tevent_req);
829 0 : struct dcerpc_PNP_GetDeviceListSize_state *state = tevent_req_data(
830 : req, struct dcerpc_PNP_GetDeviceListSize_state);
831 0 : NTSTATUS status;
832 0 : TALLOC_CTX *mem_ctx;
833 :
834 0 : if (state->out_mem_ctx) {
835 0 : mem_ctx = state->out_mem_ctx;
836 : } else {
837 0 : mem_ctx = state;
838 : }
839 :
840 0 : status = dcerpc_PNP_GetDeviceListSize_r_recv(subreq, mem_ctx);
841 0 : TALLOC_FREE(subreq);
842 0 : if (tevent_req_nterror(req, status)) {
843 0 : return;
844 : }
845 :
846 : /* Copy out parameters */
847 0 : *state->orig.out.size = *state->tmp.out.size;
848 :
849 : /* Copy result */
850 0 : state->orig.out.result = state->tmp.out.result;
851 :
852 : /* Reset temporary structure */
853 0 : NDR_ZERO_STRUCT(state->tmp);
854 :
855 0 : tevent_req_done(req);
856 : }
857 :
858 0 : NTSTATUS dcerpc_PNP_GetDeviceListSize_recv(struct tevent_req *req,
859 : TALLOC_CTX *mem_ctx,
860 : WERROR *result)
861 : {
862 0 : struct dcerpc_PNP_GetDeviceListSize_state *state = tevent_req_data(
863 : req, struct dcerpc_PNP_GetDeviceListSize_state);
864 0 : NTSTATUS status;
865 :
866 0 : if (tevent_req_is_nterror(req, &status)) {
867 0 : tevent_req_received(req);
868 0 : return status;
869 : }
870 :
871 : /* Steal possible out parameters to the callers context */
872 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
873 :
874 : /* Return result */
875 0 : *result = state->orig.out.result;
876 :
877 0 : tevent_req_received(req);
878 0 : return NT_STATUS_OK;
879 : }
880 :
881 0 : NTSTATUS dcerpc_PNP_GetDeviceListSize(struct dcerpc_binding_handle *h,
882 : TALLOC_CTX *mem_ctx,
883 : const char *_devicename /* [in] [charset(UTF16),unique] */,
884 : uint32_t *_size /* [out] [ref] */,
885 : uint32_t _flags /* [in] */,
886 : WERROR *result)
887 : {
888 0 : struct PNP_GetDeviceListSize r;
889 0 : NTSTATUS status;
890 :
891 : /* In parameters */
892 0 : r.in.devicename = _devicename;
893 0 : r.in.flags = _flags;
894 :
895 : /* Out parameters */
896 0 : r.out.size = _size;
897 :
898 : /* Result */
899 0 : NDR_ZERO_STRUCT(r.out.result);
900 :
901 0 : status = dcerpc_PNP_GetDeviceListSize_r(h, mem_ctx, &r);
902 0 : if (!NT_STATUS_IS_OK(status)) {
903 0 : return status;
904 : }
905 :
906 : /* Return variables */
907 0 : *_size = *r.out.size;
908 :
909 : /* Return result */
910 0 : *result = r.out.result;
911 :
912 0 : return NT_STATUS_OK;
913 : }
914 :
915 : struct dcerpc_PNP_GetDeviceRegProp_r_state {
916 : TALLOC_CTX *out_mem_ctx;
917 : };
918 :
919 : static void dcerpc_PNP_GetDeviceRegProp_r_done(struct tevent_req *subreq);
920 :
921 0 : struct tevent_req *dcerpc_PNP_GetDeviceRegProp_r_send(TALLOC_CTX *mem_ctx,
922 : struct tevent_context *ev,
923 : struct dcerpc_binding_handle *h,
924 : struct PNP_GetDeviceRegProp *r)
925 : {
926 0 : struct tevent_req *req;
927 0 : struct dcerpc_PNP_GetDeviceRegProp_r_state *state;
928 0 : struct tevent_req *subreq;
929 :
930 0 : req = tevent_req_create(mem_ctx, &state,
931 : struct dcerpc_PNP_GetDeviceRegProp_r_state);
932 0 : if (req == NULL) {
933 0 : return NULL;
934 : }
935 :
936 0 : state->out_mem_ctx = talloc_new(state);
937 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
938 0 : return tevent_req_post(req, ev);
939 : }
940 :
941 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
942 : NULL, &ndr_table_ntsvcs,
943 0 : NDR_PNP_GETDEVICEREGPROP, state->out_mem_ctx, r);
944 0 : if (tevent_req_nomem(subreq, req)) {
945 0 : return tevent_req_post(req, ev);
946 : }
947 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetDeviceRegProp_r_done, req);
948 :
949 0 : return req;
950 : }
951 :
952 0 : static void dcerpc_PNP_GetDeviceRegProp_r_done(struct tevent_req *subreq)
953 : {
954 0 : struct tevent_req *req =
955 0 : tevent_req_callback_data(subreq,
956 : struct tevent_req);
957 0 : NTSTATUS status;
958 :
959 0 : status = dcerpc_binding_handle_call_recv(subreq);
960 0 : TALLOC_FREE(subreq);
961 0 : if (tevent_req_nterror(req, status)) {
962 0 : return;
963 : }
964 :
965 0 : tevent_req_done(req);
966 : }
967 :
968 0 : NTSTATUS dcerpc_PNP_GetDeviceRegProp_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
969 : {
970 0 : struct dcerpc_PNP_GetDeviceRegProp_r_state *state =
971 0 : tevent_req_data(req,
972 : struct dcerpc_PNP_GetDeviceRegProp_r_state);
973 0 : NTSTATUS status;
974 :
975 0 : if (tevent_req_is_nterror(req, &status)) {
976 0 : tevent_req_received(req);
977 0 : return status;
978 : }
979 :
980 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
981 :
982 0 : tevent_req_received(req);
983 0 : return NT_STATUS_OK;
984 : }
985 :
986 4 : NTSTATUS dcerpc_PNP_GetDeviceRegProp_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct PNP_GetDeviceRegProp *r)
987 : {
988 0 : NTSTATUS status;
989 :
990 4 : status = dcerpc_binding_handle_call(h,
991 : NULL, &ndr_table_ntsvcs,
992 : NDR_PNP_GETDEVICEREGPROP, mem_ctx, r);
993 :
994 4 : return status;
995 : }
996 :
997 : struct dcerpc_PNP_GetDeviceRegProp_state {
998 : struct PNP_GetDeviceRegProp orig;
999 : struct PNP_GetDeviceRegProp tmp;
1000 : TALLOC_CTX *out_mem_ctx;
1001 : };
1002 :
1003 : static void dcerpc_PNP_GetDeviceRegProp_done(struct tevent_req *subreq);
1004 :
1005 0 : struct tevent_req *dcerpc_PNP_GetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
1006 : struct tevent_context *ev,
1007 : struct dcerpc_binding_handle *h,
1008 : const char *_devicepath /* [in] [charset(UTF16),ref] */,
1009 : uint32_t _property /* [in] */,
1010 : enum winreg_Type *_reg_data_type /* [in,out] [ref] */,
1011 : uint8_t *_buffer /* [out] [length_is(*buffer_size),ref,size_is(*buffer_size)] */,
1012 : uint32_t *_buffer_size /* [in,out] [ref] */,
1013 : uint32_t *_needed /* [in,out] [ref] */,
1014 : uint32_t _flags /* [in] */)
1015 : {
1016 0 : struct tevent_req *req;
1017 0 : struct dcerpc_PNP_GetDeviceRegProp_state *state;
1018 0 : struct tevent_req *subreq;
1019 :
1020 0 : req = tevent_req_create(mem_ctx, &state,
1021 : struct dcerpc_PNP_GetDeviceRegProp_state);
1022 0 : if (req == NULL) {
1023 0 : return NULL;
1024 : }
1025 0 : state->out_mem_ctx = NULL;
1026 :
1027 : /* In parameters */
1028 0 : state->orig.in.devicepath = _devicepath;
1029 0 : state->orig.in.property = _property;
1030 0 : state->orig.in.reg_data_type = _reg_data_type;
1031 0 : state->orig.in.buffer_size = _buffer_size;
1032 0 : state->orig.in.needed = _needed;
1033 0 : state->orig.in.flags = _flags;
1034 :
1035 : /* Out parameters */
1036 0 : state->orig.out.reg_data_type = _reg_data_type;
1037 0 : state->orig.out.buffer = _buffer;
1038 0 : state->orig.out.buffer_size = _buffer_size;
1039 0 : state->orig.out.needed = _needed;
1040 :
1041 : /* Result */
1042 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1043 :
1044 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1045 : "dcerpc_PNP_GetDeviceRegProp_out_memory");
1046 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1047 0 : return tevent_req_post(req, ev);
1048 : }
1049 :
1050 : /* make a temporary copy, that we pass to the dispatch function */
1051 0 : state->tmp = state->orig;
1052 :
1053 0 : subreq = dcerpc_PNP_GetDeviceRegProp_r_send(state, ev, h, &state->tmp);
1054 0 : if (tevent_req_nomem(subreq, req)) {
1055 0 : return tevent_req_post(req, ev);
1056 : }
1057 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetDeviceRegProp_done, req);
1058 0 : return req;
1059 : }
1060 :
1061 0 : static void dcerpc_PNP_GetDeviceRegProp_done(struct tevent_req *subreq)
1062 : {
1063 0 : struct tevent_req *req = tevent_req_callback_data(
1064 : subreq, struct tevent_req);
1065 0 : struct dcerpc_PNP_GetDeviceRegProp_state *state = tevent_req_data(
1066 : req, struct dcerpc_PNP_GetDeviceRegProp_state);
1067 0 : NTSTATUS status;
1068 0 : TALLOC_CTX *mem_ctx;
1069 :
1070 0 : if (state->out_mem_ctx) {
1071 0 : mem_ctx = state->out_mem_ctx;
1072 : } else {
1073 0 : mem_ctx = state;
1074 : }
1075 :
1076 0 : status = dcerpc_PNP_GetDeviceRegProp_r_recv(subreq, mem_ctx);
1077 0 : TALLOC_FREE(subreq);
1078 0 : if (tevent_req_nterror(req, status)) {
1079 0 : return;
1080 : }
1081 :
1082 : /* Copy out parameters */
1083 0 : *state->orig.out.reg_data_type = *state->tmp.out.reg_data_type;
1084 : {
1085 0 : size_t _copy_len_buffer;
1086 0 : if ((*state->tmp.out.buffer_size) > (*state->tmp.in.buffer_size)) {
1087 0 : tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
1088 0 : return;
1089 : }
1090 0 : _copy_len_buffer = *state->tmp.out.buffer_size;
1091 0 : if (state->orig.out.buffer != state->tmp.out.buffer) {
1092 0 : memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
1093 : }
1094 : }
1095 0 : *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
1096 0 : *state->orig.out.needed = *state->tmp.out.needed;
1097 :
1098 : /* Copy result */
1099 0 : state->orig.out.result = state->tmp.out.result;
1100 :
1101 : /* Reset temporary structure */
1102 0 : NDR_ZERO_STRUCT(state->tmp);
1103 :
1104 0 : tevent_req_done(req);
1105 : }
1106 :
1107 0 : NTSTATUS dcerpc_PNP_GetDeviceRegProp_recv(struct tevent_req *req,
1108 : TALLOC_CTX *mem_ctx,
1109 : WERROR *result)
1110 : {
1111 0 : struct dcerpc_PNP_GetDeviceRegProp_state *state = tevent_req_data(
1112 : req, struct dcerpc_PNP_GetDeviceRegProp_state);
1113 0 : NTSTATUS status;
1114 :
1115 0 : if (tevent_req_is_nterror(req, &status)) {
1116 0 : tevent_req_received(req);
1117 0 : return status;
1118 : }
1119 :
1120 : /* Steal possible out parameters to the callers context */
1121 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1122 :
1123 : /* Return result */
1124 0 : *result = state->orig.out.result;
1125 :
1126 0 : tevent_req_received(req);
1127 0 : return NT_STATUS_OK;
1128 : }
1129 :
1130 0 : NTSTATUS dcerpc_PNP_GetDeviceRegProp(struct dcerpc_binding_handle *h,
1131 : TALLOC_CTX *mem_ctx,
1132 : const char *_devicepath /* [in] [charset(UTF16),ref] */,
1133 : uint32_t _property /* [in] */,
1134 : enum winreg_Type *_reg_data_type /* [in,out] [ref] */,
1135 : uint8_t *_buffer /* [out] [length_is(*buffer_size),ref,size_is(*buffer_size)] */,
1136 : uint32_t *_buffer_size /* [in,out] [ref] */,
1137 : uint32_t *_needed /* [in,out] [ref] */,
1138 : uint32_t _flags /* [in] */,
1139 : WERROR *result)
1140 : {
1141 0 : struct PNP_GetDeviceRegProp r;
1142 0 : NTSTATUS status;
1143 :
1144 : /* In parameters */
1145 0 : r.in.devicepath = _devicepath;
1146 0 : r.in.property = _property;
1147 0 : r.in.reg_data_type = _reg_data_type;
1148 0 : r.in.buffer_size = _buffer_size;
1149 0 : r.in.needed = _needed;
1150 0 : r.in.flags = _flags;
1151 :
1152 : /* Out parameters */
1153 0 : r.out.reg_data_type = _reg_data_type;
1154 0 : r.out.buffer = _buffer;
1155 0 : r.out.buffer_size = _buffer_size;
1156 0 : r.out.needed = _needed;
1157 :
1158 : /* Result */
1159 0 : NDR_ZERO_STRUCT(r.out.result);
1160 :
1161 0 : status = dcerpc_PNP_GetDeviceRegProp_r(h, mem_ctx, &r);
1162 0 : if (!NT_STATUS_IS_OK(status)) {
1163 0 : return status;
1164 : }
1165 :
1166 : /* Return variables */
1167 0 : *_reg_data_type = *r.out.reg_data_type;
1168 : {
1169 0 : size_t _copy_len_buffer;
1170 0 : if ((*r.out.buffer_size) > (*r.in.buffer_size)) {
1171 0 : return NT_STATUS_INVALID_NETWORK_RESPONSE;
1172 : }
1173 0 : _copy_len_buffer = *r.out.buffer_size;
1174 0 : if (_buffer != r.out.buffer) {
1175 0 : memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
1176 : }
1177 : }
1178 0 : *_buffer_size = *r.out.buffer_size;
1179 0 : *_needed = *r.out.needed;
1180 :
1181 : /* Return result */
1182 0 : *result = r.out.result;
1183 :
1184 0 : return NT_STATUS_OK;
1185 : }
1186 :
1187 : struct dcerpc_PNP_HwProfFlags_r_state {
1188 : TALLOC_CTX *out_mem_ctx;
1189 : };
1190 :
1191 : static void dcerpc_PNP_HwProfFlags_r_done(struct tevent_req *subreq);
1192 :
1193 0 : struct tevent_req *dcerpc_PNP_HwProfFlags_r_send(TALLOC_CTX *mem_ctx,
1194 : struct tevent_context *ev,
1195 : struct dcerpc_binding_handle *h,
1196 : struct PNP_HwProfFlags *r)
1197 : {
1198 0 : struct tevent_req *req;
1199 0 : struct dcerpc_PNP_HwProfFlags_r_state *state;
1200 0 : struct tevent_req *subreq;
1201 :
1202 0 : req = tevent_req_create(mem_ctx, &state,
1203 : struct dcerpc_PNP_HwProfFlags_r_state);
1204 0 : if (req == NULL) {
1205 0 : return NULL;
1206 : }
1207 :
1208 0 : state->out_mem_ctx = talloc_new(state);
1209 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1210 0 : return tevent_req_post(req, ev);
1211 : }
1212 :
1213 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1214 : NULL, &ndr_table_ntsvcs,
1215 0 : NDR_PNP_HWPROFFLAGS, state->out_mem_ctx, r);
1216 0 : if (tevent_req_nomem(subreq, req)) {
1217 0 : return tevent_req_post(req, ev);
1218 : }
1219 0 : tevent_req_set_callback(subreq, dcerpc_PNP_HwProfFlags_r_done, req);
1220 :
1221 0 : return req;
1222 : }
1223 :
1224 0 : static void dcerpc_PNP_HwProfFlags_r_done(struct tevent_req *subreq)
1225 : {
1226 0 : struct tevent_req *req =
1227 0 : tevent_req_callback_data(subreq,
1228 : struct tevent_req);
1229 0 : NTSTATUS status;
1230 :
1231 0 : status = dcerpc_binding_handle_call_recv(subreq);
1232 0 : TALLOC_FREE(subreq);
1233 0 : if (tevent_req_nterror(req, status)) {
1234 0 : return;
1235 : }
1236 :
1237 0 : tevent_req_done(req);
1238 : }
1239 :
1240 0 : NTSTATUS dcerpc_PNP_HwProfFlags_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1241 : {
1242 0 : struct dcerpc_PNP_HwProfFlags_r_state *state =
1243 0 : tevent_req_data(req,
1244 : struct dcerpc_PNP_HwProfFlags_r_state);
1245 0 : NTSTATUS status;
1246 :
1247 0 : if (tevent_req_is_nterror(req, &status)) {
1248 0 : tevent_req_received(req);
1249 0 : return status;
1250 : }
1251 :
1252 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1253 :
1254 0 : tevent_req_received(req);
1255 0 : return NT_STATUS_OK;
1256 : }
1257 :
1258 0 : NTSTATUS dcerpc_PNP_HwProfFlags_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct PNP_HwProfFlags *r)
1259 : {
1260 0 : NTSTATUS status;
1261 :
1262 0 : status = dcerpc_binding_handle_call(h,
1263 : NULL, &ndr_table_ntsvcs,
1264 : NDR_PNP_HWPROFFLAGS, mem_ctx, r);
1265 :
1266 0 : return status;
1267 : }
1268 :
1269 : struct dcerpc_PNP_HwProfFlags_state {
1270 : struct PNP_HwProfFlags orig;
1271 : struct PNP_HwProfFlags tmp;
1272 : TALLOC_CTX *out_mem_ctx;
1273 : };
1274 :
1275 : static void dcerpc_PNP_HwProfFlags_done(struct tevent_req *subreq);
1276 :
1277 0 : struct tevent_req *dcerpc_PNP_HwProfFlags_send(TALLOC_CTX *mem_ctx,
1278 : struct tevent_context *ev,
1279 : struct dcerpc_binding_handle *h,
1280 : uint32_t _action /* [in] */,
1281 : const char *_devicepath /* [in] [charset(UTF16),ref] */,
1282 : uint32_t _config /* [in] */,
1283 : uint32_t *_profile_flags /* [in,out] [ref] */,
1284 : uint16_t *_veto_type /* [in,out] [unique] */,
1285 : const char *_unknown5 /* [in] [charset(UTF16),unique] */,
1286 : const char **_unknown5a /* [out] [charset(UTF16),unique] */,
1287 : uint32_t _name_length /* [in] */,
1288 : uint32_t _flags /* [in] */)
1289 : {
1290 0 : struct tevent_req *req;
1291 0 : struct dcerpc_PNP_HwProfFlags_state *state;
1292 0 : struct tevent_req *subreq;
1293 :
1294 0 : req = tevent_req_create(mem_ctx, &state,
1295 : struct dcerpc_PNP_HwProfFlags_state);
1296 0 : if (req == NULL) {
1297 0 : return NULL;
1298 : }
1299 0 : state->out_mem_ctx = NULL;
1300 :
1301 : /* In parameters */
1302 0 : state->orig.in.action = _action;
1303 0 : state->orig.in.devicepath = _devicepath;
1304 0 : state->orig.in.config = _config;
1305 0 : state->orig.in.profile_flags = _profile_flags;
1306 0 : state->orig.in.veto_type = _veto_type;
1307 0 : state->orig.in.unknown5 = _unknown5;
1308 0 : state->orig.in.name_length = _name_length;
1309 0 : state->orig.in.flags = _flags;
1310 :
1311 : /* Out parameters */
1312 0 : state->orig.out.profile_flags = _profile_flags;
1313 0 : state->orig.out.veto_type = _veto_type;
1314 0 : state->orig.out.unknown5a = _unknown5a;
1315 :
1316 : /* Result */
1317 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1318 :
1319 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1320 : "dcerpc_PNP_HwProfFlags_out_memory");
1321 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1322 0 : return tevent_req_post(req, ev);
1323 : }
1324 :
1325 : /* make a temporary copy, that we pass to the dispatch function */
1326 0 : state->tmp = state->orig;
1327 :
1328 0 : subreq = dcerpc_PNP_HwProfFlags_r_send(state, ev, h, &state->tmp);
1329 0 : if (tevent_req_nomem(subreq, req)) {
1330 0 : return tevent_req_post(req, ev);
1331 : }
1332 0 : tevent_req_set_callback(subreq, dcerpc_PNP_HwProfFlags_done, req);
1333 0 : return req;
1334 : }
1335 :
1336 0 : static void dcerpc_PNP_HwProfFlags_done(struct tevent_req *subreq)
1337 : {
1338 0 : struct tevent_req *req = tevent_req_callback_data(
1339 : subreq, struct tevent_req);
1340 0 : struct dcerpc_PNP_HwProfFlags_state *state = tevent_req_data(
1341 : req, struct dcerpc_PNP_HwProfFlags_state);
1342 0 : NTSTATUS status;
1343 0 : TALLOC_CTX *mem_ctx;
1344 :
1345 0 : if (state->out_mem_ctx) {
1346 0 : mem_ctx = state->out_mem_ctx;
1347 : } else {
1348 0 : mem_ctx = state;
1349 : }
1350 :
1351 0 : status = dcerpc_PNP_HwProfFlags_r_recv(subreq, mem_ctx);
1352 0 : TALLOC_FREE(subreq);
1353 0 : if (tevent_req_nterror(req, status)) {
1354 0 : return;
1355 : }
1356 :
1357 : /* Copy out parameters */
1358 0 : *state->orig.out.profile_flags = *state->tmp.out.profile_flags;
1359 0 : if (state->orig.out.veto_type && state->tmp.out.veto_type) {
1360 0 : *state->orig.out.veto_type = *state->tmp.out.veto_type;
1361 : }
1362 0 : if (state->orig.out.unknown5a && state->tmp.out.unknown5a) {
1363 0 : *state->orig.out.unknown5a = *state->tmp.out.unknown5a;
1364 : }
1365 :
1366 : /* Copy result */
1367 0 : state->orig.out.result = state->tmp.out.result;
1368 :
1369 : /* Reset temporary structure */
1370 0 : NDR_ZERO_STRUCT(state->tmp);
1371 :
1372 0 : tevent_req_done(req);
1373 : }
1374 :
1375 0 : NTSTATUS dcerpc_PNP_HwProfFlags_recv(struct tevent_req *req,
1376 : TALLOC_CTX *mem_ctx,
1377 : WERROR *result)
1378 : {
1379 0 : struct dcerpc_PNP_HwProfFlags_state *state = tevent_req_data(
1380 : req, struct dcerpc_PNP_HwProfFlags_state);
1381 0 : NTSTATUS status;
1382 :
1383 0 : if (tevent_req_is_nterror(req, &status)) {
1384 0 : tevent_req_received(req);
1385 0 : return status;
1386 : }
1387 :
1388 : /* Steal possible out parameters to the callers context */
1389 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1390 :
1391 : /* Return result */
1392 0 : *result = state->orig.out.result;
1393 :
1394 0 : tevent_req_received(req);
1395 0 : return NT_STATUS_OK;
1396 : }
1397 :
1398 0 : NTSTATUS dcerpc_PNP_HwProfFlags(struct dcerpc_binding_handle *h,
1399 : TALLOC_CTX *mem_ctx,
1400 : uint32_t _action /* [in] */,
1401 : const char *_devicepath /* [in] [charset(UTF16),ref] */,
1402 : uint32_t _config /* [in] */,
1403 : uint32_t *_profile_flags /* [in,out] [ref] */,
1404 : uint16_t *_veto_type /* [in,out] [unique] */,
1405 : const char *_unknown5 /* [in] [charset(UTF16),unique] */,
1406 : const char **_unknown5a /* [out] [charset(UTF16),unique] */,
1407 : uint32_t _name_length /* [in] */,
1408 : uint32_t _flags /* [in] */,
1409 : WERROR *result)
1410 : {
1411 0 : struct PNP_HwProfFlags r;
1412 0 : NTSTATUS status;
1413 :
1414 : /* In parameters */
1415 0 : r.in.action = _action;
1416 0 : r.in.devicepath = _devicepath;
1417 0 : r.in.config = _config;
1418 0 : r.in.profile_flags = _profile_flags;
1419 0 : r.in.veto_type = _veto_type;
1420 0 : r.in.unknown5 = _unknown5;
1421 0 : r.in.name_length = _name_length;
1422 0 : r.in.flags = _flags;
1423 :
1424 : /* Out parameters */
1425 0 : r.out.profile_flags = _profile_flags;
1426 0 : r.out.veto_type = _veto_type;
1427 0 : r.out.unknown5a = _unknown5a;
1428 :
1429 : /* Result */
1430 0 : NDR_ZERO_STRUCT(r.out.result);
1431 :
1432 0 : status = dcerpc_PNP_HwProfFlags_r(h, mem_ctx, &r);
1433 0 : if (!NT_STATUS_IS_OK(status)) {
1434 0 : return status;
1435 : }
1436 :
1437 : /* Return variables */
1438 0 : *_profile_flags = *r.out.profile_flags;
1439 0 : if (_veto_type && r.out.veto_type) {
1440 0 : *_veto_type = *r.out.veto_type;
1441 : }
1442 0 : if (_unknown5a && r.out.unknown5a) {
1443 0 : *_unknown5a = *r.out.unknown5a;
1444 : }
1445 :
1446 : /* Return result */
1447 0 : *result = r.out.result;
1448 :
1449 0 : return NT_STATUS_OK;
1450 : }
1451 :
1452 : struct dcerpc_PNP_GetHwProfInfo_r_state {
1453 : TALLOC_CTX *out_mem_ctx;
1454 : };
1455 :
1456 : static void dcerpc_PNP_GetHwProfInfo_r_done(struct tevent_req *subreq);
1457 :
1458 0 : struct tevent_req *dcerpc_PNP_GetHwProfInfo_r_send(TALLOC_CTX *mem_ctx,
1459 : struct tevent_context *ev,
1460 : struct dcerpc_binding_handle *h,
1461 : struct PNP_GetHwProfInfo *r)
1462 : {
1463 0 : struct tevent_req *req;
1464 0 : struct dcerpc_PNP_GetHwProfInfo_r_state *state;
1465 0 : struct tevent_req *subreq;
1466 :
1467 0 : req = tevent_req_create(mem_ctx, &state,
1468 : struct dcerpc_PNP_GetHwProfInfo_r_state);
1469 0 : if (req == NULL) {
1470 0 : return NULL;
1471 : }
1472 :
1473 0 : state->out_mem_ctx = talloc_new(state);
1474 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1475 0 : return tevent_req_post(req, ev);
1476 : }
1477 :
1478 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1479 : NULL, &ndr_table_ntsvcs,
1480 0 : NDR_PNP_GETHWPROFINFO, state->out_mem_ctx, r);
1481 0 : if (tevent_req_nomem(subreq, req)) {
1482 0 : return tevent_req_post(req, ev);
1483 : }
1484 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetHwProfInfo_r_done, req);
1485 :
1486 0 : return req;
1487 : }
1488 :
1489 0 : static void dcerpc_PNP_GetHwProfInfo_r_done(struct tevent_req *subreq)
1490 : {
1491 0 : struct tevent_req *req =
1492 0 : tevent_req_callback_data(subreq,
1493 : struct tevent_req);
1494 0 : NTSTATUS status;
1495 :
1496 0 : status = dcerpc_binding_handle_call_recv(subreq);
1497 0 : TALLOC_FREE(subreq);
1498 0 : if (tevent_req_nterror(req, status)) {
1499 0 : return;
1500 : }
1501 :
1502 0 : tevent_req_done(req);
1503 : }
1504 :
1505 0 : NTSTATUS dcerpc_PNP_GetHwProfInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1506 : {
1507 0 : struct dcerpc_PNP_GetHwProfInfo_r_state *state =
1508 0 : tevent_req_data(req,
1509 : struct dcerpc_PNP_GetHwProfInfo_r_state);
1510 0 : NTSTATUS status;
1511 :
1512 0 : if (tevent_req_is_nterror(req, &status)) {
1513 0 : tevent_req_received(req);
1514 0 : return status;
1515 : }
1516 :
1517 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1518 :
1519 0 : tevent_req_received(req);
1520 0 : return NT_STATUS_OK;
1521 : }
1522 :
1523 0 : NTSTATUS dcerpc_PNP_GetHwProfInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct PNP_GetHwProfInfo *r)
1524 : {
1525 0 : NTSTATUS status;
1526 :
1527 0 : status = dcerpc_binding_handle_call(h,
1528 : NULL, &ndr_table_ntsvcs,
1529 : NDR_PNP_GETHWPROFINFO, mem_ctx, r);
1530 :
1531 0 : return status;
1532 : }
1533 :
1534 : struct dcerpc_PNP_GetHwProfInfo_state {
1535 : struct PNP_GetHwProfInfo orig;
1536 : struct PNP_GetHwProfInfo tmp;
1537 : TALLOC_CTX *out_mem_ctx;
1538 : };
1539 :
1540 : static void dcerpc_PNP_GetHwProfInfo_done(struct tevent_req *subreq);
1541 :
1542 0 : struct tevent_req *dcerpc_PNP_GetHwProfInfo_send(TALLOC_CTX *mem_ctx,
1543 : struct tevent_context *ev,
1544 : struct dcerpc_binding_handle *h,
1545 : uint32_t _idx /* [in] */,
1546 : struct PNP_HwProfInfo *_info /* [in,out] [ref] */,
1547 : uint32_t _size /* [in] */,
1548 : uint32_t _flags /* [in] */)
1549 : {
1550 0 : struct tevent_req *req;
1551 0 : struct dcerpc_PNP_GetHwProfInfo_state *state;
1552 0 : struct tevent_req *subreq;
1553 :
1554 0 : req = tevent_req_create(mem_ctx, &state,
1555 : struct dcerpc_PNP_GetHwProfInfo_state);
1556 0 : if (req == NULL) {
1557 0 : return NULL;
1558 : }
1559 0 : state->out_mem_ctx = NULL;
1560 :
1561 : /* In parameters */
1562 0 : state->orig.in.idx = _idx;
1563 0 : state->orig.in.info = _info;
1564 0 : state->orig.in.size = _size;
1565 0 : state->orig.in.flags = _flags;
1566 :
1567 : /* Out parameters */
1568 0 : state->orig.out.info = _info;
1569 :
1570 : /* Result */
1571 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1572 :
1573 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1574 : "dcerpc_PNP_GetHwProfInfo_out_memory");
1575 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1576 0 : return tevent_req_post(req, ev);
1577 : }
1578 :
1579 : /* make a temporary copy, that we pass to the dispatch function */
1580 0 : state->tmp = state->orig;
1581 :
1582 0 : subreq = dcerpc_PNP_GetHwProfInfo_r_send(state, ev, h, &state->tmp);
1583 0 : if (tevent_req_nomem(subreq, req)) {
1584 0 : return tevent_req_post(req, ev);
1585 : }
1586 0 : tevent_req_set_callback(subreq, dcerpc_PNP_GetHwProfInfo_done, req);
1587 0 : return req;
1588 : }
1589 :
1590 0 : static void dcerpc_PNP_GetHwProfInfo_done(struct tevent_req *subreq)
1591 : {
1592 0 : struct tevent_req *req = tevent_req_callback_data(
1593 : subreq, struct tevent_req);
1594 0 : struct dcerpc_PNP_GetHwProfInfo_state *state = tevent_req_data(
1595 : req, struct dcerpc_PNP_GetHwProfInfo_state);
1596 0 : NTSTATUS status;
1597 0 : TALLOC_CTX *mem_ctx;
1598 :
1599 0 : if (state->out_mem_ctx) {
1600 0 : mem_ctx = state->out_mem_ctx;
1601 : } else {
1602 0 : mem_ctx = state;
1603 : }
1604 :
1605 0 : status = dcerpc_PNP_GetHwProfInfo_r_recv(subreq, mem_ctx);
1606 0 : TALLOC_FREE(subreq);
1607 0 : if (tevent_req_nterror(req, status)) {
1608 0 : return;
1609 : }
1610 :
1611 : /* Copy out parameters */
1612 0 : *state->orig.out.info = *state->tmp.out.info;
1613 :
1614 : /* Copy result */
1615 0 : state->orig.out.result = state->tmp.out.result;
1616 :
1617 : /* Reset temporary structure */
1618 0 : NDR_ZERO_STRUCT(state->tmp);
1619 :
1620 0 : tevent_req_done(req);
1621 : }
1622 :
1623 0 : NTSTATUS dcerpc_PNP_GetHwProfInfo_recv(struct tevent_req *req,
1624 : TALLOC_CTX *mem_ctx,
1625 : WERROR *result)
1626 : {
1627 0 : struct dcerpc_PNP_GetHwProfInfo_state *state = tevent_req_data(
1628 : req, struct dcerpc_PNP_GetHwProfInfo_state);
1629 0 : NTSTATUS status;
1630 :
1631 0 : if (tevent_req_is_nterror(req, &status)) {
1632 0 : tevent_req_received(req);
1633 0 : return status;
1634 : }
1635 :
1636 : /* Steal possible out parameters to the callers context */
1637 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1638 :
1639 : /* Return result */
1640 0 : *result = state->orig.out.result;
1641 :
1642 0 : tevent_req_received(req);
1643 0 : return NT_STATUS_OK;
1644 : }
1645 :
1646 0 : NTSTATUS dcerpc_PNP_GetHwProfInfo(struct dcerpc_binding_handle *h,
1647 : TALLOC_CTX *mem_ctx,
1648 : uint32_t _idx /* [in] */,
1649 : struct PNP_HwProfInfo *_info /* [in,out] [ref] */,
1650 : uint32_t _size /* [in] */,
1651 : uint32_t _flags /* [in] */,
1652 : WERROR *result)
1653 : {
1654 0 : struct PNP_GetHwProfInfo r;
1655 0 : NTSTATUS status;
1656 :
1657 : /* In parameters */
1658 0 : r.in.idx = _idx;
1659 0 : r.in.info = _info;
1660 0 : r.in.size = _size;
1661 0 : r.in.flags = _flags;
1662 :
1663 : /* Out parameters */
1664 0 : r.out.info = _info;
1665 :
1666 : /* Result */
1667 0 : NDR_ZERO_STRUCT(r.out.result);
1668 :
1669 0 : status = dcerpc_PNP_GetHwProfInfo_r(h, mem_ctx, &r);
1670 0 : if (!NT_STATUS_IS_OK(status)) {
1671 0 : return status;
1672 : }
1673 :
1674 : /* Return variables */
1675 0 : *_info = *r.out.info;
1676 :
1677 : /* Return result */
1678 0 : *result = r.out.result;
1679 :
1680 0 : return NT_STATUS_OK;
1681 : }
1682 :
|