spoolss: make two bitmaps public.
[abartlet/samba.git/.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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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_table_ntsvcs,
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 {
3358         struct PNP_RegisterDeviceClassAssociation orig;
3359         struct PNP_RegisterDeviceClassAssociation tmp;
3360         TALLOC_CTX *out_mem_ctx;
3361         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3362 };
3363
3364 static void rpccli_PNP_RegisterDeviceClassAssociation_done(struct tevent_req *subreq);
3365
3366 struct tevent_req *rpccli_PNP_RegisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
3367                                                                   struct tevent_context *ev,
3368                                                                   struct rpc_pipe_client *cli)
3369 {
3370         struct tevent_req *req;
3371         struct rpccli_PNP_RegisterDeviceClassAssociation_state *state;
3372         struct tevent_req *subreq;
3373
3374         req = tevent_req_create(mem_ctx, &state,
3375                                 struct rpccli_PNP_RegisterDeviceClassAssociation_state);
3376         if (req == NULL) {
3377                 return NULL;
3378         }
3379         state->out_mem_ctx = NULL;
3380         state->dispatch_recv = cli->dispatch_recv;
3381
3382         /* In parameters */
3383
3384         /* Out parameters */
3385
3386         /* Result */
3387         ZERO_STRUCT(state->orig.out.result);
3388
3389         /* make a temporary copy, that we pass to the dispatch function */
3390         state->tmp = state->orig;
3391
3392         subreq = cli->dispatch_send(state, ev, cli,
3393                                     &ndr_table_ntsvcs,
3394                                     NDR_PNP_REGISTERDEVICECLASSASSOCIATION,
3395                                     &state->tmp);
3396         if (tevent_req_nomem(subreq, req)) {
3397                 return tevent_req_post(req, ev);
3398         }
3399         tevent_req_set_callback(subreq, rpccli_PNP_RegisterDeviceClassAssociation_done, req);
3400         return req;
3401 }
3402
3403 static void rpccli_PNP_RegisterDeviceClassAssociation_done(struct tevent_req *subreq)
3404 {
3405         struct tevent_req *req = tevent_req_callback_data(
3406                 subreq, struct tevent_req);
3407         struct rpccli_PNP_RegisterDeviceClassAssociation_state *state = tevent_req_data(
3408                 req, struct rpccli_PNP_RegisterDeviceClassAssociation_state);
3409         NTSTATUS status;
3410         TALLOC_CTX *mem_ctx;
3411
3412         if (state->out_mem_ctx) {
3413                 mem_ctx = state->out_mem_ctx;
3414         } else {
3415                 mem_ctx = state;
3416         }
3417
3418         status = state->dispatch_recv(subreq, mem_ctx);
3419         TALLOC_FREE(subreq);
3420         if (!NT_STATUS_IS_OK(status)) {
3421                 tevent_req_nterror(req, status);
3422                 return;
3423         }
3424
3425         /* Copy out parameters */
3426
3427         /* Copy result */
3428         state->orig.out.result = state->tmp.out.result;
3429
3430         /* Reset temporary structure */
3431         ZERO_STRUCT(state->tmp);
3432
3433         tevent_req_done(req);
3434 }
3435
3436 NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation_recv(struct tevent_req *req,
3437                                                         TALLOC_CTX *mem_ctx,
3438                                                         WERROR *result)
3439 {
3440         struct rpccli_PNP_RegisterDeviceClassAssociation_state *state = tevent_req_data(
3441                 req, struct rpccli_PNP_RegisterDeviceClassAssociation_state);
3442         NTSTATUS status;
3443
3444         if (tevent_req_is_nterror(req, &status)) {
3445                 tevent_req_received(req);
3446                 return status;
3447         }
3448
3449         /* Steal possbile out parameters to the callers context */
3450         talloc_steal(mem_ctx, state->out_mem_ctx);
3451
3452         /* Return result */
3453         *result = state->orig.out.result;
3454
3455         tevent_req_received(req);
3456         return NT_STATUS_OK;
3457 }
3458
3459 NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli,
3460                                                    TALLOC_CTX *mem_ctx,
3461                                                    WERROR *werror)
3462 {
3463         struct PNP_RegisterDeviceClassAssociation r;
3464         NTSTATUS status;
3465
3466         /* In parameters */
3467
3468         status = cli->dispatch(cli,
3469                                 mem_ctx,
3470                                 &ndr_table_ntsvcs,
3471                                 NDR_PNP_REGISTERDEVICECLASSASSOCIATION,
3472                                 &r);
3473
3474         if (!NT_STATUS_IS_OK(status)) {
3475                 return status;
3476         }
3477
3478         if (NT_STATUS_IS_ERR(status)) {
3479                 return status;
3480         }
3481
3482         /* Return variables */
3483
3484         /* Return result */
3485         if (werror) {
3486                 *werror = r.out.result;
3487         }
3488
3489         return werror_to_ntstatus(r.out.result);
3490 }
3491
3492 struct rpccli_PNP_UnregisterDeviceClassAssociation_state {
3493         struct PNP_UnregisterDeviceClassAssociation orig;
3494         struct PNP_UnregisterDeviceClassAssociation tmp;
3495         TALLOC_CTX *out_mem_ctx;
3496         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3497 };
3498
3499 static void rpccli_PNP_UnregisterDeviceClassAssociation_done(struct tevent_req *subreq);
3500
3501 struct tevent_req *rpccli_PNP_UnregisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
3502                                                                     struct tevent_context *ev,
3503                                                                     struct rpc_pipe_client *cli)
3504 {
3505         struct tevent_req *req;
3506         struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state;
3507         struct tevent_req *subreq;
3508
3509         req = tevent_req_create(mem_ctx, &state,
3510                                 struct rpccli_PNP_UnregisterDeviceClassAssociation_state);
3511         if (req == NULL) {
3512                 return NULL;
3513         }
3514         state->out_mem_ctx = NULL;
3515         state->dispatch_recv = cli->dispatch_recv;
3516
3517         /* In parameters */
3518
3519         /* Out parameters */
3520
3521         /* Result */
3522         ZERO_STRUCT(state->orig.out.result);
3523
3524         /* make a temporary copy, that we pass to the dispatch function */
3525         state->tmp = state->orig;
3526
3527         subreq = cli->dispatch_send(state, ev, cli,
3528                                     &ndr_table_ntsvcs,
3529                                     NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION,
3530                                     &state->tmp);
3531         if (tevent_req_nomem(subreq, req)) {
3532                 return tevent_req_post(req, ev);
3533         }
3534         tevent_req_set_callback(subreq, rpccli_PNP_UnregisterDeviceClassAssociation_done, req);
3535         return req;
3536 }
3537
3538 static void rpccli_PNP_UnregisterDeviceClassAssociation_done(struct tevent_req *subreq)
3539 {
3540         struct tevent_req *req = tevent_req_callback_data(
3541                 subreq, struct tevent_req);
3542         struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state = tevent_req_data(
3543                 req, struct rpccli_PNP_UnregisterDeviceClassAssociation_state);
3544         NTSTATUS status;
3545         TALLOC_CTX *mem_ctx;
3546
3547         if (state->out_mem_ctx) {
3548                 mem_ctx = state->out_mem_ctx;
3549         } else {
3550                 mem_ctx = state;
3551         }
3552
3553         status = state->dispatch_recv(subreq, mem_ctx);
3554         TALLOC_FREE(subreq);
3555         if (!NT_STATUS_IS_OK(status)) {
3556                 tevent_req_nterror(req, status);
3557                 return;
3558         }
3559
3560         /* Copy out parameters */
3561
3562         /* Copy result */
3563         state->orig.out.result = state->tmp.out.result;
3564
3565         /* Reset temporary structure */
3566         ZERO_STRUCT(state->tmp);
3567
3568         tevent_req_done(req);
3569 }
3570
3571 NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation_recv(struct tevent_req *req,
3572                                                           TALLOC_CTX *mem_ctx,
3573                                                           WERROR *result)
3574 {
3575         struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state = tevent_req_data(
3576                 req, struct rpccli_PNP_UnregisterDeviceClassAssociation_state);
3577         NTSTATUS status;
3578
3579         if (tevent_req_is_nterror(req, &status)) {
3580                 tevent_req_received(req);
3581                 return status;
3582         }
3583
3584         /* Steal possbile out parameters to the callers context */
3585         talloc_steal(mem_ctx, state->out_mem_ctx);
3586
3587         /* Return result */
3588         *result = state->orig.out.result;
3589
3590         tevent_req_received(req);
3591         return NT_STATUS_OK;
3592 }
3593
3594 NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli,
3595                                                      TALLOC_CTX *mem_ctx,
3596                                                      WERROR *werror)
3597 {
3598         struct PNP_UnregisterDeviceClassAssociation r;
3599         NTSTATUS status;
3600
3601         /* In parameters */
3602
3603         status = cli->dispatch(cli,
3604                                 mem_ctx,
3605                                 &ndr_table_ntsvcs,
3606                                 NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION,
3607                                 &r);
3608
3609         if (!NT_STATUS_IS_OK(status)) {
3610                 return status;
3611         }
3612
3613         if (NT_STATUS_IS_ERR(status)) {
3614                 return status;
3615         }
3616
3617         /* Return variables */
3618
3619         /* Return result */
3620         if (werror) {
3621                 *werror = r.out.result;
3622         }
3623
3624         return werror_to_ntstatus(r.out.result);
3625 }
3626
3627 struct rpccli_PNP_GetClassRegProp_state {
3628         struct PNP_GetClassRegProp orig;
3629         struct PNP_GetClassRegProp tmp;
3630         TALLOC_CTX *out_mem_ctx;
3631         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3632 };
3633
3634 static void rpccli_PNP_GetClassRegProp_done(struct tevent_req *subreq);
3635
3636 struct tevent_req *rpccli_PNP_GetClassRegProp_send(TALLOC_CTX *mem_ctx,
3637                                                    struct tevent_context *ev,
3638                                                    struct rpc_pipe_client *cli)
3639 {
3640         struct tevent_req *req;
3641         struct rpccli_PNP_GetClassRegProp_state *state;
3642         struct tevent_req *subreq;
3643
3644         req = tevent_req_create(mem_ctx, &state,
3645                                 struct rpccli_PNP_GetClassRegProp_state);
3646         if (req == NULL) {
3647                 return NULL;
3648         }
3649         state->out_mem_ctx = NULL;
3650         state->dispatch_recv = cli->dispatch_recv;
3651
3652         /* In parameters */
3653
3654         /* Out parameters */
3655
3656         /* Result */
3657         ZERO_STRUCT(state->orig.out.result);
3658
3659         /* make a temporary copy, that we pass to the dispatch function */
3660         state->tmp = state->orig;
3661
3662         subreq = cli->dispatch_send(state, ev, cli,
3663                                     &ndr_table_ntsvcs,
3664                                     NDR_PNP_GETCLASSREGPROP,
3665                                     &state->tmp);
3666         if (tevent_req_nomem(subreq, req)) {
3667                 return tevent_req_post(req, ev);
3668         }
3669         tevent_req_set_callback(subreq, rpccli_PNP_GetClassRegProp_done, req);
3670         return req;
3671 }
3672
3673 static void rpccli_PNP_GetClassRegProp_done(struct tevent_req *subreq)
3674 {
3675         struct tevent_req *req = tevent_req_callback_data(
3676                 subreq, struct tevent_req);
3677         struct rpccli_PNP_GetClassRegProp_state *state = tevent_req_data(
3678                 req, struct rpccli_PNP_GetClassRegProp_state);
3679         NTSTATUS status;
3680         TALLOC_CTX *mem_ctx;
3681
3682         if (state->out_mem_ctx) {
3683                 mem_ctx = state->out_mem_ctx;
3684         } else {
3685                 mem_ctx = state;
3686         }
3687
3688         status = state->dispatch_recv(subreq, mem_ctx);
3689         TALLOC_FREE(subreq);
3690         if (!NT_STATUS_IS_OK(status)) {
3691                 tevent_req_nterror(req, status);
3692                 return;
3693         }
3694
3695         /* Copy out parameters */
3696
3697         /* Copy result */
3698         state->orig.out.result = state->tmp.out.result;
3699
3700         /* Reset temporary structure */
3701         ZERO_STRUCT(state->tmp);
3702
3703         tevent_req_done(req);
3704 }
3705
3706 NTSTATUS rpccli_PNP_GetClassRegProp_recv(struct tevent_req *req,
3707                                          TALLOC_CTX *mem_ctx,
3708                                          WERROR *result)
3709 {
3710         struct rpccli_PNP_GetClassRegProp_state *state = tevent_req_data(
3711                 req, struct rpccli_PNP_GetClassRegProp_state);
3712         NTSTATUS status;
3713
3714         if (tevent_req_is_nterror(req, &status)) {
3715                 tevent_req_received(req);
3716                 return status;
3717         }
3718
3719         /* Steal possbile out parameters to the callers context */
3720         talloc_steal(mem_ctx, state->out_mem_ctx);
3721
3722         /* Return result */
3723         *result = state->orig.out.result;
3724
3725         tevent_req_received(req);
3726         return NT_STATUS_OK;
3727 }
3728
3729 NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli,
3730                                     TALLOC_CTX *mem_ctx,
3731                                     WERROR *werror)
3732 {
3733         struct PNP_GetClassRegProp r;
3734         NTSTATUS status;
3735
3736         /* In parameters */
3737
3738         status = cli->dispatch(cli,
3739                                 mem_ctx,
3740                                 &ndr_table_ntsvcs,
3741                                 NDR_PNP_GETCLASSREGPROP,
3742                                 &r);
3743
3744         if (!NT_STATUS_IS_OK(status)) {
3745                 return status;
3746         }
3747
3748         if (NT_STATUS_IS_ERR(status)) {
3749                 return status;
3750         }
3751
3752         /* Return variables */
3753
3754         /* Return result */
3755         if (werror) {
3756                 *werror = r.out.result;
3757         }
3758
3759         return werror_to_ntstatus(r.out.result);
3760 }
3761
3762 struct rpccli_PNP_SetClassRegProp_state {
3763         struct PNP_SetClassRegProp orig;
3764         struct PNP_SetClassRegProp tmp;
3765         TALLOC_CTX *out_mem_ctx;
3766         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3767 };
3768
3769 static void rpccli_PNP_SetClassRegProp_done(struct tevent_req *subreq);
3770
3771 struct tevent_req *rpccli_PNP_SetClassRegProp_send(TALLOC_CTX *mem_ctx,
3772                                                    struct tevent_context *ev,
3773                                                    struct rpc_pipe_client *cli)
3774 {
3775         struct tevent_req *req;
3776         struct rpccli_PNP_SetClassRegProp_state *state;
3777         struct tevent_req *subreq;
3778
3779         req = tevent_req_create(mem_ctx, &state,
3780                                 struct rpccli_PNP_SetClassRegProp_state);
3781         if (req == NULL) {
3782                 return NULL;
3783         }
3784         state->out_mem_ctx = NULL;
3785         state->dispatch_recv = cli->dispatch_recv;
3786
3787         /* In parameters */
3788
3789         /* Out parameters */
3790
3791         /* Result */
3792         ZERO_STRUCT(state->orig.out.result);
3793
3794         /* make a temporary copy, that we pass to the dispatch function */
3795         state->tmp = state->orig;
3796
3797         subreq = cli->dispatch_send(state, ev, cli,
3798                                     &ndr_table_ntsvcs,
3799                                     NDR_PNP_SETCLASSREGPROP,
3800                                     &state->tmp);
3801         if (tevent_req_nomem(subreq, req)) {
3802                 return tevent_req_post(req, ev);
3803         }
3804         tevent_req_set_callback(subreq, rpccli_PNP_SetClassRegProp_done, req);
3805         return req;
3806 }
3807
3808 static void rpccli_PNP_SetClassRegProp_done(struct tevent_req *subreq)
3809 {
3810         struct tevent_req *req = tevent_req_callback_data(
3811                 subreq, struct tevent_req);
3812         struct rpccli_PNP_SetClassRegProp_state *state = tevent_req_data(
3813                 req, struct rpccli_PNP_SetClassRegProp_state);
3814         NTSTATUS status;
3815         TALLOC_CTX *mem_ctx;
3816
3817         if (state->out_mem_ctx) {
3818                 mem_ctx = state->out_mem_ctx;
3819         } else {
3820                 mem_ctx = state;
3821         }
3822
3823         status = state->dispatch_recv(subreq, mem_ctx);
3824         TALLOC_FREE(subreq);
3825         if (!NT_STATUS_IS_OK(status)) {
3826                 tevent_req_nterror(req, status);
3827                 return;
3828         }
3829
3830         /* Copy out parameters */
3831
3832         /* Copy result */
3833         state->orig.out.result = state->tmp.out.result;
3834
3835         /* Reset temporary structure */
3836         ZERO_STRUCT(state->tmp);
3837
3838         tevent_req_done(req);
3839 }
3840
3841 NTSTATUS rpccli_PNP_SetClassRegProp_recv(struct tevent_req *req,
3842                                          TALLOC_CTX *mem_ctx,
3843                                          WERROR *result)
3844 {
3845         struct rpccli_PNP_SetClassRegProp_state *state = tevent_req_data(
3846                 req, struct rpccli_PNP_SetClassRegProp_state);
3847         NTSTATUS status;
3848
3849         if (tevent_req_is_nterror(req, &status)) {
3850                 tevent_req_received(req);
3851                 return status;
3852         }
3853
3854         /* Steal possbile out parameters to the callers context */
3855         talloc_steal(mem_ctx, state->out_mem_ctx);
3856
3857         /* Return result */
3858         *result = state->orig.out.result;
3859
3860         tevent_req_received(req);
3861         return NT_STATUS_OK;
3862 }
3863
3864 NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli,
3865                                     TALLOC_CTX *mem_ctx,
3866                                     WERROR *werror)
3867 {
3868         struct PNP_SetClassRegProp r;
3869         NTSTATUS status;
3870
3871         /* In parameters */
3872
3873         status = cli->dispatch(cli,
3874                                 mem_ctx,
3875                                 &ndr_table_ntsvcs,
3876                                 NDR_PNP_SETCLASSREGPROP,
3877                                 &r);
3878
3879         if (!NT_STATUS_IS_OK(status)) {
3880                 return status;
3881         }
3882
3883         if (NT_STATUS_IS_ERR(status)) {
3884                 return status;
3885         }
3886
3887         /* Return variables */
3888
3889         /* Return result */
3890         if (werror) {
3891                 *werror = r.out.result;
3892         }
3893
3894         return werror_to_ntstatus(r.out.result);
3895 }
3896
3897 struct rpccli_PNP_CreateDevInst_state {
3898         struct PNP_CreateDevInst orig;
3899         struct PNP_CreateDevInst tmp;
3900         TALLOC_CTX *out_mem_ctx;
3901         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3902 };
3903
3904 static void rpccli_PNP_CreateDevInst_done(struct tevent_req *subreq);
3905
3906 struct tevent_req *rpccli_PNP_CreateDevInst_send(TALLOC_CTX *mem_ctx,
3907                                                  struct tevent_context *ev,
3908                                                  struct rpc_pipe_client *cli)
3909 {
3910         struct tevent_req *req;
3911         struct rpccli_PNP_CreateDevInst_state *state;
3912         struct tevent_req *subreq;
3913
3914         req = tevent_req_create(mem_ctx, &state,
3915                                 struct rpccli_PNP_CreateDevInst_state);
3916         if (req == NULL) {
3917                 return NULL;
3918         }
3919         state->out_mem_ctx = NULL;
3920         state->dispatch_recv = cli->dispatch_recv;
3921
3922         /* In parameters */
3923
3924         /* Out parameters */
3925
3926         /* Result */
3927         ZERO_STRUCT(state->orig.out.result);
3928
3929         /* make a temporary copy, that we pass to the dispatch function */
3930         state->tmp = state->orig;
3931
3932         subreq = cli->dispatch_send(state, ev, cli,
3933                                     &ndr_table_ntsvcs,
3934                                     NDR_PNP_CREATEDEVINST,
3935                                     &state->tmp);
3936         if (tevent_req_nomem(subreq, req)) {
3937                 return tevent_req_post(req, ev);
3938         }
3939         tevent_req_set_callback(subreq, rpccli_PNP_CreateDevInst_done, req);
3940         return req;
3941 }
3942
3943 static void rpccli_PNP_CreateDevInst_done(struct tevent_req *subreq)
3944 {
3945         struct tevent_req *req = tevent_req_callback_data(
3946                 subreq, struct tevent_req);
3947         struct rpccli_PNP_CreateDevInst_state *state = tevent_req_data(
3948                 req, struct rpccli_PNP_CreateDevInst_state);
3949         NTSTATUS status;
3950         TALLOC_CTX *mem_ctx;
3951
3952         if (state->out_mem_ctx) {
3953                 mem_ctx = state->out_mem_ctx;
3954         } else {
3955                 mem_ctx = state;
3956         }
3957
3958         status = state->dispatch_recv(subreq, mem_ctx);
3959         TALLOC_FREE(subreq);
3960         if (!NT_STATUS_IS_OK(status)) {
3961                 tevent_req_nterror(req, status);
3962                 return;
3963         }
3964
3965         /* Copy out parameters */
3966
3967         /* Copy result */
3968         state->orig.out.result = state->tmp.out.result;
3969
3970         /* Reset temporary structure */
3971         ZERO_STRUCT(state->tmp);
3972
3973         tevent_req_done(req);
3974 }
3975
3976 NTSTATUS rpccli_PNP_CreateDevInst_recv(struct tevent_req *req,
3977                                        TALLOC_CTX *mem_ctx,
3978                                        WERROR *result)
3979 {
3980         struct rpccli_PNP_CreateDevInst_state *state = tevent_req_data(
3981                 req, struct rpccli_PNP_CreateDevInst_state);
3982         NTSTATUS status;
3983
3984         if (tevent_req_is_nterror(req, &status)) {
3985                 tevent_req_received(req);
3986                 return status;
3987         }
3988
3989         /* Steal possbile out parameters to the callers context */
3990         talloc_steal(mem_ctx, state->out_mem_ctx);
3991
3992         /* Return result */
3993         *result = state->orig.out.result;
3994
3995         tevent_req_received(req);
3996         return NT_STATUS_OK;
3997 }
3998
3999 NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli,
4000                                   TALLOC_CTX *mem_ctx,
4001                                   WERROR *werror)
4002 {
4003         struct PNP_CreateDevInst r;
4004         NTSTATUS status;
4005
4006         /* In parameters */
4007
4008         status = cli->dispatch(cli,
4009                                 mem_ctx,
4010                                 &ndr_table_ntsvcs,
4011                                 NDR_PNP_CREATEDEVINST,
4012                                 &r);
4013
4014         if (!NT_STATUS_IS_OK(status)) {
4015                 return status;
4016         }
4017
4018         if (NT_STATUS_IS_ERR(status)) {
4019                 return status;
4020         }
4021
4022         /* Return variables */
4023
4024         /* Return result */
4025         if (werror) {
4026                 *werror = r.out.result;
4027         }
4028
4029         return werror_to_ntstatus(r.out.result);
4030 }
4031
4032 struct rpccli_PNP_DeviceInstanceAction_state {
4033         struct PNP_DeviceInstanceAction orig;
4034         struct PNP_DeviceInstanceAction tmp;
4035         TALLOC_CTX *out_mem_ctx;
4036         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4037 };
4038
4039 static void rpccli_PNP_DeviceInstanceAction_done(struct tevent_req *subreq);
4040
4041 struct tevent_req *rpccli_PNP_DeviceInstanceAction_send(TALLOC_CTX *mem_ctx,
4042                                                         struct tevent_context *ev,
4043                                                         struct rpc_pipe_client *cli)
4044 {
4045         struct tevent_req *req;
4046         struct rpccli_PNP_DeviceInstanceAction_state *state;
4047         struct tevent_req *subreq;
4048
4049         req = tevent_req_create(mem_ctx, &state,
4050                                 struct rpccli_PNP_DeviceInstanceAction_state);
4051         if (req == NULL) {
4052                 return NULL;
4053         }
4054         state->out_mem_ctx = NULL;
4055         state->dispatch_recv = cli->dispatch_recv;
4056
4057         /* In parameters */
4058
4059         /* Out parameters */
4060
4061         /* Result */
4062         ZERO_STRUCT(state->orig.out.result);
4063
4064         /* make a temporary copy, that we pass to the dispatch function */
4065         state->tmp = state->orig;
4066
4067         subreq = cli->dispatch_send(state, ev, cli,
4068                                     &ndr_table_ntsvcs,
4069                                     NDR_PNP_DEVICEINSTANCEACTION,
4070                                     &state->tmp);
4071         if (tevent_req_nomem(subreq, req)) {
4072                 return tevent_req_post(req, ev);
4073         }
4074         tevent_req_set_callback(subreq, rpccli_PNP_DeviceInstanceAction_done, req);
4075         return req;
4076 }
4077
4078 static void rpccli_PNP_DeviceInstanceAction_done(struct tevent_req *subreq)
4079 {
4080         struct tevent_req *req = tevent_req_callback_data(
4081                 subreq, struct tevent_req);
4082         struct rpccli_PNP_DeviceInstanceAction_state *state = tevent_req_data(
4083                 req, struct rpccli_PNP_DeviceInstanceAction_state);
4084         NTSTATUS status;
4085         TALLOC_CTX *mem_ctx;
4086
4087         if (state->out_mem_ctx) {
4088                 mem_ctx = state->out_mem_ctx;
4089         } else {
4090                 mem_ctx = state;
4091         }
4092
4093         status = state->dispatch_recv(subreq, mem_ctx);
4094         TALLOC_FREE(subreq);
4095         if (!NT_STATUS_IS_OK(status)) {
4096                 tevent_req_nterror(req, status);
4097                 return;
4098         }
4099
4100         /* Copy out parameters */
4101
4102         /* Copy result */
4103         state->orig.out.result = state->tmp.out.result;
4104
4105         /* Reset temporary structure */
4106         ZERO_STRUCT(state->tmp);
4107
4108         tevent_req_done(req);
4109 }
4110
4111 NTSTATUS rpccli_PNP_DeviceInstanceAction_recv(struct tevent_req *req,
4112                                               TALLOC_CTX *mem_ctx,
4113                                               WERROR *result)
4114 {
4115         struct rpccli_PNP_DeviceInstanceAction_state *state = tevent_req_data(
4116                 req, struct rpccli_PNP_DeviceInstanceAction_state);
4117         NTSTATUS status;
4118
4119         if (tevent_req_is_nterror(req, &status)) {
4120                 tevent_req_received(req);
4121                 return status;
4122         }
4123
4124         /* Steal possbile out parameters to the callers context */
4125         talloc_steal(mem_ctx, state->out_mem_ctx);
4126
4127         /* Return result */
4128         *result = state->orig.out.result;
4129
4130         tevent_req_received(req);
4131         return NT_STATUS_OK;
4132 }
4133
4134 NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli,
4135                                          TALLOC_CTX *mem_ctx,
4136                                          WERROR *werror)
4137 {
4138         struct PNP_DeviceInstanceAction r;
4139         NTSTATUS status;
4140
4141         /* In parameters */
4142
4143         status = cli->dispatch(cli,
4144                                 mem_ctx,
4145                                 &ndr_table_ntsvcs,
4146                                 NDR_PNP_DEVICEINSTANCEACTION,
4147                                 &r);
4148
4149         if (!NT_STATUS_IS_OK(status)) {
4150                 return status;
4151         }
4152
4153         if (NT_STATUS_IS_ERR(status)) {
4154                 return status;
4155         }
4156
4157         /* Return variables */
4158
4159         /* Return result */
4160         if (werror) {
4161                 *werror = r.out.result;
4162         }
4163
4164         return werror_to_ntstatus(r.out.result);
4165 }
4166
4167 struct rpccli_PNP_GetDeviceStatus_state {
4168         struct PNP_GetDeviceStatus orig;
4169         struct PNP_GetDeviceStatus tmp;
4170         TALLOC_CTX *out_mem_ctx;
4171         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4172 };
4173
4174 static void rpccli_PNP_GetDeviceStatus_done(struct tevent_req *subreq);
4175
4176 struct tevent_req *rpccli_PNP_GetDeviceStatus_send(TALLOC_CTX *mem_ctx,
4177                                                    struct tevent_context *ev,
4178                                                    struct rpc_pipe_client *cli)
4179 {
4180         struct tevent_req *req;
4181         struct rpccli_PNP_GetDeviceStatus_state *state;
4182         struct tevent_req *subreq;
4183
4184         req = tevent_req_create(mem_ctx, &state,
4185                                 struct rpccli_PNP_GetDeviceStatus_state);
4186         if (req == NULL) {
4187                 return NULL;
4188         }
4189         state->out_mem_ctx = NULL;
4190         state->dispatch_recv = cli->dispatch_recv;
4191
4192         /* In parameters */
4193
4194         /* Out parameters */
4195
4196         /* Result */
4197         ZERO_STRUCT(state->orig.out.result);
4198
4199         /* make a temporary copy, that we pass to the dispatch function */
4200         state->tmp = state->orig;
4201
4202         subreq = cli->dispatch_send(state, ev, cli,
4203                                     &ndr_table_ntsvcs,
4204                                     NDR_PNP_GETDEVICESTATUS,
4205                                     &state->tmp);
4206         if (tevent_req_nomem(subreq, req)) {
4207                 return tevent_req_post(req, ev);
4208         }
4209         tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceStatus_done, req);
4210         return req;
4211 }
4212
4213 static void rpccli_PNP_GetDeviceStatus_done(struct tevent_req *subreq)
4214 {
4215         struct tevent_req *req = tevent_req_callback_data(
4216                 subreq, struct tevent_req);
4217         struct rpccli_PNP_GetDeviceStatus_state *state = tevent_req_data(
4218                 req, struct rpccli_PNP_GetDeviceStatus_state);
4219         NTSTATUS status;
4220         TALLOC_CTX *mem_ctx;
4221
4222         if (state->out_mem_ctx) {
4223                 mem_ctx = state->out_mem_ctx;
4224         } else {
4225                 mem_ctx = state;
4226         }
4227
4228         status = state->dispatch_recv(subreq, mem_ctx);
4229         TALLOC_FREE(subreq);
4230         if (!NT_STATUS_IS_OK(status)) {
4231                 tevent_req_nterror(req, status);
4232                 return;
4233         }
4234
4235         /* Copy out parameters */
4236
4237         /* Copy result */
4238         state->orig.out.result = state->tmp.out.result;
4239
4240         /* Reset temporary structure */
4241         ZERO_STRUCT(state->tmp);
4242
4243         tevent_req_done(req);
4244 }
4245
4246 NTSTATUS rpccli_PNP_GetDeviceStatus_recv(struct tevent_req *req,
4247                                          TALLOC_CTX *mem_ctx,
4248                                          WERROR *result)
4249 {
4250         struct rpccli_PNP_GetDeviceStatus_state *state = tevent_req_data(
4251                 req, struct rpccli_PNP_GetDeviceStatus_state);
4252         NTSTATUS status;
4253
4254         if (tevent_req_is_nterror(req, &status)) {
4255                 tevent_req_received(req);
4256                 return status;
4257         }
4258
4259         /* Steal possbile out parameters to the callers context */
4260         talloc_steal(mem_ctx, state->out_mem_ctx);
4261
4262         /* Return result */
4263         *result = state->orig.out.result;
4264
4265         tevent_req_received(req);
4266         return NT_STATUS_OK;
4267 }
4268
4269 NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli,
4270                                     TALLOC_CTX *mem_ctx,
4271                                     WERROR *werror)
4272 {
4273         struct PNP_GetDeviceStatus r;
4274         NTSTATUS status;
4275
4276         /* In parameters */
4277
4278         status = cli->dispatch(cli,
4279                                 mem_ctx,
4280                                 &ndr_table_ntsvcs,
4281                                 NDR_PNP_GETDEVICESTATUS,
4282                                 &r);
4283
4284         if (!NT_STATUS_IS_OK(status)) {
4285                 return status;
4286         }
4287
4288         if (NT_STATUS_IS_ERR(status)) {
4289                 return status;
4290         }
4291
4292         /* Return variables */
4293
4294         /* Return result */
4295         if (werror) {
4296                 *werror = r.out.result;
4297         }
4298
4299         return werror_to_ntstatus(r.out.result);
4300 }
4301
4302 struct rpccli_PNP_SetDeviceProblem_state {
4303         struct PNP_SetDeviceProblem orig;
4304         struct PNP_SetDeviceProblem tmp;
4305         TALLOC_CTX *out_mem_ctx;
4306         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4307 };
4308
4309 static void rpccli_PNP_SetDeviceProblem_done(struct tevent_req *subreq);
4310
4311 struct tevent_req *rpccli_PNP_SetDeviceProblem_send(TALLOC_CTX *mem_ctx,
4312                                                     struct tevent_context *ev,
4313                                                     struct rpc_pipe_client *cli)
4314 {
4315         struct tevent_req *req;
4316         struct rpccli_PNP_SetDeviceProblem_state *state;
4317         struct tevent_req *subreq;
4318
4319         req = tevent_req_create(mem_ctx, &state,
4320                                 struct rpccli_PNP_SetDeviceProblem_state);
4321         if (req == NULL) {
4322                 return NULL;
4323         }
4324         state->out_mem_ctx = NULL;
4325         state->dispatch_recv = cli->dispatch_recv;
4326
4327         /* In parameters */
4328
4329         /* Out parameters */
4330
4331         /* Result */
4332         ZERO_STRUCT(state->orig.out.result);
4333
4334         /* make a temporary copy, that we pass to the dispatch function */
4335         state->tmp = state->orig;
4336
4337         subreq = cli->dispatch_send(state, ev, cli,
4338                                     &ndr_table_ntsvcs,
4339                                     NDR_PNP_SETDEVICEPROBLEM,
4340                                     &state->tmp);
4341         if (tevent_req_nomem(subreq, req)) {
4342                 return tevent_req_post(req, ev);
4343         }
4344         tevent_req_set_callback(subreq, rpccli_PNP_SetDeviceProblem_done, req);
4345         return req;
4346 }
4347
4348 static void rpccli_PNP_SetDeviceProblem_done(struct tevent_req *subreq)
4349 {
4350         struct tevent_req *req = tevent_req_callback_data(
4351                 subreq, struct tevent_req);
4352         struct rpccli_PNP_SetDeviceProblem_state *state = tevent_req_data(
4353                 req, struct rpccli_PNP_SetDeviceProblem_state);
4354         NTSTATUS status;
4355         TALLOC_CTX *mem_ctx;
4356
4357         if (state->out_mem_ctx) {
4358                 mem_ctx = state->out_mem_ctx;
4359         } else {
4360                 mem_ctx = state;
4361         }
4362
4363         status = state->dispatch_recv(subreq, mem_ctx);
4364         TALLOC_FREE(subreq);
4365         if (!NT_STATUS_IS_OK(status)) {
4366                 tevent_req_nterror(req, status);
4367                 return;
4368         }
4369
4370         /* Copy out parameters */
4371
4372         /* Copy result */
4373         state->orig.out.result = state->tmp.out.result;
4374
4375         /* Reset temporary structure */
4376         ZERO_STRUCT(state->tmp);
4377
4378         tevent_req_done(req);
4379 }
4380
4381 NTSTATUS rpccli_PNP_SetDeviceProblem_recv(struct tevent_req *req,
4382                                           TALLOC_CTX *mem_ctx,
4383                                           WERROR *result)
4384 {
4385         struct rpccli_PNP_SetDeviceProblem_state *state = tevent_req_data(
4386                 req, struct rpccli_PNP_SetDeviceProblem_state);
4387         NTSTATUS status;
4388
4389         if (tevent_req_is_nterror(req, &status)) {
4390                 tevent_req_received(req);
4391                 return status;
4392         }
4393
4394         /* Steal possbile out parameters to the callers context */
4395         talloc_steal(mem_ctx, state->out_mem_ctx);
4396
4397         /* Return result */
4398         *result = state->orig.out.result;
4399
4400         tevent_req_received(req);
4401         return NT_STATUS_OK;
4402 }
4403
4404 NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli,
4405                                      TALLOC_CTX *mem_ctx,
4406                                      WERROR *werror)
4407 {
4408         struct PNP_SetDeviceProblem r;
4409         NTSTATUS status;
4410
4411         /* In parameters */
4412
4413         status = cli->dispatch(cli,
4414                                 mem_ctx,
4415                                 &ndr_table_ntsvcs,
4416                                 NDR_PNP_SETDEVICEPROBLEM,
4417                                 &r);
4418
4419         if (!NT_STATUS_IS_OK(status)) {
4420                 return status;
4421         }
4422
4423         if (NT_STATUS_IS_ERR(status)) {
4424                 return status;
4425         }
4426
4427         /* Return variables */
4428
4429         /* Return result */
4430         if (werror) {
4431                 *werror = r.out.result;
4432         }
4433
4434         return werror_to_ntstatus(r.out.result);
4435 }
4436
4437 struct rpccli_PNP_DisableDevInst_state {
4438         struct PNP_DisableDevInst orig;
4439         struct PNP_DisableDevInst tmp;
4440         TALLOC_CTX *out_mem_ctx;
4441         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4442 };
4443
4444 static void rpccli_PNP_DisableDevInst_done(struct tevent_req *subreq);
4445
4446 struct tevent_req *rpccli_PNP_DisableDevInst_send(TALLOC_CTX *mem_ctx,
4447                                                   struct tevent_context *ev,
4448                                                   struct rpc_pipe_client *cli)
4449 {
4450         struct tevent_req *req;
4451         struct rpccli_PNP_DisableDevInst_state *state;
4452         struct tevent_req *subreq;
4453
4454         req = tevent_req_create(mem_ctx, &state,
4455                                 struct rpccli_PNP_DisableDevInst_state);
4456         if (req == NULL) {
4457                 return NULL;
4458         }
4459         state->out_mem_ctx = NULL;
4460         state->dispatch_recv = cli->dispatch_recv;
4461
4462         /* In parameters */
4463
4464         /* Out parameters */
4465
4466         /* Result */
4467         ZERO_STRUCT(state->orig.out.result);
4468
4469         /* make a temporary copy, that we pass to the dispatch function */
4470         state->tmp = state->orig;
4471
4472         subreq = cli->dispatch_send(state, ev, cli,
4473                                     &ndr_table_ntsvcs,
4474                                     NDR_PNP_DISABLEDEVINST,
4475                                     &state->tmp);
4476         if (tevent_req_nomem(subreq, req)) {
4477                 return tevent_req_post(req, ev);
4478         }
4479         tevent_req_set_callback(subreq, rpccli_PNP_DisableDevInst_done, req);
4480         return req;
4481 }
4482
4483 static void rpccli_PNP_DisableDevInst_done(struct tevent_req *subreq)
4484 {
4485         struct tevent_req *req = tevent_req_callback_data(
4486                 subreq, struct tevent_req);
4487         struct rpccli_PNP_DisableDevInst_state *state = tevent_req_data(
4488                 req, struct rpccli_PNP_DisableDevInst_state);
4489         NTSTATUS status;
4490         TALLOC_CTX *mem_ctx;
4491
4492         if (state->out_mem_ctx) {
4493                 mem_ctx = state->out_mem_ctx;
4494         } else {
4495                 mem_ctx = state;
4496         }
4497
4498         status = state->dispatch_recv(subreq, mem_ctx);
4499         TALLOC_FREE(subreq);
4500         if (!NT_STATUS_IS_OK(status)) {
4501                 tevent_req_nterror(req, status);
4502                 return;
4503         }
4504
4505         /* Copy out parameters */
4506
4507         /* Copy result */
4508         state->orig.out.result = state->tmp.out.result;
4509
4510         /* Reset temporary structure */
4511         ZERO_STRUCT(state->tmp);
4512
4513         tevent_req_done(req);
4514 }
4515
4516 NTSTATUS rpccli_PNP_DisableDevInst_recv(struct tevent_req *req,
4517                                         TALLOC_CTX *mem_ctx,
4518                                         WERROR *result)
4519 {
4520         struct rpccli_PNP_DisableDevInst_state *state = tevent_req_data(
4521                 req, struct rpccli_PNP_DisableDevInst_state);
4522         NTSTATUS status;
4523
4524         if (tevent_req_is_nterror(req, &status)) {
4525                 tevent_req_received(req);
4526                 return status;
4527         }
4528
4529         /* Steal possbile out parameters to the callers context */
4530         talloc_steal(mem_ctx, state->out_mem_ctx);
4531
4532         /* Return result */
4533         *result = state->orig.out.result;
4534
4535         tevent_req_received(req);
4536         return NT_STATUS_OK;
4537 }
4538
4539 NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli,
4540                                    TALLOC_CTX *mem_ctx,
4541                                    WERROR *werror)
4542 {
4543         struct PNP_DisableDevInst r;
4544         NTSTATUS status;
4545
4546         /* In parameters */
4547
4548         status = cli->dispatch(cli,
4549                                 mem_ctx,
4550                                 &ndr_table_ntsvcs,
4551                                 NDR_PNP_DISABLEDEVINST,
4552                                 &r);
4553
4554         if (!NT_STATUS_IS_OK(status)) {
4555                 return status;
4556         }
4557
4558         if (NT_STATUS_IS_ERR(status)) {
4559                 return status;
4560         }
4561
4562         /* Return variables */
4563
4564         /* Return result */
4565         if (werror) {
4566                 *werror = r.out.result;
4567         }
4568
4569         return werror_to_ntstatus(r.out.result);
4570 }
4571
4572 struct rpccli_PNP_UninstallDevInst_state {
4573         struct PNP_UninstallDevInst orig;
4574         struct PNP_UninstallDevInst tmp;
4575         TALLOC_CTX *out_mem_ctx;
4576         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4577 };
4578
4579 static void rpccli_PNP_UninstallDevInst_done(struct tevent_req *subreq);
4580
4581 struct tevent_req *rpccli_PNP_UninstallDevInst_send(TALLOC_CTX *mem_ctx,
4582                                                     struct tevent_context *ev,
4583                                                     struct rpc_pipe_client *cli)
4584 {
4585         struct tevent_req *req;
4586         struct rpccli_PNP_UninstallDevInst_state *state;
4587         struct tevent_req *subreq;
4588
4589         req = tevent_req_create(mem_ctx, &state,
4590                                 struct rpccli_PNP_UninstallDevInst_state);
4591         if (req == NULL) {
4592                 return NULL;
4593         }
4594         state->out_mem_ctx = NULL;
4595         state->dispatch_recv = cli->dispatch_recv;
4596
4597         /* In parameters */
4598
4599         /* Out parameters */
4600
4601         /* Result */
4602         ZERO_STRUCT(state->orig.out.result);
4603
4604         /* make a temporary copy, that we pass to the dispatch function */
4605         state->tmp = state->orig;
4606
4607         subreq = cli->dispatch_send(state, ev, cli,
4608                                     &ndr_table_ntsvcs,
4609                                     NDR_PNP_UNINSTALLDEVINST,
4610                                     &state->tmp);
4611         if (tevent_req_nomem(subreq, req)) {
4612                 return tevent_req_post(req, ev);
4613         }
4614         tevent_req_set_callback(subreq, rpccli_PNP_UninstallDevInst_done, req);
4615         return req;
4616 }
4617
4618 static void rpccli_PNP_UninstallDevInst_done(struct tevent_req *subreq)
4619 {
4620         struct tevent_req *req = tevent_req_callback_data(
4621                 subreq, struct tevent_req);
4622         struct rpccli_PNP_UninstallDevInst_state *state = tevent_req_data(
4623                 req, struct rpccli_PNP_UninstallDevInst_state);
4624         NTSTATUS status;
4625         TALLOC_CTX *mem_ctx;
4626
4627         if (state->out_mem_ctx) {
4628                 mem_ctx = state->out_mem_ctx;
4629         } else {
4630                 mem_ctx = state;
4631         }
4632
4633         status = state->dispatch_recv(subreq, mem_ctx);
4634         TALLOC_FREE(subreq);
4635         if (!NT_STATUS_IS_OK(status)) {
4636                 tevent_req_nterror(req, status);
4637                 return;
4638         }
4639
4640         /* Copy out parameters */
4641
4642         /* Copy result */
4643         state->orig.out.result = state->tmp.out.result;
4644
4645         /* Reset temporary structure */
4646         ZERO_STRUCT(state->tmp);
4647
4648         tevent_req_done(req);
4649 }
4650
4651 NTSTATUS rpccli_PNP_UninstallDevInst_recv(struct tevent_req *req,
4652                                           TALLOC_CTX *mem_ctx,
4653                                           WERROR *result)
4654 {
4655         struct rpccli_PNP_UninstallDevInst_state *state = tevent_req_data(
4656                 req, struct rpccli_PNP_UninstallDevInst_state);
4657         NTSTATUS status;
4658
4659         if (tevent_req_is_nterror(req, &status)) {
4660                 tevent_req_received(req);
4661                 return status;
4662         }
4663
4664         /* Steal possbile out parameters to the callers context */
4665         talloc_steal(mem_ctx, state->out_mem_ctx);
4666
4667         /* Return result */
4668         *result = state->orig.out.result;
4669
4670         tevent_req_received(req);
4671         return NT_STATUS_OK;
4672 }
4673
4674 NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli,
4675                                      TALLOC_CTX *mem_ctx,
4676                                      WERROR *werror)
4677 {
4678         struct PNP_UninstallDevInst r;
4679         NTSTATUS status;
4680
4681         /* In parameters */
4682
4683         status = cli->dispatch(cli,
4684                                 mem_ctx,
4685                                 &ndr_table_ntsvcs,
4686                                 NDR_PNP_UNINSTALLDEVINST,
4687                                 &r);
4688
4689         if (!NT_STATUS_IS_OK(status)) {
4690                 return status;
4691         }
4692
4693         if (NT_STATUS_IS_ERR(status)) {
4694                 return status;
4695         }
4696
4697         /* Return variables */
4698
4699         /* Return result */
4700         if (werror) {
4701                 *werror = r.out.result;
4702         }
4703
4704         return werror_to_ntstatus(r.out.result);
4705 }
4706
4707 struct rpccli_PNP_AddID_state {
4708         struct PNP_AddID orig;
4709         struct PNP_AddID tmp;
4710         TALLOC_CTX *out_mem_ctx;
4711         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4712 };
4713
4714 static void rpccli_PNP_AddID_done(struct tevent_req *subreq);
4715
4716 struct tevent_req *rpccli_PNP_AddID_send(TALLOC_CTX *mem_ctx,
4717                                          struct tevent_context *ev,
4718                                          struct rpc_pipe_client *cli)
4719 {
4720         struct tevent_req *req;
4721         struct rpccli_PNP_AddID_state *state;
4722         struct tevent_req *subreq;
4723
4724         req = tevent_req_create(mem_ctx, &state,
4725                                 struct rpccli_PNP_AddID_state);
4726         if (req == NULL) {
4727                 return NULL;
4728         }
4729         state->out_mem_ctx = NULL;
4730         state->dispatch_recv = cli->dispatch_recv;
4731
4732         /* In parameters */
4733
4734         /* Out parameters */
4735
4736         /* Result */
4737         ZERO_STRUCT(state->orig.out.result);
4738
4739         /* make a temporary copy, that we pass to the dispatch function */
4740         state->tmp = state->orig;
4741
4742         subreq = cli->dispatch_send(state, ev, cli,
4743                                     &ndr_table_ntsvcs,
4744                                     NDR_PNP_ADDID,
4745                                     &state->tmp);
4746         if (tevent_req_nomem(subreq, req)) {
4747                 return tevent_req_post(req, ev);
4748         }
4749         tevent_req_set_callback(subreq, rpccli_PNP_AddID_done, req);
4750         return req;
4751 }
4752
4753 static void rpccli_PNP_AddID_done(struct tevent_req *subreq)
4754 {
4755         struct tevent_req *req = tevent_req_callback_data(
4756                 subreq, struct tevent_req);
4757         struct rpccli_PNP_AddID_state *state = tevent_req_data(
4758                 req, struct rpccli_PNP_AddID_state);
4759         NTSTATUS status;
4760         TALLOC_CTX *mem_ctx;
4761
4762         if (state->out_mem_ctx) {
4763                 mem_ctx = state->out_mem_ctx;
4764         } else {
4765                 mem_ctx = state;
4766         }
4767
4768         status = state->dispatch_recv(subreq, mem_ctx);
4769         TALLOC_FREE(subreq);
4770         if (!NT_STATUS_IS_OK(status)) {
4771                 tevent_req_nterror(req, status);
4772                 return;
4773         }
4774
4775         /* Copy out parameters */
4776
4777         /* Copy result */
4778         state->orig.out.result = state->tmp.out.result;
4779
4780         /* Reset temporary structure */
4781         ZERO_STRUCT(state->tmp);
4782
4783         tevent_req_done(req);
4784 }
4785
4786 NTSTATUS rpccli_PNP_AddID_recv(struct tevent_req *req,
4787                                TALLOC_CTX *mem_ctx,
4788                                WERROR *result)
4789 {
4790         struct rpccli_PNP_AddID_state *state = tevent_req_data(
4791                 req, struct rpccli_PNP_AddID_state);
4792         NTSTATUS status;
4793
4794         if (tevent_req_is_nterror(req, &status)) {
4795                 tevent_req_received(req);
4796                 return status;
4797         }
4798
4799         /* Steal possbile out parameters to the callers context */
4800         talloc_steal(mem_ctx, state->out_mem_ctx);
4801
4802         /* Return result */
4803         *result = state->orig.out.result;
4804
4805         tevent_req_received(req);
4806         return NT_STATUS_OK;
4807 }
4808
4809 NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli,
4810                           TALLOC_CTX *mem_ctx,
4811                           WERROR *werror)
4812 {
4813         struct PNP_AddID r;
4814         NTSTATUS status;
4815
4816         /* In parameters */
4817
4818         status = cli->dispatch(cli,
4819                                 mem_ctx,
4820                                 &ndr_table_ntsvcs,
4821                                 NDR_PNP_ADDID,
4822                                 &r);
4823
4824         if (!NT_STATUS_IS_OK(status)) {
4825                 return status;
4826         }
4827
4828         if (NT_STATUS_IS_ERR(status)) {
4829                 return status;
4830         }
4831
4832         /* Return variables */
4833
4834         /* Return result */
4835         if (werror) {
4836                 *werror = r.out.result;
4837         }
4838
4839         return werror_to_ntstatus(r.out.result);
4840 }
4841
4842 struct rpccli_PNP_RegisterDriver_state {
4843         struct PNP_RegisterDriver orig;
4844         struct PNP_RegisterDriver tmp;
4845         TALLOC_CTX *out_mem_ctx;
4846         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4847 };
4848
4849 static void rpccli_PNP_RegisterDriver_done(struct tevent_req *subreq);
4850
4851 struct tevent_req *rpccli_PNP_RegisterDriver_send(TALLOC_CTX *mem_ctx,
4852                                                   struct tevent_context *ev,
4853                                                   struct rpc_pipe_client *cli)
4854 {
4855         struct tevent_req *req;
4856         struct rpccli_PNP_RegisterDriver_state *state;
4857         struct tevent_req *subreq;
4858
4859         req = tevent_req_create(mem_ctx, &state,
4860                                 struct rpccli_PNP_RegisterDriver_state);
4861         if (req == NULL) {
4862                 return NULL;
4863         }
4864         state->out_mem_ctx = NULL;
4865         state->dispatch_recv = cli->dispatch_recv;
4866
4867         /* In parameters */
4868
4869         /* Out parameters */
4870
4871         /* Result */
4872         ZERO_STRUCT(state->orig.out.result);
4873
4874         /* make a temporary copy, that we pass to the dispatch function */
4875         state->tmp = state->orig;
4876
4877         subreq = cli->dispatch_send(state, ev, cli,
4878                                     &ndr_table_ntsvcs,
4879                                     NDR_PNP_REGISTERDRIVER,
4880                                     &state->tmp);
4881         if (tevent_req_nomem(subreq, req)) {
4882                 return tevent_req_post(req, ev);
4883         }
4884         tevent_req_set_callback(subreq, rpccli_PNP_RegisterDriver_done, req);
4885         return req;
4886 }
4887
4888 static void rpccli_PNP_RegisterDriver_done(struct tevent_req *subreq)
4889 {
4890         struct tevent_req *req = tevent_req_callback_data(
4891                 subreq, struct tevent_req);
4892         struct rpccli_PNP_RegisterDriver_state *state = tevent_req_data(
4893                 req, struct rpccli_PNP_RegisterDriver_state);
4894         NTSTATUS status;
4895         TALLOC_CTX *mem_ctx;
4896
4897         if (state->out_mem_ctx) {
4898                 mem_ctx = state->out_mem_ctx;
4899         } else {
4900                 mem_ctx = state;
4901         }
4902
4903         status = state->dispatch_recv(subreq, mem_ctx);
4904         TALLOC_FREE(subreq);
4905         if (!NT_STATUS_IS_OK(status)) {
4906                 tevent_req_nterror(req, status);
4907                 return;
4908         }
4909
4910         /* Copy out parameters */
4911
4912         /* Copy result */
4913         state->orig.out.result = state->tmp.out.result;
4914
4915         /* Reset temporary structure */
4916         ZERO_STRUCT(state->tmp);
4917
4918         tevent_req_done(req);
4919 }
4920
4921 NTSTATUS rpccli_PNP_RegisterDriver_recv(struct tevent_req *req,
4922                                         TALLOC_CTX *mem_ctx,
4923                                         WERROR *result)
4924 {
4925         struct rpccli_PNP_RegisterDriver_state *state = tevent_req_data(
4926                 req, struct rpccli_PNP_RegisterDriver_state);
4927         NTSTATUS status;
4928
4929         if (tevent_req_is_nterror(req, &status)) {
4930                 tevent_req_received(req);
4931                 return status;
4932         }
4933
4934         /* Steal possbile out parameters to the callers context */
4935         talloc_steal(mem_ctx, state->out_mem_ctx);
4936
4937         /* Return result */
4938         *result = state->orig.out.result;
4939
4940         tevent_req_received(req);
4941         return NT_STATUS_OK;
4942 }
4943
4944 NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli,
4945                                    TALLOC_CTX *mem_ctx,
4946                                    WERROR *werror)
4947 {
4948         struct PNP_RegisterDriver r;
4949         NTSTATUS status;
4950
4951         /* In parameters */
4952
4953         status = cli->dispatch(cli,
4954                                 mem_ctx,
4955                                 &ndr_table_ntsvcs,
4956                                 NDR_PNP_REGISTERDRIVER,
4957                                 &r);
4958
4959         if (!NT_STATUS_IS_OK(status)) {
4960                 return status;
4961         }
4962
4963         if (NT_STATUS_IS_ERR(status)) {
4964                 return status;
4965         }
4966
4967         /* Return variables */
4968
4969         /* Return result */
4970         if (werror) {
4971                 *werror = r.out.result;
4972         }
4973
4974         return werror_to_ntstatus(r.out.result);
4975 }
4976
4977 struct rpccli_PNP_QueryRemove_state {
4978         struct PNP_QueryRemove orig;
4979         struct PNP_QueryRemove tmp;
4980         TALLOC_CTX *out_mem_ctx;
4981         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4982 };
4983
4984 static void rpccli_PNP_QueryRemove_done(struct tevent_req *subreq);
4985
4986 struct tevent_req *rpccli_PNP_QueryRemove_send(TALLOC_CTX *mem_ctx,
4987                                                struct tevent_context *ev,
4988                                                struct rpc_pipe_client *cli)
4989 {
4990         struct tevent_req *req;
4991         struct rpccli_PNP_QueryRemove_state *state;
4992         struct tevent_req *subreq;
4993
4994         req = tevent_req_create(mem_ctx, &state,
4995                                 struct rpccli_PNP_QueryRemove_state);
4996         if (req == NULL) {
4997                 return NULL;
4998         }
4999         state->out_mem_ctx = NULL;
5000         state->dispatch_recv = cli->dispatch_recv;
5001
5002         /* In parameters */
5003
5004         /* Out parameters */
5005
5006         /* Result */
5007         ZERO_STRUCT(state->orig.out.result);
5008
5009         /* make a temporary copy, that we pass to the dispatch function */
5010         state->tmp = state->orig;
5011
5012         subreq = cli->dispatch_send(state, ev, cli,
5013                                     &ndr_table_ntsvcs,
5014                                     NDR_PNP_QUERYREMOVE,
5015                                     &state->tmp);
5016         if (tevent_req_nomem(subreq, req)) {
5017                 return tevent_req_post(req, ev);
5018         }
5019         tevent_req_set_callback(subreq, rpccli_PNP_QueryRemove_done, req);
5020         return req;
5021 }
5022
5023 static void rpccli_PNP_QueryRemove_done(struct tevent_req *subreq)
5024 {
5025         struct tevent_req *req = tevent_req_callback_data(
5026                 subreq, struct tevent_req);
5027         struct rpccli_PNP_QueryRemove_state *state = tevent_req_data(
5028                 req, struct rpccli_PNP_QueryRemove_state);
5029         NTSTATUS status;
5030         TALLOC_CTX *mem_ctx;
5031
5032         if (state->out_mem_ctx) {
5033                 mem_ctx = state->out_mem_ctx;
5034         } else {
5035                 mem_ctx = state;
5036         }
5037
5038         status = state->dispatch_recv(subreq, mem_ctx);
5039         TALLOC_FREE(subreq);
5040         if (!NT_STATUS_IS_OK(status)) {
5041                 tevent_req_nterror(req, status);
5042                 return;
5043         }
5044
5045         /* Copy out parameters */
5046
5047         /* Copy result */
5048         state->orig.out.result = state->tmp.out.result;
5049
5050         /* Reset temporary structure */
5051         ZERO_STRUCT(state->tmp);
5052
5053         tevent_req_done(req);
5054 }
5055
5056 NTSTATUS rpccli_PNP_QueryRemove_recv(struct tevent_req *req,
5057                                      TALLOC_CTX *mem_ctx,
5058                                      WERROR *result)
5059 {
5060         struct rpccli_PNP_QueryRemove_state *state = tevent_req_data(
5061                 req, struct rpccli_PNP_QueryRemove_state);
5062         NTSTATUS status;
5063
5064         if (tevent_req_is_nterror(req, &status)) {
5065                 tevent_req_received(req);
5066                 return status;
5067         }
5068
5069         /* Steal possbile out parameters to the callers context */
5070         talloc_steal(mem_ctx, state->out_mem_ctx);
5071
5072         /* Return result */
5073         *result = state->orig.out.result;
5074
5075         tevent_req_received(req);
5076         return NT_STATUS_OK;
5077 }
5078
5079 NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli,
5080                                 TALLOC_CTX *mem_ctx,
5081                                 WERROR *werror)
5082 {
5083         struct PNP_QueryRemove r;
5084         NTSTATUS status;
5085
5086         /* In parameters */
5087
5088         status = cli->dispatch(cli,
5089                                 mem_ctx,
5090                                 &ndr_table_ntsvcs,
5091                                 NDR_PNP_QUERYREMOVE,
5092                                 &r);
5093
5094         if (!NT_STATUS_IS_OK(status)) {
5095                 return status;
5096         }
5097
5098         if (NT_STATUS_IS_ERR(status)) {
5099                 return status;
5100         }
5101
5102         /* Return variables */
5103
5104         /* Return result */
5105         if (werror) {
5106                 *werror = r.out.result;
5107         }
5108
5109         return werror_to_ntstatus(r.out.result);
5110 }
5111
5112 struct rpccli_PNP_RequestDeviceEject_state {
5113         struct PNP_RequestDeviceEject orig;
5114         struct PNP_RequestDeviceEject tmp;
5115         TALLOC_CTX *out_mem_ctx;
5116         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5117 };
5118
5119 static void rpccli_PNP_RequestDeviceEject_done(struct tevent_req *subreq);
5120
5121 struct tevent_req *rpccli_PNP_RequestDeviceEject_send(TALLOC_CTX *mem_ctx,
5122                                                       struct tevent_context *ev,
5123                                                       struct rpc_pipe_client *cli)
5124 {
5125         struct tevent_req *req;
5126         struct rpccli_PNP_RequestDeviceEject_state *state;
5127         struct tevent_req *subreq;
5128
5129         req = tevent_req_create(mem_ctx, &state,
5130                                 struct rpccli_PNP_RequestDeviceEject_state);
5131         if (req == NULL) {
5132                 return NULL;
5133         }
5134         state->out_mem_ctx = NULL;
5135         state->dispatch_recv = cli->dispatch_recv;
5136
5137         /* In parameters */
5138
5139         /* Out parameters */
5140
5141         /* Result */
5142         ZERO_STRUCT(state->orig.out.result);
5143
5144         /* make a temporary copy, that we pass to the dispatch function */
5145         state->tmp = state->orig;
5146
5147         subreq = cli->dispatch_send(state, ev, cli,
5148                                     &ndr_table_ntsvcs,
5149                                     NDR_PNP_REQUESTDEVICEEJECT,
5150                                     &state->tmp);
5151         if (tevent_req_nomem(subreq, req)) {
5152                 return tevent_req_post(req, ev);
5153         }
5154         tevent_req_set_callback(subreq, rpccli_PNP_RequestDeviceEject_done, req);
5155         return req;
5156 }
5157
5158 static void rpccli_PNP_RequestDeviceEject_done(struct tevent_req *subreq)
5159 {
5160         struct tevent_req *req = tevent_req_callback_data(
5161                 subreq, struct tevent_req);
5162         struct rpccli_PNP_RequestDeviceEject_state *state = tevent_req_data(
5163                 req, struct rpccli_PNP_RequestDeviceEject_state);
5164         NTSTATUS status;
5165         TALLOC_CTX *mem_ctx;
5166
5167         if (state->out_mem_ctx) {
5168                 mem_ctx = state->out_mem_ctx;
5169         } else {
5170                 mem_ctx = state;
5171         }
5172
5173         status = state->dispatch_recv(subreq, mem_ctx);
5174         TALLOC_FREE(subreq);
5175         if (!NT_STATUS_IS_OK(status)) {
5176                 tevent_req_nterror(req, status);
5177                 return;
5178         }
5179
5180         /* Copy out parameters */
5181
5182         /* Copy result */
5183         state->orig.out.result = state->tmp.out.result;
5184
5185         /* Reset temporary structure */
5186         ZERO_STRUCT(state->tmp);
5187
5188         tevent_req_done(req);
5189 }
5190
5191 NTSTATUS rpccli_PNP_RequestDeviceEject_recv(struct tevent_req *req,
5192                                             TALLOC_CTX *mem_ctx,
5193                                             WERROR *result)
5194 {
5195         struct rpccli_PNP_RequestDeviceEject_state *state = tevent_req_data(
5196                 req, struct rpccli_PNP_RequestDeviceEject_state);
5197         NTSTATUS status;
5198
5199         if (tevent_req_is_nterror(req, &status)) {
5200                 tevent_req_received(req);
5201                 return status;
5202         }
5203
5204         /* Steal possbile out parameters to the callers context */
5205         talloc_steal(mem_ctx, state->out_mem_ctx);
5206
5207         /* Return result */
5208         *result = state->orig.out.result;
5209
5210         tevent_req_received(req);
5211         return NT_STATUS_OK;
5212 }
5213
5214 NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli,
5215                                        TALLOC_CTX *mem_ctx,
5216                                        WERROR *werror)
5217 {
5218         struct PNP_RequestDeviceEject r;
5219         NTSTATUS status;
5220
5221         /* In parameters */
5222
5223         status = cli->dispatch(cli,
5224                                 mem_ctx,
5225                                 &ndr_table_ntsvcs,
5226                                 NDR_PNP_REQUESTDEVICEEJECT,
5227                                 &r);
5228
5229         if (!NT_STATUS_IS_OK(status)) {
5230                 return status;
5231         }
5232
5233         if (NT_STATUS_IS_ERR(status)) {
5234                 return status;
5235         }
5236
5237         /* Return variables */
5238
5239         /* Return result */
5240         if (werror) {
5241                 *werror = r.out.result;
5242         }
5243
5244         return werror_to_ntstatus(r.out.result);
5245 }
5246
5247 struct rpccli_PNP_IsDockStationPresent_state {
5248         struct PNP_IsDockStationPresent orig;
5249         struct PNP_IsDockStationPresent tmp;
5250         TALLOC_CTX *out_mem_ctx;
5251         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5252 };
5253
5254 static void rpccli_PNP_IsDockStationPresent_done(struct tevent_req *subreq);
5255
5256 struct tevent_req *rpccli_PNP_IsDockStationPresent_send(TALLOC_CTX *mem_ctx,
5257                                                         struct tevent_context *ev,
5258                                                         struct rpc_pipe_client *cli)
5259 {
5260         struct tevent_req *req;
5261         struct rpccli_PNP_IsDockStationPresent_state *state;
5262         struct tevent_req *subreq;
5263
5264         req = tevent_req_create(mem_ctx, &state,
5265                                 struct rpccli_PNP_IsDockStationPresent_state);
5266         if (req == NULL) {
5267                 return NULL;
5268         }
5269         state->out_mem_ctx = NULL;
5270         state->dispatch_recv = cli->dispatch_recv;
5271
5272         /* In parameters */
5273
5274         /* Out parameters */
5275
5276         /* Result */
5277         ZERO_STRUCT(state->orig.out.result);
5278
5279         /* make a temporary copy, that we pass to the dispatch function */
5280         state->tmp = state->orig;
5281
5282         subreq = cli->dispatch_send(state, ev, cli,
5283                                     &ndr_table_ntsvcs,
5284                                     NDR_PNP_ISDOCKSTATIONPRESENT,
5285                                     &state->tmp);
5286         if (tevent_req_nomem(subreq, req)) {
5287                 return tevent_req_post(req, ev);
5288         }
5289         tevent_req_set_callback(subreq, rpccli_PNP_IsDockStationPresent_done, req);
5290         return req;
5291 }
5292
5293 static void rpccli_PNP_IsDockStationPresent_done(struct tevent_req *subreq)
5294 {
5295         struct tevent_req *req = tevent_req_callback_data(
5296                 subreq, struct tevent_req);
5297         struct rpccli_PNP_IsDockStationPresent_state *state = tevent_req_data(
5298                 req, struct rpccli_PNP_IsDockStationPresent_state);
5299         NTSTATUS status;
5300         TALLOC_CTX *mem_ctx;
5301
5302         if (state->out_mem_ctx) {
5303                 mem_ctx = state->out_mem_ctx;
5304         } else {
5305                 mem_ctx = state;
5306         }
5307
5308         status = state->dispatch_recv(subreq, mem_ctx);
5309         TALLOC_FREE(subreq);
5310         if (!NT_STATUS_IS_OK(status)) {
5311                 tevent_req_nterror(req, status);
5312                 return;
5313         }
5314
5315         /* Copy out parameters */
5316
5317         /* Copy result */
5318         state->orig.out.result = state->tmp.out.result;
5319
5320         /* Reset temporary structure */
5321         ZERO_STRUCT(state->tmp);
5322
5323         tevent_req_done(req);
5324 }
5325
5326 NTSTATUS rpccli_PNP_IsDockStationPresent_recv(struct tevent_req *req,
5327                                               TALLOC_CTX *mem_ctx,
5328                                               WERROR *result)
5329 {
5330         struct rpccli_PNP_IsDockStationPresent_state *state = tevent_req_data(
5331                 req, struct rpccli_PNP_IsDockStationPresent_state);
5332         NTSTATUS status;
5333
5334         if (tevent_req_is_nterror(req, &status)) {
5335                 tevent_req_received(req);
5336                 return status;
5337         }
5338
5339         /* Steal possbile out parameters to the callers context */
5340         talloc_steal(mem_ctx, state->out_mem_ctx);
5341
5342         /* Return result */
5343         *result = state->orig.out.result;
5344
5345         tevent_req_received(req);
5346         return NT_STATUS_OK;
5347 }
5348
5349 NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli,
5350                                          TALLOC_CTX *mem_ctx,
5351                                          WERROR *werror)
5352 {
5353         struct PNP_IsDockStationPresent r;
5354         NTSTATUS status;
5355
5356         /* In parameters */
5357
5358         status = cli->dispatch(cli,
5359                                 mem_ctx,
5360                                 &ndr_table_ntsvcs,
5361                                 NDR_PNP_ISDOCKSTATIONPRESENT,
5362                                 &r);
5363
5364         if (!NT_STATUS_IS_OK(status)) {
5365                 return status;
5366         }
5367
5368         if (NT_STATUS_IS_ERR(status)) {
5369                 return status;
5370         }
5371
5372         /* Return variables */
5373
5374         /* Return result */
5375         if (werror) {
5376                 *werror = r.out.result;
5377         }
5378
5379         return werror_to_ntstatus(r.out.result);
5380 }
5381
5382 struct rpccli_PNP_RequestEjectPC_state {
5383         struct PNP_RequestEjectPC orig;
5384         struct PNP_RequestEjectPC tmp;
5385         TALLOC_CTX *out_mem_ctx;
5386         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5387 };
5388
5389 static void rpccli_PNP_RequestEjectPC_done(struct tevent_req *subreq);
5390
5391 struct tevent_req *rpccli_PNP_RequestEjectPC_send(TALLOC_CTX *mem_ctx,
5392                                                   struct tevent_context *ev,
5393                                                   struct rpc_pipe_client *cli)
5394 {
5395         struct tevent_req *req;
5396         struct rpccli_PNP_RequestEjectPC_state *state;
5397         struct tevent_req *subreq;
5398
5399         req = tevent_req_create(mem_ctx, &state,
5400                                 struct rpccli_PNP_RequestEjectPC_state);
5401         if (req == NULL) {
5402                 return NULL;
5403         }
5404         state->out_mem_ctx = NULL;
5405         state->dispatch_recv = cli->dispatch_recv;
5406
5407         /* In parameters */
5408
5409         /* Out parameters */
5410
5411         /* Result */
5412         ZERO_STRUCT(state->orig.out.result);
5413
5414         /* make a temporary copy, that we pass to the dispatch function */
5415         state->tmp = state->orig;
5416
5417         subreq = cli->dispatch_send(state, ev, cli,
5418                                     &ndr_table_ntsvcs,
5419                                     NDR_PNP_REQUESTEJECTPC,
5420                                     &state->tmp);
5421         if (tevent_req_nomem(subreq, req)) {
5422                 return tevent_req_post(req, ev);
5423         }
5424         tevent_req_set_callback(subreq, rpccli_PNP_RequestEjectPC_done, req);
5425         return req;
5426 }
5427
5428 static void rpccli_PNP_RequestEjectPC_done(struct tevent_req *subreq)
5429 {
5430         struct tevent_req *req = tevent_req_callback_data(
5431                 subreq, struct tevent_req);
5432         struct rpccli_PNP_RequestEjectPC_state *state = tevent_req_data(
5433                 req, struct rpccli_PNP_RequestEjectPC_state);
5434         NTSTATUS status;
5435         TALLOC_CTX *mem_ctx;
5436
5437         if (state->out_mem_ctx) {
5438                 mem_ctx = state->out_mem_ctx;
5439         } else {
5440                 mem_ctx = state;
5441         }
5442
5443         status = state->dispatch_recv(subreq, mem_ctx);
5444         TALLOC_FREE(subreq);
5445         if (!NT_STATUS_IS_OK(status)) {
5446                 tevent_req_nterror(req, status);
5447                 return;
5448         }
5449
5450         /* Copy out parameters */
5451
5452         /* Copy result */
5453         state->orig.out.result = state->tmp.out.result;
5454
5455         /* Reset temporary structure */
5456         ZERO_STRUCT(state->tmp);
5457
5458         tevent_req_done(req);
5459 }
5460
5461 NTSTATUS rpccli_PNP_RequestEjectPC_recv(struct tevent_req *req,
5462                                         TALLOC_CTX *mem_ctx,
5463                                         WERROR *result)
5464 {
5465         struct rpccli_PNP_RequestEjectPC_state *state = tevent_req_data(
5466                 req, struct rpccli_PNP_RequestEjectPC_state);
5467         NTSTATUS status;
5468
5469         if (tevent_req_is_nterror(req, &status)) {
5470                 tevent_req_received(req);
5471                 return status;
5472         }
5473
5474         /* Steal possbile out parameters to the callers context */
5475         talloc_steal(mem_ctx, state->out_mem_ctx);
5476
5477         /* Return result */
5478         *result = state->orig.out.result;
5479
5480         tevent_req_received(req);
5481         return NT_STATUS_OK;
5482 }
5483
5484 NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli,
5485                                    TALLOC_CTX *mem_ctx,
5486                                    WERROR *werror)
5487 {
5488         struct PNP_RequestEjectPC r;
5489         NTSTATUS status;
5490
5491         /* In parameters */
5492
5493         status = cli->dispatch(cli,
5494                                 mem_ctx,
5495                                 &ndr_table_ntsvcs,
5496                                 NDR_PNP_REQUESTEJECTPC,
5497                                 &r);
5498
5499         if (!NT_STATUS_IS_OK(status)) {
5500                 return status;
5501         }
5502
5503         if (NT_STATUS_IS_ERR(status)) {
5504                 return status;
5505         }
5506
5507         /* Return variables */
5508
5509         /* Return result */
5510         if (werror) {
5511                 *werror = r.out.result;
5512         }
5513
5514         return werror_to_ntstatus(r.out.result);
5515 }
5516
5517 struct rpccli_PNP_HwProfFlags_state {
5518         struct PNP_HwProfFlags orig;
5519         struct PNP_HwProfFlags tmp;
5520         TALLOC_CTX *out_mem_ctx;
5521         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5522 };
5523
5524 static void rpccli_PNP_HwProfFlags_done(struct tevent_req *subreq);
5525
5526 struct tevent_req *rpccli_PNP_HwProfFlags_send(TALLOC_CTX *mem_ctx,
5527                                                struct tevent_context *ev,
5528                                                struct rpc_pipe_client *cli,
5529                                                uint32_t _action /* [in]  */,
5530                                                const char *_devicepath /* [in] [ref,charset(UTF16)] */,
5531                                                uint32_t _config /* [in]  */,
5532                                                uint32_t *_profile_flags /* [in,out] [ref] */,
5533                                                uint16_t *_veto_type /* [in,out] [unique] */,
5534                                                const char *_unknown5 /* [in] [unique,charset(UTF16)] */,
5535                                                const char **_unknown5a /* [out] [unique,charset(UTF16)] */,
5536                                                uint32_t _name_length /* [in]  */,
5537                                                uint32_t _flags /* [in]  */)
5538 {
5539         struct tevent_req *req;
5540         struct rpccli_PNP_HwProfFlags_state *state;
5541         struct tevent_req *subreq;
5542
5543         req = tevent_req_create(mem_ctx, &state,
5544                                 struct rpccli_PNP_HwProfFlags_state);
5545         if (req == NULL) {
5546                 return NULL;
5547         }
5548         state->out_mem_ctx = NULL;
5549         state->dispatch_recv = cli->dispatch_recv;
5550
5551         /* In parameters */
5552         state->orig.in.action = _action;
5553         state->orig.in.devicepath = _devicepath;
5554         state->orig.in.config = _config;
5555         state->orig.in.profile_flags = _profile_flags;
5556         state->orig.in.veto_type = _veto_type;
5557         state->orig.in.unknown5 = _unknown5;
5558         state->orig.in.name_length = _name_length;
5559         state->orig.in.flags = _flags;
5560
5561         /* Out parameters */
5562         state->orig.out.profile_flags = _profile_flags;
5563         state->orig.out.veto_type = _veto_type;
5564         state->orig.out.unknown5a = _unknown5a;
5565
5566         /* Result */
5567         ZERO_STRUCT(state->orig.out.result);
5568
5569         state->out_mem_ctx = talloc_named_const(state, 0,
5570                              "rpccli_PNP_HwProfFlags_out_memory");
5571         if (tevent_req_nomem(state->out_mem_ctx, req)) {
5572                 return tevent_req_post(req, ev);
5573         }
5574
5575         /* make a temporary copy, that we pass to the dispatch function */
5576         state->tmp = state->orig;
5577
5578         subreq = cli->dispatch_send(state, ev, cli,
5579                                     &ndr_table_ntsvcs,
5580                                     NDR_PNP_HWPROFFLAGS,
5581                                     &state->tmp);
5582         if (tevent_req_nomem(subreq, req)) {
5583                 return tevent_req_post(req, ev);
5584         }
5585         tevent_req_set_callback(subreq, rpccli_PNP_HwProfFlags_done, req);
5586         return req;
5587 }
5588
5589 static void rpccli_PNP_HwProfFlags_done(struct tevent_req *subreq)
5590 {
5591         struct tevent_req *req = tevent_req_callback_data(
5592                 subreq, struct tevent_req);
5593         struct rpccli_PNP_HwProfFlags_state *state = tevent_req_data(
5594                 req, struct rpccli_PNP_HwProfFlags_state);
5595         NTSTATUS status;
5596         TALLOC_CTX *mem_ctx;
5597
5598         if (state->out_mem_ctx) {
5599                 mem_ctx = state->out_mem_ctx;
5600         } else {
5601                 mem_ctx = state;
5602         }
5603
5604         status = state->dispatch_recv(subreq, mem_ctx);
5605         TALLOC_FREE(subreq);
5606         if (!NT_STATUS_IS_OK(status)) {
5607                 tevent_req_nterror(req, status);
5608                 return;
5609         }
5610
5611         /* Copy out parameters */
5612         *state->orig.out.profile_flags = *state->tmp.out.profile_flags;
5613         if (state->orig.out.veto_type && state->tmp.out.veto_type) {
5614                 *state->orig.out.veto_type = *state->tmp.out.veto_type;
5615         }
5616         if (state->orig.out.unknown5a && state->tmp.out.unknown5a) {
5617                 *state->orig.out.unknown5a = *state->tmp.out.unknown5a;
5618         }
5619
5620         /* Copy result */
5621         state->orig.out.result = state->tmp.out.result;
5622
5623         /* Reset temporary structure */
5624         ZERO_STRUCT(state->tmp);
5625
5626         tevent_req_done(req);
5627 }
5628
5629 NTSTATUS rpccli_PNP_HwProfFlags_recv(struct tevent_req *req,
5630                                      TALLOC_CTX *mem_ctx,
5631                                      WERROR *result)
5632 {
5633         struct rpccli_PNP_HwProfFlags_state *state = tevent_req_data(
5634                 req, struct rpccli_PNP_HwProfFlags_state);
5635         NTSTATUS status;
5636
5637         if (tevent_req_is_nterror(req, &status)) {
5638                 tevent_req_received(req);
5639                 return status;
5640         }
5641
5642         /* Steal possbile out parameters to the callers context */
5643         talloc_steal(mem_ctx, state->out_mem_ctx);
5644
5645         /* Return result */
5646         *result = state->orig.out.result;
5647
5648         tevent_req_received(req);
5649         return NT_STATUS_OK;
5650 }
5651
5652 NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
5653                                 TALLOC_CTX *mem_ctx,
5654                                 uint32_t action /* [in]  */,
5655                                 const char *devicepath /* [in] [ref,charset(UTF16)] */,
5656                                 uint32_t config /* [in]  */,
5657                                 uint32_t *profile_flags /* [in,out] [ref] */,
5658                                 uint16_t *veto_type /* [in,out] [unique] */,
5659                                 const char *unknown5 /* [in] [unique,charset(UTF16)] */,
5660                                 const char **unknown5a /* [out] [unique,charset(UTF16)] */,
5661                                 uint32_t name_length /* [in]  */,
5662                                 uint32_t flags /* [in]  */,
5663                                 WERROR *werror)
5664 {
5665         struct PNP_HwProfFlags r;
5666         NTSTATUS status;
5667
5668         /* In parameters */
5669         r.in.action = action;
5670         r.in.devicepath = devicepath;
5671         r.in.config = config;
5672         r.in.profile_flags = profile_flags;
5673         r.in.veto_type = veto_type;
5674         r.in.unknown5 = unknown5;
5675         r.in.name_length = name_length;
5676         r.in.flags = flags;
5677
5678         status = cli->dispatch(cli,
5679                                 mem_ctx,
5680                                 &ndr_table_ntsvcs,
5681                                 NDR_PNP_HWPROFFLAGS,
5682                                 &r);
5683
5684         if (!NT_STATUS_IS_OK(status)) {
5685                 return status;
5686         }
5687
5688         if (NT_STATUS_IS_ERR(status)) {
5689                 return status;
5690         }
5691
5692         /* Return variables */
5693         *profile_flags = *r.out.profile_flags;
5694         if (veto_type && r.out.veto_type) {
5695                 *veto_type = *r.out.veto_type;
5696         }
5697         if (unknown5a && r.out.unknown5a) {
5698                 *unknown5a = *r.out.unknown5a;
5699         }
5700
5701         /* Return result */
5702         if (werror) {
5703                 *werror = r.out.result;
5704         }
5705
5706         return werror_to_ntstatus(r.out.result);
5707 }
5708
5709 struct rpccli_PNP_GetHwProfInfo_state {
5710         struct PNP_GetHwProfInfo orig;
5711         struct PNP_GetHwProfInfo tmp;
5712         TALLOC_CTX *out_mem_ctx;
5713         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5714 };
5715
5716 static void rpccli_PNP_GetHwProfInfo_done(struct tevent_req *subreq);
5717
5718 struct tevent_req *rpccli_PNP_GetHwProfInfo_send(TALLOC_CTX *mem_ctx,
5719                                                  struct tevent_context *ev,
5720                                                  struct rpc_pipe_client *cli,
5721                                                  uint32_t _idx /* [in]  */,
5722                                                  struct PNP_HwProfInfo *_info /* [in,out] [ref] */,
5723                                                  uint32_t _size /* [in]  */,
5724                                                  uint32_t _flags /* [in]  */)
5725 {
5726         struct tevent_req *req;
5727         struct rpccli_PNP_GetHwProfInfo_state *state;
5728         struct tevent_req *subreq;
5729
5730         req = tevent_req_create(mem_ctx, &state,
5731                                 struct rpccli_PNP_GetHwProfInfo_state);
5732         if (req == NULL) {
5733                 return NULL;
5734         }
5735         state->out_mem_ctx = NULL;
5736         state->dispatch_recv = cli->dispatch_recv;
5737
5738         /* In parameters */
5739         state->orig.in.idx = _idx;
5740         state->orig.in.info = _info;
5741         state->orig.in.size = _size;
5742         state->orig.in.flags = _flags;
5743
5744         /* Out parameters */
5745         state->orig.out.info = _info;
5746
5747         /* Result */
5748         ZERO_STRUCT(state->orig.out.result);
5749
5750         state->out_mem_ctx = talloc_named_const(state, 0,
5751                              "rpccli_PNP_GetHwProfInfo_out_memory");
5752         if (tevent_req_nomem(state->out_mem_ctx, req)) {
5753                 return tevent_req_post(req, ev);
5754         }
5755
5756         /* make a temporary copy, that we pass to the dispatch function */
5757         state->tmp = state->orig;
5758
5759         subreq = cli->dispatch_send(state, ev, cli,
5760                                     &ndr_table_ntsvcs,
5761                                     NDR_PNP_GETHWPROFINFO,
5762                                     &state->tmp);
5763         if (tevent_req_nomem(subreq, req)) {
5764                 return tevent_req_post(req, ev);
5765         }
5766         tevent_req_set_callback(subreq, rpccli_PNP_GetHwProfInfo_done, req);
5767         return req;
5768 }
5769
5770 static void rpccli_PNP_GetHwProfInfo_done(struct tevent_req *subreq)
5771 {
5772         struct tevent_req *req = tevent_req_callback_data(
5773                 subreq, struct tevent_req);
5774         struct rpccli_PNP_GetHwProfInfo_state *state = tevent_req_data(
5775                 req, struct rpccli_PNP_GetHwProfInfo_state);
5776         NTSTATUS status;
5777         TALLOC_CTX *mem_ctx;
5778
5779         if (state->out_mem_ctx) {
5780                 mem_ctx = state->out_mem_ctx;
5781         } else {
5782                 mem_ctx = state;
5783         }
5784
5785         status = state->dispatch_recv(subreq, mem_ctx);
5786         TALLOC_FREE(subreq);
5787         if (!NT_STATUS_IS_OK(status)) {
5788                 tevent_req_nterror(req, status);
5789                 return;
5790         }
5791
5792         /* Copy out parameters */
5793         *state->orig.out.info = *state->tmp.out.info;
5794
5795         /* Copy result */
5796         state->orig.out.result = state->tmp.out.result;
5797
5798         /* Reset temporary structure */
5799         ZERO_STRUCT(state->tmp);
5800
5801         tevent_req_done(req);
5802 }
5803
5804 NTSTATUS rpccli_PNP_GetHwProfInfo_recv(struct tevent_req *req,
5805                                        TALLOC_CTX *mem_ctx,
5806                                        WERROR *result)
5807 {
5808         struct rpccli_PNP_GetHwProfInfo_state *state = tevent_req_data(
5809                 req, struct rpccli_PNP_GetHwProfInfo_state);
5810         NTSTATUS status;
5811
5812         if (tevent_req_is_nterror(req, &status)) {
5813                 tevent_req_received(req);
5814                 return status;
5815         }
5816
5817         /* Steal possbile out parameters to the callers context */
5818         talloc_steal(mem_ctx, state->out_mem_ctx);
5819
5820         /* Return result */
5821         *result = state->orig.out.result;
5822
5823         tevent_req_received(req);
5824         return NT_STATUS_OK;
5825 }
5826
5827 NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli,
5828                                   TALLOC_CTX *mem_ctx,
5829                                   uint32_t idx /* [in]  */,
5830                                   struct PNP_HwProfInfo *info /* [in,out] [ref] */,
5831                                   uint32_t size /* [in]  */,
5832                                   uint32_t flags /* [in]  */,
5833                                   WERROR *werror)
5834 {
5835         struct PNP_GetHwProfInfo r;
5836         NTSTATUS status;
5837
5838         /* In parameters */
5839         r.in.idx = idx;
5840         r.in.info = info;
5841         r.in.size = size;
5842         r.in.flags = flags;
5843
5844         status = cli->dispatch(cli,
5845                                 mem_ctx,
5846                                 &ndr_table_ntsvcs,
5847                                 NDR_PNP_GETHWPROFINFO,
5848                                 &r);
5849
5850         if (!NT_STATUS_IS_OK(status)) {
5851                 return status;
5852         }
5853
5854         if (NT_STATUS_IS_ERR(status)) {
5855                 return status;
5856         }
5857
5858         /* Return variables */
5859         *info = *r.out.info;
5860
5861         /* Return result */
5862         if (werror) {
5863                 *werror = r.out.result;
5864         }
5865
5866         return werror_to_ntstatus(r.out.result);
5867 }
5868
5869 struct rpccli_PNP_AddEmptyLogConf_state {
5870         struct PNP_AddEmptyLogConf orig;
5871         struct PNP_AddEmptyLogConf tmp;
5872         TALLOC_CTX *out_mem_ctx;
5873         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5874 };
5875
5876 static void rpccli_PNP_AddEmptyLogConf_done(struct tevent_req *subreq);
5877
5878 struct tevent_req *rpccli_PNP_AddEmptyLogConf_send(TALLOC_CTX *mem_ctx,
5879                                                    struct tevent_context *ev,
5880                                                    struct rpc_pipe_client *cli)
5881 {
5882         struct tevent_req *req;
5883         struct rpccli_PNP_AddEmptyLogConf_state *state;
5884         struct tevent_req *subreq;
5885
5886         req = tevent_req_create(mem_ctx, &state,
5887                                 struct rpccli_PNP_AddEmptyLogConf_state);
5888         if (req == NULL) {
5889                 return NULL;
5890         }
5891         state->out_mem_ctx = NULL;
5892         state->dispatch_recv = cli->dispatch_recv;
5893
5894         /* In parameters */
5895
5896         /* Out parameters */
5897
5898         /* Result */
5899         ZERO_STRUCT(state->orig.out.result);
5900
5901         /* make a temporary copy, that we pass to the dispatch function */
5902         state->tmp = state->orig;
5903
5904         subreq = cli->dispatch_send(state, ev, cli,
5905                                     &ndr_table_ntsvcs,
5906                                     NDR_PNP_ADDEMPTYLOGCONF,
5907                                     &state->tmp);
5908         if (tevent_req_nomem(subreq, req)) {
5909                 return tevent_req_post(req, ev);
5910         }
5911         tevent_req_set_callback(subreq, rpccli_PNP_AddEmptyLogConf_done, req);
5912         return req;
5913 }
5914
5915 static void rpccli_PNP_AddEmptyLogConf_done(struct tevent_req *subreq)
5916 {
5917         struct tevent_req *req = tevent_req_callback_data(
5918                 subreq, struct tevent_req);
5919         struct rpccli_PNP_AddEmptyLogConf_state *state = tevent_req_data(
5920                 req, struct rpccli_PNP_AddEmptyLogConf_state);
5921         NTSTATUS status;
5922         TALLOC_CTX *mem_ctx;
5923
5924         if (state->out_mem_ctx) {
5925                 mem_ctx = state->out_mem_ctx;
5926         } else {
5927                 mem_ctx = state;
5928         }
5929
5930         status = state->dispatch_recv(subreq, mem_ctx);
5931         TALLOC_FREE(subreq);
5932         if (!NT_STATUS_IS_OK(status)) {
5933                 tevent_req_nterror(req, status);
5934                 return;
5935         }
5936
5937         /* Copy out parameters */
5938
5939         /* Copy result */
5940         state->orig.out.result = state->tmp.out.result;
5941
5942         /* Reset temporary structure */
5943         ZERO_STRUCT(state->tmp);
5944
5945         tevent_req_done(req);
5946 }
5947
5948 NTSTATUS rpccli_PNP_AddEmptyLogConf_recv(struct tevent_req *req,
5949                                          TALLOC_CTX *mem_ctx,
5950                                          WERROR *result)
5951 {
5952         struct rpccli_PNP_AddEmptyLogConf_state *state = tevent_req_data(
5953                 req, struct rpccli_PNP_AddEmptyLogConf_state);
5954         NTSTATUS status;
5955
5956         if (tevent_req_is_nterror(req, &status)) {
5957                 tevent_req_received(req);
5958                 return status;
5959         }
5960
5961         /* Steal possbile out parameters to the callers context */
5962         talloc_steal(mem_ctx, state->out_mem_ctx);
5963
5964         /* Return result */
5965         *result = state->orig.out.result;
5966
5967         tevent_req_received(req);
5968         return NT_STATUS_OK;
5969 }
5970
5971 NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli,
5972                                     TALLOC_CTX *mem_ctx,
5973                                     WERROR *werror)
5974 {
5975         struct PNP_AddEmptyLogConf r;
5976         NTSTATUS status;
5977
5978         /* In parameters */
5979
5980         status = cli->dispatch(cli,
5981                                 mem_ctx,
5982                                 &ndr_table_ntsvcs,
5983                                 NDR_PNP_ADDEMPTYLOGCONF,
5984                                 &r);
5985
5986         if (!NT_STATUS_IS_OK(status)) {
5987                 return status;
5988         }
5989
5990         if (NT_STATUS_IS_ERR(status)) {
5991                 return status;
5992         }
5993
5994         /* Return variables */
5995
5996         /* Return result */
5997         if (werror) {
5998                 *werror = r.out.result;
5999         }
6000
6001         return werror_to_ntstatus(r.out.result);
6002 }
6003
6004 struct rpccli_PNP_FreeLogConf_state {
6005         struct PNP_FreeLogConf orig;
6006         struct PNP_FreeLogConf tmp;
6007         TALLOC_CTX *out_mem_ctx;
6008         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6009 };
6010
6011 static void rpccli_PNP_FreeLogConf_done(struct tevent_req *subreq);
6012
6013 struct tevent_req *rpccli_PNP_FreeLogConf_send(TALLOC_CTX *mem_ctx,
6014                                                struct tevent_context *ev,
6015                                                struct rpc_pipe_client *cli)
6016 {
6017         struct tevent_req *req;
6018         struct rpccli_PNP_FreeLogConf_state *state;
6019         struct tevent_req *subreq;
6020
6021         req = tevent_req_create(mem_ctx, &state,
6022                                 struct rpccli_PNP_FreeLogConf_state);
6023         if (req == NULL) {
6024                 return NULL;
6025         }
6026         state->out_mem_ctx = NULL;
6027         state->dispatch_recv = cli->dispatch_recv;
6028
6029         /* In parameters */
6030
6031         /* Out parameters */
6032
6033         /* Result */
6034         ZERO_STRUCT(state->orig.out.result);
6035
6036         /* make a temporary copy, that we pass to the dispatch function */
6037         state->tmp = state->orig;
6038
6039         subreq = cli->dispatch_send(state, ev, cli,
6040                                     &ndr_table_ntsvcs,
6041                                     NDR_PNP_FREELOGCONF,
6042                                     &state->tmp);
6043         if (tevent_req_nomem(subreq, req)) {
6044                 return tevent_req_post(req, ev);
6045         }
6046         tevent_req_set_callback(subreq, rpccli_PNP_FreeLogConf_done, req);
6047         return req;
6048 }
6049
6050 static void rpccli_PNP_FreeLogConf_done(struct tevent_req *subreq)
6051 {
6052         struct tevent_req *req = tevent_req_callback_data(
6053                 subreq, struct tevent_req);
6054         struct rpccli_PNP_FreeLogConf_state *state = tevent_req_data(
6055                 req, struct rpccli_PNP_FreeLogConf_state);
6056         NTSTATUS status;
6057         TALLOC_CTX *mem_ctx;
6058
6059         if (state->out_mem_ctx) {
6060                 mem_ctx = state->out_mem_ctx;
6061         } else {
6062                 mem_ctx = state;
6063         }
6064
6065         status = state->dispatch_recv(subreq, mem_ctx);
6066         TALLOC_FREE(subreq);
6067         if (!NT_STATUS_IS_OK(status)) {
6068                 tevent_req_nterror(req, status);
6069                 return;
6070         }
6071
6072         /* Copy out parameters */
6073
6074         /* Copy result */
6075         state->orig.out.result = state->tmp.out.result;
6076
6077         /* Reset temporary structure */
6078         ZERO_STRUCT(state->tmp);
6079
6080         tevent_req_done(req);
6081 }
6082
6083 NTSTATUS rpccli_PNP_FreeLogConf_recv(struct tevent_req *req,
6084                                      TALLOC_CTX *mem_ctx,
6085                                      WERROR *result)
6086 {
6087         struct rpccli_PNP_FreeLogConf_state *state = tevent_req_data(
6088                 req, struct rpccli_PNP_FreeLogConf_state);
6089         NTSTATUS status;
6090
6091         if (tevent_req_is_nterror(req, &status)) {
6092                 tevent_req_received(req);
6093                 return status;
6094         }
6095
6096         /* Steal possbile out parameters to the callers context */
6097         talloc_steal(mem_ctx, state->out_mem_ctx);
6098
6099         /* Return result */
6100         *result = state->orig.out.result;
6101
6102         tevent_req_received(req);
6103         return NT_STATUS_OK;
6104 }
6105
6106 NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli,
6107                                 TALLOC_CTX *mem_ctx,
6108                                 WERROR *werror)
6109 {
6110         struct PNP_FreeLogConf r;
6111         NTSTATUS status;
6112
6113         /* In parameters */
6114
6115         status = cli->dispatch(cli,
6116                                 mem_ctx,
6117                                 &ndr_table_ntsvcs,
6118                                 NDR_PNP_FREELOGCONF,
6119                                 &r);
6120
6121         if (!NT_STATUS_IS_OK(status)) {
6122                 return status;
6123         }
6124
6125         if (NT_STATUS_IS_ERR(status)) {
6126                 return status;
6127         }
6128
6129         /* Return variables */
6130
6131         /* Return result */
6132         if (werror) {
6133                 *werror = r.out.result;
6134         }
6135
6136         return werror_to_ntstatus(r.out.result);
6137 }
6138
6139 struct rpccli_PNP_GetFirstLogConf_state {
6140         struct PNP_GetFirstLogConf orig;
6141         struct PNP_GetFirstLogConf tmp;
6142         TALLOC_CTX *out_mem_ctx;
6143         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6144 };
6145
6146 static void rpccli_PNP_GetFirstLogConf_done(struct tevent_req *subreq);
6147
6148 struct tevent_req *rpccli_PNP_GetFirstLogConf_send(TALLOC_CTX *mem_ctx,
6149                                                    struct tevent_context *ev,
6150                                                    struct rpc_pipe_client *cli)
6151 {
6152         struct tevent_req *req;
6153         struct rpccli_PNP_GetFirstLogConf_state *state;
6154         struct tevent_req *subreq;
6155
6156         req = tevent_req_create(mem_ctx, &state,
6157                                 struct rpccli_PNP_GetFirstLogConf_state);
6158         if (req == NULL) {
6159                 return NULL;
6160         }
6161         state->out_mem_ctx = NULL;
6162         state->dispatch_recv = cli->dispatch_recv;
6163
6164         /* In parameters */
6165
6166         /* Out parameters */
6167
6168         /* Result */
6169         ZERO_STRUCT(state->orig.out.result);
6170
6171         /* make a temporary copy, that we pass to the dispatch function */
6172         state->tmp = state->orig;
6173
6174         subreq = cli->dispatch_send(state, ev, cli,
6175                                     &ndr_table_ntsvcs,
6176                                     NDR_PNP_GETFIRSTLOGCONF,
6177                                     &state->tmp);
6178         if (tevent_req_nomem(subreq, req)) {
6179                 return tevent_req_post(req, ev);
6180         }
6181         tevent_req_set_callback(subreq, rpccli_PNP_GetFirstLogConf_done, req);
6182         return req;
6183 }
6184
6185 static void rpccli_PNP_GetFirstLogConf_done(struct tevent_req *subreq)
6186 {
6187         struct tevent_req *req = tevent_req_callback_data(
6188                 subreq, struct tevent_req);
6189         struct rpccli_PNP_GetFirstLogConf_state *state = tevent_req_data(
6190                 req, struct rpccli_PNP_GetFirstLogConf_state);
6191         NTSTATUS status;
6192         TALLOC_CTX *mem_ctx;
6193
6194         if (state->out_mem_ctx) {
6195                 mem_ctx = state->out_mem_ctx;
6196         } else {
6197                 mem_ctx = state;
6198         }
6199
6200         status = state->dispatch_recv(subreq, mem_ctx);
6201         TALLOC_FREE(subreq);
6202         if (!NT_STATUS_IS_OK(status)) {
6203                 tevent_req_nterror(req, status);
6204                 return;
6205         }
6206
6207         /* Copy out parameters */
6208
6209         /* Copy result */
6210         state->orig.out.result = state->tmp.out.result;
6211
6212         /* Reset temporary structure */
6213         ZERO_STRUCT(state->tmp);
6214
6215         tevent_req_done(req);
6216 }
6217
6218 NTSTATUS rpccli_PNP_GetFirstLogConf_recv(struct tevent_req *req,
6219                                          TALLOC_CTX *mem_ctx,
6220                                          WERROR *result)
6221 {
6222         struct rpccli_PNP_GetFirstLogConf_state *state = tevent_req_data(
6223                 req, struct rpccli_PNP_GetFirstLogConf_state);
6224         NTSTATUS status;
6225
6226         if (tevent_req_is_nterror(req, &status)) {
6227                 tevent_req_received(req);
6228                 return status;
6229         }
6230
6231         /* Steal possbile out parameters to the callers context */
6232         talloc_steal(mem_ctx, state->out_mem_ctx);
6233
6234         /* Return result */
6235         *result = state->orig.out.result;
6236
6237         tevent_req_received(req);
6238         return NT_STATUS_OK;
6239 }
6240
6241 NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli,
6242                                     TALLOC_CTX *mem_ctx,
6243                                     WERROR *werror)
6244 {
6245         struct PNP_GetFirstLogConf r;
6246         NTSTATUS status;
6247
6248         /* In parameters */
6249
6250         status = cli->dispatch(cli,
6251                                 mem_ctx,
6252                                 &ndr_table_ntsvcs,
6253                                 NDR_PNP_GETFIRSTLOGCONF,
6254                                 &r);
6255
6256         if (!NT_STATUS_IS_OK(status)) {
6257                 return status;
6258         }
6259
6260         if (NT_STATUS_IS_ERR(status)) {
6261                 return status;
6262         }
6263
6264         /* Return variables */
6265
6266         /* Return result */
6267         if (werror) {
6268                 *werror = r.out.result;
6269         }
6270
6271         return werror_to_ntstatus(r.out.result);
6272 }
6273
6274 struct rpccli_PNP_GetNextLogConf_state {
6275         struct PNP_GetNextLogConf orig;
6276         struct PNP_GetNextLogConf tmp;
6277         TALLOC_CTX *out_mem_ctx;
6278         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6279 };
6280
6281 static void rpccli_PNP_GetNextLogConf_done(struct tevent_req *subreq);
6282
6283 struct tevent_req *rpccli_PNP_GetNextLogConf_send(TALLOC_CTX *mem_ctx,
6284                                                   struct tevent_context *ev,
6285                                                   struct rpc_pipe_client *cli)
6286 {
6287         struct tevent_req *req;
6288         struct rpccli_PNP_GetNextLogConf_state *state;
6289         struct tevent_req *subreq;
6290
6291         req = tevent_req_create(mem_ctx, &state,
6292                                 struct rpccli_PNP_GetNextLogConf_state);
6293         if (req == NULL) {
6294                 return NULL;
6295         }
6296         state->out_mem_ctx = NULL;
6297         state->dispatch_recv = cli->dispatch_recv;
6298
6299         /* In parameters */
6300
6301         /* Out parameters */
6302
6303         /* Result */
6304         ZERO_STRUCT(state->orig.out.result);
6305
6306         /* make a temporary copy, that we pass to the dispatch function */
6307         state->tmp = state->orig;
6308
6309         subreq = cli->dispatch_send(state, ev, cli,
6310                                     &ndr_table_ntsvcs,
6311                                     NDR_PNP_GETNEXTLOGCONF,
6312                                     &state->tmp);
6313         if (tevent_req_nomem(subreq, req)) {
6314                 return tevent_req_post(req, ev);
6315         }
6316         tevent_req_set_callback(subreq, rpccli_PNP_GetNextLogConf_done, req);
6317         return req;
6318 }
6319
6320 static void rpccli_PNP_GetNextLogConf_done(struct tevent_req *subreq)
6321 {
6322         struct tevent_req *req = tevent_req_callback_data(
6323                 subreq, struct tevent_req);
6324         struct rpccli_PNP_GetNextLogConf_state *state = tevent_req_data(
6325                 req, struct rpccli_PNP_GetNextLogConf_state);
6326         NTSTATUS status;
6327         TALLOC_CTX *mem_ctx;
6328
6329         if (state->out_mem_ctx) {
6330                 mem_ctx = state->out_mem_ctx;
6331         } else {
6332                 mem_ctx = state;
6333         }
6334
6335         status = state->dispatch_recv(subreq, mem_ctx);
6336         TALLOC_FREE(subreq);
6337         if (!NT_STATUS_IS_OK(status)) {
6338                 tevent_req_nterror(req, status);
6339                 return;
6340         }
6341
6342         /* Copy out parameters */
6343
6344         /* Copy result */
6345         state->orig.out.result = state->tmp.out.result;
6346
6347         /* Reset temporary structure */
6348         ZERO_STRUCT(state->tmp);
6349
6350         tevent_req_done(req);
6351 }
6352
6353 NTSTATUS rpccli_PNP_GetNextLogConf_recv(struct tevent_req *req,
6354                                         TALLOC_CTX *mem_ctx,
6355                                         WERROR *result)
6356 {
6357         struct rpccli_PNP_GetNextLogConf_state *state = tevent_req_data(
6358                 req, struct rpccli_PNP_GetNextLogConf_state);
6359         NTSTATUS status;
6360
6361         if (tevent_req_is_nterror(req, &status)) {
6362                 tevent_req_received(req);
6363                 return status;
6364         }
6365
6366         /* Steal possbile out parameters to the callers context */
6367         talloc_steal(mem_ctx, state->out_mem_ctx);
6368
6369         /* Return result */
6370         *result = state->orig.out.result;
6371
6372         tevent_req_received(req);
6373         return NT_STATUS_OK;
6374 }
6375
6376 NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli,
6377                                    TALLOC_CTX *mem_ctx,
6378                                    WERROR *werror)
6379 {
6380         struct PNP_GetNextLogConf r;
6381         NTSTATUS status;
6382
6383         /* In parameters */
6384
6385         status = cli->dispatch(cli,
6386                                 mem_ctx,
6387                                 &ndr_table_ntsvcs,
6388                                 NDR_PNP_GETNEXTLOGCONF,
6389                                 &r);
6390
6391         if (!NT_STATUS_IS_OK(status)) {
6392                 return status;
6393         }
6394
6395         if (NT_STATUS_IS_ERR(status)) {
6396                 return status;
6397         }
6398
6399         /* Return variables */
6400
6401         /* Return result */
6402         if (werror) {
6403                 *werror = r.out.result;
6404         }
6405
6406         return werror_to_ntstatus(r.out.result);
6407 }
6408
6409 struct rpccli_PNP_GetLogConfPriority_state {
6410         struct PNP_GetLogConfPriority orig;
6411         struct PNP_GetLogConfPriority tmp;
6412         TALLOC_CTX *out_mem_ctx;
6413         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6414 };
6415
6416 static void rpccli_PNP_GetLogConfPriority_done(struct tevent_req *subreq);
6417
6418 struct tevent_req *rpccli_PNP_GetLogConfPriority_send(TALLOC_CTX *mem_ctx,
6419                                                       struct tevent_context *ev,
6420                                                       struct rpc_pipe_client *cli)
6421 {
6422         struct tevent_req *req;
6423         struct rpccli_PNP_GetLogConfPriority_state *state;
6424         struct tevent_req *subreq;
6425
6426         req = tevent_req_create(mem_ctx, &state,
6427                                 struct rpccli_PNP_GetLogConfPriority_state);
6428         if (req == NULL) {
6429                 return NULL;
6430         }
6431         state->out_mem_ctx = NULL;
6432         state->dispatch_recv = cli->dispatch_recv;
6433
6434         /* In parameters */
6435
6436         /* Out parameters */
6437
6438         /* Result */
6439         ZERO_STRUCT(state->orig.out.result);
6440
6441         /* make a temporary copy, that we pass to the dispatch function */
6442         state->tmp = state->orig;
6443
6444         subreq = cli->dispatch_send(state, ev, cli,
6445                                     &ndr_table_ntsvcs,
6446                                     NDR_PNP_GETLOGCONFPRIORITY,
6447                                     &state->tmp);
6448         if (tevent_req_nomem(subreq, req)) {
6449                 return tevent_req_post(req, ev);
6450         }
6451         tevent_req_set_callback(subreq, rpccli_PNP_GetLogConfPriority_done, req);
6452         return req;
6453 }
6454
6455 static void rpccli_PNP_GetLogConfPriority_done(struct tevent_req *subreq)
6456 {
6457         struct tevent_req *req = tevent_req_callback_data(
6458                 subreq, struct tevent_req);
6459         struct rpccli_PNP_GetLogConfPriority_state *state = tevent_req_data(
6460                 req, struct rpccli_PNP_GetLogConfPriority_state);
6461         NTSTATUS status;
6462         TALLOC_CTX *mem_ctx;
6463
6464         if (state->out_mem_ctx) {
6465                 mem_ctx = state->out_mem_ctx;
6466         } else {
6467                 mem_ctx = state;
6468         }
6469
6470         status = state->dispatch_recv(subreq, mem_ctx);
6471         TALLOC_FREE(subreq);
6472         if (!NT_STATUS_IS_OK(status)) {
6473                 tevent_req_nterror(req, status);
6474                 return;
6475         }
6476
6477         /* Copy out parameters */
6478
6479         /* Copy result */
6480         state->orig.out.result = state->tmp.out.result;
6481
6482         /* Reset temporary structure */
6483         ZERO_STRUCT(state->tmp);
6484
6485         tevent_req_done(req);
6486 }
6487
6488 NTSTATUS rpccli_PNP_GetLogConfPriority_recv(struct tevent_req *req,
6489                                             TALLOC_CTX *mem_ctx,
6490                                             WERROR *result)
6491 {
6492         struct rpccli_PNP_GetLogConfPriority_state *state = tevent_req_data(
6493                 req, struct rpccli_PNP_GetLogConfPriority_state);
6494         NTSTATUS status;
6495
6496         if (tevent_req_is_nterror(req, &status)) {
6497                 tevent_req_received(req);
6498                 return status;
6499         }
6500
6501         /* Steal possbile out parameters to the callers context */
6502         talloc_steal(mem_ctx, state->out_mem_ctx);
6503
6504         /* Return result */
6505         *result = state->orig.out.result;
6506
6507         tevent_req_received(req);
6508         return NT_STATUS_OK;
6509 }
6510
6511 NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli,
6512                                        TALLOC_CTX *mem_ctx,
6513                                        WERROR *werror)
6514 {
6515         struct PNP_GetLogConfPriority r;
6516         NTSTATUS status;
6517
6518         /* In parameters */
6519
6520         status = cli->dispatch(cli,
6521                                 mem_ctx,
6522                                 &ndr_table_ntsvcs,
6523                                 NDR_PNP_GETLOGCONFPRIORITY,
6524                                 &r);
6525
6526         if (!NT_STATUS_IS_OK(status)) {
6527                 return status;
6528         }
6529
6530         if (NT_STATUS_IS_ERR(status)) {
6531                 return status;
6532         }
6533
6534         /* Return variables */
6535
6536         /* Return result */
6537         if (werror) {
6538                 *werror = r.out.result;
6539         }
6540
6541         return werror_to_ntstatus(r.out.result);
6542 }
6543
6544 struct rpccli_PNP_AddResDes_state {
6545         struct PNP_AddResDes orig;
6546         struct PNP_AddResDes tmp;
6547         TALLOC_CTX *out_mem_ctx;
6548         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6549 };
6550
6551 static void rpccli_PNP_AddResDes_done(struct tevent_req *subreq);
6552
6553 struct tevent_req *rpccli_PNP_AddResDes_send(TALLOC_CTX *mem_ctx,
6554                                              struct tevent_context *ev,
6555                                              struct rpc_pipe_client *cli)
6556 {
6557         struct tevent_req *req;
6558         struct rpccli_PNP_AddResDes_state *state;
6559         struct tevent_req *subreq;
6560
6561         req = tevent_req_create(mem_ctx, &state,
6562                                 struct rpccli_PNP_AddResDes_state);
6563         if (req == NULL) {
6564                 return NULL;
6565         }
6566         state->out_mem_ctx = NULL;
6567         state->dispatch_recv = cli->dispatch_recv;
6568
6569         /* In parameters */
6570
6571         /* Out parameters */
6572
6573         /* Result */
6574         ZERO_STRUCT(state->orig.out.result);
6575
6576         /* make a temporary copy, that we pass to the dispatch function */
6577         state->tmp = state->orig;
6578
6579         subreq = cli->dispatch_send(state, ev, cli,
6580                                     &ndr_table_ntsvcs,
6581                                     NDR_PNP_ADDRESDES,
6582                                     &state->tmp);
6583         if (tevent_req_nomem(subreq, req)) {
6584                 return tevent_req_post(req, ev);
6585         }
6586         tevent_req_set_callback(subreq, rpccli_PNP_AddResDes_done, req);
6587         return req;
6588 }
6589
6590 static void rpccli_PNP_AddResDes_done(struct tevent_req *subreq)
6591 {
6592         struct tevent_req *req = tevent_req_callback_data(
6593                 subreq, struct tevent_req);
6594         struct rpccli_PNP_AddResDes_state *state = tevent_req_data(
6595                 req, struct rpccli_PNP_AddResDes_state);
6596         NTSTATUS status;
6597         TALLOC_CTX *mem_ctx;
6598
6599         if (state->out_mem_ctx) {
6600                 mem_ctx = state->out_mem_ctx;
6601         } else {
6602                 mem_ctx = state;
6603         }
6604
6605         status = state->dispatch_recv(subreq, mem_ctx);
6606         TALLOC_FREE(subreq);
6607         if (!NT_STATUS_IS_OK(status)) {
6608                 tevent_req_nterror(req, status);
6609                 return;
6610         }
6611
6612         /* Copy out parameters */
6613
6614         /* Copy result */
6615         state->orig.out.result = state->tmp.out.result;
6616
6617         /* Reset temporary structure */
6618         ZERO_STRUCT(state->tmp);
6619
6620         tevent_req_done(req);
6621 }
6622
6623 NTSTATUS rpccli_PNP_AddResDes_recv(struct tevent_req *req,
6624                                    TALLOC_CTX *mem_ctx,
6625                                    WERROR *result)
6626 {
6627         struct rpccli_PNP_AddResDes_state *state = tevent_req_data(
6628                 req, struct rpccli_PNP_AddResDes_state);
6629         NTSTATUS status;
6630
6631         if (tevent_req_is_nterror(req, &status)) {
6632                 tevent_req_received(req);
6633                 return status;
6634         }
6635
6636         /* Steal possbile out parameters to the callers context */
6637         talloc_steal(mem_ctx, state->out_mem_ctx);
6638
6639         /* Return result */
6640         *result = state->orig.out.result;
6641
6642         tevent_req_received(req);
6643         return NT_STATUS_OK;
6644 }
6645
6646 NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli,
6647                               TALLOC_CTX *mem_ctx,
6648                               WERROR *werror)
6649 {
6650         struct PNP_AddResDes r;
6651         NTSTATUS status;
6652
6653         /* In parameters */
6654
6655         status = cli->dispatch(cli,
6656                                 mem_ctx,
6657                                 &ndr_table_ntsvcs,
6658                                 NDR_PNP_ADDRESDES,
6659                                 &r);
6660
6661         if (!NT_STATUS_IS_OK(status)) {
6662                 return status;
6663         }
6664
6665         if (NT_STATUS_IS_ERR(status)) {
6666                 return status;
6667         }
6668
6669         /* Return variables */
6670
6671         /* Return result */
6672         if (werror) {
6673                 *werror = r.out.result;
6674         }
6675
6676         return werror_to_ntstatus(r.out.result);
6677 }
6678
6679 struct rpccli_PNP_FreeResDes_state {
6680         struct PNP_FreeResDes orig;
6681         struct PNP_FreeResDes tmp;
6682         TALLOC_CTX *out_mem_ctx;
6683         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6684 };
6685
6686 static void rpccli_PNP_FreeResDes_done(struct tevent_req *subreq);
6687
6688 struct tevent_req *rpccli_PNP_FreeResDes_send(TALLOC_CTX *mem_ctx,
6689                                               struct tevent_context *ev,
6690                                               struct rpc_pipe_client *cli)
6691 {
6692         struct tevent_req *req;
6693         struct rpccli_PNP_FreeResDes_state *state;
6694         struct tevent_req *subreq;
6695
6696         req = tevent_req_create(mem_ctx, &state,
6697                                 struct rpccli_PNP_FreeResDes_state);
6698         if (req == NULL) {
6699                 return NULL;
6700         }
6701         state->out_mem_ctx = NULL;
6702         state->dispatch_recv = cli->dispatch_recv;
6703
6704         /* In parameters */
6705
6706         /* Out parameters */
6707
6708         /* Result */
6709         ZERO_STRUCT(state->orig.out.result);
6710
6711         /* make a temporary copy, that we pass to the dispatch function */
6712         state->tmp = state->orig;
6713
6714         subreq = cli->dispatch_send(state, ev, cli,
6715                                     &ndr_table_ntsvcs,
6716                                     NDR_PNP_FREERESDES,
6717                                     &state->tmp);
6718         if (tevent_req_nomem(subreq, req)) {
6719                 return tevent_req_post(req, ev);
6720         }
6721         tevent_req_set_callback(subreq, rpccli_PNP_FreeResDes_done, req);
6722         return req;
6723 }
6724
6725 static void rpccli_PNP_FreeResDes_done(struct tevent_req *subreq)
6726 {
6727         struct tevent_req *req = tevent_req_callback_data(
6728                 subreq, struct tevent_req);
6729         struct rpccli_PNP_FreeResDes_state *state = tevent_req_data(
6730                 req, struct rpccli_PNP_FreeResDes_state);
6731         NTSTATUS status;
6732         TALLOC_CTX *mem_ctx;
6733
6734         if (state->out_mem_ctx) {
6735                 mem_ctx = state->out_mem_ctx;
6736         } else {
6737                 mem_ctx = state;
6738         }
6739
6740         status = state->dispatch_recv(subreq, mem_ctx);
6741         TALLOC_FREE(subreq);
6742         if (!NT_STATUS_IS_OK(status)) {
6743                 tevent_req_nterror(req, status);
6744                 return;
6745         }
6746
6747         /* Copy out parameters */
6748
6749         /* Copy result */
6750         state->orig.out.result = state->tmp.out.result;
6751
6752         /* Reset temporary structure */
6753         ZERO_STRUCT(state->tmp);
6754
6755         tevent_req_done(req);
6756 }
6757
6758 NTSTATUS rpccli_PNP_FreeResDes_recv(struct tevent_req *req,
6759                                     TALLOC_CTX *mem_ctx,
6760                                     WERROR *result)
6761 {
6762         struct rpccli_PNP_FreeResDes_state *state = tevent_req_data(
6763                 req, struct rpccli_PNP_FreeResDes_state);
6764         NTSTATUS status;
6765
6766         if (tevent_req_is_nterror(req, &status)) {
6767                 tevent_req_received(req);
6768                 return status;
6769         }
6770
6771         /* Steal possbile out parameters to the callers context */
6772         talloc_steal(mem_ctx, state->out_mem_ctx);
6773
6774         /* Return result */
6775         *result = state->orig.out.result;
6776
6777         tevent_req_received(req);
6778         return NT_STATUS_OK;
6779 }
6780
6781 NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli,
6782                                TALLOC_CTX *mem_ctx,
6783                                WERROR *werror)
6784 {
6785         struct PNP_FreeResDes r;
6786         NTSTATUS status;
6787
6788         /* In parameters */
6789
6790         status = cli->dispatch(cli,
6791                                 mem_ctx,
6792                                 &ndr_table_ntsvcs,
6793                                 NDR_PNP_FREERESDES,
6794                                 &r);
6795
6796         if (!NT_STATUS_IS_OK(status)) {
6797                 return status;
6798         }
6799
6800         if (NT_STATUS_IS_ERR(status)) {
6801                 return status;
6802         }
6803
6804         /* Return variables */
6805
6806         /* Return result */
6807         if (werror) {
6808                 *werror = r.out.result;
6809         }
6810
6811         return werror_to_ntstatus(r.out.result);
6812 }
6813
6814 struct rpccli_PNP_GetNextResDes_state {
6815         struct PNP_GetNextResDes orig;
6816         struct PNP_GetNextResDes tmp;
6817         TALLOC_CTX *out_mem_ctx;
6818         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6819 };
6820
6821 static void rpccli_PNP_GetNextResDes_done(struct tevent_req *subreq);
6822
6823 struct tevent_req *rpccli_PNP_GetNextResDes_send(TALLOC_CTX *mem_ctx,
6824                                                  struct tevent_context *ev,
6825                                                  struct rpc_pipe_client *cli)
6826 {
6827         struct tevent_req *req;
6828         struct rpccli_PNP_GetNextResDes_state *state;
6829         struct tevent_req *subreq;
6830
6831         req = tevent_req_create(mem_ctx, &state,
6832                                 struct rpccli_PNP_GetNextResDes_state);
6833         if (req == NULL) {
6834                 return NULL;
6835         }
6836         state->out_mem_ctx = NULL;
6837         state->dispatch_recv = cli->dispatch_recv;
6838
6839         /* In parameters */
6840
6841         /* Out parameters */
6842
6843         /* Result */
6844         ZERO_STRUCT(state->orig.out.result);
6845
6846         /* make a temporary copy, that we pass to the dispatch function */
6847         state->tmp = state->orig;
6848
6849         subreq = cli->dispatch_send(state, ev, cli,
6850                                     &ndr_table_ntsvcs,
6851                                     NDR_PNP_GETNEXTRESDES,
6852                                     &state->tmp);
6853         if (tevent_req_nomem(subreq, req)) {
6854                 return tevent_req_post(req, ev);
6855         }
6856         tevent_req_set_callback(subreq, rpccli_PNP_GetNextResDes_done, req);
6857         return req;
6858 }
6859
6860 static void rpccli_PNP_GetNextResDes_done(struct tevent_req *subreq)
6861 {
6862         struct tevent_req *req = tevent_req_callback_data(
6863                 subreq, struct tevent_req);
6864         struct rpccli_PNP_GetNextResDes_state *state = tevent_req_data(
6865                 req, struct rpccli_PNP_GetNextResDes_state);
6866         NTSTATUS status;
6867         TALLOC_CTX *mem_ctx;
6868
6869         if (state->out_mem_ctx) {
6870                 mem_ctx = state->out_mem_ctx;
6871         } else {
6872                 mem_ctx = state;
6873         }
6874
6875         status = state->dispatch_recv(subreq, mem_ctx);
6876         TALLOC_FREE(subreq);
6877         if (!NT_STATUS_IS_OK(status)) {
6878                 tevent_req_nterror(req, status);
6879                 return;
6880         }
6881
6882         /* Copy out parameters */
6883
6884         /* Copy result */
6885         state->orig.out.result = state->tmp.out.result;
6886
6887         /* Reset temporary structure */
6888         ZERO_STRUCT(state->tmp);
6889
6890         tevent_req_done(req);
6891 }
6892
6893 NTSTATUS rpccli_PNP_GetNextResDes_recv(struct tevent_req *req,
6894                                        TALLOC_CTX *mem_ctx,
6895                                        WERROR *result)
6896 {
6897         struct rpccli_PNP_GetNextResDes_state *state = tevent_req_data(
6898                 req, struct rpccli_PNP_GetNextResDes_state);
6899         NTSTATUS status;
6900
6901         if (tevent_req_is_nterror(req, &status)) {
6902                 tevent_req_received(req);
6903                 return status;
6904         }
6905
6906         /* Steal possbile out parameters to the callers context */
6907         talloc_steal(mem_ctx, state->out_mem_ctx);
6908
6909         /* Return result */
6910         *result = state->orig.out.result;
6911
6912         tevent_req_received(req);
6913         return NT_STATUS_OK;
6914 }
6915
6916 NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli,
6917                                   TALLOC_CTX *mem_ctx,
6918                                   WERROR *werror)
6919 {
6920         struct PNP_GetNextResDes r;
6921         NTSTATUS status;
6922
6923         /* In parameters */
6924
6925         status = cli->dispatch(cli,
6926                                 mem_ctx,
6927                                 &ndr_table_ntsvcs,
6928                                 NDR_PNP_GETNEXTRESDES,
6929                                 &r);
6930
6931         if (!NT_STATUS_IS_OK(status)) {
6932                 return status;
6933         }
6934
6935         if (NT_STATUS_IS_ERR(status)) {
6936                 return status;
6937         }
6938
6939         /* Return variables */
6940
6941         /* Return result */
6942         if (werror) {
6943                 *werror = r.out.result;
6944         }
6945
6946         return werror_to_ntstatus(r.out.result);
6947 }
6948
6949 struct rpccli_PNP_GetResDesData_state {
6950         struct PNP_GetResDesData orig;
6951         struct PNP_GetResDesData tmp;
6952         TALLOC_CTX *out_mem_ctx;
6953         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6954 };
6955
6956 static void rpccli_PNP_GetResDesData_done(struct tevent_req *subreq);
6957
6958 struct tevent_req *rpccli_PNP_GetResDesData_send(TALLOC_CTX *mem_ctx,
6959                                                  struct tevent_context *ev,
6960                                                  struct rpc_pipe_client *cli)
6961 {
6962         struct tevent_req *req;
6963         struct rpccli_PNP_GetResDesData_state *state;
6964         struct tevent_req *subreq;
6965
6966         req = tevent_req_create(mem_ctx, &state,
6967                                 struct rpccli_PNP_GetResDesData_state);
6968         if (req == NULL) {
6969                 return NULL;
6970         }
6971         state->out_mem_ctx = NULL;
6972         state->dispatch_recv = cli->dispatch_recv;
6973
6974         /* In parameters */
6975
6976         /* Out parameters */
6977
6978         /* Result */
6979         ZERO_STRUCT(state->orig.out.result);
6980
6981         /* make a temporary copy, that we pass to the dispatch function */
6982         state->tmp = state->orig;
6983
6984         subreq = cli->dispatch_send(state, ev, cli,
6985                                     &ndr_table_ntsvcs,
6986                                     NDR_PNP_GETRESDESDATA,
6987                                     &state->tmp);
6988         if (tevent_req_nomem(subreq, req)) {
6989                 return tevent_req_post(req, ev);
6990         }
6991         tevent_req_set_callback(subreq, rpccli_PNP_GetResDesData_done, req);
6992         return req;
6993 }
6994
6995 static void rpccli_PNP_GetResDesData_done(struct tevent_req *subreq)
6996 {
6997         struct tevent_req *req = tevent_req_callback_data(
6998                 subreq, struct tevent_req);
6999         struct rpccli_PNP_GetResDesData_state *state = tevent_req_data(
7000                 req, struct rpccli_PNP_GetResDesData_state);
7001         NTSTATUS status;
7002         TALLOC_CTX *mem_ctx;
7003
7004         if (state->out_mem_ctx) {
7005                 mem_ctx = state->out_mem_ctx;
7006         } else {
7007                 mem_ctx = state;
7008         }
7009
7010         status = state->dispatch_recv(subreq, mem_ctx);
7011         TALLOC_FREE(subreq);
7012         if (!NT_STATUS_IS_OK(status)) {
7013                 tevent_req_nterror(req, status);
7014                 return;
7015         }
7016
7017         /* Copy out parameters */
7018
7019         /* Copy result */
7020         state->orig.out.result = state->tmp.out.result;
7021
7022         /* Reset temporary structure */
7023         ZERO_STRUCT(state->tmp);
7024
7025         tevent_req_done(req);
7026 }
7027
7028 NTSTATUS rpccli_PNP_GetResDesData_recv(struct tevent_req *req,
7029                                        TALLOC_CTX *mem_ctx,
7030                                        WERROR *result)
7031 {
7032         struct rpccli_PNP_GetResDesData_state *state = tevent_req_data(
7033                 req, struct rpccli_PNP_GetResDesData_state);
7034         NTSTATUS status;
7035
7036         if (tevent_req_is_nterror(req, &status)) {
7037                 tevent_req_received(req);
7038                 return status;
7039         }
7040
7041         /* Steal possbile out parameters to the callers context */
7042         talloc_steal(mem_ctx, state->out_mem_ctx);
7043
7044         /* Return result */
7045         *result = state->orig.out.result;
7046
7047         tevent_req_received(req);
7048         return NT_STATUS_OK;
7049 }
7050
7051 NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli,
7052                                   TALLOC_CTX *mem_ctx,
7053                                   WERROR *werror)
7054 {
7055         struct PNP_GetResDesData r;
7056         NTSTATUS status;
7057
7058         /* In parameters */
7059
7060         status = cli->dispatch(cli,
7061                                 mem_ctx,
7062                                 &ndr_table_ntsvcs,
7063                                 NDR_PNP_GETRESDESDATA,
7064                                 &r);
7065
7066         if (!NT_STATUS_IS_OK(status)) {
7067                 return status;
7068         }
7069
7070         if (NT_STATUS_IS_ERR(status)) {
7071                 return status;
7072         }
7073
7074         /* Return variables */
7075
7076         /* Return result */
7077         if (werror) {
7078                 *werror = r.out.result;
7079         }
7080
7081         return werror_to_ntstatus(r.out.result);
7082 }
7083
7084 struct rpccli_PNP_GetResDesDataSize_state {
7085         struct PNP_GetResDesDataSize orig;
7086         struct PNP_GetResDesDataSize tmp;
7087         TALLOC_CTX *out_mem_ctx;
7088         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7089 };
7090
7091 static void rpccli_PNP_GetResDesDataSize_done(struct tevent_req *subreq);
7092
7093 struct tevent_req *rpccli_PNP_GetResDesDataSize_send(TALLOC_CTX *mem_ctx,
7094                                                      struct tevent_context *ev,
7095                                                      struct rpc_pipe_client *cli)
7096 {
7097         struct tevent_req *req;
7098         struct rpccli_PNP_GetResDesDataSize_state *state;
7099         struct tevent_req *subreq;
7100
7101         req = tevent_req_create(mem_ctx, &state,
7102                                 struct rpccli_PNP_GetResDesDataSize_state);
7103         if (req == NULL) {
7104                 return NULL;
7105         }
7106         state->out_mem_ctx = NULL;
7107         state->dispatch_recv = cli->dispatch_recv;
7108
7109         /* In parameters */
7110
7111         /* Out parameters */
7112
7113         /* Result */
7114         ZERO_STRUCT(state->orig.out.result);
7115
7116         /* make a temporary copy, that we pass to the dispatch function */
7117         state->tmp = state->orig;
7118
7119         subreq = cli->dispatch_send(state, ev, cli,
7120                                     &ndr_table_ntsvcs,
7121                                     NDR_PNP_GETRESDESDATASIZE,
7122                                     &state->tmp);
7123         if (tevent_req_nomem(subreq, req)) {
7124                 return tevent_req_post(req, ev);
7125         }
7126         tevent_req_set_callback(subreq, rpccli_PNP_GetResDesDataSize_done, req);
7127         return req;
7128 }
7129
7130 static void rpccli_PNP_GetResDesDataSize_done(struct tevent_req *subreq)
7131 {
7132         struct tevent_req *req = tevent_req_callback_data(
7133                 subreq, struct tevent_req);
7134         struct rpccli_PNP_GetResDesDataSize_state *state = tevent_req_data(
7135                 req, struct rpccli_PNP_GetResDesDataSize_state);
7136         NTSTATUS status;
7137         TALLOC_CTX *mem_ctx;
7138
7139         if (state->out_mem_ctx) {
7140                 mem_ctx = state->out_mem_ctx;
7141         } else {
7142                 mem_ctx = state;
7143         }
7144
7145         status = state->dispatch_recv(subreq, mem_ctx);
7146         TALLOC_FREE(subreq);
7147         if (!NT_STATUS_IS_OK(status)) {
7148                 tevent_req_nterror(req, status);
7149                 return;
7150         }
7151
7152         /* Copy out parameters */
7153
7154         /* Copy result */
7155         state->orig.out.result = state->tmp.out.result;
7156
7157         /* Reset temporary structure */
7158         ZERO_STRUCT(state->tmp);
7159
7160         tevent_req_done(req);
7161 }
7162
7163 NTSTATUS rpccli_PNP_GetResDesDataSize_recv(struct tevent_req *req,
7164                                            TALLOC_CTX *mem_ctx,
7165                                            WERROR *result)
7166 {
7167         struct rpccli_PNP_GetResDesDataSize_state *state = tevent_req_data(
7168                 req, struct rpccli_PNP_GetResDesDataSize_state);
7169         NTSTATUS status;
7170
7171         if (tevent_req_is_nterror(req, &status)) {
7172                 tevent_req_received(req);
7173                 return status;
7174         }
7175
7176         /* Steal possbile out parameters to the callers context */
7177         talloc_steal(mem_ctx, state->out_mem_ctx);
7178
7179         /* Return result */
7180         *result = state->orig.out.result;
7181
7182         tevent_req_received(req);
7183         return NT_STATUS_OK;
7184 }
7185
7186 NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli,
7187                                       TALLOC_CTX *mem_ctx,
7188                                       WERROR *werror)
7189 {
7190         struct PNP_GetResDesDataSize r;
7191         NTSTATUS status;
7192
7193         /* In parameters */
7194
7195         status = cli->dispatch(cli,
7196                                 mem_ctx,
7197                                 &ndr_table_ntsvcs,
7198                                 NDR_PNP_GETRESDESDATASIZE,
7199                                 &r);
7200
7201         if (!NT_STATUS_IS_OK(status)) {
7202                 return status;
7203         }
7204
7205         if (NT_STATUS_IS_ERR(status)) {
7206                 return status;
7207         }
7208
7209         /* Return variables */
7210
7211         /* Return result */
7212         if (werror) {
7213                 *werror = r.out.result;
7214         }
7215
7216         return werror_to_ntstatus(r.out.result);
7217 }
7218
7219 struct rpccli_PNP_ModifyResDes_state {
7220         struct PNP_ModifyResDes orig;
7221         struct PNP_ModifyResDes tmp;
7222         TALLOC_CTX *out_mem_ctx;
7223         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7224 };
7225
7226 static void rpccli_PNP_ModifyResDes_done(struct tevent_req *subreq);
7227
7228 struct tevent_req *rpccli_PNP_ModifyResDes_send(TALLOC_CTX *mem_ctx,
7229                                                 struct tevent_context *ev,
7230                                                 struct rpc_pipe_client *cli)
7231 {
7232         struct tevent_req *req;
7233         struct rpccli_PNP_ModifyResDes_state *state;
7234         struct tevent_req *subreq;
7235
7236         req = tevent_req_create(mem_ctx, &state,
7237                                 struct rpccli_PNP_ModifyResDes_state);
7238         if (req == NULL) {
7239                 return NULL;
7240         }
7241         state->out_mem_ctx = NULL;
7242         state->dispatch_recv = cli->dispatch_recv;
7243
7244         /* In parameters */
7245
7246         /* Out parameters */
7247
7248         /* Result */
7249         ZERO_STRUCT(state->orig.out.result);
7250
7251         /* make a temporary copy, that we pass to the dispatch function */
7252         state->tmp = state->orig;
7253
7254         subreq = cli->dispatch_send(state, ev, cli,
7255                                     &ndr_table_ntsvcs,
7256                                     NDR_PNP_MODIFYRESDES,
7257                                     &state->tmp);
7258         if (tevent_req_nomem(subreq, req)) {
7259                 return tevent_req_post(req, ev);
7260         }
7261         tevent_req_set_callback(subreq, rpccli_PNP_ModifyResDes_done, req);
7262         return req;
7263 }
7264
7265 static void rpccli_PNP_ModifyResDes_done(struct tevent_req *subreq)
7266 {
7267         struct tevent_req *req = tevent_req_callback_data(
7268                 subreq, struct tevent_req);
7269         struct rpccli_PNP_ModifyResDes_state *state = tevent_req_data(
7270                 req, struct rpccli_PNP_ModifyResDes_state);
7271         NTSTATUS status;
7272         TALLOC_CTX *mem_ctx;
7273
7274         if (state->out_mem_ctx) {
7275                 mem_ctx = state->out_mem_ctx;
7276         } else {
7277                 mem_ctx = state;
7278         }
7279
7280         status = state->dispatch_recv(subreq, mem_ctx);
7281         TALLOC_FREE(subreq);
7282         if (!NT_STATUS_IS_OK(status)) {
7283                 tevent_req_nterror(req, status);
7284                 return;
7285         }
7286
7287         /* Copy out parameters */
7288
7289         /* Copy result */
7290         state->orig.out.result = state->tmp.out.result;
7291
7292         /* Reset temporary structure */
7293         ZERO_STRUCT(state->tmp);
7294
7295         tevent_req_done(req);
7296 }
7297
7298 NTSTATUS rpccli_PNP_ModifyResDes_recv(struct tevent_req *req,
7299                                       TALLOC_CTX *mem_ctx,
7300                                       WERROR *result)
7301 {
7302         struct rpccli_PNP_ModifyResDes_state *state = tevent_req_data(
7303                 req, struct rpccli_PNP_ModifyResDes_state);
7304         NTSTATUS status;
7305
7306         if (tevent_req_is_nterror(req, &status)) {
7307                 tevent_req_received(req);
7308                 return status;
7309         }
7310
7311         /* Steal possbile out parameters to the callers context */
7312         talloc_steal(mem_ctx, state->out_mem_ctx);
7313
7314         /* Return result */
7315         *result = state->orig.out.result;
7316
7317         tevent_req_received(req);
7318         return NT_STATUS_OK;
7319 }
7320
7321 NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli,
7322                                  TALLOC_CTX *mem_ctx,
7323                                  WERROR *werror)
7324 {
7325         struct PNP_ModifyResDes r;
7326         NTSTATUS status;
7327
7328         /* In parameters */
7329
7330         status = cli->dispatch(cli,
7331                                 mem_ctx,
7332                                 &ndr_table_ntsvcs,
7333                                 NDR_PNP_MODIFYRESDES,
7334                                 &r);
7335
7336         if (!NT_STATUS_IS_OK(status)) {
7337                 return status;
7338         }
7339
7340         if (NT_STATUS_IS_ERR(status)) {
7341                 return status;
7342         }
7343
7344         /* Return variables */
7345
7346         /* Return result */
7347         if (werror) {
7348                 *werror = r.out.result;
7349         }
7350
7351         return werror_to_ntstatus(r.out.result);
7352 }
7353
7354 struct rpccli_PNP_DetectResourceLimit_state {
7355         struct PNP_DetectResourceLimit orig;
7356         struct PNP_DetectResourceLimit tmp;
7357         TALLOC_CTX *out_mem_ctx;
7358         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7359 };
7360
7361 static void rpccli_PNP_DetectResourceLimit_done(struct tevent_req *subreq);
7362
7363 struct tevent_req *rpccli_PNP_DetectResourceLimit_send(TALLOC_CTX *mem_ctx,
7364                                                        struct tevent_context *ev,
7365                                                        struct rpc_pipe_client *cli)
7366 {
7367         struct tevent_req *req;
7368         struct rpccli_PNP_DetectResourceLimit_state *state;
7369         struct tevent_req *subreq;
7370
7371         req = tevent_req_create(mem_ctx, &state,
7372                                 struct rpccli_PNP_DetectResourceLimit_state);
7373         if (req == NULL) {
7374                 return NULL;
7375         }
7376         state->out_mem_ctx = NULL;
7377         state->dispatch_recv = cli->dispatch_recv;
7378
7379         /* In parameters */
7380
7381         /* Out parameters */
7382
7383         /* Result */
7384         ZERO_STRUCT(state->orig.out.result);
7385
7386         /* make a temporary copy, that we pass to the dispatch function */
7387         state->tmp = state->orig;
7388
7389         subreq = cli->dispatch_send(state, ev, cli,
7390                                     &ndr_table_ntsvcs,
7391                                     NDR_PNP_DETECTRESOURCELIMIT,
7392                                     &state->tmp);
7393         if (tevent_req_nomem(subreq, req)) {
7394                 return tevent_req_post(req, ev);
7395         }
7396         tevent_req_set_callback(subreq, rpccli_PNP_DetectResourceLimit_done, req);
7397         return req;
7398 }
7399
7400 static void rpccli_PNP_DetectResourceLimit_done(struct tevent_req *subreq)
7401 {
7402         struct tevent_req *req = tevent_req_callback_data(
7403                 subreq, struct tevent_req);
7404         struct rpccli_PNP_DetectResourceLimit_state *state = tevent_req_data(
7405                 req, struct rpccli_PNP_DetectResourceLimit_state);
7406         NTSTATUS status;
7407         TALLOC_CTX *mem_ctx;
7408
7409         if (state->out_mem_ctx) {
7410                 mem_ctx = state->out_mem_ctx;
7411         } else {
7412                 mem_ctx = state;
7413         }
7414
7415         status = state->dispatch_recv(subreq, mem_ctx);
7416         TALLOC_FREE(subreq);
7417         if (!NT_STATUS_IS_OK(status)) {
7418                 tevent_req_nterror(req, status);
7419                 return;
7420         }
7421
7422         /* Copy out parameters */
7423
7424         /* Copy result */
7425         state->orig.out.result = state->tmp.out.result;
7426
7427         /* Reset temporary structure */
7428         ZERO_STRUCT(state->tmp);
7429
7430         tevent_req_done(req);
7431 }
7432
7433 NTSTATUS rpccli_PNP_DetectResourceLimit_recv(struct tevent_req *req,
7434                                              TALLOC_CTX *mem_ctx,
7435                                              WERROR *result)
7436 {
7437         struct rpccli_PNP_DetectResourceLimit_state *state = tevent_req_data(
7438                 req, struct rpccli_PNP_DetectResourceLimit_state);
7439         NTSTATUS status;
7440
7441         if (tevent_req_is_nterror(req, &status)) {
7442                 tevent_req_received(req);
7443                 return status;
7444         }
7445
7446         /* Steal possbile out parameters to the callers context */
7447         talloc_steal(mem_ctx, state->out_mem_ctx);
7448
7449         /* Return result */
7450         *result = state->orig.out.result;
7451
7452         tevent_req_received(req);
7453         return NT_STATUS_OK;
7454 }
7455
7456 NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli,
7457                                         TALLOC_CTX *mem_ctx,
7458                                         WERROR *werror)
7459 {
7460         struct PNP_DetectResourceLimit r;
7461         NTSTATUS status;
7462
7463         /* In parameters */
7464
7465         status = cli->dispatch(cli,
7466                                 mem_ctx,
7467                                 &ndr_table_ntsvcs,
7468                                 NDR_PNP_DETECTRESOURCELIMIT,
7469                                 &r);
7470
7471         if (!NT_STATUS_IS_OK(status)) {
7472                 return status;
7473         }
7474
7475         if (NT_STATUS_IS_ERR(status)) {
7476                 return status;
7477         }
7478
7479         /* Return variables */
7480
7481         /* Return result */
7482         if (werror) {
7483                 *werror = r.out.result;
7484         }
7485
7486         return werror_to_ntstatus(r.out.result);
7487 }
7488
7489 struct rpccli_PNP_QueryResConfList_state {
7490         struct PNP_QueryResConfList orig;
7491         struct PNP_QueryResConfList tmp;
7492         TALLOC_CTX *out_mem_ctx;
7493         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7494 };
7495
7496 static void rpccli_PNP_QueryResConfList_done(struct tevent_req *subreq);
7497
7498 struct tevent_req *rpccli_PNP_QueryResConfList_send(TALLOC_CTX *mem_ctx,
7499                                                     struct tevent_context *ev,
7500                                                     struct rpc_pipe_client *cli)
7501 {
7502         struct tevent_req *req;
7503         struct rpccli_PNP_QueryResConfList_state *state;
7504         struct tevent_req *subreq;
7505
7506         req = tevent_req_create(mem_ctx, &state,
7507                                 struct rpccli_PNP_QueryResConfList_state);
7508         if (req == NULL) {
7509                 return NULL;
7510         }
7511         state->out_mem_ctx = NULL;
7512         state->dispatch_recv = cli->dispatch_recv;
7513
7514         /* In parameters */
7515
7516         /* Out parameters */
7517
7518         /* Result */
7519         ZERO_STRUCT(state->orig.out.result);
7520
7521         /* make a temporary copy, that we pass to the dispatch function */
7522         state->tmp = state->orig;
7523
7524         subreq = cli->dispatch_send(state, ev, cli,
7525                                     &ndr_table_ntsvcs,
7526                                     NDR_PNP_QUERYRESCONFLIST,
7527                                     &state->tmp);
7528         if (tevent_req_nomem(subreq, req)) {
7529                 return tevent_req_post(req, ev);
7530         }
7531         tevent_req_set_callback(subreq, rpccli_PNP_QueryResConfList_done, req);
7532         return req;
7533 }
7534
7535 static void rpccli_PNP_QueryResConfList_done(struct tevent_req *subreq)
7536 {
7537         struct tevent_req *req = tevent_req_callback_data(
7538                 subreq, struct tevent_req);
7539         struct rpccli_PNP_QueryResConfList_state *state = tevent_req_data(
7540                 req, struct rpccli_PNP_QueryResConfList_state);
7541         NTSTATUS status;
7542         TALLOC_CTX *mem_ctx;
7543
7544         if (state->out_mem_ctx) {
7545                 mem_ctx = state->out_mem_ctx;
7546         } else {
7547                 mem_ctx = state;
7548         }
7549
7550         status = state->dispatch_recv(subreq, mem_ctx);
7551         TALLOC_FREE(subreq);
7552         if (!NT_STATUS_IS_OK(status)) {
7553                 tevent_req_nterror(req, status);
7554                 return;
7555         }
7556
7557         /* Copy out parameters */
7558
7559         /* Copy result */
7560         state->orig.out.result = state->tmp.out.result;
7561
7562         /* Reset temporary structure */
7563         ZERO_STRUCT(state->tmp);
7564
7565         tevent_req_done(req);
7566 }
7567
7568 NTSTATUS rpccli_PNP_QueryResConfList_recv(struct tevent_req *req,
7569                                           TALLOC_CTX *mem_ctx,
7570                                           WERROR *result)
7571 {
7572         struct rpccli_PNP_QueryResConfList_state *state = tevent_req_data(
7573                 req, struct rpccli_PNP_QueryResConfList_state);
7574         NTSTATUS status;
7575
7576         if (tevent_req_is_nterror(req, &status)) {
7577                 tevent_req_received(req);
7578                 return status;
7579         }
7580
7581         /* Steal possbile out parameters to the callers context */
7582         talloc_steal(mem_ctx, state->out_mem_ctx);
7583
7584         /* Return result */
7585         *result = state->orig.out.result;
7586
7587         tevent_req_received(req);
7588         return NT_STATUS_OK;
7589 }
7590
7591 NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli,
7592                                      TALLOC_CTX *mem_ctx,
7593                                      WERROR *werror)
7594 {
7595         struct PNP_QueryResConfList r;
7596         NTSTATUS status;
7597
7598         /* In parameters */
7599
7600         status = cli->dispatch(cli,
7601                                 mem_ctx,
7602                                 &ndr_table_ntsvcs,
7603                                 NDR_PNP_QUERYRESCONFLIST,
7604                                 &r);
7605
7606         if (!NT_STATUS_IS_OK(status)) {
7607                 return status;
7608         }
7609
7610         if (NT_STATUS_IS_ERR(status)) {
7611                 return status;
7612         }
7613
7614         /* Return variables */
7615
7616         /* Return result */
7617         if (werror) {
7618                 *werror = r.out.result;
7619         }
7620
7621         return werror_to_ntstatus(r.out.result);
7622 }
7623
7624 struct rpccli_PNP_SetHwProf_state {
7625         struct PNP_SetHwProf orig;
7626         struct PNP_SetHwProf tmp;
7627         TALLOC_CTX *out_mem_ctx;
7628         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7629 };
7630
7631 static void rpccli_PNP_SetHwProf_done(struct tevent_req *subreq);
7632
7633 struct tevent_req *rpccli_PNP_SetHwProf_send(TALLOC_CTX *mem_ctx,
7634                                              struct tevent_context *ev,
7635                                              struct rpc_pipe_client *cli)
7636 {
7637         struct tevent_req *req;
7638         struct rpccli_PNP_SetHwProf_state *state;
7639         struct tevent_req *subreq;
7640
7641         req = tevent_req_create(mem_ctx, &state,
7642                                 struct rpccli_PNP_SetHwProf_state);
7643         if (req == NULL) {
7644                 return NULL;
7645         }
7646         state->out_mem_ctx = NULL;
7647         state->dispatch_recv = cli->dispatch_recv;
7648
7649         /* In parameters */
7650
7651         /* Out parameters */
7652
7653         /* Result */
7654         ZERO_STRUCT(state->orig.out.result);
7655
7656         /* make a temporary copy, that we pass to the dispatch function */
7657         state->tmp = state->orig;
7658
7659         subreq = cli->dispatch_send(state, ev, cli,
7660                                     &ndr_table_ntsvcs,
7661                                     NDR_PNP_SETHWPROF,
7662                                     &state->tmp);
7663         if (tevent_req_nomem(subreq, req)) {
7664                 return tevent_req_post(req, ev);
7665         }
7666         tevent_req_set_callback(subreq, rpccli_PNP_SetHwProf_done, req);
7667         return req;
7668 }
7669
7670 static void rpccli_PNP_SetHwProf_done(struct tevent_req *subreq)
7671 {
7672         struct tevent_req *req = tevent_req_callback_data(
7673                 subreq, struct tevent_req);
7674         struct rpccli_PNP_SetHwProf_state *state = tevent_req_data(
7675                 req, struct rpccli_PNP_SetHwProf_state);
7676         NTSTATUS status;
7677         TALLOC_CTX *mem_ctx;
7678
7679         if (state->out_mem_ctx) {
7680                 mem_ctx = state->out_mem_ctx;
7681         } else {
7682                 mem_ctx = state;
7683         }
7684
7685         status = state->dispatch_recv(subreq, mem_ctx);
7686         TALLOC_FREE(subreq);
7687         if (!NT_STATUS_IS_OK(status)) {
7688                 tevent_req_nterror(req, status);
7689                 return;
7690         }
7691
7692         /* Copy out parameters */
7693
7694         /* Copy result */
7695         state->orig.out.result = state->tmp.out.result;
7696
7697         /* Reset temporary structure */
7698         ZERO_STRUCT(state->tmp);
7699
7700         tevent_req_done(req);
7701 }
7702
7703 NTSTATUS rpccli_PNP_SetHwProf_recv(struct tevent_req *req,
7704                                    TALLOC_CTX *mem_ctx,
7705                                    WERROR *result)
7706 {
7707         struct rpccli_PNP_SetHwProf_state *state = tevent_req_data(
7708                 req, struct rpccli_PNP_SetHwProf_state);
7709         NTSTATUS status;
7710
7711         if (tevent_req_is_nterror(req, &status)) {
7712                 tevent_req_received(req);
7713                 return status;
7714         }
7715
7716         /* Steal possbile out parameters to the callers context */
7717         talloc_steal(mem_ctx, state->out_mem_ctx);
7718
7719         /* Return result */
7720         *result = state->orig.out.result;
7721
7722         tevent_req_received(req);
7723         return NT_STATUS_OK;
7724 }
7725
7726 NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli,
7727                               TALLOC_CTX *mem_ctx,
7728                               WERROR *werror)
7729 {
7730         struct PNP_SetHwProf r;
7731         NTSTATUS status;
7732
7733         /* In parameters */
7734
7735         status = cli->dispatch(cli,
7736                                 mem_ctx,
7737                                 &ndr_table_ntsvcs,
7738                                 NDR_PNP_SETHWPROF,
7739                                 &r);
7740
7741         if (!NT_STATUS_IS_OK(status)) {
7742                 return status;
7743         }
7744
7745         if (NT_STATUS_IS_ERR(status)) {
7746                 return status;
7747         }
7748
7749         /* Return variables */
7750
7751         /* Return result */
7752         if (werror) {
7753                 *werror = r.out.result;
7754         }
7755
7756         return werror_to_ntstatus(r.out.result);
7757 }
7758
7759 struct rpccli_PNP_QueryArbitratorFreeData_state {
7760         struct PNP_QueryArbitratorFreeData orig;
7761         struct PNP_QueryArbitratorFreeData tmp;
7762         TALLOC_CTX *out_mem_ctx;
7763         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7764 };
7765
7766 static void rpccli_PNP_QueryArbitratorFreeData_done(struct tevent_req *subreq);
7767
7768 struct tevent_req *rpccli_PNP_QueryArbitratorFreeData_send(TALLOC_CTX *mem_ctx,
7769                                                            struct tevent_context *ev,
7770                                                            struct rpc_pipe_client *cli)
7771 {
7772         struct tevent_req *req;
7773         struct rpccli_PNP_QueryArbitratorFreeData_state *state;
7774         struct tevent_req *subreq;
7775
7776         req = tevent_req_create(mem_ctx, &state,
7777                                 struct rpccli_PNP_QueryArbitratorFreeData_state);
7778         if (req == NULL) {
7779                 return NULL;
7780         }
7781         state->out_mem_ctx = NULL;
7782         state->dispatch_recv = cli->dispatch_recv;
7783
7784         /* In parameters */
7785
7786         /* Out parameters */
7787
7788         /* Result */
7789         ZERO_STRUCT(state->orig.out.result);
7790
7791         /* make a temporary copy, that we pass to the dispatch function */
7792         state->tmp = state->orig;
7793
7794         subreq = cli->dispatch_send(state, ev, cli,
7795                                     &ndr_table_ntsvcs,
7796                                     NDR_PNP_QUERYARBITRATORFREEDATA,
7797                                     &state->tmp);
7798         if (tevent_req_nomem(subreq, req)) {
7799                 return tevent_req_post(req, ev);
7800         }
7801         tevent_req_set_callback(subreq, rpccli_PNP_QueryArbitratorFreeData_done, req);
7802         return req;
7803 }
7804
7805 static void rpccli_PNP_QueryArbitratorFreeData_done(struct tevent_req *subreq)
7806 {
7807         struct tevent_req *req = tevent_req_callback_data(
7808                 subreq, struct tevent_req);
7809         struct rpccli_PNP_QueryArbitratorFreeData_state *state = tevent_req_data(
7810                 req, struct rpccli_PNP_QueryArbitratorFreeData_state);
7811         NTSTATUS status;
7812         TALLOC_CTX *mem_ctx;
7813
7814         if (state->out_mem_ctx) {
7815                 mem_ctx = state->out_mem_ctx;
7816         } else {
7817                 mem_ctx = state;
7818         }
7819
7820         status = state->dispatch_recv(subreq, mem_ctx);
7821         TALLOC_FREE(subreq);
7822         if (!NT_STATUS_IS_OK(status)) {
7823                 tevent_req_nterror(req, status);
7824                 return;
7825         }
7826
7827         /* Copy out parameters */
7828
7829         /* Copy result */
7830         state->orig.out.result = state->tmp.out.result;
7831
7832         /* Reset temporary structure */
7833         ZERO_STRUCT(state->tmp);
7834
7835         tevent_req_done(req);
7836 }
7837
7838 NTSTATUS rpccli_PNP_QueryArbitratorFreeData_recv(struct tevent_req *req,
7839                                                  TALLOC_CTX *mem_ctx,
7840                                                  WERROR *result)
7841 {
7842         struct rpccli_PNP_QueryArbitratorFreeData_state *state = tevent_req_data(
7843                 req, struct rpccli_PNP_QueryArbitratorFreeData_state);
7844         NTSTATUS status;
7845
7846         if (tevent_req_is_nterror(req, &status)) {
7847                 tevent_req_received(req);
7848                 return status;
7849         }
7850
7851         /* Steal possbile out parameters to the callers context */
7852         talloc_steal(mem_ctx, state->out_mem_ctx);
7853
7854         /* Return result */
7855         *result = state->orig.out.result;
7856
7857         tevent_req_received(req);
7858         return NT_STATUS_OK;
7859 }
7860
7861 NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli,
7862                                             TALLOC_CTX *mem_ctx,
7863                                             WERROR *werror)
7864 {
7865         struct PNP_QueryArbitratorFreeData r;
7866         NTSTATUS status;
7867
7868         /* In parameters */
7869
7870         status = cli->dispatch(cli,
7871                                 mem_ctx,
7872                                 &ndr_table_ntsvcs,
7873                                 NDR_PNP_QUERYARBITRATORFREEDATA,
7874                                 &r);
7875
7876         if (!NT_STATUS_IS_OK(status)) {
7877                 return status;
7878         }
7879
7880         if (NT_STATUS_IS_ERR(status)) {
7881                 return status;
7882         }
7883
7884         /* Return variables */
7885
7886         /* Return result */
7887         if (werror) {
7888                 *werror = r.out.result;
7889         }
7890
7891         return werror_to_ntstatus(r.out.result);
7892 }
7893
7894 struct rpccli_PNP_QueryArbitratorFreeSize_state {
7895         struct PNP_QueryArbitratorFreeSize orig;
7896         struct PNP_QueryArbitratorFreeSize tmp;
7897         TALLOC_CTX *out_mem_ctx;
7898         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7899 };
7900
7901 static void rpccli_PNP_QueryArbitratorFreeSize_done(struct tevent_req *subreq);
7902
7903 struct tevent_req *rpccli_PNP_QueryArbitratorFreeSize_send(TALLOC_CTX *mem_ctx,
7904                                                            struct tevent_context *ev,
7905                                                            struct rpc_pipe_client *cli)
7906 {
7907         struct tevent_req *req;
7908         struct rpccli_PNP_QueryArbitratorFreeSize_state *state;
7909         struct tevent_req *subreq;
7910
7911         req = tevent_req_create(mem_ctx, &state,
7912                                 struct rpccli_PNP_QueryArbitratorFreeSize_state);
7913         if (req == NULL) {
7914                 return NULL;
7915         }
7916         state->out_mem_ctx = NULL;
7917         state->dispatch_recv = cli->dispatch_recv;
7918
7919         /* In parameters */
7920
7921         /* Out parameters */
7922
7923         /* Result */
7924         ZERO_STRUCT(state->orig.out.result);
7925
7926         /* make a temporary copy, that we pass to the dispatch function */
7927         state->tmp = state->orig;
7928
7929         subreq = cli->dispatch_send(state, ev, cli,
7930                                     &ndr_table_ntsvcs,
7931                                     NDR_PNP_QUERYARBITRATORFREESIZE,
7932                                     &state->tmp);
7933         if (tevent_req_nomem(subreq, req)) {
7934                 return tevent_req_post(req, ev);
7935         }
7936         tevent_req_set_callback(subreq, rpccli_PNP_QueryArbitratorFreeSize_done, req);
7937         return req;
7938 }
7939
7940 static void rpccli_PNP_QueryArbitratorFreeSize_done(struct tevent_req *subreq)
7941 {
7942         struct tevent_req *req = tevent_req_callback_data(
7943                 subreq, struct tevent_req);
7944         struct rpccli_PNP_QueryArbitratorFreeSize_state *state = tevent_req_data(
7945                 req, struct rpccli_PNP_QueryArbitratorFreeSize_state);
7946         NTSTATUS status;
7947         TALLOC_CTX *mem_ctx;
7948
7949         if (state->out_mem_ctx) {
7950                 mem_ctx = state->out_mem_ctx;
7951         } else {
7952                 mem_ctx = state;
7953         }
7954
7955         status = state->dispatch_recv(subreq, mem_ctx);
7956         TALLOC_FREE(subreq);
7957         if (!NT_STATUS_IS_OK(status)) {
7958                 tevent_req_nterror(req, status);
7959                 return;
7960         }
7961
7962         /* Copy out parameters */
7963
7964         /* Copy result */
7965         state->orig.out.result = state->tmp.out.result;
7966
7967         /* Reset temporary structure */
7968         ZERO_STRUCT(state->tmp);
7969
7970         tevent_req_done(req);
7971 }
7972
7973 NTSTATUS rpccli_PNP_QueryArbitratorFreeSize_recv(struct tevent_req *req,
7974                                                  TALLOC_CTX *mem_ctx,
7975                                                  WERROR *result)
7976 {
7977         struct rpccli_PNP_QueryArbitratorFreeSize_state *state = tevent_req_data(
7978                 req, struct rpccli_PNP_QueryArbitratorFreeSize_state);
7979         NTSTATUS status;
7980
7981         if (tevent_req_is_nterror(req, &status)) {
7982                 tevent_req_received(req);
7983                 return status;
7984         }
7985
7986         /* Steal possbile out parameters to the callers context */
7987         talloc_steal(mem_ctx, state->out_mem_ctx);
7988
7989         /* Return result */
7990         *result = state->orig.out.result;
7991
7992         tevent_req_received(req);
7993         return NT_STATUS_OK;
7994 }
7995
7996 NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli,
7997                                             TALLOC_CTX *mem_ctx,
7998                                             WERROR *werror)
7999 {
8000         struct PNP_QueryArbitratorFreeSize r;
8001         NTSTATUS status;
8002
8003         /* In parameters */
8004
8005         status = cli->dispatch(cli,
8006                                 mem_ctx,
8007                                 &ndr_table_ntsvcs,
8008                                 NDR_PNP_QUERYARBITRATORFREESIZE,
8009                                 &r);
8010
8011         if (!NT_STATUS_IS_OK(status)) {
8012                 return status;
8013         }
8014
8015         if (NT_STATUS_IS_ERR(status)) {
8016                 return status;
8017         }
8018
8019         /* Return variables */
8020
8021         /* Return result */
8022         if (werror) {
8023                 *werror = r.out.result;
8024         }
8025
8026         return werror_to_ntstatus(r.out.result);
8027 }
8028
8029 struct rpccli_PNP_RunDetection_state {
8030         struct PNP_RunDetection orig;
8031         struct PNP_RunDetection tmp;
8032         TALLOC_CTX *out_mem_ctx;
8033         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8034 };
8035
8036 static void rpccli_PNP_RunDetection_done(struct tevent_req *subreq);
8037
8038 struct tevent_req *rpccli_PNP_RunDetection_send(TALLOC_CTX *mem_ctx,
8039                                                 struct tevent_context *ev,
8040                                                 struct rpc_pipe_client *cli)
8041 {
8042         struct tevent_req *req;
8043         struct rpccli_PNP_RunDetection_state *state;
8044         struct tevent_req *subreq;
8045
8046         req = tevent_req_create(mem_ctx, &state,
8047                                 struct rpccli_PNP_RunDetection_state);
8048         if (req == NULL) {
8049                 return NULL;
8050         }
8051         state->out_mem_ctx = NULL;
8052         state->dispatch_recv = cli->dispatch_recv;
8053
8054         /* In parameters */
8055
8056         /* Out parameters */
8057
8058         /* Result */
8059         ZERO_STRUCT(state->orig.out.result);
8060
8061         /* make a temporary copy, that we pass to the dispatch function */
8062         state->tmp = state->orig;
8063
8064         subreq = cli->dispatch_send(state, ev, cli,
8065                                     &ndr_table_ntsvcs,
8066                                     NDR_PNP_RUNDETECTION,
8067                                     &state->tmp);
8068         if (tevent_req_nomem(subreq, req)) {
8069                 return tevent_req_post(req, ev);
8070         }
8071         tevent_req_set_callback(subreq, rpccli_PNP_RunDetection_done, req);
8072         return req;
8073 }
8074
8075 static void rpccli_PNP_RunDetection_done(struct tevent_req *subreq)
8076 {
8077         struct tevent_req *req = tevent_req_callback_data(
8078                 subreq, struct tevent_req);
8079         struct rpccli_PNP_RunDetection_state *state = tevent_req_data(
8080                 req, struct rpccli_PNP_RunDetection_state);
8081         NTSTATUS status;
8082         TALLOC_CTX *mem_ctx;
8083
8084         if (state->out_mem_ctx) {
8085                 mem_ctx = state->out_mem_ctx;
8086         } else {
8087                 mem_ctx = state;
8088         }
8089
8090         status = state->dispatch_recv(subreq, mem_ctx);
8091         TALLOC_FREE(subreq);
8092         if (!NT_STATUS_IS_OK(status)) {
8093                 tevent_req_nterror(req, status);
8094                 return;
8095         }
8096
8097         /* Copy out parameters */
8098
8099         /* Copy result */
8100         state->orig.out.result = state->tmp.out.result;
8101
8102         /* Reset temporary structure */
8103         ZERO_STRUCT(state->tmp);
8104
8105         tevent_req_done(req);
8106 }
8107
8108 NTSTATUS rpccli_PNP_RunDetection_recv(struct tevent_req *req,
8109                                       TALLOC_CTX *mem_ctx,
8110                                       WERROR *result)
8111 {
8112         struct rpccli_PNP_RunDetection_state *state = tevent_req_data(
8113                 req, struct rpccli_PNP_RunDetection_state);
8114         NTSTATUS status;
8115
8116         if (tevent_req_is_nterror(req, &status)) {
8117                 tevent_req_received(req);
8118                 return status;
8119         }
8120
8121         /* Steal possbile out parameters to the callers context */
8122         talloc_steal(mem_ctx, state->out_mem_ctx);
8123
8124         /* Return result */
8125         *result = state->orig.out.result;
8126
8127         tevent_req_received(req);
8128         return NT_STATUS_OK;
8129 }
8130
8131 NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli,
8132                                  TALLOC_CTX *mem_ctx,
8133                                  WERROR *werror)
8134 {
8135         struct PNP_RunDetection r;
8136         NTSTATUS status;
8137
8138         /* In parameters */
8139
8140         status = cli->dispatch(cli,
8141                                 mem_ctx,
8142                                 &ndr_table_ntsvcs,
8143                                 NDR_PNP_RUNDETECTION,
8144                                 &r);
8145
8146         if (!NT_STATUS_IS_OK(status)) {
8147                 return status;
8148         }
8149
8150         if (NT_STATUS_IS_ERR(status)) {
8151                 return status;
8152         }
8153
8154         /* Return variables */
8155
8156         /* Return result */
8157         if (werror) {
8158                 *werror = r.out.result;
8159         }
8160
8161         return werror_to_ntstatus(r.out.result);
8162 }
8163
8164 struct rpccli_PNP_RegisterNotification_state {
8165         struct PNP_RegisterNotification orig;
8166         struct PNP_RegisterNotification tmp;
8167         TALLOC_CTX *out_mem_ctx;
8168         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8169 };
8170
8171 static void rpccli_PNP_RegisterNotification_done(struct tevent_req *subreq);
8172
8173 struct tevent_req *rpccli_PNP_RegisterNotification_send(TALLOC_CTX *mem_ctx,
8174                                                         struct tevent_context *ev,
8175                                                         struct rpc_pipe_client *cli)
8176 {
8177         struct tevent_req *req;
8178         struct rpccli_PNP_RegisterNotification_state *state;
8179         struct tevent_req *subreq;
8180
8181         req = tevent_req_create(mem_ctx, &state,
8182                                 struct rpccli_PNP_RegisterNotification_state);
8183         if (req == NULL) {
8184                 return NULL;
8185         }
8186         state->out_mem_ctx = NULL;
8187         state->dispatch_recv = cli->dispatch_recv;
8188
8189         /* In parameters */
8190
8191         /* Out parameters */
8192
8193         /* Result */
8194         ZERO_STRUCT(state->orig.out.result);
8195
8196         /* make a temporary copy, that we pass to the dispatch function */
8197         state->tmp = state->orig;
8198
8199         subreq = cli->dispatch_send(state, ev, cli,
8200                                     &ndr_table_ntsvcs,
8201                                     NDR_PNP_REGISTERNOTIFICATION,
8202                                     &state->tmp);
8203         if (tevent_req_nomem(subreq, req)) {
8204                 return tevent_req_post(req, ev);
8205         }
8206         tevent_req_set_callback(subreq, rpccli_PNP_RegisterNotification_done, req);
8207         return req;
8208 }
8209
8210 static void rpccli_PNP_RegisterNotification_done(struct tevent_req *subreq)
8211 {
8212         struct tevent_req *req = tevent_req_callback_data(
8213                 subreq, struct tevent_req);
8214         struct rpccli_PNP_RegisterNotification_state *state = tevent_req_data(
8215                 req, struct rpccli_PNP_RegisterNotification_state);
8216         NTSTATUS status;
8217         TALLOC_CTX *mem_ctx;
8218
8219         if (state->out_mem_ctx) {
8220                 mem_ctx = state->out_mem_ctx;
8221         } else {
8222                 mem_ctx = state;
8223         }
8224
8225         status = state->dispatch_recv(subreq, mem_ctx);
8226         TALLOC_FREE(subreq);
8227         if (!NT_STATUS_IS_OK(status)) {
8228                 tevent_req_nterror(req, status);
8229                 return;
8230         }
8231
8232         /* Copy out parameters */
8233
8234         /* Copy result */
8235         state->orig.out.result = state->tmp.out.result;
8236
8237         /* Reset temporary structure */
8238         ZERO_STRUCT(state->tmp);
8239
8240         tevent_req_done(req);
8241 }
8242
8243 NTSTATUS rpccli_PNP_RegisterNotification_recv(struct tevent_req *req,
8244                                               TALLOC_CTX *mem_ctx,
8245                                               WERROR *result)
8246 {
8247         struct rpccli_PNP_RegisterNotification_state *state = tevent_req_data(
8248                 req, struct rpccli_PNP_RegisterNotification_state);
8249         NTSTATUS status;
8250
8251         if (tevent_req_is_nterror(req, &status)) {
8252                 tevent_req_received(req);
8253                 return status;
8254         }
8255
8256         /* Steal possbile out parameters to the callers context */
8257         talloc_steal(mem_ctx, state->out_mem_ctx);
8258
8259         /* Return result */
8260         *result = state->orig.out.result;
8261
8262         tevent_req_received(req);
8263         return NT_STATUS_OK;
8264 }
8265
8266 NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli,
8267                                          TALLOC_CTX *mem_ctx,
8268                                          WERROR *werror)
8269 {
8270         struct PNP_RegisterNotification r;
8271         NTSTATUS status;
8272
8273         /* In parameters */
8274
8275         status = cli->dispatch(cli,
8276                                 mem_ctx,
8277                                 &ndr_table_ntsvcs,
8278                                 NDR_PNP_REGISTERNOTIFICATION,
8279                                 &r);
8280
8281         if (!NT_STATUS_IS_OK(status)) {
8282                 return status;
8283         }
8284
8285         if (NT_STATUS_IS_ERR(status)) {
8286                 return status;
8287         }
8288
8289         /* Return variables */
8290
8291         /* Return result */
8292         if (werror) {
8293                 *werror = r.out.result;
8294         }
8295
8296         return werror_to_ntstatus(r.out.result);
8297 }
8298
8299 struct rpccli_PNP_UnregisterNotification_state {
8300         struct PNP_UnregisterNotification orig;
8301         struct PNP_UnregisterNotification tmp;
8302         TALLOC_CTX *out_mem_ctx;
8303         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8304 };
8305
8306 static void rpccli_PNP_UnregisterNotification_done(struct tevent_req *subreq);
8307
8308 struct tevent_req *rpccli_PNP_UnregisterNotification_send(TALLOC_CTX *mem_ctx,
8309                                                           struct tevent_context *ev,
8310                                                           struct rpc_pipe_client *cli)
8311 {
8312         struct tevent_req *req;
8313         struct rpccli_PNP_UnregisterNotification_state *state;
8314         struct tevent_req *subreq;
8315
8316         req = tevent_req_create(mem_ctx, &state,
8317                                 struct rpccli_PNP_UnregisterNotification_state);
8318         if (req == NULL) {
8319                 return NULL;
8320         }
8321         state->out_mem_ctx = NULL;
8322         state->dispatch_recv = cli->dispatch_recv;
8323
8324         /* In parameters */
8325
8326         /* Out parameters */
8327
8328         /* Result */
8329         ZERO_STRUCT(state->orig.out.result);
8330
8331         /* make a temporary copy, that we pass to the dispatch function */
8332         state->tmp = state->orig;
8333
8334         subreq = cli->dispatch_send(state, ev, cli,
8335                                     &ndr_table_ntsvcs,
8336                                     NDR_PNP_UNREGISTERNOTIFICATION,
8337                                     &state->tmp);
8338         if (tevent_req_nomem(subreq, req)) {
8339                 return tevent_req_post(req, ev);
8340         }
8341         tevent_req_set_callback(subreq, rpccli_PNP_UnregisterNotification_done, req);
8342         return req;
8343 }
8344
8345 static void rpccli_PNP_UnregisterNotification_done(struct tevent_req *subreq)
8346 {
8347         struct tevent_req *req = tevent_req_callback_data(
8348                 subreq, struct tevent_req);
8349         struct rpccli_PNP_UnregisterNotification_state *state = tevent_req_data(
8350                 req, struct rpccli_PNP_UnregisterNotification_state);
8351         NTSTATUS status;
8352         TALLOC_CTX *mem_ctx;
8353
8354         if (state->out_mem_ctx) {
8355                 mem_ctx = state->out_mem_ctx;
8356         } else {
8357                 mem_ctx = state;
8358         }
8359
8360         status = state->dispatch_recv(subreq, mem_ctx);
8361         TALLOC_FREE(subreq);
8362         if (!NT_STATUS_IS_OK(status)) {
8363                 tevent_req_nterror(req, status);
8364                 return;
8365         }
8366
8367         /* Copy out parameters */
8368
8369         /* Copy result */
8370         state->orig.out.result = state->tmp.out.result;
8371
8372         /* Reset temporary structure */
8373         ZERO_STRUCT(state->tmp);
8374
8375         tevent_req_done(req);
8376 }
8377
8378 NTSTATUS rpccli_PNP_UnregisterNotification_recv(struct tevent_req *req,
8379                                                 TALLOC_CTX *mem_ctx,
8380                                                 WERROR *result)
8381 {
8382         struct rpccli_PNP_UnregisterNotification_state *state = tevent_req_data(
8383                 req, struct rpccli_PNP_UnregisterNotification_state);
8384         NTSTATUS status;
8385
8386         if (tevent_req_is_nterror(req, &status)) {
8387                 tevent_req_received(req);
8388                 return status;
8389         }
8390
8391         /* Steal possbile out parameters to the callers context */
8392         talloc_steal(mem_ctx, state->out_mem_ctx);
8393
8394         /* Return result */
8395         *result = state->orig.out.result;
8396
8397         tevent_req_received(req);
8398         return NT_STATUS_OK;
8399 }
8400
8401 NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli,
8402                                            TALLOC_CTX *mem_ctx,
8403                                            WERROR *werror)
8404 {
8405         struct PNP_UnregisterNotification r;
8406         NTSTATUS status;
8407
8408         /* In parameters */
8409
8410         status = cli->dispatch(cli,
8411                                 mem_ctx,
8412                                 &ndr_table_ntsvcs,
8413                                 NDR_PNP_UNREGISTERNOTIFICATION,
8414                                 &r);
8415
8416         if (!NT_STATUS_IS_OK(status)) {
8417                 return status;
8418         }
8419
8420         if (NT_STATUS_IS_ERR(status)) {
8421                 return status;
8422         }
8423
8424         /* Return variables */
8425
8426         /* Return result */
8427         if (werror) {
8428                 *werror = r.out.result;
8429         }
8430
8431         return werror_to_ntstatus(r.out.result);
8432 }
8433
8434 struct rpccli_PNP_GetCustomDevProp_state {
8435         struct PNP_GetCustomDevProp orig;
8436         struct PNP_GetCustomDevProp tmp;
8437         TALLOC_CTX *out_mem_ctx;
8438         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8439 };
8440
8441 static void rpccli_PNP_GetCustomDevProp_done(struct tevent_req *subreq);
8442
8443 struct tevent_req *rpccli_PNP_GetCustomDevProp_send(TALLOC_CTX *mem_ctx,
8444                                                     struct tevent_context *ev,
8445                                                     struct rpc_pipe_client *cli)
8446 {
8447         struct tevent_req *req;
8448         struct rpccli_PNP_GetCustomDevProp_state *state;
8449         struct tevent_req *subreq;
8450
8451         req = tevent_req_create(mem_ctx, &state,
8452                                 struct rpccli_PNP_GetCustomDevProp_state);
8453         if (req == NULL) {
8454                 return NULL;
8455         }
8456         state->out_mem_ctx = NULL;
8457         state->dispatch_recv = cli->dispatch_recv;
8458
8459         /* In parameters */
8460
8461         /* Out parameters */
8462
8463         /* Result */
8464         ZERO_STRUCT(state->orig.out.result);
8465
8466         /* make a temporary copy, that we pass to the dispatch function */
8467         state->tmp = state->orig;
8468
8469         subreq = cli->dispatch_send(state, ev, cli,
8470                                     &ndr_table_ntsvcs,
8471                                     NDR_PNP_GETCUSTOMDEVPROP,
8472                                     &state->tmp);
8473         if (tevent_req_nomem(subreq, req)) {
8474                 return tevent_req_post(req, ev);
8475         }
8476         tevent_req_set_callback(subreq, rpccli_PNP_GetCustomDevProp_done, req);
8477         return req;
8478 }
8479
8480 static void rpccli_PNP_GetCustomDevProp_done(struct tevent_req *subreq)
8481 {
8482         struct tevent_req *req = tevent_req_callback_data(
8483                 subreq, struct tevent_req);
8484         struct rpccli_PNP_GetCustomDevProp_state *state = tevent_req_data(
8485                 req, struct rpccli_PNP_GetCustomDevProp_state);
8486         NTSTATUS status;
8487         TALLOC_CTX *mem_ctx;
8488
8489         if (state->out_mem_ctx) {
8490                 mem_ctx = state->out_mem_ctx;
8491         } else {
8492                 mem_ctx = state;
8493         }
8494
8495         status = state->dispatch_recv(subreq, mem_ctx);
8496         TALLOC_FREE(subreq);
8497         if (!NT_STATUS_IS_OK(status)) {
8498                 tevent_req_nterror(req, status);
8499                 return;
8500         }
8501
8502         /* Copy out parameters */
8503
8504         /* Copy result */
8505         state->orig.out.result = state->tmp.out.result;
8506
8507         /* Reset temporary structure */
8508         ZERO_STRUCT(state->tmp);
8509
8510         tevent_req_done(req);
8511 }
8512
8513 NTSTATUS rpccli_PNP_GetCustomDevProp_recv(struct tevent_req *req,
8514                                           TALLOC_CTX *mem_ctx,
8515                                           WERROR *result)
8516 {
8517         struct rpccli_PNP_GetCustomDevProp_state *state = tevent_req_data(
8518                 req, struct rpccli_PNP_GetCustomDevProp_state);
8519         NTSTATUS status;
8520
8521         if (tevent_req_is_nterror(req, &status)) {
8522                 tevent_req_received(req);
8523                 return status;
8524         }
8525
8526         /* Steal possbile out parameters to the callers context */
8527         talloc_steal(mem_ctx, state->out_mem_ctx);
8528
8529         /* Return result */
8530         *result = state->orig.out.result;
8531
8532         tevent_req_received(req);
8533         return NT_STATUS_OK;
8534 }
8535
8536 NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli,
8537                                      TALLOC_CTX *mem_ctx,
8538                                      WERROR *werror)
8539 {
8540         struct PNP_GetCustomDevProp r;
8541         NTSTATUS status;
8542
8543         /* In parameters */
8544
8545         status = cli->dispatch(cli,
8546                                 mem_ctx,
8547                                 &ndr_table_ntsvcs,
8548                                 NDR_PNP_GETCUSTOMDEVPROP,
8549                                 &r);
8550
8551         if (!NT_STATUS_IS_OK(status)) {
8552                 return status;
8553         }
8554
8555         if (NT_STATUS_IS_ERR(status)) {
8556                 return status;
8557         }
8558
8559         /* Return variables */
8560
8561         /* Return result */
8562         if (werror) {
8563                 *werror = r.out.result;
8564         }
8565
8566         return werror_to_ntstatus(r.out.result);
8567 }
8568
8569 struct rpccli_PNP_GetVersionInternal_state {
8570         struct PNP_GetVersionInternal orig;
8571         struct PNP_GetVersionInternal tmp;
8572         TALLOC_CTX *out_mem_ctx;
8573         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8574 };
8575
8576 static void rpccli_PNP_GetVersionInternal_done(struct tevent_req *subreq);
8577
8578 struct tevent_req *rpccli_PNP_GetVersionInternal_send(TALLOC_CTX *mem_ctx,
8579                                                       struct tevent_context *ev,
8580                                                       struct rpc_pipe_client *cli)
8581 {
8582         struct tevent_req *req;
8583         struct rpccli_PNP_GetVersionInternal_state *state;
8584         struct tevent_req *subreq;
8585
8586         req = tevent_req_create(mem_ctx, &state,
8587                                 struct rpccli_PNP_GetVersionInternal_state);
8588         if (req == NULL) {
8589                 return NULL;
8590         }
8591         state->out_mem_ctx = NULL;
8592         state->dispatch_recv = cli->dispatch_recv;
8593
8594         /* In parameters */
8595
8596         /* Out parameters */
8597
8598         /* Result */
8599         ZERO_STRUCT(state->orig.out.result);
8600
8601         /* make a temporary copy, that we pass to the dispatch function */
8602         state->tmp = state->orig;
8603
8604         subreq = cli->dispatch_send(state, ev, cli,
8605                                     &ndr_table_ntsvcs,
8606                                     NDR_PNP_GETVERSIONINTERNAL,
8607                                     &state->tmp);
8608         if (tevent_req_nomem(subreq, req)) {
8609                 return tevent_req_post(req, ev);
8610         }
8611         tevent_req_set_callback(subreq, rpccli_PNP_GetVersionInternal_done, req);
8612         return req;
8613 }
8614
8615 static void rpccli_PNP_GetVersionInternal_done(struct tevent_req *subreq)
8616 {
8617         struct tevent_req *req = tevent_req_callback_data(
8618                 subreq, struct tevent_req);
8619         struct rpccli_PNP_GetVersionInternal_state *state = tevent_req_data(
8620                 req, struct rpccli_PNP_GetVersionInternal_state);
8621         NTSTATUS status;
8622         TALLOC_CTX *mem_ctx;
8623
8624         if (state->out_mem_ctx) {
8625                 mem_ctx = state->out_mem_ctx;
8626         } else {
8627                 mem_ctx = state;
8628         }
8629
8630         status = state->dispatch_recv(subreq, mem_ctx);
8631         TALLOC_FREE(subreq);
8632         if (!NT_STATUS_IS_OK(status)) {
8633                 tevent_req_nterror(req, status);
8634                 return;
8635         }
8636
8637         /* Copy out parameters */
8638
8639         /* Copy result */
8640         state->orig.out.result = state->tmp.out.result;
8641
8642         /* Reset temporary structure */
8643         ZERO_STRUCT(state->tmp);
8644
8645         tevent_req_done(req);
8646 }
8647
8648 NTSTATUS rpccli_PNP_GetVersionInternal_recv(struct tevent_req *req,
8649                                             TALLOC_CTX *mem_ctx,
8650                                             WERROR *result)
8651 {
8652         struct rpccli_PNP_GetVersionInternal_state *state = tevent_req_data(
8653                 req, struct rpccli_PNP_GetVersionInternal_state);
8654         NTSTATUS status;
8655
8656         if (tevent_req_is_nterror(req, &status)) {
8657                 tevent_req_received(req);
8658                 return status;
8659         }
8660
8661         /* Steal possbile out parameters to the callers context */
8662         talloc_steal(mem_ctx, state->out_mem_ctx);
8663
8664         /* Return result */
8665         *result = state->orig.out.result;
8666
8667         tevent_req_received(req);
8668         return NT_STATUS_OK;
8669 }
8670
8671 NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli,
8672                                        TALLOC_CTX *mem_ctx,
8673                                        WERROR *werror)
8674 {
8675         struct PNP_GetVersionInternal r;
8676         NTSTATUS status;
8677
8678         /* In parameters */
8679
8680         status = cli->dispatch(cli,
8681                                 mem_ctx,
8682                                 &ndr_table_ntsvcs,
8683                                 NDR_PNP_GETVERSIONINTERNAL,
8684                                 &r);
8685
8686         if (!NT_STATUS_IS_OK(status)) {
8687                 return status;
8688         }
8689
8690         if (NT_STATUS_IS_ERR(status)) {
8691                 return status;
8692         }
8693
8694         /* Return variables */
8695
8696         /* Return result */
8697         if (werror) {
8698                 *werror = r.out.result;
8699         }
8700
8701         return werror_to_ntstatus(r.out.result);
8702 }
8703
8704 struct rpccli_PNP_GetBlockedDriverInfo_state {
8705         struct PNP_GetBlockedDriverInfo orig;
8706         struct PNP_GetBlockedDriverInfo tmp;
8707         TALLOC_CTX *out_mem_ctx;
8708         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8709 };
8710
8711 static void rpccli_PNP_GetBlockedDriverInfo_done(struct tevent_req *subreq);
8712
8713 struct tevent_req *rpccli_PNP_GetBlockedDriverInfo_send(TALLOC_CTX *mem_ctx,
8714                                                         struct tevent_context *ev,
8715                                                         struct rpc_pipe_client *cli)
8716 {
8717         struct tevent_req *req;
8718         struct rpccli_PNP_GetBlockedDriverInfo_state *state;
8719         struct tevent_req *subreq;
8720
8721         req = tevent_req_create(mem_ctx, &state,
8722                                 struct rpccli_PNP_GetBlockedDriverInfo_state);
8723         if (req == NULL) {
8724                 return NULL;
8725         }
8726         state->out_mem_ctx = NULL;
8727         state->dispatch_recv = cli->dispatch_recv;
8728
8729         /* In parameters */
8730
8731         /* Out parameters */
8732
8733         /* Result */
8734         ZERO_STRUCT(state->orig.out.result);
8735
8736         /* make a temporary copy, that we pass to the dispatch function */
8737         state->tmp = state->orig;
8738
8739         subreq = cli->dispatch_send(state, ev, cli,
8740                                     &ndr_table_ntsvcs,
8741                                     NDR_PNP_GETBLOCKEDDRIVERINFO,
8742                                     &state->tmp);
8743         if (tevent_req_nomem(subreq, req)) {
8744                 return tevent_req_post(req, ev);
8745         }
8746         tevent_req_set_callback(subreq, rpccli_PNP_GetBlockedDriverInfo_done, req);
8747         return req;
8748 }
8749
8750 static void rpccli_PNP_GetBlockedDriverInfo_done(struct tevent_req *subreq)
8751 {
8752         struct tevent_req *req = tevent_req_callback_data(
8753                 subreq, struct tevent_req);
8754         struct rpccli_PNP_GetBlockedDriverInfo_state *state = tevent_req_data(
8755                 req, struct rpccli_PNP_GetBlockedDriverInfo_state);
8756         NTSTATUS status;
8757         TALLOC_CTX *mem_ctx;
8758
8759         if (state->out_mem_ctx) {
8760                 mem_ctx = state->out_mem_ctx;
8761         } else {
8762                 mem_ctx = state;
8763         }
8764
8765         status = state->dispatch_recv(subreq, mem_ctx);
8766         TALLOC_FREE(subreq);
8767         if (!NT_STATUS_IS_OK(status)) {
8768                 tevent_req_nterror(req, status);
8769                 return;
8770         }
8771
8772         /* Copy out parameters */
8773
8774         /* Copy result */
8775         state->orig.out.result = state->tmp.out.result;
8776
8777         /* Reset temporary structure */
8778         ZERO_STRUCT(state->tmp);
8779
8780         tevent_req_done(req);
8781 }
8782
8783 NTSTATUS rpccli_PNP_GetBlockedDriverInfo_recv(struct tevent_req *req,
8784                                               TALLOC_CTX *mem_ctx,
8785                                               WERROR *result)
8786 {
8787         struct rpccli_PNP_GetBlockedDriverInfo_state *state = tevent_req_data(
8788                 req, struct rpccli_PNP_GetBlockedDriverInfo_state);
8789         NTSTATUS status;
8790
8791         if (tevent_req_is_nterror(req, &status)) {
8792                 tevent_req_received(req);
8793                 return status;
8794         }
8795
8796         /* Steal possbile out parameters to the callers context */
8797         talloc_steal(mem_ctx, state->out_mem_ctx);
8798
8799         /* Return result */
8800         *result = state->orig.out.result;
8801
8802         tevent_req_received(req);
8803         return NT_STATUS_OK;
8804 }
8805
8806 NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli,
8807                                          TALLOC_CTX *mem_ctx,
8808                                          WERROR *werror)
8809 {
8810         struct PNP_GetBlockedDriverInfo r;
8811         NTSTATUS status;
8812
8813         /* In parameters */
8814
8815         status = cli->dispatch(cli,
8816                                 mem_ctx,
8817                                 &ndr_table_ntsvcs,
8818                                 NDR_PNP_GETBLOCKEDDRIVERINFO,
8819                                 &r);
8820
8821         if (!NT_STATUS_IS_OK(status)) {
8822                 return status;
8823         }
8824
8825         if (NT_STATUS_IS_ERR(status)) {
8826                 return status;
8827         }
8828
8829         /* Return variables */
8830
8831         /* Return result */
8832         if (werror) {
8833                 *werror = r.out.result;
8834         }
8835
8836         return werror_to_ntstatus(r.out.result);
8837 }
8838
8839 struct rpccli_PNP_GetServerSideDeviceInstallFlags_state {
8840         struct PNP_GetServerSideDeviceInstallFlags orig;
8841         struct PNP_GetServerSideDeviceInstallFlags tmp;
8842         TALLOC_CTX *out_mem_ctx;
8843         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8844 };
8845
8846 static void rpccli_PNP_GetServerSideDeviceInstallFlags_done(struct tevent_req *subreq);
8847
8848 struct tevent_req *rpccli_PNP_GetServerSideDeviceInstallFlags_send(TALLOC_CTX *mem_ctx,
8849                                                                    struct tevent_context *ev,
8850                                                                    struct rpc_pipe_client *cli)
8851 {
8852         struct tevent_req *req;
8853         struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state;
8854         struct tevent_req *subreq;
8855
8856         req = tevent_req_create(mem_ctx, &state,
8857                                 struct rpccli_PNP_GetServerSideDeviceInstallFlags_state);
8858         if (req == NULL) {
8859                 return NULL;
8860         }
8861         state->out_mem_ctx = NULL;
8862         state->dispatch_recv = cli->dispatch_recv;
8863
8864         /* In parameters */
8865
8866         /* Out parameters */
8867
8868         /* Result */
8869         ZERO_STRUCT(state->orig.out.result);
8870
8871         /* make a temporary copy, that we pass to the dispatch function */
8872         state->tmp = state->orig;
8873
8874         subreq = cli->dispatch_send(state, ev, cli,
8875                                     &ndr_table_ntsvcs,
8876                                     NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS,
8877                                     &state->tmp);
8878         if (tevent_req_nomem(subreq, req)) {
8879                 return tevent_req_post(req, ev);
8880         }
8881         tevent_req_set_callback(subreq, rpccli_PNP_GetServerSideDeviceInstallFlags_done, req);
8882         return req;
8883 }
8884
8885 static void rpccli_PNP_GetServerSideDeviceInstallFlags_done(struct tevent_req *subreq)
8886 {
8887         struct tevent_req *req = tevent_req_callback_data(
8888                 subreq, struct tevent_req);
8889         struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state = tevent_req_data(
8890                 req, struct rpccli_PNP_GetServerSideDeviceInstallFlags_state);
8891         NTSTATUS status;
8892         TALLOC_CTX *mem_ctx;
8893
8894         if (state->out_mem_ctx) {
8895                 mem_ctx = state->out_mem_ctx;
8896         } else {
8897                 mem_ctx = state;
8898         }
8899
8900         status = state->dispatch_recv(subreq, mem_ctx);
8901         TALLOC_FREE(subreq);
8902         if (!NT_STATUS_IS_OK(status)) {
8903                 tevent_req_nterror(req, status);
8904                 return;
8905         }
8906
8907         /* Copy out parameters */
8908
8909         /* Copy result */
8910         state->orig.out.result = state->tmp.out.result;
8911
8912         /* Reset temporary structure */
8913         ZERO_STRUCT(state->tmp);
8914
8915         tevent_req_done(req);
8916 }
8917
8918 NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags_recv(struct tevent_req *req,
8919                                                          TALLOC_CTX *mem_ctx,
8920                                                          WERROR *result)
8921 {
8922         struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state = tevent_req_data(
8923                 req, struct rpccli_PNP_GetServerSideDeviceInstallFlags_state);
8924         NTSTATUS status;
8925
8926         if (tevent_req_is_nterror(req, &status)) {
8927                 tevent_req_received(req);
8928                 return status;
8929         }
8930
8931         /* Steal possbile out parameters to the callers context */
8932         talloc_steal(mem_ctx, state->out_mem_ctx);
8933
8934         /* Return result */
8935         *result = state->orig.out.result;
8936
8937         tevent_req_received(req);
8938         return NT_STATUS_OK;
8939 }
8940
8941 NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli,
8942                                                     TALLOC_CTX *mem_ctx,
8943                                                     WERROR *werror)
8944 {
8945         struct PNP_GetServerSideDeviceInstallFlags r;
8946         NTSTATUS status;
8947
8948         /* In parameters */
8949
8950         status = cli->dispatch(cli,
8951                                 mem_ctx,
8952                                 &ndr_table_ntsvcs,
8953                                 NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS,
8954                                 &r);
8955
8956         if (!NT_STATUS_IS_OK(status)) {
8957                 return status;
8958         }
8959
8960         if (NT_STATUS_IS_ERR(status)) {
8961                 return status;
8962         }
8963
8964         /* Return variables */
8965
8966         /* Return result */
8967         if (werror) {
8968                 *werror = r.out.result;
8969         }
8970
8971         return werror_to_ntstatus(r.out.result);
8972 }
8973