s3-netlogon: add DS_WEB_SERVICE_REQUIRED bit for dsgetdcname calls.
[ira/wip.git] / librpc / gen_ndr / cli_ntsvcs.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_ntsvcs.h"
8
9 struct rpccli_PNP_Disconnect_state {
10         struct PNP_Disconnect orig;
11         struct PNP_Disconnect tmp;
12         TALLOC_CTX *out_mem_ctx;
13         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14 };
15
16 static void rpccli_PNP_Disconnect_done(struct tevent_req *subreq);
17
18 struct tevent_req *rpccli_PNP_Disconnect_send(TALLOC_CTX *mem_ctx,
19                                               struct tevent_context *ev,
20                                               struct rpc_pipe_client *cli)
21 {
22         struct tevent_req *req;
23         struct rpccli_PNP_Disconnect_state *state;
24         struct tevent_req *subreq;
25
26         req = tevent_req_create(mem_ctx, &state,
27                                 struct rpccli_PNP_Disconnect_state);
28         if (req == NULL) {
29                 return NULL;
30         }
31         state->out_mem_ctx = NULL;
32         state->dispatch_recv = cli->dispatch_recv;
33
34         /* In parameters */
35
36         /* Out parameters */
37
38         /* Result */
39         ZERO_STRUCT(state->orig.out.result);
40
41         if (DEBUGLEVEL >= 10) {
42                 NDR_PRINT_IN_DEBUG(PNP_Disconnect, &state->orig);
43         }
44
45         /* make a temporary copy, that we pass to the dispatch function */
46         state->tmp = state->orig;
47
48         subreq = cli->dispatch_send(state, ev, cli,
49                                     &ndr_table_ntsvcs,
50                                     NDR_PNP_DISCONNECT,
51                                     &state->tmp);
52         if (tevent_req_nomem(subreq, req)) {
53                 return tevent_req_post(req, ev);
54         }
55         tevent_req_set_callback(subreq, rpccli_PNP_Disconnect_done, req);
56         return req;
57 }
58
59 static void rpccli_PNP_Disconnect_done(struct tevent_req *subreq)
60 {
61         struct tevent_req *req = tevent_req_callback_data(
62                 subreq, struct tevent_req);
63         struct rpccli_PNP_Disconnect_state *state = tevent_req_data(
64                 req, struct rpccli_PNP_Disconnect_state);
65         NTSTATUS status;
66         TALLOC_CTX *mem_ctx;
67
68         if (state->out_mem_ctx) {
69                 mem_ctx = state->out_mem_ctx;
70         } else {
71                 mem_ctx = state;
72         }
73
74         status = state->dispatch_recv(subreq, mem_ctx);
75         TALLOC_FREE(subreq);
76         if (!NT_STATUS_IS_OK(status)) {
77                 tevent_req_nterror(req, status);
78                 return;
79         }
80
81         /* Copy out parameters */
82
83         /* Copy result */
84         state->orig.out.result = state->tmp.out.result;
85
86         /* Reset temporary structure */
87         ZERO_STRUCT(state->tmp);
88
89         if (DEBUGLEVEL >= 10) {
90                 NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &state->orig);
91         }
92
93         tevent_req_done(req);
94 }
95
96 NTSTATUS rpccli_PNP_Disconnect_recv(struct tevent_req *req,
97                                     TALLOC_CTX *mem_ctx,
98                                     WERROR *result)
99 {
100         struct rpccli_PNP_Disconnect_state *state = tevent_req_data(
101                 req, struct rpccli_PNP_Disconnect_state);
102         NTSTATUS status;
103
104         if (tevent_req_is_nterror(req, &status)) {
105                 tevent_req_received(req);
106                 return status;
107         }
108
109         /* Steal possbile out parameters to the callers context */
110         talloc_steal(mem_ctx, state->out_mem_ctx);
111
112         /* Return result */
113         *result = state->orig.out.result;
114
115         tevent_req_received(req);
116         return NT_STATUS_OK;
117 }
118
119 NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli,
120                                TALLOC_CTX *mem_ctx,
121                                WERROR *werror)
122 {
123         struct PNP_Disconnect r;
124         NTSTATUS status;
125
126         /* In parameters */
127
128         if (DEBUGLEVEL >= 10) {
129                 NDR_PRINT_IN_DEBUG(PNP_Disconnect, &r);
130         }
131
132         status = cli->dispatch(cli,
133                                 mem_ctx,
134                                 &ndr_table_ntsvcs,
135                                 NDR_PNP_DISCONNECT,
136                                 &r);
137
138         if (!NT_STATUS_IS_OK(status)) {
139                 return status;
140         }
141
142         if (DEBUGLEVEL >= 10) {
143                 NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &r);
144         }
145
146         if (NT_STATUS_IS_ERR(status)) {
147                 return status;
148         }
149
150         /* Return variables */
151
152         /* Return result */
153         if (werror) {
154                 *werror = r.out.result;
155         }
156
157         return werror_to_ntstatus(r.out.result);
158 }
159
160 struct rpccli_PNP_Connect_state {
161         struct PNP_Connect orig;
162         struct PNP_Connect tmp;
163         TALLOC_CTX *out_mem_ctx;
164         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
165 };
166
167 static void rpccli_PNP_Connect_done(struct tevent_req *subreq);
168
169 struct tevent_req *rpccli_PNP_Connect_send(TALLOC_CTX *mem_ctx,
170                                            struct tevent_context *ev,
171                                            struct rpc_pipe_client *cli)
172 {
173         struct tevent_req *req;
174         struct rpccli_PNP_Connect_state *state;
175         struct tevent_req *subreq;
176
177         req = tevent_req_create(mem_ctx, &state,
178                                 struct rpccli_PNP_Connect_state);
179         if (req == NULL) {
180                 return NULL;
181         }
182         state->out_mem_ctx = NULL;
183         state->dispatch_recv = cli->dispatch_recv;
184
185         /* In parameters */
186
187         /* Out parameters */
188
189         /* Result */
190         ZERO_STRUCT(state->orig.out.result);
191
192         if (DEBUGLEVEL >= 10) {
193                 NDR_PRINT_IN_DEBUG(PNP_Connect, &state->orig);
194         }
195
196         /* make a temporary copy, that we pass to the dispatch function */
197         state->tmp = state->orig;
198
199         subreq = cli->dispatch_send(state, ev, cli,
200                                     &ndr_table_ntsvcs,
201                                     NDR_PNP_CONNECT,
202                                     &state->tmp);
203         if (tevent_req_nomem(subreq, req)) {
204                 return tevent_req_post(req, ev);
205         }
206         tevent_req_set_callback(subreq, rpccli_PNP_Connect_done, req);
207         return req;
208 }
209
210 static void rpccli_PNP_Connect_done(struct tevent_req *subreq)
211 {
212         struct tevent_req *req = tevent_req_callback_data(
213                 subreq, struct tevent_req);
214         struct rpccli_PNP_Connect_state *state = tevent_req_data(
215                 req, struct rpccli_PNP_Connect_state);
216         NTSTATUS status;
217         TALLOC_CTX *mem_ctx;
218
219         if (state->out_mem_ctx) {
220                 mem_ctx = state->out_mem_ctx;
221         } else {
222                 mem_ctx = state;
223         }
224
225         status = state->dispatch_recv(subreq, mem_ctx);
226         TALLOC_FREE(subreq);
227         if (!NT_STATUS_IS_OK(status)) {
228                 tevent_req_nterror(req, status);
229                 return;
230         }
231
232         /* Copy out parameters */
233
234         /* Copy result */
235         state->orig.out.result = state->tmp.out.result;
236
237         /* Reset temporary structure */
238         ZERO_STRUCT(state->tmp);
239
240         if (DEBUGLEVEL >= 10) {
241                 NDR_PRINT_OUT_DEBUG(PNP_Connect, &state->orig);
242         }
243
244         tevent_req_done(req);
245 }
246
247 NTSTATUS rpccli_PNP_Connect_recv(struct tevent_req *req,
248                                  TALLOC_CTX *mem_ctx,
249                                  WERROR *result)
250 {
251         struct rpccli_PNP_Connect_state *state = tevent_req_data(
252                 req, struct rpccli_PNP_Connect_state);
253         NTSTATUS status;
254
255         if (tevent_req_is_nterror(req, &status)) {
256                 tevent_req_received(req);
257                 return status;
258         }
259
260         /* Steal possbile out parameters to the callers context */
261         talloc_steal(mem_ctx, state->out_mem_ctx);
262
263         /* Return result */
264         *result = state->orig.out.result;
265
266         tevent_req_received(req);
267         return NT_STATUS_OK;
268 }
269
270 NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli,
271                             TALLOC_CTX *mem_ctx,
272                             WERROR *werror)
273 {
274         struct PNP_Connect r;
275         NTSTATUS status;
276
277         /* In parameters */
278
279         if (DEBUGLEVEL >= 10) {
280                 NDR_PRINT_IN_DEBUG(PNP_Connect, &r);
281         }
282
283         status = cli->dispatch(cli,
284                                 mem_ctx,
285                                 &ndr_table_ntsvcs,
286                                 NDR_PNP_CONNECT,
287                                 &r);
288
289         if (!NT_STATUS_IS_OK(status)) {
290                 return status;
291         }
292
293         if (DEBUGLEVEL >= 10) {
294                 NDR_PRINT_OUT_DEBUG(PNP_Connect, &r);
295         }
296
297         if (NT_STATUS_IS_ERR(status)) {
298                 return status;
299         }
300
301         /* Return variables */
302
303         /* Return result */
304         if (werror) {
305                 *werror = r.out.result;
306         }
307
308         return werror_to_ntstatus(r.out.result);
309 }
310
311 struct rpccli_PNP_GetVersion_state {
312         struct PNP_GetVersion orig;
313         struct PNP_GetVersion tmp;
314         TALLOC_CTX *out_mem_ctx;
315         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
316 };
317
318 static void rpccli_PNP_GetVersion_done(struct tevent_req *subreq);
319
320 struct tevent_req *rpccli_PNP_GetVersion_send(TALLOC_CTX *mem_ctx,
321                                               struct tevent_context *ev,
322                                               struct rpc_pipe_client *cli,
323                                               uint16_t *_version /* [out] [ref] */)
324 {
325         struct tevent_req *req;
326         struct rpccli_PNP_GetVersion_state *state;
327         struct tevent_req *subreq;
328
329         req = tevent_req_create(mem_ctx, &state,
330                                 struct rpccli_PNP_GetVersion_state);
331         if (req == NULL) {
332                 return NULL;
333         }
334         state->out_mem_ctx = NULL;
335         state->dispatch_recv = cli->dispatch_recv;
336
337         /* In parameters */
338
339         /* Out parameters */
340         state->orig.out.version = _version;
341
342         /* Result */
343         ZERO_STRUCT(state->orig.out.result);
344
345         if (DEBUGLEVEL >= 10) {
346                 NDR_PRINT_IN_DEBUG(PNP_GetVersion, &state->orig);
347         }
348
349         state->out_mem_ctx = talloc_named_const(state, 0,
350                              "rpccli_PNP_GetVersion_out_memory");
351         if (tevent_req_nomem(state->out_mem_ctx, req)) {
352                 return tevent_req_post(req, ev);
353         }
354
355         /* make a temporary copy, that we pass to the dispatch function */
356         state->tmp = state->orig;
357
358         subreq = cli->dispatch_send(state, ev, cli,
359                                     &ndr_table_ntsvcs,
360                                     NDR_PNP_GETVERSION,
361                                     &state->tmp);
362         if (tevent_req_nomem(subreq, req)) {
363                 return tevent_req_post(req, ev);
364         }
365         tevent_req_set_callback(subreq, rpccli_PNP_GetVersion_done, req);
366         return req;
367 }
368
369 static void rpccli_PNP_GetVersion_done(struct tevent_req *subreq)
370 {
371         struct tevent_req *req = tevent_req_callback_data(
372                 subreq, struct tevent_req);
373         struct rpccli_PNP_GetVersion_state *state = tevent_req_data(
374                 req, struct rpccli_PNP_GetVersion_state);
375         NTSTATUS status;
376         TALLOC_CTX *mem_ctx;
377
378         if (state->out_mem_ctx) {
379                 mem_ctx = state->out_mem_ctx;
380         } else {
381                 mem_ctx = state;
382         }
383
384         status = state->dispatch_recv(subreq, mem_ctx);
385         TALLOC_FREE(subreq);
386         if (!NT_STATUS_IS_OK(status)) {
387                 tevent_req_nterror(req, status);
388                 return;
389         }
390
391         /* Copy out parameters */
392         *state->orig.out.version = *state->tmp.out.version;
393
394         /* Copy result */
395         state->orig.out.result = state->tmp.out.result;
396
397         /* Reset temporary structure */
398         ZERO_STRUCT(state->tmp);
399
400         if (DEBUGLEVEL >= 10) {
401                 NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &state->orig);
402         }
403
404         tevent_req_done(req);
405 }
406
407 NTSTATUS rpccli_PNP_GetVersion_recv(struct tevent_req *req,
408                                     TALLOC_CTX *mem_ctx,
409                                     WERROR *result)
410 {
411         struct rpccli_PNP_GetVersion_state *state = tevent_req_data(
412                 req, struct rpccli_PNP_GetVersion_state);
413         NTSTATUS status;
414
415         if (tevent_req_is_nterror(req, &status)) {
416                 tevent_req_received(req);
417                 return status;
418         }
419
420         /* Steal possbile out parameters to the callers context */
421         talloc_steal(mem_ctx, state->out_mem_ctx);
422
423         /* Return result */
424         *result = state->orig.out.result;
425
426         tevent_req_received(req);
427         return NT_STATUS_OK;
428 }
429
430 NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
431                                TALLOC_CTX *mem_ctx,
432                                uint16_t *version /* [out] [ref] */,
433                                WERROR *werror)
434 {
435         struct PNP_GetVersion r;
436         NTSTATUS status;
437
438         /* In parameters */
439
440         if (DEBUGLEVEL >= 10) {
441                 NDR_PRINT_IN_DEBUG(PNP_GetVersion, &r);
442         }
443
444         status = cli->dispatch(cli,
445                                 mem_ctx,
446                                 &ndr_table_ntsvcs,
447                                 NDR_PNP_GETVERSION,
448                                 &r);
449
450         if (!NT_STATUS_IS_OK(status)) {
451                 return status;
452         }
453
454         if (DEBUGLEVEL >= 10) {
455                 NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &r);
456         }
457
458         if (NT_STATUS_IS_ERR(status)) {
459                 return status;
460         }
461
462         /* Return variables */
463         *version = *r.out.version;
464
465         /* Return result */
466         if (werror) {
467                 *werror = r.out.result;
468         }
469
470         return werror_to_ntstatus(r.out.result);
471 }
472
473 struct rpccli_PNP_GetGlobalState_state {
474         struct PNP_GetGlobalState orig;
475         struct PNP_GetGlobalState tmp;
476         TALLOC_CTX *out_mem_ctx;
477         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
478 };
479
480 static void rpccli_PNP_GetGlobalState_done(struct tevent_req *subreq);
481
482 struct tevent_req *rpccli_PNP_GetGlobalState_send(TALLOC_CTX *mem_ctx,
483                                                   struct tevent_context *ev,
484                                                   struct rpc_pipe_client *cli)
485 {
486         struct tevent_req *req;
487         struct rpccli_PNP_GetGlobalState_state *state;
488         struct tevent_req *subreq;
489
490         req = tevent_req_create(mem_ctx, &state,
491                                 struct rpccli_PNP_GetGlobalState_state);
492         if (req == NULL) {
493                 return NULL;
494         }
495         state->out_mem_ctx = NULL;
496         state->dispatch_recv = cli->dispatch_recv;
497
498         /* In parameters */
499
500         /* Out parameters */
501
502         /* Result */
503         ZERO_STRUCT(state->orig.out.result);
504
505         if (DEBUGLEVEL >= 10) {
506                 NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &state->orig);
507         }
508
509         /* make a temporary copy, that we pass to the dispatch function */
510         state->tmp = state->orig;
511
512         subreq = cli->dispatch_send(state, ev, cli,
513                                     &ndr_table_ntsvcs,
514                                     NDR_PNP_GETGLOBALSTATE,
515                                     &state->tmp);
516         if (tevent_req_nomem(subreq, req)) {
517                 return tevent_req_post(req, ev);
518         }
519         tevent_req_set_callback(subreq, rpccli_PNP_GetGlobalState_done, req);
520         return req;
521 }
522
523 static void rpccli_PNP_GetGlobalState_done(struct tevent_req *subreq)
524 {
525         struct tevent_req *req = tevent_req_callback_data(
526                 subreq, struct tevent_req);
527         struct rpccli_PNP_GetGlobalState_state *state = tevent_req_data(
528                 req, struct rpccli_PNP_GetGlobalState_state);
529         NTSTATUS status;
530         TALLOC_CTX *mem_ctx;
531
532         if (state->out_mem_ctx) {
533                 mem_ctx = state->out_mem_ctx;
534         } else {
535                 mem_ctx = state;
536         }
537
538         status = state->dispatch_recv(subreq, mem_ctx);
539         TALLOC_FREE(subreq);
540         if (!NT_STATUS_IS_OK(status)) {
541                 tevent_req_nterror(req, status);
542                 return;
543         }
544
545         /* Copy out parameters */
546
547         /* Copy result */
548         state->orig.out.result = state->tmp.out.result;
549
550         /* Reset temporary structure */
551         ZERO_STRUCT(state->tmp);
552
553         if (DEBUGLEVEL >= 10) {
554                 NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &state->orig);
555         }
556
557         tevent_req_done(req);
558 }
559
560 NTSTATUS rpccli_PNP_GetGlobalState_recv(struct tevent_req *req,
561                                         TALLOC_CTX *mem_ctx,
562                                         WERROR *result)
563 {
564         struct rpccli_PNP_GetGlobalState_state *state = tevent_req_data(
565                 req, struct rpccli_PNP_GetGlobalState_state);
566         NTSTATUS status;
567
568         if (tevent_req_is_nterror(req, &status)) {
569                 tevent_req_received(req);
570                 return status;
571         }
572
573         /* Steal possbile out parameters to the callers context */
574         talloc_steal(mem_ctx, state->out_mem_ctx);
575
576         /* Return result */
577         *result = state->orig.out.result;
578
579         tevent_req_received(req);
580         return NT_STATUS_OK;
581 }
582
583 NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli,
584                                    TALLOC_CTX *mem_ctx,
585                                    WERROR *werror)
586 {
587         struct PNP_GetGlobalState r;
588         NTSTATUS status;
589
590         /* In parameters */
591
592         if (DEBUGLEVEL >= 10) {
593                 NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &r);
594         }
595
596         status = cli->dispatch(cli,
597                                 mem_ctx,
598                                 &ndr_table_ntsvcs,
599                                 NDR_PNP_GETGLOBALSTATE,
600                                 &r);
601
602         if (!NT_STATUS_IS_OK(status)) {
603                 return status;
604         }
605
606         if (DEBUGLEVEL >= 10) {
607                 NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &r);
608         }
609
610         if (NT_STATUS_IS_ERR(status)) {
611                 return status;
612         }
613
614         /* Return variables */
615
616         /* Return result */
617         if (werror) {
618                 *werror = r.out.result;
619         }
620
621         return werror_to_ntstatus(r.out.result);
622 }
623
624 struct rpccli_PNP_InitDetection_state {
625         struct PNP_InitDetection orig;
626         struct PNP_InitDetection tmp;
627         TALLOC_CTX *out_mem_ctx;
628         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
629 };
630
631 static void rpccli_PNP_InitDetection_done(struct tevent_req *subreq);
632
633 struct tevent_req *rpccli_PNP_InitDetection_send(TALLOC_CTX *mem_ctx,
634                                                  struct tevent_context *ev,
635                                                  struct rpc_pipe_client *cli)
636 {
637         struct tevent_req *req;
638         struct rpccli_PNP_InitDetection_state *state;
639         struct tevent_req *subreq;
640
641         req = tevent_req_create(mem_ctx, &state,
642                                 struct rpccli_PNP_InitDetection_state);
643         if (req == NULL) {
644                 return NULL;
645         }
646         state->out_mem_ctx = NULL;
647         state->dispatch_recv = cli->dispatch_recv;
648
649         /* In parameters */
650
651         /* Out parameters */
652
653         /* Result */
654         ZERO_STRUCT(state->orig.out.result);
655
656         if (DEBUGLEVEL >= 10) {
657                 NDR_PRINT_IN_DEBUG(PNP_InitDetection, &state->orig);
658         }
659
660         /* make a temporary copy, that we pass to the dispatch function */
661         state->tmp = state->orig;
662
663         subreq = cli->dispatch_send(state, ev, cli,
664                                     &ndr_table_ntsvcs,
665                                     NDR_PNP_INITDETECTION,
666                                     &state->tmp);
667         if (tevent_req_nomem(subreq, req)) {
668                 return tevent_req_post(req, ev);
669         }
670         tevent_req_set_callback(subreq, rpccli_PNP_InitDetection_done, req);
671         return req;
672 }
673
674 static void rpccli_PNP_InitDetection_done(struct tevent_req *subreq)
675 {
676         struct tevent_req *req = tevent_req_callback_data(
677                 subreq, struct tevent_req);
678         struct rpccli_PNP_InitDetection_state *state = tevent_req_data(
679                 req, struct rpccli_PNP_InitDetection_state);
680         NTSTATUS status;
681         TALLOC_CTX *mem_ctx;
682
683         if (state->out_mem_ctx) {
684                 mem_ctx = state->out_mem_ctx;
685         } else {
686                 mem_ctx = state;
687         }
688
689         status = state->dispatch_recv(subreq, mem_ctx);
690         TALLOC_FREE(subreq);
691         if (!NT_STATUS_IS_OK(status)) {
692                 tevent_req_nterror(req, status);
693                 return;
694         }
695
696         /* Copy out parameters */
697
698         /* Copy result */
699         state->orig.out.result = state->tmp.out.result;
700
701         /* Reset temporary structure */
702         ZERO_STRUCT(state->tmp);
703
704         if (DEBUGLEVEL >= 10) {
705                 NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &state->orig);
706         }
707
708         tevent_req_done(req);
709 }
710
711 NTSTATUS rpccli_PNP_InitDetection_recv(struct tevent_req *req,
712                                        TALLOC_CTX *mem_ctx,
713                                        WERROR *result)
714 {
715         struct rpccli_PNP_InitDetection_state *state = tevent_req_data(
716                 req, struct rpccli_PNP_InitDetection_state);
717         NTSTATUS status;
718
719         if (tevent_req_is_nterror(req, &status)) {
720                 tevent_req_received(req);
721                 return status;
722         }
723
724         /* Steal possbile out parameters to the callers context */
725         talloc_steal(mem_ctx, state->out_mem_ctx);
726
727         /* Return result */
728         *result = state->orig.out.result;
729
730         tevent_req_received(req);
731         return NT_STATUS_OK;
732 }
733
734 NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli,
735                                   TALLOC_CTX *mem_ctx,
736                                   WERROR *werror)
737 {
738         struct PNP_InitDetection r;
739         NTSTATUS status;
740
741         /* In parameters */
742
743         if (DEBUGLEVEL >= 10) {
744                 NDR_PRINT_IN_DEBUG(PNP_InitDetection, &r);
745         }
746
747         status = cli->dispatch(cli,
748                                 mem_ctx,
749                                 &ndr_table_ntsvcs,
750                                 NDR_PNP_INITDETECTION,
751                                 &r);
752
753         if (!NT_STATUS_IS_OK(status)) {
754                 return status;
755         }
756
757         if (DEBUGLEVEL >= 10) {
758                 NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &r);
759         }
760
761         if (NT_STATUS_IS_ERR(status)) {
762                 return status;
763         }
764
765         /* Return variables */
766
767         /* Return result */
768         if (werror) {
769                 *werror = r.out.result;
770         }
771
772         return werror_to_ntstatus(r.out.result);
773 }
774
775 struct rpccli_PNP_ReportLogOn_state {
776         struct PNP_ReportLogOn orig;
777         struct PNP_ReportLogOn tmp;
778         TALLOC_CTX *out_mem_ctx;
779         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
780 };
781
782 static void rpccli_PNP_ReportLogOn_done(struct tevent_req *subreq);
783
784 struct tevent_req *rpccli_PNP_ReportLogOn_send(TALLOC_CTX *mem_ctx,
785                                                struct tevent_context *ev,
786                                                struct rpc_pipe_client *cli)
787 {
788         struct tevent_req *req;
789         struct rpccli_PNP_ReportLogOn_state *state;
790         struct tevent_req *subreq;
791
792         req = tevent_req_create(mem_ctx, &state,
793                                 struct rpccli_PNP_ReportLogOn_state);
794         if (req == NULL) {
795                 return NULL;
796         }
797         state->out_mem_ctx = NULL;
798         state->dispatch_recv = cli->dispatch_recv;
799
800         /* In parameters */
801
802         /* Out parameters */
803
804         /* Result */
805         ZERO_STRUCT(state->orig.out.result);
806
807         if (DEBUGLEVEL >= 10) {
808                 NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &state->orig);
809         }
810
811         /* make a temporary copy, that we pass to the dispatch function */
812         state->tmp = state->orig;
813
814         subreq = cli->dispatch_send(state, ev, cli,
815                                     &ndr_table_ntsvcs,
816                                     NDR_PNP_REPORTLOGON,
817                                     &state->tmp);
818         if (tevent_req_nomem(subreq, req)) {
819                 return tevent_req_post(req, ev);
820         }
821         tevent_req_set_callback(subreq, rpccli_PNP_ReportLogOn_done, req);
822         return req;
823 }
824
825 static void rpccli_PNP_ReportLogOn_done(struct tevent_req *subreq)
826 {
827         struct tevent_req *req = tevent_req_callback_data(
828                 subreq, struct tevent_req);
829         struct rpccli_PNP_ReportLogOn_state *state = tevent_req_data(
830                 req, struct rpccli_PNP_ReportLogOn_state);
831         NTSTATUS status;
832         TALLOC_CTX *mem_ctx;
833
834         if (state->out_mem_ctx) {
835                 mem_ctx = state->out_mem_ctx;
836         } else {
837                 mem_ctx = state;
838         }
839
840         status = state->dispatch_recv(subreq, mem_ctx);
841         TALLOC_FREE(subreq);
842         if (!NT_STATUS_IS_OK(status)) {
843                 tevent_req_nterror(req, status);
844                 return;
845         }
846
847         /* Copy out parameters */
848
849         /* Copy result */
850         state->orig.out.result = state->tmp.out.result;
851
852         /* Reset temporary structure */
853         ZERO_STRUCT(state->tmp);
854
855         if (DEBUGLEVEL >= 10) {
856                 NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &state->orig);
857         }
858
859         tevent_req_done(req);
860 }
861
862 NTSTATUS rpccli_PNP_ReportLogOn_recv(struct tevent_req *req,
863                                      TALLOC_CTX *mem_ctx,
864                                      WERROR *result)
865 {
866         struct rpccli_PNP_ReportLogOn_state *state = tevent_req_data(
867                 req, struct rpccli_PNP_ReportLogOn_state);
868         NTSTATUS status;
869
870         if (tevent_req_is_nterror(req, &status)) {
871                 tevent_req_received(req);
872                 return status;
873         }
874
875         /* Steal possbile out parameters to the callers context */
876         talloc_steal(mem_ctx, state->out_mem_ctx);
877
878         /* Return result */
879         *result = state->orig.out.result;
880
881         tevent_req_received(req);
882         return NT_STATUS_OK;
883 }
884
885 NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli,
886                                 TALLOC_CTX *mem_ctx,
887                                 WERROR *werror)
888 {
889         struct PNP_ReportLogOn r;
890         NTSTATUS status;
891
892         /* In parameters */
893
894         if (DEBUGLEVEL >= 10) {
895                 NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &r);
896         }
897
898         status = cli->dispatch(cli,
899                                 mem_ctx,
900                                 &ndr_table_ntsvcs,
901                                 NDR_PNP_REPORTLOGON,
902                                 &r);
903
904         if (!NT_STATUS_IS_OK(status)) {
905                 return status;
906         }
907
908         if (DEBUGLEVEL >= 10) {
909                 NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &r);
910         }
911
912         if (NT_STATUS_IS_ERR(status)) {
913                 return status;
914         }
915
916         /* Return variables */
917
918         /* Return result */
919         if (werror) {
920                 *werror = r.out.result;
921         }
922
923         return werror_to_ntstatus(r.out.result);
924 }
925
926 struct rpccli_PNP_ValidateDeviceInstance_state {
927         struct PNP_ValidateDeviceInstance orig;
928         struct PNP_ValidateDeviceInstance tmp;
929         TALLOC_CTX *out_mem_ctx;
930         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
931 };
932
933 static void rpccli_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq);
934
935 struct tevent_req *rpccli_PNP_ValidateDeviceInstance_send(TALLOC_CTX *mem_ctx,
936                                                           struct tevent_context *ev,
937                                                           struct rpc_pipe_client *cli,
938                                                           const char *_devicepath /* [in] [ref,charset(UTF16)] */,
939                                                           uint32_t _flags /* [in]  */)
940 {
941         struct tevent_req *req;
942         struct rpccli_PNP_ValidateDeviceInstance_state *state;
943         struct tevent_req *subreq;
944
945         req = tevent_req_create(mem_ctx, &state,
946                                 struct rpccli_PNP_ValidateDeviceInstance_state);
947         if (req == NULL) {
948                 return NULL;
949         }
950         state->out_mem_ctx = NULL;
951         state->dispatch_recv = cli->dispatch_recv;
952
953         /* In parameters */
954         state->orig.in.devicepath = _devicepath;
955         state->orig.in.flags = _flags;
956
957         /* Out parameters */
958
959         /* Result */
960         ZERO_STRUCT(state->orig.out.result);
961
962         if (DEBUGLEVEL >= 10) {
963                 NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &state->orig);
964         }
965
966         /* make a temporary copy, that we pass to the dispatch function */
967         state->tmp = state->orig;
968
969         subreq = cli->dispatch_send(state, ev, cli,
970                                     &ndr_table_ntsvcs,
971                                     NDR_PNP_VALIDATEDEVICEINSTANCE,
972                                     &state->tmp);
973         if (tevent_req_nomem(subreq, req)) {
974                 return tevent_req_post(req, ev);
975         }
976         tevent_req_set_callback(subreq, rpccli_PNP_ValidateDeviceInstance_done, req);
977         return req;
978 }
979
980 static void rpccli_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq)
981 {
982         struct tevent_req *req = tevent_req_callback_data(
983                 subreq, struct tevent_req);
984         struct rpccli_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
985                 req, struct rpccli_PNP_ValidateDeviceInstance_state);
986         NTSTATUS status;
987         TALLOC_CTX *mem_ctx;
988
989         if (state->out_mem_ctx) {
990                 mem_ctx = state->out_mem_ctx;
991         } else {
992                 mem_ctx = state;
993         }
994
995         status = state->dispatch_recv(subreq, mem_ctx);
996         TALLOC_FREE(subreq);
997         if (!NT_STATUS_IS_OK(status)) {
998                 tevent_req_nterror(req, status);
999                 return;
1000         }
1001
1002         /* Copy out parameters */
1003
1004         /* Copy result */
1005         state->orig.out.result = state->tmp.out.result;
1006
1007         /* Reset temporary structure */
1008         ZERO_STRUCT(state->tmp);
1009
1010         if (DEBUGLEVEL >= 10) {
1011                 NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &state->orig);
1012         }
1013
1014         tevent_req_done(req);
1015 }
1016
1017 NTSTATUS rpccli_PNP_ValidateDeviceInstance_recv(struct tevent_req *req,
1018                                                 TALLOC_CTX *mem_ctx,
1019                                                 WERROR *result)
1020 {
1021         struct rpccli_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
1022                 req, struct rpccli_PNP_ValidateDeviceInstance_state);
1023         NTSTATUS status;
1024
1025         if (tevent_req_is_nterror(req, &status)) {
1026                 tevent_req_received(req);
1027                 return status;
1028         }
1029
1030         /* Steal possbile out parameters to the callers context */
1031         talloc_steal(mem_ctx, state->out_mem_ctx);
1032
1033         /* Return result */
1034         *result = state->orig.out.result;
1035
1036         tevent_req_received(req);
1037         return NT_STATUS_OK;
1038 }
1039
1040 NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
1041                                            TALLOC_CTX *mem_ctx,
1042                                            const char *devicepath /* [in] [ref,charset(UTF16)] */,
1043                                            uint32_t flags /* [in]  */,
1044                                            WERROR *werror)
1045 {
1046         struct PNP_ValidateDeviceInstance r;
1047         NTSTATUS status;
1048
1049         /* In parameters */
1050         r.in.devicepath = devicepath;
1051         r.in.flags = flags;
1052
1053         if (DEBUGLEVEL >= 10) {
1054                 NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &r);
1055         }
1056
1057         status = cli->dispatch(cli,
1058                                 mem_ctx,
1059                                 &ndr_table_ntsvcs,
1060                                 NDR_PNP_VALIDATEDEVICEINSTANCE,
1061                                 &r);
1062
1063         if (!NT_STATUS_IS_OK(status)) {
1064                 return status;
1065         }
1066
1067         if (DEBUGLEVEL >= 10) {
1068                 NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &r);
1069         }
1070
1071         if (NT_STATUS_IS_ERR(status)) {
1072                 return status;
1073         }
1074
1075         /* Return variables */
1076
1077         /* Return result */
1078         if (werror) {
1079                 *werror = r.out.result;
1080         }
1081
1082         return werror_to_ntstatus(r.out.result);
1083 }
1084
1085 struct rpccli_PNP_GetRootDeviceInstance_state {
1086         struct PNP_GetRootDeviceInstance orig;
1087         struct PNP_GetRootDeviceInstance tmp;
1088         TALLOC_CTX *out_mem_ctx;
1089         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1090 };
1091
1092 static void rpccli_PNP_GetRootDeviceInstance_done(struct tevent_req *subreq);
1093
1094 struct tevent_req *rpccli_PNP_GetRootDeviceInstance_send(TALLOC_CTX *mem_ctx,
1095                                                          struct tevent_context *ev,
1096                                                          struct rpc_pipe_client *cli)
1097 {
1098         struct tevent_req *req;
1099         struct rpccli_PNP_GetRootDeviceInstance_state *state;
1100         struct tevent_req *subreq;
1101
1102         req = tevent_req_create(mem_ctx, &state,
1103                                 struct rpccli_PNP_GetRootDeviceInstance_state);
1104         if (req == NULL) {
1105                 return NULL;
1106         }
1107         state->out_mem_ctx = NULL;
1108         state->dispatch_recv = cli->dispatch_recv;
1109
1110         /* In parameters */
1111
1112         /* Out parameters */
1113
1114         /* Result */
1115         ZERO_STRUCT(state->orig.out.result);
1116
1117         if (DEBUGLEVEL >= 10) {
1118                 NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &state->orig);
1119         }
1120
1121         /* make a temporary copy, that we pass to the dispatch function */
1122         state->tmp = state->orig;
1123
1124         subreq = cli->dispatch_send(state, ev, cli,
1125                                     &ndr_table_ntsvcs,
1126                                     NDR_PNP_GETROOTDEVICEINSTANCE,
1127                                     &state->tmp);
1128         if (tevent_req_nomem(subreq, req)) {
1129                 return tevent_req_post(req, ev);
1130         }
1131         tevent_req_set_callback(subreq, rpccli_PNP_GetRootDeviceInstance_done, req);
1132         return req;
1133 }
1134
1135 static void rpccli_PNP_GetRootDeviceInstance_done(struct tevent_req *subreq)
1136 {
1137         struct tevent_req *req = tevent_req_callback_data(
1138                 subreq, struct tevent_req);
1139         struct rpccli_PNP_GetRootDeviceInstance_state *state = tevent_req_data(
1140                 req, struct rpccli_PNP_GetRootDeviceInstance_state);
1141         NTSTATUS status;
1142         TALLOC_CTX *mem_ctx;
1143
1144         if (state->out_mem_ctx) {
1145                 mem_ctx = state->out_mem_ctx;
1146         } else {
1147                 mem_ctx = state;
1148         }
1149
1150         status = state->dispatch_recv(subreq, mem_ctx);
1151         TALLOC_FREE(subreq);
1152         if (!NT_STATUS_IS_OK(status)) {
1153                 tevent_req_nterror(req, status);
1154                 return;
1155         }
1156
1157         /* Copy out parameters */
1158
1159         /* Copy result */
1160         state->orig.out.result = state->tmp.out.result;
1161
1162         /* Reset temporary structure */
1163         ZERO_STRUCT(state->tmp);
1164
1165         if (DEBUGLEVEL >= 10) {
1166                 NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &state->orig);
1167         }
1168
1169         tevent_req_done(req);
1170 }
1171
1172 NTSTATUS rpccli_PNP_GetRootDeviceInstance_recv(struct tevent_req *req,
1173                                                TALLOC_CTX *mem_ctx,
1174                                                WERROR *result)
1175 {
1176         struct rpccli_PNP_GetRootDeviceInstance_state *state = tevent_req_data(
1177                 req, struct rpccli_PNP_GetRootDeviceInstance_state);
1178         NTSTATUS status;
1179
1180         if (tevent_req_is_nterror(req, &status)) {
1181                 tevent_req_received(req);
1182                 return status;
1183         }
1184
1185         /* Steal possbile out parameters to the callers context */
1186         talloc_steal(mem_ctx, state->out_mem_ctx);
1187
1188         /* Return result */
1189         *result = state->orig.out.result;
1190
1191         tevent_req_received(req);
1192         return NT_STATUS_OK;
1193 }
1194
1195 NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli,
1196                                           TALLOC_CTX *mem_ctx,
1197                                           WERROR *werror)
1198 {
1199         struct PNP_GetRootDeviceInstance r;
1200         NTSTATUS status;
1201
1202         /* In parameters */
1203
1204         if (DEBUGLEVEL >= 10) {
1205                 NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &r);
1206         }
1207
1208         status = cli->dispatch(cli,
1209                                 mem_ctx,
1210                                 &ndr_table_ntsvcs,
1211                                 NDR_PNP_GETROOTDEVICEINSTANCE,
1212                                 &r);
1213
1214         if (!NT_STATUS_IS_OK(status)) {
1215                 return status;
1216         }
1217
1218         if (DEBUGLEVEL >= 10) {
1219                 NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &r);
1220         }
1221
1222         if (NT_STATUS_IS_ERR(status)) {
1223                 return status;
1224         }
1225
1226         /* Return variables */
1227
1228         /* Return result */
1229         if (werror) {
1230                 *werror = r.out.result;
1231         }
1232
1233         return werror_to_ntstatus(r.out.result);
1234 }
1235
1236 struct rpccli_PNP_GetRelatedDeviceInstance_state {
1237         struct PNP_GetRelatedDeviceInstance orig;
1238         struct PNP_GetRelatedDeviceInstance tmp;
1239         TALLOC_CTX *out_mem_ctx;
1240         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1241 };
1242
1243 static void rpccli_PNP_GetRelatedDeviceInstance_done(struct tevent_req *subreq);
1244
1245 struct tevent_req *rpccli_PNP_GetRelatedDeviceInstance_send(TALLOC_CTX *mem_ctx,
1246                                                             struct tevent_context *ev,
1247                                                             struct rpc_pipe_client *cli)
1248 {
1249         struct tevent_req *req;
1250         struct rpccli_PNP_GetRelatedDeviceInstance_state *state;
1251         struct tevent_req *subreq;
1252
1253         req = tevent_req_create(mem_ctx, &state,
1254                                 struct rpccli_PNP_GetRelatedDeviceInstance_state);
1255         if (req == NULL) {
1256                 return NULL;
1257         }
1258         state->out_mem_ctx = NULL;
1259         state->dispatch_recv = cli->dispatch_recv;
1260
1261         /* In parameters */
1262
1263         /* Out parameters */
1264
1265         /* Result */
1266         ZERO_STRUCT(state->orig.out.result);
1267
1268         if (DEBUGLEVEL >= 10) {
1269                 NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &state->orig);
1270         }
1271
1272         /* make a temporary copy, that we pass to the dispatch function */
1273         state->tmp = state->orig;
1274
1275         subreq = cli->dispatch_send(state, ev, cli,
1276                                     &ndr_table_ntsvcs,
1277                                     NDR_PNP_GETRELATEDDEVICEINSTANCE,
1278                                     &state->tmp);
1279         if (tevent_req_nomem(subreq, req)) {
1280                 return tevent_req_post(req, ev);
1281         }
1282         tevent_req_set_callback(subreq, rpccli_PNP_GetRelatedDeviceInstance_done, req);
1283         return req;
1284 }
1285
1286 static void rpccli_PNP_GetRelatedDeviceInstance_done(struct tevent_req *subreq)
1287 {
1288         struct tevent_req *req = tevent_req_callback_data(
1289                 subreq, struct tevent_req);
1290         struct rpccli_PNP_GetRelatedDeviceInstance_state *state = tevent_req_data(
1291                 req, struct rpccli_PNP_GetRelatedDeviceInstance_state);
1292         NTSTATUS status;
1293         TALLOC_CTX *mem_ctx;
1294
1295         if (state->out_mem_ctx) {
1296                 mem_ctx = state->out_mem_ctx;
1297         } else {
1298                 mem_ctx = state;
1299         }
1300
1301         status = state->dispatch_recv(subreq, mem_ctx);
1302         TALLOC_FREE(subreq);
1303         if (!NT_STATUS_IS_OK(status)) {
1304                 tevent_req_nterror(req, status);
1305                 return;
1306         }
1307
1308         /* Copy out parameters */
1309
1310         /* Copy result */
1311         state->orig.out.result = state->tmp.out.result;
1312
1313         /* Reset temporary structure */
1314         ZERO_STRUCT(state->tmp);
1315
1316         if (DEBUGLEVEL >= 10) {
1317                 NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &state->orig);
1318         }
1319
1320         tevent_req_done(req);
1321 }
1322
1323 NTSTATUS rpccli_PNP_GetRelatedDeviceInstance_recv(struct tevent_req *req,
1324                                                   TALLOC_CTX *mem_ctx,
1325                                                   WERROR *result)
1326 {
1327         struct rpccli_PNP_GetRelatedDeviceInstance_state *state = tevent_req_data(
1328                 req, struct rpccli_PNP_GetRelatedDeviceInstance_state);
1329         NTSTATUS status;
1330
1331         if (tevent_req_is_nterror(req, &status)) {
1332                 tevent_req_received(req);
1333                 return status;
1334         }
1335
1336         /* Steal possbile out parameters to the callers context */
1337         talloc_steal(mem_ctx, state->out_mem_ctx);
1338
1339         /* Return result */
1340         *result = state->orig.out.result;
1341
1342         tevent_req_received(req);
1343         return NT_STATUS_OK;
1344 }
1345
1346 NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli,
1347                                              TALLOC_CTX *mem_ctx,
1348                                              WERROR *werror)
1349 {
1350         struct PNP_GetRelatedDeviceInstance r;
1351         NTSTATUS status;
1352
1353         /* In parameters */
1354
1355         if (DEBUGLEVEL >= 10) {
1356                 NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &r);
1357         }
1358
1359         status = cli->dispatch(cli,
1360                                 mem_ctx,
1361                                 &ndr_table_ntsvcs,
1362                                 NDR_PNP_GETRELATEDDEVICEINSTANCE,
1363                                 &r);
1364
1365         if (!NT_STATUS_IS_OK(status)) {
1366                 return status;
1367         }
1368
1369         if (DEBUGLEVEL >= 10) {
1370                 NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &r);
1371         }
1372
1373         if (NT_STATUS_IS_ERR(status)) {
1374                 return status;
1375         }
1376
1377         /* Return variables */
1378
1379         /* Return result */
1380         if (werror) {
1381                 *werror = r.out.result;
1382         }
1383
1384         return werror_to_ntstatus(r.out.result);
1385 }
1386
1387 struct rpccli_PNP_EnumerateSubKeys_state {
1388         struct PNP_EnumerateSubKeys orig;
1389         struct PNP_EnumerateSubKeys tmp;
1390         TALLOC_CTX *out_mem_ctx;
1391         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1392 };
1393
1394 static void rpccli_PNP_EnumerateSubKeys_done(struct tevent_req *subreq);
1395
1396 struct tevent_req *rpccli_PNP_EnumerateSubKeys_send(TALLOC_CTX *mem_ctx,
1397                                                     struct tevent_context *ev,
1398                                                     struct rpc_pipe_client *cli)
1399 {
1400         struct tevent_req *req;
1401         struct rpccli_PNP_EnumerateSubKeys_state *state;
1402         struct tevent_req *subreq;
1403
1404         req = tevent_req_create(mem_ctx, &state,
1405                                 struct rpccli_PNP_EnumerateSubKeys_state);
1406         if (req == NULL) {
1407                 return NULL;
1408         }
1409         state->out_mem_ctx = NULL;
1410         state->dispatch_recv = cli->dispatch_recv;
1411
1412         /* In parameters */
1413
1414         /* Out parameters */
1415
1416         /* Result */
1417         ZERO_STRUCT(state->orig.out.result);
1418
1419         if (DEBUGLEVEL >= 10) {
1420                 NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &state->orig);
1421         }
1422
1423         /* make a temporary copy, that we pass to the dispatch function */
1424         state->tmp = state->orig;
1425
1426         subreq = cli->dispatch_send(state, ev, cli,
1427                                     &ndr_table_ntsvcs,
1428                                     NDR_PNP_ENUMERATESUBKEYS,
1429                                     &state->tmp);
1430         if (tevent_req_nomem(subreq, req)) {
1431                 return tevent_req_post(req, ev);
1432         }
1433         tevent_req_set_callback(subreq, rpccli_PNP_EnumerateSubKeys_done, req);
1434         return req;
1435 }
1436
1437 static void rpccli_PNP_EnumerateSubKeys_done(struct tevent_req *subreq)
1438 {
1439         struct tevent_req *req = tevent_req_callback_data(
1440                 subreq, struct tevent_req);
1441         struct rpccli_PNP_EnumerateSubKeys_state *state = tevent_req_data(
1442                 req, struct rpccli_PNP_EnumerateSubKeys_state);
1443         NTSTATUS status;
1444         TALLOC_CTX *mem_ctx;
1445
1446         if (state->out_mem_ctx) {
1447                 mem_ctx = state->out_mem_ctx;
1448         } else {
1449                 mem_ctx = state;
1450         }
1451
1452         status = state->dispatch_recv(subreq, mem_ctx);
1453         TALLOC_FREE(subreq);
1454         if (!NT_STATUS_IS_OK(status)) {
1455                 tevent_req_nterror(req, status);
1456                 return;
1457         }
1458
1459         /* Copy out parameters */
1460
1461         /* Copy result */
1462         state->orig.out.result = state->tmp.out.result;
1463
1464         /* Reset temporary structure */
1465         ZERO_STRUCT(state->tmp);
1466
1467         if (DEBUGLEVEL >= 10) {
1468                 NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &state->orig);
1469         }
1470
1471         tevent_req_done(req);
1472 }
1473
1474 NTSTATUS rpccli_PNP_EnumerateSubKeys_recv(struct tevent_req *req,
1475                                           TALLOC_CTX *mem_ctx,
1476                                           WERROR *result)
1477 {
1478         struct rpccli_PNP_EnumerateSubKeys_state *state = tevent_req_data(
1479                 req, struct rpccli_PNP_EnumerateSubKeys_state);
1480         NTSTATUS status;
1481
1482         if (tevent_req_is_nterror(req, &status)) {
1483                 tevent_req_received(req);
1484                 return status;
1485         }
1486
1487         /* Steal possbile out parameters to the callers context */
1488         talloc_steal(mem_ctx, state->out_mem_ctx);
1489
1490         /* Return result */
1491         *result = state->orig.out.result;
1492
1493         tevent_req_received(req);
1494         return NT_STATUS_OK;
1495 }
1496
1497 NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli,
1498                                      TALLOC_CTX *mem_ctx,
1499                                      WERROR *werror)
1500 {
1501         struct PNP_EnumerateSubKeys r;
1502         NTSTATUS status;
1503
1504         /* In parameters */
1505
1506         if (DEBUGLEVEL >= 10) {
1507                 NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &r);
1508         }
1509
1510         status = cli->dispatch(cli,
1511                                 mem_ctx,
1512                                 &ndr_table_ntsvcs,
1513                                 NDR_PNP_ENUMERATESUBKEYS,
1514                                 &r);
1515
1516         if (!NT_STATUS_IS_OK(status)) {
1517                 return status;
1518         }
1519
1520         if (DEBUGLEVEL >= 10) {
1521                 NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &r);
1522         }
1523
1524         if (NT_STATUS_IS_ERR(status)) {
1525                 return status;
1526         }
1527
1528         /* Return variables */
1529
1530         /* Return result */
1531         if (werror) {
1532                 *werror = r.out.result;
1533         }
1534
1535         return werror_to_ntstatus(r.out.result);
1536 }
1537
1538 struct rpccli_PNP_GetDeviceList_state {
1539         struct PNP_GetDeviceList orig;
1540         struct PNP_GetDeviceList tmp;
1541         TALLOC_CTX *out_mem_ctx;
1542         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1543 };
1544
1545 static void rpccli_PNP_GetDeviceList_done(struct tevent_req *subreq);
1546
1547 struct tevent_req *rpccli_PNP_GetDeviceList_send(TALLOC_CTX *mem_ctx,
1548                                                  struct tevent_context *ev,
1549                                                  struct rpc_pipe_client *cli,
1550                                                  const char *_filter /* [in] [unique,charset(UTF16)] */,
1551                                                  uint16_t *_buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
1552                                                  uint32_t *_length /* [in,out] [ref] */,
1553                                                  uint32_t _flags /* [in]  */)
1554 {
1555         struct tevent_req *req;
1556         struct rpccli_PNP_GetDeviceList_state *state;
1557         struct tevent_req *subreq;
1558
1559         req = tevent_req_create(mem_ctx, &state,
1560                                 struct rpccli_PNP_GetDeviceList_state);
1561         if (req == NULL) {
1562                 return NULL;
1563         }
1564         state->out_mem_ctx = NULL;
1565         state->dispatch_recv = cli->dispatch_recv;
1566
1567         /* In parameters */
1568         state->orig.in.filter = _filter;
1569         state->orig.in.length = _length;
1570         state->orig.in.flags = _flags;
1571
1572         /* Out parameters */
1573         state->orig.out.buffer = _buffer;
1574         state->orig.out.length = _length;
1575
1576         /* Result */
1577         ZERO_STRUCT(state->orig.out.result);
1578
1579         if (DEBUGLEVEL >= 10) {
1580                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &state->orig);
1581         }
1582
1583         state->out_mem_ctx = talloc_named_const(state, 0,
1584                              "rpccli_PNP_GetDeviceList_out_memory");
1585         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1586                 return tevent_req_post(req, ev);
1587         }
1588
1589         /* make a temporary copy, that we pass to the dispatch function */
1590         state->tmp = state->orig;
1591
1592         subreq = cli->dispatch_send(state, ev, cli,
1593                                     &ndr_table_ntsvcs,
1594                                     NDR_PNP_GETDEVICELIST,
1595                                     &state->tmp);
1596         if (tevent_req_nomem(subreq, req)) {
1597                 return tevent_req_post(req, ev);
1598         }
1599         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceList_done, req);
1600         return req;
1601 }
1602
1603 static void rpccli_PNP_GetDeviceList_done(struct tevent_req *subreq)
1604 {
1605         struct tevent_req *req = tevent_req_callback_data(
1606                 subreq, struct tevent_req);
1607         struct rpccli_PNP_GetDeviceList_state *state = tevent_req_data(
1608                 req, struct rpccli_PNP_GetDeviceList_state);
1609         NTSTATUS status;
1610         TALLOC_CTX *mem_ctx;
1611
1612         if (state->out_mem_ctx) {
1613                 mem_ctx = state->out_mem_ctx;
1614         } else {
1615                 mem_ctx = state;
1616         }
1617
1618         status = state->dispatch_recv(subreq, mem_ctx);
1619         TALLOC_FREE(subreq);
1620         if (!NT_STATUS_IS_OK(status)) {
1621                 tevent_req_nterror(req, status);
1622                 return;
1623         }
1624
1625         /* Copy out parameters */
1626         memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.length * sizeof(*state->orig.out.buffer));
1627         *state->orig.out.length = *state->tmp.out.length;
1628
1629         /* Copy result */
1630         state->orig.out.result = state->tmp.out.result;
1631
1632         /* Reset temporary structure */
1633         ZERO_STRUCT(state->tmp);
1634
1635         if (DEBUGLEVEL >= 10) {
1636                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &state->orig);
1637         }
1638
1639         tevent_req_done(req);
1640 }
1641
1642 NTSTATUS rpccli_PNP_GetDeviceList_recv(struct tevent_req *req,
1643                                        TALLOC_CTX *mem_ctx,
1644                                        WERROR *result)
1645 {
1646         struct rpccli_PNP_GetDeviceList_state *state = tevent_req_data(
1647                 req, struct rpccli_PNP_GetDeviceList_state);
1648         NTSTATUS status;
1649
1650         if (tevent_req_is_nterror(req, &status)) {
1651                 tevent_req_received(req);
1652                 return status;
1653         }
1654
1655         /* Steal possbile out parameters to the callers context */
1656         talloc_steal(mem_ctx, state->out_mem_ctx);
1657
1658         /* Return result */
1659         *result = state->orig.out.result;
1660
1661         tevent_req_received(req);
1662         return NT_STATUS_OK;
1663 }
1664
1665 NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
1666                                   TALLOC_CTX *mem_ctx,
1667                                   const char *filter /* [in] [unique,charset(UTF16)] */,
1668                                   uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
1669                                   uint32_t *length /* [in,out] [ref] */,
1670                                   uint32_t flags /* [in]  */,
1671                                   WERROR *werror)
1672 {
1673         struct PNP_GetDeviceList r;
1674         NTSTATUS status;
1675
1676         /* In parameters */
1677         r.in.filter = filter;
1678         r.in.length = length;
1679         r.in.flags = flags;
1680
1681         if (DEBUGLEVEL >= 10) {
1682                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &r);
1683         }
1684
1685         status = cli->dispatch(cli,
1686                                 mem_ctx,
1687                                 &ndr_table_ntsvcs,
1688                                 NDR_PNP_GETDEVICELIST,
1689                                 &r);
1690
1691         if (!NT_STATUS_IS_OK(status)) {
1692                 return status;
1693         }
1694
1695         if (DEBUGLEVEL >= 10) {
1696                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &r);
1697         }
1698
1699         if (NT_STATUS_IS_ERR(status)) {
1700                 return status;
1701         }
1702
1703         /* Return variables */
1704         memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer));
1705         *length = *r.out.length;
1706
1707         /* Return result */
1708         if (werror) {
1709                 *werror = r.out.result;
1710         }
1711
1712         return werror_to_ntstatus(r.out.result);
1713 }
1714
1715 struct rpccli_PNP_GetDeviceListSize_state {
1716         struct PNP_GetDeviceListSize orig;
1717         struct PNP_GetDeviceListSize tmp;
1718         TALLOC_CTX *out_mem_ctx;
1719         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1720 };
1721
1722 static void rpccli_PNP_GetDeviceListSize_done(struct tevent_req *subreq);
1723
1724 struct tevent_req *rpccli_PNP_GetDeviceListSize_send(TALLOC_CTX *mem_ctx,
1725                                                      struct tevent_context *ev,
1726                                                      struct rpc_pipe_client *cli,
1727                                                      const char *_devicename /* [in] [unique,charset(UTF16)] */,
1728                                                      uint32_t *_size /* [out] [ref] */,
1729                                                      uint32_t _flags /* [in]  */)
1730 {
1731         struct tevent_req *req;
1732         struct rpccli_PNP_GetDeviceListSize_state *state;
1733         struct tevent_req *subreq;
1734
1735         req = tevent_req_create(mem_ctx, &state,
1736                                 struct rpccli_PNP_GetDeviceListSize_state);
1737         if (req == NULL) {
1738                 return NULL;
1739         }
1740         state->out_mem_ctx = NULL;
1741         state->dispatch_recv = cli->dispatch_recv;
1742
1743         /* In parameters */
1744         state->orig.in.devicename = _devicename;
1745         state->orig.in.flags = _flags;
1746
1747         /* Out parameters */
1748         state->orig.out.size = _size;
1749
1750         /* Result */
1751         ZERO_STRUCT(state->orig.out.result);
1752
1753         if (DEBUGLEVEL >= 10) {
1754                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &state->orig);
1755         }
1756
1757         state->out_mem_ctx = talloc_named_const(state, 0,
1758                              "rpccli_PNP_GetDeviceListSize_out_memory");
1759         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1760                 return tevent_req_post(req, ev);
1761         }
1762
1763         /* make a temporary copy, that we pass to the dispatch function */
1764         state->tmp = state->orig;
1765
1766         subreq = cli->dispatch_send(state, ev, cli,
1767                                     &ndr_table_ntsvcs,
1768                                     NDR_PNP_GETDEVICELISTSIZE,
1769                                     &state->tmp);
1770         if (tevent_req_nomem(subreq, req)) {
1771                 return tevent_req_post(req, ev);
1772         }
1773         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceListSize_done, req);
1774         return req;
1775 }
1776
1777 static void rpccli_PNP_GetDeviceListSize_done(struct tevent_req *subreq)
1778 {
1779         struct tevent_req *req = tevent_req_callback_data(
1780                 subreq, struct tevent_req);
1781         struct rpccli_PNP_GetDeviceListSize_state *state = tevent_req_data(
1782                 req, struct rpccli_PNP_GetDeviceListSize_state);
1783         NTSTATUS status;
1784         TALLOC_CTX *mem_ctx;
1785
1786         if (state->out_mem_ctx) {
1787                 mem_ctx = state->out_mem_ctx;
1788         } else {
1789                 mem_ctx = state;
1790         }
1791
1792         status = state->dispatch_recv(subreq, mem_ctx);
1793         TALLOC_FREE(subreq);
1794         if (!NT_STATUS_IS_OK(status)) {
1795                 tevent_req_nterror(req, status);
1796                 return;
1797         }
1798
1799         /* Copy out parameters */
1800         *state->orig.out.size = *state->tmp.out.size;
1801
1802         /* Copy result */
1803         state->orig.out.result = state->tmp.out.result;
1804
1805         /* Reset temporary structure */
1806         ZERO_STRUCT(state->tmp);
1807
1808         if (DEBUGLEVEL >= 10) {
1809                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &state->orig);
1810         }
1811
1812         tevent_req_done(req);
1813 }
1814
1815 NTSTATUS rpccli_PNP_GetDeviceListSize_recv(struct tevent_req *req,
1816                                            TALLOC_CTX *mem_ctx,
1817                                            WERROR *result)
1818 {
1819         struct rpccli_PNP_GetDeviceListSize_state *state = tevent_req_data(
1820                 req, struct rpccli_PNP_GetDeviceListSize_state);
1821         NTSTATUS status;
1822
1823         if (tevent_req_is_nterror(req, &status)) {
1824                 tevent_req_received(req);
1825                 return status;
1826         }
1827
1828         /* Steal possbile out parameters to the callers context */
1829         talloc_steal(mem_ctx, state->out_mem_ctx);
1830
1831         /* Return result */
1832         *result = state->orig.out.result;
1833
1834         tevent_req_received(req);
1835         return NT_STATUS_OK;
1836 }
1837
1838 NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli,
1839                                       TALLOC_CTX *mem_ctx,
1840                                       const char *devicename /* [in] [unique,charset(UTF16)] */,
1841                                       uint32_t *size /* [out] [ref] */,
1842                                       uint32_t flags /* [in]  */,
1843                                       WERROR *werror)
1844 {
1845         struct PNP_GetDeviceListSize r;
1846         NTSTATUS status;
1847
1848         /* In parameters */
1849         r.in.devicename = devicename;
1850         r.in.flags = flags;
1851
1852         if (DEBUGLEVEL >= 10) {
1853                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &r);
1854         }
1855
1856         status = cli->dispatch(cli,
1857                                 mem_ctx,
1858                                 &ndr_table_ntsvcs,
1859                                 NDR_PNP_GETDEVICELISTSIZE,
1860                                 &r);
1861
1862         if (!NT_STATUS_IS_OK(status)) {
1863                 return status;
1864         }
1865
1866         if (DEBUGLEVEL >= 10) {
1867                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &r);
1868         }
1869
1870         if (NT_STATUS_IS_ERR(status)) {
1871                 return status;
1872         }
1873
1874         /* Return variables */
1875         *size = *r.out.size;
1876
1877         /* Return result */
1878         if (werror) {
1879                 *werror = r.out.result;
1880         }
1881
1882         return werror_to_ntstatus(r.out.result);
1883 }
1884
1885 struct rpccli_PNP_GetDepth_state {
1886         struct PNP_GetDepth orig;
1887         struct PNP_GetDepth tmp;
1888         TALLOC_CTX *out_mem_ctx;
1889         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1890 };
1891
1892 static void rpccli_PNP_GetDepth_done(struct tevent_req *subreq);
1893
1894 struct tevent_req *rpccli_PNP_GetDepth_send(TALLOC_CTX *mem_ctx,
1895                                             struct tevent_context *ev,
1896                                             struct rpc_pipe_client *cli)
1897 {
1898         struct tevent_req *req;
1899         struct rpccli_PNP_GetDepth_state *state;
1900         struct tevent_req *subreq;
1901
1902         req = tevent_req_create(mem_ctx, &state,
1903                                 struct rpccli_PNP_GetDepth_state);
1904         if (req == NULL) {
1905                 return NULL;
1906         }
1907         state->out_mem_ctx = NULL;
1908         state->dispatch_recv = cli->dispatch_recv;
1909
1910         /* In parameters */
1911
1912         /* Out parameters */
1913
1914         /* Result */
1915         ZERO_STRUCT(state->orig.out.result);
1916
1917         if (DEBUGLEVEL >= 10) {
1918                 NDR_PRINT_IN_DEBUG(PNP_GetDepth, &state->orig);
1919         }
1920
1921         /* make a temporary copy, that we pass to the dispatch function */
1922         state->tmp = state->orig;
1923
1924         subreq = cli->dispatch_send(state, ev, cli,
1925                                     &ndr_table_ntsvcs,
1926                                     NDR_PNP_GETDEPTH,
1927                                     &state->tmp);
1928         if (tevent_req_nomem(subreq, req)) {
1929                 return tevent_req_post(req, ev);
1930         }
1931         tevent_req_set_callback(subreq, rpccli_PNP_GetDepth_done, req);
1932         return req;
1933 }
1934
1935 static void rpccli_PNP_GetDepth_done(struct tevent_req *subreq)
1936 {
1937         struct tevent_req *req = tevent_req_callback_data(
1938                 subreq, struct tevent_req);
1939         struct rpccli_PNP_GetDepth_state *state = tevent_req_data(
1940                 req, struct rpccli_PNP_GetDepth_state);
1941         NTSTATUS status;
1942         TALLOC_CTX *mem_ctx;
1943
1944         if (state->out_mem_ctx) {
1945                 mem_ctx = state->out_mem_ctx;
1946         } else {
1947                 mem_ctx = state;
1948         }
1949
1950         status = state->dispatch_recv(subreq, mem_ctx);
1951         TALLOC_FREE(subreq);
1952         if (!NT_STATUS_IS_OK(status)) {
1953                 tevent_req_nterror(req, status);
1954                 return;
1955         }
1956
1957         /* Copy out parameters */
1958
1959         /* Copy result */
1960         state->orig.out.result = state->tmp.out.result;
1961
1962         /* Reset temporary structure */
1963         ZERO_STRUCT(state->tmp);
1964
1965         if (DEBUGLEVEL >= 10) {
1966                 NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &state->orig);
1967         }
1968
1969         tevent_req_done(req);
1970 }
1971
1972 NTSTATUS rpccli_PNP_GetDepth_recv(struct tevent_req *req,
1973                                   TALLOC_CTX *mem_ctx,
1974                                   WERROR *result)
1975 {
1976         struct rpccli_PNP_GetDepth_state *state = tevent_req_data(
1977                 req, struct rpccli_PNP_GetDepth_state);
1978         NTSTATUS status;
1979
1980         if (tevent_req_is_nterror(req, &status)) {
1981                 tevent_req_received(req);
1982                 return status;
1983         }
1984
1985         /* Steal possbile out parameters to the callers context */
1986         talloc_steal(mem_ctx, state->out_mem_ctx);
1987
1988         /* Return result */
1989         *result = state->orig.out.result;
1990
1991         tevent_req_received(req);
1992         return NT_STATUS_OK;
1993 }
1994
1995 NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli,
1996                              TALLOC_CTX *mem_ctx,
1997                              WERROR *werror)
1998 {
1999         struct PNP_GetDepth r;
2000         NTSTATUS status;
2001
2002         /* In parameters */
2003
2004         if (DEBUGLEVEL >= 10) {
2005                 NDR_PRINT_IN_DEBUG(PNP_GetDepth, &r);
2006         }
2007
2008         status = cli->dispatch(cli,
2009                                 mem_ctx,
2010                                 &ndr_table_ntsvcs,
2011                                 NDR_PNP_GETDEPTH,
2012                                 &r);
2013
2014         if (!NT_STATUS_IS_OK(status)) {
2015                 return status;
2016         }
2017
2018         if (DEBUGLEVEL >= 10) {
2019                 NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &r);
2020         }
2021
2022         if (NT_STATUS_IS_ERR(status)) {
2023                 return status;
2024         }
2025
2026         /* Return variables */
2027
2028         /* Return result */
2029         if (werror) {
2030                 *werror = r.out.result;
2031         }
2032
2033         return werror_to_ntstatus(r.out.result);
2034 }
2035
2036 struct rpccli_PNP_GetDeviceRegProp_state {
2037         struct PNP_GetDeviceRegProp orig;
2038         struct PNP_GetDeviceRegProp tmp;
2039         TALLOC_CTX *out_mem_ctx;
2040         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2041 };
2042
2043 static void rpccli_PNP_GetDeviceRegProp_done(struct tevent_req *subreq);
2044
2045 struct tevent_req *rpccli_PNP_GetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
2046                                                     struct tevent_context *ev,
2047                                                     struct rpc_pipe_client *cli,
2048                                                     const char *_devicepath /* [in] [ref,charset(UTF16)] */,
2049                                                     uint32_t _property /* [in]  */,
2050                                                     enum winreg_Type *_reg_data_type /* [in,out] [ref] */,
2051                                                     uint8_t *_buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
2052                                                     uint32_t *_buffer_size /* [in,out] [ref] */,
2053                                                     uint32_t *_needed /* [in,out] [ref] */,
2054                                                     uint32_t _flags /* [in]  */)
2055 {
2056         struct tevent_req *req;
2057         struct rpccli_PNP_GetDeviceRegProp_state *state;
2058         struct tevent_req *subreq;
2059
2060         req = tevent_req_create(mem_ctx, &state,
2061                                 struct rpccli_PNP_GetDeviceRegProp_state);
2062         if (req == NULL) {
2063                 return NULL;
2064         }
2065         state->out_mem_ctx = NULL;
2066         state->dispatch_recv = cli->dispatch_recv;
2067
2068         /* In parameters */
2069         state->orig.in.devicepath = _devicepath;
2070         state->orig.in.property = _property;
2071         state->orig.in.reg_data_type = _reg_data_type;
2072         state->orig.in.buffer_size = _buffer_size;
2073         state->orig.in.needed = _needed;
2074         state->orig.in.flags = _flags;
2075
2076         /* Out parameters */
2077         state->orig.out.reg_data_type = _reg_data_type;
2078         state->orig.out.buffer = _buffer;
2079         state->orig.out.buffer_size = _buffer_size;
2080         state->orig.out.needed = _needed;
2081
2082         /* Result */
2083         ZERO_STRUCT(state->orig.out.result);
2084
2085         if (DEBUGLEVEL >= 10) {
2086                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &state->orig);
2087         }
2088
2089         state->out_mem_ctx = talloc_named_const(state, 0,
2090                              "rpccli_PNP_GetDeviceRegProp_out_memory");
2091         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2092                 return tevent_req_post(req, ev);
2093         }
2094
2095         /* make a temporary copy, that we pass to the dispatch function */
2096         state->tmp = state->orig;
2097
2098         subreq = cli->dispatch_send(state, ev, cli,
2099                                     &ndr_table_ntsvcs,
2100                                     NDR_PNP_GETDEVICEREGPROP,
2101                                     &state->tmp);
2102         if (tevent_req_nomem(subreq, req)) {
2103                 return tevent_req_post(req, ev);
2104         }
2105         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceRegProp_done, req);
2106         return req;
2107 }
2108
2109 static void rpccli_PNP_GetDeviceRegProp_done(struct tevent_req *subreq)
2110 {
2111         struct tevent_req *req = tevent_req_callback_data(
2112                 subreq, struct tevent_req);
2113         struct rpccli_PNP_GetDeviceRegProp_state *state = tevent_req_data(
2114                 req, struct rpccli_PNP_GetDeviceRegProp_state);
2115         NTSTATUS status;
2116         TALLOC_CTX *mem_ctx;
2117
2118         if (state->out_mem_ctx) {
2119                 mem_ctx = state->out_mem_ctx;
2120         } else {
2121                 mem_ctx = state;
2122         }
2123
2124         status = state->dispatch_recv(subreq, mem_ctx);
2125         TALLOC_FREE(subreq);
2126         if (!NT_STATUS_IS_OK(status)) {
2127                 tevent_req_nterror(req, status);
2128                 return;
2129         }
2130
2131         /* Copy out parameters */
2132         *state->orig.out.reg_data_type = *state->tmp.out.reg_data_type;
2133         memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.buffer_size * sizeof(*state->orig.out.buffer));
2134         *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
2135         *state->orig.out.needed = *state->tmp.out.needed;
2136
2137         /* Copy result */
2138         state->orig.out.result = state->tmp.out.result;
2139
2140         /* Reset temporary structure */
2141         ZERO_STRUCT(state->tmp);
2142
2143         if (DEBUGLEVEL >= 10) {
2144                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &state->orig);
2145         }
2146
2147         tevent_req_done(req);
2148 }
2149
2150 NTSTATUS rpccli_PNP_GetDeviceRegProp_recv(struct tevent_req *req,
2151                                           TALLOC_CTX *mem_ctx,
2152                                           WERROR *result)
2153 {
2154         struct rpccli_PNP_GetDeviceRegProp_state *state = tevent_req_data(
2155                 req, struct rpccli_PNP_GetDeviceRegProp_state);
2156         NTSTATUS status;
2157
2158         if (tevent_req_is_nterror(req, &status)) {
2159                 tevent_req_received(req);
2160                 return status;
2161         }
2162
2163         /* Steal possbile out parameters to the callers context */
2164         talloc_steal(mem_ctx, state->out_mem_ctx);
2165
2166         /* Return result */
2167         *result = state->orig.out.result;
2168
2169         tevent_req_received(req);
2170         return NT_STATUS_OK;
2171 }
2172
2173 NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
2174                                      TALLOC_CTX *mem_ctx,
2175                                      const char *devicepath /* [in] [ref,charset(UTF16)] */,
2176                                      uint32_t property /* [in]  */,
2177                                      enum winreg_Type *reg_data_type /* [in,out] [ref] */,
2178                                      uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
2179                                      uint32_t *buffer_size /* [in,out] [ref] */,
2180                                      uint32_t *needed /* [in,out] [ref] */,
2181                                      uint32_t flags /* [in]  */,
2182                                      WERROR *werror)
2183 {
2184         struct PNP_GetDeviceRegProp r;
2185         NTSTATUS status;
2186
2187         /* In parameters */
2188         r.in.devicepath = devicepath;
2189         r.in.property = property;
2190         r.in.reg_data_type = reg_data_type;
2191         r.in.buffer_size = buffer_size;
2192         r.in.needed = needed;
2193         r.in.flags = flags;
2194
2195         if (DEBUGLEVEL >= 10) {
2196                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &r);
2197         }
2198
2199         status = cli->dispatch(cli,
2200                                 mem_ctx,
2201                                 &ndr_table_ntsvcs,
2202                                 NDR_PNP_GETDEVICEREGPROP,
2203                                 &r);
2204
2205         if (!NT_STATUS_IS_OK(status)) {
2206                 return status;
2207         }
2208
2209         if (DEBUGLEVEL >= 10) {
2210                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &r);
2211         }
2212
2213         if (NT_STATUS_IS_ERR(status)) {
2214                 return status;
2215         }
2216
2217         /* Return variables */
2218         *reg_data_type = *r.out.reg_data_type;
2219         memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
2220         *buffer_size = *r.out.buffer_size;
2221         *needed = *r.out.needed;
2222
2223         /* Return result */
2224         if (werror) {
2225                 *werror = r.out.result;
2226         }
2227
2228         return werror_to_ntstatus(r.out.result);
2229 }
2230
2231 struct rpccli_PNP_SetDeviceRegProp_state {
2232         struct PNP_SetDeviceRegProp orig;
2233         struct PNP_SetDeviceRegProp tmp;
2234         TALLOC_CTX *out_mem_ctx;
2235         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2236 };
2237
2238 static void rpccli_PNP_SetDeviceRegProp_done(struct tevent_req *subreq);
2239
2240 struct tevent_req *rpccli_PNP_SetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
2241                                                     struct tevent_context *ev,
2242                                                     struct rpc_pipe_client *cli)
2243 {
2244         struct tevent_req *req;
2245         struct rpccli_PNP_SetDeviceRegProp_state *state;
2246         struct tevent_req *subreq;
2247
2248         req = tevent_req_create(mem_ctx, &state,
2249                                 struct rpccli_PNP_SetDeviceRegProp_state);
2250         if (req == NULL) {
2251                 return NULL;
2252         }
2253         state->out_mem_ctx = NULL;
2254         state->dispatch_recv = cli->dispatch_recv;
2255
2256         /* In parameters */
2257
2258         /* Out parameters */
2259
2260         /* Result */
2261         ZERO_STRUCT(state->orig.out.result);
2262
2263         if (DEBUGLEVEL >= 10) {
2264                 NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &state->orig);
2265         }
2266
2267         /* make a temporary copy, that we pass to the dispatch function */
2268         state->tmp = state->orig;
2269
2270         subreq = cli->dispatch_send(state, ev, cli,
2271                                     &ndr_table_ntsvcs,
2272                                     NDR_PNP_SETDEVICEREGPROP,
2273                                     &state->tmp);
2274         if (tevent_req_nomem(subreq, req)) {
2275                 return tevent_req_post(req, ev);
2276         }
2277         tevent_req_set_callback(subreq, rpccli_PNP_SetDeviceRegProp_done, req);
2278         return req;
2279 }
2280
2281 static void rpccli_PNP_SetDeviceRegProp_done(struct tevent_req *subreq)
2282 {
2283         struct tevent_req *req = tevent_req_callback_data(
2284                 subreq, struct tevent_req);
2285         struct rpccli_PNP_SetDeviceRegProp_state *state = tevent_req_data(
2286                 req, struct rpccli_PNP_SetDeviceRegProp_state);
2287         NTSTATUS status;
2288         TALLOC_CTX *mem_ctx;
2289
2290         if (state->out_mem_ctx) {
2291                 mem_ctx = state->out_mem_ctx;
2292         } else {
2293                 mem_ctx = state;
2294         }
2295
2296         status = state->dispatch_recv(subreq, mem_ctx);
2297         TALLOC_FREE(subreq);
2298         if (!NT_STATUS_IS_OK(status)) {
2299                 tevent_req_nterror(req, status);
2300                 return;
2301         }
2302
2303         /* Copy out parameters */
2304
2305         /* Copy result */
2306         state->orig.out.result = state->tmp.out.result;
2307
2308         /* Reset temporary structure */
2309         ZERO_STRUCT(state->tmp);
2310
2311         if (DEBUGLEVEL >= 10) {
2312                 NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &state->orig);
2313         }
2314
2315         tevent_req_done(req);
2316 }
2317
2318 NTSTATUS rpccli_PNP_SetDeviceRegProp_recv(struct tevent_req *req,
2319                                           TALLOC_CTX *mem_ctx,
2320                                           WERROR *result)
2321 {
2322         struct rpccli_PNP_SetDeviceRegProp_state *state = tevent_req_data(
2323                 req, struct rpccli_PNP_SetDeviceRegProp_state);
2324         NTSTATUS status;
2325
2326         if (tevent_req_is_nterror(req, &status)) {
2327                 tevent_req_received(req);
2328                 return status;
2329         }
2330
2331         /* Steal possbile out parameters to the callers context */
2332         talloc_steal(mem_ctx, state->out_mem_ctx);
2333
2334         /* Return result */
2335         *result = state->orig.out.result;
2336
2337         tevent_req_received(req);
2338         return NT_STATUS_OK;
2339 }
2340
2341 NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
2342                                      TALLOC_CTX *mem_ctx,
2343                                      WERROR *werror)
2344 {
2345         struct PNP_SetDeviceRegProp r;
2346         NTSTATUS status;
2347
2348         /* In parameters */
2349
2350         if (DEBUGLEVEL >= 10) {
2351                 NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &r);
2352         }
2353
2354         status = cli->dispatch(cli,
2355                                 mem_ctx,
2356                                 &ndr_table_ntsvcs,
2357                                 NDR_PNP_SETDEVICEREGPROP,
2358                                 &r);
2359
2360         if (!NT_STATUS_IS_OK(status)) {
2361                 return status;
2362         }
2363
2364         if (DEBUGLEVEL >= 10) {
2365                 NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &r);
2366         }
2367
2368         if (NT_STATUS_IS_ERR(status)) {
2369                 return status;
2370         }
2371
2372         /* Return variables */
2373
2374         /* Return result */
2375         if (werror) {
2376                 *werror = r.out.result;
2377         }
2378
2379         return werror_to_ntstatus(r.out.result);
2380 }
2381
2382 struct rpccli_PNP_GetClassInstance_state {
2383         struct PNP_GetClassInstance orig;
2384         struct PNP_GetClassInstance tmp;
2385         TALLOC_CTX *out_mem_ctx;
2386         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2387 };
2388
2389 static void rpccli_PNP_GetClassInstance_done(struct tevent_req *subreq);
2390
2391 struct tevent_req *rpccli_PNP_GetClassInstance_send(TALLOC_CTX *mem_ctx,
2392                                                     struct tevent_context *ev,
2393                                                     struct rpc_pipe_client *cli)
2394 {
2395         struct tevent_req *req;
2396         struct rpccli_PNP_GetClassInstance_state *state;
2397         struct tevent_req *subreq;
2398
2399         req = tevent_req_create(mem_ctx, &state,
2400                                 struct rpccli_PNP_GetClassInstance_state);
2401         if (req == NULL) {
2402                 return NULL;
2403         }
2404         state->out_mem_ctx = NULL;
2405         state->dispatch_recv = cli->dispatch_recv;
2406
2407         /* In parameters */
2408
2409         /* Out parameters */
2410
2411         /* Result */
2412         ZERO_STRUCT(state->orig.out.result);
2413
2414         if (DEBUGLEVEL >= 10) {
2415                 NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &state->orig);
2416         }
2417
2418         /* make a temporary copy, that we pass to the dispatch function */
2419         state->tmp = state->orig;
2420
2421         subreq = cli->dispatch_send(state, ev, cli,
2422                                     &ndr_table_ntsvcs,
2423                                     NDR_PNP_GETCLASSINSTANCE,
2424                                     &state->tmp);
2425         if (tevent_req_nomem(subreq, req)) {
2426                 return tevent_req_post(req, ev);
2427         }
2428         tevent_req_set_callback(subreq, rpccli_PNP_GetClassInstance_done, req);
2429         return req;
2430 }
2431
2432 static void rpccli_PNP_GetClassInstance_done(struct tevent_req *subreq)
2433 {
2434         struct tevent_req *req = tevent_req_callback_data(
2435                 subreq, struct tevent_req);
2436         struct rpccli_PNP_GetClassInstance_state *state = tevent_req_data(
2437                 req, struct rpccli_PNP_GetClassInstance_state);
2438         NTSTATUS status;
2439         TALLOC_CTX *mem_ctx;
2440
2441         if (state->out_mem_ctx) {
2442                 mem_ctx = state->out_mem_ctx;
2443         } else {
2444                 mem_ctx = state;
2445         }
2446
2447         status = state->dispatch_recv(subreq, mem_ctx);
2448         TALLOC_FREE(subreq);
2449         if (!NT_STATUS_IS_OK(status)) {
2450                 tevent_req_nterror(req, status);
2451                 return;
2452         }
2453
2454         /* Copy out parameters */
2455
2456         /* Copy result */
2457         state->orig.out.result = state->tmp.out.result;
2458
2459         /* Reset temporary structure */
2460         ZERO_STRUCT(state->tmp);
2461
2462         if (DEBUGLEVEL >= 10) {
2463                 NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &state->orig);
2464         }
2465
2466         tevent_req_done(req);
2467 }
2468
2469 NTSTATUS rpccli_PNP_GetClassInstance_recv(struct tevent_req *req,
2470                                           TALLOC_CTX *mem_ctx,
2471                                           WERROR *result)
2472 {
2473         struct rpccli_PNP_GetClassInstance_state *state = tevent_req_data(
2474                 req, struct rpccli_PNP_GetClassInstance_state);
2475         NTSTATUS status;
2476
2477         if (tevent_req_is_nterror(req, &status)) {
2478                 tevent_req_received(req);
2479                 return status;
2480         }
2481
2482         /* Steal possbile out parameters to the callers context */
2483         talloc_steal(mem_ctx, state->out_mem_ctx);
2484
2485         /* Return result */
2486         *result = state->orig.out.result;
2487
2488         tevent_req_received(req);
2489         return NT_STATUS_OK;
2490 }
2491
2492 NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli,
2493                                      TALLOC_CTX *mem_ctx,
2494                                      WERROR *werror)
2495 {
2496         struct PNP_GetClassInstance r;
2497         NTSTATUS status;
2498
2499         /* In parameters */
2500
2501         if (DEBUGLEVEL >= 10) {
2502                 NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &r);
2503         }
2504
2505         status = cli->dispatch(cli,
2506                                 mem_ctx,
2507                                 &ndr_table_ntsvcs,
2508                                 NDR_PNP_GETCLASSINSTANCE,
2509                                 &r);
2510
2511         if (!NT_STATUS_IS_OK(status)) {
2512                 return status;
2513         }
2514
2515         if (DEBUGLEVEL >= 10) {
2516                 NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &r);
2517         }
2518
2519         if (NT_STATUS_IS_ERR(status)) {
2520                 return status;
2521         }
2522
2523         /* Return variables */
2524
2525         /* Return result */
2526         if (werror) {
2527                 *werror = r.out.result;
2528         }
2529
2530         return werror_to_ntstatus(r.out.result);
2531 }
2532
2533 struct rpccli_PNP_CreateKey_state {
2534         struct PNP_CreateKey orig;
2535         struct PNP_CreateKey tmp;
2536         TALLOC_CTX *out_mem_ctx;
2537         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2538 };
2539
2540 static void rpccli_PNP_CreateKey_done(struct tevent_req *subreq);
2541
2542 struct tevent_req *rpccli_PNP_CreateKey_send(TALLOC_CTX *mem_ctx,
2543                                              struct tevent_context *ev,
2544                                              struct rpc_pipe_client *cli)
2545 {
2546         struct tevent_req *req;
2547         struct rpccli_PNP_CreateKey_state *state;
2548         struct tevent_req *subreq;
2549
2550         req = tevent_req_create(mem_ctx, &state,
2551                                 struct rpccli_PNP_CreateKey_state);
2552         if (req == NULL) {
2553                 return NULL;
2554         }
2555         state->out_mem_ctx = NULL;
2556         state->dispatch_recv = cli->dispatch_recv;
2557
2558         /* In parameters */
2559
2560         /* Out parameters */
2561
2562         /* Result */
2563         ZERO_STRUCT(state->orig.out.result);
2564
2565         if (DEBUGLEVEL >= 10) {
2566                 NDR_PRINT_IN_DEBUG(PNP_CreateKey, &state->orig);
2567         }
2568
2569         /* make a temporary copy, that we pass to the dispatch function */
2570         state->tmp = state->orig;
2571
2572         subreq = cli->dispatch_send(state, ev, cli,
2573                                     &ndr_table_ntsvcs,
2574                                     NDR_PNP_CREATEKEY,
2575                                     &state->tmp);
2576         if (tevent_req_nomem(subreq, req)) {
2577                 return tevent_req_post(req, ev);
2578         }
2579         tevent_req_set_callback(subreq, rpccli_PNP_CreateKey_done, req);
2580         return req;
2581 }
2582
2583 static void rpccli_PNP_CreateKey_done(struct tevent_req *subreq)
2584 {
2585         struct tevent_req *req = tevent_req_callback_data(
2586                 subreq, struct tevent_req);
2587         struct rpccli_PNP_CreateKey_state *state = tevent_req_data(
2588                 req, struct rpccli_PNP_CreateKey_state);
2589         NTSTATUS status;
2590         TALLOC_CTX *mem_ctx;
2591
2592         if (state->out_mem_ctx) {
2593                 mem_ctx = state->out_mem_ctx;
2594         } else {
2595                 mem_ctx = state;
2596         }
2597
2598         status = state->dispatch_recv(subreq, mem_ctx);
2599         TALLOC_FREE(subreq);
2600         if (!NT_STATUS_IS_OK(status)) {
2601                 tevent_req_nterror(req, status);
2602                 return;
2603         }
2604
2605         /* Copy out parameters */
2606
2607         /* Copy result */
2608         state->orig.out.result = state->tmp.out.result;
2609
2610         /* Reset temporary structure */
2611         ZERO_STRUCT(state->tmp);
2612
2613         if (DEBUGLEVEL >= 10) {
2614                 NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &state->orig);
2615         }
2616
2617         tevent_req_done(req);
2618 }
2619
2620 NTSTATUS rpccli_PNP_CreateKey_recv(struct tevent_req *req,
2621                                    TALLOC_CTX *mem_ctx,
2622                                    WERROR *result)
2623 {
2624         struct rpccli_PNP_CreateKey_state *state = tevent_req_data(
2625                 req, struct rpccli_PNP_CreateKey_state);
2626         NTSTATUS status;
2627
2628         if (tevent_req_is_nterror(req, &status)) {
2629                 tevent_req_received(req);
2630                 return status;
2631         }
2632
2633         /* Steal possbile out parameters to the callers context */
2634         talloc_steal(mem_ctx, state->out_mem_ctx);
2635
2636         /* Return result */
2637         *result = state->orig.out.result;
2638
2639         tevent_req_received(req);
2640         return NT_STATUS_OK;
2641 }
2642
2643 NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli,
2644                               TALLOC_CTX *mem_ctx,
2645                               WERROR *werror)
2646 {
2647         struct PNP_CreateKey r;
2648         NTSTATUS status;
2649
2650         /* In parameters */
2651
2652         if (DEBUGLEVEL >= 10) {
2653                 NDR_PRINT_IN_DEBUG(PNP_CreateKey, &r);
2654         }
2655
2656         status = cli->dispatch(cli,
2657                                 mem_ctx,
2658                                 &ndr_table_ntsvcs,
2659                                 NDR_PNP_CREATEKEY,
2660                                 &r);
2661
2662         if (!NT_STATUS_IS_OK(status)) {
2663                 return status;
2664         }
2665
2666         if (DEBUGLEVEL >= 10) {
2667                 NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &r);
2668         }
2669
2670         if (NT_STATUS_IS_ERR(status)) {
2671                 return status;
2672         }
2673
2674         /* Return variables */
2675
2676         /* Return result */
2677         if (werror) {
2678                 *werror = r.out.result;
2679         }
2680
2681         return werror_to_ntstatus(r.out.result);
2682 }
2683
2684 struct rpccli_PNP_DeleteRegistryKey_state {
2685         struct PNP_DeleteRegistryKey orig;
2686         struct PNP_DeleteRegistryKey tmp;
2687         TALLOC_CTX *out_mem_ctx;
2688         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2689 };
2690
2691 static void rpccli_PNP_DeleteRegistryKey_done(struct tevent_req *subreq);
2692
2693 struct tevent_req *rpccli_PNP_DeleteRegistryKey_send(TALLOC_CTX *mem_ctx,
2694                                                      struct tevent_context *ev,
2695                                                      struct rpc_pipe_client *cli)
2696 {
2697         struct tevent_req *req;
2698         struct rpccli_PNP_DeleteRegistryKey_state *state;
2699         struct tevent_req *subreq;
2700
2701         req = tevent_req_create(mem_ctx, &state,
2702                                 struct rpccli_PNP_DeleteRegistryKey_state);
2703         if (req == NULL) {
2704                 return NULL;
2705         }
2706         state->out_mem_ctx = NULL;
2707         state->dispatch_recv = cli->dispatch_recv;
2708
2709         /* In parameters */
2710
2711         /* Out parameters */
2712
2713         /* Result */
2714         ZERO_STRUCT(state->orig.out.result);
2715
2716         if (DEBUGLEVEL >= 10) {
2717                 NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &state->orig);
2718         }
2719
2720         /* make a temporary copy, that we pass to the dispatch function */
2721         state->tmp = state->orig;
2722
2723         subreq = cli->dispatch_send(state, ev, cli,
2724                                     &ndr_table_ntsvcs,
2725                                     NDR_PNP_DELETEREGISTRYKEY,
2726                                     &state->tmp);
2727         if (tevent_req_nomem(subreq, req)) {
2728                 return tevent_req_post(req, ev);
2729         }
2730         tevent_req_set_callback(subreq, rpccli_PNP_DeleteRegistryKey_done, req);
2731         return req;
2732 }
2733
2734 static void rpccli_PNP_DeleteRegistryKey_done(struct tevent_req *subreq)
2735 {
2736         struct tevent_req *req = tevent_req_callback_data(
2737                 subreq, struct tevent_req);
2738         struct rpccli_PNP_DeleteRegistryKey_state *state = tevent_req_data(
2739                 req, struct rpccli_PNP_DeleteRegistryKey_state);
2740         NTSTATUS status;
2741         TALLOC_CTX *mem_ctx;
2742
2743         if (state->out_mem_ctx) {
2744                 mem_ctx = state->out_mem_ctx;
2745         } else {
2746                 mem_ctx = state;
2747         }
2748
2749         status = state->dispatch_recv(subreq, mem_ctx);
2750         TALLOC_FREE(subreq);
2751         if (!NT_STATUS_IS_OK(status)) {
2752                 tevent_req_nterror(req, status);
2753                 return;
2754         }
2755
2756         /* Copy out parameters */
2757
2758         /* Copy result */
2759         state->orig.out.result = state->tmp.out.result;
2760
2761         /* Reset temporary structure */
2762         ZERO_STRUCT(state->tmp);
2763
2764         if (DEBUGLEVEL >= 10) {
2765                 NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &state->orig);
2766         }
2767
2768         tevent_req_done(req);
2769 }
2770
2771 NTSTATUS rpccli_PNP_DeleteRegistryKey_recv(struct tevent_req *req,
2772                                            TALLOC_CTX *mem_ctx,
2773                                            WERROR *result)
2774 {
2775         struct rpccli_PNP_DeleteRegistryKey_state *state = tevent_req_data(
2776                 req, struct rpccli_PNP_DeleteRegistryKey_state);
2777         NTSTATUS status;
2778
2779         if (tevent_req_is_nterror(req, &status)) {
2780                 tevent_req_received(req);
2781                 return status;
2782         }
2783
2784         /* Steal possbile out parameters to the callers context */
2785         talloc_steal(mem_ctx, state->out_mem_ctx);
2786
2787         /* Return result */
2788         *result = state->orig.out.result;
2789
2790         tevent_req_received(req);
2791         return NT_STATUS_OK;
2792 }
2793
2794 NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli,
2795                                       TALLOC_CTX *mem_ctx,
2796                                       WERROR *werror)
2797 {
2798         struct PNP_DeleteRegistryKey r;
2799         NTSTATUS status;
2800
2801         /* In parameters */
2802
2803         if (DEBUGLEVEL >= 10) {
2804                 NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &r);
2805         }
2806
2807         status = cli->dispatch(cli,
2808                                 mem_ctx,
2809                                 &ndr_table_ntsvcs,
2810                                 NDR_PNP_DELETEREGISTRYKEY,
2811                                 &r);
2812
2813         if (!NT_STATUS_IS_OK(status)) {
2814                 return status;
2815         }
2816
2817         if (DEBUGLEVEL >= 10) {
2818                 NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &r);
2819         }
2820
2821         if (NT_STATUS_IS_ERR(status)) {
2822                 return status;
2823         }
2824
2825         /* Return variables */
2826
2827         /* Return result */
2828         if (werror) {
2829                 *werror = r.out.result;
2830         }
2831
2832         return werror_to_ntstatus(r.out.result);
2833 }
2834
2835 struct rpccli_PNP_GetClassCount_state {
2836         struct PNP_GetClassCount orig;
2837         struct PNP_GetClassCount tmp;
2838         TALLOC_CTX *out_mem_ctx;
2839         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2840 };
2841
2842 static void rpccli_PNP_GetClassCount_done(struct tevent_req *subreq);
2843
2844 struct tevent_req *rpccli_PNP_GetClassCount_send(TALLOC_CTX *mem_ctx,
2845                                                  struct tevent_context *ev,
2846                                                  struct rpc_pipe_client *cli)
2847 {
2848         struct tevent_req *req;
2849         struct rpccli_PNP_GetClassCount_state *state;
2850         struct tevent_req *subreq;
2851
2852         req = tevent_req_create(mem_ctx, &state,
2853                                 struct rpccli_PNP_GetClassCount_state);
2854         if (req == NULL) {
2855                 return NULL;
2856         }
2857         state->out_mem_ctx = NULL;
2858         state->dispatch_recv = cli->dispatch_recv;
2859
2860         /* In parameters */
2861
2862         /* Out parameters */
2863
2864         /* Result */
2865         ZERO_STRUCT(state->orig.out.result);
2866
2867         if (DEBUGLEVEL >= 10) {
2868                 NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &state->orig);
2869         }
2870
2871         /* make a temporary copy, that we pass to the dispatch function */
2872         state->tmp = state->orig;
2873
2874         subreq = cli->dispatch_send(state, ev, cli,
2875                                     &ndr_table_ntsvcs,
2876                                     NDR_PNP_GETCLASSCOUNT,
2877                                     &state->tmp);
2878         if (tevent_req_nomem(subreq, req)) {
2879                 return tevent_req_post(req, ev);
2880         }
2881         tevent_req_set_callback(subreq, rpccli_PNP_GetClassCount_done, req);
2882         return req;
2883 }
2884
2885 static void rpccli_PNP_GetClassCount_done(struct tevent_req *subreq)
2886 {
2887         struct tevent_req *req = tevent_req_callback_data(
2888                 subreq, struct tevent_req);
2889         struct rpccli_PNP_GetClassCount_state *state = tevent_req_data(
2890                 req, struct rpccli_PNP_GetClassCount_state);
2891         NTSTATUS status;
2892         TALLOC_CTX *mem_ctx;
2893
2894         if (state->out_mem_ctx) {
2895                 mem_ctx = state->out_mem_ctx;
2896         } else {
2897                 mem_ctx = state;
2898         }
2899
2900         status = state->dispatch_recv(subreq, mem_ctx);
2901         TALLOC_FREE(subreq);
2902         if (!NT_STATUS_IS_OK(status)) {
2903                 tevent_req_nterror(req, status);
2904                 return;
2905         }
2906
2907         /* Copy out parameters */
2908
2909         /* Copy result */
2910         state->orig.out.result = state->tmp.out.result;
2911
2912         /* Reset temporary structure */
2913         ZERO_STRUCT(state->tmp);
2914
2915         if (DEBUGLEVEL >= 10) {
2916                 NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &state->orig);
2917         }
2918
2919         tevent_req_done(req);
2920 }
2921
2922 NTSTATUS rpccli_PNP_GetClassCount_recv(struct tevent_req *req,
2923                                        TALLOC_CTX *mem_ctx,
2924                                        WERROR *result)
2925 {
2926         struct rpccli_PNP_GetClassCount_state *state = tevent_req_data(
2927                 req, struct rpccli_PNP_GetClassCount_state);
2928         NTSTATUS status;
2929
2930         if (tevent_req_is_nterror(req, &status)) {
2931                 tevent_req_received(req);
2932                 return status;
2933         }
2934
2935         /* Steal possbile out parameters to the callers context */
2936         talloc_steal(mem_ctx, state->out_mem_ctx);
2937
2938         /* Return result */
2939         *result = state->orig.out.result;
2940
2941         tevent_req_received(req);
2942         return NT_STATUS_OK;
2943 }
2944
2945 NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli,
2946                                   TALLOC_CTX *mem_ctx,
2947                                   WERROR *werror)
2948 {
2949         struct PNP_GetClassCount r;
2950         NTSTATUS status;
2951
2952         /* In parameters */
2953
2954         if (DEBUGLEVEL >= 10) {
2955                 NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &r);
2956         }
2957
2958         status = cli->dispatch(cli,
2959                                 mem_ctx,
2960                                 &ndr_table_ntsvcs,
2961                                 NDR_PNP_GETCLASSCOUNT,
2962                                 &r);
2963
2964         if (!NT_STATUS_IS_OK(status)) {
2965                 return status;
2966         }
2967
2968         if (DEBUGLEVEL >= 10) {
2969                 NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &r);
2970         }
2971
2972         if (NT_STATUS_IS_ERR(status)) {
2973                 return status;
2974         }
2975
2976         /* Return variables */
2977
2978         /* Return result */
2979         if (werror) {
2980                 *werror = r.out.result;
2981         }
2982
2983         return werror_to_ntstatus(r.out.result);
2984 }
2985
2986 struct rpccli_PNP_GetClassName_state {
2987         struct PNP_GetClassName orig;
2988         struct PNP_GetClassName tmp;
2989         TALLOC_CTX *out_mem_ctx;
2990         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2991 };
2992
2993 static void rpccli_PNP_GetClassName_done(struct tevent_req *subreq);
2994
2995 struct tevent_req *rpccli_PNP_GetClassName_send(TALLOC_CTX *mem_ctx,
2996                                                 struct tevent_context *ev,
2997                                                 struct rpc_pipe_client *cli)
2998 {
2999         struct tevent_req *req;
3000         struct rpccli_PNP_GetClassName_state *state;
3001         struct tevent_req *subreq;
3002
3003         req = tevent_req_create(mem_ctx, &state,
3004                                 struct rpccli_PNP_GetClassName_state);
3005         if (req == NULL) {
3006                 return NULL;
3007         }
3008         state->out_mem_ctx = NULL;
3009         state->dispatch_recv = cli->dispatch_recv;
3010
3011         /* In parameters */
3012
3013         /* Out parameters */
3014
3015         /* Result */
3016         ZERO_STRUCT(state->orig.out.result);
3017
3018         if (DEBUGLEVEL >= 10) {
3019                 NDR_PRINT_IN_DEBUG(PNP_GetClassName, &state->orig);
3020         }
3021
3022         /* make a temporary copy, that we pass to the dispatch function */
3023         state->tmp = state->orig;
3024
3025         subreq = cli->dispatch_send(state, ev, cli,
3026                                     &ndr_table_ntsvcs,
3027                                     NDR_PNP_GETCLASSNAME,
3028                                     &state->tmp);
3029         if (tevent_req_nomem(subreq, req)) {
3030                 return tevent_req_post(req, ev);
3031         }
3032         tevent_req_set_callback(subreq, rpccli_PNP_GetClassName_done, req);
3033         return req;
3034 }
3035
3036 static void rpccli_PNP_GetClassName_done(struct tevent_req *subreq)
3037 {
3038         struct tevent_req *req = tevent_req_callback_data(
3039                 subreq, struct tevent_req);
3040         struct rpccli_PNP_GetClassName_state *state = tevent_req_data(
3041                 req, struct rpccli_PNP_GetClassName_state);
3042         NTSTATUS status;
3043         TALLOC_CTX *mem_ctx;
3044
3045         if (state->out_mem_ctx) {
3046                 mem_ctx = state->out_mem_ctx;
3047         } else {
3048                 mem_ctx = state;
3049         }
3050
3051         status = state->dispatch_recv(subreq, mem_ctx);
3052         TALLOC_FREE(subreq);
3053         if (!NT_STATUS_IS_OK(status)) {
3054                 tevent_req_nterror(req, status);
3055                 return;
3056         }
3057
3058         /* Copy out parameters */
3059
3060         /* Copy result */
3061         state->orig.out.result = state->tmp.out.result;
3062
3063         /* Reset temporary structure */
3064         ZERO_STRUCT(state->tmp);
3065
3066         if (DEBUGLEVEL >= 10) {
3067                 NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &state->orig);
3068         }
3069
3070         tevent_req_done(req);
3071 }
3072
3073 NTSTATUS rpccli_PNP_GetClassName_recv(struct tevent_req *req,
3074                                       TALLOC_CTX *mem_ctx,
3075                                       WERROR *result)
3076 {
3077         struct rpccli_PNP_GetClassName_state *state = tevent_req_data(
3078                 req, struct rpccli_PNP_GetClassName_state);
3079         NTSTATUS status;
3080
3081         if (tevent_req_is_nterror(req, &status)) {
3082                 tevent_req_received(req);
3083                 return status;
3084         }
3085
3086         /* Steal possbile out parameters to the callers context */
3087         talloc_steal(mem_ctx, state->out_mem_ctx);
3088
3089         /* Return result */
3090         *result = state->orig.out.result;
3091
3092         tevent_req_received(req);
3093         return NT_STATUS_OK;
3094 }
3095
3096 NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli,
3097                                  TALLOC_CTX *mem_ctx,
3098                                  WERROR *werror)
3099 {
3100         struct PNP_GetClassName r;
3101         NTSTATUS status;
3102
3103         /* In parameters */
3104
3105         if (DEBUGLEVEL >= 10) {
3106                 NDR_PRINT_IN_DEBUG(PNP_GetClassName, &r);
3107         }
3108
3109         status = cli->dispatch(cli,
3110                                 mem_ctx,
3111                                 &ndr_table_ntsvcs,
3112                                 NDR_PNP_GETCLASSNAME,
3113                                 &r);
3114
3115         if (!NT_STATUS_IS_OK(status)) {
3116                 return status;
3117         }
3118
3119         if (DEBUGLEVEL >= 10) {
3120                 NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &r);
3121         }
3122
3123         if (NT_STATUS_IS_ERR(status)) {
3124                 return status;
3125         }
3126
3127         /* Return variables */
3128
3129         /* Return result */
3130         if (werror) {
3131                 *werror = r.out.result;
3132         }
3133
3134         return werror_to_ntstatus(r.out.result);
3135 }
3136
3137 struct rpccli_PNP_DeleteClassKey_state {
3138         struct PNP_DeleteClassKey orig;
3139         struct PNP_DeleteClassKey tmp;
3140         TALLOC_CTX *out_mem_ctx;
3141         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3142 };
3143
3144 static void rpccli_PNP_DeleteClassKey_done(struct tevent_req *subreq);
3145
3146 struct tevent_req *rpccli_PNP_DeleteClassKey_send(TALLOC_CTX *mem_ctx,
3147                                                   struct tevent_context *ev,
3148                                                   struct rpc_pipe_client *cli)
3149 {
3150         struct tevent_req *req;
3151         struct rpccli_PNP_DeleteClassKey_state *state;
3152         struct tevent_req *subreq;
3153
3154         req = tevent_req_create(mem_ctx, &state,
3155                                 struct rpccli_PNP_DeleteClassKey_state);
3156         if (req == NULL) {
3157                 return NULL;
3158         }
3159         state->out_mem_ctx = NULL;
3160         state->dispatch_recv = cli->dispatch_recv;
3161
3162         /* In parameters */
3163
3164         /* Out parameters */
3165
3166         /* Result */
3167         ZERO_STRUCT(state->orig.out.result);
3168
3169         if (DEBUGLEVEL >= 10) {
3170                 NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &state->orig);
3171         }
3172
3173         /* make a temporary copy, that we pass to the dispatch function */
3174         state->tmp = state->orig;
3175
3176         subreq = cli->dispatch_send(state, ev, cli,
3177                                     &ndr_table_ntsvcs,
3178                                     NDR_PNP_DELETECLASSKEY,
3179                                     &state->tmp);
3180         if (tevent_req_nomem(subreq, req)) {
3181                 return tevent_req_post(req, ev);
3182         }
3183         tevent_req_set_callback(subreq, rpccli_PNP_DeleteClassKey_done, req);
3184         return req;
3185 }
3186
3187 static void rpccli_PNP_DeleteClassKey_done(struct tevent_req *subreq)
3188 {
3189         struct tevent_req *req = tevent_req_callback_data(
3190                 subreq, struct tevent_req);
3191         struct rpccli_PNP_DeleteClassKey_state *state = tevent_req_data(
3192                 req, struct rpccli_PNP_DeleteClassKey_state);
3193         NTSTATUS status;
3194         TALLOC_CTX *mem_ctx;
3195
3196         if (state->out_mem_ctx) {
3197                 mem_ctx = state->out_mem_ctx;
3198         } else {
3199                 mem_ctx = state;
3200         }
3201
3202         status = state->dispatch_recv(subreq, mem_ctx);
3203         TALLOC_FREE(subreq);
3204         if (!NT_STATUS_IS_OK(status)) {
3205                 tevent_req_nterror(req, status);
3206                 return;
3207         }
3208
3209         /* Copy out parameters */
3210
3211         /* Copy result */
3212         state->orig.out.result = state->tmp.out.result;
3213
3214         /* Reset temporary structure */
3215         ZERO_STRUCT(state->tmp);
3216
3217         if (DEBUGLEVEL >= 10) {
3218                 NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &state->orig);
3219         }
3220
3221         tevent_req_done(req);
3222 }
3223
3224 NTSTATUS rpccli_PNP_DeleteClassKey_recv(struct tevent_req *req,
3225                                         TALLOC_CTX *mem_ctx,
3226                                         WERROR *result)
3227 {
3228         struct rpccli_PNP_DeleteClassKey_state *state = tevent_req_data(
3229                 req, struct rpccli_PNP_DeleteClassKey_state);
3230         NTSTATUS status;
3231
3232         if (tevent_req_is_nterror(req, &status)) {
3233                 tevent_req_received(req);
3234                 return status;
3235         }
3236
3237         /* Steal possbile out parameters to the callers context */
3238         talloc_steal(mem_ctx, state->out_mem_ctx);
3239
3240         /* Return result */
3241         *result = state->orig.out.result;
3242
3243         tevent_req_received(req);
3244         return NT_STATUS_OK;
3245 }
3246
3247 NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli,
3248                                    TALLOC_CTX *mem_ctx,
3249                                    WERROR *werror)
3250 {
3251         struct PNP_DeleteClassKey r;
3252         NTSTATUS status;
3253
3254         /* In parameters */
3255
3256         if (DEBUGLEVEL >= 10) {
3257                 NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &r);
3258         }
3259
3260         status = cli->dispatch(cli,
3261                                 mem_ctx,
3262                                 &ndr_table_ntsvcs,
3263                                 NDR_PNP_DELETECLASSKEY,
3264                                 &r);
3265
3266         if (!NT_STATUS_IS_OK(status)) {
3267                 return status;
3268         }
3269
3270         if (DEBUGLEVEL >= 10) {
3271                 NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &r);
3272         }
3273
3274         if (NT_STATUS_IS_ERR(status)) {
3275                 return status;
3276         }
3277
3278         /* Return variables */
3279
3280         /* Return result */
3281         if (werror) {
3282                 *werror = r.out.result;
3283         }
3284
3285         return werror_to_ntstatus(r.out.result);
3286 }
3287
3288 struct rpccli_PNP_GetInterfaceDeviceAlias_state {
3289         struct PNP_GetInterfaceDeviceAlias orig;
3290         struct PNP_GetInterfaceDeviceAlias tmp;
3291         TALLOC_CTX *out_mem_ctx;
3292         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3293 };
3294
3295 static void rpccli_PNP_GetInterfaceDeviceAlias_done(struct tevent_req *subreq);
3296
3297 struct tevent_req *rpccli_PNP_GetInterfaceDeviceAlias_send(TALLOC_CTX *mem_ctx,
3298                                                            struct tevent_context *ev,
3299                                                            struct rpc_pipe_client *cli)
3300 {
3301         struct tevent_req *req;
3302         struct rpccli_PNP_GetInterfaceDeviceAlias_state *state;
3303         struct tevent_req *subreq;
3304
3305         req = tevent_req_create(mem_ctx, &state,
3306                                 struct rpccli_PNP_GetInterfaceDeviceAlias_state);
3307         if (req == NULL) {
3308                 return NULL;
3309         }
3310         state->out_mem_ctx = NULL;
3311         state->dispatch_recv = cli->dispatch_recv;
3312
3313         /* In parameters */
3314
3315         /* Out parameters */
3316
3317         /* Result */
3318         ZERO_STRUCT(state->orig.out.result);
3319
3320         if (DEBUGLEVEL >= 10) {
3321                 NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &state->orig);
3322         }
3323
3324         /* make a temporary copy, that we pass to the dispatch function */
3325         state->tmp = state->orig;
3326
3327         subreq = cli->dispatch_send(state, ev, cli,
3328                                     &ndr_table_ntsvcs,
3329                                     NDR_PNP_GETINTERFACEDEVICEALIAS,
3330                                     &state->tmp);
3331         if (tevent_req_nomem(subreq, req)) {
3332                 return tevent_req_post(req, ev);
3333         }
3334         tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceAlias_done, req);
3335         return req;
3336 }
3337
3338 static void rpccli_PNP_GetInterfaceDeviceAlias_done(struct tevent_req *subreq)
3339 {
3340         struct tevent_req *req = tevent_req_callback_data(
3341                 subreq, struct tevent_req);
3342         struct rpccli_PNP_GetInterfaceDeviceAlias_state *state = tevent_req_data(
3343                 req, struct rpccli_PNP_GetInterfaceDeviceAlias_state);
3344         NTSTATUS status;
3345         TALLOC_CTX *mem_ctx;
3346
3347         if (state->out_mem_ctx) {
3348                 mem_ctx = state->out_mem_ctx;
3349         } else {
3350                 mem_ctx = state;
3351         }
3352
3353         status = state->dispatch_recv(subreq, mem_ctx);
3354         TALLOC_FREE(subreq);
3355         if (!NT_STATUS_IS_OK(status)) {
3356                 tevent_req_nterror(req, status);
3357                 return;
3358         }
3359
3360         /* Copy out parameters */
3361
3362         /* Copy result */
3363         state->orig.out.result = state->tmp.out.result;
3364
3365         /* Reset temporary structure */
3366         ZERO_STRUCT(state->tmp);
3367
3368         if (DEBUGLEVEL >= 10) {
3369                 NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &state->orig);
3370         }
3371
3372         tevent_req_done(req);
3373 }
3374
3375 NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias_recv(struct tevent_req *req,
3376                                                  TALLOC_CTX *mem_ctx,
3377                                                  WERROR *result)
3378 {
3379         struct rpccli_PNP_GetInterfaceDeviceAlias_state *state = tevent_req_data(
3380                 req, struct rpccli_PNP_GetInterfaceDeviceAlias_state);
3381         NTSTATUS status;
3382
3383         if (tevent_req_is_nterror(req, &status)) {
3384                 tevent_req_received(req);
3385                 return status;
3386         }
3387
3388         /* Steal possbile out parameters to the callers context */
3389         talloc_steal(mem_ctx, state->out_mem_ctx);
3390
3391         /* Return result */
3392         *result = state->orig.out.result;
3393
3394         tevent_req_received(req);
3395         return NT_STATUS_OK;
3396 }
3397
3398 NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli,
3399                                             TALLOC_CTX *mem_ctx,
3400                                             WERROR *werror)
3401 {
3402         struct PNP_GetInterfaceDeviceAlias r;
3403         NTSTATUS status;
3404
3405         /* In parameters */
3406
3407         if (DEBUGLEVEL >= 10) {
3408                 NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &r);
3409         }
3410
3411         status = cli->dispatch(cli,
3412                                 mem_ctx,
3413                                 &ndr_table_ntsvcs,
3414                                 NDR_PNP_GETINTERFACEDEVICEALIAS,
3415                                 &r);
3416
3417         if (!NT_STATUS_IS_OK(status)) {
3418                 return status;
3419         }
3420
3421         if (DEBUGLEVEL >= 10) {
3422                 NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &r);
3423         }
3424
3425         if (NT_STATUS_IS_ERR(status)) {
3426                 return status;
3427         }
3428
3429         /* Return variables */
3430
3431         /* Return result */
3432         if (werror) {
3433                 *werror = r.out.result;
3434         }
3435
3436         return werror_to_ntstatus(r.out.result);
3437 }
3438
3439 struct rpccli_PNP_GetInterfaceDeviceList_state {
3440         struct PNP_GetInterfaceDeviceList orig;
3441         struct PNP_GetInterfaceDeviceList tmp;
3442         TALLOC_CTX *out_mem_ctx;
3443         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3444 };
3445
3446 static void rpccli_PNP_GetInterfaceDeviceList_done(struct tevent_req *subreq);
3447
3448 struct tevent_req *rpccli_PNP_GetInterfaceDeviceList_send(TALLOC_CTX *mem_ctx,
3449                                                           struct tevent_context *ev,
3450                                                           struct rpc_pipe_client *cli)
3451 {
3452         struct tevent_req *req;
3453         struct rpccli_PNP_GetInterfaceDeviceList_state *state;
3454         struct tevent_req *subreq;
3455
3456         req = tevent_req_create(mem_ctx, &state,
3457                                 struct rpccli_PNP_GetInterfaceDeviceList_state);
3458         if (req == NULL) {
3459                 return NULL;
3460         }
3461         state->out_mem_ctx = NULL;
3462         state->dispatch_recv = cli->dispatch_recv;
3463
3464         /* In parameters */
3465
3466         /* Out parameters */
3467
3468         /* Result */
3469         ZERO_STRUCT(state->orig.out.result);
3470
3471         if (DEBUGLEVEL >= 10) {
3472                 NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &state->orig);
3473         }
3474
3475         /* make a temporary copy, that we pass to the dispatch function */
3476         state->tmp = state->orig;
3477
3478         subreq = cli->dispatch_send(state, ev, cli,
3479                                     &ndr_table_ntsvcs,
3480                                     NDR_PNP_GETINTERFACEDEVICELIST,
3481                                     &state->tmp);
3482         if (tevent_req_nomem(subreq, req)) {
3483                 return tevent_req_post(req, ev);
3484         }
3485         tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceList_done, req);
3486         return req;
3487 }
3488
3489 static void rpccli_PNP_GetInterfaceDeviceList_done(struct tevent_req *subreq)
3490 {
3491         struct tevent_req *req = tevent_req_callback_data(
3492                 subreq, struct tevent_req);
3493         struct rpccli_PNP_GetInterfaceDeviceList_state *state = tevent_req_data(
3494                 req, struct rpccli_PNP_GetInterfaceDeviceList_state);
3495         NTSTATUS status;
3496         TALLOC_CTX *mem_ctx;
3497
3498         if (state->out_mem_ctx) {
3499                 mem_ctx = state->out_mem_ctx;
3500         } else {
3501                 mem_ctx = state;
3502         }
3503
3504         status = state->dispatch_recv(subreq, mem_ctx);
3505         TALLOC_FREE(subreq);
3506         if (!NT_STATUS_IS_OK(status)) {
3507                 tevent_req_nterror(req, status);
3508                 return;
3509         }
3510
3511         /* Copy out parameters */
3512
3513         /* Copy result */
3514         state->orig.out.result = state->tmp.out.result;
3515
3516         /* Reset temporary structure */
3517         ZERO_STRUCT(state->tmp);
3518
3519         if (DEBUGLEVEL >= 10) {
3520                 NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &state->orig);
3521         }
3522
3523         tevent_req_done(req);
3524 }
3525
3526 NTSTATUS rpccli_PNP_GetInterfaceDeviceList_recv(struct tevent_req *req,
3527                                                 TALLOC_CTX *mem_ctx,
3528                                                 WERROR *result)
3529 {
3530         struct rpccli_PNP_GetInterfaceDeviceList_state *state = tevent_req_data(
3531                 req, struct rpccli_PNP_GetInterfaceDeviceList_state);
3532         NTSTATUS status;
3533
3534         if (tevent_req_is_nterror(req, &status)) {
3535                 tevent_req_received(req);
3536                 return status;
3537         }
3538
3539         /* Steal possbile out parameters to the callers context */
3540         talloc_steal(mem_ctx, state->out_mem_ctx);
3541
3542         /* Return result */
3543         *result = state->orig.out.result;
3544
3545         tevent_req_received(req);
3546         return NT_STATUS_OK;
3547 }
3548
3549 NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli,
3550                                            TALLOC_CTX *mem_ctx,
3551                                            WERROR *werror)
3552 {
3553         struct PNP_GetInterfaceDeviceList r;
3554         NTSTATUS status;
3555
3556         /* In parameters */
3557
3558         if (DEBUGLEVEL >= 10) {
3559                 NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &r);
3560         }
3561
3562         status = cli->dispatch(cli,
3563                                 mem_ctx,
3564                                 &ndr_table_ntsvcs,
3565                                 NDR_PNP_GETINTERFACEDEVICELIST,
3566                                 &r);
3567
3568         if (!NT_STATUS_IS_OK(status)) {
3569                 return status;
3570         }
3571
3572         if (DEBUGLEVEL >= 10) {
3573                 NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &r);
3574         }
3575
3576         if (NT_STATUS_IS_ERR(status)) {
3577                 return status;
3578         }
3579
3580         /* Return variables */
3581
3582         /* Return result */
3583         if (werror) {
3584                 *werror = r.out.result;
3585         }
3586
3587         return werror_to_ntstatus(r.out.result);
3588 }
3589
3590 struct rpccli_PNP_GetInterfaceDeviceListSize_state {
3591         struct PNP_GetInterfaceDeviceListSize orig;
3592         struct PNP_GetInterfaceDeviceListSize tmp;
3593         TALLOC_CTX *out_mem_ctx;
3594         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3595 };
3596
3597 static void rpccli_PNP_GetInterfaceDeviceListSize_done(struct tevent_req *subreq);
3598
3599 struct tevent_req *rpccli_PNP_GetInterfaceDeviceListSize_send(TALLOC_CTX *mem_ctx,
3600                                                               struct tevent_context *ev,
3601                                                               struct rpc_pipe_client *cli)
3602 {
3603         struct tevent_req *req;
3604         struct rpccli_PNP_GetInterfaceDeviceListSize_state *state;
3605         struct tevent_req *subreq;
3606
3607         req = tevent_req_create(mem_ctx, &state,
3608                                 struct rpccli_PNP_GetInterfaceDeviceListSize_state);
3609         if (req == NULL) {
3610                 return NULL;
3611         }
3612         state->out_mem_ctx = NULL;
3613         state->dispatch_recv = cli->dispatch_recv;
3614
3615         /* In parameters */
3616
3617         /* Out parameters */
3618
3619         /* Result */
3620         ZERO_STRUCT(state->orig.out.result);
3621
3622         if (DEBUGLEVEL >= 10) {
3623                 NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &state->orig);
3624         }
3625
3626         /* make a temporary copy, that we pass to the dispatch function */
3627         state->tmp = state->orig;
3628
3629         subreq = cli->dispatch_send(state, ev, cli,
3630                                     &ndr_table_ntsvcs,
3631                                     NDR_PNP_GETINTERFACEDEVICELISTSIZE,
3632                                     &state->tmp);
3633         if (tevent_req_nomem(subreq, req)) {
3634                 return tevent_req_post(req, ev);
3635         }
3636         tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceListSize_done, req);
3637         return req;
3638 }
3639
3640 static void rpccli_PNP_GetInterfaceDeviceListSize_done(struct tevent_req *subreq)
3641 {
3642         struct tevent_req *req = tevent_req_callback_data(
3643                 subreq, struct tevent_req);
3644         struct rpccli_PNP_GetInterfaceDeviceListSize_state *state = tevent_req_data(
3645                 req, struct rpccli_PNP_GetInterfaceDeviceListSize_state);
3646         NTSTATUS status;
3647         TALLOC_CTX *mem_ctx;
3648
3649         if (state->out_mem_ctx) {
3650                 mem_ctx = state->out_mem_ctx;
3651         } else {
3652                 mem_ctx = state;
3653         }
3654
3655         status = state->dispatch_recv(subreq, mem_ctx);
3656         TALLOC_FREE(subreq);
3657         if (!NT_STATUS_IS_OK(status)) {
3658                 tevent_req_nterror(req, status);
3659                 return;
3660         }
3661
3662         /* Copy out parameters */
3663
3664         /* Copy result */
3665         state->orig.out.result = state->tmp.out.result;
3666
3667         /* Reset temporary structure */
3668         ZERO_STRUCT(state->tmp);
3669
3670         if (DEBUGLEVEL >= 10) {
3671                 NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &state->orig);
3672         }
3673
3674         tevent_req_done(req);
3675 }
3676
3677 NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize_recv(struct tevent_req *req,
3678                                                     TALLOC_CTX *mem_ctx,
3679                                                     WERROR *result)
3680 {
3681         struct rpccli_PNP_GetInterfaceDeviceListSize_state *state = tevent_req_data(
3682                 req, struct rpccli_PNP_GetInterfaceDeviceListSize_state);
3683         NTSTATUS status;
3684
3685         if (tevent_req_is_nterror(req, &status)) {
3686                 tevent_req_received(req);
3687                 return status;
3688         }
3689
3690         /* Steal possbile out parameters to the callers context */
3691         talloc_steal(mem_ctx, state->out_mem_ctx);
3692
3693         /* Return result */
3694         *result = state->orig.out.result;
3695
3696         tevent_req_received(req);
3697         return NT_STATUS_OK;
3698 }
3699
3700 NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli,
3701                                                TALLOC_CTX *mem_ctx,
3702                                                WERROR *werror)
3703 {
3704         struct PNP_GetInterfaceDeviceListSize r;
3705         NTSTATUS status;
3706
3707         /* In parameters */
3708
3709         if (DEBUGLEVEL >= 10) {
3710                 NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &r);
3711         }
3712
3713         status = cli->dispatch(cli,
3714                                 mem_ctx,
3715                                 &ndr_table_ntsvcs,
3716                                 NDR_PNP_GETINTERFACEDEVICELISTSIZE,
3717                                 &r);
3718
3719         if (!NT_STATUS_IS_OK(status)) {
3720                 return status;
3721         }
3722
3723         if (DEBUGLEVEL >= 10) {
3724                 NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &r);
3725         }
3726
3727         if (NT_STATUS_IS_ERR(status)) {
3728                 return status;
3729         }
3730
3731         /* Return variables */
3732
3733         /* Return result */
3734         if (werror) {
3735                 *werror = r.out.result;
3736         }
3737
3738         return werror_to_ntstatus(r.out.result);
3739 }
3740
3741 struct rpccli_PNP_RegisterDeviceClassAssociation_state {
3742         struct PNP_RegisterDeviceClassAssociation orig;
3743         struct PNP_RegisterDeviceClassAssociation tmp;
3744         TALLOC_CTX *out_mem_ctx;
3745         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3746 };
3747
3748 static void rpccli_PNP_RegisterDeviceClassAssociation_done(struct tevent_req *subreq);
3749
3750 struct tevent_req *rpccli_PNP_RegisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
3751                                                                   struct tevent_context *ev,
3752                                                                   struct rpc_pipe_client *cli)
3753 {
3754         struct tevent_req *req;
3755         struct rpccli_PNP_RegisterDeviceClassAssociation_state *state;
3756         struct tevent_req *subreq;
3757
3758         req = tevent_req_create(mem_ctx, &state,
3759                                 struct rpccli_PNP_RegisterDeviceClassAssociation_state);
3760         if (req == NULL) {
3761                 return NULL;
3762         }
3763         state->out_mem_ctx = NULL;
3764         state->dispatch_recv = cli->dispatch_recv;
3765
3766         /* In parameters */
3767
3768         /* Out parameters */
3769
3770         /* Result */
3771         ZERO_STRUCT(state->orig.out.result);
3772
3773         if (DEBUGLEVEL >= 10) {
3774                 NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &state->orig);
3775         }
3776
3777         /* make a temporary copy, that we pass to the dispatch function */
3778         state->tmp = state->orig;
3779
3780         subreq = cli->dispatch_send(state, ev, cli,
3781                                     &ndr_table_ntsvcs,
3782                                     NDR_PNP_REGISTERDEVICECLASSASSOCIATION,
3783                                     &state->tmp);
3784         if (tevent_req_nomem(subreq, req)) {
3785                 return tevent_req_post(req, ev);
3786         }
3787         tevent_req_set_callback(subreq, rpccli_PNP_RegisterDeviceClassAssociation_done, req);
3788         return req;
3789 }
3790
3791 static void rpccli_PNP_RegisterDeviceClassAssociation_done(struct tevent_req *subreq)
3792 {
3793         struct tevent_req *req = tevent_req_callback_data(
3794                 subreq, struct tevent_req);
3795         struct rpccli_PNP_RegisterDeviceClassAssociation_state *state = tevent_req_data(
3796                 req, struct rpccli_PNP_RegisterDeviceClassAssociation_state);
3797         NTSTATUS status;
3798         TALLOC_CTX *mem_ctx;
3799
3800         if (state->out_mem_ctx) {
3801                 mem_ctx = state->out_mem_ctx;
3802         } else {
3803                 mem_ctx = state;
3804         }
3805
3806         status = state->dispatch_recv(subreq, mem_ctx);
3807         TALLOC_FREE(subreq);
3808         if (!NT_STATUS_IS_OK(status)) {
3809                 tevent_req_nterror(req, status);
3810                 return;
3811         }
3812
3813         /* Copy out parameters */
3814
3815         /* Copy result */
3816         state->orig.out.result = state->tmp.out.result;
3817
3818         /* Reset temporary structure */
3819         ZERO_STRUCT(state->tmp);
3820
3821         if (DEBUGLEVEL >= 10) {
3822                 NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &state->orig);
3823         }
3824
3825         tevent_req_done(req);
3826 }
3827
3828 NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation_recv(struct tevent_req *req,
3829                                                         TALLOC_CTX *mem_ctx,
3830                                                         WERROR *result)
3831 {
3832         struct rpccli_PNP_RegisterDeviceClassAssociation_state *state = tevent_req_data(
3833                 req, struct rpccli_PNP_RegisterDeviceClassAssociation_state);
3834         NTSTATUS status;
3835
3836         if (tevent_req_is_nterror(req, &status)) {
3837                 tevent_req_received(req);
3838                 return status;
3839         }
3840
3841         /* Steal possbile out parameters to the callers context */
3842         talloc_steal(mem_ctx, state->out_mem_ctx);
3843
3844         /* Return result */
3845         *result = state->orig.out.result;
3846
3847         tevent_req_received(req);
3848         return NT_STATUS_OK;
3849 }
3850
3851 NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli,
3852                                                    TALLOC_CTX *mem_ctx,
3853                                                    WERROR *werror)
3854 {
3855         struct PNP_RegisterDeviceClassAssociation r;
3856         NTSTATUS status;
3857
3858         /* In parameters */
3859
3860         if (DEBUGLEVEL >= 10) {
3861                 NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &r);
3862         }
3863
3864         status = cli->dispatch(cli,
3865                                 mem_ctx,
3866                                 &ndr_table_ntsvcs,
3867                                 NDR_PNP_REGISTERDEVICECLASSASSOCIATION,
3868                                 &r);
3869
3870         if (!NT_STATUS_IS_OK(status)) {
3871                 return status;
3872         }
3873
3874         if (DEBUGLEVEL >= 10) {
3875                 NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &r);
3876         }
3877
3878         if (NT_STATUS_IS_ERR(status)) {
3879                 return status;
3880         }
3881
3882         /* Return variables */
3883
3884         /* Return result */
3885         if (werror) {
3886                 *werror = r.out.result;
3887         }
3888
3889         return werror_to_ntstatus(r.out.result);
3890 }
3891
3892 struct rpccli_PNP_UnregisterDeviceClassAssociation_state {
3893         struct PNP_UnregisterDeviceClassAssociation orig;
3894         struct PNP_UnregisterDeviceClassAssociation tmp;
3895         TALLOC_CTX *out_mem_ctx;
3896         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3897 };
3898
3899 static void rpccli_PNP_UnregisterDeviceClassAssociation_done(struct tevent_req *subreq);
3900
3901 struct tevent_req *rpccli_PNP_UnregisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
3902                                                                     struct tevent_context *ev,
3903                                                                     struct rpc_pipe_client *cli)
3904 {
3905         struct tevent_req *req;
3906         struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state;
3907         struct tevent_req *subreq;
3908
3909         req = tevent_req_create(mem_ctx, &state,
3910                                 struct rpccli_PNP_UnregisterDeviceClassAssociation_state);
3911         if (req == NULL) {
3912                 return NULL;
3913         }
3914         state->out_mem_ctx = NULL;
3915         state->dispatch_recv = cli->dispatch_recv;
3916
3917         /* In parameters */
3918
3919         /* Out parameters */
3920
3921         /* Result */
3922         ZERO_STRUCT(state->orig.out.result);
3923
3924         if (DEBUGLEVEL >= 10) {
3925                 NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &state->orig);
3926         }
3927
3928         /* make a temporary copy, that we pass to the dispatch function */
3929         state->tmp = state->orig;
3930
3931         subreq = cli->dispatch_send(state, ev, cli,
3932                                     &ndr_table_ntsvcs,
3933                                     NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION,
3934                                     &state->tmp);
3935         if (tevent_req_nomem(subreq, req)) {
3936                 return tevent_req_post(req, ev);
3937         }
3938         tevent_req_set_callback(subreq, rpccli_PNP_UnregisterDeviceClassAssociation_done, req);
3939         return req;
3940 }
3941
3942 static void rpccli_PNP_UnregisterDeviceClassAssociation_done(struct tevent_req *subreq)
3943 {
3944         struct tevent_req *req = tevent_req_callback_data(
3945                 subreq, struct tevent_req);
3946         struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state = tevent_req_data(
3947                 req, struct rpccli_PNP_UnregisterDeviceClassAssociation_state);
3948         NTSTATUS status;
3949         TALLOC_CTX *mem_ctx;
3950
3951         if (state->out_mem_ctx) {
3952                 mem_ctx = state->out_mem_ctx;
3953         } else {
3954                 mem_ctx = state;
3955         }
3956
3957         status = state->dispatch_recv(subreq, mem_ctx);
3958         TALLOC_FREE(subreq);
3959         if (!NT_STATUS_IS_OK(status)) {
3960                 tevent_req_nterror(req, status);
3961                 return;
3962         }
3963
3964         /* Copy out parameters */
3965
3966         /* Copy result */
3967         state->orig.out.result = state->tmp.out.result;
3968
3969         /* Reset temporary structure */
3970         ZERO_STRUCT(state->tmp);
3971
3972         if (DEBUGLEVEL >= 10) {
3973                 NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &state->orig);
3974         }
3975
3976         tevent_req_done(req);
3977 }
3978
3979 NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation_recv(struct tevent_req *req,
3980                                                           TALLOC_CTX *mem_ctx,
3981                                                           WERROR *result)
3982 {
3983         struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state = tevent_req_data(
3984                 req, struct rpccli_PNP_UnregisterDeviceClassAssociation_state);
3985         NTSTATUS status;
3986
3987         if (tevent_req_is_nterror(req, &status)) {
3988                 tevent_req_received(req);
3989                 return status;
3990         }
3991
3992         /* Steal possbile out parameters to the callers context */
3993         talloc_steal(mem_ctx, state->out_mem_ctx);
3994
3995         /* Return result */
3996         *result = state->orig.out.result;
3997
3998         tevent_req_received(req);
3999         return NT_STATUS_OK;
4000 }
4001
4002 NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli,
4003                                                      TALLOC_CTX *mem_ctx,
4004                                                      WERROR *werror)
4005 {
4006         struct PNP_UnregisterDeviceClassAssociation r;
4007         NTSTATUS status;
4008
4009         /* In parameters */
4010
4011         if (DEBUGLEVEL >= 10) {
4012                 NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &r);
4013         }
4014
4015         status = cli->dispatch(cli,
4016                                 mem_ctx,
4017                                 &ndr_table_ntsvcs,
4018                                 NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION,
4019                                 &r);
4020
4021         if (!NT_STATUS_IS_OK(status)) {
4022                 return status;
4023         }
4024
4025         if (DEBUGLEVEL >= 10) {
4026                 NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &r);
4027         }
4028
4029         if (NT_STATUS_IS_ERR(status)) {
4030                 return status;
4031         }
4032
4033         /* Return variables */
4034
4035         /* Return result */
4036         if (werror) {
4037                 *werror = r.out.result;
4038         }
4039
4040         return werror_to_ntstatus(r.out.result);
4041 }
4042
4043 struct rpccli_PNP_GetClassRegProp_state {
4044         struct PNP_GetClassRegProp orig;
4045         struct PNP_GetClassRegProp tmp;
4046         TALLOC_CTX *out_mem_ctx;
4047         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4048 };
4049
4050 static void rpccli_PNP_GetClassRegProp_done(struct tevent_req *subreq);
4051
4052 struct tevent_req *rpccli_PNP_GetClassRegProp_send(TALLOC_CTX *mem_ctx,
4053                                                    struct tevent_context *ev,
4054                                                    struct rpc_pipe_client *cli)
4055 {
4056         struct tevent_req *req;
4057         struct rpccli_PNP_GetClassRegProp_state *state;
4058         struct tevent_req *subreq;
4059
4060         req = tevent_req_create(mem_ctx, &state,
4061                                 struct rpccli_PNP_GetClassRegProp_state);
4062         if (req == NULL) {
4063                 return NULL;
4064         }
4065         state->out_mem_ctx = NULL;
4066         state->dispatch_recv = cli->dispatch_recv;
4067
4068         /* In parameters */
4069
4070         /* Out parameters */
4071
4072         /* Result */
4073         ZERO_STRUCT(state->orig.out.result);
4074
4075         if (DEBUGLEVEL >= 10) {
4076                 NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &state->orig);
4077         }
4078
4079         /* make a temporary copy, that we pass to the dispatch function */
4080         state->tmp = state->orig;
4081
4082         subreq = cli->dispatch_send(state, ev, cli,
4083                                     &ndr_table_ntsvcs,
4084                                     NDR_PNP_GETCLASSREGPROP,
4085                                     &state->tmp);
4086         if (tevent_req_nomem(subreq, req)) {
4087                 return tevent_req_post(req, ev);
4088         }
4089         tevent_req_set_callback(subreq, rpccli_PNP_GetClassRegProp_done, req);
4090         return req;
4091 }
4092
4093 static void rpccli_PNP_GetClassRegProp_done(struct tevent_req *subreq)
4094 {
4095         struct tevent_req *req = tevent_req_callback_data(
4096                 subreq, struct tevent_req);
4097         struct rpccli_PNP_GetClassRegProp_state *state = tevent_req_data(
4098                 req, struct rpccli_PNP_GetClassRegProp_state);
4099         NTSTATUS status;
4100         TALLOC_CTX *mem_ctx;
4101
4102         if (state->out_mem_ctx) {
4103                 mem_ctx = state->out_mem_ctx;
4104         } else {
4105                 mem_ctx = state;
4106         }
4107
4108         status = state->dispatch_recv(subreq, mem_ctx);
4109         TALLOC_FREE(subreq);
4110         if (!NT_STATUS_IS_OK(status)) {
4111                 tevent_req_nterror(req, status);
4112                 return;
4113         }
4114
4115         /* Copy out parameters */
4116
4117         /* Copy result */
4118         state->orig.out.result = state->tmp.out.result;
4119
4120         /* Reset temporary structure */
4121         ZERO_STRUCT(state->tmp);
4122
4123         if (DEBUGLEVEL >= 10) {
4124                 NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &state->orig);
4125         }
4126
4127         tevent_req_done(req);
4128 }
4129
4130 NTSTATUS rpccli_PNP_GetClassRegProp_recv(struct tevent_req *req,
4131                                          TALLOC_CTX *mem_ctx,
4132                                          WERROR *result)
4133 {
4134         struct rpccli_PNP_GetClassRegProp_state *state = tevent_req_data(
4135                 req, struct rpccli_PNP_GetClassRegProp_state);
4136         NTSTATUS status;
4137
4138         if (tevent_req_is_nterror(req, &status)) {
4139                 tevent_req_received(req);
4140                 return status;
4141         }
4142
4143         /* Steal possbile out parameters to the callers context */
4144         talloc_steal(mem_ctx, state->out_mem_ctx);
4145
4146         /* Return result */
4147         *result = state->orig.out.result;
4148
4149         tevent_req_received(req);
4150         return NT_STATUS_OK;
4151 }
4152
4153 NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli,
4154                                     TALLOC_CTX *mem_ctx,
4155                                     WERROR *werror)
4156 {
4157         struct PNP_GetClassRegProp r;
4158         NTSTATUS status;
4159
4160         /* In parameters */
4161
4162         if (DEBUGLEVEL >= 10) {
4163                 NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &r);
4164         }
4165
4166         status = cli->dispatch(cli,
4167                                 mem_ctx,
4168                                 &ndr_table_ntsvcs,
4169                                 NDR_PNP_GETCLASSREGPROP,
4170                                 &r);
4171
4172         if (!NT_STATUS_IS_OK(status)) {
4173                 return status;
4174         }
4175
4176         if (DEBUGLEVEL >= 10) {
4177                 NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &r);
4178         }
4179
4180         if (NT_STATUS_IS_ERR(status)) {
4181                 return status;
4182         }
4183
4184         /* Return variables */
4185
4186         /* Return result */
4187         if (werror) {
4188                 *werror = r.out.result;
4189         }
4190
4191         return werror_to_ntstatus(r.out.result);
4192 }
4193
4194 struct rpccli_PNP_SetClassRegProp_state {
4195         struct PNP_SetClassRegProp orig;
4196         struct PNP_SetClassRegProp tmp;
4197         TALLOC_CTX *out_mem_ctx;
4198         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4199 };
4200
4201 static void rpccli_PNP_SetClassRegProp_done(struct tevent_req *subreq);
4202
4203 struct tevent_req *rpccli_PNP_SetClassRegProp_send(TALLOC_CTX *mem_ctx,
4204                                                    struct tevent_context *ev,
4205                                                    struct rpc_pipe_client *cli)
4206 {
4207         struct tevent_req *req;
4208         struct rpccli_PNP_SetClassRegProp_state *state;
4209         struct tevent_req *subreq;
4210
4211         req = tevent_req_create(mem_ctx, &state,
4212                                 struct rpccli_PNP_SetClassRegProp_state);
4213         if (req == NULL) {
4214                 return NULL;
4215         }
4216         state->out_mem_ctx = NULL;
4217         state->dispatch_recv = cli->dispatch_recv;
4218
4219         /* In parameters */
4220
4221         /* Out parameters */
4222
4223         /* Result */
4224         ZERO_STRUCT(state->orig.out.result);
4225
4226         if (DEBUGLEVEL >= 10) {
4227                 NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &state->orig);
4228         }
4229
4230         /* make a temporary copy, that we pass to the dispatch function */
4231         state->tmp = state->orig;
4232
4233         subreq = cli->dispatch_send(state, ev, cli,
4234                                     &ndr_table_ntsvcs,
4235                                     NDR_PNP_SETCLASSREGPROP,
4236                                     &state->tmp);
4237         if (tevent_req_nomem(subreq, req)) {
4238                 return tevent_req_post(req, ev);
4239         }
4240         tevent_req_set_callback(subreq, rpccli_PNP_SetClassRegProp_done, req);
4241         return req;
4242 }
4243
4244 static void rpccli_PNP_SetClassRegProp_done(struct tevent_req *subreq)
4245 {
4246         struct tevent_req *req = tevent_req_callback_data(
4247                 subreq, struct tevent_req);
4248         struct rpccli_PNP_SetClassRegProp_state *state = tevent_req_data(
4249                 req, struct rpccli_PNP_SetClassRegProp_state);
4250         NTSTATUS status;
4251         TALLOC_CTX *mem_ctx;
4252
4253         if (state->out_mem_ctx) {
4254                 mem_ctx = state->out_mem_ctx;
4255         } else {
4256                 mem_ctx = state;
4257         }
4258
4259         status = state->dispatch_recv(subreq, mem_ctx);
4260         TALLOC_FREE(subreq);
4261         if (!NT_STATUS_IS_OK(status)) {
4262                 tevent_req_nterror(req, status);
4263                 return;
4264         }
4265
4266         /* Copy out parameters */
4267
4268         /* Copy result */
4269         state->orig.out.result = state->tmp.out.result;
4270
4271         /* Reset temporary structure */
4272         ZERO_STRUCT(state->tmp);
4273
4274         if (DEBUGLEVEL >= 10) {
4275                 NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &state->orig);
4276         }
4277
4278         tevent_req_done(req);
4279 }
4280
4281 NTSTATUS rpccli_PNP_SetClassRegProp_recv(struct tevent_req *req,
4282                                          TALLOC_CTX *mem_ctx,
4283                                          WERROR *result)
4284 {
4285         struct rpccli_PNP_SetClassRegProp_state *state = tevent_req_data(
4286                 req, struct rpccli_PNP_SetClassRegProp_state);
4287         NTSTATUS status;
4288
4289         if (tevent_req_is_nterror(req, &status)) {
4290                 tevent_req_received(req);
4291                 return status;
4292         }
4293
4294         /* Steal possbile out parameters to the callers context */
4295         talloc_steal(mem_ctx, state->out_mem_ctx);
4296
4297         /* Return result */
4298         *result = state->orig.out.result;
4299
4300         tevent_req_received(req);
4301         return NT_STATUS_OK;
4302 }
4303
4304 NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli,
4305                                     TALLOC_CTX *mem_ctx,
4306                                     WERROR *werror)
4307 {
4308         struct PNP_SetClassRegProp r;
4309         NTSTATUS status;
4310
4311         /* In parameters */
4312
4313         if (DEBUGLEVEL >= 10) {
4314                 NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &r);
4315         }
4316
4317         status = cli->dispatch(cli,
4318                                 mem_ctx,
4319                                 &ndr_table_ntsvcs,
4320                                 NDR_PNP_SETCLASSREGPROP,
4321                                 &r);
4322
4323         if (!NT_STATUS_IS_OK(status)) {
4324                 return status;
4325         }
4326
4327         if (DEBUGLEVEL >= 10) {
4328                 NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &r);
4329         }
4330
4331         if (NT_STATUS_IS_ERR(status)) {
4332                 return status;
4333         }
4334
4335         /* Return variables */
4336
4337         /* Return result */
4338         if (werror) {
4339                 *werror = r.out.result;
4340         }
4341
4342         return werror_to_ntstatus(r.out.result);
4343 }
4344
4345 struct rpccli_PNP_CreateDevInst_state {
4346         struct PNP_CreateDevInst orig;
4347         struct PNP_CreateDevInst tmp;
4348         TALLOC_CTX *out_mem_ctx;
4349         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4350 };
4351
4352 static void rpccli_PNP_CreateDevInst_done(struct tevent_req *subreq);
4353
4354 struct tevent_req *rpccli_PNP_CreateDevInst_send(TALLOC_CTX *mem_ctx,
4355                                                  struct tevent_context *ev,
4356                                                  struct rpc_pipe_client *cli)
4357 {
4358         struct tevent_req *req;
4359         struct rpccli_PNP_CreateDevInst_state *state;
4360         struct tevent_req *subreq;
4361
4362         req = tevent_req_create(mem_ctx, &state,
4363                                 struct rpccli_PNP_CreateDevInst_state);
4364         if (req == NULL) {
4365                 return NULL;
4366         }
4367         state->out_mem_ctx = NULL;
4368         state->dispatch_recv = cli->dispatch_recv;
4369
4370         /* In parameters */
4371
4372         /* Out parameters */
4373
4374         /* Result */
4375         ZERO_STRUCT(state->orig.out.result);
4376
4377         if (DEBUGLEVEL >= 10) {
4378                 NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &state->orig);
4379         }
4380
4381         /* make a temporary copy, that we pass to the dispatch function */
4382         state->tmp = state->orig;
4383
4384         subreq = cli->dispatch_send(state, ev, cli,
4385                                     &ndr_table_ntsvcs,
4386                                     NDR_PNP_CREATEDEVINST,
4387                                     &state->tmp);
4388         if (tevent_req_nomem(subreq, req)) {
4389                 return tevent_req_post(req, ev);
4390         }
4391         tevent_req_set_callback(subreq, rpccli_PNP_CreateDevInst_done, req);
4392         return req;
4393 }
4394
4395 static void rpccli_PNP_CreateDevInst_done(struct tevent_req *subreq)
4396 {
4397         struct tevent_req *req = tevent_req_callback_data(
4398                 subreq, struct tevent_req);
4399         struct rpccli_PNP_CreateDevInst_state *state = tevent_req_data(
4400                 req, struct rpccli_PNP_CreateDevInst_state);
4401         NTSTATUS status;
4402         TALLOC_CTX *mem_ctx;
4403
4404         if (state->out_mem_ctx) {
4405                 mem_ctx = state->out_mem_ctx;
4406         } else {
4407                 mem_ctx = state;
4408         }
4409
4410         status = state->dispatch_recv(subreq, mem_ctx);
4411         TALLOC_FREE(subreq);
4412         if (!NT_STATUS_IS_OK(status)) {
4413                 tevent_req_nterror(req, status);
4414                 return;
4415         }
4416
4417         /* Copy out parameters */
4418
4419         /* Copy result */
4420         state->orig.out.result = state->tmp.out.result;
4421
4422         /* Reset temporary structure */
4423         ZERO_STRUCT(state->tmp);
4424
4425         if (DEBUGLEVEL >= 10) {
4426                 NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &state->orig);
4427         }
4428
4429         tevent_req_done(req);
4430 }
4431
4432 NTSTATUS rpccli_PNP_CreateDevInst_recv(struct tevent_req *req,
4433                                        TALLOC_CTX *mem_ctx,
4434                                        WERROR *result)
4435 {
4436         struct rpccli_PNP_CreateDevInst_state *state = tevent_req_data(
4437                 req, struct rpccli_PNP_CreateDevInst_state);
4438         NTSTATUS status;
4439
4440         if (tevent_req_is_nterror(req, &status)) {
4441                 tevent_req_received(req);
4442                 return status;
4443         }
4444
4445         /* Steal possbile out parameters to the callers context */
4446         talloc_steal(mem_ctx, state->out_mem_ctx);
4447
4448         /* Return result */
4449         *result = state->orig.out.result;
4450
4451         tevent_req_received(req);
4452         return NT_STATUS_OK;
4453 }
4454
4455 NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli,
4456                                   TALLOC_CTX *mem_ctx,
4457                                   WERROR *werror)
4458 {
4459         struct PNP_CreateDevInst r;
4460         NTSTATUS status;
4461
4462         /* In parameters */
4463
4464         if (DEBUGLEVEL >= 10) {
4465                 NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &r);
4466         }
4467
4468         status = cli->dispatch(cli,
4469                                 mem_ctx,
4470                                 &ndr_table_ntsvcs,
4471                                 NDR_PNP_CREATEDEVINST,
4472                                 &r);
4473
4474         if (!NT_STATUS_IS_OK(status)) {
4475                 return status;
4476         }
4477
4478         if (DEBUGLEVEL >= 10) {
4479                 NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &r);
4480         }
4481
4482         if (NT_STATUS_IS_ERR(status)) {
4483                 return status;
4484         }
4485
4486         /* Return variables */
4487
4488         /* Return result */
4489         if (werror) {
4490                 *werror = r.out.result;
4491         }
4492
4493         return werror_to_ntstatus(r.out.result);
4494 }
4495
4496 struct rpccli_PNP_DeviceInstanceAction_state {
4497         struct PNP_DeviceInstanceAction orig;
4498         struct PNP_DeviceInstanceAction tmp;
4499         TALLOC_CTX *out_mem_ctx;
4500         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4501 };
4502
4503 static void rpccli_PNP_DeviceInstanceAction_done(struct tevent_req *subreq);
4504
4505 struct tevent_req *rpccli_PNP_DeviceInstanceAction_send(TALLOC_CTX *mem_ctx,
4506                                                         struct tevent_context *ev,
4507                                                         struct rpc_pipe_client *cli)
4508 {
4509         struct tevent_req *req;
4510         struct rpccli_PNP_DeviceInstanceAction_state *state;
4511         struct tevent_req *subreq;
4512
4513         req = tevent_req_create(mem_ctx, &state,
4514                                 struct rpccli_PNP_DeviceInstanceAction_state);
4515         if (req == NULL) {
4516                 return NULL;
4517         }
4518         state->out_mem_ctx = NULL;
4519         state->dispatch_recv = cli->dispatch_recv;
4520
4521         /* In parameters */
4522
4523         /* Out parameters */
4524
4525         /* Result */
4526         ZERO_STRUCT(state->orig.out.result);
4527
4528         if (DEBUGLEVEL >= 10) {
4529                 NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &state->orig);
4530         }
4531
4532         /* make a temporary copy, that we pass to the dispatch function */
4533         state->tmp = state->orig;
4534
4535         subreq = cli->dispatch_send(state, ev, cli,
4536                                     &ndr_table_ntsvcs,
4537                                     NDR_PNP_DEVICEINSTANCEACTION,
4538                                     &state->tmp);
4539         if (tevent_req_nomem(subreq, req)) {
4540                 return tevent_req_post(req, ev);
4541         }
4542         tevent_req_set_callback(subreq, rpccli_PNP_DeviceInstanceAction_done, req);
4543         return req;
4544 }
4545
4546 static void rpccli_PNP_DeviceInstanceAction_done(struct tevent_req *subreq)
4547 {
4548         struct tevent_req *req = tevent_req_callback_data(
4549                 subreq, struct tevent_req);
4550         struct rpccli_PNP_DeviceInstanceAction_state *state = tevent_req_data(
4551                 req, struct rpccli_PNP_DeviceInstanceAction_state);
4552         NTSTATUS status;
4553         TALLOC_CTX *mem_ctx;
4554
4555         if (state->out_mem_ctx) {
4556                 mem_ctx = state->out_mem_ctx;
4557         } else {
4558                 mem_ctx = state;
4559         }
4560
4561         status = state->dispatch_recv(subreq, mem_ctx);
4562         TALLOC_FREE(subreq);
4563         if (!NT_STATUS_IS_OK(status)) {
4564                 tevent_req_nterror(req, status);
4565                 return;
4566         }
4567
4568         /* Copy out parameters */
4569
4570         /* Copy result */
4571         state->orig.out.result = state->tmp.out.result;
4572
4573         /* Reset temporary structure */
4574         ZERO_STRUCT(state->tmp);
4575
4576         if (DEBUGLEVEL >= 10) {
4577                 NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &state->orig);
4578         }
4579
4580         tevent_req_done(req);
4581 }
4582
4583 NTSTATUS rpccli_PNP_DeviceInstanceAction_recv(struct tevent_req *req,
4584                                               TALLOC_CTX *mem_ctx,
4585                                               WERROR *result)
4586 {
4587         struct rpccli_PNP_DeviceInstanceAction_state *state = tevent_req_data(
4588                 req, struct rpccli_PNP_DeviceInstanceAction_state);
4589         NTSTATUS status;
4590
4591         if (tevent_req_is_nterror(req, &status)) {
4592                 tevent_req_received(req);
4593                 return status;
4594         }
4595
4596         /* Steal possbile out parameters to the callers context */
4597         talloc_steal(mem_ctx, state->out_mem_ctx);
4598
4599         /* Return result */
4600         *result = state->orig.out.result;
4601
4602         tevent_req_received(req);
4603         return NT_STATUS_OK;
4604 }
4605
4606 NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli,
4607                                          TALLOC_CTX *mem_ctx,
4608                                          WERROR *werror)
4609 {
4610         struct PNP_DeviceInstanceAction r;
4611         NTSTATUS status;
4612
4613         /* In parameters */
4614
4615         if (DEBUGLEVEL >= 10) {
4616                 NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &r);
4617         }
4618
4619         status = cli->dispatch(cli,
4620                                 mem_ctx,
4621                                 &ndr_table_ntsvcs,
4622                                 NDR_PNP_DEVICEINSTANCEACTION,
4623                                 &r);
4624
4625         if (!NT_STATUS_IS_OK(status)) {
4626                 return status;
4627         }
4628
4629         if (DEBUGLEVEL >= 10) {
4630                 NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &r);
4631         }
4632
4633         if (NT_STATUS_IS_ERR(status)) {
4634                 return status;
4635         }
4636
4637         /* Return variables */
4638
4639         /* Return result */
4640         if (werror) {
4641                 *werror = r.out.result;
4642         }
4643
4644         return werror_to_ntstatus(r.out.result);
4645 }
4646
4647 struct rpccli_PNP_GetDeviceStatus_state {
4648         struct PNP_GetDeviceStatus orig;
4649         struct PNP_GetDeviceStatus tmp;
4650         TALLOC_CTX *out_mem_ctx;
4651         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4652 };
4653
4654 static void rpccli_PNP_GetDeviceStatus_done(struct tevent_req *subreq);
4655
4656 struct tevent_req *rpccli_PNP_GetDeviceStatus_send(TALLOC_CTX *mem_ctx,
4657                                                    struct tevent_context *ev,
4658                                                    struct rpc_pipe_client *cli)
4659 {
4660         struct tevent_req *req;
4661         struct rpccli_PNP_GetDeviceStatus_state *state;
4662         struct tevent_req *subreq;
4663
4664         req = tevent_req_create(mem_ctx, &state,
4665                                 struct rpccli_PNP_GetDeviceStatus_state);
4666         if (req == NULL) {
4667                 return NULL;
4668         }
4669         state->out_mem_ctx = NULL;
4670         state->dispatch_recv = cli->dispatch_recv;
4671
4672         /* In parameters */
4673
4674         /* Out parameters */
4675
4676         /* Result */
4677         ZERO_STRUCT(state->orig.out.result);
4678
4679         if (DEBUGLEVEL >= 10) {
4680                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &state->orig);
4681         }
4682
4683         /* make a temporary copy, that we pass to the dispatch function */
4684         state->tmp = state->orig;
4685
4686         subreq = cli->dispatch_send(state, ev, cli,
4687                                     &ndr_table_ntsvcs,
4688                                     NDR_PNP_GETDEVICESTATUS,
4689                                     &state->tmp);
4690         if (tevent_req_nomem(subreq, req)) {
4691                 return tevent_req_post(req, ev);
4692         }
4693         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceStatus_done, req);
4694         return req;
4695 }
4696
4697 static void rpccli_PNP_GetDeviceStatus_done(struct tevent_req *subreq)
4698 {
4699         struct tevent_req *req = tevent_req_callback_data(
4700                 subreq, struct tevent_req);
4701         struct rpccli_PNP_GetDeviceStatus_state *state = tevent_req_data(
4702                 req, struct rpccli_PNP_GetDeviceStatus_state);
4703         NTSTATUS status;
4704         TALLOC_CTX *mem_ctx;
4705
4706         if (state->out_mem_ctx) {
4707                 mem_ctx = state->out_mem_ctx;
4708         } else {
4709                 mem_ctx = state;
4710         }
4711
4712         status = state->dispatch_recv(subreq, mem_ctx);
4713         TALLOC_FREE(subreq);
4714         if (!NT_STATUS_IS_OK(status)) {
4715                 tevent_req_nterror(req, status);
4716                 return;
4717         }
4718
4719         /* Copy out parameters */
4720
4721         /* Copy result */
4722         state->orig.out.result = state->tmp.out.result;
4723
4724         /* Reset temporary structure */
4725         ZERO_STRUCT(state->tmp);
4726
4727         if (DEBUGLEVEL >= 10) {
4728                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &state->orig);
4729         }
4730
4731         tevent_req_done(req);
4732 }
4733
4734 NTSTATUS rpccli_PNP_GetDeviceStatus_recv(struct tevent_req *req,
4735                                          TALLOC_CTX *mem_ctx,
4736                                          WERROR *result)
4737 {
4738         struct rpccli_PNP_GetDeviceStatus_state *state = tevent_req_data(
4739                 req, struct rpccli_PNP_GetDeviceStatus_state);
4740         NTSTATUS status;
4741
4742         if (tevent_req_is_nterror(req, &status)) {
4743                 tevent_req_received(req);
4744                 return status;
4745         }
4746
4747         /* Steal possbile out parameters to the callers context */
4748         talloc_steal(mem_ctx, state->out_mem_ctx);
4749
4750         /* Return result */
4751         *result = state->orig.out.result;
4752
4753         tevent_req_received(req);
4754         return NT_STATUS_OK;
4755 }
4756
4757 NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli,
4758                                     TALLOC_CTX *mem_ctx,
4759                                     WERROR *werror)
4760 {
4761         struct PNP_GetDeviceStatus r;
4762         NTSTATUS status;
4763
4764         /* In parameters */
4765
4766         if (DEBUGLEVEL >= 10) {
4767                 NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &r);
4768         }
4769
4770         status = cli->dispatch(cli,
4771                                 mem_ctx,
4772                                 &ndr_table_ntsvcs,
4773                                 NDR_PNP_GETDEVICESTATUS,
4774                                 &r);
4775
4776         if (!NT_STATUS_IS_OK(status)) {
4777                 return status;
4778         }
4779
4780         if (DEBUGLEVEL >= 10) {
4781                 NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &r);
4782         }
4783
4784         if (NT_STATUS_IS_ERR(status)) {
4785                 return status;
4786         }
4787
4788         /* Return variables */
4789
4790         /* Return result */
4791         if (werror) {
4792                 *werror = r.out.result;
4793         }
4794
4795         return werror_to_ntstatus(r.out.result);
4796 }
4797
4798 struct rpccli_PNP_SetDeviceProblem_state {
4799         struct PNP_SetDeviceProblem orig;
4800         struct PNP_SetDeviceProblem tmp;
4801         TALLOC_CTX *out_mem_ctx;
4802         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4803 };
4804
4805 static void rpccli_PNP_SetDeviceProblem_done(struct tevent_req *subreq);
4806
4807 struct tevent_req *rpccli_PNP_SetDeviceProblem_send(TALLOC_CTX *mem_ctx,
4808                                                     struct tevent_context *ev,
4809                                                     struct rpc_pipe_client *cli)
4810 {
4811         struct tevent_req *req;
4812         struct rpccli_PNP_SetDeviceProblem_state *state;
4813         struct tevent_req *subreq;
4814
4815         req = tevent_req_create(mem_ctx, &state,
4816                                 struct rpccli_PNP_SetDeviceProblem_state);
4817         if (req == NULL) {
4818                 return NULL;
4819         }
4820         state->out_mem_ctx = NULL;
4821         state->dispatch_recv = cli->dispatch_recv;
4822
4823         /* In parameters */
4824
4825         /* Out parameters */
4826
4827         /* Result */
4828         ZERO_STRUCT(state->orig.out.result);
4829
4830         if (DEBUGLEVEL >= 10) {
4831                 NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &state->orig);
4832         }
4833
4834         /* make a temporary copy, that we pass to the dispatch function */
4835         state->tmp = state->orig;
4836
4837         subreq = cli->dispatch_send(state, ev, cli,
4838                                     &ndr_table_ntsvcs,
4839                                     NDR_PNP_SETDEVICEPROBLEM,
4840                                     &state->tmp);
4841         if (tevent_req_nomem(subreq, req)) {
4842                 return tevent_req_post(req, ev);
4843         }
4844         tevent_req_set_callback(subreq, rpccli_PNP_SetDeviceProblem_done, req);
4845         return req;
4846 }
4847
4848 static void rpccli_PNP_SetDeviceProblem_done(struct tevent_req *subreq)
4849 {
4850         struct tevent_req *req = tevent_req_callback_data(
4851                 subreq, struct tevent_req);
4852         struct rpccli_PNP_SetDeviceProblem_state *state = tevent_req_data(
4853                 req, struct rpccli_PNP_SetDeviceProblem_state);
4854         NTSTATUS status;
4855         TALLOC_CTX *mem_ctx;
4856
4857         if (state->out_mem_ctx) {
4858                 mem_ctx = state->out_mem_ctx;
4859         } else {
4860                 mem_ctx = state;
4861         }
4862
4863         status = state->dispatch_recv(subreq, mem_ctx);
4864         TALLOC_FREE(subreq);
4865         if (!NT_STATUS_IS_OK(status)) {
4866                 tevent_req_nterror(req, status);
4867                 return;
4868         }
4869
4870         /* Copy out parameters */
4871
4872         /* Copy result */
4873         state->orig.out.result = state->tmp.out.result;
4874
4875         /* Reset temporary structure */
4876         ZERO_STRUCT(state->tmp);
4877
4878         if (DEBUGLEVEL >= 10) {
4879                 NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &state->orig);
4880         }
4881
4882         tevent_req_done(req);
4883 }
4884
4885 NTSTATUS rpccli_PNP_SetDeviceProblem_recv(struct tevent_req *req,
4886                                           TALLOC_CTX *mem_ctx,
4887                                           WERROR *result)
4888 {
4889         struct rpccli_PNP_SetDeviceProblem_state *state = tevent_req_data(
4890                 req, struct rpccli_PNP_SetDeviceProblem_state);
4891         NTSTATUS status;
4892
4893         if (tevent_req_is_nterror(req, &status)) {
4894                 tevent_req_received(req);
4895                 return status;
4896         }
4897
4898         /* Steal possbile out parameters to the callers context */
4899         talloc_steal(mem_ctx, state->out_mem_ctx);
4900
4901         /* Return result */
4902         *result = state->orig.out.result;
4903
4904         tevent_req_received(req);
4905         return NT_STATUS_OK;
4906 }
4907
4908 NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli,
4909                                      TALLOC_CTX *mem_ctx,
4910                                      WERROR *werror)
4911 {
4912         struct PNP_SetDeviceProblem r;
4913         NTSTATUS status;
4914
4915         /* In parameters */
4916
4917         if (DEBUGLEVEL >= 10) {
4918                 NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &r);
4919         }
4920
4921         status = cli->dispatch(cli,
4922                                 mem_ctx,
4923                                 &ndr_table_ntsvcs,
4924                                 NDR_PNP_SETDEVICEPROBLEM,
4925                                 &r);
4926
4927         if (!NT_STATUS_IS_OK(status)) {
4928                 return status;
4929         }
4930
4931         if (DEBUGLEVEL >= 10) {
4932                 NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &r);
4933         }
4934
4935         if (NT_STATUS_IS_ERR(status)) {
4936                 return status;
4937         }
4938
4939         /* Return variables */
4940
4941         /* Return result */
4942         if (werror) {
4943                 *werror = r.out.result;
4944         }
4945
4946         return werror_to_ntstatus(r.out.result);
4947 }
4948
4949 struct rpccli_PNP_DisableDevInst_state {
4950         struct PNP_DisableDevInst orig;
4951         struct PNP_DisableDevInst tmp;
4952         TALLOC_CTX *out_mem_ctx;
4953         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4954 };
4955
4956 static void rpccli_PNP_DisableDevInst_done(struct tevent_req *subreq);
4957
4958 struct tevent_req *rpccli_PNP_DisableDevInst_send(TALLOC_CTX *mem_ctx,
4959                                                   struct tevent_context *ev,
4960                                                   struct rpc_pipe_client *cli)
4961 {
4962         struct tevent_req *req;
4963         struct rpccli_PNP_DisableDevInst_state *state;
4964         struct tevent_req *subreq;
4965
4966         req = tevent_req_create(mem_ctx, &state,
4967                                 struct rpccli_PNP_DisableDevInst_state);
4968         if (req == NULL) {
4969                 return NULL;
4970         }
4971         state->out_mem_ctx = NULL;
4972         state->dispatch_recv = cli->dispatch_recv;
4973
4974         /* In parameters */
4975
4976         /* Out parameters */
4977
4978         /* Result */
4979         ZERO_STRUCT(state->orig.out.result);
4980
4981         if (DEBUGLEVEL >= 10) {
4982                 NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &state->orig);
4983         }
4984
4985         /* make a temporary copy, that we pass to the dispatch function */
4986         state->tmp = state->orig;
4987
4988         subreq = cli->dispatch_send(state, ev, cli,
4989                                     &ndr_table_ntsvcs,
4990                                     NDR_PNP_DISABLEDEVINST,
4991                                     &state->tmp);
4992         if (tevent_req_nomem(subreq, req)) {
4993                 return tevent_req_post(req, ev);
4994         }
4995         tevent_req_set_callback(subreq, rpccli_PNP_DisableDevInst_done, req);
4996         return req;
4997 }
4998
4999 static void rpccli_PNP_DisableDevInst_done(struct tevent_req *subreq)
5000 {
5001         struct tevent_req *req = tevent_req_callback_data(
5002                 subreq, struct tevent_req);
5003         struct rpccli_PNP_DisableDevInst_state *state = tevent_req_data(
5004                 req, struct rpccli_PNP_DisableDevInst_state);
5005         NTSTATUS status;
5006         TALLOC_CTX *mem_ctx;
5007
5008         if (state->out_mem_ctx) {
5009                 mem_ctx = state->out_mem_ctx;
5010         } else {
5011                 mem_ctx = state;
5012         }
5013
5014         status = state->dispatch_recv(subreq, mem_ctx);
5015         TALLOC_FREE(subreq);
5016         if (!NT_STATUS_IS_OK(status)) {
5017                 tevent_req_nterror(req, status);
5018                 return;
5019         }
5020
5021         /* Copy out parameters */
5022
5023         /* Copy result */
5024         state->orig.out.result = state->tmp.out.result;
5025
5026         /* Reset temporary structure */
5027         ZERO_STRUCT(state->tmp);
5028
5029         if (DEBUGLEVEL >= 10) {
5030                 NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &state->orig);
5031         }
5032
5033         tevent_req_done(req);
5034 }
5035
5036 NTSTATUS rpccli_PNP_DisableDevInst_recv(struct tevent_req *req,
5037                                         TALLOC_CTX *mem_ctx,
5038                                         WERROR *result)
5039 {
5040         struct rpccli_PNP_DisableDevInst_state *state = tevent_req_data(
5041                 req, struct rpccli_PNP_DisableDevInst_state);
5042         NTSTATUS status;
5043
5044         if (tevent_req_is_nterror(req, &status)) {
5045                 tevent_req_received(req);
5046                 return status;
5047         }
5048
5049         /* Steal possbile out parameters to the callers context */
5050         talloc_steal(mem_ctx, state->out_mem_ctx);
5051
5052         /* Return result */
5053         *result = state->orig.out.result;
5054
5055         tevent_req_received(req);
5056         return NT_STATUS_OK;
5057 }
5058
5059 NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli,
5060                                    TALLOC_CTX *mem_ctx,
5061                                    WERROR *werror)
5062 {
5063         struct PNP_DisableDevInst r;
5064         NTSTATUS status;
5065
5066         /* In parameters */
5067
5068         if (DEBUGLEVEL >= 10) {
5069                 NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &r);
5070         }
5071
5072         status = cli->dispatch(cli,
5073                                 mem_ctx,
5074                                 &ndr_table_ntsvcs,
5075                                 NDR_PNP_DISABLEDEVINST,
5076                                 &r);
5077
5078         if (!NT_STATUS_IS_OK(status)) {
5079                 return status;
5080         }
5081
5082         if (DEBUGLEVEL >= 10) {
5083                 NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &r);
5084         }
5085
5086         if (NT_STATUS_IS_ERR(status)) {
5087                 return status;
5088         }
5089
5090         /* Return variables */
5091
5092         /* Return result */
5093         if (werror) {
5094                 *werror = r.out.result;
5095         }
5096
5097         return werror_to_ntstatus(r.out.result);
5098 }
5099
5100 struct rpccli_PNP_UninstallDevInst_state {
5101         struct PNP_UninstallDevInst orig;
5102         struct PNP_UninstallDevInst tmp;
5103         TALLOC_CTX *out_mem_ctx;
5104         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5105 };
5106
5107 static void rpccli_PNP_UninstallDevInst_done(struct tevent_req *subreq);
5108
5109 struct tevent_req *rpccli_PNP_UninstallDevInst_send(TALLOC_CTX *mem_ctx,
5110                                                     struct tevent_context *ev,
5111                                                     struct rpc_pipe_client *cli)
5112 {
5113         struct tevent_req *req;
5114         struct rpccli_PNP_UninstallDevInst_state *state;
5115         struct tevent_req *subreq;
5116
5117         req = tevent_req_create(mem_ctx, &state,
5118                                 struct rpccli_PNP_UninstallDevInst_state);
5119         if (req == NULL) {
5120                 return NULL;
5121         }
5122         state->out_mem_ctx = NULL;
5123         state->dispatch_recv = cli->dispatch_recv;
5124
5125         /* In parameters */
5126
5127         /* Out parameters */
5128
5129         /* Result */
5130         ZERO_STRUCT(state->orig.out.result);
5131
5132         if (DEBUGLEVEL >= 10) {
5133                 NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &state->orig);
5134         }
5135
5136         /* make a temporary copy, that we pass to the dispatch function */
5137         state->tmp = state->orig;
5138
5139         subreq = cli->dispatch_send(state, ev, cli,
5140                                     &ndr_table_ntsvcs,
5141                                     NDR_PNP_UNINSTALLDEVINST,
5142                                     &state->tmp);
5143         if (tevent_req_nomem(subreq, req)) {
5144                 return tevent_req_post(req, ev);
5145         }
5146         tevent_req_set_callback(subreq, rpccli_PNP_UninstallDevInst_done, req);
5147         return req;
5148 }
5149
5150 static void rpccli_PNP_UninstallDevInst_done(struct tevent_req *subreq)
5151 {
5152         struct tevent_req *req = tevent_req_callback_data(
5153                 subreq, struct tevent_req);
5154         struct rpccli_PNP_UninstallDevInst_state *state = tevent_req_data(
5155                 req, struct rpccli_PNP_UninstallDevInst_state);
5156         NTSTATUS status;
5157         TALLOC_CTX *mem_ctx;
5158
5159         if (state->out_mem_ctx) {
5160                 mem_ctx = state->out_mem_ctx;
5161         } else {
5162                 mem_ctx = state;
5163         }
5164
5165         status = state->dispatch_recv(subreq, mem_ctx);
5166         TALLOC_FREE(subreq);
5167         if (!NT_STATUS_IS_OK(status)) {
5168                 tevent_req_nterror(req, status);
5169                 return;
5170         }
5171
5172         /* Copy out parameters */
5173
5174         /* Copy result */
5175         state->orig.out.result = state->tmp.out.result;
5176
5177         /* Reset temporary structure */
5178         ZERO_STRUCT(state->tmp);
5179
5180         if (DEBUGLEVEL >= 10) {
5181                 NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &state->orig);
5182         }
5183
5184         tevent_req_done(req);
5185 }
5186
5187 NTSTATUS rpccli_PNP_UninstallDevInst_recv(struct tevent_req *req,
5188                                           TALLOC_CTX *mem_ctx,
5189                                           WERROR *result)
5190 {
5191         struct rpccli_PNP_UninstallDevInst_state *state = tevent_req_data(
5192                 req, struct rpccli_PNP_UninstallDevInst_state);
5193         NTSTATUS status;
5194
5195         if (tevent_req_is_nterror(req, &status)) {
5196                 tevent_req_received(req);
5197                 return status;
5198         }
5199
5200         /* Steal possbile out parameters to the callers context */
5201         talloc_steal(mem_ctx, state->out_mem_ctx);
5202
5203         /* Return result */
5204         *result = state->orig.out.result;
5205
5206         tevent_req_received(req);
5207         return NT_STATUS_OK;
5208 }
5209
5210 NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli,
5211                                      TALLOC_CTX *mem_ctx,
5212                                      WERROR *werror)
5213 {
5214         struct PNP_UninstallDevInst r;
5215         NTSTATUS status;
5216
5217         /* In parameters */
5218
5219         if (DEBUGLEVEL >= 10) {
5220                 NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &r);
5221         }
5222
5223         status = cli->dispatch(cli,
5224                                 mem_ctx,
5225                                 &ndr_table_ntsvcs,
5226                                 NDR_PNP_UNINSTALLDEVINST,
5227                                 &r);
5228
5229         if (!NT_STATUS_IS_OK(status)) {
5230                 return status;
5231         }
5232
5233         if (DEBUGLEVEL >= 10) {
5234                 NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &r);
5235         }
5236
5237         if (NT_STATUS_IS_ERR(status)) {
5238                 return status;
5239         }
5240
5241         /* Return variables */
5242
5243         /* Return result */
5244         if (werror) {
5245                 *werror = r.out.result;
5246         }
5247
5248         return werror_to_ntstatus(r.out.result);
5249 }
5250
5251 struct rpccli_PNP_AddID_state {
5252         struct PNP_AddID orig;
5253         struct PNP_AddID tmp;
5254         TALLOC_CTX *out_mem_ctx;
5255         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5256 };
5257
5258 static void rpccli_PNP_AddID_done(struct tevent_req *subreq);
5259
5260 struct tevent_req *rpccli_PNP_AddID_send(TALLOC_CTX *mem_ctx,
5261                                          struct tevent_context *ev,
5262                                          struct rpc_pipe_client *cli)
5263 {
5264         struct tevent_req *req;
5265         struct rpccli_PNP_AddID_state *state;
5266         struct tevent_req *subreq;
5267
5268         req = tevent_req_create(mem_ctx, &state,
5269                                 struct rpccli_PNP_AddID_state);
5270         if (req == NULL) {
5271                 return NULL;
5272         }
5273         state->out_mem_ctx = NULL;
5274         state->dispatch_recv = cli->dispatch_recv;
5275
5276         /* In parameters */
5277
5278         /* Out parameters */
5279
5280         /* Result */
5281         ZERO_STRUCT(state->orig.out.result);
5282
5283         if (DEBUGLEVEL >= 10) {
5284                 NDR_PRINT_IN_DEBUG(PNP_AddID, &state->orig);
5285         }
5286
5287         /* make a temporary copy, that we pass to the dispatch function */
5288         state->tmp = state->orig;
5289
5290         subreq = cli->dispatch_send(state, ev, cli,
5291                                     &ndr_table_ntsvcs,
5292                                     NDR_PNP_ADDID,
5293                                     &state->tmp);
5294         if (tevent_req_nomem(subreq, req)) {
5295                 return tevent_req_post(req, ev);
5296         }
5297         tevent_req_set_callback(subreq, rpccli_PNP_AddID_done, req);
5298         return req;
5299 }
5300
5301 static void rpccli_PNP_AddID_done(struct tevent_req *subreq)
5302 {
5303         struct tevent_req *req = tevent_req_callback_data(
5304                 subreq, struct tevent_req);
5305         struct rpccli_PNP_AddID_state *state = tevent_req_data(
5306                 req, struct rpccli_PNP_AddID_state);
5307         NTSTATUS status;
5308         TALLOC_CTX *mem_ctx;
5309
5310         if (state->out_mem_ctx) {
5311                 mem_ctx = state->out_mem_ctx;
5312         } else {
5313                 mem_ctx = state;
5314         }
5315
5316         status = state->dispatch_recv(subreq, mem_ctx);
5317         TALLOC_FREE(subreq);
5318         if (!NT_STATUS_IS_OK(status)) {
5319                 tevent_req_nterror(req, status);
5320                 return;
5321         }
5322
5323         /* Copy out parameters */
5324
5325         /* Copy result */
5326         state->orig.out.result = state->tmp.out.result;
5327
5328         /* Reset temporary structure */
5329         ZERO_STRUCT(state->tmp);
5330
5331         if (DEBUGLEVEL >= 10) {
5332                 NDR_PRINT_OUT_DEBUG(PNP_AddID, &state->orig);
5333         }
5334
5335         tevent_req_done(req);
5336 }
5337
5338 NTSTATUS rpccli_PNP_AddID_recv(struct tevent_req *req,
5339                                TALLOC_CTX *mem_ctx,
5340                                WERROR *result)
5341 {
5342         struct rpccli_PNP_AddID_state *state = tevent_req_data(
5343                 req, struct rpccli_PNP_AddID_state);
5344         NTSTATUS status;
5345
5346         if (tevent_req_is_nterror(req, &status)) {
5347                 tevent_req_received(req);
5348                 return status;
5349         }
5350
5351         /* Steal possbile out parameters to the callers context */
5352         talloc_steal(mem_ctx, state->out_mem_ctx);
5353
5354         /* Return result */
5355         *result = state->orig.out.result;
5356
5357         tevent_req_received(req);
5358         return NT_STATUS_OK;
5359 }
5360
5361 NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli,
5362                           TALLOC_CTX *mem_ctx,
5363                           WERROR *werror)
5364 {
5365         struct PNP_AddID r;
5366         NTSTATUS status;
5367
5368         /* In parameters */
5369
5370         if (DEBUGLEVEL >= 10) {
5371                 NDR_PRINT_IN_DEBUG(PNP_AddID, &r);
5372         }
5373
5374         status = cli->dispatch(cli,
5375                                 mem_ctx,
5376                                 &ndr_table_ntsvcs,
5377                                 NDR_PNP_ADDID,
5378                                 &r);
5379
5380         if (!NT_STATUS_IS_OK(status)) {
5381                 return status;
5382         }
5383
5384         if (DEBUGLEVEL >= 10) {
5385                 NDR_PRINT_OUT_DEBUG(PNP_AddID, &r);
5386         }
5387
5388         if (NT_STATUS_IS_ERR(status)) {
5389                 return status;
5390         }
5391
5392         /* Return variables */
5393
5394         /* Return result */
5395         if (werror) {
5396                 *werror = r.out.result;
5397         }
5398
5399         return werror_to_ntstatus(r.out.result);
5400 }
5401
5402 struct rpccli_PNP_RegisterDriver_state {
5403         struct PNP_RegisterDriver orig;
5404         struct PNP_RegisterDriver tmp;
5405         TALLOC_CTX *out_mem_ctx;
5406         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5407 };
5408
5409 static void rpccli_PNP_RegisterDriver_done(struct tevent_req *subreq);
5410
5411 struct tevent_req *rpccli_PNP_RegisterDriver_send(TALLOC_CTX *mem_ctx,
5412                                                   struct tevent_context *ev,
5413                                                   struct rpc_pipe_client *cli)
5414 {
5415         struct tevent_req *req;
5416         struct rpccli_PNP_RegisterDriver_state *state;
5417         struct tevent_req *subreq;
5418
5419         req = tevent_req_create(mem_ctx, &state,
5420                                 struct rpccli_PNP_RegisterDriver_state);
5421         if (req == NULL) {
5422                 return NULL;
5423         }
5424         state->out_mem_ctx = NULL;
5425         state->dispatch_recv = cli->dispatch_recv;
5426
5427         /* In parameters */
5428
5429         /* Out parameters */
5430
5431         /* Result */
5432         ZERO_STRUCT(state->orig.out.result);
5433
5434         if (DEBUGLEVEL >= 10) {
5435                 NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &state->orig);
5436         }
5437
5438         /* make a temporary copy, that we pass to the dispatch function */
5439         state->tmp = state->orig;
5440
5441         subreq = cli->dispatch_send(state, ev, cli,
5442                                     &ndr_table_ntsvcs,
5443                                     NDR_PNP_REGISTERDRIVER,
5444                                     &state->tmp);
5445         if (tevent_req_nomem(subreq, req)) {
5446                 return tevent_req_post(req, ev);
5447         }
5448         tevent_req_set_callback(subreq, rpccli_PNP_RegisterDriver_done, req);
5449         return req;
5450 }
5451
5452 static void rpccli_PNP_RegisterDriver_done(struct tevent_req *subreq)
5453 {
5454         struct tevent_req *req = tevent_req_callback_data(
5455                 subreq, struct tevent_req);
5456         struct rpccli_PNP_RegisterDriver_state *state = tevent_req_data(
5457                 req, struct rpccli_PNP_RegisterDriver_state);
5458         NTSTATUS status;
5459         TALLOC_CTX *mem_ctx;
5460
5461         if (state->out_mem_ctx) {
5462                 mem_ctx = state->out_mem_ctx;
5463         } else {
5464                 mem_ctx = state;
5465         }
5466
5467         status = state->dispatch_recv(subreq, mem_ctx);
5468         TALLOC_FREE(subreq);
5469         if (!NT_STATUS_IS_OK(status)) {
5470                 tevent_req_nterror(req, status);
5471                 return;
5472         }
5473
5474         /* Copy out parameters */
5475
5476         /* Copy result */
5477         state->orig.out.result = state->tmp.out.result;
5478
5479         /* Reset temporary structure */
5480         ZERO_STRUCT(state->tmp);
5481
5482         if (DEBUGLEVEL >= 10) {
5483                 NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &state->orig);
5484         }
5485
5486         tevent_req_done(req);
5487 }
5488
5489 NTSTATUS rpccli_PNP_RegisterDriver_recv(struct tevent_req *req,
5490                                         TALLOC_CTX *mem_ctx,
5491                                         WERROR *result)
5492 {
5493         struct rpccli_PNP_RegisterDriver_state *state = tevent_req_data(
5494                 req, struct rpccli_PNP_RegisterDriver_state);
5495         NTSTATUS status;
5496
5497         if (tevent_req_is_nterror(req, &status)) {
5498                 tevent_req_received(req);
5499                 return status;
5500         }
5501
5502         /* Steal possbile out parameters to the callers context */
5503         talloc_steal(mem_ctx, state->out_mem_ctx);
5504
5505         /* Return result */
5506         *result = state->orig.out.result;
5507
5508         tevent_req_received(req);
5509         return NT_STATUS_OK;
5510 }
5511
5512 NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli,
5513                                    TALLOC_CTX *mem_ctx,
5514                                    WERROR *werror)
5515 {
5516         struct PNP_RegisterDriver r;
5517         NTSTATUS status;
5518
5519         /* In parameters */
5520
5521         if (DEBUGLEVEL >= 10) {
5522                 NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &r);
5523         }
5524
5525         status = cli->dispatch(cli,
5526                                 mem_ctx,
5527                                 &ndr_table_ntsvcs,
5528                                 NDR_PNP_REGISTERDRIVER,
5529                                 &r);
5530
5531         if (!NT_STATUS_IS_OK(status)) {
5532                 return status;
5533         }
5534
5535         if (DEBUGLEVEL >= 10) {
5536                 NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &r);
5537         }
5538
5539         if (NT_STATUS_IS_ERR(status)) {
5540                 return status;
5541         }
5542
5543         /* Return variables */
5544
5545         /* Return result */
5546         if (werror) {
5547                 *werror = r.out.result;
5548         }
5549
5550         return werror_to_ntstatus(r.out.result);
5551 }
5552
5553 struct rpccli_PNP_QueryRemove_state {
5554         struct PNP_QueryRemove orig;
5555         struct PNP_QueryRemove tmp;
5556         TALLOC_CTX *out_mem_ctx;
5557         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5558 };
5559
5560 static void rpccli_PNP_QueryRemove_done(struct tevent_req *subreq);
5561
5562 struct tevent_req *rpccli_PNP_QueryRemove_send(TALLOC_CTX *mem_ctx,
5563                                                struct tevent_context *ev,
5564                                                struct rpc_pipe_client *cli)
5565 {
5566         struct tevent_req *req;
5567         struct rpccli_PNP_QueryRemove_state *state;
5568         struct tevent_req *subreq;
5569
5570         req = tevent_req_create(mem_ctx, &state,
5571                                 struct rpccli_PNP_QueryRemove_state);
5572         if (req == NULL) {
5573                 return NULL;
5574         }
5575         state->out_mem_ctx = NULL;
5576         state->dispatch_recv = cli->dispatch_recv;
5577
5578         /* In parameters */
5579
5580         /* Out parameters */
5581
5582         /* Result */
5583         ZERO_STRUCT(state->orig.out.result);
5584
5585         if (DEBUGLEVEL >= 10) {
5586                 NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &state->orig);
5587         }
5588
5589         /* make a temporary copy, that we pass to the dispatch function */
5590         state->tmp = state->orig;
5591
5592         subreq = cli->dispatch_send(state, ev, cli,
5593                                     &ndr_table_ntsvcs,
5594                                     NDR_PNP_QUERYREMOVE,
5595                                     &state->tmp);
5596         if (tevent_req_nomem(subreq, req)) {
5597                 return tevent_req_post(req, ev);
5598         }
5599         tevent_req_set_callback(subreq, rpccli_PNP_QueryRemove_done, req);
5600         return req;
5601 }
5602
5603 static void rpccli_PNP_QueryRemove_done(struct tevent_req *subreq)
5604 {
5605         struct tevent_req *req = tevent_req_callback_data(
5606                 subreq, struct tevent_req);
5607         struct rpccli_PNP_QueryRemove_state *state = tevent_req_data(
5608                 req, struct rpccli_PNP_QueryRemove_state);
5609         NTSTATUS status;
5610         TALLOC_CTX *mem_ctx;
5611
5612         if (state->out_mem_ctx) {
5613                 mem_ctx = state->out_mem_ctx;
5614         } else {
5615                 mem_ctx = state;
5616         }
5617
5618         status = state->dispatch_recv(subreq, mem_ctx);
5619         TALLOC_FREE(subreq);
5620         if (!NT_STATUS_IS_OK(status)) {
5621                 tevent_req_nterror(req, status);
5622                 return;
5623         }
5624
5625         /* Copy out parameters */
5626
5627         /* Copy result */
5628         state->orig.out.result = state->tmp.out.result;
5629
5630         /* Reset temporary structure */
5631         ZERO_STRUCT(state->tmp);
5632
5633         if (DEBUGLEVEL >= 10) {
5634                 NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &state->orig);
5635         }
5636
5637         tevent_req_done(req);
5638 }
5639
5640 NTSTATUS rpccli_PNP_QueryRemove_recv(struct tevent_req *req,
5641                                      TALLOC_CTX *mem_ctx,
5642                                      WERROR *result)
5643 {
5644         struct rpccli_PNP_QueryRemove_state *state = tevent_req_data(
5645                 req, struct rpccli_PNP_QueryRemove_state);
5646         NTSTATUS status;
5647
5648         if (tevent_req_is_nterror(req, &status)) {
5649                 tevent_req_received(req);
5650                 return status;
5651         }
5652
5653         /* Steal possbile out parameters to the callers context */
5654         talloc_steal(mem_ctx, state->out_mem_ctx);
5655
5656         /* Return result */
5657         *result = state->orig.out.result;
5658
5659         tevent_req_received(req);
5660         return NT_STATUS_OK;
5661 }
5662
5663 NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli,
5664                                 TALLOC_CTX *mem_ctx,
5665                                 WERROR *werror)
5666 {
5667         struct PNP_QueryRemove r;
5668         NTSTATUS status;
5669
5670         /* In parameters */
5671
5672         if (DEBUGLEVEL >= 10) {
5673                 NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &r);
5674         }
5675
5676         status = cli->dispatch(cli,
5677                                 mem_ctx,
5678                                 &ndr_table_ntsvcs,
5679                                 NDR_PNP_QUERYREMOVE,
5680                                 &r);
5681
5682         if (!NT_STATUS_IS_OK(status)) {
5683                 return status;
5684         }
5685
5686         if (DEBUGLEVEL >= 10) {
5687                 NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &r);
5688         }
5689
5690         if (NT_STATUS_IS_ERR(status)) {
5691                 return status;
5692         }
5693
5694         /* Return variables */
5695
5696         /* Return result */
5697         if (werror) {
5698                 *werror = r.out.result;
5699         }
5700
5701         return werror_to_ntstatus(r.out.result);
5702 }
5703
5704 struct rpccli_PNP_RequestDeviceEject_state {
5705         struct PNP_RequestDeviceEject orig;
5706         struct PNP_RequestDeviceEject tmp;
5707         TALLOC_CTX *out_mem_ctx;
5708         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5709 };
5710
5711 static void rpccli_PNP_RequestDeviceEject_done(struct tevent_req *subreq);
5712
5713 struct tevent_req *rpccli_PNP_RequestDeviceEject_send(TALLOC_CTX *mem_ctx,
5714                                                       struct tevent_context *ev,
5715                                                       struct rpc_pipe_client *cli)
5716 {
5717         struct tevent_req *req;
5718         struct rpccli_PNP_RequestDeviceEject_state *state;
5719         struct tevent_req *subreq;
5720
5721         req = tevent_req_create(mem_ctx, &state,
5722                                 struct rpccli_PNP_RequestDeviceEject_state);
5723         if (req == NULL) {
5724                 return NULL;
5725         }
5726         state->out_mem_ctx = NULL;
5727         state->dispatch_recv = cli->dispatch_recv;
5728
5729         /* In parameters */
5730
5731         /* Out parameters */
5732
5733         /* Result */
5734         ZERO_STRUCT(state->orig.out.result);
5735
5736         if (DEBUGLEVEL >= 10) {
5737                 NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &state->orig);
5738         }
5739
5740         /* make a temporary copy, that we pass to the dispatch function */
5741         state->tmp = state->orig;
5742
5743         subreq = cli->dispatch_send(state, ev, cli,
5744                                     &ndr_table_ntsvcs,
5745                                     NDR_PNP_REQUESTDEVICEEJECT,
5746                                     &state->tmp);
5747         if (tevent_req_nomem(subreq, req)) {
5748                 return tevent_req_post(req, ev);
5749         }
5750         tevent_req_set_callback(subreq, rpccli_PNP_RequestDeviceEject_done, req);
5751         return req;
5752 }
5753
5754 static void rpccli_PNP_RequestDeviceEject_done(struct tevent_req *subreq)
5755 {
5756         struct tevent_req *req = tevent_req_callback_data(
5757                 subreq, struct tevent_req);
5758         struct rpccli_PNP_RequestDeviceEject_state *state = tevent_req_data(
5759                 req, struct rpccli_PNP_RequestDeviceEject_state);
5760         NTSTATUS status;
5761         TALLOC_CTX *mem_ctx;
5762
5763         if (state->out_mem_ctx) {
5764                 mem_ctx = state->out_mem_ctx;
5765         } else {
5766                 mem_ctx = state;
5767         }
5768
5769         status = state->dispatch_recv(subreq, mem_ctx);
5770         TALLOC_FREE(subreq);
5771         if (!NT_STATUS_IS_OK(status)) {
5772                 tevent_req_nterror(req, status);
5773                 return;
5774         }
5775
5776         /* Copy out parameters */
5777
5778         /* Copy result */
5779         state->orig.out.result = state->tmp.out.result;
5780
5781         /* Reset temporary structure */
5782         ZERO_STRUCT(state->tmp);
5783
5784         if (DEBUGLEVEL >= 10) {
5785                 NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &state->orig);
5786         }
5787
5788         tevent_req_done(req);
5789 }
5790
5791 NTSTATUS rpccli_PNP_RequestDeviceEject_recv(struct tevent_req *req,
5792                                             TALLOC_CTX *mem_ctx,
5793                                             WERROR *result)
5794 {
5795         struct rpccli_PNP_RequestDeviceEject_state *state = tevent_req_data(
5796                 req, struct rpccli_PNP_RequestDeviceEject_state);
5797         NTSTATUS status;
5798
5799         if (tevent_req_is_nterror(req, &status)) {
5800                 tevent_req_received(req);
5801                 return status;
5802         }
5803
5804         /* Steal possbile out parameters to the callers context */
5805         talloc_steal(mem_ctx, state->out_mem_ctx);
5806
5807         /* Return result */
5808         *result = state->orig.out.result;
5809
5810         tevent_req_received(req);
5811         return NT_STATUS_OK;
5812 }
5813
5814 NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli,
5815                                        TALLOC_CTX *mem_ctx,
5816                                        WERROR *werror)
5817 {
5818         struct PNP_RequestDeviceEject r;
5819         NTSTATUS status;
5820
5821         /* In parameters */
5822
5823         if (DEBUGLEVEL >= 10) {
5824                 NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &r);
5825         }
5826
5827         status = cli->dispatch(cli,
5828                                 mem_ctx,
5829                                 &ndr_table_ntsvcs,
5830                                 NDR_PNP_REQUESTDEVICEEJECT,
5831                                 &r);
5832
5833         if (!NT_STATUS_IS_OK(status)) {
5834                 return status;
5835         }
5836
5837         if (DEBUGLEVEL >= 10) {
5838                 NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &r);
5839         }
5840
5841         if (NT_STATUS_IS_ERR(status)) {
5842                 return status;
5843         }
5844
5845         /* Return variables */
5846
5847         /* Return result */
5848         if (werror) {
5849                 *werror = r.out.result;
5850         }
5851
5852         return werror_to_ntstatus(r.out.result);
5853 }
5854
5855 struct rpccli_PNP_IsDockStationPresent_state {
5856         struct PNP_IsDockStationPresent orig;
5857         struct PNP_IsDockStationPresent tmp;
5858         TALLOC_CTX *out_mem_ctx;
5859         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5860 };
5861
5862 static void rpccli_PNP_IsDockStationPresent_done(struct tevent_req *subreq);
5863
5864 struct tevent_req *rpccli_PNP_IsDockStationPresent_send(TALLOC_CTX *mem_ctx,
5865                                                         struct tevent_context *ev,
5866                                                         struct rpc_pipe_client *cli)
5867 {
5868         struct tevent_req *req;
5869         struct rpccli_PNP_IsDockStationPresent_state *state;
5870         struct tevent_req *subreq;
5871
5872         req = tevent_req_create(mem_ctx, &state,
5873                                 struct rpccli_PNP_IsDockStationPresent_state);
5874         if (req == NULL) {
5875                 return NULL;
5876         }
5877         state->out_mem_ctx = NULL;
5878         state->dispatch_recv = cli->dispatch_recv;
5879
5880         /* In parameters */
5881
5882         /* Out parameters */
5883
5884         /* Result */
5885         ZERO_STRUCT(state->orig.out.result);
5886
5887         if (DEBUGLEVEL >= 10) {
5888                 NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &state->orig);
5889         }
5890
5891         /* make a temporary copy, that we pass to the dispatch function */
5892         state->tmp = state->orig;
5893
5894         subreq = cli->dispatch_send(state, ev, cli,
5895                                     &ndr_table_ntsvcs,
5896                                     NDR_PNP_ISDOCKSTATIONPRESENT,
5897                                     &state->tmp);
5898         if (tevent_req_nomem(subreq, req)) {
5899                 return tevent_req_post(req, ev);
5900         }
5901         tevent_req_set_callback(subreq, rpccli_PNP_IsDockStationPresent_done, req);
5902         return req;
5903 }
5904
5905 static void rpccli_PNP_IsDockStationPresent_done(struct tevent_req *subreq)
5906 {
5907         struct tevent_req *req = tevent_req_callback_data(
5908                 subreq, struct tevent_req);
5909         struct rpccli_PNP_IsDockStationPresent_state *state = tevent_req_data(
5910                 req, struct rpccli_PNP_IsDockStationPresent_state);
5911         NTSTATUS status;
5912         TALLOC_CTX *mem_ctx;
5913
5914         if (state->out_mem_ctx) {
5915                 mem_ctx = state->out_mem_ctx;
5916         } else {
5917                 mem_ctx = state;
5918         }
5919
5920         status = state->dispatch_recv(subreq, mem_ctx);
5921         TALLOC_FREE(subreq);
5922         if (!NT_STATUS_IS_OK(status)) {
5923                 tevent_req_nterror(req, status);
5924                 return;
5925         }
5926
5927         /* Copy out parameters */
5928
5929         /* Copy result */
5930         state->orig.out.result = state->tmp.out.result;
5931
5932         /* Reset temporary structure */
5933         ZERO_STRUCT(state->tmp);
5934
5935         if (DEBUGLEVEL >= 10) {
5936                 NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &state->orig);
5937         }
5938
5939         tevent_req_done(req);
5940 }
5941
5942 NTSTATUS rpccli_PNP_IsDockStationPresent_recv(struct tevent_req *req,
5943                                               TALLOC_CTX *mem_ctx,
5944                                               WERROR *result)
5945 {
5946         struct rpccli_PNP_IsDockStationPresent_state *state = tevent_req_data(
5947                 req, struct rpccli_PNP_IsDockStationPresent_state);
5948         NTSTATUS status;
5949
5950         if (tevent_req_is_nterror(req, &status)) {
5951                 tevent_req_received(req);
5952                 return status;
5953         }
5954
5955         /* Steal possbile out parameters to the callers context */
5956         talloc_steal(mem_ctx, state->out_mem_ctx);
5957
5958         /* Return result */
5959         *result = state->orig.out.result;
5960
5961         tevent_req_received(req);
5962         return NT_STATUS_OK;
5963 }
5964
5965 NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli,
5966                                          TALLOC_CTX *mem_ctx,
5967                                          WERROR *werror)
5968 {
5969         struct PNP_IsDockStationPresent r;
5970         NTSTATUS status;
5971
5972         /* In parameters */
5973
5974         if (DEBUGLEVEL >= 10) {
5975                 NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &r);
5976         }
5977
5978         status = cli->dispatch(cli,
5979                                 mem_ctx,
5980                                 &ndr_table_ntsvcs,
5981                                 NDR_PNP_ISDOCKSTATIONPRESENT,
5982                                 &r);
5983
5984         if (!NT_STATUS_IS_OK(status)) {
5985                 return status;
5986         }
5987
5988         if (DEBUGLEVEL >= 10) {
5989                 NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &r);
5990         }
5991
5992         if (NT_STATUS_IS_ERR(status)) {
5993                 return status;
5994         }
5995
5996         /* Return variables */
5997
5998         /* Return result */
5999         if (werror) {
6000                 *werror = r.out.result;
6001         }
6002
6003         return werror_to_ntstatus(r.out.result);
6004 }
6005
6006 struct rpccli_PNP_RequestEjectPC_state {
6007         struct PNP_RequestEjectPC orig;
6008         struct PNP_RequestEjectPC tmp;
6009         TALLOC_CTX *out_mem_ctx;
6010         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6011 };
6012
6013 static void rpccli_PNP_RequestEjectPC_done(struct tevent_req *subreq);
6014
6015 struct tevent_req *rpccli_PNP_RequestEjectPC_send(TALLOC_CTX *mem_ctx,
6016                                                   struct tevent_context *ev,
6017                                                   struct rpc_pipe_client *cli)
6018 {
6019         struct tevent_req *req;
6020         struct rpccli_PNP_RequestEjectPC_state *state;
6021         struct tevent_req *subreq;
6022
6023         req = tevent_req_create(mem_ctx, &state,
6024                                 struct rpccli_PNP_RequestEjectPC_state);
6025         if (req == NULL) {
6026                 return NULL;
6027         }
6028         state->out_mem_ctx = NULL;
6029         state->dispatch_recv = cli->dispatch_recv;
6030
6031         /* In parameters */
6032
6033         /* Out parameters */
6034
6035         /* Result */
6036         ZERO_STRUCT(state->orig.out.result);
6037
6038         if (DEBUGLEVEL >= 10) {
6039                 NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &state->orig);
6040         }
6041
6042         /* make a temporary copy, that we pass to the dispatch function */
6043         state->tmp = state->orig;
6044
6045         subreq = cli->dispatch_send(state, ev, cli,
6046                                     &ndr_table_ntsvcs,
6047                                     NDR_PNP_REQUESTEJECTPC,
6048                                     &state->tmp);
6049         if (tevent_req_nomem(subreq, req)) {
6050                 return tevent_req_post(req, ev);
6051         }
6052         tevent_req_set_callback(subreq, rpccli_PNP_RequestEjectPC_done, req);
6053         return req;
6054 }
6055
6056 static void rpccli_PNP_RequestEjectPC_done(struct tevent_req *subreq)
6057 {
6058         struct tevent_req *req = tevent_req_callback_data(
6059                 subreq, struct tevent_req);
6060         struct rpccli_PNP_RequestEjectPC_state *state = tevent_req_data(
6061                 req, struct rpccli_PNP_RequestEjectPC_state);
6062         NTSTATUS status;
6063         TALLOC_CTX *mem_ctx;
6064
6065         if (state->out_mem_ctx) {
6066                 mem_ctx = state->out_mem_ctx;
6067         } else {
6068                 mem_ctx = state;
6069         }
6070
6071         status = state->dispatch_recv(subreq, mem_ctx);
6072         TALLOC_FREE(subreq);
6073         if (!NT_STATUS_IS_OK(status)) {
6074                 tevent_req_nterror(req, status);
6075                 return;
6076         }
6077
6078         /* Copy out parameters */
6079
6080         /* Copy result */
6081         state->orig.out.result = state->tmp.out.result;
6082
6083         /* Reset temporary structure */
6084         ZERO_STRUCT(state->tmp);
6085
6086         if (DEBUGLEVEL >= 10) {
6087                 NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &state->orig);
6088         }
6089
6090         tevent_req_done(req);
6091 }
6092
6093 NTSTATUS rpccli_PNP_RequestEjectPC_recv(struct tevent_req *req,
6094                                         TALLOC_CTX *mem_ctx,
6095                                         WERROR *result)
6096 {
6097         struct rpccli_PNP_RequestEjectPC_state *state = tevent_req_data(
6098                 req, struct rpccli_PNP_RequestEjectPC_state);
6099         NTSTATUS status;
6100
6101         if (tevent_req_is_nterror(req, &status)) {
6102                 tevent_req_received(req);
6103                 return status;
6104         }
6105
6106         /* Steal possbile out parameters to the callers context */
6107         talloc_steal(mem_ctx, state->out_mem_ctx);
6108
6109         /* Return result */
6110         *result = state->orig.out.result;
6111
6112         tevent_req_received(req);
6113         return NT_STATUS_OK;
6114 }
6115
6116 NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli,
6117                                    TALLOC_CTX *mem_ctx,
6118                                    WERROR *werror)
6119 {
6120         struct PNP_RequestEjectPC r;
6121         NTSTATUS status;
6122
6123         /* In parameters */
6124
6125         if (DEBUGLEVEL >= 10) {
6126                 NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &r);
6127         }
6128
6129         status = cli->dispatch(cli,
6130                                 mem_ctx,
6131                                 &ndr_table_ntsvcs,
6132                                 NDR_PNP_REQUESTEJECTPC,
6133                                 &r);
6134
6135         if (!NT_STATUS_IS_OK(status)) {
6136                 return status;
6137         }
6138
6139         if (DEBUGLEVEL >= 10) {
6140                 NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &r);
6141         }
6142
6143         if (NT_STATUS_IS_ERR(status)) {
6144                 return status;
6145         }
6146
6147         /* Return variables */
6148
6149         /* Return result */
6150         if (werror) {
6151                 *werror = r.out.result;
6152         }
6153
6154         return werror_to_ntstatus(r.out.result);
6155 }
6156
6157 struct rpccli_PNP_HwProfFlags_state {
6158         struct PNP_HwProfFlags orig;
6159         struct PNP_HwProfFlags tmp;
6160         TALLOC_CTX *out_mem_ctx;
6161         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6162 };
6163
6164 static void rpccli_PNP_HwProfFlags_done(struct tevent_req *subreq);
6165
6166 struct tevent_req *rpccli_PNP_HwProfFlags_send(TALLOC_CTX *mem_ctx,
6167                                                struct tevent_context *ev,
6168                                                struct rpc_pipe_client *cli,
6169                                                uint32_t _action /* [in]  */,
6170                                                const char *_devicepath /* [in] [ref,charset(UTF16)] */,
6171                                                uint32_t _config /* [in]  */,
6172                                                uint32_t *_profile_flags /* [in,out] [ref] */,
6173                                                uint16_t *_veto_type /* [in,out] [unique] */,
6174                                                const char *_unknown5 /* [in] [unique,charset(UTF16)] */,
6175                                                const char **_unknown5a /* [out] [unique,charset(UTF16)] */,
6176                                                uint32_t _name_length /* [in]  */,
6177                                                uint32_t _flags /* [in]  */)
6178 {
6179         struct tevent_req *req;
6180         struct rpccli_PNP_HwProfFlags_state *state;
6181         struct tevent_req *subreq;
6182
6183         req = tevent_req_create(mem_ctx, &state,
6184                                 struct rpccli_PNP_HwProfFlags_state);
6185         if (req == NULL) {
6186                 return NULL;
6187         }
6188         state->out_mem_ctx = NULL;
6189         state->dispatch_recv = cli->dispatch_recv;
6190
6191         /* In parameters */
6192         state->orig.in.action = _action;
6193         state->orig.in.devicepath = _devicepath;
6194         state->orig.in.config = _config;
6195         state->orig.in.profile_flags = _profile_flags;
6196         state->orig.in.veto_type = _veto_type;
6197         state->orig.in.unknown5 = _unknown5;
6198         state->orig.in.name_length = _name_length;
6199         state->orig.in.flags = _flags;
6200
6201         /* Out parameters */
6202         state->orig.out.profile_flags = _profile_flags;
6203         state->orig.out.veto_type = _veto_type;
6204         state->orig.out.unknown5a = _unknown5a;
6205
6206         /* Result */
6207         ZERO_STRUCT(state->orig.out.result);
6208
6209         if (DEBUGLEVEL >= 10) {
6210                 NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &state->orig);
6211         }
6212
6213         state->out_mem_ctx = talloc_named_const(state, 0,
6214                              "rpccli_PNP_HwProfFlags_out_memory");
6215         if (tevent_req_nomem(state->out_mem_ctx, req)) {
6216                 return tevent_req_post(req, ev);
6217         }
6218
6219         /* make a temporary copy, that we pass to the dispatch function */
6220         state->tmp = state->orig;
6221
6222         subreq = cli->dispatch_send(state, ev, cli,
6223                                     &ndr_table_ntsvcs,
6224                                     NDR_PNP_HWPROFFLAGS,
6225                                     &state->tmp);
6226         if (tevent_req_nomem(subreq, req)) {
6227                 return tevent_req_post(req, ev);
6228         }
6229         tevent_req_set_callback(subreq, rpccli_PNP_HwProfFlags_done, req);
6230         return req;
6231 }
6232
6233 static void rpccli_PNP_HwProfFlags_done(struct tevent_req *subreq)
6234 {
6235         struct tevent_req *req = tevent_req_callback_data(
6236                 subreq, struct tevent_req);
6237         struct rpccli_PNP_HwProfFlags_state *state = tevent_req_data(
6238                 req, struct rpccli_PNP_HwProfFlags_state);
6239         NTSTATUS status;
6240         TALLOC_CTX *mem_ctx;
6241
6242         if (state->out_mem_ctx) {
6243                 mem_ctx = state->out_mem_ctx;
6244         } else {
6245                 mem_ctx = state;
6246         }
6247
6248         status = state->dispatch_recv(subreq, mem_ctx);
6249         TALLOC_FREE(subreq);
6250         if (!NT_STATUS_IS_OK(status)) {
6251                 tevent_req_nterror(req, status);
6252                 return;
6253         }
6254
6255         /* Copy out parameters */
6256         *state->orig.out.profile_flags = *state->tmp.out.profile_flags;
6257         if (state->orig.out.veto_type && state->tmp.out.veto_type) {
6258                 *state->orig.out.veto_type = *state->tmp.out.veto_type;
6259         }
6260         if (state->orig.out.unknown5a && state->tmp.out.unknown5a) {
6261                 *state->orig.out.unknown5a = *state->tmp.out.unknown5a;
6262         }
6263
6264         /* Copy result */
6265         state->orig.out.result = state->tmp.out.result;
6266
6267         /* Reset temporary structure */
6268         ZERO_STRUCT(state->tmp);
6269
6270         if (DEBUGLEVEL >= 10) {
6271                 NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &state->orig);
6272         }
6273
6274         tevent_req_done(req);
6275 }
6276
6277 NTSTATUS rpccli_PNP_HwProfFlags_recv(struct tevent_req *req,
6278                                      TALLOC_CTX *mem_ctx,
6279                                      WERROR *result)
6280 {
6281         struct rpccli_PNP_HwProfFlags_state *state = tevent_req_data(
6282                 req, struct rpccli_PNP_HwProfFlags_state);
6283         NTSTATUS status;
6284
6285         if (tevent_req_is_nterror(req, &status)) {
6286                 tevent_req_received(req);
6287                 return status;
6288         }
6289
6290         /* Steal possbile out parameters to the callers context */
6291         talloc_steal(mem_ctx, state->out_mem_ctx);
6292
6293         /* Return result */
6294         *result = state->orig.out.result;
6295
6296         tevent_req_received(req);
6297         return NT_STATUS_OK;
6298 }
6299
6300 NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
6301                                 TALLOC_CTX *mem_ctx,
6302                                 uint32_t action /* [in]  */,
6303                                 const char *devicepath /* [in] [ref,charset(UTF16)] */,
6304                                 uint32_t config /* [in]  */,
6305                                 uint32_t *profile_flags /* [in,out] [ref] */,
6306                                 uint16_t *veto_type /* [in,out] [unique] */,
6307                                 const char *unknown5 /* [in] [unique,charset(UTF16)] */,
6308                                 const char **unknown5a /* [out] [unique,charset(UTF16)] */,
6309                                 uint32_t name_length /* [in]  */,
6310                                 uint32_t flags /* [in]  */,
6311                                 WERROR *werror)
6312 {
6313         struct PNP_HwProfFlags r;
6314         NTSTATUS status;
6315
6316         /* In parameters */
6317         r.in.action = action;
6318         r.in.devicepath = devicepath;
6319         r.in.config = config;
6320         r.in.profile_flags = profile_flags;
6321         r.in.veto_type = veto_type;
6322         r.in.unknown5 = unknown5;
6323         r.in.name_length = name_length;
6324         r.in.flags = flags;
6325
6326         if (DEBUGLEVEL >= 10) {
6327                 NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &r);
6328         }
6329
6330         status = cli->dispatch(cli,
6331                                 mem_ctx,
6332                                 &ndr_table_ntsvcs,
6333                                 NDR_PNP_HWPROFFLAGS,
6334                                 &r);
6335
6336         if (!NT_STATUS_IS_OK(status)) {
6337                 return status;
6338         }
6339
6340         if (DEBUGLEVEL >= 10) {
6341                 NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &r);
6342         }
6343
6344         if (NT_STATUS_IS_ERR(status)) {
6345                 return status;
6346         }
6347
6348         /* Return variables */
6349         *profile_flags = *r.out.profile_flags;
6350         if (veto_type && r.out.veto_type) {
6351                 *veto_type = *r.out.veto_type;
6352         }
6353         if (unknown5a && r.out.unknown5a) {
6354                 *unknown5a = *r.out.unknown5a;
6355         }
6356
6357         /* Return result */
6358         if (werror) {
6359                 *werror = r.out.result;
6360         }
6361
6362         return werror_to_ntstatus(r.out.result);
6363 }
6364
6365 struct rpccli_PNP_GetHwProfInfo_state {
6366         struct PNP_GetHwProfInfo orig;
6367         struct PNP_GetHwProfInfo tmp;
6368         TALLOC_CTX *out_mem_ctx;
6369         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6370 };
6371
6372 static void rpccli_PNP_GetHwProfInfo_done(struct tevent_req *subreq);
6373
6374 struct tevent_req *rpccli_PNP_GetHwProfInfo_send(TALLOC_CTX *mem_ctx,
6375                                                  struct tevent_context *ev,
6376                                                  struct rpc_pipe_client *cli,
6377                                                  uint32_t _idx /* [in]  */,
6378                                                  struct PNP_HwProfInfo *_info /* [in,out] [ref] */,
6379                                                  uint32_t _size /* [in]  */,
6380                                                  uint32_t _flags /* [in]  */)
6381 {
6382         struct tevent_req *req;
6383         struct rpccli_PNP_GetHwProfInfo_state *state;
6384         struct tevent_req *subreq;
6385
6386         req = tevent_req_create(mem_ctx, &state,
6387                                 struct rpccli_PNP_GetHwProfInfo_state);
6388         if (req == NULL) {
6389                 return NULL;
6390         }
6391         state->out_mem_ctx = NULL;
6392         state->dispatch_recv = cli->dispatch_recv;
6393
6394         /* In parameters */
6395         state->orig.in.idx = _idx;
6396         state->orig.in.info = _info;
6397         state->orig.in.size = _size;
6398         state->orig.in.flags = _flags;
6399
6400         /* Out parameters */
6401         state->orig.out.info = _info;
6402
6403         /* Result */
6404         ZERO_STRUCT(state->orig.out.result);
6405
6406         if (DEBUGLEVEL >= 10) {
6407                 NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &state->orig);
6408         }
6409
6410         state->out_mem_ctx = talloc_named_const(state, 0,
6411                              "rpccli_PNP_GetHwProfInfo_out_memory");
6412         if (tevent_req_nomem(state->out_mem_ctx, req)) {
6413                 return tevent_req_post(req, ev);
6414         }
6415
6416         /* make a temporary copy, that we pass to the dispatch function */
6417         state->tmp = state->orig;
6418
6419         subreq = cli->dispatch_send(state, ev, cli,
6420                                     &ndr_table_ntsvcs,
6421                                     NDR_PNP_GETHWPROFINFO,
6422                                     &state->tmp);
6423         if (tevent_req_nomem(subreq, req)) {
6424                 return tevent_req_post(req, ev);
6425         }
6426         tevent_req_set_callback(subreq, rpccli_PNP_GetHwProfInfo_done, req);
6427         return req;
6428 }
6429
6430 static void rpccli_PNP_GetHwProfInfo_done(struct tevent_req *subreq)
6431 {
6432         struct tevent_req *req = tevent_req_callback_data(
6433                 subreq, struct tevent_req);
6434         struct rpccli_PNP_GetHwProfInfo_state *state = tevent_req_data(
6435                 req, struct rpccli_PNP_GetHwProfInfo_state);
6436         NTSTATUS status;
6437         TALLOC_CTX *mem_ctx;
6438
6439         if (state->out_mem_ctx) {
6440                 mem_ctx = state->out_mem_ctx;
6441         } else {
6442                 mem_ctx = state;
6443         }
6444
6445         status = state->dispatch_recv(subreq, mem_ctx);
6446         TALLOC_FREE(subreq);
6447         if (!NT_STATUS_IS_OK(status)) {
6448                 tevent_req_nterror(req, status);
6449                 return;
6450         }
6451
6452         /* Copy out parameters */
6453         *state->orig.out.info = *state->tmp.out.info;
6454
6455         /* Copy result */
6456         state->orig.out.result = state->tmp.out.result;
6457
6458         /* Reset temporary structure */
6459         ZERO_STRUCT(state->tmp);
6460
6461         if (DEBUGLEVEL >= 10) {
6462                 NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &state->orig);
6463         }
6464
6465         tevent_req_done(req);
6466 }
6467
6468 NTSTATUS rpccli_PNP_GetHwProfInfo_recv(struct tevent_req *req,
6469                                        TALLOC_CTX *mem_ctx,
6470                                        WERROR *result)
6471 {
6472         struct rpccli_PNP_GetHwProfInfo_state *state = tevent_req_data(
6473                 req, struct rpccli_PNP_GetHwProfInfo_state);
6474         NTSTATUS status;
6475
6476         if (tevent_req_is_nterror(req, &status)) {
6477                 tevent_req_received(req);
6478                 return status;
6479         }
6480
6481         /* Steal possbile out parameters to the callers context */
6482         talloc_steal(mem_ctx, state->out_mem_ctx);
6483
6484         /* Return result */
6485         *result = state->orig.out.result;
6486
6487         tevent_req_received(req);
6488         return NT_STATUS_OK;
6489 }
6490
6491 NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli,
6492                                   TALLOC_CTX *mem_ctx,
6493                                   uint32_t idx /* [in]  */,
6494                                   struct PNP_HwProfInfo *info /* [in,out] [ref] */,
6495                                   uint32_t size /* [in]  */,
6496                                   uint32_t flags /* [in]  */,
6497                                   WERROR *werror)
6498 {
6499         struct PNP_GetHwProfInfo r;
6500         NTSTATUS status;
6501
6502         /* In parameters */
6503         r.in.idx = idx;
6504         r.in.info = info;
6505         r.in.size = size;
6506         r.in.flags = flags;
6507
6508         if (DEBUGLEVEL >= 10) {
6509                 NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &r);
6510         }
6511
6512         status = cli->dispatch(cli,
6513                                 mem_ctx,
6514                                 &ndr_table_ntsvcs,
6515                                 NDR_PNP_GETHWPROFINFO,
6516                                 &r);
6517
6518         if (!NT_STATUS_IS_OK(status)) {
6519                 return status;
6520         }
6521
6522         if (DEBUGLEVEL >= 10) {
6523                 NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &r);
6524         }
6525
6526         if (NT_STATUS_IS_ERR(status)) {
6527                 return status;
6528         }
6529
6530         /* Return variables */
6531         *info = *r.out.info;
6532
6533         /* Return result */
6534         if (werror) {
6535                 *werror = r.out.result;
6536         }
6537
6538         return werror_to_ntstatus(r.out.result);
6539 }
6540
6541 struct rpccli_PNP_AddEmptyLogConf_state {
6542         struct PNP_AddEmptyLogConf orig;
6543         struct PNP_AddEmptyLogConf tmp;
6544         TALLOC_CTX *out_mem_ctx;
6545         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6546 };
6547
6548 static void rpccli_PNP_AddEmptyLogConf_done(struct tevent_req *subreq);
6549
6550 struct tevent_req *rpccli_PNP_AddEmptyLogConf_send(TALLOC_CTX *mem_ctx,
6551                                                    struct tevent_context *ev,
6552                                                    struct rpc_pipe_client *cli)
6553 {
6554         struct tevent_req *req;
6555         struct rpccli_PNP_AddEmptyLogConf_state *state;
6556         struct tevent_req *subreq;
6557
6558         req = tevent_req_create(mem_ctx, &state,
6559                                 struct rpccli_PNP_AddEmptyLogConf_state);
6560         if (req == NULL) {
6561                 return NULL;
6562         }
6563         state->out_mem_ctx = NULL;
6564         state->dispatch_recv = cli->dispatch_recv;
6565
6566         /* In parameters */
6567
6568         /* Out parameters */
6569
6570         /* Result */
6571         ZERO_STRUCT(state->orig.out.result);
6572
6573         if (DEBUGLEVEL >= 10) {
6574                 NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &state->orig);
6575         }
6576
6577         /* make a temporary copy, that we pass to the dispatch function */
6578         state->tmp = state->orig;
6579
6580         subreq = cli->dispatch_send(state, ev, cli,
6581                                     &ndr_table_ntsvcs,
6582                                     NDR_PNP_ADDEMPTYLOGCONF,
6583                                     &state->tmp);
6584         if (tevent_req_nomem(subreq, req)) {
6585                 return tevent_req_post(req, ev);
6586         }
6587         tevent_req_set_callback(subreq, rpccli_PNP_AddEmptyLogConf_done, req);
6588         return req;
6589 }
6590
6591 static void rpccli_PNP_AddEmptyLogConf_done(struct tevent_req *subreq)
6592 {
6593         struct tevent_req *req = tevent_req_callback_data(
6594                 subreq, struct tevent_req);
6595         struct rpccli_PNP_AddEmptyLogConf_state *state = tevent_req_data(
6596                 req, struct rpccli_PNP_AddEmptyLogConf_state);
6597         NTSTATUS status;
6598         TALLOC_CTX *mem_ctx;
6599
6600         if (state->out_mem_ctx) {
6601                 mem_ctx = state->out_mem_ctx;
6602         } else {
6603                 mem_ctx = state;
6604         }
6605
6606         status = state->dispatch_recv(subreq, mem_ctx);
6607         TALLOC_FREE(subreq);
6608         if (!NT_STATUS_IS_OK(status)) {
6609                 tevent_req_nterror(req, status);
6610                 return;
6611         }
6612
6613         /* Copy out parameters */
6614
6615         /* Copy result */
6616         state->orig.out.result = state->tmp.out.result;
6617
6618         /* Reset temporary structure */
6619         ZERO_STRUCT(state->tmp);
6620
6621         if (DEBUGLEVEL >= 10) {
6622                 NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &state->orig);
6623         }
6624
6625         tevent_req_done(req);
6626 }
6627
6628 NTSTATUS rpccli_PNP_AddEmptyLogConf_recv(struct tevent_req *req,
6629                                          TALLOC_CTX *mem_ctx,
6630                                          WERROR *result)
6631 {
6632         struct rpccli_PNP_AddEmptyLogConf_state *state = tevent_req_data(
6633                 req, struct rpccli_PNP_AddEmptyLogConf_state);
6634         NTSTATUS status;
6635
6636         if (tevent_req_is_nterror(req, &status)) {
6637                 tevent_req_received(req);
6638                 return status;
6639         }
6640
6641         /* Steal possbile out parameters to the callers context */
6642         talloc_steal(mem_ctx, state->out_mem_ctx);
6643
6644         /* Return result */
6645         *result = state->orig.out.result;
6646
6647         tevent_req_received(req);
6648         return NT_STATUS_OK;
6649 }
6650
6651 NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli,
6652                                     TALLOC_CTX *mem_ctx,
6653                                     WERROR *werror)
6654 {
6655         struct PNP_AddEmptyLogConf r;
6656         NTSTATUS status;
6657
6658         /* In parameters */
6659
6660         if (DEBUGLEVEL >= 10) {
6661                 NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &r);
6662         }
6663
6664         status = cli->dispatch(cli,
6665                                 mem_ctx,
6666                                 &ndr_table_ntsvcs,
6667                                 NDR_PNP_ADDEMPTYLOGCONF,
6668                                 &r);
6669
6670         if (!NT_STATUS_IS_OK(status)) {
6671                 return status;
6672         }
6673
6674         if (DEBUGLEVEL >= 10) {
6675                 NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &r);
6676         }
6677
6678         if (NT_STATUS_IS_ERR(status)) {
6679                 return status;
6680         }
6681
6682         /* Return variables */
6683
6684         /* Return result */
6685         if (werror) {
6686                 *werror = r.out.result;
6687         }
6688
6689         return werror_to_ntstatus(r.out.result);
6690 }
6691
6692 struct rpccli_PNP_FreeLogConf_state {
6693         struct PNP_FreeLogConf orig;
6694         struct PNP_FreeLogConf tmp;
6695         TALLOC_CTX *out_mem_ctx;
6696         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6697 };
6698
6699 static void rpccli_PNP_FreeLogConf_done(struct tevent_req *subreq);
6700
6701 struct tevent_req *rpccli_PNP_FreeLogConf_send(TALLOC_CTX *mem_ctx,
6702                                                struct tevent_context *ev,
6703                                                struct rpc_pipe_client *cli)
6704 {
6705         struct tevent_req *req;
6706         struct rpccli_PNP_FreeLogConf_state *state;
6707         struct tevent_req *subreq;
6708
6709         req = tevent_req_create(mem_ctx, &state,
6710                                 struct rpccli_PNP_FreeLogConf_state);
6711         if (req == NULL) {
6712                 return NULL;
6713         }
6714         state->out_mem_ctx = NULL;
6715         state->dispatch_recv = cli->dispatch_recv;
6716
6717         /* In parameters */
6718
6719         /* Out parameters */
6720
6721         /* Result */
6722         ZERO_STRUCT(state->orig.out.result);
6723
6724         if (DEBUGLEVEL >= 10) {
6725                 NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &state->orig);
6726         }
6727
6728         /* make a temporary copy, that we pass to the dispatch function */
6729         state->tmp = state->orig;
6730
6731         subreq = cli->dispatch_send(state, ev, cli,
6732                                     &ndr_table_ntsvcs,
6733                                     NDR_PNP_FREELOGCONF,
6734                                     &state->tmp);
6735         if (tevent_req_nomem(subreq, req)) {
6736                 return tevent_req_post(req, ev);
6737         }
6738         tevent_req_set_callback(subreq, rpccli_PNP_FreeLogConf_done, req);
6739         return req;
6740 }
6741
6742 static void rpccli_PNP_FreeLogConf_done(struct tevent_req *subreq)
6743 {
6744         struct tevent_req *req = tevent_req_callback_data(
6745                 subreq, struct tevent_req);
6746         struct rpccli_PNP_FreeLogConf_state *state = tevent_req_data(
6747                 req, struct rpccli_PNP_FreeLogConf_state);
6748         NTSTATUS status;
6749         TALLOC_CTX *mem_ctx;
6750
6751         if (state->out_mem_ctx) {
6752                 mem_ctx = state->out_mem_ctx;
6753         } else {
6754                 mem_ctx = state;
6755         }
6756
6757         status = state->dispatch_recv(subreq, mem_ctx);
6758         TALLOC_FREE(subreq);
6759         if (!NT_STATUS_IS_OK(status)) {
6760                 tevent_req_nterror(req, status);
6761                 return;
6762         }
6763
6764         /* Copy out parameters */
6765
6766         /* Copy result */
6767         state->orig.out.result = state->tmp.out.result;
6768
6769         /* Reset temporary structure */
6770         ZERO_STRUCT(state->tmp);
6771
6772         if (DEBUGLEVEL >= 10) {
6773                 NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &state->orig);
6774         }
6775
6776         tevent_req_done(req);
6777 }
6778
6779 NTSTATUS rpccli_PNP_FreeLogConf_recv(struct tevent_req *req,
6780                                      TALLOC_CTX *mem_ctx,
6781                                      WERROR *result)
6782 {
6783         struct rpccli_PNP_FreeLogConf_state *state = tevent_req_data(
6784                 req, struct rpccli_PNP_FreeLogConf_state);
6785         NTSTATUS status;
6786
6787         if (tevent_req_is_nterror(req, &status)) {
6788                 tevent_req_received(req);
6789                 return status;
6790         }
6791
6792         /* Steal possbile out parameters to the callers context */
6793         talloc_steal(mem_ctx, state->out_mem_ctx);
6794
6795         /* Return result */
6796         *result = state->orig.out.result;
6797
6798         tevent_req_received(req);
6799         return NT_STATUS_OK;
6800 }
6801
6802 NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli,
6803                                 TALLOC_CTX *mem_ctx,
6804                                 WERROR *werror)
6805 {
6806         struct PNP_FreeLogConf r;
6807         NTSTATUS status;
6808
6809         /* In parameters */
6810
6811         if (DEBUGLEVEL >= 10) {
6812                 NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &r);
6813         }
6814
6815         status = cli->dispatch(cli,
6816                                 mem_ctx,
6817                                 &ndr_table_ntsvcs,
6818                                 NDR_PNP_FREELOGCONF,
6819                                 &r);
6820
6821         if (!NT_STATUS_IS_OK(status)) {
6822                 return status;
6823         }
6824
6825         if (DEBUGLEVEL >= 10) {
6826                 NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &r);
6827         }
6828
6829         if (NT_STATUS_IS_ERR(status)) {
6830                 return status;
6831         }
6832
6833         /* Return variables */
6834
6835         /* Return result */
6836         if (werror) {
6837                 *werror = r.out.result;
6838         }
6839
6840         return werror_to_ntstatus(r.out.result);
6841 }
6842
6843 struct rpccli_PNP_GetFirstLogConf_state {
6844         struct PNP_GetFirstLogConf orig;
6845         struct PNP_GetFirstLogConf tmp;
6846         TALLOC_CTX *out_mem_ctx;
6847         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6848 };
6849
6850 static void rpccli_PNP_GetFirstLogConf_done(struct tevent_req *subreq);
6851
6852 struct tevent_req *rpccli_PNP_GetFirstLogConf_send(TALLOC_CTX *mem_ctx,
6853                                                    struct tevent_context *ev,
6854                                                    struct rpc_pipe_client *cli)
6855 {
6856         struct tevent_req *req;
6857         struct rpccli_PNP_GetFirstLogConf_state *state;
6858         struct tevent_req *subreq;
6859
6860         req = tevent_req_create(mem_ctx, &state,
6861                                 struct rpccli_PNP_GetFirstLogConf_state);
6862         if (req == NULL) {
6863                 return NULL;
6864         }
6865         state->out_mem_ctx = NULL;
6866         state->dispatch_recv = cli->dispatch_recv;
6867
6868         /* In parameters */
6869
6870         /* Out parameters */
6871
6872         /* Result */
6873         ZERO_STRUCT(state->orig.out.result);
6874
6875         if (DEBUGLEVEL >= 10) {
6876                 NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &state->orig);
6877         }
6878
6879         /* make a temporary copy, that we pass to the dispatch function */
6880         state->tmp = state->orig;
6881
6882         subreq = cli->dispatch_send(state, ev, cli,
6883                                     &ndr_table_ntsvcs,
6884                                     NDR_PNP_GETFIRSTLOGCONF,
6885                                     &state->tmp);
6886         if (tevent_req_nomem(subreq, req)) {
6887                 return tevent_req_post(req, ev);
6888         }
6889         tevent_req_set_callback(subreq, rpccli_PNP_GetFirstLogConf_done, req);
6890         return req;
6891 }
6892
6893 static void rpccli_PNP_GetFirstLogConf_done(struct tevent_req *subreq)
6894 {
6895         struct tevent_req *req = tevent_req_callback_data(
6896                 subreq, struct tevent_req);
6897         struct rpccli_PNP_GetFirstLogConf_state *state = tevent_req_data(
6898                 req, struct rpccli_PNP_GetFirstLogConf_state);
6899         NTSTATUS status;
6900         TALLOC_CTX *mem_ctx;
6901
6902         if (state->out_mem_ctx) {
6903                 mem_ctx = state->out_mem_ctx;
6904         } else {
6905                 mem_ctx = state;
6906         }
6907
6908         status = state->dispatch_recv(subreq, mem_ctx);
6909         TALLOC_FREE(subreq);
6910         if (!NT_STATUS_IS_OK(status)) {
6911                 tevent_req_nterror(req, status);
6912                 return;
6913         }
6914
6915         /* Copy out parameters */
6916
6917         /* Copy result */
6918         state->orig.out.result = state->tmp.out.result;
6919
6920         /* Reset temporary structure */
6921         ZERO_STRUCT(state->tmp);
6922
6923         if (DEBUGLEVEL >= 10) {
6924                 NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &state->orig);
6925         }
6926
6927         tevent_req_done(req);
6928 }
6929
6930 NTSTATUS rpccli_PNP_GetFirstLogConf_recv(struct tevent_req *req,
6931                                          TALLOC_CTX *mem_ctx,
6932                                          WERROR *result)
6933 {
6934         struct rpccli_PNP_GetFirstLogConf_state *state = tevent_req_data(
6935                 req, struct rpccli_PNP_GetFirstLogConf_state);
6936         NTSTATUS status;
6937
6938         if (tevent_req_is_nterror(req, &status)) {
6939                 tevent_req_received(req);
6940                 return status;
6941         }
6942
6943         /* Steal possbile out parameters to the callers context */
6944         talloc_steal(mem_ctx, state->out_mem_ctx);
6945
6946         /* Return result */
6947         *result = state->orig.out.result;
6948
6949         tevent_req_received(req);
6950         return NT_STATUS_OK;
6951 }
6952
6953 NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli,
6954                                     TALLOC_CTX *mem_ctx,
6955                                     WERROR *werror)
6956 {
6957         struct PNP_GetFirstLogConf r;
6958         NTSTATUS status;
6959
6960         /* In parameters */
6961
6962         if (DEBUGLEVEL >= 10) {
6963                 NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &r);
6964         }
6965
6966         status = cli->dispatch(cli,
6967                                 mem_ctx,
6968                                 &ndr_table_ntsvcs,
6969                                 NDR_PNP_GETFIRSTLOGCONF,
6970                                 &r);
6971
6972         if (!NT_STATUS_IS_OK(status)) {
6973                 return status;
6974         }
6975
6976         if (DEBUGLEVEL >= 10) {
6977                 NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &r);
6978         }
6979
6980         if (NT_STATUS_IS_ERR(status)) {
6981                 return status;
6982         }
6983
6984         /* Return variables */
6985
6986         /* Return result */
6987         if (werror) {
6988                 *werror = r.out.result;
6989         }
6990
6991         return werror_to_ntstatus(r.out.result);
6992 }
6993
6994 struct rpccli_PNP_GetNextLogConf_state {
6995         struct PNP_GetNextLogConf orig;
6996         struct PNP_GetNextLogConf tmp;
6997         TALLOC_CTX *out_mem_ctx;
6998         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6999 };
7000
7001 static void rpccli_PNP_GetNextLogConf_done(struct tevent_req *subreq);
7002
7003 struct tevent_req *rpccli_PNP_GetNextLogConf_send(TALLOC_CTX *mem_ctx,
7004                                                   struct tevent_context *ev,
7005                                                   struct rpc_pipe_client *cli)
7006 {
7007         struct tevent_req *req;
7008         struct rpccli_PNP_GetNextLogConf_state *state;
7009         struct tevent_req *subreq;
7010
7011         req = tevent_req_create(mem_ctx, &state,
7012                                 struct rpccli_PNP_GetNextLogConf_state);
7013         if (req == NULL) {
7014                 return NULL;
7015         }
7016         state->out_mem_ctx = NULL;
7017         state->dispatch_recv = cli->dispatch_recv;
7018
7019         /* In parameters */
7020
7021         /* Out parameters */
7022
7023         /* Result */
7024         ZERO_STRUCT(state->orig.out.result);
7025
7026         if (DEBUGLEVEL >= 10) {
7027                 NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &state->orig);
7028         }
7029
7030         /* make a temporary copy, that we pass to the dispatch function */
7031         state->tmp = state->orig;
7032
7033         subreq = cli->dispatch_send(state, ev, cli,
7034                                     &ndr_table_ntsvcs,
7035                                     NDR_PNP_GETNEXTLOGCONF,
7036                                     &state->tmp);
7037         if (tevent_req_nomem(subreq, req)) {
7038                 return tevent_req_post(req, ev);
7039         }
7040         tevent_req_set_callback(subreq, rpccli_PNP_GetNextLogConf_done, req);
7041         return req;
7042 }
7043
7044 static void rpccli_PNP_GetNextLogConf_done(struct tevent_req *subreq)
7045 {
7046         struct tevent_req *req = tevent_req_callback_data(
7047                 subreq, struct tevent_req);
7048         struct rpccli_PNP_GetNextLogConf_state *state = tevent_req_data(
7049                 req, struct rpccli_PNP_GetNextLogConf_state);
7050         NTSTATUS status;
7051         TALLOC_CTX *mem_ctx;
7052
7053         if (state->out_mem_ctx) {
7054                 mem_ctx = state->out_mem_ctx;
7055         } else {
7056                 mem_ctx = state;
7057         }
7058
7059         status = state->dispatch_recv(subreq, mem_ctx);
7060         TALLOC_FREE(subreq);
7061         if (!NT_STATUS_IS_OK(status)) {
7062                 tevent_req_nterror(req, status);
7063                 return;
7064         }
7065
7066         /* Copy out parameters */
7067
7068         /* Copy result */
7069         state->orig.out.result = state->tmp.out.result;
7070
7071         /* Reset temporary structure */
7072         ZERO_STRUCT(state->tmp);
7073
7074         if (DEBUGLEVEL >= 10) {
7075                 NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &state->orig);
7076         }
7077
7078         tevent_req_done(req);
7079 }
7080
7081 NTSTATUS rpccli_PNP_GetNextLogConf_recv(struct tevent_req *req,
7082                                         TALLOC_CTX *mem_ctx,
7083                                         WERROR *result)
7084 {
7085         struct rpccli_PNP_GetNextLogConf_state *state = tevent_req_data(
7086                 req, struct rpccli_PNP_GetNextLogConf_state);
7087         NTSTATUS status;
7088
7089         if (tevent_req_is_nterror(req, &status)) {
7090                 tevent_req_received(req);
7091                 return status;
7092         }
7093
7094         /* Steal possbile out parameters to the callers context */
7095         talloc_steal(mem_ctx, state->out_mem_ctx);
7096
7097         /* Return result */
7098         *result = state->orig.out.result;
7099
7100         tevent_req_received(req);
7101         return NT_STATUS_OK;
7102 }
7103
7104 NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli,
7105                                    TALLOC_CTX *mem_ctx,
7106                                    WERROR *werror)
7107 {
7108         struct PNP_GetNextLogConf r;
7109         NTSTATUS status;
7110
7111         /* In parameters */
7112
7113         if (DEBUGLEVEL >= 10) {
7114                 NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &r);
7115         }
7116
7117         status = cli->dispatch(cli,
7118                                 mem_ctx,
7119                                 &ndr_table_ntsvcs,
7120                                 NDR_PNP_GETNEXTLOGCONF,
7121                                 &r);
7122
7123         if (!NT_STATUS_IS_OK(status)) {
7124                 return status;
7125         }
7126
7127         if (DEBUGLEVEL >= 10) {
7128                 NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &r);
7129         }
7130
7131         if (NT_STATUS_IS_ERR(status)) {
7132                 return status;
7133         }
7134
7135         /* Return variables */
7136
7137         /* Return result */
7138         if (werror) {
7139                 *werror = r.out.result;
7140         }
7141
7142         return werror_to_ntstatus(r.out.result);
7143 }
7144
7145 struct rpccli_PNP_GetLogConfPriority_state {
7146         struct PNP_GetLogConfPriority orig;
7147         struct PNP_GetLogConfPriority tmp;
7148         TALLOC_CTX *out_mem_ctx;
7149         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7150 };
7151
7152 static void rpccli_PNP_GetLogConfPriority_done(struct tevent_req *subreq);
7153
7154 struct tevent_req *rpccli_PNP_GetLogConfPriority_send(TALLOC_CTX *mem_ctx,
7155                                                       struct tevent_context *ev,
7156                                                       struct rpc_pipe_client *cli)
7157 {
7158         struct tevent_req *req;
7159         struct rpccli_PNP_GetLogConfPriority_state *state;
7160         struct tevent_req *subreq;
7161
7162         req = tevent_req_create(mem_ctx, &state,
7163                                 struct rpccli_PNP_GetLogConfPriority_state);
7164         if (req == NULL) {
7165                 return NULL;
7166         }
7167         state->out_mem_ctx = NULL;
7168         state->dispatch_recv = cli->dispatch_recv;
7169
7170         /* In parameters */
7171
7172         /* Out parameters */
7173
7174         /* Result */
7175         ZERO_STRUCT(state->orig.out.result);
7176
7177         if (DEBUGLEVEL >= 10) {
7178                 NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &state->orig);
7179         }
7180
7181         /* make a temporary copy, that we pass to the dispatch function */
7182         state->tmp = state->orig;
7183
7184         subreq = cli->dispatch_send(state, ev, cli,
7185                                     &ndr_table_ntsvcs,
7186                                     NDR_PNP_GETLOGCONFPRIORITY,
7187                                     &state->tmp);
7188         if (tevent_req_nomem(subreq, req)) {
7189                 return tevent_req_post(req, ev);
7190         }
7191         tevent_req_set_callback(subreq, rpccli_PNP_GetLogConfPriority_done, req);
7192         return req;
7193 }
7194
7195 static void rpccli_PNP_GetLogConfPriority_done(struct tevent_req *subreq)
7196 {
7197         struct tevent_req *req = tevent_req_callback_data(
7198                 subreq, struct tevent_req);
7199         struct rpccli_PNP_GetLogConfPriority_state *state = tevent_req_data(
7200                 req, struct rpccli_PNP_GetLogConfPriority_state);
7201         NTSTATUS status;
7202         TALLOC_CTX *mem_ctx;
7203
7204         if (state->out_mem_ctx) {
7205                 mem_ctx = state->out_mem_ctx;
7206         } else {
7207                 mem_ctx = state;
7208         }
7209
7210         status = state->dispatch_recv(subreq, mem_ctx);
7211         TALLOC_FREE(subreq);
7212         if (!NT_STATUS_IS_OK(status)) {
7213                 tevent_req_nterror(req, status);
7214                 return;
7215         }
7216
7217         /* Copy out parameters */
7218
7219         /* Copy result */
7220         state->orig.out.result = state->tmp.out.result;
7221
7222         /* Reset temporary structure */
7223         ZERO_STRUCT(state->tmp);
7224
7225         if (DEBUGLEVEL >= 10) {
7226                 NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &state->orig);
7227         }
7228
7229         tevent_req_done(req);
7230 }
7231
7232 NTSTATUS rpccli_PNP_GetLogConfPriority_recv(struct tevent_req *req,
7233                                             TALLOC_CTX *mem_ctx,
7234                                             WERROR *result)
7235 {
7236         struct rpccli_PNP_GetLogConfPriority_state *state = tevent_req_data(
7237                 req, struct rpccli_PNP_GetLogConfPriority_state);
7238         NTSTATUS status;
7239
7240         if (tevent_req_is_nterror(req, &status)) {
7241                 tevent_req_received(req);
7242                 return status;
7243         }
7244
7245         /* Steal possbile out parameters to the callers context */
7246         talloc_steal(mem_ctx, state->out_mem_ctx);
7247
7248         /* Return result */
7249         *result = state->orig.out.result;
7250
7251         tevent_req_received(req);
7252         return NT_STATUS_OK;
7253 }
7254
7255 NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli,
7256                                        TALLOC_CTX *mem_ctx,
7257                                        WERROR *werror)
7258 {
7259         struct PNP_GetLogConfPriority r;
7260         NTSTATUS status;
7261
7262         /* In parameters */
7263
7264         if (DEBUGLEVEL >= 10) {
7265                 NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &r);
7266         }
7267
7268         status = cli->dispatch(cli,
7269                                 mem_ctx,
7270                                 &ndr_table_ntsvcs,
7271                                 NDR_PNP_GETLOGCONFPRIORITY,
7272                                 &r);
7273
7274         if (!NT_STATUS_IS_OK(status)) {
7275                 return status;
7276         }
7277
7278         if (DEBUGLEVEL >= 10) {
7279                 NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &r);
7280         }
7281
7282         if (NT_STATUS_IS_ERR(status)) {
7283                 return status;
7284         }
7285
7286         /* Return variables */
7287
7288         /* Return result */
7289         if (werror) {
7290                 *werror = r.out.result;
7291         }
7292
7293         return werror_to_ntstatus(r.out.result);
7294 }
7295
7296 struct rpccli_PNP_AddResDes_state {
7297         struct PNP_AddResDes orig;
7298         struct PNP_AddResDes tmp;
7299         TALLOC_CTX *out_mem_ctx;
7300         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7301 };
7302
7303 static void rpccli_PNP_AddResDes_done(struct tevent_req *subreq);
7304
7305 struct tevent_req *rpccli_PNP_AddResDes_send(TALLOC_CTX *mem_ctx,
7306                                              struct tevent_context *ev,
7307                                              struct rpc_pipe_client *cli)
7308 {
7309         struct tevent_req *req;
7310         struct rpccli_PNP_AddResDes_state *state;
7311         struct tevent_req *subreq;
7312
7313         req = tevent_req_create(mem_ctx, &state,
7314                                 struct rpccli_PNP_AddResDes_state);
7315         if (req == NULL) {
7316                 return NULL;
7317         }
7318         state->out_mem_ctx = NULL;
7319         state->dispatch_recv = cli->dispatch_recv;
7320
7321         /* In parameters */
7322
7323         /* Out parameters */
7324
7325         /* Result */
7326         ZERO_STRUCT(state->orig.out.result);
7327
7328         if (DEBUGLEVEL >= 10) {
7329                 NDR_PRINT_IN_DEBUG(PNP_AddResDes, &state->orig);
7330         }
7331
7332         /* make a temporary copy, that we pass to the dispatch function */
7333         state->tmp = state->orig;
7334
7335         subreq = cli->dispatch_send(state, ev, cli,
7336                                     &ndr_table_ntsvcs,
7337                                     NDR_PNP_ADDRESDES,
7338                                     &state->tmp);
7339         if (tevent_req_nomem(subreq, req)) {
7340                 return tevent_req_post(req, ev);
7341         }
7342         tevent_req_set_callback(subreq, rpccli_PNP_AddResDes_done, req);
7343         return req;
7344 }
7345
7346 static void rpccli_PNP_AddResDes_done(struct tevent_req *subreq)
7347 {
7348         struct tevent_req *req = tevent_req_callback_data(
7349                 subreq, struct tevent_req);
7350         struct rpccli_PNP_AddResDes_state *state = tevent_req_data(
7351                 req, struct rpccli_PNP_AddResDes_state);
7352         NTSTATUS status;
7353         TALLOC_CTX *mem_ctx;
7354
7355         if (state->out_mem_ctx) {
7356                 mem_ctx = state->out_mem_ctx;
7357         } else {
7358                 mem_ctx = state;
7359         }
7360
7361         status = state->dispatch_recv(subreq, mem_ctx);
7362         TALLOC_FREE(subreq);
7363         if (!NT_STATUS_IS_OK(status)) {
7364                 tevent_req_nterror(req, status);
7365                 return;
7366         }
7367
7368         /* Copy out parameters */
7369
7370         /* Copy result */
7371         state->orig.out.result = state->tmp.out.result;
7372
7373         /* Reset temporary structure */
7374         ZERO_STRUCT(state->tmp);
7375
7376         if (DEBUGLEVEL >= 10) {
7377                 NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &state->orig);
7378         }
7379
7380         tevent_req_done(req);
7381 }
7382
7383 NTSTATUS rpccli_PNP_AddResDes_recv(struct tevent_req *req,
7384                                    TALLOC_CTX *mem_ctx,
7385                                    WERROR *result)
7386 {
7387         struct rpccli_PNP_AddResDes_state *state = tevent_req_data(
7388                 req, struct rpccli_PNP_AddResDes_state);
7389         NTSTATUS status;
7390
7391         if (tevent_req_is_nterror(req, &status)) {
7392                 tevent_req_received(req);
7393                 return status;
7394         }
7395
7396         /* Steal possbile out parameters to the callers context */
7397         talloc_steal(mem_ctx, state->out_mem_ctx);
7398
7399         /* Return result */
7400         *result = state->orig.out.result;
7401
7402         tevent_req_received(req);
7403         return NT_STATUS_OK;
7404 }
7405
7406 NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli,
7407                               TALLOC_CTX *mem_ctx,
7408                               WERROR *werror)
7409 {
7410         struct PNP_AddResDes r;
7411         NTSTATUS status;
7412
7413         /* In parameters */
7414
7415         if (DEBUGLEVEL >= 10) {
7416                 NDR_PRINT_IN_DEBUG(PNP_AddResDes, &r);
7417         }
7418
7419         status = cli->dispatch(cli,
7420                                 mem_ctx,
7421                                 &ndr_table_ntsvcs,
7422                                 NDR_PNP_ADDRESDES,
7423                                 &r);
7424
7425         if (!NT_STATUS_IS_OK(status)) {
7426                 return status;
7427         }
7428
7429         if (DEBUGLEVEL >= 10) {
7430                 NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &r);
7431         }
7432
7433         if (NT_STATUS_IS_ERR(status)) {
7434                 return status;
7435         }
7436
7437         /* Return variables */
7438
7439         /* Return result */
7440         if (werror) {
7441                 *werror = r.out.result;
7442         }
7443
7444         return werror_to_ntstatus(r.out.result);
7445 }
7446
7447 struct rpccli_PNP_FreeResDes_state {
7448         struct PNP_FreeResDes orig;
7449         struct PNP_FreeResDes tmp;
7450         TALLOC_CTX *out_mem_ctx;
7451         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7452 };
7453
7454 static void rpccli_PNP_FreeResDes_done(struct tevent_req *subreq);
7455
7456 struct tevent_req *rpccli_PNP_FreeResDes_send(TALLOC_CTX *mem_ctx,
7457                                               struct tevent_context *ev,
7458                                               struct rpc_pipe_client *cli)
7459 {
7460         struct tevent_req *req;
7461         struct rpccli_PNP_FreeResDes_state *state;
7462         struct tevent_req *subreq;
7463
7464         req = tevent_req_create(mem_ctx, &state,
7465                                 struct rpccli_PNP_FreeResDes_state);
7466         if (req == NULL) {
7467                 return NULL;
7468         }
7469         state->out_mem_ctx = NULL;
7470         state->dispatch_recv = cli->dispatch_recv;
7471
7472         /* In parameters */
7473
7474         /* Out parameters */
7475
7476         /* Result */
7477         ZERO_STRUCT(state->orig.out.result);
7478
7479         if (DEBUGLEVEL >= 10) {
7480                 NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &state->orig);
7481         }
7482
7483         /* make a temporary copy, that we pass to the dispatch function */
7484         state->tmp = state->orig;
7485
7486         subreq = cli->dispatch_send(state, ev, cli,
7487                                     &ndr_table_ntsvcs,
7488                                     NDR_PNP_FREERESDES,
7489                                     &state->tmp);
7490         if (tevent_req_nomem(subreq, req)) {
7491                 return tevent_req_post(req, ev);
7492         }
7493         tevent_req_set_callback(subreq, rpccli_PNP_FreeResDes_done, req);
7494         return req;
7495 }
7496
7497 static void rpccli_PNP_FreeResDes_done(struct tevent_req *subreq)
7498 {
7499         struct tevent_req *req = tevent_req_callback_data(
7500                 subreq, struct tevent_req);
7501         struct rpccli_PNP_FreeResDes_state *state = tevent_req_data(
7502                 req, struct rpccli_PNP_FreeResDes_state);
7503         NTSTATUS status;
7504         TALLOC_CTX *mem_ctx;
7505
7506         if (state->out_mem_ctx) {
7507                 mem_ctx = state->out_mem_ctx;
7508         } else {
7509                 mem_ctx = state;
7510         }
7511
7512         status = state->dispatch_recv(subreq, mem_ctx);
7513         TALLOC_FREE(subreq);
7514         if (!NT_STATUS_IS_OK(status)) {
7515                 tevent_req_nterror(req, status);
7516                 return;
7517         }
7518
7519         /* Copy out parameters */
7520
7521         /* Copy result */
7522         state->orig.out.result = state->tmp.out.result;
7523
7524         /* Reset temporary structure */
7525         ZERO_STRUCT(state->tmp);
7526
7527         if (DEBUGLEVEL >= 10) {
7528                 NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &state->orig);
7529         }
7530
7531         tevent_req_done(req);
7532 }
7533
7534 NTSTATUS rpccli_PNP_FreeResDes_recv(struct tevent_req *req,
7535                                     TALLOC_CTX *mem_ctx,
7536                                     WERROR *result)
7537 {
7538         struct rpccli_PNP_FreeResDes_state *state = tevent_req_data(
7539                 req, struct rpccli_PNP_FreeResDes_state);
7540         NTSTATUS status;
7541
7542         if (tevent_req_is_nterror(req, &status)) {
7543                 tevent_req_received(req);
7544                 return status;
7545         }
7546
7547         /* Steal possbile out parameters to the callers context */
7548         talloc_steal(mem_ctx, state->out_mem_ctx);
7549
7550         /* Return result */
7551         *result = state->orig.out.result;
7552
7553         tevent_req_received(req);
7554         return NT_STATUS_OK;
7555 }
7556
7557 NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli,
7558                                TALLOC_CTX *mem_ctx,
7559                                WERROR *werror)
7560 {
7561         struct PNP_FreeResDes r;
7562         NTSTATUS status;
7563
7564         /* In parameters */
7565
7566         if (DEBUGLEVEL >= 10) {
7567                 NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &r);
7568         }
7569
7570         status = cli->dispatch(cli,
7571                                 mem_ctx,
7572                                 &ndr_table_ntsvcs,
7573                                 NDR_PNP_FREERESDES,
7574                                 &r);
7575
7576         if (!NT_STATUS_IS_OK(status)) {
7577                 return status;
7578         }
7579
7580         if (DEBUGLEVEL >= 10) {
7581                 NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &r);
7582         }
7583
7584         if (NT_STATUS_IS_ERR(status)) {
7585                 return status;
7586         }
7587
7588         /* Return variables */
7589
7590         /* Return result */
7591         if (werror) {
7592                 *werror = r.out.result;
7593         }
7594
7595         return werror_to_ntstatus(r.out.result);
7596 }
7597
7598 struct rpccli_PNP_GetNextResDes_state {
7599         struct PNP_GetNextResDes orig;
7600         struct PNP_GetNextResDes tmp;
7601         TALLOC_CTX *out_mem_ctx;
7602         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7603 };
7604
7605 static void rpccli_PNP_GetNextResDes_done(struct tevent_req *subreq);
7606
7607 struct tevent_req *rpccli_PNP_GetNextResDes_send(TALLOC_CTX *mem_ctx,
7608                                                  struct tevent_context *ev,
7609                                                  struct rpc_pipe_client *cli)
7610 {
7611         struct tevent_req *req;
7612         struct rpccli_PNP_GetNextResDes_state *state;
7613         struct tevent_req *subreq;
7614
7615         req = tevent_req_create(mem_ctx, &state,
7616                                 struct rpccli_PNP_GetNextResDes_state);
7617         if (req == NULL) {
7618                 return NULL;
7619         }
7620         state->out_mem_ctx = NULL;
7621         state->dispatch_recv = cli->dispatch_recv;
7622
7623         /* In parameters */
7624
7625         /* Out parameters */
7626
7627         /* Result */
7628         ZERO_STRUCT(state->orig.out.result);
7629
7630         if (DEBUGLEVEL >= 10) {
7631                 NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &state->orig);
7632         }
7633
7634         /* make a temporary copy, that we pass to the dispatch function */
7635         state->tmp = state->orig;
7636
7637         subreq = cli->dispatch_send(state, ev, cli,
7638                                     &ndr_table_ntsvcs,
7639                                     NDR_PNP_GETNEXTRESDES,
7640                                     &state->tmp);
7641         if (tevent_req_nomem(subreq, req)) {
7642                 return tevent_req_post(req, ev);
7643         }
7644         tevent_req_set_callback(subreq, rpccli_PNP_GetNextResDes_done, req);
7645         return req;
7646 }
7647
7648 static void rpccli_PNP_GetNextResDes_done(struct tevent_req *subreq)
7649 {
7650         struct tevent_req *req = tevent_req_callback_data(
7651                 subreq, struct tevent_req);
7652         struct rpccli_PNP_GetNextResDes_state *state = tevent_req_data(
7653                 req, struct rpccli_PNP_GetNextResDes_state);
7654         NTSTATUS status;
7655         TALLOC_CTX *mem_ctx;
7656
7657         if (state->out_mem_ctx) {
7658                 mem_ctx = state->out_mem_ctx;
7659         } else {
7660                 mem_ctx = state;
7661         }
7662
7663         status = state->dispatch_recv(subreq, mem_ctx);
7664         TALLOC_FREE(subreq);
7665         if (!NT_STATUS_IS_OK(status)) {
7666                 tevent_req_nterror(req, status);
7667                 return;
7668         }
7669
7670         /* Copy out parameters */
7671
7672         /* Copy result */
7673         state->orig.out.result = state->tmp.out.result;
7674
7675         /* Reset temporary structure */
7676         ZERO_STRUCT(state->tmp);
7677
7678         if (DEBUGLEVEL >= 10) {
7679                 NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &state->orig);
7680         }
7681
7682         tevent_req_done(req);
7683 }
7684
7685 NTSTATUS rpccli_PNP_GetNextResDes_recv(struct tevent_req *req,
7686                                        TALLOC_CTX *mem_ctx,
7687                                        WERROR *result)
7688 {
7689         struct rpccli_PNP_GetNextResDes_state *state = tevent_req_data(
7690                 req, struct rpccli_PNP_GetNextResDes_state);
7691         NTSTATUS status;
7692
7693         if (tevent_req_is_nterror(req, &status)) {
7694                 tevent_req_received(req);
7695                 return status;
7696         }
7697
7698         /* Steal possbile out parameters to the callers context */
7699         talloc_steal(mem_ctx, state->out_mem_ctx);
7700
7701         /* Return result */
7702         *result = state->orig.out.result;
7703
7704         tevent_req_received(req);
7705         return NT_STATUS_OK;
7706 }
7707
7708 NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli,
7709                                   TALLOC_CTX *mem_ctx,
7710                                   WERROR *werror)
7711 {
7712         struct PNP_GetNextResDes r;
7713         NTSTATUS status;
7714
7715         /* In parameters */
7716
7717         if (DEBUGLEVEL >= 10) {
7718                 NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &r);
7719         }
7720
7721         status = cli->dispatch(cli,
7722                                 mem_ctx,
7723                                 &ndr_table_ntsvcs,
7724                                 NDR_PNP_GETNEXTRESDES,
7725                                 &r);
7726
7727         if (!NT_STATUS_IS_OK(status)) {
7728                 return status;
7729         }
7730
7731         if (DEBUGLEVEL >= 10) {
7732                 NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &r);
7733         }
7734
7735         if (NT_STATUS_IS_ERR(status)) {
7736                 return status;
7737         }
7738
7739         /* Return variables */
7740
7741         /* Return result */
7742         if (werror) {
7743                 *werror = r.out.result;
7744         }
7745
7746         return werror_to_ntstatus(r.out.result);
7747 }
7748
7749 struct rpccli_PNP_GetResDesData_state {
7750         struct PNP_GetResDesData orig;
7751         struct PNP_GetResDesData tmp;
7752         TALLOC_CTX *out_mem_ctx;
7753         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7754 };
7755
7756 static void rpccli_PNP_GetResDesData_done(struct tevent_req *subreq);
7757
7758 struct tevent_req *rpccli_PNP_GetResDesData_send(TALLOC_CTX *mem_ctx,
7759                                                  struct tevent_context *ev,
7760                                                  struct rpc_pipe_client *cli)
7761 {
7762         struct tevent_req *req;
7763         struct rpccli_PNP_GetResDesData_state *state;
7764         struct tevent_req *subreq;
7765
7766         req = tevent_req_create(mem_ctx, &state,
7767                                 struct rpccli_PNP_GetResDesData_state);
7768         if (req == NULL) {
7769                 return NULL;
7770         }
7771         state->out_mem_ctx = NULL;
7772         state->dispatch_recv = cli->dispatch_recv;
7773
7774         /* In parameters */
7775
7776         /* Out parameters */
7777
7778         /* Result */
7779         ZERO_STRUCT(state->orig.out.result);
7780
7781         if (DEBUGLEVEL >= 10) {
7782                 NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &state->orig);
7783         }
7784
7785         /* make a temporary copy, that we pass to the dispatch function */
7786         state->tmp = state->orig;
7787
7788         subreq = cli->dispatch_send(state, ev, cli,
7789                                     &ndr_table_ntsvcs,
7790                                     NDR_PNP_GETRESDESDATA,
7791                                     &state->tmp);
7792         if (tevent_req_nomem(subreq, req)) {
7793                 return tevent_req_post(req, ev);
7794         }
7795         tevent_req_set_callback(subreq, rpccli_PNP_GetResDesData_done, req);
7796         return req;
7797 }
7798
7799 static void rpccli_PNP_GetResDesData_done(struct tevent_req *subreq)
7800 {
7801         struct tevent_req *req = tevent_req_callback_data(
7802                 subreq, struct tevent_req);
7803         struct rpccli_PNP_GetResDesData_state *state = tevent_req_data(
7804                 req, struct rpccli_PNP_GetResDesData_state);
7805         NTSTATUS status;
7806         TALLOC_CTX *mem_ctx;
7807
7808         if (state->out_mem_ctx) {
7809                 mem_ctx = state->out_mem_ctx;
7810         } else {
7811                 mem_ctx = state;
7812         }
7813
7814         status = state->dispatch_recv(subreq, mem_ctx);
7815         TALLOC_FREE(subreq);
7816         if (!NT_STATUS_IS_OK(status)) {
7817                 tevent_req_nterror(req, status);
7818                 return;
7819         }
7820
7821         /* Copy out parameters */
7822
7823         /* Copy result */
7824         state->orig.out.result = state->tmp.out.result;
7825
7826         /* Reset temporary structure */
7827         ZERO_STRUCT(state->tmp);
7828
7829         if (DEBUGLEVEL >= 10) {
7830                 NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &state->orig);
7831         }
7832
7833         tevent_req_done(req);
7834 }
7835
7836 NTSTATUS rpccli_PNP_GetResDesData_recv(struct tevent_req *req,
7837                                        TALLOC_CTX *mem_ctx,
7838                                        WERROR *result)
7839 {
7840         struct rpccli_PNP_GetResDesData_state *state = tevent_req_data(
7841                 req, struct rpccli_PNP_GetResDesData_state);
7842         NTSTATUS status;
7843
7844         if (tevent_req_is_nterror(req, &status)) {
7845                 tevent_req_received(req);
7846                 return status;
7847         }
7848
7849         /* Steal possbile out parameters to the callers context */
7850         talloc_steal(mem_ctx, state->out_mem_ctx);
7851
7852         /* Return result */
7853         *result = state->orig.out.result;
7854
7855         tevent_req_received(req);
7856         return NT_STATUS_OK;
7857 }
7858
7859 NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli,
7860                                   TALLOC_CTX *mem_ctx,
7861                                   WERROR *werror)
7862 {
7863         struct PNP_GetResDesData r;
7864         NTSTATUS status;
7865
7866         /* In parameters */
7867
7868         if (DEBUGLEVEL >= 10) {
7869                 NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &r);
7870         }
7871
7872         status = cli->dispatch(cli,
7873                                 mem_ctx,
7874                                 &ndr_table_ntsvcs,
7875                                 NDR_PNP_GETRESDESDATA,
7876                                 &r);
7877
7878         if (!NT_STATUS_IS_OK(status)) {
7879                 return status;
7880         }
7881
7882         if (DEBUGLEVEL >= 10) {
7883                 NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &r);
7884         }
7885
7886         if (NT_STATUS_IS_ERR(status)) {
7887                 return status;
7888         }
7889
7890         /* Return variables */
7891
7892         /* Return result */
7893         if (werror) {
7894                 *werror = r.out.result;
7895         }
7896
7897         return werror_to_ntstatus(r.out.result);
7898 }
7899
7900 struct rpccli_PNP_GetResDesDataSize_state {
7901         struct PNP_GetResDesDataSize orig;
7902         struct PNP_GetResDesDataSize tmp;
7903         TALLOC_CTX *out_mem_ctx;
7904         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7905 };
7906
7907 static void rpccli_PNP_GetResDesDataSize_done(struct tevent_req *subreq);
7908
7909 struct tevent_req *rpccli_PNP_GetResDesDataSize_send(TALLOC_CTX *mem_ctx,
7910                                                      struct tevent_context *ev,
7911                                                      struct rpc_pipe_client *cli)
7912 {
7913         struct tevent_req *req;
7914         struct rpccli_PNP_GetResDesDataSize_state *state;
7915         struct tevent_req *subreq;
7916
7917         req = tevent_req_create(mem_ctx, &state,
7918                                 struct rpccli_PNP_GetResDesDataSize_state);
7919         if (req == NULL) {
7920                 return NULL;
7921         }
7922         state->out_mem_ctx = NULL;
7923         state->dispatch_recv = cli->dispatch_recv;
7924
7925         /* In parameters */
7926
7927         /* Out parameters */
7928
7929         /* Result */
7930         ZERO_STRUCT(state->orig.out.result);
7931
7932         if (DEBUGLEVEL >= 10) {
7933                 NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &state->orig);
7934         }
7935
7936         /* make a temporary copy, that we pass to the dispatch function */
7937         state->tmp = state->orig;
7938
7939         subreq = cli->dispatch_send(state, ev, cli,
7940                                     &ndr_table_ntsvcs,
7941                                     NDR_PNP_GETRESDESDATASIZE,
7942                                     &state->tmp);
7943         if (tevent_req_nomem(subreq, req)) {
7944                 return tevent_req_post(req, ev);
7945         }
7946         tevent_req_set_callback(subreq, rpccli_PNP_GetResDesDataSize_done, req);
7947         return req;
7948 }
7949
7950 static void rpccli_PNP_GetResDesDataSize_done(struct tevent_req *subreq)
7951 {
7952         struct tevent_req *req = tevent_req_callback_data(
7953                 subreq, struct tevent_req);
7954         struct rpccli_PNP_GetResDesDataSize_state *state = tevent_req_data(
7955                 req, struct rpccli_PNP_GetResDesDataSize_state);
7956         NTSTATUS status;
7957         TALLOC_CTX *mem_ctx;
7958
7959         if (state->out_mem_ctx) {
7960                 mem_ctx = state->out_mem_ctx;
7961         } else {
7962                 mem_ctx = state;
7963         }
7964
7965         status = state->dispatch_recv(subreq, mem_ctx);
7966         TALLOC_FREE(subreq);
7967         if (!NT_STATUS_IS_OK(status)) {
7968                 tevent_req_nterror(req, status);
7969                 return;
7970         }
7971
7972         /* Copy out parameters */
7973
7974         /* Copy result */
7975         state->orig.out.result = state->tmp.out.result;
7976
7977         /* Reset temporary structure */
7978         ZERO_STRUCT(state->tmp);
7979
7980         if (DEBUGLEVEL >= 10) {
7981                 NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &state->orig);
7982         }
7983
7984         tevent_req_done(req);
7985 }
7986
7987 NTSTATUS rpccli_PNP_GetResDesDataSize_recv(struct tevent_req *req,
7988                                            TALLOC_CTX *mem_ctx,
7989                                            WERROR *result)
7990 {
7991         struct rpccli_PNP_GetResDesDataSize_state *state = tevent_req_data(
7992                 req, struct rpccli_PNP_GetResDesDataSize_state);
7993         NTSTATUS status;
7994
7995         if (tevent_req_is_nterror(req, &status)) {
7996                 tevent_req_received(req);
7997                 return status;
7998         }
7999
8000         /* Steal possbile out parameters to the callers context */
8001         talloc_steal(mem_ctx, state->out_mem_ctx);
8002
8003         /* Return result */
8004         *result = state->orig.out.result;
8005
8006         tevent_req_received(req);
8007         return NT_STATUS_OK;
8008 }
8009
8010 NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli,
8011                                       TALLOC_CTX *mem_ctx,
8012                                       WERROR *werror)
8013 {
8014         struct PNP_GetResDesDataSize r;
8015         NTSTATUS status;
8016
8017         /* In parameters */
8018
8019         if (DEBUGLEVEL >= 10) {
8020                 NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &r);
8021         }
8022
8023         status = cli->dispatch(cli,
8024                                 mem_ctx,
8025                                 &ndr_table_ntsvcs,
8026                                 NDR_PNP_GETRESDESDATASIZE,
8027                                 &r);
8028
8029         if (!NT_STATUS_IS_OK(status)) {
8030                 return status;
8031         }
8032
8033         if (DEBUGLEVEL >= 10) {
8034                 NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &r);
8035         }
8036
8037         if (NT_STATUS_IS_ERR(status)) {
8038                 return status;
8039         }
8040
8041         /* Return variables */
8042
8043         /* Return result */
8044         if (werror) {
8045                 *werror = r.out.result;
8046         }
8047
8048         return werror_to_ntstatus(r.out.result);
8049 }
8050
8051 struct rpccli_PNP_ModifyResDes_state {
8052         struct PNP_ModifyResDes orig;
8053         struct PNP_ModifyResDes tmp;
8054         TALLOC_CTX *out_mem_ctx;
8055         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8056 };
8057
8058 static void rpccli_PNP_ModifyResDes_done(struct tevent_req *subreq);
8059
8060 struct tevent_req *rpccli_PNP_ModifyResDes_send(TALLOC_CTX *mem_ctx,
8061                                                 struct tevent_context *ev,
8062                                                 struct rpc_pipe_client *cli)
8063 {
8064         struct tevent_req *req;
8065         struct rpccli_PNP_ModifyResDes_state *state;
8066         struct tevent_req *subreq;
8067
8068         req = tevent_req_create(mem_ctx, &state,
8069                                 struct rpccli_PNP_ModifyResDes_state);
8070         if (req == NULL) {
8071                 return NULL;
8072         }
8073         state->out_mem_ctx = NULL;
8074         state->dispatch_recv = cli->dispatch_recv;
8075
8076         /* In parameters */
8077
8078         /* Out parameters */
8079
8080         /* Result */
8081         ZERO_STRUCT(state->orig.out.result);
8082
8083         if (DEBUGLEVEL >= 10) {
8084                 NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &state->orig);
8085         }
8086
8087         /* make a temporary copy, that we pass to the dispatch function */
8088         state->tmp = state->orig;
8089
8090         subreq = cli->dispatch_send(state, ev, cli,
8091                                     &ndr_table_ntsvcs,
8092                                     NDR_PNP_MODIFYRESDES,
8093                                     &state->tmp);
8094         if (tevent_req_nomem(subreq, req)) {
8095                 return tevent_req_post(req, ev);
8096         }
8097         tevent_req_set_callback(subreq, rpccli_PNP_ModifyResDes_done, req);
8098         return req;
8099 }
8100
8101 static void rpccli_PNP_ModifyResDes_done(struct tevent_req *subreq)
8102 {
8103         struct tevent_req *req = tevent_req_callback_data(
8104                 subreq, struct tevent_req);
8105         struct rpccli_PNP_ModifyResDes_state *state = tevent_req_data(
8106                 req, struct rpccli_PNP_ModifyResDes_state);
8107         NTSTATUS status;
8108         TALLOC_CTX *mem_ctx;
8109
8110         if (state->out_mem_ctx) {
8111                 mem_ctx = state->out_mem_ctx;
8112         } else {
8113                 mem_ctx = state;
8114         }
8115
8116         status = state->dispatch_recv(subreq, mem_ctx);
8117         TALLOC_FREE(subreq);
8118         if (!NT_STATUS_IS_OK(status)) {
8119                 tevent_req_nterror(req, status);
8120                 return;
8121         }
8122
8123         /* Copy out parameters */
8124
8125         /* Copy result */
8126         state->orig.out.result = state->tmp.out.result;
8127
8128         /* Reset temporary structure */
8129         ZERO_STRUCT(state->tmp);
8130
8131         if (DEBUGLEVEL >= 10) {
8132                 NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &state->orig);
8133         }
8134
8135         tevent_req_done(req);
8136 }
8137
8138 NTSTATUS rpccli_PNP_ModifyResDes_recv(struct tevent_req *req,
8139                                       TALLOC_CTX *mem_ctx,
8140                                       WERROR *result)
8141 {
8142         struct rpccli_PNP_ModifyResDes_state *state = tevent_req_data(
8143                 req, struct rpccli_PNP_ModifyResDes_state);
8144         NTSTATUS status;
8145
8146         if (tevent_req_is_nterror(req, &status)) {
8147                 tevent_req_received(req);
8148                 return status;
8149         }
8150
8151         /* Steal possbile out parameters to the callers context */
8152         talloc_steal(mem_ctx, state->out_mem_ctx);
8153
8154         /* Return result */
8155         *result = state->orig.out.result;
8156
8157         tevent_req_received(req);
8158         return NT_STATUS_OK;
8159 }
8160
8161 NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli,
8162                                  TALLOC_CTX *mem_ctx,
8163                                  WERROR *werror)
8164 {
8165         struct PNP_ModifyResDes r;
8166         NTSTATUS status;
8167
8168         /* In parameters */
8169
8170         if (DEBUGLEVEL >= 10) {
8171                 NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &r);
8172         }
8173
8174         status = cli->dispatch(cli,
8175                                 mem_ctx,
8176                                 &ndr_table_ntsvcs,
8177                                 NDR_PNP_MODIFYRESDES,
8178                                 &r);
8179
8180         if (!NT_STATUS_IS_OK(status)) {
8181                 return status;
8182         }
8183
8184         if (DEBUGLEVEL >= 10) {
8185                 NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &r);
8186         }
8187
8188         if (NT_STATUS_IS_ERR(status)) {
8189                 return status;
8190         }
8191
8192         /* Return variables */
8193
8194         /* Return result */
8195         if (werror) {
8196                 *werror = r.out.result;
8197         }
8198
8199         return werror_to_ntstatus(r.out.result);
8200 }
8201
8202 struct rpccli_PNP_DetectResourceLimit_state {
8203         struct PNP_DetectResourceLimit orig;
8204         struct PNP_DetectResourceLimit tmp;
8205         TALLOC_CTX *out_mem_ctx;
8206         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8207 };
8208
8209 static void rpccli_PNP_DetectResourceLimit_done(struct tevent_req *subreq);
8210
8211 struct tevent_req *rpccli_PNP_DetectResourceLimit_send(TALLOC_CTX *mem_ctx,
8212                                                        struct tevent_context *ev,
8213                                                        struct rpc_pipe_client *cli)
8214 {
8215         struct tevent_req *req;
8216         struct rpccli_PNP_DetectResourceLimit_state *state;
8217         struct tevent_req *subreq;
8218
8219         req = tevent_req_create(mem_ctx, &state,
8220                                 struct rpccli_PNP_DetectResourceLimit_state);
8221         if (req == NULL) {
8222                 return NULL;
8223         }
8224         state->out_mem_ctx = NULL;
8225         state->dispatch_recv = cli->dispatch_recv;
8226
8227         /* In parameters */
8228
8229         /* Out parameters */
8230
8231         /* Result */
8232         ZERO_STRUCT(state->orig.out.result);
8233
8234         if (DEBUGLEVEL >= 10) {
8235                 NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &state->orig);
8236         }
8237
8238         /* make a temporary copy, that we pass to the dispatch function */
8239         state->tmp = state->orig;
8240
8241         subreq = cli->dispatch_send(state, ev, cli,
8242                                     &ndr_table_ntsvcs,
8243                                     NDR_PNP_DETECTRESOURCELIMIT,
8244                                     &state->tmp);
8245         if (tevent_req_nomem(subreq, req)) {
8246                 return tevent_req_post(req, ev);
8247         }
8248         tevent_req_set_callback(subreq, rpccli_PNP_DetectResourceLimit_done, req);
8249         return req;
8250 }
8251
8252 static void rpccli_PNP_DetectResourceLimit_done(struct tevent_req *subreq)
8253 {
8254         struct tevent_req *req = tevent_req_callback_data(
8255                 subreq, struct tevent_req);
8256         struct rpccli_PNP_DetectResourceLimit_state *state = tevent_req_data(
8257                 req, struct rpccli_PNP_DetectResourceLimit_state);
8258         NTSTATUS status;
8259         TALLOC_CTX *mem_ctx;
8260
8261         if (state->out_mem_ctx) {
8262                 mem_ctx = state->out_mem_ctx;
8263         } else {
8264                 mem_ctx = state;
8265         }
8266
8267         status = state->dispatch_recv(subreq, mem_ctx);
8268         TALLOC_FREE(subreq);
8269         if (!NT_STATUS_IS_OK(status)) {
8270                 tevent_req_nterror(req, status);
8271                 return;
8272         }
8273
8274         /* Copy out parameters */
8275
8276         /* Copy result */
8277         state->orig.out.result = state->tmp.out.result;
8278
8279         /* Reset temporary structure */
8280         ZERO_STRUCT(state->tmp);
8281
8282         if (DEBUGLEVEL >= 10) {
8283                 NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &state->orig);
8284         }
8285
8286         tevent_req_done(req);
8287 }
8288
8289 NTSTATUS rpccli_PNP_DetectResourceLimit_recv(struct tevent_req *req,
8290                                              TALLOC_CTX *mem_ctx,
8291                                              WERROR *result)
8292 {
8293         struct rpccli_PNP_DetectResourceLimit_state *state = tevent_req_data(
8294                 req, struct rpccli_PNP_DetectResourceLimit_state);
8295         NTSTATUS status;
8296
8297         if (tevent_req_is_nterror(req, &status)) {
8298                 tevent_req_received(req);
8299                 return status;
8300         }
8301
8302         /* Steal possbile out parameters to the callers context */
8303         talloc_steal(mem_ctx, state->out_mem_ctx);
8304
8305         /* Return result */
8306         *result = state->orig.out.result;
8307
8308         tevent_req_received(req);
8309         return NT_STATUS_OK;
8310 }
8311
8312 NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli,
8313                                         TALLOC_CTX *mem_ctx,
8314                                         WERROR *werror)
8315 {
8316         struct PNP_DetectResourceLimit r;
8317         NTSTATUS status;
8318
8319         /* In parameters */
8320
8321         if (DEBUGLEVEL >= 10) {
8322                 NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &r);
8323         }
8324
8325         status = cli->dispatch(cli,
8326                                 mem_ctx,
8327                                 &ndr_table_ntsvcs,
8328                                 NDR_PNP_DETECTRESOURCELIMIT,
8329                                 &r);
8330
8331         if (!NT_STATUS_IS_OK(status)) {
8332                 return status;
8333         }
8334
8335         if (DEBUGLEVEL >= 10) {
8336                 NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &r);
8337         }
8338
8339         if (NT_STATUS_IS_ERR(status)) {
8340                 return status;
8341         }
8342
8343         /* Return variables */
8344
8345         /* Return result */
8346         if (werror) {
8347                 *werror = r.out.result;
8348         }
8349
8350         return werror_to_ntstatus(r.out.result);
8351 }
8352
8353 struct rpccli_PNP_QueryResConfList_state {
8354         struct PNP_QueryResConfList orig;
8355         struct PNP_QueryResConfList tmp;
8356         TALLOC_CTX *out_mem_ctx;
8357         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8358 };
8359
8360 static void rpccli_PNP_QueryResConfList_done(struct tevent_req *subreq);
8361
8362 struct tevent_req *rpccli_PNP_QueryResConfList_send(TALLOC_CTX *mem_ctx,
8363                                                     struct tevent_context *ev,
8364                                                     struct rpc_pipe_client *cli)
8365 {
8366         struct tevent_req *req;
8367         struct rpccli_PNP_QueryResConfList_state *state;
8368         struct tevent_req *subreq;
8369
8370         req = tevent_req_create(mem_ctx, &state,
8371                                 struct rpccli_PNP_QueryResConfList_state);
8372         if (req == NULL) {
8373                 return NULL;
8374         }
8375         state->out_mem_ctx = NULL;
8376         state->dispatch_recv = cli->dispatch_recv;
8377
8378         /* In parameters */
8379
8380         /* Out parameters */
8381
8382         /* Result */
8383         ZERO_STRUCT(state->orig.out.result);
8384
8385         if (DEBUGLEVEL >= 10) {
8386                 NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &state->orig);
8387         }
8388
8389         /* make a temporary copy, that we pass to the dispatch function */
8390         state->tmp = state->orig;
8391
8392         subreq = cli->dispatch_send(state, ev, cli,
8393                                     &ndr_table_ntsvcs,
8394                                     NDR_PNP_QUERYRESCONFLIST,
8395                                     &state->tmp);
8396         if (tevent_req_nomem(subreq, req)) {
8397                 return tevent_req_post(req, ev);
8398         }
8399         tevent_req_set_callback(subreq, rpccli_PNP_QueryResConfList_done, req);
8400         return req;
8401 }
8402
8403 static void rpccli_PNP_QueryResConfList_done(struct tevent_req *subreq)
8404 {
8405         struct tevent_req *req = tevent_req_callback_data(
8406                 subreq, struct tevent_req);
8407         struct rpccli_PNP_QueryResConfList_state *state = tevent_req_data(
8408                 req, struct rpccli_PNP_QueryResConfList_state);
8409         NTSTATUS status;
8410         TALLOC_CTX *mem_ctx;
8411
8412         if (state->out_mem_ctx) {
8413                 mem_ctx = state->out_mem_ctx;
8414         } else {
8415                 mem_ctx = state;
8416         }
8417
8418         status = state->dispatch_recv(subreq, mem_ctx);
8419         TALLOC_FREE(subreq);
8420         if (!NT_STATUS_IS_OK(status)) {
8421                 tevent_req_nterror(req, status);
8422                 return;
8423         }
8424
8425         /* Copy out parameters */
8426
8427         /* Copy result */
8428         state->orig.out.result = state->tmp.out.result;
8429
8430         /* Reset temporary structure */
8431         ZERO_STRUCT(state->tmp);
8432
8433         if (DEBUGLEVEL >= 10) {
8434                 NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &state->orig);
8435         }
8436
8437         tevent_req_done(req);
8438 }
8439
8440 NTSTATUS rpccli_PNP_QueryResConfList_recv(struct tevent_req *req,
8441                                           TALLOC_CTX *mem_ctx,
8442                                           WERROR *result)
8443 {
8444         struct rpccli_PNP_QueryResConfList_state *state = tevent_req_data(
8445                 req, struct rpccli_PNP_QueryResConfList_state);
8446         NTSTATUS status;
8447
8448         if (tevent_req_is_nterror(req, &status)) {
8449                 tevent_req_received(req);
8450                 return status;
8451         }
8452
8453         /* Steal possbile out parameters to the callers context */
8454         talloc_steal(mem_ctx, state->out_mem_ctx);
8455
8456         /* Return result */
8457         *result = state->orig.out.result;
8458
8459         tevent_req_received(req);
8460         return NT_STATUS_OK;
8461 }
8462
8463 NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli,
8464                                      TALLOC_CTX *mem_ctx,
8465                                      WERROR *werror)
8466 {
8467         struct PNP_QueryResConfList r;
8468         NTSTATUS status;
8469
8470         /* In parameters */
8471
8472         if (DEBUGLEVEL >= 10) {
8473                 NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &r);
8474         }
8475
8476         status = cli->dispatch(cli,
8477                                 mem_ctx,
8478                                 &ndr_table_ntsvcs,
8479                                 NDR_PNP_QUERYRESCONFLIST,
8480                                 &r);
8481
8482         if (!NT_STATUS_IS_OK(status)) {
8483                 return status;
8484         }
8485
8486         if (DEBUGLEVEL >= 10) {
8487                 NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &r);
8488         }
8489
8490         if (NT_STATUS_IS_ERR(status)) {
8491                 return status;
8492         }
8493
8494         /* Return variables */
8495
8496         /* Return result */
8497         if (werror) {
8498                 *werror = r.out.result;
8499         }
8500
8501         return werror_to_ntstatus(r.out.result);
8502 }
8503
8504 struct rpccli_PNP_SetHwProf_state {
8505         struct PNP_SetHwProf orig;
8506         struct PNP_SetHwProf tmp;
8507         TALLOC_CTX *out_mem_ctx;
8508         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8509 };
8510
8511 static void rpccli_PNP_SetHwProf_done(struct tevent_req *subreq);
8512
8513 struct tevent_req *rpccli_PNP_SetHwProf_send(TALLOC_CTX *mem_ctx,
8514                                              struct tevent_context *ev,
8515                                              struct rpc_pipe_client *cli)
8516 {
8517         struct tevent_req *req;
8518         struct rpccli_PNP_SetHwProf_state *state;
8519         struct tevent_req *subreq;
8520
8521         req = tevent_req_create(mem_ctx, &state,
8522                                 struct rpccli_PNP_SetHwProf_state);
8523         if (req == NULL) {
8524                 return NULL;
8525         }
8526         state->out_mem_ctx = NULL;
8527         state->dispatch_recv = cli->dispatch_recv;
8528
8529         /* In parameters */
8530
8531         /* Out parameters */
8532
8533         /* Result */
8534         ZERO_STRUCT(state->orig.out.result);
8535
8536         if (DEBUGLEVEL >= 10) {
8537                 NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &state->orig);
8538         }
8539
8540         /* make a temporary copy, that we pass to the dispatch function */
8541         state->tmp = state->orig;
8542
8543         subreq = cli->dispatch_send(state, ev, cli,
8544                                     &ndr_table_ntsvcs,
8545                                     NDR_PNP_SETHWPROF,
8546                                     &state->tmp);
8547         if (tevent_req_nomem(subreq, req)) {
8548                 return tevent_req_post(req, ev);
8549         }
8550         tevent_req_set_callback(subreq, rpccli_PNP_SetHwProf_done, req);
8551         return req;
8552 }
8553
8554 static void rpccli_PNP_SetHwProf_done(struct tevent_req *subreq)
8555 {
8556         struct tevent_req *req = tevent_req_callback_data(
8557                 subreq, struct tevent_req);
8558         struct rpccli_PNP_SetHwProf_state *state = tevent_req_data(
8559                 req, struct rpccli_PNP_SetHwProf_state);
8560         NTSTATUS status;
8561         TALLOC_CTX *mem_ctx;
8562
8563         if (state->out_mem_ctx) {
8564                 mem_ctx = state->out_mem_ctx;
8565         } else {
8566                 mem_ctx = state;
8567         }
8568
8569         status = state->dispatch_recv(subreq, mem_ctx);
8570         TALLOC_FREE(subreq);
8571         if (!NT_STATUS_IS_OK(status)) {
8572                 tevent_req_nterror(req, status);
8573                 return;
8574         }
8575
8576         /* Copy out parameters */
8577
8578         /* Copy result */
8579         state->orig.out.result = state->tmp.out.result;
8580
8581         /* Reset temporary structure */
8582         ZERO_STRUCT(state->tmp);
8583
8584         if (DEBUGLEVEL >= 10) {
8585                 NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &state->orig);
8586         }
8587
8588         tevent_req_done(req);
8589 }
8590
8591 NTSTATUS rpccli_PNP_SetHwProf_recv(struct tevent_req *req,
8592                                    TALLOC_CTX *mem_ctx,
8593                                    WERROR *result)
8594 {
8595         struct rpccli_PNP_SetHwProf_state *state = tevent_req_data(
8596                 req, struct rpccli_PNP_SetHwProf_state);
8597         NTSTATUS status;
8598
8599         if (tevent_req_is_nterror(req, &status)) {
8600                 tevent_req_received(req);
8601                 return status;
8602         }
8603
8604         /* Steal possbile out parameters to the callers context */
8605         talloc_steal(mem_ctx, state->out_mem_ctx);
8606
8607         /* Return result */
8608         *result = state->orig.out.result;
8609
8610         tevent_req_received(req);
8611         return NT_STATUS_OK;
8612 }
8613
8614 NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli,
8615                               TALLOC_CTX *mem_ctx,
8616                               WERROR *werror)
8617 {
8618         struct PNP_SetHwProf r;
8619         NTSTATUS status;
8620
8621         /* In parameters */
8622
8623         if (DEBUGLEVEL >= 10) {
8624                 NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &r);
8625         }
8626
8627         status = cli->dispatch(cli,
8628                                 mem_ctx,
8629                                 &ndr_table_ntsvcs,
8630                                 NDR_PNP_SETHWPROF,
8631                                 &r);
8632
8633         if (!NT_STATUS_IS_OK(status)) {
8634                 return status;
8635         }
8636
8637         if (DEBUGLEVEL >= 10) {
8638                 NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &r);
8639         }
8640
8641         if (NT_STATUS_IS_ERR(status)) {
8642                 return status;
8643         }
8644
8645         /* Return variables */
8646
8647         /* Return result */
8648         if (werror) {
8649                 *werror = r.out.result;
8650         }
8651
8652         return werror_to_ntstatus(r.out.result);
8653 }
8654
8655 struct rpccli_PNP_QueryArbitratorFreeData_state {
8656         struct PNP_QueryArbitratorFreeData orig;
8657         struct PNP_QueryArbitratorFreeData tmp;
8658         TALLOC_CTX *out_mem_ctx;
8659         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8660 };
8661
8662 static void rpccli_PNP_QueryArbitratorFreeData_done(struct tevent_req *subreq);
8663
8664 struct tevent_req *rpccli_PNP_QueryArbitratorFreeData_send(TALLOC_CTX *mem_ctx,
8665                                                            struct tevent_context *ev,
8666                                                            struct rpc_pipe_client *cli)
8667 {
8668         struct tevent_req *req;
8669         struct rpccli_PNP_QueryArbitratorFreeData_state *state;
8670         struct tevent_req *subreq;
8671
8672         req = tevent_req_create(mem_ctx, &state,
8673                                 struct rpccli_PNP_QueryArbitratorFreeData_state);
8674         if (req == NULL) {
8675                 return NULL;
8676         }
8677         state->out_mem_ctx = NULL;
8678         state->dispatch_recv = cli->dispatch_recv;
8679
8680         /* In parameters */
8681
8682         /* Out parameters */
8683
8684         /* Result */
8685         ZERO_STRUCT(state->orig.out.result);
8686
8687         if (DEBUGLEVEL >= 10) {
8688                 NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &state->orig);
8689         }
8690
8691         /* make a temporary copy, that we pass to the dispatch function */
8692         state->tmp = state->orig;
8693
8694         subreq = cli->dispatch_send(state, ev, cli,
8695                                     &ndr_table_ntsvcs,
8696                                     NDR_PNP_QUERYARBITRATORFREEDATA,
8697                                     &state->tmp);
8698         if (tevent_req_nomem(subreq, req)) {
8699                 return tevent_req_post(req, ev);
8700         }
8701         tevent_req_set_callback(subreq, rpccli_PNP_QueryArbitratorFreeData_done, req);
8702         return req;
8703 }
8704
8705 static void rpccli_PNP_QueryArbitratorFreeData_done(struct tevent_req *subreq)
8706 {
8707         struct tevent_req *req = tevent_req_callback_data(
8708                 subreq, struct tevent_req);
8709         struct rpccli_PNP_QueryArbitratorFreeData_state *state = tevent_req_data(
8710                 req, struct rpccli_PNP_QueryArbitratorFreeData_state);
8711         NTSTATUS status;
8712         TALLOC_CTX *mem_ctx;
8713
8714         if (state->out_mem_ctx) {
8715                 mem_ctx = state->out_mem_ctx;
8716         } else {
8717                 mem_ctx = state;
8718         }
8719
8720         status = state->dispatch_recv(subreq, mem_ctx);
8721         TALLOC_FREE(subreq);
8722         if (!NT_STATUS_IS_OK(status)) {
8723                 tevent_req_nterror(req, status);
8724                 return;
8725         }
8726
8727         /* Copy out parameters */
8728
8729         /* Copy result */
8730         state->orig.out.result = state->tmp.out.result;
8731
8732         /* Reset temporary structure */
8733         ZERO_STRUCT(state->tmp);
8734
8735         if (DEBUGLEVEL >= 10) {
8736                 NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &state->orig);
8737         }
8738
8739         tevent_req_done(req);
8740 }
8741
8742 NTSTATUS rpccli_PNP_QueryArbitratorFreeData_recv(struct tevent_req *req,
8743                                                  TALLOC_CTX *mem_ctx,
8744                                                  WERROR *result)
8745 {
8746         struct rpccli_PNP_QueryArbitratorFreeData_state *state = tevent_req_data(
8747                 req, struct rpccli_PNP_QueryArbitratorFreeData_state);
8748         NTSTATUS status;
8749
8750         if (tevent_req_is_nterror(req, &status)) {
8751                 tevent_req_received(req);
8752                 return status;
8753         }
8754
8755         /* Steal possbile out parameters to the callers context */
8756         talloc_steal(mem_ctx, state->out_mem_ctx);
8757
8758         /* Return result */
8759         *result = state->orig.out.result;
8760
8761         tevent_req_received(req);
8762         return NT_STATUS_OK;
8763 }
8764
8765 NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli,
8766                                             TALLOC_CTX *mem_ctx,
8767                                             WERROR *werror)
8768 {
8769         struct PNP_QueryArbitratorFreeData r;
8770         NTSTATUS status;
8771
8772         /* In parameters */
8773
8774         if (DEBUGLEVEL >= 10) {
8775                 NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &r);
8776         }
8777
8778         status = cli->dispatch(cli,
8779                                 mem_ctx,
8780                                 &ndr_table_ntsvcs,
8781                                 NDR_PNP_QUERYARBITRATORFREEDATA,
8782                                 &r);
8783
8784         if (!NT_STATUS_IS_OK(status)) {
8785                 return status;
8786         }
8787
8788         if (DEBUGLEVEL >= 10) {
8789                 NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &r);
8790         }
8791
8792         if (NT_STATUS_IS_ERR(status)) {
8793                 return status;
8794         }
8795
8796         /* Return variables */
8797
8798         /* Return result */
8799         if (werror) {
8800                 *werror = r.out.result;
8801         }
8802
8803         return werror_to_ntstatus(r.out.result);
8804 }
8805
8806 struct rpccli_PNP_QueryArbitratorFreeSize_state {
8807         struct PNP_QueryArbitratorFreeSize orig;
8808         struct PNP_QueryArbitratorFreeSize tmp;
8809         TALLOC_CTX *out_mem_ctx;
8810         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8811 };
8812
8813 static void rpccli_PNP_QueryArbitratorFreeSize_done(struct tevent_req *subreq);
8814
8815 struct tevent_req *rpccli_PNP_QueryArbitratorFreeSize_send(TALLOC_CTX *mem_ctx,
8816                                                            struct tevent_context *ev,
8817                                                            struct rpc_pipe_client *cli)
8818 {
8819         struct tevent_req *req;
8820         struct rpccli_PNP_QueryArbitratorFreeSize_state *state;
8821         struct tevent_req *subreq;
8822
8823         req = tevent_req_create(mem_ctx, &state,
8824                                 struct rpccli_PNP_QueryArbitratorFreeSize_state);
8825         if (req == NULL) {
8826                 return NULL;
8827         }
8828         state->out_mem_ctx = NULL;
8829         state->dispatch_recv = cli->dispatch_recv;
8830
8831         /* In parameters */
8832
8833         /* Out parameters */
8834
8835         /* Result */
8836         ZERO_STRUCT(state->orig.out.result);
8837
8838         if (DEBUGLEVEL >= 10) {
8839                 NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &state->orig);
8840         }
8841
8842         /* make a temporary copy, that we pass to the dispatch function */
8843         state->tmp = state->orig;
8844
8845         subreq = cli->dispatch_send(state, ev, cli,
8846                                     &ndr_table_ntsvcs,
8847                                     NDR_PNP_QUERYARBITRATORFREESIZE,
8848                                     &state->tmp);
8849         if (tevent_req_nomem(subreq, req)) {
8850                 return tevent_req_post(req, ev);
8851         }
8852         tevent_req_set_callback(subreq, rpccli_PNP_QueryArbitratorFreeSize_done, req);
8853         return req;
8854 }
8855
8856 static void rpccli_PNP_QueryArbitratorFreeSize_done(struct tevent_req *subreq)
8857 {
8858         struct tevent_req *req = tevent_req_callback_data(
8859                 subreq, struct tevent_req);
8860         struct rpccli_PNP_QueryArbitratorFreeSize_state *state = tevent_req_data(
8861                 req, struct rpccli_PNP_QueryArbitratorFreeSize_state);
8862         NTSTATUS status;
8863         TALLOC_CTX *mem_ctx;
8864
8865         if (state->out_mem_ctx) {
8866                 mem_ctx = state->out_mem_ctx;
8867         } else {
8868                 mem_ctx = state;
8869         }
8870
8871         status = state->dispatch_recv(subreq, mem_ctx);
8872         TALLOC_FREE(subreq);
8873         if (!NT_STATUS_IS_OK(status)) {
8874                 tevent_req_nterror(req, status);
8875                 return;
8876         }
8877
8878         /* Copy out parameters */
8879
8880         /* Copy result */
8881         state->orig.out.result = state->tmp.out.result;
8882
8883         /* Reset temporary structure */
8884         ZERO_STRUCT(state->tmp);
8885
8886         if (DEBUGLEVEL >= 10) {
8887                 NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &state->orig);
8888         }
8889
8890         tevent_req_done(req);
8891 }
8892
8893 NTSTATUS rpccli_PNP_QueryArbitratorFreeSize_recv(struct tevent_req *req,
8894                                                  TALLOC_CTX *mem_ctx,
8895                                                  WERROR *result)
8896 {
8897         struct rpccli_PNP_QueryArbitratorFreeSize_state *state = tevent_req_data(
8898                 req, struct rpccli_PNP_QueryArbitratorFreeSize_state);
8899         NTSTATUS status;
8900
8901         if (tevent_req_is_nterror(req, &status)) {
8902                 tevent_req_received(req);
8903                 return status;
8904         }
8905
8906         /* Steal possbile out parameters to the callers context */
8907         talloc_steal(mem_ctx, state->out_mem_ctx);
8908
8909         /* Return result */
8910         *result = state->orig.out.result;
8911
8912         tevent_req_received(req);
8913         return NT_STATUS_OK;
8914 }
8915
8916 NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli,
8917                                             TALLOC_CTX *mem_ctx,
8918                                             WERROR *werror)
8919 {
8920         struct PNP_QueryArbitratorFreeSize r;
8921         NTSTATUS status;
8922
8923         /* In parameters */
8924
8925         if (DEBUGLEVEL >= 10) {
8926                 NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &r);
8927         }
8928
8929         status = cli->dispatch(cli,
8930                                 mem_ctx,
8931                                 &ndr_table_ntsvcs,
8932                                 NDR_PNP_QUERYARBITRATORFREESIZE,
8933                                 &r);
8934
8935         if (!NT_STATUS_IS_OK(status)) {
8936                 return status;
8937         }
8938
8939         if (DEBUGLEVEL >= 10) {
8940                 NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &r);
8941         }
8942
8943         if (NT_STATUS_IS_ERR(status)) {
8944                 return status;
8945         }
8946
8947         /* Return variables */
8948
8949         /* Return result */
8950         if (werror) {
8951                 *werror = r.out.result;
8952         }
8953
8954         return werror_to_ntstatus(r.out.result);
8955 }
8956
8957 struct rpccli_PNP_RunDetection_state {
8958         struct PNP_RunDetection orig;
8959         struct PNP_RunDetection tmp;
8960         TALLOC_CTX *out_mem_ctx;
8961         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8962 };
8963
8964 static void rpccli_PNP_RunDetection_done(struct tevent_req *subreq);
8965
8966 struct tevent_req *rpccli_PNP_RunDetection_send(TALLOC_CTX *mem_ctx,
8967                                                 struct tevent_context *ev,
8968                                                 struct rpc_pipe_client *cli)
8969 {
8970         struct tevent_req *req;
8971         struct rpccli_PNP_RunDetection_state *state;
8972         struct tevent_req *subreq;
8973
8974         req = tevent_req_create(mem_ctx, &state,
8975                                 struct rpccli_PNP_RunDetection_state);
8976         if (req == NULL) {
8977                 return NULL;
8978         }
8979         state->out_mem_ctx = NULL;
8980         state->dispatch_recv = cli->dispatch_recv;
8981
8982         /* In parameters */
8983
8984         /* Out parameters */
8985
8986         /* Result */
8987         ZERO_STRUCT(state->orig.out.result);
8988
8989         if (DEBUGLEVEL >= 10) {
8990                 NDR_PRINT_IN_DEBUG(PNP_RunDetection, &state->orig);
8991         }
8992
8993         /* make a temporary copy, that we pass to the dispatch function */
8994         state->tmp = state->orig;
8995
8996         subreq = cli->dispatch_send(state, ev, cli,
8997                                     &ndr_table_ntsvcs,
8998                                     NDR_PNP_RUNDETECTION,
8999                                     &state->tmp);
9000         if (tevent_req_nomem(subreq, req)) {
9001                 return tevent_req_post(req, ev);
9002         }
9003         tevent_req_set_callback(subreq, rpccli_PNP_RunDetection_done, req);
9004         return req;
9005 }
9006
9007 static void rpccli_PNP_RunDetection_done(struct tevent_req *subreq)
9008 {
9009         struct tevent_req *req = tevent_req_callback_data(
9010                 subreq, struct tevent_req);
9011         struct rpccli_PNP_RunDetection_state *state = tevent_req_data(
9012                 req, struct rpccli_PNP_RunDetection_state);
9013         NTSTATUS status;
9014         TALLOC_CTX *mem_ctx;
9015
9016         if (state->out_mem_ctx) {
9017                 mem_ctx = state->out_mem_ctx;
9018         } else {
9019                 mem_ctx = state;
9020         }
9021
9022         status = state->dispatch_recv(subreq, mem_ctx);
9023         TALLOC_FREE(subreq);
9024         if (!NT_STATUS_IS_OK(status)) {
9025                 tevent_req_nterror(req, status);
9026                 return;
9027         }
9028
9029         /* Copy out parameters */
9030
9031         /* Copy result */
9032         state->orig.out.result = state->tmp.out.result;
9033
9034         /* Reset temporary structure */
9035         ZERO_STRUCT(state->tmp);
9036
9037         if (DEBUGLEVEL >= 10) {
9038                 NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &state->orig);
9039         }
9040
9041         tevent_req_done(req);
9042 }
9043
9044 NTSTATUS rpccli_PNP_RunDetection_recv(struct tevent_req *req,
9045                                       TALLOC_CTX *mem_ctx,
9046                                       WERROR *result)
9047 {
9048         struct rpccli_PNP_RunDetection_state *state = tevent_req_data(
9049                 req, struct rpccli_PNP_RunDetection_state);
9050         NTSTATUS status;
9051
9052         if (tevent_req_is_nterror(req, &status)) {
9053                 tevent_req_received(req);
9054                 return status;
9055         }
9056
9057         /* Steal possbile out parameters to the callers context */
9058         talloc_steal(mem_ctx, state->out_mem_ctx);
9059
9060         /* Return result */
9061         *result = state->orig.out.result;
9062
9063         tevent_req_received(req);
9064         return NT_STATUS_OK;
9065 }
9066
9067 NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli,
9068                                  TALLOC_CTX *mem_ctx,
9069                                  WERROR *werror)
9070 {
9071         struct PNP_RunDetection r;
9072         NTSTATUS status;
9073
9074         /* In parameters */
9075
9076         if (DEBUGLEVEL >= 10) {
9077                 NDR_PRINT_IN_DEBUG(PNP_RunDetection, &r);
9078         }
9079
9080         status = cli->dispatch(cli,
9081                                 mem_ctx,
9082                                 &ndr_table_ntsvcs,
9083                                 NDR_PNP_RUNDETECTION,
9084                                 &r);
9085
9086         if (!NT_STATUS_IS_OK(status)) {
9087                 return status;
9088         }
9089
9090         if (DEBUGLEVEL >= 10) {
9091                 NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &r);
9092         }
9093
9094         if (NT_STATUS_IS_ERR(status)) {
9095                 return status;
9096         }
9097
9098         /* Return variables */
9099
9100         /* Return result */
9101         if (werror) {
9102                 *werror = r.out.result;
9103         }
9104
9105         return werror_to_ntstatus(r.out.result);
9106 }
9107
9108 struct rpccli_PNP_RegisterNotification_state {
9109         struct PNP_RegisterNotification orig;
9110         struct PNP_RegisterNotification tmp;
9111         TALLOC_CTX *out_mem_ctx;
9112         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9113 };
9114
9115 static void rpccli_PNP_RegisterNotification_done(struct tevent_req *subreq);
9116
9117 struct tevent_req *rpccli_PNP_RegisterNotification_send(TALLOC_CTX *mem_ctx,
9118                                                         struct tevent_context *ev,
9119                                                         struct rpc_pipe_client *cli)
9120 {
9121         struct tevent_req *req;
9122         struct rpccli_PNP_RegisterNotification_state *state;
9123         struct tevent_req *subreq;
9124
9125         req = tevent_req_create(mem_ctx, &state,
9126                                 struct rpccli_PNP_RegisterNotification_state);
9127         if (req == NULL) {
9128                 return NULL;
9129         }
9130         state->out_mem_ctx = NULL;
9131         state->dispatch_recv = cli->dispatch_recv;
9132
9133         /* In parameters */
9134
9135         /* Out parameters */
9136
9137         /* Result */
9138         ZERO_STRUCT(state->orig.out.result);
9139
9140         if (DEBUGLEVEL >= 10) {
9141                 NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &state->orig);
9142         }
9143
9144         /* make a temporary copy, that we pass to the dispatch function */
9145         state->tmp = state->orig;
9146
9147         subreq = cli->dispatch_send(state, ev, cli,
9148                                     &ndr_table_ntsvcs,
9149                                     NDR_PNP_REGISTERNOTIFICATION,
9150                                     &state->tmp);
9151         if (tevent_req_nomem(subreq, req)) {
9152                 return tevent_req_post(req, ev);
9153         }
9154         tevent_req_set_callback(subreq, rpccli_PNP_RegisterNotification_done, req);
9155         return req;
9156 }
9157
9158 static void rpccli_PNP_RegisterNotification_done(struct tevent_req *subreq)
9159 {
9160         struct tevent_req *req = tevent_req_callback_data(
9161                 subreq, struct tevent_req);
9162         struct rpccli_PNP_RegisterNotification_state *state = tevent_req_data(
9163                 req, struct rpccli_PNP_RegisterNotification_state);
9164         NTSTATUS status;
9165         TALLOC_CTX *mem_ctx;
9166
9167         if (state->out_mem_ctx) {
9168                 mem_ctx = state->out_mem_ctx;
9169         } else {
9170                 mem_ctx = state;
9171         }
9172
9173         status = state->dispatch_recv(subreq, mem_ctx);
9174         TALLOC_FREE(subreq);
9175         if (!NT_STATUS_IS_OK(status)) {
9176                 tevent_req_nterror(req, status);
9177                 return;
9178         }
9179
9180         /* Copy out parameters */
9181
9182         /* Copy result */
9183         state->orig.out.result = state->tmp.out.result;
9184
9185         /* Reset temporary structure */
9186         ZERO_STRUCT(state->tmp);
9187
9188         if (DEBUGLEVEL >= 10) {
9189                 NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &state->orig);
9190         }
9191
9192         tevent_req_done(req);
9193 }
9194
9195 NTSTATUS rpccli_PNP_RegisterNotification_recv(struct tevent_req *req,
9196                                               TALLOC_CTX *mem_ctx,
9197                                               WERROR *result)
9198 {
9199         struct rpccli_PNP_RegisterNotification_state *state = tevent_req_data(
9200                 req, struct rpccli_PNP_RegisterNotification_state);
9201         NTSTATUS status;
9202
9203         if (tevent_req_is_nterror(req, &status)) {
9204                 tevent_req_received(req);
9205                 return status;
9206         }
9207
9208         /* Steal possbile out parameters to the callers context */
9209         talloc_steal(mem_ctx, state->out_mem_ctx);
9210
9211         /* Return result */
9212         *result = state->orig.out.result;
9213
9214         tevent_req_received(req);
9215         return NT_STATUS_OK;
9216 }
9217
9218 NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli,
9219                                          TALLOC_CTX *mem_ctx,
9220                                          WERROR *werror)
9221 {
9222         struct PNP_RegisterNotification r;
9223         NTSTATUS status;
9224
9225         /* In parameters */
9226
9227         if (DEBUGLEVEL >= 10) {
9228                 NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &r);
9229         }
9230
9231         status = cli->dispatch(cli,
9232                                 mem_ctx,
9233                                 &ndr_table_ntsvcs,
9234                                 NDR_PNP_REGISTERNOTIFICATION,
9235                                 &r);
9236
9237         if (!NT_STATUS_IS_OK(status)) {
9238                 return status;
9239         }
9240
9241         if (DEBUGLEVEL >= 10) {
9242                 NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &r);
9243         }
9244
9245         if (NT_STATUS_IS_ERR(status)) {
9246                 return status;
9247         }
9248
9249         /* Return variables */
9250
9251         /* Return result */
9252         if (werror) {
9253                 *werror = r.out.result;
9254         }
9255
9256         return werror_to_ntstatus(r.out.result);
9257 }
9258
9259 struct rpccli_PNP_UnregisterNotification_state {
9260         struct PNP_UnregisterNotification orig;
9261         struct PNP_UnregisterNotification tmp;
9262         TALLOC_CTX *out_mem_ctx;
9263         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9264 };
9265
9266 static void rpccli_PNP_UnregisterNotification_done(struct tevent_req *subreq);
9267
9268 struct tevent_req *rpccli_PNP_UnregisterNotification_send(TALLOC_CTX *mem_ctx,
9269                                                           struct tevent_context *ev,
9270                                                           struct rpc_pipe_client *cli)
9271 {
9272         struct tevent_req *req;
9273         struct rpccli_PNP_UnregisterNotification_state *state;
9274         struct tevent_req *subreq;
9275
9276         req = tevent_req_create(mem_ctx, &state,
9277                                 struct rpccli_PNP_UnregisterNotification_state);
9278         if (req == NULL) {
9279                 return NULL;
9280         }
9281         state->out_mem_ctx = NULL;
9282         state->dispatch_recv = cli->dispatch_recv;
9283
9284         /* In parameters */
9285
9286         /* Out parameters */
9287
9288         /* Result */
9289         ZERO_STRUCT(state->orig.out.result);
9290
9291         if (DEBUGLEVEL >= 10) {
9292                 NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &state->orig);
9293         }
9294
9295         /* make a temporary copy, that we pass to the dispatch function */
9296         state->tmp = state->orig;
9297
9298         subreq = cli->dispatch_send(state, ev, cli,
9299                                     &ndr_table_ntsvcs,
9300                                     NDR_PNP_UNREGISTERNOTIFICATION,
9301                                     &state->tmp);
9302         if (tevent_req_nomem(subreq, req)) {
9303                 return tevent_req_post(req, ev);
9304         }
9305         tevent_req_set_callback(subreq, rpccli_PNP_UnregisterNotification_done, req);
9306         return req;
9307 }
9308
9309 static void rpccli_PNP_UnregisterNotification_done(struct tevent_req *subreq)
9310 {
9311         struct tevent_req *req = tevent_req_callback_data(
9312                 subreq, struct tevent_req);
9313         struct rpccli_PNP_UnregisterNotification_state *state = tevent_req_data(
9314                 req, struct rpccli_PNP_UnregisterNotification_state);
9315         NTSTATUS status;
9316         TALLOC_CTX *mem_ctx;
9317
9318         if (state->out_mem_ctx) {
9319                 mem_ctx = state->out_mem_ctx;
9320         } else {
9321                 mem_ctx = state;
9322         }
9323
9324         status = state->dispatch_recv(subreq, mem_ctx);
9325         TALLOC_FREE(subreq);
9326         if (!NT_STATUS_IS_OK(status)) {
9327                 tevent_req_nterror(req, status);
9328                 return;
9329         }
9330
9331         /* Copy out parameters */
9332
9333         /* Copy result */
9334         state->orig.out.result = state->tmp.out.result;
9335
9336         /* Reset temporary structure */
9337         ZERO_STRUCT(state->tmp);
9338
9339         if (DEBUGLEVEL >= 10) {
9340                 NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &state->orig);
9341         }
9342
9343         tevent_req_done(req);
9344 }
9345
9346 NTSTATUS rpccli_PNP_UnregisterNotification_recv(struct tevent_req *req,
9347                                                 TALLOC_CTX *mem_ctx,
9348                                                 WERROR *result)
9349 {
9350         struct rpccli_PNP_UnregisterNotification_state *state = tevent_req_data(
9351                 req, struct rpccli_PNP_UnregisterNotification_state);
9352         NTSTATUS status;
9353
9354         if (tevent_req_is_nterror(req, &status)) {
9355                 tevent_req_received(req);
9356                 return status;
9357         }
9358
9359         /* Steal possbile out parameters to the callers context */
9360         talloc_steal(mem_ctx, state->out_mem_ctx);
9361
9362         /* Return result */
9363         *result = state->orig.out.result;
9364
9365         tevent_req_received(req);
9366         return NT_STATUS_OK;
9367 }
9368
9369 NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli,
9370                                            TALLOC_CTX *mem_ctx,
9371                                            WERROR *werror)
9372 {
9373         struct PNP_UnregisterNotification r;
9374         NTSTATUS status;
9375
9376         /* In parameters */
9377
9378         if (DEBUGLEVEL >= 10) {
9379                 NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &r);
9380         }
9381
9382         status = cli->dispatch(cli,
9383                                 mem_ctx,
9384                                 &ndr_table_ntsvcs,
9385                                 NDR_PNP_UNREGISTERNOTIFICATION,
9386                                 &r);
9387
9388         if (!NT_STATUS_IS_OK(status)) {
9389                 return status;
9390         }
9391
9392         if (DEBUGLEVEL >= 10) {
9393                 NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &r);
9394         }
9395
9396         if (NT_STATUS_IS_ERR(status)) {
9397                 return status;
9398         }
9399
9400         /* Return variables */
9401
9402         /* Return result */
9403         if (werror) {
9404                 *werror = r.out.result;
9405         }
9406
9407         return werror_to_ntstatus(r.out.result);
9408 }
9409
9410 struct rpccli_PNP_GetCustomDevProp_state {
9411         struct PNP_GetCustomDevProp orig;
9412         struct PNP_GetCustomDevProp tmp;
9413         TALLOC_CTX *out_mem_ctx;
9414         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9415 };
9416
9417 static void rpccli_PNP_GetCustomDevProp_done(struct tevent_req *subreq);
9418
9419 struct tevent_req *rpccli_PNP_GetCustomDevProp_send(TALLOC_CTX *mem_ctx,
9420                                                     struct tevent_context *ev,
9421                                                     struct rpc_pipe_client *cli)
9422 {
9423         struct tevent_req *req;
9424         struct rpccli_PNP_GetCustomDevProp_state *state;
9425         struct tevent_req *subreq;
9426
9427         req = tevent_req_create(mem_ctx, &state,
9428                                 struct rpccli_PNP_GetCustomDevProp_state);
9429         if (req == NULL) {
9430                 return NULL;
9431         }
9432         state->out_mem_ctx = NULL;
9433         state->dispatch_recv = cli->dispatch_recv;
9434
9435         /* In parameters */
9436
9437         /* Out parameters */
9438
9439         /* Result */
9440         ZERO_STRUCT(state->orig.out.result);
9441
9442         if (DEBUGLEVEL >= 10) {
9443                 NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &state->orig);
9444         }
9445
9446         /* make a temporary copy, that we pass to the dispatch function */
9447         state->tmp = state->orig;
9448
9449         subreq = cli->dispatch_send(state, ev, cli,
9450                                     &ndr_table_ntsvcs,
9451                                     NDR_PNP_GETCUSTOMDEVPROP,
9452                                     &state->tmp);
9453         if (tevent_req_nomem(subreq, req)) {
9454                 return tevent_req_post(req, ev);
9455         }
9456         tevent_req_set_callback(subreq, rpccli_PNP_GetCustomDevProp_done, req);
9457         return req;
9458 }
9459
9460 static void rpccli_PNP_GetCustomDevProp_done(struct tevent_req *subreq)
9461 {
9462         struct tevent_req *req = tevent_req_callback_data(
9463                 subreq, struct tevent_req);
9464         struct rpccli_PNP_GetCustomDevProp_state *state = tevent_req_data(
9465                 req, struct rpccli_PNP_GetCustomDevProp_state);
9466         NTSTATUS status;
9467         TALLOC_CTX *mem_ctx;
9468
9469         if (state->out_mem_ctx) {
9470                 mem_ctx = state->out_mem_ctx;
9471         } else {
9472                 mem_ctx = state;
9473         }
9474
9475         status = state->dispatch_recv(subreq, mem_ctx);
9476         TALLOC_FREE(subreq);
9477         if (!NT_STATUS_IS_OK(status)) {
9478                 tevent_req_nterror(req, status);
9479                 return;
9480         }
9481
9482         /* Copy out parameters */
9483
9484         /* Copy result */
9485         state->orig.out.result = state->tmp.out.result;
9486
9487         /* Reset temporary structure */
9488         ZERO_STRUCT(state->tmp);
9489
9490         if (DEBUGLEVEL >= 10) {
9491                 NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &state->orig);
9492         }
9493
9494         tevent_req_done(req);
9495 }
9496
9497 NTSTATUS rpccli_PNP_GetCustomDevProp_recv(struct tevent_req *req,
9498                                           TALLOC_CTX *mem_ctx,
9499                                           WERROR *result)
9500 {
9501         struct rpccli_PNP_GetCustomDevProp_state *state = tevent_req_data(
9502                 req, struct rpccli_PNP_GetCustomDevProp_state);
9503         NTSTATUS status;
9504
9505         if (tevent_req_is_nterror(req, &status)) {
9506                 tevent_req_received(req);
9507                 return status;
9508         }
9509
9510         /* Steal possbile out parameters to the callers context */
9511         talloc_steal(mem_ctx, state->out_mem_ctx);
9512
9513         /* Return result */
9514         *result = state->orig.out.result;
9515
9516         tevent_req_received(req);
9517         return NT_STATUS_OK;
9518 }
9519
9520 NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli,
9521                                      TALLOC_CTX *mem_ctx,
9522                                      WERROR *werror)
9523 {
9524         struct PNP_GetCustomDevProp r;
9525         NTSTATUS status;
9526
9527         /* In parameters */
9528
9529         if (DEBUGLEVEL >= 10) {
9530                 NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &r);
9531         }
9532
9533         status = cli->dispatch(cli,
9534                                 mem_ctx,
9535                                 &ndr_table_ntsvcs,
9536                                 NDR_PNP_GETCUSTOMDEVPROP,
9537                                 &r);
9538
9539         if (!NT_STATUS_IS_OK(status)) {
9540                 return status;
9541         }
9542
9543         if (DEBUGLEVEL >= 10) {
9544                 NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &r);
9545         }
9546
9547         if (NT_STATUS_IS_ERR(status)) {
9548                 return status;
9549         }
9550
9551         /* Return variables */
9552
9553         /* Return result */
9554         if (werror) {
9555                 *werror = r.out.result;
9556         }
9557
9558         return werror_to_ntstatus(r.out.result);
9559 }
9560
9561 struct rpccli_PNP_GetVersionInternal_state {
9562         struct PNP_GetVersionInternal orig;
9563         struct PNP_GetVersionInternal tmp;
9564         TALLOC_CTX *out_mem_ctx;
9565         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9566 };
9567
9568 static void rpccli_PNP_GetVersionInternal_done(struct tevent_req *subreq);
9569
9570 struct tevent_req *rpccli_PNP_GetVersionInternal_send(TALLOC_CTX *mem_ctx,
9571                                                       struct tevent_context *ev,
9572                                                       struct rpc_pipe_client *cli)
9573 {
9574         struct tevent_req *req;
9575         struct rpccli_PNP_GetVersionInternal_state *state;
9576         struct tevent_req *subreq;
9577
9578         req = tevent_req_create(mem_ctx, &state,
9579                                 struct rpccli_PNP_GetVersionInternal_state);
9580         if (req == NULL) {
9581                 return NULL;
9582         }
9583         state->out_mem_ctx = NULL;
9584         state->dispatch_recv = cli->dispatch_recv;
9585
9586         /* In parameters */
9587
9588         /* Out parameters */
9589
9590         /* Result */
9591         ZERO_STRUCT(state->orig.out.result);
9592
9593         if (DEBUGLEVEL >= 10) {
9594                 NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &state->orig);
9595         }
9596
9597         /* make a temporary copy, that we pass to the dispatch function */
9598         state->tmp = state->orig;
9599
9600         subreq = cli->dispatch_send(state, ev, cli,
9601                                     &ndr_table_ntsvcs,
9602                                     NDR_PNP_GETVERSIONINTERNAL,
9603                                     &state->tmp);
9604         if (tevent_req_nomem(subreq, req)) {
9605                 return tevent_req_post(req, ev);
9606         }
9607         tevent_req_set_callback(subreq, rpccli_PNP_GetVersionInternal_done, req);
9608         return req;
9609 }
9610
9611 static void rpccli_PNP_GetVersionInternal_done(struct tevent_req *subreq)
9612 {
9613         struct tevent_req *req = tevent_req_callback_data(
9614                 subreq, struct tevent_req);
9615         struct rpccli_PNP_GetVersionInternal_state *state = tevent_req_data(
9616                 req, struct rpccli_PNP_GetVersionInternal_state);
9617         NTSTATUS status;
9618         TALLOC_CTX *mem_ctx;
9619
9620         if (state->out_mem_ctx) {
9621                 mem_ctx = state->out_mem_ctx;
9622         } else {
9623                 mem_ctx = state;
9624         }
9625
9626         status = state->dispatch_recv(subreq, mem_ctx);
9627         TALLOC_FREE(subreq);
9628         if (!NT_STATUS_IS_OK(status)) {
9629                 tevent_req_nterror(req, status);
9630                 return;
9631         }
9632
9633         /* Copy out parameters */
9634
9635         /* Copy result */
9636         state->orig.out.result = state->tmp.out.result;
9637
9638         /* Reset temporary structure */
9639         ZERO_STRUCT(state->tmp);
9640
9641         if (DEBUGLEVEL >= 10) {
9642                 NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &state->orig);
9643         }
9644
9645         tevent_req_done(req);
9646 }
9647
9648 NTSTATUS rpccli_PNP_GetVersionInternal_recv(struct tevent_req *req,
9649                                             TALLOC_CTX *mem_ctx,
9650                                             WERROR *result)
9651 {
9652         struct rpccli_PNP_GetVersionInternal_state *state = tevent_req_data(
9653                 req, struct rpccli_PNP_GetVersionInternal_state);
9654         NTSTATUS status;
9655
9656         if (tevent_req_is_nterror(req, &status)) {
9657                 tevent_req_received(req);
9658                 return status;
9659         }
9660
9661         /* Steal possbile out parameters to the callers context */
9662         talloc_steal(mem_ctx, state->out_mem_ctx);
9663
9664         /* Return result */
9665         *result = state->orig.out.result;
9666
9667         tevent_req_received(req);
9668         return NT_STATUS_OK;
9669 }
9670
9671 NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli,
9672                                        TALLOC_CTX *mem_ctx,
9673                                        WERROR *werror)
9674 {
9675         struct PNP_GetVersionInternal r;
9676         NTSTATUS status;
9677
9678         /* In parameters */
9679
9680         if (DEBUGLEVEL >= 10) {
9681                 NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &r);
9682         }
9683
9684         status = cli->dispatch(cli,
9685                                 mem_ctx,
9686                                 &ndr_table_ntsvcs,
9687                                 NDR_PNP_GETVERSIONINTERNAL,
9688                                 &r);
9689
9690         if (!NT_STATUS_IS_OK(status)) {
9691                 return status;
9692         }
9693
9694         if (DEBUGLEVEL >= 10) {
9695                 NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &r);
9696         }
9697
9698         if (NT_STATUS_IS_ERR(status)) {
9699                 return status;
9700         }
9701
9702         /* Return variables */
9703
9704         /* Return result */
9705         if (werror) {
9706                 *werror = r.out.result;
9707         }
9708
9709         return werror_to_ntstatus(r.out.result);
9710 }
9711
9712 struct rpccli_PNP_GetBlockedDriverInfo_state {
9713         struct PNP_GetBlockedDriverInfo orig;
9714         struct PNP_GetBlockedDriverInfo tmp;
9715         TALLOC_CTX *out_mem_ctx;
9716         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9717 };
9718
9719 static void rpccli_PNP_GetBlockedDriverInfo_done(struct tevent_req *subreq);
9720
9721 struct tevent_req *rpccli_PNP_GetBlockedDriverInfo_send(TALLOC_CTX *mem_ctx,
9722                                                         struct tevent_context *ev,
9723                                                         struct rpc_pipe_client *cli)
9724 {
9725         struct tevent_req *req;
9726         struct rpccli_PNP_GetBlockedDriverInfo_state *state;
9727         struct tevent_req *subreq;
9728
9729         req = tevent_req_create(mem_ctx, &state,
9730                                 struct rpccli_PNP_GetBlockedDriverInfo_state);
9731         if (req == NULL) {
9732                 return NULL;
9733         }
9734         state->out_mem_ctx = NULL;
9735         state->dispatch_recv = cli->dispatch_recv;
9736
9737         /* In parameters */
9738
9739         /* Out parameters */
9740
9741         /* Result */
9742         ZERO_STRUCT(state->orig.out.result);
9743
9744         if (DEBUGLEVEL >= 10) {
9745                 NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, &state->orig);
9746         }
9747
9748         /* make a temporary copy, that we pass to the dispatch function */
9749         state->tmp = state->orig;
9750
9751         subreq = cli->dispatch_send(state, ev, cli,
9752                                     &ndr_table_ntsvcs,
9753                                     NDR_PNP_GETBLOCKEDDRIVERINFO,
9754                                     &state->tmp);
9755         if (tevent_req_nomem(subreq, req)) {
9756                 return tevent_req_post(req, ev);
9757         }
9758         tevent_req_set_callback(subreq, rpccli_PNP_GetBlockedDriverInfo_done, req);
9759         return req;
9760 }
9761
9762 static void rpccli_PNP_GetBlockedDriverInfo_done(struct tevent_req *subreq)
9763 {
9764         struct tevent_req *req = tevent_req_callback_data(
9765                 subreq, struct tevent_req);
9766         struct rpccli_PNP_GetBlockedDriverInfo_state *state = tevent_req_data(
9767                 req, struct rpccli_PNP_GetBlockedDriverInfo_state);
9768         NTSTATUS status;
9769         TALLOC_CTX *mem_ctx;
9770
9771         if (state->out_mem_ctx) {
9772                 mem_ctx = state->out_mem_ctx;
9773         } else {
9774                 mem_ctx = state;
9775         }
9776
9777         status = state->dispatch_recv(subreq, mem_ctx);
9778         TALLOC_FREE(subreq);
9779         if (!NT_STATUS_IS_OK(status)) {
9780                 tevent_req_nterror(req, status);
9781                 return;
9782         }
9783
9784         /* Copy out parameters */
9785
9786         /* Copy result */
9787         state->orig.out.result = state->tmp.out.result;
9788
9789         /* Reset temporary structure */
9790         ZERO_STRUCT(state->tmp);
9791
9792         if (DEBUGLEVEL >= 10) {
9793                 NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, &state->orig);
9794         }
9795
9796         tevent_req_done(req);
9797 }
9798
9799 NTSTATUS rpccli_PNP_GetBlockedDriverInfo_recv(struct tevent_req *req,
9800                                               TALLOC_CTX *mem_ctx,
9801                                               WERROR *result)
9802 {
9803         struct rpccli_PNP_GetBlockedDriverInfo_state *state = tevent_req_data(
9804                 req, struct rpccli_PNP_GetBlockedDriverInfo_state);
9805         NTSTATUS status;
9806
9807         if (tevent_req_is_nterror(req, &status)) {
9808                 tevent_req_received(req);
9809                 return status;
9810         }
9811
9812         /* Steal possbile out parameters to the callers context */
9813         talloc_steal(mem_ctx, state->out_mem_ctx);
9814
9815         /* Return result */
9816         *result = state->orig.out.result;
9817
9818         tevent_req_received(req);
9819         return NT_STATUS_OK;
9820 }
9821
9822 NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli,
9823                                          TALLOC_CTX *mem_ctx,
9824                                          WERROR *werror)
9825 {
9826         struct PNP_GetBlockedDriverInfo r;
9827         NTSTATUS status;
9828
9829         /* In parameters */
9830
9831         if (DEBUGLEVEL >= 10) {
9832                 NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, &r);
9833         }
9834
9835         status = cli->dispatch(cli,
9836                                 mem_ctx,
9837                                 &ndr_table_ntsvcs,
9838                                 NDR_PNP_GETBLOCKEDDRIVERINFO,
9839                                 &r);
9840
9841         if (!NT_STATUS_IS_OK(status)) {
9842                 return status;
9843         }
9844
9845         if (DEBUGLEVEL >= 10) {
9846                 NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, &r);
9847         }
9848
9849         if (NT_STATUS_IS_ERR(status)) {
9850                 return status;
9851         }
9852
9853         /* Return variables */
9854
9855         /* Return result */
9856         if (werror) {
9857                 *werror = r.out.result;
9858         }
9859
9860         return werror_to_ntstatus(r.out.result);
9861 }
9862
9863 struct rpccli_PNP_GetServerSideDeviceInstallFlags_state {
9864         struct PNP_GetServerSideDeviceInstallFlags orig;
9865         struct PNP_GetServerSideDeviceInstallFlags tmp;
9866         TALLOC_CTX *out_mem_ctx;
9867         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9868 };
9869
9870 static void rpccli_PNP_GetServerSideDeviceInstallFlags_done(struct tevent_req *subreq);
9871
9872 struct tevent_req *rpccli_PNP_GetServerSideDeviceInstallFlags_send(TALLOC_CTX *mem_ctx,
9873                                                                    struct tevent_context *ev,
9874                                                                    struct rpc_pipe_client *cli)
9875 {
9876         struct tevent_req *req;
9877         struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state;
9878         struct tevent_req *subreq;
9879
9880         req = tevent_req_create(mem_ctx, &state,
9881                                 struct rpccli_PNP_GetServerSideDeviceInstallFlags_state);
9882         if (req == NULL) {
9883                 return NULL;
9884         }
9885         state->out_mem_ctx = NULL;
9886         state->dispatch_recv = cli->dispatch_recv;
9887
9888         /* In parameters */
9889
9890         /* Out parameters */
9891
9892         /* Result */
9893         ZERO_STRUCT(state->orig.out.result);
9894
9895         if (DEBUGLEVEL >= 10) {
9896                 NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, &state->orig);
9897         }
9898
9899         /* make a temporary copy, that we pass to the dispatch function */
9900         state->tmp = state->orig;
9901
9902         subreq = cli->dispatch_send(state, ev, cli,
9903                                     &ndr_table_ntsvcs,
9904                                     NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS,
9905                                     &state->tmp);
9906         if (tevent_req_nomem(subreq, req)) {
9907                 return tevent_req_post(req, ev);
9908         }
9909         tevent_req_set_callback(subreq, rpccli_PNP_GetServerSideDeviceInstallFlags_done, req);
9910         return req;
9911 }
9912
9913 static void rpccli_PNP_GetServerSideDeviceInstallFlags_done(struct tevent_req *subreq)
9914 {
9915         struct tevent_req *req = tevent_req_callback_data(
9916                 subreq, struct tevent_req);
9917         struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state = tevent_req_data(
9918                 req, struct rpccli_PNP_GetServerSideDeviceInstallFlags_state);
9919         NTSTATUS status;
9920         TALLOC_CTX *mem_ctx;
9921
9922         if (state->out_mem_ctx) {
9923                 mem_ctx = state->out_mem_ctx;
9924         } else {
9925                 mem_ctx = state;
9926         }
9927
9928         status = state->dispatch_recv(subreq, mem_ctx);
9929         TALLOC_FREE(subreq);
9930         if (!NT_STATUS_IS_OK(status)) {
9931                 tevent_req_nterror(req, status);
9932                 return;
9933         }
9934
9935         /* Copy out parameters */
9936
9937         /* Copy result */
9938         state->orig.out.result = state->tmp.out.result;
9939
9940         /* Reset temporary structure */
9941         ZERO_STRUCT(state->tmp);
9942
9943         if (DEBUGLEVEL >= 10) {
9944                 NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, &state->orig);
9945         }
9946
9947         tevent_req_done(req);
9948 }
9949
9950 NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags_recv(struct tevent_req *req,
9951                                                          TALLOC_CTX *mem_ctx,
9952                                                          WERROR *result)
9953 {
9954         struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state = tevent_req_data(
9955                 req, struct rpccli_PNP_GetServerSideDeviceInstallFlags_state);
9956         NTSTATUS status;
9957
9958         if (tevent_req_is_nterror(req, &status)) {
9959                 tevent_req_received(req);
9960                 return status;
9961         }
9962
9963         /* Steal possbile out parameters to the callers context */
9964         talloc_steal(mem_ctx, state->out_mem_ctx);
9965
9966         /* Return result */
9967         *result = state->orig.out.result;
9968
9969         tevent_req_received(req);
9970         return NT_STATUS_OK;
9971 }
9972
9973 NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli,
9974                                                     TALLOC_CTX *mem_ctx,
9975                                                     WERROR *werror)
9976 {
9977         struct PNP_GetServerSideDeviceInstallFlags r;
9978         NTSTATUS status;
9979
9980         /* In parameters */
9981
9982         if (DEBUGLEVEL >= 10) {
9983                 NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r);
9984         }
9985
9986         status = cli->dispatch(cli,
9987                                 mem_ctx,
9988                                 &ndr_table_ntsvcs,
9989                                 NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS,
9990                                 &r);
9991
9992         if (!NT_STATUS_IS_OK(status)) {
9993                 return status;
9994         }
9995
9996         if (DEBUGLEVEL >= 10) {
9997                 NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r);
9998         }
9999
10000         if (NT_STATUS_IS_ERR(status)) {
10001                 return status;
10002         }
10003
10004         /* Return variables */
10005
10006         /* Return result */
10007         if (werror) {
10008                 *werror = r.out.result;
10009         }
10010
10011         return werror_to_ntstatus(r.out.result);
10012 }
10013