s3: Do not reference ndr_table_<pipe> in the cli_ routines directly
[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         /* make a temporary copy, that we pass to the dispatch function */
42         state->tmp = state->orig;
43
44         subreq = cli->dispatch_send(state, ev, cli,
45                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
46                                     NDR_PNP_DISCONNECT,
47                                     &state->tmp);
48         if (tevent_req_nomem(subreq, req)) {
49                 return tevent_req_post(req, ev);
50         }
51         tevent_req_set_callback(subreq, rpccli_PNP_Disconnect_done, req);
52         return req;
53 }
54
55 static void rpccli_PNP_Disconnect_done(struct tevent_req *subreq)
56 {
57         struct tevent_req *req = tevent_req_callback_data(
58                 subreq, struct tevent_req);
59         struct rpccli_PNP_Disconnect_state *state = tevent_req_data(
60                 req, struct rpccli_PNP_Disconnect_state);
61         NTSTATUS status;
62         TALLOC_CTX *mem_ctx;
63
64         if (state->out_mem_ctx) {
65                 mem_ctx = state->out_mem_ctx;
66         } else {
67                 mem_ctx = state;
68         }
69
70         status = state->dispatch_recv(subreq, mem_ctx);
71         TALLOC_FREE(subreq);
72         if (!NT_STATUS_IS_OK(status)) {
73                 tevent_req_nterror(req, status);
74                 return;
75         }
76
77         /* Copy out parameters */
78
79         /* Copy result */
80         state->orig.out.result = state->tmp.out.result;
81
82         /* Reset temporary structure */
83         ZERO_STRUCT(state->tmp);
84
85         tevent_req_done(req);
86 }
87
88 NTSTATUS rpccli_PNP_Disconnect_recv(struct tevent_req *req,
89                                     TALLOC_CTX *mem_ctx,
90                                     WERROR *result)
91 {
92         struct rpccli_PNP_Disconnect_state *state = tevent_req_data(
93                 req, struct rpccli_PNP_Disconnect_state);
94         NTSTATUS status;
95
96         if (tevent_req_is_nterror(req, &status)) {
97                 tevent_req_received(req);
98                 return status;
99         }
100
101         /* Steal possbile out parameters to the callers context */
102         talloc_steal(mem_ctx, state->out_mem_ctx);
103
104         /* Return result */
105         *result = state->orig.out.result;
106
107         tevent_req_received(req);
108         return NT_STATUS_OK;
109 }
110
111 NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli,
112                                TALLOC_CTX *mem_ctx,
113                                WERROR *werror)
114 {
115         struct PNP_Disconnect r;
116         NTSTATUS status;
117
118         /* In parameters */
119
120         status = cli->dispatch(cli,
121                                 mem_ctx,
122                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
123                                 NDR_PNP_DISCONNECT,
124                                 &r);
125
126         if (!NT_STATUS_IS_OK(status)) {
127                 return status;
128         }
129
130         if (NT_STATUS_IS_ERR(status)) {
131                 return status;
132         }
133
134         /* Return variables */
135
136         /* Return result */
137         if (werror) {
138                 *werror = r.out.result;
139         }
140
141         return werror_to_ntstatus(r.out.result);
142 }
143
144 struct rpccli_PNP_Connect_state {
145         struct PNP_Connect orig;
146         struct PNP_Connect tmp;
147         TALLOC_CTX *out_mem_ctx;
148         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
149 };
150
151 static void rpccli_PNP_Connect_done(struct tevent_req *subreq);
152
153 struct tevent_req *rpccli_PNP_Connect_send(TALLOC_CTX *mem_ctx,
154                                            struct tevent_context *ev,
155                                            struct rpc_pipe_client *cli)
156 {
157         struct tevent_req *req;
158         struct rpccli_PNP_Connect_state *state;
159         struct tevent_req *subreq;
160
161         req = tevent_req_create(mem_ctx, &state,
162                                 struct rpccli_PNP_Connect_state);
163         if (req == NULL) {
164                 return NULL;
165         }
166         state->out_mem_ctx = NULL;
167         state->dispatch_recv = cli->dispatch_recv;
168
169         /* In parameters */
170
171         /* Out parameters */
172
173         /* Result */
174         ZERO_STRUCT(state->orig.out.result);
175
176         /* make a temporary copy, that we pass to the dispatch function */
177         state->tmp = state->orig;
178
179         subreq = cli->dispatch_send(state, ev, cli,
180                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
181                                     NDR_PNP_CONNECT,
182                                     &state->tmp);
183         if (tevent_req_nomem(subreq, req)) {
184                 return tevent_req_post(req, ev);
185         }
186         tevent_req_set_callback(subreq, rpccli_PNP_Connect_done, req);
187         return req;
188 }
189
190 static void rpccli_PNP_Connect_done(struct tevent_req *subreq)
191 {
192         struct tevent_req *req = tevent_req_callback_data(
193                 subreq, struct tevent_req);
194         struct rpccli_PNP_Connect_state *state = tevent_req_data(
195                 req, struct rpccli_PNP_Connect_state);
196         NTSTATUS status;
197         TALLOC_CTX *mem_ctx;
198
199         if (state->out_mem_ctx) {
200                 mem_ctx = state->out_mem_ctx;
201         } else {
202                 mem_ctx = state;
203         }
204
205         status = state->dispatch_recv(subreq, mem_ctx);
206         TALLOC_FREE(subreq);
207         if (!NT_STATUS_IS_OK(status)) {
208                 tevent_req_nterror(req, status);
209                 return;
210         }
211
212         /* Copy out parameters */
213
214         /* Copy result */
215         state->orig.out.result = state->tmp.out.result;
216
217         /* Reset temporary structure */
218         ZERO_STRUCT(state->tmp);
219
220         tevent_req_done(req);
221 }
222
223 NTSTATUS rpccli_PNP_Connect_recv(struct tevent_req *req,
224                                  TALLOC_CTX *mem_ctx,
225                                  WERROR *result)
226 {
227         struct rpccli_PNP_Connect_state *state = tevent_req_data(
228                 req, struct rpccli_PNP_Connect_state);
229         NTSTATUS status;
230
231         if (tevent_req_is_nterror(req, &status)) {
232                 tevent_req_received(req);
233                 return status;
234         }
235
236         /* Steal possbile out parameters to the callers context */
237         talloc_steal(mem_ctx, state->out_mem_ctx);
238
239         /* Return result */
240         *result = state->orig.out.result;
241
242         tevent_req_received(req);
243         return NT_STATUS_OK;
244 }
245
246 NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli,
247                             TALLOC_CTX *mem_ctx,
248                             WERROR *werror)
249 {
250         struct PNP_Connect r;
251         NTSTATUS status;
252
253         /* In parameters */
254
255         status = cli->dispatch(cli,
256                                 mem_ctx,
257                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
258                                 NDR_PNP_CONNECT,
259                                 &r);
260
261         if (!NT_STATUS_IS_OK(status)) {
262                 return status;
263         }
264
265         if (NT_STATUS_IS_ERR(status)) {
266                 return status;
267         }
268
269         /* Return variables */
270
271         /* Return result */
272         if (werror) {
273                 *werror = r.out.result;
274         }
275
276         return werror_to_ntstatus(r.out.result);
277 }
278
279 struct rpccli_PNP_GetVersion_state {
280         struct PNP_GetVersion orig;
281         struct PNP_GetVersion tmp;
282         TALLOC_CTX *out_mem_ctx;
283         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
284 };
285
286 static void rpccli_PNP_GetVersion_done(struct tevent_req *subreq);
287
288 struct tevent_req *rpccli_PNP_GetVersion_send(TALLOC_CTX *mem_ctx,
289                                               struct tevent_context *ev,
290                                               struct rpc_pipe_client *cli,
291                                               uint16_t *_version /* [out] [ref] */)
292 {
293         struct tevent_req *req;
294         struct rpccli_PNP_GetVersion_state *state;
295         struct tevent_req *subreq;
296
297         req = tevent_req_create(mem_ctx, &state,
298                                 struct rpccli_PNP_GetVersion_state);
299         if (req == NULL) {
300                 return NULL;
301         }
302         state->out_mem_ctx = NULL;
303         state->dispatch_recv = cli->dispatch_recv;
304
305         /* In parameters */
306
307         /* Out parameters */
308         state->orig.out.version = _version;
309
310         /* Result */
311         ZERO_STRUCT(state->orig.out.result);
312
313         state->out_mem_ctx = talloc_named_const(state, 0,
314                              "rpccli_PNP_GetVersion_out_memory");
315         if (tevent_req_nomem(state->out_mem_ctx, req)) {
316                 return tevent_req_post(req, ev);
317         }
318
319         /* make a temporary copy, that we pass to the dispatch function */
320         state->tmp = state->orig;
321
322         subreq = cli->dispatch_send(state, ev, cli,
323                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
324                                     NDR_PNP_GETVERSION,
325                                     &state->tmp);
326         if (tevent_req_nomem(subreq, req)) {
327                 return tevent_req_post(req, ev);
328         }
329         tevent_req_set_callback(subreq, rpccli_PNP_GetVersion_done, req);
330         return req;
331 }
332
333 static void rpccli_PNP_GetVersion_done(struct tevent_req *subreq)
334 {
335         struct tevent_req *req = tevent_req_callback_data(
336                 subreq, struct tevent_req);
337         struct rpccli_PNP_GetVersion_state *state = tevent_req_data(
338                 req, struct rpccli_PNP_GetVersion_state);
339         NTSTATUS status;
340         TALLOC_CTX *mem_ctx;
341
342         if (state->out_mem_ctx) {
343                 mem_ctx = state->out_mem_ctx;
344         } else {
345                 mem_ctx = state;
346         }
347
348         status = state->dispatch_recv(subreq, mem_ctx);
349         TALLOC_FREE(subreq);
350         if (!NT_STATUS_IS_OK(status)) {
351                 tevent_req_nterror(req, status);
352                 return;
353         }
354
355         /* Copy out parameters */
356         *state->orig.out.version = *state->tmp.out.version;
357
358         /* Copy result */
359         state->orig.out.result = state->tmp.out.result;
360
361         /* Reset temporary structure */
362         ZERO_STRUCT(state->tmp);
363
364         tevent_req_done(req);
365 }
366
367 NTSTATUS rpccli_PNP_GetVersion_recv(struct tevent_req *req,
368                                     TALLOC_CTX *mem_ctx,
369                                     WERROR *result)
370 {
371         struct rpccli_PNP_GetVersion_state *state = tevent_req_data(
372                 req, struct rpccli_PNP_GetVersion_state);
373         NTSTATUS status;
374
375         if (tevent_req_is_nterror(req, &status)) {
376                 tevent_req_received(req);
377                 return status;
378         }
379
380         /* Steal possbile out parameters to the callers context */
381         talloc_steal(mem_ctx, state->out_mem_ctx);
382
383         /* Return result */
384         *result = state->orig.out.result;
385
386         tevent_req_received(req);
387         return NT_STATUS_OK;
388 }
389
390 NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
391                                TALLOC_CTX *mem_ctx,
392                                uint16_t *version /* [out] [ref] */,
393                                WERROR *werror)
394 {
395         struct PNP_GetVersion r;
396         NTSTATUS status;
397
398         /* In parameters */
399
400         status = cli->dispatch(cli,
401                                 mem_ctx,
402                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
403                                 NDR_PNP_GETVERSION,
404                                 &r);
405
406         if (!NT_STATUS_IS_OK(status)) {
407                 return status;
408         }
409
410         if (NT_STATUS_IS_ERR(status)) {
411                 return status;
412         }
413
414         /* Return variables */
415         *version = *r.out.version;
416
417         /* Return result */
418         if (werror) {
419                 *werror = r.out.result;
420         }
421
422         return werror_to_ntstatus(r.out.result);
423 }
424
425 struct rpccli_PNP_GetGlobalState_state {
426         struct PNP_GetGlobalState orig;
427         struct PNP_GetGlobalState tmp;
428         TALLOC_CTX *out_mem_ctx;
429         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
430 };
431
432 static void rpccli_PNP_GetGlobalState_done(struct tevent_req *subreq);
433
434 struct tevent_req *rpccli_PNP_GetGlobalState_send(TALLOC_CTX *mem_ctx,
435                                                   struct tevent_context *ev,
436                                                   struct rpc_pipe_client *cli)
437 {
438         struct tevent_req *req;
439         struct rpccli_PNP_GetGlobalState_state *state;
440         struct tevent_req *subreq;
441
442         req = tevent_req_create(mem_ctx, &state,
443                                 struct rpccli_PNP_GetGlobalState_state);
444         if (req == NULL) {
445                 return NULL;
446         }
447         state->out_mem_ctx = NULL;
448         state->dispatch_recv = cli->dispatch_recv;
449
450         /* In parameters */
451
452         /* Out parameters */
453
454         /* Result */
455         ZERO_STRUCT(state->orig.out.result);
456
457         /* make a temporary copy, that we pass to the dispatch function */
458         state->tmp = state->orig;
459
460         subreq = cli->dispatch_send(state, ev, cli,
461                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
462                                     NDR_PNP_GETGLOBALSTATE,
463                                     &state->tmp);
464         if (tevent_req_nomem(subreq, req)) {
465                 return tevent_req_post(req, ev);
466         }
467         tevent_req_set_callback(subreq, rpccli_PNP_GetGlobalState_done, req);
468         return req;
469 }
470
471 static void rpccli_PNP_GetGlobalState_done(struct tevent_req *subreq)
472 {
473         struct tevent_req *req = tevent_req_callback_data(
474                 subreq, struct tevent_req);
475         struct rpccli_PNP_GetGlobalState_state *state = tevent_req_data(
476                 req, struct rpccli_PNP_GetGlobalState_state);
477         NTSTATUS status;
478         TALLOC_CTX *mem_ctx;
479
480         if (state->out_mem_ctx) {
481                 mem_ctx = state->out_mem_ctx;
482         } else {
483                 mem_ctx = state;
484         }
485
486         status = state->dispatch_recv(subreq, mem_ctx);
487         TALLOC_FREE(subreq);
488         if (!NT_STATUS_IS_OK(status)) {
489                 tevent_req_nterror(req, status);
490                 return;
491         }
492
493         /* Copy out parameters */
494
495         /* Copy result */
496         state->orig.out.result = state->tmp.out.result;
497
498         /* Reset temporary structure */
499         ZERO_STRUCT(state->tmp);
500
501         tevent_req_done(req);
502 }
503
504 NTSTATUS rpccli_PNP_GetGlobalState_recv(struct tevent_req *req,
505                                         TALLOC_CTX *mem_ctx,
506                                         WERROR *result)
507 {
508         struct rpccli_PNP_GetGlobalState_state *state = tevent_req_data(
509                 req, struct rpccli_PNP_GetGlobalState_state);
510         NTSTATUS status;
511
512         if (tevent_req_is_nterror(req, &status)) {
513                 tevent_req_received(req);
514                 return status;
515         }
516
517         /* Steal possbile out parameters to the callers context */
518         talloc_steal(mem_ctx, state->out_mem_ctx);
519
520         /* Return result */
521         *result = state->orig.out.result;
522
523         tevent_req_received(req);
524         return NT_STATUS_OK;
525 }
526
527 NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli,
528                                    TALLOC_CTX *mem_ctx,
529                                    WERROR *werror)
530 {
531         struct PNP_GetGlobalState r;
532         NTSTATUS status;
533
534         /* In parameters */
535
536         status = cli->dispatch(cli,
537                                 mem_ctx,
538                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
539                                 NDR_PNP_GETGLOBALSTATE,
540                                 &r);
541
542         if (!NT_STATUS_IS_OK(status)) {
543                 return status;
544         }
545
546         if (NT_STATUS_IS_ERR(status)) {
547                 return status;
548         }
549
550         /* Return variables */
551
552         /* Return result */
553         if (werror) {
554                 *werror = r.out.result;
555         }
556
557         return werror_to_ntstatus(r.out.result);
558 }
559
560 struct rpccli_PNP_InitDetection_state {
561         struct PNP_InitDetection orig;
562         struct PNP_InitDetection tmp;
563         TALLOC_CTX *out_mem_ctx;
564         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
565 };
566
567 static void rpccli_PNP_InitDetection_done(struct tevent_req *subreq);
568
569 struct tevent_req *rpccli_PNP_InitDetection_send(TALLOC_CTX *mem_ctx,
570                                                  struct tevent_context *ev,
571                                                  struct rpc_pipe_client *cli)
572 {
573         struct tevent_req *req;
574         struct rpccli_PNP_InitDetection_state *state;
575         struct tevent_req *subreq;
576
577         req = tevent_req_create(mem_ctx, &state,
578                                 struct rpccli_PNP_InitDetection_state);
579         if (req == NULL) {
580                 return NULL;
581         }
582         state->out_mem_ctx = NULL;
583         state->dispatch_recv = cli->dispatch_recv;
584
585         /* In parameters */
586
587         /* Out parameters */
588
589         /* Result */
590         ZERO_STRUCT(state->orig.out.result);
591
592         /* make a temporary copy, that we pass to the dispatch function */
593         state->tmp = state->orig;
594
595         subreq = cli->dispatch_send(state, ev, cli,
596                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
597                                     NDR_PNP_INITDETECTION,
598                                     &state->tmp);
599         if (tevent_req_nomem(subreq, req)) {
600                 return tevent_req_post(req, ev);
601         }
602         tevent_req_set_callback(subreq, rpccli_PNP_InitDetection_done, req);
603         return req;
604 }
605
606 static void rpccli_PNP_InitDetection_done(struct tevent_req *subreq)
607 {
608         struct tevent_req *req = tevent_req_callback_data(
609                 subreq, struct tevent_req);
610         struct rpccli_PNP_InitDetection_state *state = tevent_req_data(
611                 req, struct rpccli_PNP_InitDetection_state);
612         NTSTATUS status;
613         TALLOC_CTX *mem_ctx;
614
615         if (state->out_mem_ctx) {
616                 mem_ctx = state->out_mem_ctx;
617         } else {
618                 mem_ctx = state;
619         }
620
621         status = state->dispatch_recv(subreq, mem_ctx);
622         TALLOC_FREE(subreq);
623         if (!NT_STATUS_IS_OK(status)) {
624                 tevent_req_nterror(req, status);
625                 return;
626         }
627
628         /* Copy out parameters */
629
630         /* Copy result */
631         state->orig.out.result = state->tmp.out.result;
632
633         /* Reset temporary structure */
634         ZERO_STRUCT(state->tmp);
635
636         tevent_req_done(req);
637 }
638
639 NTSTATUS rpccli_PNP_InitDetection_recv(struct tevent_req *req,
640                                        TALLOC_CTX *mem_ctx,
641                                        WERROR *result)
642 {
643         struct rpccli_PNP_InitDetection_state *state = tevent_req_data(
644                 req, struct rpccli_PNP_InitDetection_state);
645         NTSTATUS status;
646
647         if (tevent_req_is_nterror(req, &status)) {
648                 tevent_req_received(req);
649                 return status;
650         }
651
652         /* Steal possbile out parameters to the callers context */
653         talloc_steal(mem_ctx, state->out_mem_ctx);
654
655         /* Return result */
656         *result = state->orig.out.result;
657
658         tevent_req_received(req);
659         return NT_STATUS_OK;
660 }
661
662 NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli,
663                                   TALLOC_CTX *mem_ctx,
664                                   WERROR *werror)
665 {
666         struct PNP_InitDetection r;
667         NTSTATUS status;
668
669         /* In parameters */
670
671         status = cli->dispatch(cli,
672                                 mem_ctx,
673                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
674                                 NDR_PNP_INITDETECTION,
675                                 &r);
676
677         if (!NT_STATUS_IS_OK(status)) {
678                 return status;
679         }
680
681         if (NT_STATUS_IS_ERR(status)) {
682                 return status;
683         }
684
685         /* Return variables */
686
687         /* Return result */
688         if (werror) {
689                 *werror = r.out.result;
690         }
691
692         return werror_to_ntstatus(r.out.result);
693 }
694
695 struct rpccli_PNP_ReportLogOn_state {
696         struct PNP_ReportLogOn orig;
697         struct PNP_ReportLogOn tmp;
698         TALLOC_CTX *out_mem_ctx;
699         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
700 };
701
702 static void rpccli_PNP_ReportLogOn_done(struct tevent_req *subreq);
703
704 struct tevent_req *rpccli_PNP_ReportLogOn_send(TALLOC_CTX *mem_ctx,
705                                                struct tevent_context *ev,
706                                                struct rpc_pipe_client *cli)
707 {
708         struct tevent_req *req;
709         struct rpccli_PNP_ReportLogOn_state *state;
710         struct tevent_req *subreq;
711
712         req = tevent_req_create(mem_ctx, &state,
713                                 struct rpccli_PNP_ReportLogOn_state);
714         if (req == NULL) {
715                 return NULL;
716         }
717         state->out_mem_ctx = NULL;
718         state->dispatch_recv = cli->dispatch_recv;
719
720         /* In parameters */
721
722         /* Out parameters */
723
724         /* Result */
725         ZERO_STRUCT(state->orig.out.result);
726
727         /* make a temporary copy, that we pass to the dispatch function */
728         state->tmp = state->orig;
729
730         subreq = cli->dispatch_send(state, ev, cli,
731                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
732                                     NDR_PNP_REPORTLOGON,
733                                     &state->tmp);
734         if (tevent_req_nomem(subreq, req)) {
735                 return tevent_req_post(req, ev);
736         }
737         tevent_req_set_callback(subreq, rpccli_PNP_ReportLogOn_done, req);
738         return req;
739 }
740
741 static void rpccli_PNP_ReportLogOn_done(struct tevent_req *subreq)
742 {
743         struct tevent_req *req = tevent_req_callback_data(
744                 subreq, struct tevent_req);
745         struct rpccli_PNP_ReportLogOn_state *state = tevent_req_data(
746                 req, struct rpccli_PNP_ReportLogOn_state);
747         NTSTATUS status;
748         TALLOC_CTX *mem_ctx;
749
750         if (state->out_mem_ctx) {
751                 mem_ctx = state->out_mem_ctx;
752         } else {
753                 mem_ctx = state;
754         }
755
756         status = state->dispatch_recv(subreq, mem_ctx);
757         TALLOC_FREE(subreq);
758         if (!NT_STATUS_IS_OK(status)) {
759                 tevent_req_nterror(req, status);
760                 return;
761         }
762
763         /* Copy out parameters */
764
765         /* Copy result */
766         state->orig.out.result = state->tmp.out.result;
767
768         /* Reset temporary structure */
769         ZERO_STRUCT(state->tmp);
770
771         tevent_req_done(req);
772 }
773
774 NTSTATUS rpccli_PNP_ReportLogOn_recv(struct tevent_req *req,
775                                      TALLOC_CTX *mem_ctx,
776                                      WERROR *result)
777 {
778         struct rpccli_PNP_ReportLogOn_state *state = tevent_req_data(
779                 req, struct rpccli_PNP_ReportLogOn_state);
780         NTSTATUS status;
781
782         if (tevent_req_is_nterror(req, &status)) {
783                 tevent_req_received(req);
784                 return status;
785         }
786
787         /* Steal possbile out parameters to the callers context */
788         talloc_steal(mem_ctx, state->out_mem_ctx);
789
790         /* Return result */
791         *result = state->orig.out.result;
792
793         tevent_req_received(req);
794         return NT_STATUS_OK;
795 }
796
797 NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli,
798                                 TALLOC_CTX *mem_ctx,
799                                 WERROR *werror)
800 {
801         struct PNP_ReportLogOn r;
802         NTSTATUS status;
803
804         /* In parameters */
805
806         status = cli->dispatch(cli,
807                                 mem_ctx,
808                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
809                                 NDR_PNP_REPORTLOGON,
810                                 &r);
811
812         if (!NT_STATUS_IS_OK(status)) {
813                 return status;
814         }
815
816         if (NT_STATUS_IS_ERR(status)) {
817                 return status;
818         }
819
820         /* Return variables */
821
822         /* Return result */
823         if (werror) {
824                 *werror = r.out.result;
825         }
826
827         return werror_to_ntstatus(r.out.result);
828 }
829
830 struct rpccli_PNP_ValidateDeviceInstance_state {
831         struct PNP_ValidateDeviceInstance orig;
832         struct PNP_ValidateDeviceInstance tmp;
833         TALLOC_CTX *out_mem_ctx;
834         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
835 };
836
837 static void rpccli_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq);
838
839 struct tevent_req *rpccli_PNP_ValidateDeviceInstance_send(TALLOC_CTX *mem_ctx,
840                                                           struct tevent_context *ev,
841                                                           struct rpc_pipe_client *cli,
842                                                           const char *_devicepath /* [in] [ref,charset(UTF16)] */,
843                                                           uint32_t _flags /* [in]  */)
844 {
845         struct tevent_req *req;
846         struct rpccli_PNP_ValidateDeviceInstance_state *state;
847         struct tevent_req *subreq;
848
849         req = tevent_req_create(mem_ctx, &state,
850                                 struct rpccli_PNP_ValidateDeviceInstance_state);
851         if (req == NULL) {
852                 return NULL;
853         }
854         state->out_mem_ctx = NULL;
855         state->dispatch_recv = cli->dispatch_recv;
856
857         /* In parameters */
858         state->orig.in.devicepath = _devicepath;
859         state->orig.in.flags = _flags;
860
861         /* Out parameters */
862
863         /* Result */
864         ZERO_STRUCT(state->orig.out.result);
865
866         /* make a temporary copy, that we pass to the dispatch function */
867         state->tmp = state->orig;
868
869         subreq = cli->dispatch_send(state, ev, cli,
870                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
871                                     NDR_PNP_VALIDATEDEVICEINSTANCE,
872                                     &state->tmp);
873         if (tevent_req_nomem(subreq, req)) {
874                 return tevent_req_post(req, ev);
875         }
876         tevent_req_set_callback(subreq, rpccli_PNP_ValidateDeviceInstance_done, req);
877         return req;
878 }
879
880 static void rpccli_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq)
881 {
882         struct tevent_req *req = tevent_req_callback_data(
883                 subreq, struct tevent_req);
884         struct rpccli_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
885                 req, struct rpccli_PNP_ValidateDeviceInstance_state);
886         NTSTATUS status;
887         TALLOC_CTX *mem_ctx;
888
889         if (state->out_mem_ctx) {
890                 mem_ctx = state->out_mem_ctx;
891         } else {
892                 mem_ctx = state;
893         }
894
895         status = state->dispatch_recv(subreq, mem_ctx);
896         TALLOC_FREE(subreq);
897         if (!NT_STATUS_IS_OK(status)) {
898                 tevent_req_nterror(req, status);
899                 return;
900         }
901
902         /* Copy out parameters */
903
904         /* Copy result */
905         state->orig.out.result = state->tmp.out.result;
906
907         /* Reset temporary structure */
908         ZERO_STRUCT(state->tmp);
909
910         tevent_req_done(req);
911 }
912
913 NTSTATUS rpccli_PNP_ValidateDeviceInstance_recv(struct tevent_req *req,
914                                                 TALLOC_CTX *mem_ctx,
915                                                 WERROR *result)
916 {
917         struct rpccli_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
918                 req, struct rpccli_PNP_ValidateDeviceInstance_state);
919         NTSTATUS status;
920
921         if (tevent_req_is_nterror(req, &status)) {
922                 tevent_req_received(req);
923                 return status;
924         }
925
926         /* Steal possbile out parameters to the callers context */
927         talloc_steal(mem_ctx, state->out_mem_ctx);
928
929         /* Return result */
930         *result = state->orig.out.result;
931
932         tevent_req_received(req);
933         return NT_STATUS_OK;
934 }
935
936 NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
937                                            TALLOC_CTX *mem_ctx,
938                                            const char *devicepath /* [in] [ref,charset(UTF16)] */,
939                                            uint32_t flags /* [in]  */,
940                                            WERROR *werror)
941 {
942         struct PNP_ValidateDeviceInstance r;
943         NTSTATUS status;
944
945         /* In parameters */
946         r.in.devicepath = devicepath;
947         r.in.flags = flags;
948
949         status = cli->dispatch(cli,
950                                 mem_ctx,
951                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
952                                 NDR_PNP_VALIDATEDEVICEINSTANCE,
953                                 &r);
954
955         if (!NT_STATUS_IS_OK(status)) {
956                 return status;
957         }
958
959         if (NT_STATUS_IS_ERR(status)) {
960                 return status;
961         }
962
963         /* Return variables */
964
965         /* Return result */
966         if (werror) {
967                 *werror = r.out.result;
968         }
969
970         return werror_to_ntstatus(r.out.result);
971 }
972
973 struct rpccli_PNP_GetRootDeviceInstance_state {
974         struct PNP_GetRootDeviceInstance orig;
975         struct PNP_GetRootDeviceInstance tmp;
976         TALLOC_CTX *out_mem_ctx;
977         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
978 };
979
980 static void rpccli_PNP_GetRootDeviceInstance_done(struct tevent_req *subreq);
981
982 struct tevent_req *rpccli_PNP_GetRootDeviceInstance_send(TALLOC_CTX *mem_ctx,
983                                                          struct tevent_context *ev,
984                                                          struct rpc_pipe_client *cli)
985 {
986         struct tevent_req *req;
987         struct rpccli_PNP_GetRootDeviceInstance_state *state;
988         struct tevent_req *subreq;
989
990         req = tevent_req_create(mem_ctx, &state,
991                                 struct rpccli_PNP_GetRootDeviceInstance_state);
992         if (req == NULL) {
993                 return NULL;
994         }
995         state->out_mem_ctx = NULL;
996         state->dispatch_recv = cli->dispatch_recv;
997
998         /* In parameters */
999
1000         /* Out parameters */
1001
1002         /* Result */
1003         ZERO_STRUCT(state->orig.out.result);
1004
1005         /* make a temporary copy, that we pass to the dispatch function */
1006         state->tmp = state->orig;
1007
1008         subreq = cli->dispatch_send(state, ev, cli,
1009                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1010                                     NDR_PNP_GETROOTDEVICEINSTANCE,
1011                                     &state->tmp);
1012         if (tevent_req_nomem(subreq, req)) {
1013                 return tevent_req_post(req, ev);
1014         }
1015         tevent_req_set_callback(subreq, rpccli_PNP_GetRootDeviceInstance_done, req);
1016         return req;
1017 }
1018
1019 static void rpccli_PNP_GetRootDeviceInstance_done(struct tevent_req *subreq)
1020 {
1021         struct tevent_req *req = tevent_req_callback_data(
1022                 subreq, struct tevent_req);
1023         struct rpccli_PNP_GetRootDeviceInstance_state *state = tevent_req_data(
1024                 req, struct rpccli_PNP_GetRootDeviceInstance_state);
1025         NTSTATUS status;
1026         TALLOC_CTX *mem_ctx;
1027
1028         if (state->out_mem_ctx) {
1029                 mem_ctx = state->out_mem_ctx;
1030         } else {
1031                 mem_ctx = state;
1032         }
1033
1034         status = state->dispatch_recv(subreq, mem_ctx);
1035         TALLOC_FREE(subreq);
1036         if (!NT_STATUS_IS_OK(status)) {
1037                 tevent_req_nterror(req, status);
1038                 return;
1039         }
1040
1041         /* Copy out parameters */
1042
1043         /* Copy result */
1044         state->orig.out.result = state->tmp.out.result;
1045
1046         /* Reset temporary structure */
1047         ZERO_STRUCT(state->tmp);
1048
1049         tevent_req_done(req);
1050 }
1051
1052 NTSTATUS rpccli_PNP_GetRootDeviceInstance_recv(struct tevent_req *req,
1053                                                TALLOC_CTX *mem_ctx,
1054                                                WERROR *result)
1055 {
1056         struct rpccli_PNP_GetRootDeviceInstance_state *state = tevent_req_data(
1057                 req, struct rpccli_PNP_GetRootDeviceInstance_state);
1058         NTSTATUS status;
1059
1060         if (tevent_req_is_nterror(req, &status)) {
1061                 tevent_req_received(req);
1062                 return status;
1063         }
1064
1065         /* Steal possbile out parameters to the callers context */
1066         talloc_steal(mem_ctx, state->out_mem_ctx);
1067
1068         /* Return result */
1069         *result = state->orig.out.result;
1070
1071         tevent_req_received(req);
1072         return NT_STATUS_OK;
1073 }
1074
1075 NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli,
1076                                           TALLOC_CTX *mem_ctx,
1077                                           WERROR *werror)
1078 {
1079         struct PNP_GetRootDeviceInstance r;
1080         NTSTATUS status;
1081
1082         /* In parameters */
1083
1084         status = cli->dispatch(cli,
1085                                 mem_ctx,
1086                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1087                                 NDR_PNP_GETROOTDEVICEINSTANCE,
1088                                 &r);
1089
1090         if (!NT_STATUS_IS_OK(status)) {
1091                 return status;
1092         }
1093
1094         if (NT_STATUS_IS_ERR(status)) {
1095                 return status;
1096         }
1097
1098         /* Return variables */
1099
1100         /* Return result */
1101         if (werror) {
1102                 *werror = r.out.result;
1103         }
1104
1105         return werror_to_ntstatus(r.out.result);
1106 }
1107
1108 struct rpccli_PNP_GetRelatedDeviceInstance_state {
1109         struct PNP_GetRelatedDeviceInstance orig;
1110         struct PNP_GetRelatedDeviceInstance tmp;
1111         TALLOC_CTX *out_mem_ctx;
1112         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1113 };
1114
1115 static void rpccli_PNP_GetRelatedDeviceInstance_done(struct tevent_req *subreq);
1116
1117 struct tevent_req *rpccli_PNP_GetRelatedDeviceInstance_send(TALLOC_CTX *mem_ctx,
1118                                                             struct tevent_context *ev,
1119                                                             struct rpc_pipe_client *cli)
1120 {
1121         struct tevent_req *req;
1122         struct rpccli_PNP_GetRelatedDeviceInstance_state *state;
1123         struct tevent_req *subreq;
1124
1125         req = tevent_req_create(mem_ctx, &state,
1126                                 struct rpccli_PNP_GetRelatedDeviceInstance_state);
1127         if (req == NULL) {
1128                 return NULL;
1129         }
1130         state->out_mem_ctx = NULL;
1131         state->dispatch_recv = cli->dispatch_recv;
1132
1133         /* In parameters */
1134
1135         /* Out parameters */
1136
1137         /* Result */
1138         ZERO_STRUCT(state->orig.out.result);
1139
1140         /* make a temporary copy, that we pass to the dispatch function */
1141         state->tmp = state->orig;
1142
1143         subreq = cli->dispatch_send(state, ev, cli,
1144                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1145                                     NDR_PNP_GETRELATEDDEVICEINSTANCE,
1146                                     &state->tmp);
1147         if (tevent_req_nomem(subreq, req)) {
1148                 return tevent_req_post(req, ev);
1149         }
1150         tevent_req_set_callback(subreq, rpccli_PNP_GetRelatedDeviceInstance_done, req);
1151         return req;
1152 }
1153
1154 static void rpccli_PNP_GetRelatedDeviceInstance_done(struct tevent_req *subreq)
1155 {
1156         struct tevent_req *req = tevent_req_callback_data(
1157                 subreq, struct tevent_req);
1158         struct rpccli_PNP_GetRelatedDeviceInstance_state *state = tevent_req_data(
1159                 req, struct rpccli_PNP_GetRelatedDeviceInstance_state);
1160         NTSTATUS status;
1161         TALLOC_CTX *mem_ctx;
1162
1163         if (state->out_mem_ctx) {
1164                 mem_ctx = state->out_mem_ctx;
1165         } else {
1166                 mem_ctx = state;
1167         }
1168
1169         status = state->dispatch_recv(subreq, mem_ctx);
1170         TALLOC_FREE(subreq);
1171         if (!NT_STATUS_IS_OK(status)) {
1172                 tevent_req_nterror(req, status);
1173                 return;
1174         }
1175
1176         /* Copy out parameters */
1177
1178         /* Copy result */
1179         state->orig.out.result = state->tmp.out.result;
1180
1181         /* Reset temporary structure */
1182         ZERO_STRUCT(state->tmp);
1183
1184         tevent_req_done(req);
1185 }
1186
1187 NTSTATUS rpccli_PNP_GetRelatedDeviceInstance_recv(struct tevent_req *req,
1188                                                   TALLOC_CTX *mem_ctx,
1189                                                   WERROR *result)
1190 {
1191         struct rpccli_PNP_GetRelatedDeviceInstance_state *state = tevent_req_data(
1192                 req, struct rpccli_PNP_GetRelatedDeviceInstance_state);
1193         NTSTATUS status;
1194
1195         if (tevent_req_is_nterror(req, &status)) {
1196                 tevent_req_received(req);
1197                 return status;
1198         }
1199
1200         /* Steal possbile out parameters to the callers context */
1201         talloc_steal(mem_ctx, state->out_mem_ctx);
1202
1203         /* Return result */
1204         *result = state->orig.out.result;
1205
1206         tevent_req_received(req);
1207         return NT_STATUS_OK;
1208 }
1209
1210 NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli,
1211                                              TALLOC_CTX *mem_ctx,
1212                                              WERROR *werror)
1213 {
1214         struct PNP_GetRelatedDeviceInstance r;
1215         NTSTATUS status;
1216
1217         /* In parameters */
1218
1219         status = cli->dispatch(cli,
1220                                 mem_ctx,
1221                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1222                                 NDR_PNP_GETRELATEDDEVICEINSTANCE,
1223                                 &r);
1224
1225         if (!NT_STATUS_IS_OK(status)) {
1226                 return status;
1227         }
1228
1229         if (NT_STATUS_IS_ERR(status)) {
1230                 return status;
1231         }
1232
1233         /* Return variables */
1234
1235         /* Return result */
1236         if (werror) {
1237                 *werror = r.out.result;
1238         }
1239
1240         return werror_to_ntstatus(r.out.result);
1241 }
1242
1243 struct rpccli_PNP_EnumerateSubKeys_state {
1244         struct PNP_EnumerateSubKeys orig;
1245         struct PNP_EnumerateSubKeys tmp;
1246         TALLOC_CTX *out_mem_ctx;
1247         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1248 };
1249
1250 static void rpccli_PNP_EnumerateSubKeys_done(struct tevent_req *subreq);
1251
1252 struct tevent_req *rpccli_PNP_EnumerateSubKeys_send(TALLOC_CTX *mem_ctx,
1253                                                     struct tevent_context *ev,
1254                                                     struct rpc_pipe_client *cli)
1255 {
1256         struct tevent_req *req;
1257         struct rpccli_PNP_EnumerateSubKeys_state *state;
1258         struct tevent_req *subreq;
1259
1260         req = tevent_req_create(mem_ctx, &state,
1261                                 struct rpccli_PNP_EnumerateSubKeys_state);
1262         if (req == NULL) {
1263                 return NULL;
1264         }
1265         state->out_mem_ctx = NULL;
1266         state->dispatch_recv = cli->dispatch_recv;
1267
1268         /* In parameters */
1269
1270         /* Out parameters */
1271
1272         /* Result */
1273         ZERO_STRUCT(state->orig.out.result);
1274
1275         /* make a temporary copy, that we pass to the dispatch function */
1276         state->tmp = state->orig;
1277
1278         subreq = cli->dispatch_send(state, ev, cli,
1279                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1280                                     NDR_PNP_ENUMERATESUBKEYS,
1281                                     &state->tmp);
1282         if (tevent_req_nomem(subreq, req)) {
1283                 return tevent_req_post(req, ev);
1284         }
1285         tevent_req_set_callback(subreq, rpccli_PNP_EnumerateSubKeys_done, req);
1286         return req;
1287 }
1288
1289 static void rpccli_PNP_EnumerateSubKeys_done(struct tevent_req *subreq)
1290 {
1291         struct tevent_req *req = tevent_req_callback_data(
1292                 subreq, struct tevent_req);
1293         struct rpccli_PNP_EnumerateSubKeys_state *state = tevent_req_data(
1294                 req, struct rpccli_PNP_EnumerateSubKeys_state);
1295         NTSTATUS status;
1296         TALLOC_CTX *mem_ctx;
1297
1298         if (state->out_mem_ctx) {
1299                 mem_ctx = state->out_mem_ctx;
1300         } else {
1301                 mem_ctx = state;
1302         }
1303
1304         status = state->dispatch_recv(subreq, mem_ctx);
1305         TALLOC_FREE(subreq);
1306         if (!NT_STATUS_IS_OK(status)) {
1307                 tevent_req_nterror(req, status);
1308                 return;
1309         }
1310
1311         /* Copy out parameters */
1312
1313         /* Copy result */
1314         state->orig.out.result = state->tmp.out.result;
1315
1316         /* Reset temporary structure */
1317         ZERO_STRUCT(state->tmp);
1318
1319         tevent_req_done(req);
1320 }
1321
1322 NTSTATUS rpccli_PNP_EnumerateSubKeys_recv(struct tevent_req *req,
1323                                           TALLOC_CTX *mem_ctx,
1324                                           WERROR *result)
1325 {
1326         struct rpccli_PNP_EnumerateSubKeys_state *state = tevent_req_data(
1327                 req, struct rpccli_PNP_EnumerateSubKeys_state);
1328         NTSTATUS status;
1329
1330         if (tevent_req_is_nterror(req, &status)) {
1331                 tevent_req_received(req);
1332                 return status;
1333         }
1334
1335         /* Steal possbile out parameters to the callers context */
1336         talloc_steal(mem_ctx, state->out_mem_ctx);
1337
1338         /* Return result */
1339         *result = state->orig.out.result;
1340
1341         tevent_req_received(req);
1342         return NT_STATUS_OK;
1343 }
1344
1345 NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli,
1346                                      TALLOC_CTX *mem_ctx,
1347                                      WERROR *werror)
1348 {
1349         struct PNP_EnumerateSubKeys r;
1350         NTSTATUS status;
1351
1352         /* In parameters */
1353
1354         status = cli->dispatch(cli,
1355                                 mem_ctx,
1356                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1357                                 NDR_PNP_ENUMERATESUBKEYS,
1358                                 &r);
1359
1360         if (!NT_STATUS_IS_OK(status)) {
1361                 return status;
1362         }
1363
1364         if (NT_STATUS_IS_ERR(status)) {
1365                 return status;
1366         }
1367
1368         /* Return variables */
1369
1370         /* Return result */
1371         if (werror) {
1372                 *werror = r.out.result;
1373         }
1374
1375         return werror_to_ntstatus(r.out.result);
1376 }
1377
1378 struct rpccli_PNP_GetDeviceList_state {
1379         struct PNP_GetDeviceList orig;
1380         struct PNP_GetDeviceList tmp;
1381         TALLOC_CTX *out_mem_ctx;
1382         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1383 };
1384
1385 static void rpccli_PNP_GetDeviceList_done(struct tevent_req *subreq);
1386
1387 struct tevent_req *rpccli_PNP_GetDeviceList_send(TALLOC_CTX *mem_ctx,
1388                                                  struct tevent_context *ev,
1389                                                  struct rpc_pipe_client *cli,
1390                                                  const char *_filter /* [in] [unique,charset(UTF16)] */,
1391                                                  uint16_t *_buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
1392                                                  uint32_t *_length /* [in,out] [ref] */,
1393                                                  uint32_t _flags /* [in]  */)
1394 {
1395         struct tevent_req *req;
1396         struct rpccli_PNP_GetDeviceList_state *state;
1397         struct tevent_req *subreq;
1398
1399         req = tevent_req_create(mem_ctx, &state,
1400                                 struct rpccli_PNP_GetDeviceList_state);
1401         if (req == NULL) {
1402                 return NULL;
1403         }
1404         state->out_mem_ctx = NULL;
1405         state->dispatch_recv = cli->dispatch_recv;
1406
1407         /* In parameters */
1408         state->orig.in.filter = _filter;
1409         state->orig.in.length = _length;
1410         state->orig.in.flags = _flags;
1411
1412         /* Out parameters */
1413         state->orig.out.buffer = _buffer;
1414         state->orig.out.length = _length;
1415
1416         /* Result */
1417         ZERO_STRUCT(state->orig.out.result);
1418
1419         state->out_mem_ctx = talloc_named_const(state, 0,
1420                              "rpccli_PNP_GetDeviceList_out_memory");
1421         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1422                 return tevent_req_post(req, ev);
1423         }
1424
1425         /* make a temporary copy, that we pass to the dispatch function */
1426         state->tmp = state->orig;
1427
1428         subreq = cli->dispatch_send(state, ev, cli,
1429                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1430                                     NDR_PNP_GETDEVICELIST,
1431                                     &state->tmp);
1432         if (tevent_req_nomem(subreq, req)) {
1433                 return tevent_req_post(req, ev);
1434         }
1435         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceList_done, req);
1436         return req;
1437 }
1438
1439 static void rpccli_PNP_GetDeviceList_done(struct tevent_req *subreq)
1440 {
1441         struct tevent_req *req = tevent_req_callback_data(
1442                 subreq, struct tevent_req);
1443         struct rpccli_PNP_GetDeviceList_state *state = tevent_req_data(
1444                 req, struct rpccli_PNP_GetDeviceList_state);
1445         NTSTATUS status;
1446         TALLOC_CTX *mem_ctx;
1447
1448         if (state->out_mem_ctx) {
1449                 mem_ctx = state->out_mem_ctx;
1450         } else {
1451                 mem_ctx = state;
1452         }
1453
1454         status = state->dispatch_recv(subreq, mem_ctx);
1455         TALLOC_FREE(subreq);
1456         if (!NT_STATUS_IS_OK(status)) {
1457                 tevent_req_nterror(req, status);
1458                 return;
1459         }
1460
1461         /* Copy out parameters */
1462         memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.length * sizeof(*state->orig.out.buffer));
1463         *state->orig.out.length = *state->tmp.out.length;
1464
1465         /* Copy result */
1466         state->orig.out.result = state->tmp.out.result;
1467
1468         /* Reset temporary structure */
1469         ZERO_STRUCT(state->tmp);
1470
1471         tevent_req_done(req);
1472 }
1473
1474 NTSTATUS rpccli_PNP_GetDeviceList_recv(struct tevent_req *req,
1475                                        TALLOC_CTX *mem_ctx,
1476                                        WERROR *result)
1477 {
1478         struct rpccli_PNP_GetDeviceList_state *state = tevent_req_data(
1479                 req, struct rpccli_PNP_GetDeviceList_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_GetDeviceList(struct rpc_pipe_client *cli,
1498                                   TALLOC_CTX *mem_ctx,
1499                                   const char *filter /* [in] [unique,charset(UTF16)] */,
1500                                   uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
1501                                   uint32_t *length /* [in,out] [ref] */,
1502                                   uint32_t flags /* [in]  */,
1503                                   WERROR *werror)
1504 {
1505         struct PNP_GetDeviceList r;
1506         NTSTATUS status;
1507
1508         /* In parameters */
1509         r.in.filter = filter;
1510         r.in.length = length;
1511         r.in.flags = flags;
1512
1513         status = cli->dispatch(cli,
1514                                 mem_ctx,
1515                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1516                                 NDR_PNP_GETDEVICELIST,
1517                                 &r);
1518
1519         if (!NT_STATUS_IS_OK(status)) {
1520                 return status;
1521         }
1522
1523         if (NT_STATUS_IS_ERR(status)) {
1524                 return status;
1525         }
1526
1527         /* Return variables */
1528         memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer));
1529         *length = *r.out.length;
1530
1531         /* Return result */
1532         if (werror) {
1533                 *werror = r.out.result;
1534         }
1535
1536         return werror_to_ntstatus(r.out.result);
1537 }
1538
1539 struct rpccli_PNP_GetDeviceListSize_state {
1540         struct PNP_GetDeviceListSize orig;
1541         struct PNP_GetDeviceListSize tmp;
1542         TALLOC_CTX *out_mem_ctx;
1543         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1544 };
1545
1546 static void rpccli_PNP_GetDeviceListSize_done(struct tevent_req *subreq);
1547
1548 struct tevent_req *rpccli_PNP_GetDeviceListSize_send(TALLOC_CTX *mem_ctx,
1549                                                      struct tevent_context *ev,
1550                                                      struct rpc_pipe_client *cli,
1551                                                      const char *_devicename /* [in] [unique,charset(UTF16)] */,
1552                                                      uint32_t *_size /* [out] [ref] */,
1553                                                      uint32_t _flags /* [in]  */)
1554 {
1555         struct tevent_req *req;
1556         struct rpccli_PNP_GetDeviceListSize_state *state;
1557         struct tevent_req *subreq;
1558
1559         req = tevent_req_create(mem_ctx, &state,
1560                                 struct rpccli_PNP_GetDeviceListSize_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.devicename = _devicename;
1569         state->orig.in.flags = _flags;
1570
1571         /* Out parameters */
1572         state->orig.out.size = _size;
1573
1574         /* Result */
1575         ZERO_STRUCT(state->orig.out.result);
1576
1577         state->out_mem_ctx = talloc_named_const(state, 0,
1578                              "rpccli_PNP_GetDeviceListSize_out_memory");
1579         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1580                 return tevent_req_post(req, ev);
1581         }
1582
1583         /* make a temporary copy, that we pass to the dispatch function */
1584         state->tmp = state->orig;
1585
1586         subreq = cli->dispatch_send(state, ev, cli,
1587                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1588                                     NDR_PNP_GETDEVICELISTSIZE,
1589                                     &state->tmp);
1590         if (tevent_req_nomem(subreq, req)) {
1591                 return tevent_req_post(req, ev);
1592         }
1593         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceListSize_done, req);
1594         return req;
1595 }
1596
1597 static void rpccli_PNP_GetDeviceListSize_done(struct tevent_req *subreq)
1598 {
1599         struct tevent_req *req = tevent_req_callback_data(
1600                 subreq, struct tevent_req);
1601         struct rpccli_PNP_GetDeviceListSize_state *state = tevent_req_data(
1602                 req, struct rpccli_PNP_GetDeviceListSize_state);
1603         NTSTATUS status;
1604         TALLOC_CTX *mem_ctx;
1605
1606         if (state->out_mem_ctx) {
1607                 mem_ctx = state->out_mem_ctx;
1608         } else {
1609                 mem_ctx = state;
1610         }
1611
1612         status = state->dispatch_recv(subreq, mem_ctx);
1613         TALLOC_FREE(subreq);
1614         if (!NT_STATUS_IS_OK(status)) {
1615                 tevent_req_nterror(req, status);
1616                 return;
1617         }
1618
1619         /* Copy out parameters */
1620         *state->orig.out.size = *state->tmp.out.size;
1621
1622         /* Copy result */
1623         state->orig.out.result = state->tmp.out.result;
1624
1625         /* Reset temporary structure */
1626         ZERO_STRUCT(state->tmp);
1627
1628         tevent_req_done(req);
1629 }
1630
1631 NTSTATUS rpccli_PNP_GetDeviceListSize_recv(struct tevent_req *req,
1632                                            TALLOC_CTX *mem_ctx,
1633                                            WERROR *result)
1634 {
1635         struct rpccli_PNP_GetDeviceListSize_state *state = tevent_req_data(
1636                 req, struct rpccli_PNP_GetDeviceListSize_state);
1637         NTSTATUS status;
1638
1639         if (tevent_req_is_nterror(req, &status)) {
1640                 tevent_req_received(req);
1641                 return status;
1642         }
1643
1644         /* Steal possbile out parameters to the callers context */
1645         talloc_steal(mem_ctx, state->out_mem_ctx);
1646
1647         /* Return result */
1648         *result = state->orig.out.result;
1649
1650         tevent_req_received(req);
1651         return NT_STATUS_OK;
1652 }
1653
1654 NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli,
1655                                       TALLOC_CTX *mem_ctx,
1656                                       const char *devicename /* [in] [unique,charset(UTF16)] */,
1657                                       uint32_t *size /* [out] [ref] */,
1658                                       uint32_t flags /* [in]  */,
1659                                       WERROR *werror)
1660 {
1661         struct PNP_GetDeviceListSize r;
1662         NTSTATUS status;
1663
1664         /* In parameters */
1665         r.in.devicename = devicename;
1666         r.in.flags = flags;
1667
1668         status = cli->dispatch(cli,
1669                                 mem_ctx,
1670                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1671                                 NDR_PNP_GETDEVICELISTSIZE,
1672                                 &r);
1673
1674         if (!NT_STATUS_IS_OK(status)) {
1675                 return status;
1676         }
1677
1678         if (NT_STATUS_IS_ERR(status)) {
1679                 return status;
1680         }
1681
1682         /* Return variables */
1683         *size = *r.out.size;
1684
1685         /* Return result */
1686         if (werror) {
1687                 *werror = r.out.result;
1688         }
1689
1690         return werror_to_ntstatus(r.out.result);
1691 }
1692
1693 struct rpccli_PNP_GetDepth_state {
1694         struct PNP_GetDepth orig;
1695         struct PNP_GetDepth tmp;
1696         TALLOC_CTX *out_mem_ctx;
1697         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1698 };
1699
1700 static void rpccli_PNP_GetDepth_done(struct tevent_req *subreq);
1701
1702 struct tevent_req *rpccli_PNP_GetDepth_send(TALLOC_CTX *mem_ctx,
1703                                             struct tevent_context *ev,
1704                                             struct rpc_pipe_client *cli)
1705 {
1706         struct tevent_req *req;
1707         struct rpccli_PNP_GetDepth_state *state;
1708         struct tevent_req *subreq;
1709
1710         req = tevent_req_create(mem_ctx, &state,
1711                                 struct rpccli_PNP_GetDepth_state);
1712         if (req == NULL) {
1713                 return NULL;
1714         }
1715         state->out_mem_ctx = NULL;
1716         state->dispatch_recv = cli->dispatch_recv;
1717
1718         /* In parameters */
1719
1720         /* Out parameters */
1721
1722         /* Result */
1723         ZERO_STRUCT(state->orig.out.result);
1724
1725         /* make a temporary copy, that we pass to the dispatch function */
1726         state->tmp = state->orig;
1727
1728         subreq = cli->dispatch_send(state, ev, cli,
1729                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1730                                     NDR_PNP_GETDEPTH,
1731                                     &state->tmp);
1732         if (tevent_req_nomem(subreq, req)) {
1733                 return tevent_req_post(req, ev);
1734         }
1735         tevent_req_set_callback(subreq, rpccli_PNP_GetDepth_done, req);
1736         return req;
1737 }
1738
1739 static void rpccli_PNP_GetDepth_done(struct tevent_req *subreq)
1740 {
1741         struct tevent_req *req = tevent_req_callback_data(
1742                 subreq, struct tevent_req);
1743         struct rpccli_PNP_GetDepth_state *state = tevent_req_data(
1744                 req, struct rpccli_PNP_GetDepth_state);
1745         NTSTATUS status;
1746         TALLOC_CTX *mem_ctx;
1747
1748         if (state->out_mem_ctx) {
1749                 mem_ctx = state->out_mem_ctx;
1750         } else {
1751                 mem_ctx = state;
1752         }
1753
1754         status = state->dispatch_recv(subreq, mem_ctx);
1755         TALLOC_FREE(subreq);
1756         if (!NT_STATUS_IS_OK(status)) {
1757                 tevent_req_nterror(req, status);
1758                 return;
1759         }
1760
1761         /* Copy out parameters */
1762
1763         /* Copy result */
1764         state->orig.out.result = state->tmp.out.result;
1765
1766         /* Reset temporary structure */
1767         ZERO_STRUCT(state->tmp);
1768
1769         tevent_req_done(req);
1770 }
1771
1772 NTSTATUS rpccli_PNP_GetDepth_recv(struct tevent_req *req,
1773                                   TALLOC_CTX *mem_ctx,
1774                                   WERROR *result)
1775 {
1776         struct rpccli_PNP_GetDepth_state *state = tevent_req_data(
1777                 req, struct rpccli_PNP_GetDepth_state);
1778         NTSTATUS status;
1779
1780         if (tevent_req_is_nterror(req, &status)) {
1781                 tevent_req_received(req);
1782                 return status;
1783         }
1784
1785         /* Steal possbile out parameters to the callers context */
1786         talloc_steal(mem_ctx, state->out_mem_ctx);
1787
1788         /* Return result */
1789         *result = state->orig.out.result;
1790
1791         tevent_req_received(req);
1792         return NT_STATUS_OK;
1793 }
1794
1795 NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli,
1796                              TALLOC_CTX *mem_ctx,
1797                              WERROR *werror)
1798 {
1799         struct PNP_GetDepth r;
1800         NTSTATUS status;
1801
1802         /* In parameters */
1803
1804         status = cli->dispatch(cli,
1805                                 mem_ctx,
1806                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1807                                 NDR_PNP_GETDEPTH,
1808                                 &r);
1809
1810         if (!NT_STATUS_IS_OK(status)) {
1811                 return status;
1812         }
1813
1814         if (NT_STATUS_IS_ERR(status)) {
1815                 return status;
1816         }
1817
1818         /* Return variables */
1819
1820         /* Return result */
1821         if (werror) {
1822                 *werror = r.out.result;
1823         }
1824
1825         return werror_to_ntstatus(r.out.result);
1826 }
1827
1828 struct rpccli_PNP_GetDeviceRegProp_state {
1829         struct PNP_GetDeviceRegProp orig;
1830         struct PNP_GetDeviceRegProp tmp;
1831         TALLOC_CTX *out_mem_ctx;
1832         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1833 };
1834
1835 static void rpccli_PNP_GetDeviceRegProp_done(struct tevent_req *subreq);
1836
1837 struct tevent_req *rpccli_PNP_GetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
1838                                                     struct tevent_context *ev,
1839                                                     struct rpc_pipe_client *cli,
1840                                                     const char *_devicepath /* [in] [ref,charset(UTF16)] */,
1841                                                     uint32_t _property /* [in]  */,
1842                                                     enum winreg_Type *_reg_data_type /* [in,out] [ref] */,
1843                                                     uint8_t *_buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
1844                                                     uint32_t *_buffer_size /* [in,out] [ref] */,
1845                                                     uint32_t *_needed /* [in,out] [ref] */,
1846                                                     uint32_t _flags /* [in]  */)
1847 {
1848         struct tevent_req *req;
1849         struct rpccli_PNP_GetDeviceRegProp_state *state;
1850         struct tevent_req *subreq;
1851
1852         req = tevent_req_create(mem_ctx, &state,
1853                                 struct rpccli_PNP_GetDeviceRegProp_state);
1854         if (req == NULL) {
1855                 return NULL;
1856         }
1857         state->out_mem_ctx = NULL;
1858         state->dispatch_recv = cli->dispatch_recv;
1859
1860         /* In parameters */
1861         state->orig.in.devicepath = _devicepath;
1862         state->orig.in.property = _property;
1863         state->orig.in.reg_data_type = _reg_data_type;
1864         state->orig.in.buffer_size = _buffer_size;
1865         state->orig.in.needed = _needed;
1866         state->orig.in.flags = _flags;
1867
1868         /* Out parameters */
1869         state->orig.out.reg_data_type = _reg_data_type;
1870         state->orig.out.buffer = _buffer;
1871         state->orig.out.buffer_size = _buffer_size;
1872         state->orig.out.needed = _needed;
1873
1874         /* Result */
1875         ZERO_STRUCT(state->orig.out.result);
1876
1877         state->out_mem_ctx = talloc_named_const(state, 0,
1878                              "rpccli_PNP_GetDeviceRegProp_out_memory");
1879         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1880                 return tevent_req_post(req, ev);
1881         }
1882
1883         /* make a temporary copy, that we pass to the dispatch function */
1884         state->tmp = state->orig;
1885
1886         subreq = cli->dispatch_send(state, ev, cli,
1887                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1888                                     NDR_PNP_GETDEVICEREGPROP,
1889                                     &state->tmp);
1890         if (tevent_req_nomem(subreq, req)) {
1891                 return tevent_req_post(req, ev);
1892         }
1893         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceRegProp_done, req);
1894         return req;
1895 }
1896
1897 static void rpccli_PNP_GetDeviceRegProp_done(struct tevent_req *subreq)
1898 {
1899         struct tevent_req *req = tevent_req_callback_data(
1900                 subreq, struct tevent_req);
1901         struct rpccli_PNP_GetDeviceRegProp_state *state = tevent_req_data(
1902                 req, struct rpccli_PNP_GetDeviceRegProp_state);
1903         NTSTATUS status;
1904         TALLOC_CTX *mem_ctx;
1905
1906         if (state->out_mem_ctx) {
1907                 mem_ctx = state->out_mem_ctx;
1908         } else {
1909                 mem_ctx = state;
1910         }
1911
1912         status = state->dispatch_recv(subreq, mem_ctx);
1913         TALLOC_FREE(subreq);
1914         if (!NT_STATUS_IS_OK(status)) {
1915                 tevent_req_nterror(req, status);
1916                 return;
1917         }
1918
1919         /* Copy out parameters */
1920         *state->orig.out.reg_data_type = *state->tmp.out.reg_data_type;
1921         memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.buffer_size * sizeof(*state->orig.out.buffer));
1922         *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
1923         *state->orig.out.needed = *state->tmp.out.needed;
1924
1925         /* Copy result */
1926         state->orig.out.result = state->tmp.out.result;
1927
1928         /* Reset temporary structure */
1929         ZERO_STRUCT(state->tmp);
1930
1931         tevent_req_done(req);
1932 }
1933
1934 NTSTATUS rpccli_PNP_GetDeviceRegProp_recv(struct tevent_req *req,
1935                                           TALLOC_CTX *mem_ctx,
1936                                           WERROR *result)
1937 {
1938         struct rpccli_PNP_GetDeviceRegProp_state *state = tevent_req_data(
1939                 req, struct rpccli_PNP_GetDeviceRegProp_state);
1940         NTSTATUS status;
1941
1942         if (tevent_req_is_nterror(req, &status)) {
1943                 tevent_req_received(req);
1944                 return status;
1945         }
1946
1947         /* Steal possbile out parameters to the callers context */
1948         talloc_steal(mem_ctx, state->out_mem_ctx);
1949
1950         /* Return result */
1951         *result = state->orig.out.result;
1952
1953         tevent_req_received(req);
1954         return NT_STATUS_OK;
1955 }
1956
1957 NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
1958                                      TALLOC_CTX *mem_ctx,
1959                                      const char *devicepath /* [in] [ref,charset(UTF16)] */,
1960                                      uint32_t property /* [in]  */,
1961                                      enum winreg_Type *reg_data_type /* [in,out] [ref] */,
1962                                      uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
1963                                      uint32_t *buffer_size /* [in,out] [ref] */,
1964                                      uint32_t *needed /* [in,out] [ref] */,
1965                                      uint32_t flags /* [in]  */,
1966                                      WERROR *werror)
1967 {
1968         struct PNP_GetDeviceRegProp r;
1969         NTSTATUS status;
1970
1971         /* In parameters */
1972         r.in.devicepath = devicepath;
1973         r.in.property = property;
1974         r.in.reg_data_type = reg_data_type;
1975         r.in.buffer_size = buffer_size;
1976         r.in.needed = needed;
1977         r.in.flags = flags;
1978
1979         status = cli->dispatch(cli,
1980                                 mem_ctx,
1981                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
1982                                 NDR_PNP_GETDEVICEREGPROP,
1983                                 &r);
1984
1985         if (!NT_STATUS_IS_OK(status)) {
1986                 return status;
1987         }
1988
1989         if (NT_STATUS_IS_ERR(status)) {
1990                 return status;
1991         }
1992
1993         /* Return variables */
1994         *reg_data_type = *r.out.reg_data_type;
1995         memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
1996         *buffer_size = *r.out.buffer_size;
1997         *needed = *r.out.needed;
1998
1999         /* Return result */
2000         if (werror) {
2001                 *werror = r.out.result;
2002         }
2003
2004         return werror_to_ntstatus(r.out.result);
2005 }
2006
2007 struct rpccli_PNP_SetDeviceRegProp_state {
2008         struct PNP_SetDeviceRegProp orig;
2009         struct PNP_SetDeviceRegProp tmp;
2010         TALLOC_CTX *out_mem_ctx;
2011         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2012 };
2013
2014 static void rpccli_PNP_SetDeviceRegProp_done(struct tevent_req *subreq);
2015
2016 struct tevent_req *rpccli_PNP_SetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
2017                                                     struct tevent_context *ev,
2018                                                     struct rpc_pipe_client *cli)
2019 {
2020         struct tevent_req *req;
2021         struct rpccli_PNP_SetDeviceRegProp_state *state;
2022         struct tevent_req *subreq;
2023
2024         req = tevent_req_create(mem_ctx, &state,
2025                                 struct rpccli_PNP_SetDeviceRegProp_state);
2026         if (req == NULL) {
2027                 return NULL;
2028         }
2029         state->out_mem_ctx = NULL;
2030         state->dispatch_recv = cli->dispatch_recv;
2031
2032         /* In parameters */
2033
2034         /* Out parameters */
2035
2036         /* Result */
2037         ZERO_STRUCT(state->orig.out.result);
2038
2039         /* make a temporary copy, that we pass to the dispatch function */
2040         state->tmp = state->orig;
2041
2042         subreq = cli->dispatch_send(state, ev, cli,
2043                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2044                                     NDR_PNP_SETDEVICEREGPROP,
2045                                     &state->tmp);
2046         if (tevent_req_nomem(subreq, req)) {
2047                 return tevent_req_post(req, ev);
2048         }
2049         tevent_req_set_callback(subreq, rpccli_PNP_SetDeviceRegProp_done, req);
2050         return req;
2051 }
2052
2053 static void rpccli_PNP_SetDeviceRegProp_done(struct tevent_req *subreq)
2054 {
2055         struct tevent_req *req = tevent_req_callback_data(
2056                 subreq, struct tevent_req);
2057         struct rpccli_PNP_SetDeviceRegProp_state *state = tevent_req_data(
2058                 req, struct rpccli_PNP_SetDeviceRegProp_state);
2059         NTSTATUS status;
2060         TALLOC_CTX *mem_ctx;
2061
2062         if (state->out_mem_ctx) {
2063                 mem_ctx = state->out_mem_ctx;
2064         } else {
2065                 mem_ctx = state;
2066         }
2067
2068         status = state->dispatch_recv(subreq, mem_ctx);
2069         TALLOC_FREE(subreq);
2070         if (!NT_STATUS_IS_OK(status)) {
2071                 tevent_req_nterror(req, status);
2072                 return;
2073         }
2074
2075         /* Copy out parameters */
2076
2077         /* Copy result */
2078         state->orig.out.result = state->tmp.out.result;
2079
2080         /* Reset temporary structure */
2081         ZERO_STRUCT(state->tmp);
2082
2083         tevent_req_done(req);
2084 }
2085
2086 NTSTATUS rpccli_PNP_SetDeviceRegProp_recv(struct tevent_req *req,
2087                                           TALLOC_CTX *mem_ctx,
2088                                           WERROR *result)
2089 {
2090         struct rpccli_PNP_SetDeviceRegProp_state *state = tevent_req_data(
2091                 req, struct rpccli_PNP_SetDeviceRegProp_state);
2092         NTSTATUS status;
2093
2094         if (tevent_req_is_nterror(req, &status)) {
2095                 tevent_req_received(req);
2096                 return status;
2097         }
2098
2099         /* Steal possbile out parameters to the callers context */
2100         talloc_steal(mem_ctx, state->out_mem_ctx);
2101
2102         /* Return result */
2103         *result = state->orig.out.result;
2104
2105         tevent_req_received(req);
2106         return NT_STATUS_OK;
2107 }
2108
2109 NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
2110                                      TALLOC_CTX *mem_ctx,
2111                                      WERROR *werror)
2112 {
2113         struct PNP_SetDeviceRegProp r;
2114         NTSTATUS status;
2115
2116         /* In parameters */
2117
2118         status = cli->dispatch(cli,
2119                                 mem_ctx,
2120                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2121                                 NDR_PNP_SETDEVICEREGPROP,
2122                                 &r);
2123
2124         if (!NT_STATUS_IS_OK(status)) {
2125                 return status;
2126         }
2127
2128         if (NT_STATUS_IS_ERR(status)) {
2129                 return status;
2130         }
2131
2132         /* Return variables */
2133
2134         /* Return result */
2135         if (werror) {
2136                 *werror = r.out.result;
2137         }
2138
2139         return werror_to_ntstatus(r.out.result);
2140 }
2141
2142 struct rpccli_PNP_GetClassInstance_state {
2143         struct PNP_GetClassInstance orig;
2144         struct PNP_GetClassInstance tmp;
2145         TALLOC_CTX *out_mem_ctx;
2146         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2147 };
2148
2149 static void rpccli_PNP_GetClassInstance_done(struct tevent_req *subreq);
2150
2151 struct tevent_req *rpccli_PNP_GetClassInstance_send(TALLOC_CTX *mem_ctx,
2152                                                     struct tevent_context *ev,
2153                                                     struct rpc_pipe_client *cli)
2154 {
2155         struct tevent_req *req;
2156         struct rpccli_PNP_GetClassInstance_state *state;
2157         struct tevent_req *subreq;
2158
2159         req = tevent_req_create(mem_ctx, &state,
2160                                 struct rpccli_PNP_GetClassInstance_state);
2161         if (req == NULL) {
2162                 return NULL;
2163         }
2164         state->out_mem_ctx = NULL;
2165         state->dispatch_recv = cli->dispatch_recv;
2166
2167         /* In parameters */
2168
2169         /* Out parameters */
2170
2171         /* Result */
2172         ZERO_STRUCT(state->orig.out.result);
2173
2174         /* make a temporary copy, that we pass to the dispatch function */
2175         state->tmp = state->orig;
2176
2177         subreq = cli->dispatch_send(state, ev, cli,
2178                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2179                                     NDR_PNP_GETCLASSINSTANCE,
2180                                     &state->tmp);
2181         if (tevent_req_nomem(subreq, req)) {
2182                 return tevent_req_post(req, ev);
2183         }
2184         tevent_req_set_callback(subreq, rpccli_PNP_GetClassInstance_done, req);
2185         return req;
2186 }
2187
2188 static void rpccli_PNP_GetClassInstance_done(struct tevent_req *subreq)
2189 {
2190         struct tevent_req *req = tevent_req_callback_data(
2191                 subreq, struct tevent_req);
2192         struct rpccli_PNP_GetClassInstance_state *state = tevent_req_data(
2193                 req, struct rpccli_PNP_GetClassInstance_state);
2194         NTSTATUS status;
2195         TALLOC_CTX *mem_ctx;
2196
2197         if (state->out_mem_ctx) {
2198                 mem_ctx = state->out_mem_ctx;
2199         } else {
2200                 mem_ctx = state;
2201         }
2202
2203         status = state->dispatch_recv(subreq, mem_ctx);
2204         TALLOC_FREE(subreq);
2205         if (!NT_STATUS_IS_OK(status)) {
2206                 tevent_req_nterror(req, status);
2207                 return;
2208         }
2209
2210         /* Copy out parameters */
2211
2212         /* Copy result */
2213         state->orig.out.result = state->tmp.out.result;
2214
2215         /* Reset temporary structure */
2216         ZERO_STRUCT(state->tmp);
2217
2218         tevent_req_done(req);
2219 }
2220
2221 NTSTATUS rpccli_PNP_GetClassInstance_recv(struct tevent_req *req,
2222                                           TALLOC_CTX *mem_ctx,
2223                                           WERROR *result)
2224 {
2225         struct rpccli_PNP_GetClassInstance_state *state = tevent_req_data(
2226                 req, struct rpccli_PNP_GetClassInstance_state);
2227         NTSTATUS status;
2228
2229         if (tevent_req_is_nterror(req, &status)) {
2230                 tevent_req_received(req);
2231                 return status;
2232         }
2233
2234         /* Steal possbile out parameters to the callers context */
2235         talloc_steal(mem_ctx, state->out_mem_ctx);
2236
2237         /* Return result */
2238         *result = state->orig.out.result;
2239
2240         tevent_req_received(req);
2241         return NT_STATUS_OK;
2242 }
2243
2244 NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli,
2245                                      TALLOC_CTX *mem_ctx,
2246                                      WERROR *werror)
2247 {
2248         struct PNP_GetClassInstance r;
2249         NTSTATUS status;
2250
2251         /* In parameters */
2252
2253         status = cli->dispatch(cli,
2254                                 mem_ctx,
2255                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2256                                 NDR_PNP_GETCLASSINSTANCE,
2257                                 &r);
2258
2259         if (!NT_STATUS_IS_OK(status)) {
2260                 return status;
2261         }
2262
2263         if (NT_STATUS_IS_ERR(status)) {
2264                 return status;
2265         }
2266
2267         /* Return variables */
2268
2269         /* Return result */
2270         if (werror) {
2271                 *werror = r.out.result;
2272         }
2273
2274         return werror_to_ntstatus(r.out.result);
2275 }
2276
2277 struct rpccli_PNP_CreateKey_state {
2278         struct PNP_CreateKey orig;
2279         struct PNP_CreateKey tmp;
2280         TALLOC_CTX *out_mem_ctx;
2281         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2282 };
2283
2284 static void rpccli_PNP_CreateKey_done(struct tevent_req *subreq);
2285
2286 struct tevent_req *rpccli_PNP_CreateKey_send(TALLOC_CTX *mem_ctx,
2287                                              struct tevent_context *ev,
2288                                              struct rpc_pipe_client *cli)
2289 {
2290         struct tevent_req *req;
2291         struct rpccli_PNP_CreateKey_state *state;
2292         struct tevent_req *subreq;
2293
2294         req = tevent_req_create(mem_ctx, &state,
2295                                 struct rpccli_PNP_CreateKey_state);
2296         if (req == NULL) {
2297                 return NULL;
2298         }
2299         state->out_mem_ctx = NULL;
2300         state->dispatch_recv = cli->dispatch_recv;
2301
2302         /* In parameters */
2303
2304         /* Out parameters */
2305
2306         /* Result */
2307         ZERO_STRUCT(state->orig.out.result);
2308
2309         /* make a temporary copy, that we pass to the dispatch function */
2310         state->tmp = state->orig;
2311
2312         subreq = cli->dispatch_send(state, ev, cli,
2313                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2314                                     NDR_PNP_CREATEKEY,
2315                                     &state->tmp);
2316         if (tevent_req_nomem(subreq, req)) {
2317                 return tevent_req_post(req, ev);
2318         }
2319         tevent_req_set_callback(subreq, rpccli_PNP_CreateKey_done, req);
2320         return req;
2321 }
2322
2323 static void rpccli_PNP_CreateKey_done(struct tevent_req *subreq)
2324 {
2325         struct tevent_req *req = tevent_req_callback_data(
2326                 subreq, struct tevent_req);
2327         struct rpccli_PNP_CreateKey_state *state = tevent_req_data(
2328                 req, struct rpccli_PNP_CreateKey_state);
2329         NTSTATUS status;
2330         TALLOC_CTX *mem_ctx;
2331
2332         if (state->out_mem_ctx) {
2333                 mem_ctx = state->out_mem_ctx;
2334         } else {
2335                 mem_ctx = state;
2336         }
2337
2338         status = state->dispatch_recv(subreq, mem_ctx);
2339         TALLOC_FREE(subreq);
2340         if (!NT_STATUS_IS_OK(status)) {
2341                 tevent_req_nterror(req, status);
2342                 return;
2343         }
2344
2345         /* Copy out parameters */
2346
2347         /* Copy result */
2348         state->orig.out.result = state->tmp.out.result;
2349
2350         /* Reset temporary structure */
2351         ZERO_STRUCT(state->tmp);
2352
2353         tevent_req_done(req);
2354 }
2355
2356 NTSTATUS rpccli_PNP_CreateKey_recv(struct tevent_req *req,
2357                                    TALLOC_CTX *mem_ctx,
2358                                    WERROR *result)
2359 {
2360         struct rpccli_PNP_CreateKey_state *state = tevent_req_data(
2361                 req, struct rpccli_PNP_CreateKey_state);
2362         NTSTATUS status;
2363
2364         if (tevent_req_is_nterror(req, &status)) {
2365                 tevent_req_received(req);
2366                 return status;
2367         }
2368
2369         /* Steal possbile out parameters to the callers context */
2370         talloc_steal(mem_ctx, state->out_mem_ctx);
2371
2372         /* Return result */
2373         *result = state->orig.out.result;
2374
2375         tevent_req_received(req);
2376         return NT_STATUS_OK;
2377 }
2378
2379 NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli,
2380                               TALLOC_CTX *mem_ctx,
2381                               WERROR *werror)
2382 {
2383         struct PNP_CreateKey r;
2384         NTSTATUS status;
2385
2386         /* In parameters */
2387
2388         status = cli->dispatch(cli,
2389                                 mem_ctx,
2390                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2391                                 NDR_PNP_CREATEKEY,
2392                                 &r);
2393
2394         if (!NT_STATUS_IS_OK(status)) {
2395                 return status;
2396         }
2397
2398         if (NT_STATUS_IS_ERR(status)) {
2399                 return status;
2400         }
2401
2402         /* Return variables */
2403
2404         /* Return result */
2405         if (werror) {
2406                 *werror = r.out.result;
2407         }
2408
2409         return werror_to_ntstatus(r.out.result);
2410 }
2411
2412 struct rpccli_PNP_DeleteRegistryKey_state {
2413         struct PNP_DeleteRegistryKey orig;
2414         struct PNP_DeleteRegistryKey tmp;
2415         TALLOC_CTX *out_mem_ctx;
2416         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2417 };
2418
2419 static void rpccli_PNP_DeleteRegistryKey_done(struct tevent_req *subreq);
2420
2421 struct tevent_req *rpccli_PNP_DeleteRegistryKey_send(TALLOC_CTX *mem_ctx,
2422                                                      struct tevent_context *ev,
2423                                                      struct rpc_pipe_client *cli)
2424 {
2425         struct tevent_req *req;
2426         struct rpccli_PNP_DeleteRegistryKey_state *state;
2427         struct tevent_req *subreq;
2428
2429         req = tevent_req_create(mem_ctx, &state,
2430                                 struct rpccli_PNP_DeleteRegistryKey_state);
2431         if (req == NULL) {
2432                 return NULL;
2433         }
2434         state->out_mem_ctx = NULL;
2435         state->dispatch_recv = cli->dispatch_recv;
2436
2437         /* In parameters */
2438
2439         /* Out parameters */
2440
2441         /* Result */
2442         ZERO_STRUCT(state->orig.out.result);
2443
2444         /* make a temporary copy, that we pass to the dispatch function */
2445         state->tmp = state->orig;
2446
2447         subreq = cli->dispatch_send(state, ev, cli,
2448                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2449                                     NDR_PNP_DELETEREGISTRYKEY,
2450                                     &state->tmp);
2451         if (tevent_req_nomem(subreq, req)) {
2452                 return tevent_req_post(req, ev);
2453         }
2454         tevent_req_set_callback(subreq, rpccli_PNP_DeleteRegistryKey_done, req);
2455         return req;
2456 }
2457
2458 static void rpccli_PNP_DeleteRegistryKey_done(struct tevent_req *subreq)
2459 {
2460         struct tevent_req *req = tevent_req_callback_data(
2461                 subreq, struct tevent_req);
2462         struct rpccli_PNP_DeleteRegistryKey_state *state = tevent_req_data(
2463                 req, struct rpccli_PNP_DeleteRegistryKey_state);
2464         NTSTATUS status;
2465         TALLOC_CTX *mem_ctx;
2466
2467         if (state->out_mem_ctx) {
2468                 mem_ctx = state->out_mem_ctx;
2469         } else {
2470                 mem_ctx = state;
2471         }
2472
2473         status = state->dispatch_recv(subreq, mem_ctx);
2474         TALLOC_FREE(subreq);
2475         if (!NT_STATUS_IS_OK(status)) {
2476                 tevent_req_nterror(req, status);
2477                 return;
2478         }
2479
2480         /* Copy out parameters */
2481
2482         /* Copy result */
2483         state->orig.out.result = state->tmp.out.result;
2484
2485         /* Reset temporary structure */
2486         ZERO_STRUCT(state->tmp);
2487
2488         tevent_req_done(req);
2489 }
2490
2491 NTSTATUS rpccli_PNP_DeleteRegistryKey_recv(struct tevent_req *req,
2492                                            TALLOC_CTX *mem_ctx,
2493                                            WERROR *result)
2494 {
2495         struct rpccli_PNP_DeleteRegistryKey_state *state = tevent_req_data(
2496                 req, struct rpccli_PNP_DeleteRegistryKey_state);
2497         NTSTATUS status;
2498
2499         if (tevent_req_is_nterror(req, &status)) {
2500                 tevent_req_received(req);
2501                 return status;
2502         }
2503
2504         /* Steal possbile out parameters to the callers context */
2505         talloc_steal(mem_ctx, state->out_mem_ctx);
2506
2507         /* Return result */
2508         *result = state->orig.out.result;
2509
2510         tevent_req_received(req);
2511         return NT_STATUS_OK;
2512 }
2513
2514 NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli,
2515                                       TALLOC_CTX *mem_ctx,
2516                                       WERROR *werror)
2517 {
2518         struct PNP_DeleteRegistryKey r;
2519         NTSTATUS status;
2520
2521         /* In parameters */
2522
2523         status = cli->dispatch(cli,
2524                                 mem_ctx,
2525                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2526                                 NDR_PNP_DELETEREGISTRYKEY,
2527                                 &r);
2528
2529         if (!NT_STATUS_IS_OK(status)) {
2530                 return status;
2531         }
2532
2533         if (NT_STATUS_IS_ERR(status)) {
2534                 return status;
2535         }
2536
2537         /* Return variables */
2538
2539         /* Return result */
2540         if (werror) {
2541                 *werror = r.out.result;
2542         }
2543
2544         return werror_to_ntstatus(r.out.result);
2545 }
2546
2547 struct rpccli_PNP_GetClassCount_state {
2548         struct PNP_GetClassCount orig;
2549         struct PNP_GetClassCount tmp;
2550         TALLOC_CTX *out_mem_ctx;
2551         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2552 };
2553
2554 static void rpccli_PNP_GetClassCount_done(struct tevent_req *subreq);
2555
2556 struct tevent_req *rpccli_PNP_GetClassCount_send(TALLOC_CTX *mem_ctx,
2557                                                  struct tevent_context *ev,
2558                                                  struct rpc_pipe_client *cli)
2559 {
2560         struct tevent_req *req;
2561         struct rpccli_PNP_GetClassCount_state *state;
2562         struct tevent_req *subreq;
2563
2564         req = tevent_req_create(mem_ctx, &state,
2565                                 struct rpccli_PNP_GetClassCount_state);
2566         if (req == NULL) {
2567                 return NULL;
2568         }
2569         state->out_mem_ctx = NULL;
2570         state->dispatch_recv = cli->dispatch_recv;
2571
2572         /* In parameters */
2573
2574         /* Out parameters */
2575
2576         /* Result */
2577         ZERO_STRUCT(state->orig.out.result);
2578
2579         /* make a temporary copy, that we pass to the dispatch function */
2580         state->tmp = state->orig;
2581
2582         subreq = cli->dispatch_send(state, ev, cli,
2583                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2584                                     NDR_PNP_GETCLASSCOUNT,
2585                                     &state->tmp);
2586         if (tevent_req_nomem(subreq, req)) {
2587                 return tevent_req_post(req, ev);
2588         }
2589         tevent_req_set_callback(subreq, rpccli_PNP_GetClassCount_done, req);
2590         return req;
2591 }
2592
2593 static void rpccli_PNP_GetClassCount_done(struct tevent_req *subreq)
2594 {
2595         struct tevent_req *req = tevent_req_callback_data(
2596                 subreq, struct tevent_req);
2597         struct rpccli_PNP_GetClassCount_state *state = tevent_req_data(
2598                 req, struct rpccli_PNP_GetClassCount_state);
2599         NTSTATUS status;
2600         TALLOC_CTX *mem_ctx;
2601
2602         if (state->out_mem_ctx) {
2603                 mem_ctx = state->out_mem_ctx;
2604         } else {
2605                 mem_ctx = state;
2606         }
2607
2608         status = state->dispatch_recv(subreq, mem_ctx);
2609         TALLOC_FREE(subreq);
2610         if (!NT_STATUS_IS_OK(status)) {
2611                 tevent_req_nterror(req, status);
2612                 return;
2613         }
2614
2615         /* Copy out parameters */
2616
2617         /* Copy result */
2618         state->orig.out.result = state->tmp.out.result;
2619
2620         /* Reset temporary structure */
2621         ZERO_STRUCT(state->tmp);
2622
2623         tevent_req_done(req);
2624 }
2625
2626 NTSTATUS rpccli_PNP_GetClassCount_recv(struct tevent_req *req,
2627                                        TALLOC_CTX *mem_ctx,
2628                                        WERROR *result)
2629 {
2630         struct rpccli_PNP_GetClassCount_state *state = tevent_req_data(
2631                 req, struct rpccli_PNP_GetClassCount_state);
2632         NTSTATUS status;
2633
2634         if (tevent_req_is_nterror(req, &status)) {
2635                 tevent_req_received(req);
2636                 return status;
2637         }
2638
2639         /* Steal possbile out parameters to the callers context */
2640         talloc_steal(mem_ctx, state->out_mem_ctx);
2641
2642         /* Return result */
2643         *result = state->orig.out.result;
2644
2645         tevent_req_received(req);
2646         return NT_STATUS_OK;
2647 }
2648
2649 NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli,
2650                                   TALLOC_CTX *mem_ctx,
2651                                   WERROR *werror)
2652 {
2653         struct PNP_GetClassCount r;
2654         NTSTATUS status;
2655
2656         /* In parameters */
2657
2658         status = cli->dispatch(cli,
2659                                 mem_ctx,
2660                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2661                                 NDR_PNP_GETCLASSCOUNT,
2662                                 &r);
2663
2664         if (!NT_STATUS_IS_OK(status)) {
2665                 return status;
2666         }
2667
2668         if (NT_STATUS_IS_ERR(status)) {
2669                 return status;
2670         }
2671
2672         /* Return variables */
2673
2674         /* Return result */
2675         if (werror) {
2676                 *werror = r.out.result;
2677         }
2678
2679         return werror_to_ntstatus(r.out.result);
2680 }
2681
2682 struct rpccli_PNP_GetClassName_state {
2683         struct PNP_GetClassName orig;
2684         struct PNP_GetClassName tmp;
2685         TALLOC_CTX *out_mem_ctx;
2686         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2687 };
2688
2689 static void rpccli_PNP_GetClassName_done(struct tevent_req *subreq);
2690
2691 struct tevent_req *rpccli_PNP_GetClassName_send(TALLOC_CTX *mem_ctx,
2692                                                 struct tevent_context *ev,
2693                                                 struct rpc_pipe_client *cli)
2694 {
2695         struct tevent_req *req;
2696         struct rpccli_PNP_GetClassName_state *state;
2697         struct tevent_req *subreq;
2698
2699         req = tevent_req_create(mem_ctx, &state,
2700                                 struct rpccli_PNP_GetClassName_state);
2701         if (req == NULL) {
2702                 return NULL;
2703         }
2704         state->out_mem_ctx = NULL;
2705         state->dispatch_recv = cli->dispatch_recv;
2706
2707         /* In parameters */
2708
2709         /* Out parameters */
2710
2711         /* Result */
2712         ZERO_STRUCT(state->orig.out.result);
2713
2714         /* make a temporary copy, that we pass to the dispatch function */
2715         state->tmp = state->orig;
2716
2717         subreq = cli->dispatch_send(state, ev, cli,
2718                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2719                                     NDR_PNP_GETCLASSNAME,
2720                                     &state->tmp);
2721         if (tevent_req_nomem(subreq, req)) {
2722                 return tevent_req_post(req, ev);
2723         }
2724         tevent_req_set_callback(subreq, rpccli_PNP_GetClassName_done, req);
2725         return req;
2726 }
2727
2728 static void rpccli_PNP_GetClassName_done(struct tevent_req *subreq)
2729 {
2730         struct tevent_req *req = tevent_req_callback_data(
2731                 subreq, struct tevent_req);
2732         struct rpccli_PNP_GetClassName_state *state = tevent_req_data(
2733                 req, struct rpccli_PNP_GetClassName_state);
2734         NTSTATUS status;
2735         TALLOC_CTX *mem_ctx;
2736
2737         if (state->out_mem_ctx) {
2738                 mem_ctx = state->out_mem_ctx;
2739         } else {
2740                 mem_ctx = state;
2741         }
2742
2743         status = state->dispatch_recv(subreq, mem_ctx);
2744         TALLOC_FREE(subreq);
2745         if (!NT_STATUS_IS_OK(status)) {
2746                 tevent_req_nterror(req, status);
2747                 return;
2748         }
2749
2750         /* Copy out parameters */
2751
2752         /* Copy result */
2753         state->orig.out.result = state->tmp.out.result;
2754
2755         /* Reset temporary structure */
2756         ZERO_STRUCT(state->tmp);
2757
2758         tevent_req_done(req);
2759 }
2760
2761 NTSTATUS rpccli_PNP_GetClassName_recv(struct tevent_req *req,
2762                                       TALLOC_CTX *mem_ctx,
2763                                       WERROR *result)
2764 {
2765         struct rpccli_PNP_GetClassName_state *state = tevent_req_data(
2766                 req, struct rpccli_PNP_GetClassName_state);
2767         NTSTATUS status;
2768
2769         if (tevent_req_is_nterror(req, &status)) {
2770                 tevent_req_received(req);
2771                 return status;
2772         }
2773
2774         /* Steal possbile out parameters to the callers context */
2775         talloc_steal(mem_ctx, state->out_mem_ctx);
2776
2777         /* Return result */
2778         *result = state->orig.out.result;
2779
2780         tevent_req_received(req);
2781         return NT_STATUS_OK;
2782 }
2783
2784 NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli,
2785                                  TALLOC_CTX *mem_ctx,
2786                                  WERROR *werror)
2787 {
2788         struct PNP_GetClassName r;
2789         NTSTATUS status;
2790
2791         /* In parameters */
2792
2793         status = cli->dispatch(cli,
2794                                 mem_ctx,
2795                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2796                                 NDR_PNP_GETCLASSNAME,
2797                                 &r);
2798
2799         if (!NT_STATUS_IS_OK(status)) {
2800                 return status;
2801         }
2802
2803         if (NT_STATUS_IS_ERR(status)) {
2804                 return status;
2805         }
2806
2807         /* Return variables */
2808
2809         /* Return result */
2810         if (werror) {
2811                 *werror = r.out.result;
2812         }
2813
2814         return werror_to_ntstatus(r.out.result);
2815 }
2816
2817 struct rpccli_PNP_DeleteClassKey_state {
2818         struct PNP_DeleteClassKey orig;
2819         struct PNP_DeleteClassKey tmp;
2820         TALLOC_CTX *out_mem_ctx;
2821         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2822 };
2823
2824 static void rpccli_PNP_DeleteClassKey_done(struct tevent_req *subreq);
2825
2826 struct tevent_req *rpccli_PNP_DeleteClassKey_send(TALLOC_CTX *mem_ctx,
2827                                                   struct tevent_context *ev,
2828                                                   struct rpc_pipe_client *cli)
2829 {
2830         struct tevent_req *req;
2831         struct rpccli_PNP_DeleteClassKey_state *state;
2832         struct tevent_req *subreq;
2833
2834         req = tevent_req_create(mem_ctx, &state,
2835                                 struct rpccli_PNP_DeleteClassKey_state);
2836         if (req == NULL) {
2837                 return NULL;
2838         }
2839         state->out_mem_ctx = NULL;
2840         state->dispatch_recv = cli->dispatch_recv;
2841
2842         /* In parameters */
2843
2844         /* Out parameters */
2845
2846         /* Result */
2847         ZERO_STRUCT(state->orig.out.result);
2848
2849         /* make a temporary copy, that we pass to the dispatch function */
2850         state->tmp = state->orig;
2851
2852         subreq = cli->dispatch_send(state, ev, cli,
2853                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2854                                     NDR_PNP_DELETECLASSKEY,
2855                                     &state->tmp);
2856         if (tevent_req_nomem(subreq, req)) {
2857                 return tevent_req_post(req, ev);
2858         }
2859         tevent_req_set_callback(subreq, rpccli_PNP_DeleteClassKey_done, req);
2860         return req;
2861 }
2862
2863 static void rpccli_PNP_DeleteClassKey_done(struct tevent_req *subreq)
2864 {
2865         struct tevent_req *req = tevent_req_callback_data(
2866                 subreq, struct tevent_req);
2867         struct rpccli_PNP_DeleteClassKey_state *state = tevent_req_data(
2868                 req, struct rpccli_PNP_DeleteClassKey_state);
2869         NTSTATUS status;
2870         TALLOC_CTX *mem_ctx;
2871
2872         if (state->out_mem_ctx) {
2873                 mem_ctx = state->out_mem_ctx;
2874         } else {
2875                 mem_ctx = state;
2876         }
2877
2878         status = state->dispatch_recv(subreq, mem_ctx);
2879         TALLOC_FREE(subreq);
2880         if (!NT_STATUS_IS_OK(status)) {
2881                 tevent_req_nterror(req, status);
2882                 return;
2883         }
2884
2885         /* Copy out parameters */
2886
2887         /* Copy result */
2888         state->orig.out.result = state->tmp.out.result;
2889
2890         /* Reset temporary structure */
2891         ZERO_STRUCT(state->tmp);
2892
2893         tevent_req_done(req);
2894 }
2895
2896 NTSTATUS rpccli_PNP_DeleteClassKey_recv(struct tevent_req *req,
2897                                         TALLOC_CTX *mem_ctx,
2898                                         WERROR *result)
2899 {
2900         struct rpccli_PNP_DeleteClassKey_state *state = tevent_req_data(
2901                 req, struct rpccli_PNP_DeleteClassKey_state);
2902         NTSTATUS status;
2903
2904         if (tevent_req_is_nterror(req, &status)) {
2905                 tevent_req_received(req);
2906                 return status;
2907         }
2908
2909         /* Steal possbile out parameters to the callers context */
2910         talloc_steal(mem_ctx, state->out_mem_ctx);
2911
2912         /* Return result */
2913         *result = state->orig.out.result;
2914
2915         tevent_req_received(req);
2916         return NT_STATUS_OK;
2917 }
2918
2919 NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli,
2920                                    TALLOC_CTX *mem_ctx,
2921                                    WERROR *werror)
2922 {
2923         struct PNP_DeleteClassKey r;
2924         NTSTATUS status;
2925
2926         /* In parameters */
2927
2928         status = cli->dispatch(cli,
2929                                 mem_ctx,
2930                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2931                                 NDR_PNP_DELETECLASSKEY,
2932                                 &r);
2933
2934         if (!NT_STATUS_IS_OK(status)) {
2935                 return status;
2936         }
2937
2938         if (NT_STATUS_IS_ERR(status)) {
2939                 return status;
2940         }
2941
2942         /* Return variables */
2943
2944         /* Return result */
2945         if (werror) {
2946                 *werror = r.out.result;
2947         }
2948
2949         return werror_to_ntstatus(r.out.result);
2950 }
2951
2952 struct rpccli_PNP_GetInterfaceDeviceAlias_state {
2953         struct PNP_GetInterfaceDeviceAlias orig;
2954         struct PNP_GetInterfaceDeviceAlias tmp;
2955         TALLOC_CTX *out_mem_ctx;
2956         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2957 };
2958
2959 static void rpccli_PNP_GetInterfaceDeviceAlias_done(struct tevent_req *subreq);
2960
2961 struct tevent_req *rpccli_PNP_GetInterfaceDeviceAlias_send(TALLOC_CTX *mem_ctx,
2962                                                            struct tevent_context *ev,
2963                                                            struct rpc_pipe_client *cli)
2964 {
2965         struct tevent_req *req;
2966         struct rpccli_PNP_GetInterfaceDeviceAlias_state *state;
2967         struct tevent_req *subreq;
2968
2969         req = tevent_req_create(mem_ctx, &state,
2970                                 struct rpccli_PNP_GetInterfaceDeviceAlias_state);
2971         if (req == NULL) {
2972                 return NULL;
2973         }
2974         state->out_mem_ctx = NULL;
2975         state->dispatch_recv = cli->dispatch_recv;
2976
2977         /* In parameters */
2978
2979         /* Out parameters */
2980
2981         /* Result */
2982         ZERO_STRUCT(state->orig.out.result);
2983
2984         /* make a temporary copy, that we pass to the dispatch function */
2985         state->tmp = state->orig;
2986
2987         subreq = cli->dispatch_send(state, ev, cli,
2988                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
2989                                     NDR_PNP_GETINTERFACEDEVICEALIAS,
2990                                     &state->tmp);
2991         if (tevent_req_nomem(subreq, req)) {
2992                 return tevent_req_post(req, ev);
2993         }
2994         tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceAlias_done, req);
2995         return req;
2996 }
2997
2998 static void rpccli_PNP_GetInterfaceDeviceAlias_done(struct tevent_req *subreq)
2999 {
3000         struct tevent_req *req = tevent_req_callback_data(
3001                 subreq, struct tevent_req);
3002         struct rpccli_PNP_GetInterfaceDeviceAlias_state *state = tevent_req_data(
3003                 req, struct rpccli_PNP_GetInterfaceDeviceAlias_state);
3004         NTSTATUS status;
3005         TALLOC_CTX *mem_ctx;
3006
3007         if (state->out_mem_ctx) {
3008                 mem_ctx = state->out_mem_ctx;
3009         } else {
3010                 mem_ctx = state;
3011         }
3012
3013         status = state->dispatch_recv(subreq, mem_ctx);
3014         TALLOC_FREE(subreq);
3015         if (!NT_STATUS_IS_OK(status)) {
3016                 tevent_req_nterror(req, status);
3017                 return;
3018         }
3019
3020         /* Copy out parameters */
3021
3022         /* Copy result */
3023         state->orig.out.result = state->tmp.out.result;
3024
3025         /* Reset temporary structure */
3026         ZERO_STRUCT(state->tmp);
3027
3028         tevent_req_done(req);
3029 }
3030
3031 NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias_recv(struct tevent_req *req,
3032                                                  TALLOC_CTX *mem_ctx,
3033                                                  WERROR *result)
3034 {
3035         struct rpccli_PNP_GetInterfaceDeviceAlias_state *state = tevent_req_data(
3036                 req, struct rpccli_PNP_GetInterfaceDeviceAlias_state);
3037         NTSTATUS status;
3038
3039         if (tevent_req_is_nterror(req, &status)) {
3040                 tevent_req_received(req);
3041                 return status;
3042         }
3043
3044         /* Steal possbile out parameters to the callers context */
3045         talloc_steal(mem_ctx, state->out_mem_ctx);
3046
3047         /* Return result */
3048         *result = state->orig.out.result;
3049
3050         tevent_req_received(req);
3051         return NT_STATUS_OK;
3052 }
3053
3054 NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli,
3055                                             TALLOC_CTX *mem_ctx,
3056                                             WERROR *werror)
3057 {
3058         struct PNP_GetInterfaceDeviceAlias r;
3059         NTSTATUS status;
3060
3061         /* In parameters */
3062
3063         status = cli->dispatch(cli,
3064                                 mem_ctx,
3065                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
3066                                 NDR_PNP_GETINTERFACEDEVICEALIAS,
3067                                 &r);
3068
3069         if (!NT_STATUS_IS_OK(status)) {
3070                 return status;
3071         }
3072
3073         if (NT_STATUS_IS_ERR(status)) {
3074                 return status;
3075         }
3076
3077         /* Return variables */
3078
3079         /* Return result */
3080         if (werror) {
3081                 *werror = r.out.result;
3082         }
3083
3084         return werror_to_ntstatus(r.out.result);
3085 }
3086
3087 struct rpccli_PNP_GetInterfaceDeviceList_state {
3088         struct PNP_GetInterfaceDeviceList orig;
3089         struct PNP_GetInterfaceDeviceList tmp;
3090         TALLOC_CTX *out_mem_ctx;
3091         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3092 };
3093
3094 static void rpccli_PNP_GetInterfaceDeviceList_done(struct tevent_req *subreq);
3095
3096 struct tevent_req *rpccli_PNP_GetInterfaceDeviceList_send(TALLOC_CTX *mem_ctx,
3097                                                           struct tevent_context *ev,
3098                                                           struct rpc_pipe_client *cli)
3099 {
3100         struct tevent_req *req;
3101         struct rpccli_PNP_GetInterfaceDeviceList_state *state;
3102         struct tevent_req *subreq;
3103
3104         req = tevent_req_create(mem_ctx, &state,
3105                                 struct rpccli_PNP_GetInterfaceDeviceList_state);
3106         if (req == NULL) {
3107                 return NULL;
3108         }
3109         state->out_mem_ctx = NULL;
3110         state->dispatch_recv = cli->dispatch_recv;
3111
3112         /* In parameters */
3113
3114         /* Out parameters */
3115
3116         /* Result */
3117         ZERO_STRUCT(state->orig.out.result);
3118
3119         /* make a temporary copy, that we pass to the dispatch function */
3120         state->tmp = state->orig;
3121
3122         subreq = cli->dispatch_send(state, ev, cli,
3123                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
3124                                     NDR_PNP_GETINTERFACEDEVICELIST,
3125                                     &state->tmp);
3126         if (tevent_req_nomem(subreq, req)) {
3127                 return tevent_req_post(req, ev);
3128         }
3129         tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceList_done, req);
3130         return req;
3131 }
3132
3133 static void rpccli_PNP_GetInterfaceDeviceList_done(struct tevent_req *subreq)
3134 {
3135         struct tevent_req *req = tevent_req_callback_data(
3136                 subreq, struct tevent_req);
3137         struct rpccli_PNP_GetInterfaceDeviceList_state *state = tevent_req_data(
3138                 req, struct rpccli_PNP_GetInterfaceDeviceList_state);
3139         NTSTATUS status;
3140         TALLOC_CTX *mem_ctx;
3141
3142         if (state->out_mem_ctx) {
3143                 mem_ctx = state->out_mem_ctx;
3144         } else {
3145                 mem_ctx = state;
3146         }
3147
3148         status = state->dispatch_recv(subreq, mem_ctx);
3149         TALLOC_FREE(subreq);
3150         if (!NT_STATUS_IS_OK(status)) {
3151                 tevent_req_nterror(req, status);
3152                 return;
3153         }
3154
3155         /* Copy out parameters */
3156
3157         /* Copy result */
3158         state->orig.out.result = state->tmp.out.result;
3159
3160         /* Reset temporary structure */
3161         ZERO_STRUCT(state->tmp);
3162
3163         tevent_req_done(req);
3164 }
3165
3166 NTSTATUS rpccli_PNP_GetInterfaceDeviceList_recv(struct tevent_req *req,
3167                                                 TALLOC_CTX *mem_ctx,
3168                                                 WERROR *result)
3169 {
3170         struct rpccli_PNP_GetInterfaceDeviceList_state *state = tevent_req_data(
3171                 req, struct rpccli_PNP_GetInterfaceDeviceList_state);
3172         NTSTATUS status;
3173
3174         if (tevent_req_is_nterror(req, &status)) {
3175                 tevent_req_received(req);
3176                 return status;
3177         }
3178
3179         /* Steal possbile out parameters to the callers context */
3180         talloc_steal(mem_ctx, state->out_mem_ctx);
3181
3182         /* Return result */
3183         *result = state->orig.out.result;
3184
3185         tevent_req_received(req);
3186         return NT_STATUS_OK;
3187 }
3188
3189 NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli,
3190                                            TALLOC_CTX *mem_ctx,
3191                                            WERROR *werror)
3192 {
3193         struct PNP_GetInterfaceDeviceList r;
3194         NTSTATUS status;
3195
3196         /* In parameters */
3197
3198         status = cli->dispatch(cli,
3199                                 mem_ctx,
3200                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
3201                                 NDR_PNP_GETINTERFACEDEVICELIST,
3202                                 &r);
3203
3204         if (!NT_STATUS_IS_OK(status)) {
3205                 return status;
3206         }
3207
3208         if (NT_STATUS_IS_ERR(status)) {
3209                 return status;
3210         }
3211
3212         /* Return variables */
3213
3214         /* Return result */
3215         if (werror) {
3216                 *werror = r.out.result;
3217         }
3218
3219         return werror_to_ntstatus(r.out.result);
3220 }
3221
3222 struct rpccli_PNP_GetInterfaceDeviceListSize_state {
3223         struct PNP_GetInterfaceDeviceListSize orig;
3224         struct PNP_GetInterfaceDeviceListSize tmp;
3225         TALLOC_CTX *out_mem_ctx;
3226         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3227 };
3228
3229 static void rpccli_PNP_GetInterfaceDeviceListSize_done(struct tevent_req *subreq);
3230
3231 struct tevent_req *rpccli_PNP_GetInterfaceDeviceListSize_send(TALLOC_CTX *mem_ctx,
3232                                                               struct tevent_context *ev,
3233                                                               struct rpc_pipe_client *cli)
3234 {
3235         struct tevent_req *req;
3236         struct rpccli_PNP_GetInterfaceDeviceListSize_state *state;
3237         struct tevent_req *subreq;
3238
3239         req = tevent_req_create(mem_ctx, &state,
3240                                 struct rpccli_PNP_GetInterfaceDeviceListSize_state);
3241         if (req == NULL) {
3242                 return NULL;
3243         }
3244         state->out_mem_ctx = NULL;
3245         state->dispatch_recv = cli->dispatch_recv;
3246
3247         /* In parameters */
3248
3249         /* Out parameters */
3250
3251         /* Result */
3252         ZERO_STRUCT(state->orig.out.result);
3253
3254         /* make a temporary copy, that we pass to the dispatch function */
3255         state->tmp = state->orig;
3256
3257         subreq = cli->dispatch_send(state, ev, cli,
3258                                     NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
3259                                     NDR_PNP_GETINTERFACEDEVICELISTSIZE,
3260                                     &state->tmp);
3261         if (tevent_req_nomem(subreq, req)) {
3262                 return tevent_req_post(req, ev);
3263         }
3264         tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceListSize_done, req);
3265         return req;
3266 }
3267
3268 static void rpccli_PNP_GetInterfaceDeviceListSize_done(struct tevent_req *subreq)
3269 {
3270         struct tevent_req *req = tevent_req_callback_data(
3271                 subreq, struct tevent_req);
3272         struct rpccli_PNP_GetInterfaceDeviceListSize_state *state = tevent_req_data(
3273                 req, struct rpccli_PNP_GetInterfaceDeviceListSize_state);
3274         NTSTATUS status;
3275         TALLOC_CTX *mem_ctx;
3276
3277         if (state->out_mem_ctx) {
3278                 mem_ctx = state->out_mem_ctx;
3279         } else {
3280                 mem_ctx = state;
3281         }
3282
3283         status = state->dispatch_recv(subreq, mem_ctx);
3284         TALLOC_FREE(subreq);
3285         if (!NT_STATUS_IS_OK(status)) {
3286                 tevent_req_nterror(req, status);
3287                 return;
3288         }
3289
3290         /* Copy out parameters */
3291
3292         /* Copy result */
3293         state->orig.out.result = state->tmp.out.result;
3294
3295         /* Reset temporary structure */
3296         ZERO_STRUCT(state->tmp);
3297
3298         tevent_req_done(req);
3299 }
3300
3301 NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize_recv(struct tevent_req *req,
3302                                                     TALLOC_CTX *mem_ctx,
3303                                                     WERROR *result)
3304 {
3305         struct rpccli_PNP_GetInterfaceDeviceListSize_state *state = tevent_req_data(
3306                 req, struct rpccli_PNP_GetInterfaceDeviceListSize_state);
3307         NTSTATUS status;
3308
3309         if (tevent_req_is_nterror(req, &status)) {
3310                 tevent_req_received(req);
3311                 return status;
3312         }
3313
3314         /* Steal possbile out parameters to the callers context */
3315         talloc_steal(mem_ctx, state->out_mem_ctx);
3316
3317         /* Return result */
3318         *result = state->orig.out.result;
3319
3320         tevent_req_received(req);
3321         return NT_STATUS_OK;
3322 }
3323
3324 NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli,
3325                                                TALLOC_CTX *mem_ctx,
3326                                                WERROR *werror)
3327 {
3328         struct PNP_GetInterfaceDeviceListSize r;
3329         NTSTATUS status;
3330
3331         /* In parameters */
3332
3333         status = cli->dispatch(cli,
3334                                 mem_ctx,
3335                                 NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION,
3336                                 NDR_PNP_GETINTERFACEDEVICELISTSIZE,
3337                                 &r);
3338
3339         if (!NT_STATUS_IS_OK(status)) {
3340                 return status;
3341         }
3342
3343         if (NT_STATUS_IS_ERR(status)) {
3344                 return status;
3345         }
3346
3347         /* Return variables */
3348
3349         /* Return result */
3350         if (werror) {
3351                 *werror = r.out.result;
3352         }
3353
3354         return werror_to_ntstatus(r.out.result);
3355 }
3356
3357 struct rpccli_PNP_RegisterDeviceClassAssociation_state {