1 /* client functions auto-generated by pidl */
5 #include "lib/util/tevent_ntstatus.h"
6 #include "bin/default/librpc/gen_ndr/ndr_remact.h"
7 #include "bin/default/librpc/gen_ndr/ndr_remact_c.h"
9 /* IRemoteActivation - client functions generated by pidl */
11 struct dcerpc_RemoteActivation_r_state {
12 TALLOC_CTX *out_mem_ctx;
15 static void dcerpc_RemoteActivation_r_done(struct tevent_req *subreq);
17 struct tevent_req *dcerpc_RemoteActivation_r_send(TALLOC_CTX *mem_ctx,
18 struct tevent_context *ev,
19 struct dcerpc_binding_handle *h,
20 struct RemoteActivation *r)
22 struct tevent_req *req;
23 struct dcerpc_RemoteActivation_r_state *state;
24 struct tevent_req *subreq;
26 req = tevent_req_create(mem_ctx, &state,
27 struct dcerpc_RemoteActivation_r_state);
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);
37 subreq = dcerpc_binding_handle_call_send(state, ev, h,
38 NULL, &ndr_table_IRemoteActivation,
39 NDR_REMOTEACTIVATION, state->out_mem_ctx, r);
40 if (tevent_req_nomem(subreq, req)) {
41 return tevent_req_post(req, ev);
43 tevent_req_set_callback(subreq, dcerpc_RemoteActivation_r_done, req);
48 static void dcerpc_RemoteActivation_r_done(struct tevent_req *subreq)
50 struct tevent_req *req =
51 tevent_req_callback_data(subreq,
55 status = dcerpc_binding_handle_call_recv(subreq);
57 if (tevent_req_nterror(req, status)) {
64 NTSTATUS dcerpc_RemoteActivation_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
66 struct dcerpc_RemoteActivation_r_state *state =
68 struct dcerpc_RemoteActivation_r_state);
71 if (tevent_req_is_nterror(req, &status)) {
72 tevent_req_received(req);
76 talloc_steal(mem_ctx, state->out_mem_ctx);
78 tevent_req_received(req);
82 NTSTATUS dcerpc_RemoteActivation_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct RemoteActivation *r)
86 status = dcerpc_binding_handle_call(h,
87 NULL, &ndr_table_IRemoteActivation,
88 NDR_REMOTEACTIVATION, mem_ctx, r);
93 struct dcerpc_RemoteActivation_state {
94 struct RemoteActivation orig;
95 struct RemoteActivation tmp;
96 TALLOC_CTX *out_mem_ctx;
99 static void dcerpc_RemoteActivation_done(struct tevent_req *subreq);
101 struct tevent_req *dcerpc_RemoteActivation_send(TALLOC_CTX *mem_ctx,
102 struct tevent_context *ev,
103 struct dcerpc_binding_handle *h,
104 struct ORPCTHIS _this_object /* [in] */,
105 struct ORPCTHAT *_that /* [out] [ref] */,
106 struct GUID _Clsid /* [in] */,
107 const char *_pwszObjectName /* [in] [ref,charset(UTF16)] */,
108 struct MInterfacePointer *_pObjectStorage /* [in] [ref] */,
109 uint32_t _ClientImpLevel /* [in] */,
110 uint32_t _Mode /* [in] */,
111 uint32_t _Interfaces /* [in] [range(1,32768)] */,
112 struct GUID *_pIIDs /* [in] [ref,size_is(Interfaces)] */,
113 uint16_t _num_protseqs /* [in] */,
114 uint16_t *_protseq /* [in] [size_is(num_protseqs)] */,
115 uint64_t *_pOxid /* [out] [ref] */,
116 struct DUALSTRINGARRAY *_pdsaOxidBindings /* [out] [ref] */,
117 struct GUID *_ipidRemUnknown /* [out] [ref] */,
118 uint32_t *_AuthnHint /* [out] [ref] */,
119 struct COMVERSION *_ServerVersion /* [out] [ref] */,
120 WERROR *_hr /* [out] [ref] */,
121 struct MInterfacePointer **_ifaces /* [out] [ref,size_is(Interfaces)] */,
122 WERROR *_results /* [out] [size_is(Interfaces)] */)
124 struct tevent_req *req;
125 struct dcerpc_RemoteActivation_state *state;
126 struct tevent_req *subreq;
128 req = tevent_req_create(mem_ctx, &state,
129 struct dcerpc_RemoteActivation_state);
133 state->out_mem_ctx = NULL;
136 state->orig.in.this_object = _this_object;
137 state->orig.in.Clsid = _Clsid;
138 state->orig.in.pwszObjectName = _pwszObjectName;
139 state->orig.in.pObjectStorage = _pObjectStorage;
140 state->orig.in.ClientImpLevel = _ClientImpLevel;
141 state->orig.in.Mode = _Mode;
142 state->orig.in.Interfaces = _Interfaces;
143 state->orig.in.pIIDs = _pIIDs;
144 state->orig.in.num_protseqs = _num_protseqs;
145 state->orig.in.protseq = _protseq;
148 state->orig.out.that = _that;
149 state->orig.out.pOxid = _pOxid;
150 state->orig.out.pdsaOxidBindings = _pdsaOxidBindings;
151 state->orig.out.ipidRemUnknown = _ipidRemUnknown;
152 state->orig.out.AuthnHint = _AuthnHint;
153 state->orig.out.ServerVersion = _ServerVersion;
154 state->orig.out.hr = _hr;
155 state->orig.out.ifaces = _ifaces;
156 state->orig.out.results = _results;
159 ZERO_STRUCT(state->orig.out.result);
161 state->out_mem_ctx = talloc_named_const(state, 0,
162 "dcerpc_RemoteActivation_out_memory");
163 if (tevent_req_nomem(state->out_mem_ctx, req)) {
164 return tevent_req_post(req, ev);
167 /* make a temporary copy, that we pass to the dispatch function */
168 state->tmp = state->orig;
170 subreq = dcerpc_RemoteActivation_r_send(state, ev, h, &state->tmp);
171 if (tevent_req_nomem(subreq, req)) {
172 return tevent_req_post(req, ev);
174 tevent_req_set_callback(subreq, dcerpc_RemoteActivation_done, req);
178 static void dcerpc_RemoteActivation_done(struct tevent_req *subreq)
180 struct tevent_req *req = tevent_req_callback_data(
181 subreq, struct tevent_req);
182 struct dcerpc_RemoteActivation_state *state = tevent_req_data(
183 req, struct dcerpc_RemoteActivation_state);
187 if (state->out_mem_ctx) {
188 mem_ctx = state->out_mem_ctx;
193 status = dcerpc_RemoteActivation_r_recv(subreq, mem_ctx);
195 if (tevent_req_nterror(req, status)) {
199 /* Copy out parameters */
200 *state->orig.out.that = *state->tmp.out.that;
201 *state->orig.out.pOxid = *state->tmp.out.pOxid;
202 *state->orig.out.pdsaOxidBindings = *state->tmp.out.pdsaOxidBindings;
203 *state->orig.out.ipidRemUnknown = *state->tmp.out.ipidRemUnknown;
204 *state->orig.out.AuthnHint = *state->tmp.out.AuthnHint;
205 *state->orig.out.ServerVersion = *state->tmp.out.ServerVersion;
206 *state->orig.out.hr = *state->tmp.out.hr;
208 size_t _copy_len_ifaces;
209 _copy_len_ifaces = state->tmp.in.Interfaces;
210 memcpy(state->orig.out.ifaces, state->tmp.out.ifaces, _copy_len_ifaces * sizeof(*state->orig.out.ifaces));
213 size_t _copy_len_results;
214 _copy_len_results = state->tmp.in.Interfaces;
215 memcpy(state->orig.out.results, state->tmp.out.results, _copy_len_results * sizeof(*state->orig.out.results));
219 state->orig.out.result = state->tmp.out.result;
221 /* Reset temporary structure */
222 ZERO_STRUCT(state->tmp);
224 tevent_req_done(req);
227 NTSTATUS dcerpc_RemoteActivation_recv(struct tevent_req *req,
231 struct dcerpc_RemoteActivation_state *state = tevent_req_data(
232 req, struct dcerpc_RemoteActivation_state);
235 if (tevent_req_is_nterror(req, &status)) {
236 tevent_req_received(req);
240 /* Steal possible out parameters to the callers context */
241 talloc_steal(mem_ctx, state->out_mem_ctx);
244 *result = state->orig.out.result;
246 tevent_req_received(req);
250 NTSTATUS dcerpc_RemoteActivation(struct dcerpc_binding_handle *h,
252 struct ORPCTHIS _this_object /* [in] */,
253 struct ORPCTHAT *_that /* [out] [ref] */,
254 struct GUID _Clsid /* [in] */,
255 const char *_pwszObjectName /* [in] [ref,charset(UTF16)] */,
256 struct MInterfacePointer *_pObjectStorage /* [in] [ref] */,
257 uint32_t _ClientImpLevel /* [in] */,
258 uint32_t _Mode /* [in] */,
259 uint32_t _Interfaces /* [in] [range(1,32768)] */,
260 struct GUID *_pIIDs /* [in] [ref,size_is(Interfaces)] */,
261 uint16_t _num_protseqs /* [in] */,
262 uint16_t *_protseq /* [in] [size_is(num_protseqs)] */,
263 uint64_t *_pOxid /* [out] [ref] */,
264 struct DUALSTRINGARRAY *_pdsaOxidBindings /* [out] [ref] */,
265 struct GUID *_ipidRemUnknown /* [out] [ref] */,
266 uint32_t *_AuthnHint /* [out] [ref] */,
267 struct COMVERSION *_ServerVersion /* [out] [ref] */,
268 WERROR *_hr /* [out] [ref] */,
269 struct MInterfacePointer **_ifaces /* [out] [ref,size_is(Interfaces)] */,
270 WERROR *_results /* [out] [size_is(Interfaces)] */,
273 struct RemoteActivation r;
277 r.in.this_object = _this_object;
279 r.in.pwszObjectName = _pwszObjectName;
280 r.in.pObjectStorage = _pObjectStorage;
281 r.in.ClientImpLevel = _ClientImpLevel;
283 r.in.Interfaces = _Interfaces;
285 r.in.num_protseqs = _num_protseqs;
286 r.in.protseq = _protseq;
288 status = dcerpc_RemoteActivation_r(h, mem_ctx, &r);
289 if (!NT_STATUS_IS_OK(status)) {
293 /* Return variables */
294 *_that = *r.out.that;
295 *_pOxid = *r.out.pOxid;
296 *_pdsaOxidBindings = *r.out.pdsaOxidBindings;
297 *_ipidRemUnknown = *r.out.ipidRemUnknown;
298 *_AuthnHint = *r.out.AuthnHint;
299 *_ServerVersion = *r.out.ServerVersion;
302 size_t _copy_len_ifaces;
303 _copy_len_ifaces = r.in.Interfaces;
304 memcpy(_ifaces, r.out.ifaces, _copy_len_ifaces * sizeof(*_ifaces));
307 size_t _copy_len_results;
308 _copy_len_results = r.in.Interfaces;
309 memcpy(_results, r.out.results, _copy_len_results * sizeof(*_results));
313 *result = r.out.result;