2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
7 #include "librpc/gen_ndr/cli_wbint.h"
9 struct rpccli_wbint_Ping_state {
10 struct wbint_Ping orig;
11 struct wbint_Ping tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_wbint_Ping_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint32_t _in_data /* [in] */,
22 uint32_t *_out_data /* [out] [ref] */)
24 struct tevent_req *req;
25 struct rpccli_wbint_Ping_state *state;
26 struct tevent_req *subreq;
28 req = tevent_req_create(mem_ctx, &state,
29 struct rpccli_wbint_Ping_state);
33 state->out_mem_ctx = NULL;
34 state->dispatch_recv = cli->dispatch_recv;
37 state->orig.in.in_data = _in_data;
40 state->orig.out.out_data = _out_data;
42 if (DEBUGLEVEL >= 10) {
43 NDR_PRINT_IN_DEBUG(wbint_Ping, &state->orig);
46 state->out_mem_ctx = talloc_named_const(state, 0,
47 "rpccli_wbint_Ping_out_memory");
48 if (tevent_req_nomem(state->out_mem_ctx, req)) {
49 return tevent_req_post(req, ev);
52 /* make a temporary copy, that we pass to the dispatch function */
53 state->tmp = state->orig;
55 subreq = cli->dispatch_send(state, ev, cli,
59 if (tevent_req_nomem(subreq, req)) {
60 return tevent_req_post(req, ev);
62 tevent_req_set_callback(subreq, rpccli_wbint_Ping_done, req);
66 static void rpccli_wbint_Ping_done(struct tevent_req *subreq)
68 struct tevent_req *req = tevent_req_callback_data(
69 subreq, struct tevent_req);
70 struct rpccli_wbint_Ping_state *state = tevent_req_data(
71 req, struct rpccli_wbint_Ping_state);
75 if (state->out_mem_ctx) {
76 mem_ctx = state->out_mem_ctx;
81 status = state->dispatch_recv(subreq, mem_ctx);
83 if (!NT_STATUS_IS_OK(status)) {
84 tevent_req_nterror(req, status);
88 /* Copy out parameters */
89 *state->orig.out.out_data = *state->tmp.out.out_data;
91 /* Reset temporary structure */
92 ZERO_STRUCT(state->tmp);
94 if (DEBUGLEVEL >= 10) {
95 NDR_PRINT_OUT_DEBUG(wbint_Ping, &state->orig);
101 NTSTATUS rpccli_wbint_Ping_recv(struct tevent_req *req,
104 struct rpccli_wbint_Ping_state *state = tevent_req_data(
105 req, struct rpccli_wbint_Ping_state);
108 if (tevent_req_is_nterror(req, &status)) {
109 tevent_req_received(req);
113 /* Steal possbile out parameters to the callers context */
114 talloc_steal(mem_ctx, state->out_mem_ctx);
116 tevent_req_received(req);
120 NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli,
122 uint32_t in_data /* [in] */,
123 uint32_t *out_data /* [out] [ref] */)
129 r.in.in_data = in_data;
131 if (DEBUGLEVEL >= 10) {
132 NDR_PRINT_IN_DEBUG(wbint_Ping, &r);
135 status = cli->dispatch(cli,
141 if (!NT_STATUS_IS_OK(status)) {
145 if (DEBUGLEVEL >= 10) {
146 NDR_PRINT_OUT_DEBUG(wbint_Ping, &r);
149 if (NT_STATUS_IS_ERR(status)) {
153 /* Return variables */
154 *out_data = *r.out.out_data;
160 struct rpccli_wbint_LookupSid_state {
161 struct wbint_LookupSid orig;
162 struct wbint_LookupSid tmp;
163 TALLOC_CTX *out_mem_ctx;
164 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
167 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq);
169 struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx,
170 struct tevent_context *ev,
171 struct rpc_pipe_client *cli,
172 struct dom_sid *_sid /* [in] [ref] */,
173 enum lsa_SidType *_type /* [out] [ref] */,
174 const char **_domain /* [out] [ref,charset(UTF8)] */,
175 const char **_name /* [out] [ref,charset(UTF8)] */)
177 struct tevent_req *req;
178 struct rpccli_wbint_LookupSid_state *state;
179 struct tevent_req *subreq;
181 req = tevent_req_create(mem_ctx, &state,
182 struct rpccli_wbint_LookupSid_state);
186 state->out_mem_ctx = NULL;
187 state->dispatch_recv = cli->dispatch_recv;
190 state->orig.in.sid = _sid;
193 state->orig.out.type = _type;
194 state->orig.out.domain = _domain;
195 state->orig.out.name = _name;
198 ZERO_STRUCT(state->orig.out.result);
200 if (DEBUGLEVEL >= 10) {
201 NDR_PRINT_IN_DEBUG(wbint_LookupSid, &state->orig);
204 state->out_mem_ctx = talloc_named_const(state, 0,
205 "rpccli_wbint_LookupSid_out_memory");
206 if (tevent_req_nomem(state->out_mem_ctx, req)) {
207 return tevent_req_post(req, ev);
210 /* make a temporary copy, that we pass to the dispatch function */
211 state->tmp = state->orig;
213 subreq = cli->dispatch_send(state, ev, cli,
217 if (tevent_req_nomem(subreq, req)) {
218 return tevent_req_post(req, ev);
220 tevent_req_set_callback(subreq, rpccli_wbint_LookupSid_done, req);
224 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq)
226 struct tevent_req *req = tevent_req_callback_data(
227 subreq, struct tevent_req);
228 struct rpccli_wbint_LookupSid_state *state = tevent_req_data(
229 req, struct rpccli_wbint_LookupSid_state);
233 if (state->out_mem_ctx) {
234 mem_ctx = state->out_mem_ctx;
239 status = state->dispatch_recv(subreq, mem_ctx);
241 if (!NT_STATUS_IS_OK(status)) {
242 tevent_req_nterror(req, status);
246 /* Copy out parameters */
247 *state->orig.out.type = *state->tmp.out.type;
248 *state->orig.out.domain = *state->tmp.out.domain;
249 *state->orig.out.name = *state->tmp.out.name;
252 state->orig.out.result = state->tmp.out.result;
254 /* Reset temporary structure */
255 ZERO_STRUCT(state->tmp);
257 if (DEBUGLEVEL >= 10) {
258 NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &state->orig);
261 tevent_req_done(req);
264 NTSTATUS rpccli_wbint_LookupSid_recv(struct tevent_req *req,
268 struct rpccli_wbint_LookupSid_state *state = tevent_req_data(
269 req, struct rpccli_wbint_LookupSid_state);
272 if (tevent_req_is_nterror(req, &status)) {
273 tevent_req_received(req);
277 /* Steal possbile out parameters to the callers context */
278 talloc_steal(mem_ctx, state->out_mem_ctx);
281 *result = state->orig.out.result;
283 tevent_req_received(req);
287 NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli,
289 struct dom_sid *sid /* [in] [ref] */,
290 enum lsa_SidType *type /* [out] [ref] */,
291 const char **domain /* [out] [ref,charset(UTF8)] */,
292 const char **name /* [out] [ref,charset(UTF8)] */)
294 struct wbint_LookupSid r;
300 if (DEBUGLEVEL >= 10) {
301 NDR_PRINT_IN_DEBUG(wbint_LookupSid, &r);
304 status = cli->dispatch(cli,
310 if (!NT_STATUS_IS_OK(status)) {
314 if (DEBUGLEVEL >= 10) {
315 NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &r);
318 if (NT_STATUS_IS_ERR(status)) {
322 /* Return variables */
324 *domain = *r.out.domain;