git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / librpc / gen_ndr / ndr_fsrvp_c.c
1 /* client functions auto-generated by pidl */
2
3 #include "includes.h"
4 #include <tevent.h>
5 #include "lib/util/tevent_ntstatus.h"
6 #include "bin/default/librpc/gen_ndr/ndr_fsrvp.h"
7 #include "bin/default/librpc/gen_ndr/ndr_fsrvp_c.h"
8
9 /* FileServerVssAgent - client functions generated by pidl */
10
11 struct dcerpc_fss_GetSupportedVersion_r_state {
12         TALLOC_CTX *out_mem_ctx;
13 };
14
15 static void dcerpc_fss_GetSupportedVersion_r_done(struct tevent_req *subreq);
16
17 struct tevent_req *dcerpc_fss_GetSupportedVersion_r_send(TALLOC_CTX *mem_ctx,
18         struct tevent_context *ev,
19         struct dcerpc_binding_handle *h,
20         struct fss_GetSupportedVersion *r)
21 {
22         struct tevent_req *req;
23         struct dcerpc_fss_GetSupportedVersion_r_state *state;
24         struct tevent_req *subreq;
25
26         req = tevent_req_create(mem_ctx, &state,
27                                 struct dcerpc_fss_GetSupportedVersion_r_state);
28         if (req == NULL) {
29                 return NULL;
30         }
31
32         state->out_mem_ctx = talloc_new(state);
33         if (tevent_req_nomem(state->out_mem_ctx, req)) {
34                 return tevent_req_post(req, ev);
35         }
36
37         subreq = dcerpc_binding_handle_call_send(state, ev, h,
38                         NULL, &ndr_table_FileServerVssAgent,
39                         NDR_FSS_GETSUPPORTEDVERSION, state->out_mem_ctx, r);
40         if (tevent_req_nomem(subreq, req)) {
41                 return tevent_req_post(req, ev);
42         }
43         tevent_req_set_callback(subreq, dcerpc_fss_GetSupportedVersion_r_done, req);
44
45         return req;
46 }
47
48 static void dcerpc_fss_GetSupportedVersion_r_done(struct tevent_req *subreq)
49 {
50         struct tevent_req *req =
51                 tevent_req_callback_data(subreq,
52                 struct tevent_req);
53         NTSTATUS status;
54
55         status = dcerpc_binding_handle_call_recv(subreq);
56         TALLOC_FREE(subreq);
57         if (tevent_req_nterror(req, status)) {
58                 return;
59         }
60
61         tevent_req_done(req);
62 }
63
64 NTSTATUS dcerpc_fss_GetSupportedVersion_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
65 {
66         struct dcerpc_fss_GetSupportedVersion_r_state *state =
67                 tevent_req_data(req,
68                 struct dcerpc_fss_GetSupportedVersion_r_state);
69         NTSTATUS status;
70
71         if (tevent_req_is_nterror(req, &status)) {
72                 tevent_req_received(req);
73                 return status;
74         }
75
76         talloc_steal(mem_ctx, state->out_mem_ctx);
77
78         tevent_req_received(req);
79         return NT_STATUS_OK;
80 }
81
82 NTSTATUS dcerpc_fss_GetSupportedVersion_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_GetSupportedVersion *r)
83 {
84         NTSTATUS status;
85
86         status = dcerpc_binding_handle_call(h,
87                         NULL, &ndr_table_FileServerVssAgent,
88                         NDR_FSS_GETSUPPORTEDVERSION, mem_ctx, r);
89
90         return status;
91 }
92
93 struct dcerpc_fss_GetSupportedVersion_state {
94         struct fss_GetSupportedVersion orig;
95         struct fss_GetSupportedVersion tmp;
96         TALLOC_CTX *out_mem_ctx;
97 };
98
99 static void dcerpc_fss_GetSupportedVersion_done(struct tevent_req *subreq);
100
101 struct tevent_req *dcerpc_fss_GetSupportedVersion_send(TALLOC_CTX *mem_ctx,
102                                                        struct tevent_context *ev,
103                                                        struct dcerpc_binding_handle *h,
104                                                        uint8_t _magic[52] /* [in]  */,
105                                                        uint32_t *_MinVersion /* [out] [ref] */,
106                                                        uint32_t *_MaxVersion /* [out] [ref] */)
107 {
108         struct tevent_req *req;
109         struct dcerpc_fss_GetSupportedVersion_state *state;
110         struct tevent_req *subreq;
111
112         req = tevent_req_create(mem_ctx, &state,
113                                 struct dcerpc_fss_GetSupportedVersion_state);
114         if (req == NULL) {
115                 return NULL;
116         }
117         state->out_mem_ctx = NULL;
118
119         /* In parameters */
120         memcpy(state->orig.in.magic, _magic, sizeof(state->orig.in.magic));
121
122         /* Out parameters */
123         state->orig.out.MinVersion = _MinVersion;
124         state->orig.out.MaxVersion = _MaxVersion;
125
126         /* Result */
127         ZERO_STRUCT(state->orig.out.result);
128
129         state->out_mem_ctx = talloc_named_const(state, 0,
130                              "dcerpc_fss_GetSupportedVersion_out_memory");
131         if (tevent_req_nomem(state->out_mem_ctx, req)) {
132                 return tevent_req_post(req, ev);
133         }
134
135         /* make a temporary copy, that we pass to the dispatch function */
136         state->tmp = state->orig;
137
138         subreq = dcerpc_fss_GetSupportedVersion_r_send(state, ev, h, &state->tmp);
139         if (tevent_req_nomem(subreq, req)) {
140                 return tevent_req_post(req, ev);
141         }
142         tevent_req_set_callback(subreq, dcerpc_fss_GetSupportedVersion_done, req);
143         return req;
144 }
145
146 static void dcerpc_fss_GetSupportedVersion_done(struct tevent_req *subreq)
147 {
148         struct tevent_req *req = tevent_req_callback_data(
149                 subreq, struct tevent_req);
150         struct dcerpc_fss_GetSupportedVersion_state *state = tevent_req_data(
151                 req, struct dcerpc_fss_GetSupportedVersion_state);
152         NTSTATUS status;
153         TALLOC_CTX *mem_ctx;
154
155         if (state->out_mem_ctx) {
156                 mem_ctx = state->out_mem_ctx;
157         } else {
158                 mem_ctx = state;
159         }
160
161         status = dcerpc_fss_GetSupportedVersion_r_recv(subreq, mem_ctx);
162         TALLOC_FREE(subreq);
163         if (tevent_req_nterror(req, status)) {
164                 return;
165         }
166
167         /* Copy out parameters */
168         *state->orig.out.MinVersion = *state->tmp.out.MinVersion;
169         *state->orig.out.MaxVersion = *state->tmp.out.MaxVersion;
170
171         /* Copy result */
172         state->orig.out.result = state->tmp.out.result;
173
174         /* Reset temporary structure */
175         ZERO_STRUCT(state->tmp);
176
177         tevent_req_done(req);
178 }
179
180 NTSTATUS dcerpc_fss_GetSupportedVersion_recv(struct tevent_req *req,
181                                              TALLOC_CTX *mem_ctx,
182                                              uint32_t *result)
183 {
184         struct dcerpc_fss_GetSupportedVersion_state *state = tevent_req_data(
185                 req, struct dcerpc_fss_GetSupportedVersion_state);
186         NTSTATUS status;
187
188         if (tevent_req_is_nterror(req, &status)) {
189                 tevent_req_received(req);
190                 return status;
191         }
192
193         /* Steal possible out parameters to the callers context */
194         talloc_steal(mem_ctx, state->out_mem_ctx);
195
196         /* Return result */
197         *result = state->orig.out.result;
198
199         tevent_req_received(req);
200         return NT_STATUS_OK;
201 }
202
203 NTSTATUS dcerpc_fss_GetSupportedVersion(struct dcerpc_binding_handle *h,
204                                         TALLOC_CTX *mem_ctx,
205                                         uint8_t _magic[52] /* [in]  */,
206                                         uint32_t *_MinVersion /* [out] [ref] */,
207                                         uint32_t *_MaxVersion /* [out] [ref] */,
208                                         uint32_t *result)
209 {
210         struct fss_GetSupportedVersion r;
211         NTSTATUS status;
212
213         /* In parameters */
214         memcpy(r.in.magic, _magic, sizeof(r.in.magic));
215
216         status = dcerpc_fss_GetSupportedVersion_r(h, mem_ctx, &r);
217         if (!NT_STATUS_IS_OK(status)) {
218                 return status;
219         }
220
221         /* Return variables */
222         *_MinVersion = *r.out.MinVersion;
223         *_MaxVersion = *r.out.MaxVersion;
224
225         /* Return result */
226         *result = r.out.result;
227
228         return NT_STATUS_OK;
229 }
230
231 struct dcerpc_fss_SetContext_r_state {
232         TALLOC_CTX *out_mem_ctx;
233 };
234
235 static void dcerpc_fss_SetContext_r_done(struct tevent_req *subreq);
236
237 struct tevent_req *dcerpc_fss_SetContext_r_send(TALLOC_CTX *mem_ctx,
238         struct tevent_context *ev,
239         struct dcerpc_binding_handle *h,
240         struct fss_SetContext *r)
241 {
242         struct tevent_req *req;
243         struct dcerpc_fss_SetContext_r_state *state;
244         struct tevent_req *subreq;
245
246         req = tevent_req_create(mem_ctx, &state,
247                                 struct dcerpc_fss_SetContext_r_state);
248         if (req == NULL) {
249                 return NULL;
250         }
251
252         state->out_mem_ctx = NULL;
253
254         subreq = dcerpc_binding_handle_call_send(state, ev, h,
255                         NULL, &ndr_table_FileServerVssAgent,
256                         NDR_FSS_SETCONTEXT, state, r);
257         if (tevent_req_nomem(subreq, req)) {
258                 return tevent_req_post(req, ev);
259         }
260         tevent_req_set_callback(subreq, dcerpc_fss_SetContext_r_done, req);
261
262         return req;
263 }
264
265 static void dcerpc_fss_SetContext_r_done(struct tevent_req *subreq)
266 {
267         struct tevent_req *req =
268                 tevent_req_callback_data(subreq,
269                 struct tevent_req);
270         NTSTATUS status;
271
272         status = dcerpc_binding_handle_call_recv(subreq);
273         TALLOC_FREE(subreq);
274         if (tevent_req_nterror(req, status)) {
275                 return;
276         }
277
278         tevent_req_done(req);
279 }
280
281 NTSTATUS dcerpc_fss_SetContext_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
282 {
283         struct dcerpc_fss_SetContext_r_state *state =
284                 tevent_req_data(req,
285                 struct dcerpc_fss_SetContext_r_state);
286         NTSTATUS status;
287
288         if (tevent_req_is_nterror(req, &status)) {
289                 tevent_req_received(req);
290                 return status;
291         }
292
293         talloc_steal(mem_ctx, state->out_mem_ctx);
294
295         tevent_req_received(req);
296         return NT_STATUS_OK;
297 }
298
299 NTSTATUS dcerpc_fss_SetContext_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_SetContext *r)
300 {
301         NTSTATUS status;
302
303         status = dcerpc_binding_handle_call(h,
304                         NULL, &ndr_table_FileServerVssAgent,
305                         NDR_FSS_SETCONTEXT, mem_ctx, r);
306
307         return status;
308 }
309
310 struct dcerpc_fss_SetContext_state {
311         struct fss_SetContext orig;
312         struct fss_SetContext tmp;
313         TALLOC_CTX *out_mem_ctx;
314 };
315
316 static void dcerpc_fss_SetContext_done(struct tevent_req *subreq);
317
318 struct tevent_req *dcerpc_fss_SetContext_send(TALLOC_CTX *mem_ctx,
319                                               struct tevent_context *ev,
320                                               struct dcerpc_binding_handle *h,
321                                               uint32_t _Context /* [in]  */)
322 {
323         struct tevent_req *req;
324         struct dcerpc_fss_SetContext_state *state;
325         struct tevent_req *subreq;
326
327         req = tevent_req_create(mem_ctx, &state,
328                                 struct dcerpc_fss_SetContext_state);
329         if (req == NULL) {
330                 return NULL;
331         }
332         state->out_mem_ctx = NULL;
333
334         /* In parameters */
335         state->orig.in.Context = _Context;
336
337         /* Out parameters */
338
339         /* Result */
340         ZERO_STRUCT(state->orig.out.result);
341
342         /* make a temporary copy, that we pass to the dispatch function */
343         state->tmp = state->orig;
344
345         subreq = dcerpc_fss_SetContext_r_send(state, ev, h, &state->tmp);
346         if (tevent_req_nomem(subreq, req)) {
347                 return tevent_req_post(req, ev);
348         }
349         tevent_req_set_callback(subreq, dcerpc_fss_SetContext_done, req);
350         return req;
351 }
352
353 static void dcerpc_fss_SetContext_done(struct tevent_req *subreq)
354 {
355         struct tevent_req *req = tevent_req_callback_data(
356                 subreq, struct tevent_req);
357         struct dcerpc_fss_SetContext_state *state = tevent_req_data(
358                 req, struct dcerpc_fss_SetContext_state);
359         NTSTATUS status;
360         TALLOC_CTX *mem_ctx;
361
362         if (state->out_mem_ctx) {
363                 mem_ctx = state->out_mem_ctx;
364         } else {
365                 mem_ctx = state;
366         }
367
368         status = dcerpc_fss_SetContext_r_recv(subreq, mem_ctx);
369         TALLOC_FREE(subreq);
370         if (tevent_req_nterror(req, status)) {
371                 return;
372         }
373
374         /* Copy out parameters */
375
376         /* Copy result */
377         state->orig.out.result = state->tmp.out.result;
378
379         /* Reset temporary structure */
380         ZERO_STRUCT(state->tmp);
381
382         tevent_req_done(req);
383 }
384
385 NTSTATUS dcerpc_fss_SetContext_recv(struct tevent_req *req,
386                                     TALLOC_CTX *mem_ctx,
387                                     uint32_t *result)
388 {
389         struct dcerpc_fss_SetContext_state *state = tevent_req_data(
390                 req, struct dcerpc_fss_SetContext_state);
391         NTSTATUS status;
392
393         if (tevent_req_is_nterror(req, &status)) {
394                 tevent_req_received(req);
395                 return status;
396         }
397
398         /* Steal possible out parameters to the callers context */
399         talloc_steal(mem_ctx, state->out_mem_ctx);
400
401         /* Return result */
402         *result = state->orig.out.result;
403
404         tevent_req_received(req);
405         return NT_STATUS_OK;
406 }
407
408 NTSTATUS dcerpc_fss_SetContext(struct dcerpc_binding_handle *h,
409                                TALLOC_CTX *mem_ctx,
410                                uint32_t _Context /* [in]  */,
411                                uint32_t *result)
412 {
413         struct fss_SetContext r;
414         NTSTATUS status;
415
416         /* In parameters */
417         r.in.Context = _Context;
418
419         status = dcerpc_fss_SetContext_r(h, mem_ctx, &r);
420         if (!NT_STATUS_IS_OK(status)) {
421                 return status;
422         }
423
424         /* Return variables */
425
426         /* Return result */
427         *result = r.out.result;
428
429         return NT_STATUS_OK;
430 }
431
432 struct dcerpc_fss_StartShadowCopySet_r_state {
433         TALLOC_CTX *out_mem_ctx;
434 };
435
436 static void dcerpc_fss_StartShadowCopySet_r_done(struct tevent_req *subreq);
437
438 struct tevent_req *dcerpc_fss_StartShadowCopySet_r_send(TALLOC_CTX *mem_ctx,
439         struct tevent_context *ev,
440         struct dcerpc_binding_handle *h,
441         struct fss_StartShadowCopySet *r)
442 {
443         struct tevent_req *req;
444         struct dcerpc_fss_StartShadowCopySet_r_state *state;
445         struct tevent_req *subreq;
446
447         req = tevent_req_create(mem_ctx, &state,
448                                 struct dcerpc_fss_StartShadowCopySet_r_state);
449         if (req == NULL) {
450                 return NULL;
451         }
452
453         state->out_mem_ctx = talloc_new(state);
454         if (tevent_req_nomem(state->out_mem_ctx, req)) {
455                 return tevent_req_post(req, ev);
456         }
457
458         subreq = dcerpc_binding_handle_call_send(state, ev, h,
459                         NULL, &ndr_table_FileServerVssAgent,
460                         NDR_FSS_STARTSHADOWCOPYSET, state->out_mem_ctx, r);
461         if (tevent_req_nomem(subreq, req)) {
462                 return tevent_req_post(req, ev);
463         }
464         tevent_req_set_callback(subreq, dcerpc_fss_StartShadowCopySet_r_done, req);
465
466         return req;
467 }
468
469 static void dcerpc_fss_StartShadowCopySet_r_done(struct tevent_req *subreq)
470 {
471         struct tevent_req *req =
472                 tevent_req_callback_data(subreq,
473                 struct tevent_req);
474         NTSTATUS status;
475
476         status = dcerpc_binding_handle_call_recv(subreq);
477         TALLOC_FREE(subreq);
478         if (tevent_req_nterror(req, status)) {
479                 return;
480         }
481
482         tevent_req_done(req);
483 }
484
485 NTSTATUS dcerpc_fss_StartShadowCopySet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
486 {
487         struct dcerpc_fss_StartShadowCopySet_r_state *state =
488                 tevent_req_data(req,
489                 struct dcerpc_fss_StartShadowCopySet_r_state);
490         NTSTATUS status;
491
492         if (tevent_req_is_nterror(req, &status)) {
493                 tevent_req_received(req);
494                 return status;
495         }
496
497         talloc_steal(mem_ctx, state->out_mem_ctx);
498
499         tevent_req_received(req);
500         return NT_STATUS_OK;
501 }
502
503 NTSTATUS dcerpc_fss_StartShadowCopySet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_StartShadowCopySet *r)
504 {
505         NTSTATUS status;
506
507         status = dcerpc_binding_handle_call(h,
508                         NULL, &ndr_table_FileServerVssAgent,
509                         NDR_FSS_STARTSHADOWCOPYSET, mem_ctx, r);
510
511         return status;
512 }
513
514 struct dcerpc_fss_StartShadowCopySet_state {
515         struct fss_StartShadowCopySet orig;
516         struct fss_StartShadowCopySet tmp;
517         TALLOC_CTX *out_mem_ctx;
518 };
519
520 static void dcerpc_fss_StartShadowCopySet_done(struct tevent_req *subreq);
521
522 struct tevent_req *dcerpc_fss_StartShadowCopySet_send(TALLOC_CTX *mem_ctx,
523                                                       struct tevent_context *ev,
524                                                       struct dcerpc_binding_handle *h,
525                                                       struct GUID _ClientShadowCopySetId /* [in]  */,
526                                                       struct GUID *_pShadowCopySetId /* [out] [ref] */)
527 {
528         struct tevent_req *req;
529         struct dcerpc_fss_StartShadowCopySet_state *state;
530         struct tevent_req *subreq;
531
532         req = tevent_req_create(mem_ctx, &state,
533                                 struct dcerpc_fss_StartShadowCopySet_state);
534         if (req == NULL) {
535                 return NULL;
536         }
537         state->out_mem_ctx = NULL;
538
539         /* In parameters */
540         state->orig.in.ClientShadowCopySetId = _ClientShadowCopySetId;
541
542         /* Out parameters */
543         state->orig.out.pShadowCopySetId = _pShadowCopySetId;
544
545         /* Result */
546         ZERO_STRUCT(state->orig.out.result);
547
548         state->out_mem_ctx = talloc_named_const(state, 0,
549                              "dcerpc_fss_StartShadowCopySet_out_memory");
550         if (tevent_req_nomem(state->out_mem_ctx, req)) {
551                 return tevent_req_post(req, ev);
552         }
553
554         /* make a temporary copy, that we pass to the dispatch function */
555         state->tmp = state->orig;
556
557         subreq = dcerpc_fss_StartShadowCopySet_r_send(state, ev, h, &state->tmp);
558         if (tevent_req_nomem(subreq, req)) {
559                 return tevent_req_post(req, ev);
560         }
561         tevent_req_set_callback(subreq, dcerpc_fss_StartShadowCopySet_done, req);
562         return req;
563 }
564
565 static void dcerpc_fss_StartShadowCopySet_done(struct tevent_req *subreq)
566 {
567         struct tevent_req *req = tevent_req_callback_data(
568                 subreq, struct tevent_req);
569         struct dcerpc_fss_StartShadowCopySet_state *state = tevent_req_data(
570                 req, struct dcerpc_fss_StartShadowCopySet_state);
571         NTSTATUS status;
572         TALLOC_CTX *mem_ctx;
573
574         if (state->out_mem_ctx) {
575                 mem_ctx = state->out_mem_ctx;
576         } else {
577                 mem_ctx = state;
578         }
579
580         status = dcerpc_fss_StartShadowCopySet_r_recv(subreq, mem_ctx);
581         TALLOC_FREE(subreq);
582         if (tevent_req_nterror(req, status)) {
583                 return;
584         }
585
586         /* Copy out parameters */
587         *state->orig.out.pShadowCopySetId = *state->tmp.out.pShadowCopySetId;
588
589         /* Copy result */
590         state->orig.out.result = state->tmp.out.result;
591
592         /* Reset temporary structure */
593         ZERO_STRUCT(state->tmp);
594
595         tevent_req_done(req);
596 }
597
598 NTSTATUS dcerpc_fss_StartShadowCopySet_recv(struct tevent_req *req,
599                                             TALLOC_CTX *mem_ctx,
600                                             uint32_t *result)
601 {
602         struct dcerpc_fss_StartShadowCopySet_state *state = tevent_req_data(
603                 req, struct dcerpc_fss_StartShadowCopySet_state);
604         NTSTATUS status;
605
606         if (tevent_req_is_nterror(req, &status)) {
607                 tevent_req_received(req);
608                 return status;
609         }
610
611         /* Steal possible out parameters to the callers context */
612         talloc_steal(mem_ctx, state->out_mem_ctx);
613
614         /* Return result */
615         *result = state->orig.out.result;
616
617         tevent_req_received(req);
618         return NT_STATUS_OK;
619 }
620
621 NTSTATUS dcerpc_fss_StartShadowCopySet(struct dcerpc_binding_handle *h,
622                                        TALLOC_CTX *mem_ctx,
623                                        struct GUID _ClientShadowCopySetId /* [in]  */,
624                                        struct GUID *_pShadowCopySetId /* [out] [ref] */,
625                                        uint32_t *result)
626 {
627         struct fss_StartShadowCopySet r;
628         NTSTATUS status;
629
630         /* In parameters */
631         r.in.ClientShadowCopySetId = _ClientShadowCopySetId;
632
633         status = dcerpc_fss_StartShadowCopySet_r(h, mem_ctx, &r);
634         if (!NT_STATUS_IS_OK(status)) {
635                 return status;
636         }
637
638         /* Return variables */
639         *_pShadowCopySetId = *r.out.pShadowCopySetId;
640
641         /* Return result */
642         *result = r.out.result;
643
644         return NT_STATUS_OK;
645 }
646
647 struct dcerpc_fss_AddToShadowCopySet_r_state {
648         TALLOC_CTX *out_mem_ctx;
649 };
650
651 static void dcerpc_fss_AddToShadowCopySet_r_done(struct tevent_req *subreq);
652
653 struct tevent_req *dcerpc_fss_AddToShadowCopySet_r_send(TALLOC_CTX *mem_ctx,
654         struct tevent_context *ev,
655         struct dcerpc_binding_handle *h,
656         struct fss_AddToShadowCopySet *r)
657 {
658         struct tevent_req *req;
659         struct dcerpc_fss_AddToShadowCopySet_r_state *state;
660         struct tevent_req *subreq;
661
662         req = tevent_req_create(mem_ctx, &state,
663                                 struct dcerpc_fss_AddToShadowCopySet_r_state);
664         if (req == NULL) {
665                 return NULL;
666         }
667
668         state->out_mem_ctx = talloc_new(state);
669         if (tevent_req_nomem(state->out_mem_ctx, req)) {
670                 return tevent_req_post(req, ev);
671         }
672
673         subreq = dcerpc_binding_handle_call_send(state, ev, h,
674                         NULL, &ndr_table_FileServerVssAgent,
675                         NDR_FSS_ADDTOSHADOWCOPYSET, state->out_mem_ctx, r);
676         if (tevent_req_nomem(subreq, req)) {
677                 return tevent_req_post(req, ev);
678         }
679         tevent_req_set_callback(subreq, dcerpc_fss_AddToShadowCopySet_r_done, req);
680
681         return req;
682 }
683
684 static void dcerpc_fss_AddToShadowCopySet_r_done(struct tevent_req *subreq)
685 {
686         struct tevent_req *req =
687                 tevent_req_callback_data(subreq,
688                 struct tevent_req);
689         NTSTATUS status;
690
691         status = dcerpc_binding_handle_call_recv(subreq);
692         TALLOC_FREE(subreq);
693         if (tevent_req_nterror(req, status)) {
694                 return;
695         }
696
697         tevent_req_done(req);
698 }
699
700 NTSTATUS dcerpc_fss_AddToShadowCopySet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
701 {
702         struct dcerpc_fss_AddToShadowCopySet_r_state *state =
703                 tevent_req_data(req,
704                 struct dcerpc_fss_AddToShadowCopySet_r_state);
705         NTSTATUS status;
706
707         if (tevent_req_is_nterror(req, &status)) {
708                 tevent_req_received(req);
709                 return status;
710         }
711
712         talloc_steal(mem_ctx, state->out_mem_ctx);
713
714         tevent_req_received(req);
715         return NT_STATUS_OK;
716 }
717
718 NTSTATUS dcerpc_fss_AddToShadowCopySet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_AddToShadowCopySet *r)
719 {
720         NTSTATUS status;
721
722         status = dcerpc_binding_handle_call(h,
723                         NULL, &ndr_table_FileServerVssAgent,
724                         NDR_FSS_ADDTOSHADOWCOPYSET, mem_ctx, r);
725
726         return status;
727 }
728
729 struct dcerpc_fss_AddToShadowCopySet_state {
730         struct fss_AddToShadowCopySet orig;
731         struct fss_AddToShadowCopySet tmp;
732         TALLOC_CTX *out_mem_ctx;
733 };
734
735 static void dcerpc_fss_AddToShadowCopySet_done(struct tevent_req *subreq);
736
737 struct tevent_req *dcerpc_fss_AddToShadowCopySet_send(TALLOC_CTX *mem_ctx,
738                                                       struct tevent_context *ev,
739                                                       struct dcerpc_binding_handle *h,
740                                                       struct GUID _ClientShadowCopyId /* [in]  */,
741                                                       struct GUID _ShadowCopySetId /* [in]  */,
742                                                       const char *_ShareName /* [in] [ref,charset(UTF16)] */,
743                                                       struct GUID *_pShadowCopyId /* [out] [ref] */)
744 {
745         struct tevent_req *req;
746         struct dcerpc_fss_AddToShadowCopySet_state *state;
747         struct tevent_req *subreq;
748
749         req = tevent_req_create(mem_ctx, &state,
750                                 struct dcerpc_fss_AddToShadowCopySet_state);
751         if (req == NULL) {
752                 return NULL;
753         }
754         state->out_mem_ctx = NULL;
755
756         /* In parameters */
757         state->orig.in.ClientShadowCopyId = _ClientShadowCopyId;
758         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
759         state->orig.in.ShareName = _ShareName;
760
761         /* Out parameters */
762         state->orig.out.pShadowCopyId = _pShadowCopyId;
763
764         /* Result */
765         ZERO_STRUCT(state->orig.out.result);
766
767         state->out_mem_ctx = talloc_named_const(state, 0,
768                              "dcerpc_fss_AddToShadowCopySet_out_memory");
769         if (tevent_req_nomem(state->out_mem_ctx, req)) {
770                 return tevent_req_post(req, ev);
771         }
772
773         /* make a temporary copy, that we pass to the dispatch function */
774         state->tmp = state->orig;
775
776         subreq = dcerpc_fss_AddToShadowCopySet_r_send(state, ev, h, &state->tmp);
777         if (tevent_req_nomem(subreq, req)) {
778                 return tevent_req_post(req, ev);
779         }
780         tevent_req_set_callback(subreq, dcerpc_fss_AddToShadowCopySet_done, req);
781         return req;
782 }
783
784 static void dcerpc_fss_AddToShadowCopySet_done(struct tevent_req *subreq)
785 {
786         struct tevent_req *req = tevent_req_callback_data(
787                 subreq, struct tevent_req);
788         struct dcerpc_fss_AddToShadowCopySet_state *state = tevent_req_data(
789                 req, struct dcerpc_fss_AddToShadowCopySet_state);
790         NTSTATUS status;
791         TALLOC_CTX *mem_ctx;
792
793         if (state->out_mem_ctx) {
794                 mem_ctx = state->out_mem_ctx;
795         } else {
796                 mem_ctx = state;
797         }
798
799         status = dcerpc_fss_AddToShadowCopySet_r_recv(subreq, mem_ctx);
800         TALLOC_FREE(subreq);
801         if (tevent_req_nterror(req, status)) {
802                 return;
803         }
804
805         /* Copy out parameters */
806         *state->orig.out.pShadowCopyId = *state->tmp.out.pShadowCopyId;
807
808         /* Copy result */
809         state->orig.out.result = state->tmp.out.result;
810
811         /* Reset temporary structure */
812         ZERO_STRUCT(state->tmp);
813
814         tevent_req_done(req);
815 }
816
817 NTSTATUS dcerpc_fss_AddToShadowCopySet_recv(struct tevent_req *req,
818                                             TALLOC_CTX *mem_ctx,
819                                             uint32_t *result)
820 {
821         struct dcerpc_fss_AddToShadowCopySet_state *state = tevent_req_data(
822                 req, struct dcerpc_fss_AddToShadowCopySet_state);
823         NTSTATUS status;
824
825         if (tevent_req_is_nterror(req, &status)) {
826                 tevent_req_received(req);
827                 return status;
828         }
829
830         /* Steal possible out parameters to the callers context */
831         talloc_steal(mem_ctx, state->out_mem_ctx);
832
833         /* Return result */
834         *result = state->orig.out.result;
835
836         tevent_req_received(req);
837         return NT_STATUS_OK;
838 }
839
840 NTSTATUS dcerpc_fss_AddToShadowCopySet(struct dcerpc_binding_handle *h,
841                                        TALLOC_CTX *mem_ctx,
842                                        struct GUID _ClientShadowCopyId /* [in]  */,
843                                        struct GUID _ShadowCopySetId /* [in]  */,
844                                        const char *_ShareName /* [in] [ref,charset(UTF16)] */,
845                                        struct GUID *_pShadowCopyId /* [out] [ref] */,
846                                        uint32_t *result)
847 {
848         struct fss_AddToShadowCopySet r;
849         NTSTATUS status;
850
851         /* In parameters */
852         r.in.ClientShadowCopyId = _ClientShadowCopyId;
853         r.in.ShadowCopySetId = _ShadowCopySetId;
854         r.in.ShareName = _ShareName;
855
856         status = dcerpc_fss_AddToShadowCopySet_r(h, mem_ctx, &r);
857         if (!NT_STATUS_IS_OK(status)) {
858                 return status;
859         }
860
861         /* Return variables */
862         *_pShadowCopyId = *r.out.pShadowCopyId;
863
864         /* Return result */
865         *result = r.out.result;
866
867         return NT_STATUS_OK;
868 }
869
870 struct dcerpc_fss_CommitShadowCopySet_r_state {
871         TALLOC_CTX *out_mem_ctx;
872 };
873
874 static void dcerpc_fss_CommitShadowCopySet_r_done(struct tevent_req *subreq);
875
876 struct tevent_req *dcerpc_fss_CommitShadowCopySet_r_send(TALLOC_CTX *mem_ctx,
877         struct tevent_context *ev,
878         struct dcerpc_binding_handle *h,
879         struct fss_CommitShadowCopySet *r)
880 {
881         struct tevent_req *req;
882         struct dcerpc_fss_CommitShadowCopySet_r_state *state;
883         struct tevent_req *subreq;
884
885         req = tevent_req_create(mem_ctx, &state,
886                                 struct dcerpc_fss_CommitShadowCopySet_r_state);
887         if (req == NULL) {
888                 return NULL;
889         }
890
891         state->out_mem_ctx = NULL;
892
893         subreq = dcerpc_binding_handle_call_send(state, ev, h,
894                         NULL, &ndr_table_FileServerVssAgent,
895                         NDR_FSS_COMMITSHADOWCOPYSET, state, r);
896         if (tevent_req_nomem(subreq, req)) {
897                 return tevent_req_post(req, ev);
898         }
899         tevent_req_set_callback(subreq, dcerpc_fss_CommitShadowCopySet_r_done, req);
900
901         return req;
902 }
903
904 static void dcerpc_fss_CommitShadowCopySet_r_done(struct tevent_req *subreq)
905 {
906         struct tevent_req *req =
907                 tevent_req_callback_data(subreq,
908                 struct tevent_req);
909         NTSTATUS status;
910
911         status = dcerpc_binding_handle_call_recv(subreq);
912         TALLOC_FREE(subreq);
913         if (tevent_req_nterror(req, status)) {
914                 return;
915         }
916
917         tevent_req_done(req);
918 }
919
920 NTSTATUS dcerpc_fss_CommitShadowCopySet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
921 {
922         struct dcerpc_fss_CommitShadowCopySet_r_state *state =
923                 tevent_req_data(req,
924                 struct dcerpc_fss_CommitShadowCopySet_r_state);
925         NTSTATUS status;
926
927         if (tevent_req_is_nterror(req, &status)) {
928                 tevent_req_received(req);
929                 return status;
930         }
931
932         talloc_steal(mem_ctx, state->out_mem_ctx);
933
934         tevent_req_received(req);
935         return NT_STATUS_OK;
936 }
937
938 NTSTATUS dcerpc_fss_CommitShadowCopySet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_CommitShadowCopySet *r)
939 {
940         NTSTATUS status;
941
942         status = dcerpc_binding_handle_call(h,
943                         NULL, &ndr_table_FileServerVssAgent,
944                         NDR_FSS_COMMITSHADOWCOPYSET, mem_ctx, r);
945
946         return status;
947 }
948
949 struct dcerpc_fss_CommitShadowCopySet_state {
950         struct fss_CommitShadowCopySet orig;
951         struct fss_CommitShadowCopySet tmp;
952         TALLOC_CTX *out_mem_ctx;
953 };
954
955 static void dcerpc_fss_CommitShadowCopySet_done(struct tevent_req *subreq);
956
957 struct tevent_req *dcerpc_fss_CommitShadowCopySet_send(TALLOC_CTX *mem_ctx,
958                                                        struct tevent_context *ev,
959                                                        struct dcerpc_binding_handle *h,
960                                                        struct GUID _ShadowCopySetId /* [in]  */,
961                                                        uint32_t _TimeOutInMilliseconds /* [in]  */)
962 {
963         struct tevent_req *req;
964         struct dcerpc_fss_CommitShadowCopySet_state *state;
965         struct tevent_req *subreq;
966
967         req = tevent_req_create(mem_ctx, &state,
968                                 struct dcerpc_fss_CommitShadowCopySet_state);
969         if (req == NULL) {
970                 return NULL;
971         }
972         state->out_mem_ctx = NULL;
973
974         /* In parameters */
975         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
976         state->orig.in.TimeOutInMilliseconds = _TimeOutInMilliseconds;
977
978         /* Out parameters */
979
980         /* Result */
981         ZERO_STRUCT(state->orig.out.result);
982
983         /* make a temporary copy, that we pass to the dispatch function */
984         state->tmp = state->orig;
985
986         subreq = dcerpc_fss_CommitShadowCopySet_r_send(state, ev, h, &state->tmp);
987         if (tevent_req_nomem(subreq, req)) {
988                 return tevent_req_post(req, ev);
989         }
990         tevent_req_set_callback(subreq, dcerpc_fss_CommitShadowCopySet_done, req);
991         return req;
992 }
993
994 static void dcerpc_fss_CommitShadowCopySet_done(struct tevent_req *subreq)
995 {
996         struct tevent_req *req = tevent_req_callback_data(
997                 subreq, struct tevent_req);
998         struct dcerpc_fss_CommitShadowCopySet_state *state = tevent_req_data(
999                 req, struct dcerpc_fss_CommitShadowCopySet_state);
1000         NTSTATUS status;
1001         TALLOC_CTX *mem_ctx;
1002
1003         if (state->out_mem_ctx) {
1004                 mem_ctx = state->out_mem_ctx;
1005         } else {
1006                 mem_ctx = state;
1007         }
1008
1009         status = dcerpc_fss_CommitShadowCopySet_r_recv(subreq, mem_ctx);
1010         TALLOC_FREE(subreq);
1011         if (tevent_req_nterror(req, status)) {
1012                 return;
1013         }
1014
1015         /* Copy out parameters */
1016
1017         /* Copy result */
1018         state->orig.out.result = state->tmp.out.result;
1019
1020         /* Reset temporary structure */
1021         ZERO_STRUCT(state->tmp);
1022
1023         tevent_req_done(req);
1024 }
1025
1026 NTSTATUS dcerpc_fss_CommitShadowCopySet_recv(struct tevent_req *req,
1027                                              TALLOC_CTX *mem_ctx,
1028                                              uint32_t *result)
1029 {
1030         struct dcerpc_fss_CommitShadowCopySet_state *state = tevent_req_data(
1031                 req, struct dcerpc_fss_CommitShadowCopySet_state);
1032         NTSTATUS status;
1033
1034         if (tevent_req_is_nterror(req, &status)) {
1035                 tevent_req_received(req);
1036                 return status;
1037         }
1038
1039         /* Steal possible out parameters to the callers context */
1040         talloc_steal(mem_ctx, state->out_mem_ctx);
1041
1042         /* Return result */
1043         *result = state->orig.out.result;
1044
1045         tevent_req_received(req);
1046         return NT_STATUS_OK;
1047 }
1048
1049 NTSTATUS dcerpc_fss_CommitShadowCopySet(struct dcerpc_binding_handle *h,
1050                                         TALLOC_CTX *mem_ctx,
1051                                         struct GUID _ShadowCopySetId /* [in]  */,
1052                                         uint32_t _TimeOutInMilliseconds /* [in]  */,
1053                                         uint32_t *result)
1054 {
1055         struct fss_CommitShadowCopySet r;
1056         NTSTATUS status;
1057
1058         /* In parameters */
1059         r.in.ShadowCopySetId = _ShadowCopySetId;
1060         r.in.TimeOutInMilliseconds = _TimeOutInMilliseconds;
1061
1062         status = dcerpc_fss_CommitShadowCopySet_r(h, mem_ctx, &r);
1063         if (!NT_STATUS_IS_OK(status)) {
1064                 return status;
1065         }
1066
1067         /* Return variables */
1068
1069         /* Return result */
1070         *result = r.out.result;
1071
1072         return NT_STATUS_OK;
1073 }
1074
1075 struct dcerpc_fss_ExposeShadowCopySet_r_state {
1076         TALLOC_CTX *out_mem_ctx;
1077 };
1078
1079 static void dcerpc_fss_ExposeShadowCopySet_r_done(struct tevent_req *subreq);
1080
1081 struct tevent_req *dcerpc_fss_ExposeShadowCopySet_r_send(TALLOC_CTX *mem_ctx,
1082         struct tevent_context *ev,
1083         struct dcerpc_binding_handle *h,
1084         struct fss_ExposeShadowCopySet *r)
1085 {
1086         struct tevent_req *req;
1087         struct dcerpc_fss_ExposeShadowCopySet_r_state *state;
1088         struct tevent_req *subreq;
1089
1090         req = tevent_req_create(mem_ctx, &state,
1091                                 struct dcerpc_fss_ExposeShadowCopySet_r_state);
1092         if (req == NULL) {
1093                 return NULL;
1094         }
1095
1096         state->out_mem_ctx = NULL;
1097
1098         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1099                         NULL, &ndr_table_FileServerVssAgent,
1100                         NDR_FSS_EXPOSESHADOWCOPYSET, state, r);
1101         if (tevent_req_nomem(subreq, req)) {
1102                 return tevent_req_post(req, ev);
1103         }
1104         tevent_req_set_callback(subreq, dcerpc_fss_ExposeShadowCopySet_r_done, req);
1105
1106         return req;
1107 }
1108
1109 static void dcerpc_fss_ExposeShadowCopySet_r_done(struct tevent_req *subreq)
1110 {
1111         struct tevent_req *req =
1112                 tevent_req_callback_data(subreq,
1113                 struct tevent_req);
1114         NTSTATUS status;
1115
1116         status = dcerpc_binding_handle_call_recv(subreq);
1117         TALLOC_FREE(subreq);
1118         if (tevent_req_nterror(req, status)) {
1119                 return;
1120         }
1121
1122         tevent_req_done(req);
1123 }
1124
1125 NTSTATUS dcerpc_fss_ExposeShadowCopySet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1126 {
1127         struct dcerpc_fss_ExposeShadowCopySet_r_state *state =
1128                 tevent_req_data(req,
1129                 struct dcerpc_fss_ExposeShadowCopySet_r_state);
1130         NTSTATUS status;
1131
1132         if (tevent_req_is_nterror(req, &status)) {
1133                 tevent_req_received(req);
1134                 return status;
1135         }
1136
1137         talloc_steal(mem_ctx, state->out_mem_ctx);
1138
1139         tevent_req_received(req);
1140         return NT_STATUS_OK;
1141 }
1142
1143 NTSTATUS dcerpc_fss_ExposeShadowCopySet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_ExposeShadowCopySet *r)
1144 {
1145         NTSTATUS status;
1146
1147         status = dcerpc_binding_handle_call(h,
1148                         NULL, &ndr_table_FileServerVssAgent,
1149                         NDR_FSS_EXPOSESHADOWCOPYSET, mem_ctx, r);
1150
1151         return status;
1152 }
1153
1154 struct dcerpc_fss_ExposeShadowCopySet_state {
1155         struct fss_ExposeShadowCopySet orig;
1156         struct fss_ExposeShadowCopySet tmp;
1157         TALLOC_CTX *out_mem_ctx;
1158 };
1159
1160 static void dcerpc_fss_ExposeShadowCopySet_done(struct tevent_req *subreq);
1161
1162 struct tevent_req *dcerpc_fss_ExposeShadowCopySet_send(TALLOC_CTX *mem_ctx,
1163                                                        struct tevent_context *ev,
1164                                                        struct dcerpc_binding_handle *h,
1165                                                        struct GUID _ShadowCopySetId /* [in]  */,
1166                                                        uint32_t _TimeOutInMilliseconds /* [in]  */)
1167 {
1168         struct tevent_req *req;
1169         struct dcerpc_fss_ExposeShadowCopySet_state *state;
1170         struct tevent_req *subreq;
1171
1172         req = tevent_req_create(mem_ctx, &state,
1173                                 struct dcerpc_fss_ExposeShadowCopySet_state);
1174         if (req == NULL) {
1175                 return NULL;
1176         }
1177         state->out_mem_ctx = NULL;
1178
1179         /* In parameters */
1180         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
1181         state->orig.in.TimeOutInMilliseconds = _TimeOutInMilliseconds;
1182
1183         /* Out parameters */
1184
1185         /* Result */
1186         ZERO_STRUCT(state->orig.out.result);
1187
1188         /* make a temporary copy, that we pass to the dispatch function */
1189         state->tmp = state->orig;
1190
1191         subreq = dcerpc_fss_ExposeShadowCopySet_r_send(state, ev, h, &state->tmp);
1192         if (tevent_req_nomem(subreq, req)) {
1193                 return tevent_req_post(req, ev);
1194         }
1195         tevent_req_set_callback(subreq, dcerpc_fss_ExposeShadowCopySet_done, req);
1196         return req;
1197 }
1198
1199 static void dcerpc_fss_ExposeShadowCopySet_done(struct tevent_req *subreq)
1200 {
1201         struct tevent_req *req = tevent_req_callback_data(
1202                 subreq, struct tevent_req);
1203         struct dcerpc_fss_ExposeShadowCopySet_state *state = tevent_req_data(
1204                 req, struct dcerpc_fss_ExposeShadowCopySet_state);
1205         NTSTATUS status;
1206         TALLOC_CTX *mem_ctx;
1207
1208         if (state->out_mem_ctx) {
1209                 mem_ctx = state->out_mem_ctx;
1210         } else {
1211                 mem_ctx = state;
1212         }
1213
1214         status = dcerpc_fss_ExposeShadowCopySet_r_recv(subreq, mem_ctx);
1215         TALLOC_FREE(subreq);
1216         if (tevent_req_nterror(req, status)) {
1217                 return;
1218         }
1219
1220         /* Copy out parameters */
1221
1222         /* Copy result */
1223         state->orig.out.result = state->tmp.out.result;
1224
1225         /* Reset temporary structure */
1226         ZERO_STRUCT(state->tmp);
1227
1228         tevent_req_done(req);
1229 }
1230
1231 NTSTATUS dcerpc_fss_ExposeShadowCopySet_recv(struct tevent_req *req,
1232                                              TALLOC_CTX *mem_ctx,
1233                                              uint32_t *result)
1234 {
1235         struct dcerpc_fss_ExposeShadowCopySet_state *state = tevent_req_data(
1236                 req, struct dcerpc_fss_ExposeShadowCopySet_state);
1237         NTSTATUS status;
1238
1239         if (tevent_req_is_nterror(req, &status)) {
1240                 tevent_req_received(req);
1241                 return status;
1242         }
1243
1244         /* Steal possible out parameters to the callers context */
1245         talloc_steal(mem_ctx, state->out_mem_ctx);
1246
1247         /* Return result */
1248         *result = state->orig.out.result;
1249
1250         tevent_req_received(req);
1251         return NT_STATUS_OK;
1252 }
1253
1254 NTSTATUS dcerpc_fss_ExposeShadowCopySet(struct dcerpc_binding_handle *h,
1255                                         TALLOC_CTX *mem_ctx,
1256                                         struct GUID _ShadowCopySetId /* [in]  */,
1257                                         uint32_t _TimeOutInMilliseconds /* [in]  */,
1258                                         uint32_t *result)
1259 {
1260         struct fss_ExposeShadowCopySet r;
1261         NTSTATUS status;
1262
1263         /* In parameters */
1264         r.in.ShadowCopySetId = _ShadowCopySetId;
1265         r.in.TimeOutInMilliseconds = _TimeOutInMilliseconds;
1266
1267         status = dcerpc_fss_ExposeShadowCopySet_r(h, mem_ctx, &r);
1268         if (!NT_STATUS_IS_OK(status)) {
1269                 return status;
1270         }
1271
1272         /* Return variables */
1273
1274         /* Return result */
1275         *result = r.out.result;
1276
1277         return NT_STATUS_OK;
1278 }
1279
1280 struct dcerpc_fss_RecoveryCompleteShadowCopySet_r_state {
1281         TALLOC_CTX *out_mem_ctx;
1282 };
1283
1284 static void dcerpc_fss_RecoveryCompleteShadowCopySet_r_done(struct tevent_req *subreq);
1285
1286 struct tevent_req *dcerpc_fss_RecoveryCompleteShadowCopySet_r_send(TALLOC_CTX *mem_ctx,
1287         struct tevent_context *ev,
1288         struct dcerpc_binding_handle *h,
1289         struct fss_RecoveryCompleteShadowCopySet *r)
1290 {
1291         struct tevent_req *req;
1292         struct dcerpc_fss_RecoveryCompleteShadowCopySet_r_state *state;
1293         struct tevent_req *subreq;
1294
1295         req = tevent_req_create(mem_ctx, &state,
1296                                 struct dcerpc_fss_RecoveryCompleteShadowCopySet_r_state);
1297         if (req == NULL) {
1298                 return NULL;
1299         }
1300
1301         state->out_mem_ctx = NULL;
1302
1303         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1304                         NULL, &ndr_table_FileServerVssAgent,
1305                         NDR_FSS_RECOVERYCOMPLETESHADOWCOPYSET, state, r);
1306         if (tevent_req_nomem(subreq, req)) {
1307                 return tevent_req_post(req, ev);
1308         }
1309         tevent_req_set_callback(subreq, dcerpc_fss_RecoveryCompleteShadowCopySet_r_done, req);
1310
1311         return req;
1312 }
1313
1314 static void dcerpc_fss_RecoveryCompleteShadowCopySet_r_done(struct tevent_req *subreq)
1315 {
1316         struct tevent_req *req =
1317                 tevent_req_callback_data(subreq,
1318                 struct tevent_req);
1319         NTSTATUS status;
1320
1321         status = dcerpc_binding_handle_call_recv(subreq);
1322         TALLOC_FREE(subreq);
1323         if (tevent_req_nterror(req, status)) {
1324                 return;
1325         }
1326
1327         tevent_req_done(req);
1328 }
1329
1330 NTSTATUS dcerpc_fss_RecoveryCompleteShadowCopySet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1331 {
1332         struct dcerpc_fss_RecoveryCompleteShadowCopySet_r_state *state =
1333                 tevent_req_data(req,
1334                 struct dcerpc_fss_RecoveryCompleteShadowCopySet_r_state);
1335         NTSTATUS status;
1336
1337         if (tevent_req_is_nterror(req, &status)) {
1338                 tevent_req_received(req);
1339                 return status;
1340         }
1341
1342         talloc_steal(mem_ctx, state->out_mem_ctx);
1343
1344         tevent_req_received(req);
1345         return NT_STATUS_OK;
1346 }
1347
1348 NTSTATUS dcerpc_fss_RecoveryCompleteShadowCopySet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_RecoveryCompleteShadowCopySet *r)
1349 {
1350         NTSTATUS status;
1351
1352         status = dcerpc_binding_handle_call(h,
1353                         NULL, &ndr_table_FileServerVssAgent,
1354                         NDR_FSS_RECOVERYCOMPLETESHADOWCOPYSET, mem_ctx, r);
1355
1356         return status;
1357 }
1358
1359 struct dcerpc_fss_RecoveryCompleteShadowCopySet_state {
1360         struct fss_RecoveryCompleteShadowCopySet orig;
1361         struct fss_RecoveryCompleteShadowCopySet tmp;
1362         TALLOC_CTX *out_mem_ctx;
1363 };
1364
1365 static void dcerpc_fss_RecoveryCompleteShadowCopySet_done(struct tevent_req *subreq);
1366
1367 struct tevent_req *dcerpc_fss_RecoveryCompleteShadowCopySet_send(TALLOC_CTX *mem_ctx,
1368                                                                  struct tevent_context *ev,
1369                                                                  struct dcerpc_binding_handle *h,
1370                                                                  struct GUID _ShadowCopySetId /* [in]  */)
1371 {
1372         struct tevent_req *req;
1373         struct dcerpc_fss_RecoveryCompleteShadowCopySet_state *state;
1374         struct tevent_req *subreq;
1375
1376         req = tevent_req_create(mem_ctx, &state,
1377                                 struct dcerpc_fss_RecoveryCompleteShadowCopySet_state);
1378         if (req == NULL) {
1379                 return NULL;
1380         }
1381         state->out_mem_ctx = NULL;
1382
1383         /* In parameters */
1384         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
1385
1386         /* Out parameters */
1387
1388         /* Result */
1389         ZERO_STRUCT(state->orig.out.result);
1390
1391         /* make a temporary copy, that we pass to the dispatch function */
1392         state->tmp = state->orig;
1393
1394         subreq = dcerpc_fss_RecoveryCompleteShadowCopySet_r_send(state, ev, h, &state->tmp);
1395         if (tevent_req_nomem(subreq, req)) {
1396                 return tevent_req_post(req, ev);
1397         }
1398         tevent_req_set_callback(subreq, dcerpc_fss_RecoveryCompleteShadowCopySet_done, req);
1399         return req;
1400 }
1401
1402 static void dcerpc_fss_RecoveryCompleteShadowCopySet_done(struct tevent_req *subreq)
1403 {
1404         struct tevent_req *req = tevent_req_callback_data(
1405                 subreq, struct tevent_req);
1406         struct dcerpc_fss_RecoveryCompleteShadowCopySet_state *state = tevent_req_data(
1407                 req, struct dcerpc_fss_RecoveryCompleteShadowCopySet_state);
1408         NTSTATUS status;
1409         TALLOC_CTX *mem_ctx;
1410
1411         if (state->out_mem_ctx) {
1412                 mem_ctx = state->out_mem_ctx;
1413         } else {
1414                 mem_ctx = state;
1415         }
1416
1417         status = dcerpc_fss_RecoveryCompleteShadowCopySet_r_recv(subreq, mem_ctx);
1418         TALLOC_FREE(subreq);
1419         if (tevent_req_nterror(req, status)) {
1420                 return;
1421         }
1422
1423         /* Copy out parameters */
1424
1425         /* Copy result */
1426         state->orig.out.result = state->tmp.out.result;
1427
1428         /* Reset temporary structure */
1429         ZERO_STRUCT(state->tmp);
1430
1431         tevent_req_done(req);
1432 }
1433
1434 NTSTATUS dcerpc_fss_RecoveryCompleteShadowCopySet_recv(struct tevent_req *req,
1435                                                        TALLOC_CTX *mem_ctx,
1436                                                        uint32_t *result)
1437 {
1438         struct dcerpc_fss_RecoveryCompleteShadowCopySet_state *state = tevent_req_data(
1439                 req, struct dcerpc_fss_RecoveryCompleteShadowCopySet_state);
1440         NTSTATUS status;
1441
1442         if (tevent_req_is_nterror(req, &status)) {
1443                 tevent_req_received(req);
1444                 return status;
1445         }
1446
1447         /* Steal possible out parameters to the callers context */
1448         talloc_steal(mem_ctx, state->out_mem_ctx);
1449
1450         /* Return result */
1451         *result = state->orig.out.result;
1452
1453         tevent_req_received(req);
1454         return NT_STATUS_OK;
1455 }
1456
1457 NTSTATUS dcerpc_fss_RecoveryCompleteShadowCopySet(struct dcerpc_binding_handle *h,
1458                                                   TALLOC_CTX *mem_ctx,
1459                                                   struct GUID _ShadowCopySetId /* [in]  */,
1460                                                   uint32_t *result)
1461 {
1462         struct fss_RecoveryCompleteShadowCopySet r;
1463         NTSTATUS status;
1464
1465         /* In parameters */
1466         r.in.ShadowCopySetId = _ShadowCopySetId;
1467
1468         status = dcerpc_fss_RecoveryCompleteShadowCopySet_r(h, mem_ctx, &r);
1469         if (!NT_STATUS_IS_OK(status)) {
1470                 return status;
1471         }
1472
1473         /* Return variables */
1474
1475         /* Return result */
1476         *result = r.out.result;
1477
1478         return NT_STATUS_OK;
1479 }
1480
1481 struct dcerpc_fss_AbortShadowCopySet_r_state {
1482         TALLOC_CTX *out_mem_ctx;
1483 };
1484
1485 static void dcerpc_fss_AbortShadowCopySet_r_done(struct tevent_req *subreq);
1486
1487 struct tevent_req *dcerpc_fss_AbortShadowCopySet_r_send(TALLOC_CTX *mem_ctx,
1488         struct tevent_context *ev,
1489         struct dcerpc_binding_handle *h,
1490         struct fss_AbortShadowCopySet *r)
1491 {
1492         struct tevent_req *req;
1493         struct dcerpc_fss_AbortShadowCopySet_r_state *state;
1494         struct tevent_req *subreq;
1495
1496         req = tevent_req_create(mem_ctx, &state,
1497                                 struct dcerpc_fss_AbortShadowCopySet_r_state);
1498         if (req == NULL) {
1499                 return NULL;
1500         }
1501
1502         state->out_mem_ctx = NULL;
1503
1504         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1505                         NULL, &ndr_table_FileServerVssAgent,
1506                         NDR_FSS_ABORTSHADOWCOPYSET, state, r);
1507         if (tevent_req_nomem(subreq, req)) {
1508                 return tevent_req_post(req, ev);
1509         }
1510         tevent_req_set_callback(subreq, dcerpc_fss_AbortShadowCopySet_r_done, req);
1511
1512         return req;
1513 }
1514
1515 static void dcerpc_fss_AbortShadowCopySet_r_done(struct tevent_req *subreq)
1516 {
1517         struct tevent_req *req =
1518                 tevent_req_callback_data(subreq,
1519                 struct tevent_req);
1520         NTSTATUS status;
1521
1522         status = dcerpc_binding_handle_call_recv(subreq);
1523         TALLOC_FREE(subreq);
1524         if (tevent_req_nterror(req, status)) {
1525                 return;
1526         }
1527
1528         tevent_req_done(req);
1529 }
1530
1531 NTSTATUS dcerpc_fss_AbortShadowCopySet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1532 {
1533         struct dcerpc_fss_AbortShadowCopySet_r_state *state =
1534                 tevent_req_data(req,
1535                 struct dcerpc_fss_AbortShadowCopySet_r_state);
1536         NTSTATUS status;
1537
1538         if (tevent_req_is_nterror(req, &status)) {
1539                 tevent_req_received(req);
1540                 return status;
1541         }
1542
1543         talloc_steal(mem_ctx, state->out_mem_ctx);
1544
1545         tevent_req_received(req);
1546         return NT_STATUS_OK;
1547 }
1548
1549 NTSTATUS dcerpc_fss_AbortShadowCopySet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_AbortShadowCopySet *r)
1550 {
1551         NTSTATUS status;
1552
1553         status = dcerpc_binding_handle_call(h,
1554                         NULL, &ndr_table_FileServerVssAgent,
1555                         NDR_FSS_ABORTSHADOWCOPYSET, mem_ctx, r);
1556
1557         return status;
1558 }
1559
1560 struct dcerpc_fss_AbortShadowCopySet_state {
1561         struct fss_AbortShadowCopySet orig;
1562         struct fss_AbortShadowCopySet tmp;
1563         TALLOC_CTX *out_mem_ctx;
1564 };
1565
1566 static void dcerpc_fss_AbortShadowCopySet_done(struct tevent_req *subreq);
1567
1568 struct tevent_req *dcerpc_fss_AbortShadowCopySet_send(TALLOC_CTX *mem_ctx,
1569                                                       struct tevent_context *ev,
1570                                                       struct dcerpc_binding_handle *h,
1571                                                       struct GUID _ShadowCopySetId /* [in]  */)
1572 {
1573         struct tevent_req *req;
1574         struct dcerpc_fss_AbortShadowCopySet_state *state;
1575         struct tevent_req *subreq;
1576
1577         req = tevent_req_create(mem_ctx, &state,
1578                                 struct dcerpc_fss_AbortShadowCopySet_state);
1579         if (req == NULL) {
1580                 return NULL;
1581         }
1582         state->out_mem_ctx = NULL;
1583
1584         /* In parameters */
1585         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
1586
1587         /* Out parameters */
1588
1589         /* Result */
1590         ZERO_STRUCT(state->orig.out.result);
1591
1592         /* make a temporary copy, that we pass to the dispatch function */
1593         state->tmp = state->orig;
1594
1595         subreq = dcerpc_fss_AbortShadowCopySet_r_send(state, ev, h, &state->tmp);
1596         if (tevent_req_nomem(subreq, req)) {
1597                 return tevent_req_post(req, ev);
1598         }
1599         tevent_req_set_callback(subreq, dcerpc_fss_AbortShadowCopySet_done, req);
1600         return req;
1601 }
1602
1603 static void dcerpc_fss_AbortShadowCopySet_done(struct tevent_req *subreq)
1604 {
1605         struct tevent_req *req = tevent_req_callback_data(
1606                 subreq, struct tevent_req);
1607         struct dcerpc_fss_AbortShadowCopySet_state *state = tevent_req_data(
1608                 req, struct dcerpc_fss_AbortShadowCopySet_state);
1609         NTSTATUS status;
1610         TALLOC_CTX *mem_ctx;
1611
1612         if (state->out_mem_ctx) {
1613                 mem_ctx = state->out_mem_ctx;
1614         } else {
1615                 mem_ctx = state;
1616         }
1617
1618         status = dcerpc_fss_AbortShadowCopySet_r_recv(subreq, mem_ctx);
1619         TALLOC_FREE(subreq);
1620         if (tevent_req_nterror(req, status)) {
1621                 return;
1622         }
1623
1624         /* Copy out parameters */
1625
1626         /* Copy result */
1627         state->orig.out.result = state->tmp.out.result;
1628
1629         /* Reset temporary structure */
1630         ZERO_STRUCT(state->tmp);
1631
1632         tevent_req_done(req);
1633 }
1634
1635 NTSTATUS dcerpc_fss_AbortShadowCopySet_recv(struct tevent_req *req,
1636                                             TALLOC_CTX *mem_ctx,
1637                                             uint32_t *result)
1638 {
1639         struct dcerpc_fss_AbortShadowCopySet_state *state = tevent_req_data(
1640                 req, struct dcerpc_fss_AbortShadowCopySet_state);
1641         NTSTATUS status;
1642
1643         if (tevent_req_is_nterror(req, &status)) {
1644                 tevent_req_received(req);
1645                 return status;
1646         }
1647
1648         /* Steal possible out parameters to the callers context */
1649         talloc_steal(mem_ctx, state->out_mem_ctx);
1650
1651         /* Return result */
1652         *result = state->orig.out.result;
1653
1654         tevent_req_received(req);
1655         return NT_STATUS_OK;
1656 }
1657
1658 NTSTATUS dcerpc_fss_AbortShadowCopySet(struct dcerpc_binding_handle *h,
1659                                        TALLOC_CTX *mem_ctx,
1660                                        struct GUID _ShadowCopySetId /* [in]  */,
1661                                        uint32_t *result)
1662 {
1663         struct fss_AbortShadowCopySet r;
1664         NTSTATUS status;
1665
1666         /* In parameters */
1667         r.in.ShadowCopySetId = _ShadowCopySetId;
1668
1669         status = dcerpc_fss_AbortShadowCopySet_r(h, mem_ctx, &r);
1670         if (!NT_STATUS_IS_OK(status)) {
1671                 return status;
1672         }
1673
1674         /* Return variables */
1675
1676         /* Return result */
1677         *result = r.out.result;
1678
1679         return NT_STATUS_OK;
1680 }
1681
1682 struct dcerpc_fss_IsPathSupported_r_state {
1683         TALLOC_CTX *out_mem_ctx;
1684 };
1685
1686 static void dcerpc_fss_IsPathSupported_r_done(struct tevent_req *subreq);
1687
1688 struct tevent_req *dcerpc_fss_IsPathSupported_r_send(TALLOC_CTX *mem_ctx,
1689         struct tevent_context *ev,
1690         struct dcerpc_binding_handle *h,
1691         struct fss_IsPathSupported *r)
1692 {
1693         struct tevent_req *req;
1694         struct dcerpc_fss_IsPathSupported_r_state *state;
1695         struct tevent_req *subreq;
1696
1697         req = tevent_req_create(mem_ctx, &state,
1698                                 struct dcerpc_fss_IsPathSupported_r_state);
1699         if (req == NULL) {
1700                 return NULL;
1701         }
1702
1703         state->out_mem_ctx = talloc_new(state);
1704         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1705                 return tevent_req_post(req, ev);
1706         }
1707
1708         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1709                         NULL, &ndr_table_FileServerVssAgent,
1710                         NDR_FSS_ISPATHSUPPORTED, state->out_mem_ctx, r);
1711         if (tevent_req_nomem(subreq, req)) {
1712                 return tevent_req_post(req, ev);
1713         }
1714         tevent_req_set_callback(subreq, dcerpc_fss_IsPathSupported_r_done, req);
1715
1716         return req;
1717 }
1718
1719 static void dcerpc_fss_IsPathSupported_r_done(struct tevent_req *subreq)
1720 {
1721         struct tevent_req *req =
1722                 tevent_req_callback_data(subreq,
1723                 struct tevent_req);
1724         NTSTATUS status;
1725
1726         status = dcerpc_binding_handle_call_recv(subreq);
1727         TALLOC_FREE(subreq);
1728         if (tevent_req_nterror(req, status)) {
1729                 return;
1730         }
1731
1732         tevent_req_done(req);
1733 }
1734
1735 NTSTATUS dcerpc_fss_IsPathSupported_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1736 {
1737         struct dcerpc_fss_IsPathSupported_r_state *state =
1738                 tevent_req_data(req,
1739                 struct dcerpc_fss_IsPathSupported_r_state);
1740         NTSTATUS status;
1741
1742         if (tevent_req_is_nterror(req, &status)) {
1743                 tevent_req_received(req);
1744                 return status;
1745         }
1746
1747         talloc_steal(mem_ctx, state->out_mem_ctx);
1748
1749         tevent_req_received(req);
1750         return NT_STATUS_OK;
1751 }
1752
1753 NTSTATUS dcerpc_fss_IsPathSupported_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_IsPathSupported *r)
1754 {
1755         NTSTATUS status;
1756
1757         status = dcerpc_binding_handle_call(h,
1758                         NULL, &ndr_table_FileServerVssAgent,
1759                         NDR_FSS_ISPATHSUPPORTED, mem_ctx, r);
1760
1761         return status;
1762 }
1763
1764 struct dcerpc_fss_IsPathSupported_state {
1765         struct fss_IsPathSupported orig;
1766         struct fss_IsPathSupported tmp;
1767         TALLOC_CTX *out_mem_ctx;
1768 };
1769
1770 static void dcerpc_fss_IsPathSupported_done(struct tevent_req *subreq);
1771
1772 struct tevent_req *dcerpc_fss_IsPathSupported_send(TALLOC_CTX *mem_ctx,
1773                                                    struct tevent_context *ev,
1774                                                    struct dcerpc_binding_handle *h,
1775                                                    const char *_ShareName /* [in] [ref,charset(UTF16)] */,
1776                                                    uint8_t _magic[52] /* [in]  */,
1777                                                    uint32_t *_SupportedByThisProvider /* [out] [ref] */,
1778                                                    const char **_OwnerMachineName /* [out] [ref,charset(UTF16)] */)
1779 {
1780         struct tevent_req *req;
1781         struct dcerpc_fss_IsPathSupported_state *state;
1782         struct tevent_req *subreq;
1783
1784         req = tevent_req_create(mem_ctx, &state,
1785                                 struct dcerpc_fss_IsPathSupported_state);
1786         if (req == NULL) {
1787                 return NULL;
1788         }
1789         state->out_mem_ctx = NULL;
1790
1791         /* In parameters */
1792         state->orig.in.ShareName = _ShareName;
1793         memcpy(state->orig.in.magic, _magic, sizeof(state->orig.in.magic));
1794
1795         /* Out parameters */
1796         state->orig.out.SupportedByThisProvider = _SupportedByThisProvider;
1797         state->orig.out.OwnerMachineName = _OwnerMachineName;
1798
1799         /* Result */
1800         ZERO_STRUCT(state->orig.out.result);
1801
1802         state->out_mem_ctx = talloc_named_const(state, 0,
1803                              "dcerpc_fss_IsPathSupported_out_memory");
1804         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1805                 return tevent_req_post(req, ev);
1806         }
1807
1808         /* make a temporary copy, that we pass to the dispatch function */
1809         state->tmp = state->orig;
1810
1811         subreq = dcerpc_fss_IsPathSupported_r_send(state, ev, h, &state->tmp);
1812         if (tevent_req_nomem(subreq, req)) {
1813                 return tevent_req_post(req, ev);
1814         }
1815         tevent_req_set_callback(subreq, dcerpc_fss_IsPathSupported_done, req);
1816         return req;
1817 }
1818
1819 static void dcerpc_fss_IsPathSupported_done(struct tevent_req *subreq)
1820 {
1821         struct tevent_req *req = tevent_req_callback_data(
1822                 subreq, struct tevent_req);
1823         struct dcerpc_fss_IsPathSupported_state *state = tevent_req_data(
1824                 req, struct dcerpc_fss_IsPathSupported_state);
1825         NTSTATUS status;
1826         TALLOC_CTX *mem_ctx;
1827
1828         if (state->out_mem_ctx) {
1829                 mem_ctx = state->out_mem_ctx;
1830         } else {
1831                 mem_ctx = state;
1832         }
1833
1834         status = dcerpc_fss_IsPathSupported_r_recv(subreq, mem_ctx);
1835         TALLOC_FREE(subreq);
1836         if (tevent_req_nterror(req, status)) {
1837                 return;
1838         }
1839
1840         /* Copy out parameters */
1841         *state->orig.out.SupportedByThisProvider = *state->tmp.out.SupportedByThisProvider;
1842         *state->orig.out.OwnerMachineName = *state->tmp.out.OwnerMachineName;
1843
1844         /* Copy result */
1845         state->orig.out.result = state->tmp.out.result;
1846
1847         /* Reset temporary structure */
1848         ZERO_STRUCT(state->tmp);
1849
1850         tevent_req_done(req);
1851 }
1852
1853 NTSTATUS dcerpc_fss_IsPathSupported_recv(struct tevent_req *req,
1854                                          TALLOC_CTX *mem_ctx,
1855                                          uint32_t *result)
1856 {
1857         struct dcerpc_fss_IsPathSupported_state *state = tevent_req_data(
1858                 req, struct dcerpc_fss_IsPathSupported_state);
1859         NTSTATUS status;
1860
1861         if (tevent_req_is_nterror(req, &status)) {
1862                 tevent_req_received(req);
1863                 return status;
1864         }
1865
1866         /* Steal possible out parameters to the callers context */
1867         talloc_steal(mem_ctx, state->out_mem_ctx);
1868
1869         /* Return result */
1870         *result = state->orig.out.result;
1871
1872         tevent_req_received(req);
1873         return NT_STATUS_OK;
1874 }
1875
1876 NTSTATUS dcerpc_fss_IsPathSupported(struct dcerpc_binding_handle *h,
1877                                     TALLOC_CTX *mem_ctx,
1878                                     const char *_ShareName /* [in] [ref,charset(UTF16)] */,
1879                                     uint8_t _magic[52] /* [in]  */,
1880                                     uint32_t *_SupportedByThisProvider /* [out] [ref] */,
1881                                     const char **_OwnerMachineName /* [out] [ref,charset(UTF16)] */,
1882                                     uint32_t *result)
1883 {
1884         struct fss_IsPathSupported r;
1885         NTSTATUS status;
1886
1887         /* In parameters */
1888         r.in.ShareName = _ShareName;
1889         memcpy(r.in.magic, _magic, sizeof(r.in.magic));
1890
1891         status = dcerpc_fss_IsPathSupported_r(h, mem_ctx, &r);
1892         if (!NT_STATUS_IS_OK(status)) {
1893                 return status;
1894         }
1895
1896         /* Return variables */
1897         *_SupportedByThisProvider = *r.out.SupportedByThisProvider;
1898         *_OwnerMachineName = *r.out.OwnerMachineName;
1899
1900         /* Return result */
1901         *result = r.out.result;
1902
1903         return NT_STATUS_OK;
1904 }
1905
1906 struct dcerpc_fss_IsPathShadowCopied_r_state {
1907         TALLOC_CTX *out_mem_ctx;
1908 };
1909
1910 static void dcerpc_fss_IsPathShadowCopied_r_done(struct tevent_req *subreq);
1911
1912 struct tevent_req *dcerpc_fss_IsPathShadowCopied_r_send(TALLOC_CTX *mem_ctx,
1913         struct tevent_context *ev,
1914         struct dcerpc_binding_handle *h,
1915         struct fss_IsPathShadowCopied *r)
1916 {
1917         struct tevent_req *req;
1918         struct dcerpc_fss_IsPathShadowCopied_r_state *state;
1919         struct tevent_req *subreq;
1920
1921         req = tevent_req_create(mem_ctx, &state,
1922                                 struct dcerpc_fss_IsPathShadowCopied_r_state);
1923         if (req == NULL) {
1924                 return NULL;
1925         }
1926
1927         state->out_mem_ctx = talloc_new(state);
1928         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1929                 return tevent_req_post(req, ev);
1930         }
1931
1932         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1933                         NULL, &ndr_table_FileServerVssAgent,
1934                         NDR_FSS_ISPATHSHADOWCOPIED, state->out_mem_ctx, r);
1935         if (tevent_req_nomem(subreq, req)) {
1936                 return tevent_req_post(req, ev);
1937         }
1938         tevent_req_set_callback(subreq, dcerpc_fss_IsPathShadowCopied_r_done, req);
1939
1940         return req;
1941 }
1942
1943 static void dcerpc_fss_IsPathShadowCopied_r_done(struct tevent_req *subreq)
1944 {
1945         struct tevent_req *req =
1946                 tevent_req_callback_data(subreq,
1947                 struct tevent_req);
1948         NTSTATUS status;
1949
1950         status = dcerpc_binding_handle_call_recv(subreq);
1951         TALLOC_FREE(subreq);
1952         if (tevent_req_nterror(req, status)) {
1953                 return;
1954         }
1955
1956         tevent_req_done(req);
1957 }
1958
1959 NTSTATUS dcerpc_fss_IsPathShadowCopied_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1960 {
1961         struct dcerpc_fss_IsPathShadowCopied_r_state *state =
1962                 tevent_req_data(req,
1963                 struct dcerpc_fss_IsPathShadowCopied_r_state);
1964         NTSTATUS status;
1965
1966         if (tevent_req_is_nterror(req, &status)) {
1967                 tevent_req_received(req);
1968                 return status;
1969         }
1970
1971         talloc_steal(mem_ctx, state->out_mem_ctx);
1972
1973         tevent_req_received(req);
1974         return NT_STATUS_OK;
1975 }
1976
1977 NTSTATUS dcerpc_fss_IsPathShadowCopied_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_IsPathShadowCopied *r)
1978 {
1979         NTSTATUS status;
1980
1981         status = dcerpc_binding_handle_call(h,
1982                         NULL, &ndr_table_FileServerVssAgent,
1983                         NDR_FSS_ISPATHSHADOWCOPIED, mem_ctx, r);
1984
1985         return status;
1986 }
1987
1988 struct dcerpc_fss_IsPathShadowCopied_state {
1989         struct fss_IsPathShadowCopied orig;
1990         struct fss_IsPathShadowCopied tmp;
1991         TALLOC_CTX *out_mem_ctx;
1992 };
1993
1994 static void dcerpc_fss_IsPathShadowCopied_done(struct tevent_req *subreq);
1995
1996 struct tevent_req *dcerpc_fss_IsPathShadowCopied_send(TALLOC_CTX *mem_ctx,
1997                                                       struct tevent_context *ev,
1998                                                       struct dcerpc_binding_handle *h,
1999                                                       const char *_ShareName /* [in] [ref,charset(UTF16)] */,
2000                                                       uint32_t *_ShadowCopyPresent /* [out] [ref] */,
2001                                                       int32_t *_ShadowCopyCompatibility /* [out] [ref] */)
2002 {
2003         struct tevent_req *req;
2004         struct dcerpc_fss_IsPathShadowCopied_state *state;
2005         struct tevent_req *subreq;
2006
2007         req = tevent_req_create(mem_ctx, &state,
2008                                 struct dcerpc_fss_IsPathShadowCopied_state);
2009         if (req == NULL) {
2010                 return NULL;
2011         }
2012         state->out_mem_ctx = NULL;
2013
2014         /* In parameters */
2015         state->orig.in.ShareName = _ShareName;
2016
2017         /* Out parameters */
2018         state->orig.out.ShadowCopyPresent = _ShadowCopyPresent;
2019         state->orig.out.ShadowCopyCompatibility = _ShadowCopyCompatibility;
2020
2021         /* Result */
2022         ZERO_STRUCT(state->orig.out.result);
2023
2024         state->out_mem_ctx = talloc_named_const(state, 0,
2025                              "dcerpc_fss_IsPathShadowCopied_out_memory");
2026         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2027                 return tevent_req_post(req, ev);
2028         }
2029
2030         /* make a temporary copy, that we pass to the dispatch function */
2031         state->tmp = state->orig;
2032
2033         subreq = dcerpc_fss_IsPathShadowCopied_r_send(state, ev, h, &state->tmp);
2034         if (tevent_req_nomem(subreq, req)) {
2035                 return tevent_req_post(req, ev);
2036         }
2037         tevent_req_set_callback(subreq, dcerpc_fss_IsPathShadowCopied_done, req);
2038         return req;
2039 }
2040
2041 static void dcerpc_fss_IsPathShadowCopied_done(struct tevent_req *subreq)
2042 {
2043         struct tevent_req *req = tevent_req_callback_data(
2044                 subreq, struct tevent_req);
2045         struct dcerpc_fss_IsPathShadowCopied_state *state = tevent_req_data(
2046                 req, struct dcerpc_fss_IsPathShadowCopied_state);
2047         NTSTATUS status;
2048         TALLOC_CTX *mem_ctx;
2049
2050         if (state->out_mem_ctx) {
2051                 mem_ctx = state->out_mem_ctx;
2052         } else {
2053                 mem_ctx = state;
2054         }
2055
2056         status = dcerpc_fss_IsPathShadowCopied_r_recv(subreq, mem_ctx);
2057         TALLOC_FREE(subreq);
2058         if (tevent_req_nterror(req, status)) {
2059                 return;
2060         }
2061
2062         /* Copy out parameters */
2063         *state->orig.out.ShadowCopyPresent = *state->tmp.out.ShadowCopyPresent;
2064         *state->orig.out.ShadowCopyCompatibility = *state->tmp.out.ShadowCopyCompatibility;
2065
2066         /* Copy result */
2067         state->orig.out.result = state->tmp.out.result;
2068
2069         /* Reset temporary structure */
2070         ZERO_STRUCT(state->tmp);
2071
2072         tevent_req_done(req);
2073 }
2074
2075 NTSTATUS dcerpc_fss_IsPathShadowCopied_recv(struct tevent_req *req,
2076                                             TALLOC_CTX *mem_ctx,
2077                                             uint32_t *result)
2078 {
2079         struct dcerpc_fss_IsPathShadowCopied_state *state = tevent_req_data(
2080                 req, struct dcerpc_fss_IsPathShadowCopied_state);
2081         NTSTATUS status;
2082
2083         if (tevent_req_is_nterror(req, &status)) {
2084                 tevent_req_received(req);
2085                 return status;
2086         }
2087
2088         /* Steal possible out parameters to the callers context */
2089         talloc_steal(mem_ctx, state->out_mem_ctx);
2090
2091         /* Return result */
2092         *result = state->orig.out.result;
2093
2094         tevent_req_received(req);
2095         return NT_STATUS_OK;
2096 }
2097
2098 NTSTATUS dcerpc_fss_IsPathShadowCopied(struct dcerpc_binding_handle *h,
2099                                        TALLOC_CTX *mem_ctx,
2100                                        const char *_ShareName /* [in] [ref,charset(UTF16)] */,
2101                                        uint32_t *_ShadowCopyPresent /* [out] [ref] */,
2102                                        int32_t *_ShadowCopyCompatibility /* [out] [ref] */,
2103                                        uint32_t *result)
2104 {
2105         struct fss_IsPathShadowCopied r;
2106         NTSTATUS status;
2107
2108         /* In parameters */
2109         r.in.ShareName = _ShareName;
2110
2111         status = dcerpc_fss_IsPathShadowCopied_r(h, mem_ctx, &r);
2112         if (!NT_STATUS_IS_OK(status)) {
2113                 return status;
2114         }
2115
2116         /* Return variables */
2117         *_ShadowCopyPresent = *r.out.ShadowCopyPresent;
2118         *_ShadowCopyCompatibility = *r.out.ShadowCopyCompatibility;
2119
2120         /* Return result */
2121         *result = r.out.result;
2122
2123         return NT_STATUS_OK;
2124 }
2125
2126 struct dcerpc_fss_GetShareMapping_r_state {
2127         TALLOC_CTX *out_mem_ctx;
2128 };
2129
2130 static void dcerpc_fss_GetShareMapping_r_done(struct tevent_req *subreq);
2131
2132 struct tevent_req *dcerpc_fss_GetShareMapping_r_send(TALLOC_CTX *mem_ctx,
2133         struct tevent_context *ev,
2134         struct dcerpc_binding_handle *h,
2135         struct fss_GetShareMapping *r)
2136 {
2137         struct tevent_req *req;
2138         struct dcerpc_fss_GetShareMapping_r_state *state;
2139         struct tevent_req *subreq;
2140
2141         req = tevent_req_create(mem_ctx, &state,
2142                                 struct dcerpc_fss_GetShareMapping_r_state);
2143         if (req == NULL) {
2144                 return NULL;
2145         }
2146
2147         state->out_mem_ctx = talloc_new(state);
2148         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2149                 return tevent_req_post(req, ev);
2150         }
2151
2152         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2153                         NULL, &ndr_table_FileServerVssAgent,
2154                         NDR_FSS_GETSHAREMAPPING, state->out_mem_ctx, r);
2155         if (tevent_req_nomem(subreq, req)) {
2156                 return tevent_req_post(req, ev);
2157         }
2158         tevent_req_set_callback(subreq, dcerpc_fss_GetShareMapping_r_done, req);
2159
2160         return req;
2161 }
2162
2163 static void dcerpc_fss_GetShareMapping_r_done(struct tevent_req *subreq)
2164 {
2165         struct tevent_req *req =
2166                 tevent_req_callback_data(subreq,
2167                 struct tevent_req);
2168         NTSTATUS status;
2169
2170         status = dcerpc_binding_handle_call_recv(subreq);
2171         TALLOC_FREE(subreq);
2172         if (tevent_req_nterror(req, status)) {
2173                 return;
2174         }
2175
2176         tevent_req_done(req);
2177 }
2178
2179 NTSTATUS dcerpc_fss_GetShareMapping_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2180 {
2181         struct dcerpc_fss_GetShareMapping_r_state *state =
2182                 tevent_req_data(req,
2183                 struct dcerpc_fss_GetShareMapping_r_state);
2184         NTSTATUS status;
2185
2186         if (tevent_req_is_nterror(req, &status)) {
2187                 tevent_req_received(req);
2188                 return status;
2189         }
2190
2191         talloc_steal(mem_ctx, state->out_mem_ctx);
2192
2193         tevent_req_received(req);
2194         return NT_STATUS_OK;
2195 }
2196
2197 NTSTATUS dcerpc_fss_GetShareMapping_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_GetShareMapping *r)
2198 {
2199         NTSTATUS status;
2200
2201         status = dcerpc_binding_handle_call(h,
2202                         NULL, &ndr_table_FileServerVssAgent,
2203                         NDR_FSS_GETSHAREMAPPING, mem_ctx, r);
2204
2205         return status;
2206 }
2207
2208 struct dcerpc_fss_GetShareMapping_state {
2209         struct fss_GetShareMapping orig;
2210         struct fss_GetShareMapping tmp;
2211         TALLOC_CTX *out_mem_ctx;
2212 };
2213
2214 static void dcerpc_fss_GetShareMapping_done(struct tevent_req *subreq);
2215
2216 struct tevent_req *dcerpc_fss_GetShareMapping_send(TALLOC_CTX *mem_ctx,
2217                                                    struct tevent_context *ev,
2218                                                    struct dcerpc_binding_handle *h,
2219                                                    struct GUID _ShadowCopyId /* [in]  */,
2220                                                    struct GUID _ShadowCopySetId /* [in]  */,
2221                                                    const char *_ShareName /* [in] [ref,charset(UTF16)] */,
2222                                                    uint32_t _Level /* [in]  */,
2223                                                    union fssagent_share_mapping *_ShareMapping /* [out] [ref,switch_is(Level)] */)
2224 {
2225         struct tevent_req *req;
2226         struct dcerpc_fss_GetShareMapping_state *state;
2227         struct tevent_req *subreq;
2228
2229         req = tevent_req_create(mem_ctx, &state,
2230                                 struct dcerpc_fss_GetShareMapping_state);
2231         if (req == NULL) {
2232                 return NULL;
2233         }
2234         state->out_mem_ctx = NULL;
2235
2236         /* In parameters */
2237         state->orig.in.ShadowCopyId = _ShadowCopyId;
2238         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
2239         state->orig.in.ShareName = _ShareName;
2240         state->orig.in.Level = _Level;
2241
2242         /* Out parameters */
2243         state->orig.out.ShareMapping = _ShareMapping;
2244
2245         /* Result */
2246         ZERO_STRUCT(state->orig.out.result);
2247
2248         state->out_mem_ctx = talloc_named_const(state, 0,
2249                              "dcerpc_fss_GetShareMapping_out_memory");
2250         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2251                 return tevent_req_post(req, ev);
2252         }
2253
2254         /* make a temporary copy, that we pass to the dispatch function */
2255         state->tmp = state->orig;
2256
2257         subreq = dcerpc_fss_GetShareMapping_r_send(state, ev, h, &state->tmp);
2258         if (tevent_req_nomem(subreq, req)) {
2259                 return tevent_req_post(req, ev);
2260         }
2261         tevent_req_set_callback(subreq, dcerpc_fss_GetShareMapping_done, req);
2262         return req;
2263 }
2264
2265 static void dcerpc_fss_GetShareMapping_done(struct tevent_req *subreq)
2266 {
2267         struct tevent_req *req = tevent_req_callback_data(
2268                 subreq, struct tevent_req);
2269         struct dcerpc_fss_GetShareMapping_state *state = tevent_req_data(
2270                 req, struct dcerpc_fss_GetShareMapping_state);
2271         NTSTATUS status;
2272         TALLOC_CTX *mem_ctx;
2273
2274         if (state->out_mem_ctx) {
2275                 mem_ctx = state->out_mem_ctx;
2276         } else {
2277                 mem_ctx = state;
2278         }
2279
2280         status = dcerpc_fss_GetShareMapping_r_recv(subreq, mem_ctx);
2281         TALLOC_FREE(subreq);
2282         if (tevent_req_nterror(req, status)) {
2283                 return;
2284         }
2285
2286         /* Copy out parameters */
2287         *state->orig.out.ShareMapping = *state->tmp.out.ShareMapping;
2288
2289         /* Copy result */
2290         state->orig.out.result = state->tmp.out.result;
2291
2292         /* Reset temporary structure */
2293         ZERO_STRUCT(state->tmp);
2294
2295         tevent_req_done(req);
2296 }
2297
2298 NTSTATUS dcerpc_fss_GetShareMapping_recv(struct tevent_req *req,
2299                                          TALLOC_CTX *mem_ctx,
2300                                          uint32_t *result)
2301 {
2302         struct dcerpc_fss_GetShareMapping_state *state = tevent_req_data(
2303                 req, struct dcerpc_fss_GetShareMapping_state);
2304         NTSTATUS status;
2305
2306         if (tevent_req_is_nterror(req, &status)) {
2307                 tevent_req_received(req);
2308                 return status;
2309         }
2310
2311         /* Steal possible out parameters to the callers context */
2312         talloc_steal(mem_ctx, state->out_mem_ctx);
2313
2314         /* Return result */
2315         *result = state->orig.out.result;
2316
2317         tevent_req_received(req);
2318         return NT_STATUS_OK;
2319 }
2320
2321 NTSTATUS dcerpc_fss_GetShareMapping(struct dcerpc_binding_handle *h,
2322                                     TALLOC_CTX *mem_ctx,
2323                                     struct GUID _ShadowCopyId /* [in]  */,
2324                                     struct GUID _ShadowCopySetId /* [in]  */,
2325                                     const char *_ShareName /* [in] [ref,charset(UTF16)] */,
2326                                     uint32_t _Level /* [in]  */,
2327                                     union fssagent_share_mapping *_ShareMapping /* [out] [ref,switch_is(Level)] */,
2328                                     uint32_t *result)
2329 {
2330         struct fss_GetShareMapping r;
2331         NTSTATUS status;
2332
2333         /* In parameters */
2334         r.in.ShadowCopyId = _ShadowCopyId;
2335         r.in.ShadowCopySetId = _ShadowCopySetId;
2336         r.in.ShareName = _ShareName;
2337         r.in.Level = _Level;
2338
2339         status = dcerpc_fss_GetShareMapping_r(h, mem_ctx, &r);
2340         if (!NT_STATUS_IS_OK(status)) {
2341                 return status;
2342         }
2343
2344         /* Return variables */
2345         *_ShareMapping = *r.out.ShareMapping;
2346
2347         /* Return result */
2348         *result = r.out.result;
2349
2350         return NT_STATUS_OK;
2351 }
2352
2353 struct dcerpc_fss_DeleteShareMapping_r_state {
2354         TALLOC_CTX *out_mem_ctx;
2355 };
2356
2357 static void dcerpc_fss_DeleteShareMapping_r_done(struct tevent_req *subreq);
2358
2359 struct tevent_req *dcerpc_fss_DeleteShareMapping_r_send(TALLOC_CTX *mem_ctx,
2360         struct tevent_context *ev,
2361         struct dcerpc_binding_handle *h,
2362         struct fss_DeleteShareMapping *r)
2363 {
2364         struct tevent_req *req;
2365         struct dcerpc_fss_DeleteShareMapping_r_state *state;
2366         struct tevent_req *subreq;
2367
2368         req = tevent_req_create(mem_ctx, &state,
2369                                 struct dcerpc_fss_DeleteShareMapping_r_state);
2370         if (req == NULL) {
2371                 return NULL;
2372         }
2373
2374         state->out_mem_ctx = NULL;
2375
2376         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2377                         NULL, &ndr_table_FileServerVssAgent,
2378                         NDR_FSS_DELETESHAREMAPPING, state, r);
2379         if (tevent_req_nomem(subreq, req)) {
2380                 return tevent_req_post(req, ev);
2381         }
2382         tevent_req_set_callback(subreq, dcerpc_fss_DeleteShareMapping_r_done, req);
2383
2384         return req;
2385 }
2386
2387 static void dcerpc_fss_DeleteShareMapping_r_done(struct tevent_req *subreq)
2388 {
2389         struct tevent_req *req =
2390                 tevent_req_callback_data(subreq,
2391                 struct tevent_req);
2392         NTSTATUS status;
2393
2394         status = dcerpc_binding_handle_call_recv(subreq);
2395         TALLOC_FREE(subreq);
2396         if (tevent_req_nterror(req, status)) {
2397                 return;
2398         }
2399
2400         tevent_req_done(req);
2401 }
2402
2403 NTSTATUS dcerpc_fss_DeleteShareMapping_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2404 {
2405         struct dcerpc_fss_DeleteShareMapping_r_state *state =
2406                 tevent_req_data(req,
2407                 struct dcerpc_fss_DeleteShareMapping_r_state);
2408         NTSTATUS status;
2409
2410         if (tevent_req_is_nterror(req, &status)) {
2411                 tevent_req_received(req);
2412                 return status;
2413         }
2414
2415         talloc_steal(mem_ctx, state->out_mem_ctx);
2416
2417         tevent_req_received(req);
2418         return NT_STATUS_OK;
2419 }
2420
2421 NTSTATUS dcerpc_fss_DeleteShareMapping_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_DeleteShareMapping *r)
2422 {
2423         NTSTATUS status;
2424
2425         status = dcerpc_binding_handle_call(h,
2426                         NULL, &ndr_table_FileServerVssAgent,
2427                         NDR_FSS_DELETESHAREMAPPING, mem_ctx, r);
2428
2429         return status;
2430 }
2431
2432 struct dcerpc_fss_DeleteShareMapping_state {
2433         struct fss_DeleteShareMapping orig;
2434         struct fss_DeleteShareMapping tmp;
2435         TALLOC_CTX *out_mem_ctx;
2436 };
2437
2438 static void dcerpc_fss_DeleteShareMapping_done(struct tevent_req *subreq);
2439
2440 struct tevent_req *dcerpc_fss_DeleteShareMapping_send(TALLOC_CTX *mem_ctx,
2441                                                       struct tevent_context *ev,
2442                                                       struct dcerpc_binding_handle *h,
2443                                                       struct GUID _ShadowCopySetId /* [in]  */,
2444                                                       struct GUID _ShadowCopyId /* [in]  */,
2445                                                       const char *_ShareName /* [in] [ref,charset(UTF16)] */)
2446 {
2447         struct tevent_req *req;
2448         struct dcerpc_fss_DeleteShareMapping_state *state;
2449         struct tevent_req *subreq;
2450
2451         req = tevent_req_create(mem_ctx, &state,
2452                                 struct dcerpc_fss_DeleteShareMapping_state);
2453         if (req == NULL) {
2454                 return NULL;
2455         }
2456         state->out_mem_ctx = NULL;
2457
2458         /* In parameters */
2459         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
2460         state->orig.in.ShadowCopyId = _ShadowCopyId;
2461         state->orig.in.ShareName = _ShareName;
2462
2463         /* Out parameters */
2464
2465         /* Result */
2466         ZERO_STRUCT(state->orig.out.result);
2467
2468         /* make a temporary copy, that we pass to the dispatch function */
2469         state->tmp = state->orig;
2470
2471         subreq = dcerpc_fss_DeleteShareMapping_r_send(state, ev, h, &state->tmp);
2472         if (tevent_req_nomem(subreq, req)) {
2473                 return tevent_req_post(req, ev);
2474         }
2475         tevent_req_set_callback(subreq, dcerpc_fss_DeleteShareMapping_done, req);
2476         return req;
2477 }
2478
2479 static void dcerpc_fss_DeleteShareMapping_done(struct tevent_req *subreq)
2480 {
2481         struct tevent_req *req = tevent_req_callback_data(
2482                 subreq, struct tevent_req);
2483         struct dcerpc_fss_DeleteShareMapping_state *state = tevent_req_data(
2484                 req, struct dcerpc_fss_DeleteShareMapping_state);
2485         NTSTATUS status;
2486         TALLOC_CTX *mem_ctx;
2487
2488         if (state->out_mem_ctx) {
2489                 mem_ctx = state->out_mem_ctx;
2490         } else {
2491                 mem_ctx = state;
2492         }
2493
2494         status = dcerpc_fss_DeleteShareMapping_r_recv(subreq, mem_ctx);
2495         TALLOC_FREE(subreq);
2496         if (tevent_req_nterror(req, status)) {
2497                 return;
2498         }
2499
2500         /* Copy out parameters */
2501
2502         /* Copy result */
2503         state->orig.out.result = state->tmp.out.result;
2504
2505         /* Reset temporary structure */
2506         ZERO_STRUCT(state->tmp);
2507
2508         tevent_req_done(req);
2509 }
2510
2511 NTSTATUS dcerpc_fss_DeleteShareMapping_recv(struct tevent_req *req,
2512                                             TALLOC_CTX *mem_ctx,
2513                                             uint32_t *result)
2514 {
2515         struct dcerpc_fss_DeleteShareMapping_state *state = tevent_req_data(
2516                 req, struct dcerpc_fss_DeleteShareMapping_state);
2517         NTSTATUS status;
2518
2519         if (tevent_req_is_nterror(req, &status)) {
2520                 tevent_req_received(req);
2521                 return status;
2522         }
2523
2524         /* Steal possible out parameters to the callers context */
2525         talloc_steal(mem_ctx, state->out_mem_ctx);
2526
2527         /* Return result */
2528         *result = state->orig.out.result;
2529
2530         tevent_req_received(req);
2531         return NT_STATUS_OK;
2532 }
2533
2534 NTSTATUS dcerpc_fss_DeleteShareMapping(struct dcerpc_binding_handle *h,
2535                                        TALLOC_CTX *mem_ctx,
2536                                        struct GUID _ShadowCopySetId /* [in]  */,
2537                                        struct GUID _ShadowCopyId /* [in]  */,
2538                                        const char *_ShareName /* [in] [ref,charset(UTF16)] */,
2539                                        uint32_t *result)
2540 {
2541         struct fss_DeleteShareMapping r;
2542         NTSTATUS status;
2543
2544         /* In parameters */
2545         r.in.ShadowCopySetId = _ShadowCopySetId;
2546         r.in.ShadowCopyId = _ShadowCopyId;
2547         r.in.ShareName = _ShareName;
2548
2549         status = dcerpc_fss_DeleteShareMapping_r(h, mem_ctx, &r);
2550         if (!NT_STATUS_IS_OK(status)) {
2551                 return status;
2552         }
2553
2554         /* Return variables */
2555
2556         /* Return result */
2557         *result = r.out.result;
2558
2559         return NT_STATUS_OK;
2560 }
2561
2562 struct dcerpc_fss_PrepareShadowCopySet_r_state {
2563         TALLOC_CTX *out_mem_ctx;
2564 };
2565
2566 static void dcerpc_fss_PrepareShadowCopySet_r_done(struct tevent_req *subreq);
2567
2568 struct tevent_req *dcerpc_fss_PrepareShadowCopySet_r_send(TALLOC_CTX *mem_ctx,
2569         struct tevent_context *ev,
2570         struct dcerpc_binding_handle *h,
2571         struct fss_PrepareShadowCopySet *r)
2572 {
2573         struct tevent_req *req;
2574         struct dcerpc_fss_PrepareShadowCopySet_r_state *state;
2575         struct tevent_req *subreq;
2576
2577         req = tevent_req_create(mem_ctx, &state,
2578                                 struct dcerpc_fss_PrepareShadowCopySet_r_state);
2579         if (req == NULL) {
2580                 return NULL;
2581         }
2582
2583         state->out_mem_ctx = NULL;
2584
2585         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2586                         NULL, &ndr_table_FileServerVssAgent,
2587                         NDR_FSS_PREPARESHADOWCOPYSET, state, r);
2588         if (tevent_req_nomem(subreq, req)) {
2589                 return tevent_req_post(req, ev);
2590         }
2591         tevent_req_set_callback(subreq, dcerpc_fss_PrepareShadowCopySet_r_done, req);
2592
2593         return req;
2594 }
2595
2596 static void dcerpc_fss_PrepareShadowCopySet_r_done(struct tevent_req *subreq)
2597 {
2598         struct tevent_req *req =
2599                 tevent_req_callback_data(subreq,
2600                 struct tevent_req);
2601         NTSTATUS status;
2602
2603         status = dcerpc_binding_handle_call_recv(subreq);
2604         TALLOC_FREE(subreq);
2605         if (tevent_req_nterror(req, status)) {
2606                 return;
2607         }
2608
2609         tevent_req_done(req);
2610 }
2611
2612 NTSTATUS dcerpc_fss_PrepareShadowCopySet_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2613 {
2614         struct dcerpc_fss_PrepareShadowCopySet_r_state *state =
2615                 tevent_req_data(req,
2616                 struct dcerpc_fss_PrepareShadowCopySet_r_state);
2617         NTSTATUS status;
2618
2619         if (tevent_req_is_nterror(req, &status)) {
2620                 tevent_req_received(req);
2621                 return status;
2622         }
2623
2624         talloc_steal(mem_ctx, state->out_mem_ctx);
2625
2626         tevent_req_received(req);
2627         return NT_STATUS_OK;
2628 }
2629
2630 NTSTATUS dcerpc_fss_PrepareShadowCopySet_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct fss_PrepareShadowCopySet *r)
2631 {
2632         NTSTATUS status;
2633
2634         status = dcerpc_binding_handle_call(h,
2635                         NULL, &ndr_table_FileServerVssAgent,
2636                         NDR_FSS_PREPARESHADOWCOPYSET, mem_ctx, r);
2637
2638         return status;
2639 }
2640
2641 struct dcerpc_fss_PrepareShadowCopySet_state {
2642         struct fss_PrepareShadowCopySet orig;
2643         struct fss_PrepareShadowCopySet tmp;
2644         TALLOC_CTX *out_mem_ctx;
2645 };
2646
2647 static void dcerpc_fss_PrepareShadowCopySet_done(struct tevent_req *subreq);
2648
2649 struct tevent_req *dcerpc_fss_PrepareShadowCopySet_send(TALLOC_CTX *mem_ctx,
2650                                                         struct tevent_context *ev,
2651                                                         struct dcerpc_binding_handle *h,
2652                                                         struct GUID _ShadowCopySetId /* [in]  */,
2653                                                         uint32_t _TimeOutInMilliseconds /* [in]  */)
2654 {
2655         struct tevent_req *req;
2656         struct dcerpc_fss_PrepareShadowCopySet_state *state;
2657         struct tevent_req *subreq;
2658
2659         req = tevent_req_create(mem_ctx, &state,
2660                                 struct dcerpc_fss_PrepareShadowCopySet_state);
2661         if (req == NULL) {
2662                 return NULL;
2663         }
2664         state->out_mem_ctx = NULL;
2665
2666         /* In parameters */
2667         state->orig.in.ShadowCopySetId = _ShadowCopySetId;
2668         state->orig.in.TimeOutInMilliseconds = _TimeOutInMilliseconds;
2669
2670         /* Out parameters */
2671
2672         /* Result */
2673         ZERO_STRUCT(state->orig.out.result);
2674
2675         /* make a temporary copy, that we pass to the dispatch function */
2676         state->tmp = state->orig;
2677
2678         subreq = dcerpc_fss_PrepareShadowCopySet_r_send(state, ev, h, &state->tmp);
2679         if (tevent_req_nomem(subreq, req)) {
2680                 return tevent_req_post(req, ev);
2681         }
2682         tevent_req_set_callback(subreq, dcerpc_fss_PrepareShadowCopySet_done, req);
2683         return req;
2684 }
2685
2686 static void dcerpc_fss_PrepareShadowCopySet_done(struct tevent_req *subreq)
2687 {
2688         struct tevent_req *req = tevent_req_callback_data(
2689                 subreq, struct tevent_req);
2690         struct dcerpc_fss_PrepareShadowCopySet_state *state = tevent_req_data(
2691                 req, struct dcerpc_fss_PrepareShadowCopySet_state);
2692         NTSTATUS status;
2693         TALLOC_CTX *mem_ctx;
2694
2695         if (state->out_mem_ctx) {
2696                 mem_ctx = state->out_mem_ctx;
2697         } else {
2698                 mem_ctx = state;
2699         }
2700
2701         status = dcerpc_fss_PrepareShadowCopySet_r_recv(subreq, mem_ctx);
2702         TALLOC_FREE(subreq);
2703         if (tevent_req_nterror(req, status)) {
2704                 return;
2705         }
2706
2707         /* Copy out parameters */
2708
2709         /* Copy result */
2710         state->orig.out.result = state->tmp.out.result;
2711
2712         /* Reset temporary structure */
2713         ZERO_STRUCT(state->tmp);
2714
2715         tevent_req_done(req);
2716 }
2717
2718 NTSTATUS dcerpc_fss_PrepareShadowCopySet_recv(struct tevent_req *req,
2719                                               TALLOC_CTX *mem_ctx,
2720                                               uint32_t *result)
2721 {
2722         struct dcerpc_fss_PrepareShadowCopySet_state *state = tevent_req_data(
2723                 req, struct dcerpc_fss_PrepareShadowCopySet_state);
2724         NTSTATUS status;
2725
2726         if (tevent_req_is_nterror(req, &status)) {
2727                 tevent_req_received(req);
2728                 return status;
2729         }
2730
2731         /* Steal possible out parameters to the callers context */
2732         talloc_steal(mem_ctx, state->out_mem_ctx);
2733
2734         /* Return result */
2735         *result = state->orig.out.result;
2736
2737         tevent_req_received(req);
2738         return NT_STATUS_OK;
2739 }
2740
2741 NTSTATUS dcerpc_fss_PrepareShadowCopySet(struct dcerpc_binding_handle *h,
2742                                          TALLOC_CTX *mem_ctx,
2743                                          struct GUID _ShadowCopySetId /* [in]  */,
2744                                          uint32_t _TimeOutInMilliseconds /* [in]  */,
2745                                          uint32_t *result)
2746 {
2747         struct fss_PrepareShadowCopySet r;
2748         NTSTATUS status;
2749
2750         /* In parameters */
2751         r.in.ShadowCopySetId = _ShadowCopySetId;
2752         r.in.TimeOutInMilliseconds = _TimeOutInMilliseconds;
2753
2754         status = dcerpc_fss_PrepareShadowCopySet_r(h, mem_ctx, &r);
2755         if (!NT_STATUS_IS_OK(status)) {
2756                 return status;
2757         }
2758
2759         /* Return variables */
2760
2761         /* Return result */
2762         *result = r.out.result;
2763
2764         return NT_STATUS_OK;
2765 }
2766