git add -f bin/default/librpc/gen_ndr/*.{c,h,ndr,pidl} bin/default/source*/librpc...
[metze/samba/wip.git] / bin / default / source4 / librpc / gen_ndr / s3compat_winstation.c
1 #include "includes.h"
2 #include "ntdomain.h"
3 #include "lib/util/tevent_ntstatus.h"
4 #include "librpc/rpc/dcerpc_connection.h"
5 #include "bin/default/source4/librpc/gen_ndr/s3compat_winstation.h"
6
7 struct _s3_compat_winstation_foo_state {
8         struct tevent_context *ev;
9         struct dcerpc_call_handle *call;
10         struct winstation_foo *r;
11 };
12
13 static struct tevent_req *_s3_compat_winstation_foo_send(TALLOC_CTX *mem_ctx,
14                                                          struct tevent_context *ev,
15                                                          struct dcerpc_call_handle *call,
16                                                          struct winstation_foo *r)
17 {
18         struct tevent_req *req;
19         struct _s3_compat_winstation_foo_state *state;
20         struct pipes_struct *p;
21
22         req = tevent_req_create(mem_ctx, &state,
23                                 struct _s3_compat_winstation_foo_state);
24         if (req == NULL) {
25                 return NULL;
26         }
27         state->ev = ev;
28         state->call = call;
29         state->r = r;
30
31         p = dcerpc_call_handle_get_pipes_struct(call);
32         if (p == NULL) {
33                 tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
34                 return tevent_req_post(req, ev);
35         }
36
37         _winstation_foo(p, r);
38
39         if (p->fault_state) {
40                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
41                 tevent_req_nterror(req, status);
42                 return tevent_req_post(req, ev);
43         }
44
45         tevent_req_done(req);
46         return tevent_req_post(req, ev);
47 }
48
49 static NTSTATUS _s3_compat_winstation_foo_recv(struct tevent_req *req)
50 {
51         return tevent_req_simple_recv_ntstatus(req);
52 }
53
54
55 static const struct dcerpc_call_entry_point_fns _s3_compat_winstation_fns[] = {
56         {
57                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
58                         _s3_compat_winstation_foo_send,
59                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
60                         _s3_compat_winstation_foo_recv,
61         },
62         {
63                 .send_fn = NULL,
64                 .recv_fn = NULL,
65         },
66 };
67
68 static const struct dcerpc_call_entry_point_vector _s3_compat_winstation_epv[] = {
69         {
70         .name = "_s3_compat_winstation",
71         .table = &ndr_table_winstation,
72         .num_fns = 1,
73         .fns = _s3_compat_winstation_fns,
74         },
75 };
76
77 NTSTATUS dcerpc_server_setup_s3compat_winstation(struct dcerpc_server *server)
78 {
79         return NT_STATUS_NOT_IMPLEMENTED;
80 }