1 | /*
|
---|
2 | * Unix SMB/CIFS implementation.
|
---|
3 | * client auto-generated by pidl. DO NOT MODIFY!
|
---|
4 | */
|
---|
5 |
|
---|
6 | #include "includes.h"
|
---|
7 | #include "../librpc/gen_ndr/cli_samr.h"
|
---|
8 |
|
---|
9 | struct rpccli_samr_Connect_state {
|
---|
10 | struct samr_Connect orig;
|
---|
11 | struct samr_Connect tmp;
|
---|
12 | TALLOC_CTX *out_mem_ctx;
|
---|
13 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
14 | };
|
---|
15 |
|
---|
16 | static void rpccli_samr_Connect_done(struct tevent_req *subreq);
|
---|
17 |
|
---|
18 | struct tevent_req *rpccli_samr_Connect_send(TALLOC_CTX *mem_ctx,
|
---|
19 | struct tevent_context *ev,
|
---|
20 | struct rpc_pipe_client *cli,
|
---|
21 | uint16_t *_system_name /* [in] [unique] */,
|
---|
22 | uint32_t _access_mask /* [in] */,
|
---|
23 | struct policy_handle *_connect_handle /* [out] [ref] */)
|
---|
24 | {
|
---|
25 | struct tevent_req *req;
|
---|
26 | struct rpccli_samr_Connect_state *state;
|
---|
27 | struct tevent_req *subreq;
|
---|
28 |
|
---|
29 | req = tevent_req_create(mem_ctx, &state,
|
---|
30 | struct rpccli_samr_Connect_state);
|
---|
31 | if (req == NULL) {
|
---|
32 | return NULL;
|
---|
33 | }
|
---|
34 | state->out_mem_ctx = NULL;
|
---|
35 | state->dispatch_recv = cli->dispatch_recv;
|
---|
36 |
|
---|
37 | /* In parameters */
|
---|
38 | state->orig.in.system_name = _system_name;
|
---|
39 | state->orig.in.access_mask = _access_mask;
|
---|
40 |
|
---|
41 | /* Out parameters */
|
---|
42 | state->orig.out.connect_handle = _connect_handle;
|
---|
43 |
|
---|
44 | /* Result */
|
---|
45 | ZERO_STRUCT(state->orig.out.result);
|
---|
46 |
|
---|
47 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
48 | "rpccli_samr_Connect_out_memory");
|
---|
49 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
50 | return tevent_req_post(req, ev);
|
---|
51 | }
|
---|
52 |
|
---|
53 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
54 | state->tmp = state->orig;
|
---|
55 |
|
---|
56 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
57 | &ndr_table_samr,
|
---|
58 | NDR_SAMR_CONNECT,
|
---|
59 | &state->tmp);
|
---|
60 | if (tevent_req_nomem(subreq, req)) {
|
---|
61 | return tevent_req_post(req, ev);
|
---|
62 | }
|
---|
63 | tevent_req_set_callback(subreq, rpccli_samr_Connect_done, req);
|
---|
64 | return req;
|
---|
65 | }
|
---|
66 |
|
---|
67 | static void rpccli_samr_Connect_done(struct tevent_req *subreq)
|
---|
68 | {
|
---|
69 | struct tevent_req *req = tevent_req_callback_data(
|
---|
70 | subreq, struct tevent_req);
|
---|
71 | struct rpccli_samr_Connect_state *state = tevent_req_data(
|
---|
72 | req, struct rpccli_samr_Connect_state);
|
---|
73 | NTSTATUS status;
|
---|
74 | TALLOC_CTX *mem_ctx;
|
---|
75 |
|
---|
76 | if (state->out_mem_ctx) {
|
---|
77 | mem_ctx = state->out_mem_ctx;
|
---|
78 | } else {
|
---|
79 | mem_ctx = state;
|
---|
80 | }
|
---|
81 |
|
---|
82 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
83 | TALLOC_FREE(subreq);
|
---|
84 | if (!NT_STATUS_IS_OK(status)) {
|
---|
85 | tevent_req_nterror(req, status);
|
---|
86 | return;
|
---|
87 | }
|
---|
88 |
|
---|
89 | /* Copy out parameters */
|
---|
90 | *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
|
---|
91 |
|
---|
92 | /* Copy result */
|
---|
93 | state->orig.out.result = state->tmp.out.result;
|
---|
94 |
|
---|
95 | /* Reset temporary structure */
|
---|
96 | ZERO_STRUCT(state->tmp);
|
---|
97 |
|
---|
98 | tevent_req_done(req);
|
---|
99 | }
|
---|
100 |
|
---|
101 | NTSTATUS rpccli_samr_Connect_recv(struct tevent_req *req,
|
---|
102 | TALLOC_CTX *mem_ctx,
|
---|
103 | NTSTATUS *result)
|
---|
104 | {
|
---|
105 | struct rpccli_samr_Connect_state *state = tevent_req_data(
|
---|
106 | req, struct rpccli_samr_Connect_state);
|
---|
107 | NTSTATUS status;
|
---|
108 |
|
---|
109 | if (tevent_req_is_nterror(req, &status)) {
|
---|
110 | tevent_req_received(req);
|
---|
111 | return status;
|
---|
112 | }
|
---|
113 |
|
---|
114 | /* Steal possbile out parameters to the callers context */
|
---|
115 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
116 |
|
---|
117 | /* Return result */
|
---|
118 | *result = state->orig.out.result;
|
---|
119 |
|
---|
120 | tevent_req_received(req);
|
---|
121 | return NT_STATUS_OK;
|
---|
122 | }
|
---|
123 |
|
---|
124 | NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli,
|
---|
125 | TALLOC_CTX *mem_ctx,
|
---|
126 | uint16_t *system_name /* [in] [unique] */,
|
---|
127 | uint32_t access_mask /* [in] */,
|
---|
128 | struct policy_handle *connect_handle /* [out] [ref] */)
|
---|
129 | {
|
---|
130 | struct samr_Connect r;
|
---|
131 | NTSTATUS status;
|
---|
132 |
|
---|
133 | /* In parameters */
|
---|
134 | r.in.system_name = system_name;
|
---|
135 | r.in.access_mask = access_mask;
|
---|
136 |
|
---|
137 | status = cli->dispatch(cli,
|
---|
138 | mem_ctx,
|
---|
139 | &ndr_table_samr,
|
---|
140 | NDR_SAMR_CONNECT,
|
---|
141 | &r);
|
---|
142 |
|
---|
143 | if (!NT_STATUS_IS_OK(status)) {
|
---|
144 | return status;
|
---|
145 | }
|
---|
146 |
|
---|
147 | if (NT_STATUS_IS_ERR(status)) {
|
---|
148 | return status;
|
---|
149 | }
|
---|
150 |
|
---|
151 | /* Return variables */
|
---|
152 | *connect_handle = *r.out.connect_handle;
|
---|
153 |
|
---|
154 | /* Return result */
|
---|
155 | return r.out.result;
|
---|
156 | }
|
---|
157 |
|
---|
158 | struct rpccli_samr_Close_state {
|
---|
159 | struct samr_Close orig;
|
---|
160 | struct samr_Close tmp;
|
---|
161 | TALLOC_CTX *out_mem_ctx;
|
---|
162 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
163 | };
|
---|
164 |
|
---|
165 | static void rpccli_samr_Close_done(struct tevent_req *subreq);
|
---|
166 |
|
---|
167 | struct tevent_req *rpccli_samr_Close_send(TALLOC_CTX *mem_ctx,
|
---|
168 | struct tevent_context *ev,
|
---|
169 | struct rpc_pipe_client *cli,
|
---|
170 | struct policy_handle *_handle /* [in,out] [ref] */)
|
---|
171 | {
|
---|
172 | struct tevent_req *req;
|
---|
173 | struct rpccli_samr_Close_state *state;
|
---|
174 | struct tevent_req *subreq;
|
---|
175 |
|
---|
176 | req = tevent_req_create(mem_ctx, &state,
|
---|
177 | struct rpccli_samr_Close_state);
|
---|
178 | if (req == NULL) {
|
---|
179 | return NULL;
|
---|
180 | }
|
---|
181 | state->out_mem_ctx = NULL;
|
---|
182 | state->dispatch_recv = cli->dispatch_recv;
|
---|
183 |
|
---|
184 | /* In parameters */
|
---|
185 | state->orig.in.handle = _handle;
|
---|
186 |
|
---|
187 | /* Out parameters */
|
---|
188 | state->orig.out.handle = _handle;
|
---|
189 |
|
---|
190 | /* Result */
|
---|
191 | ZERO_STRUCT(state->orig.out.result);
|
---|
192 |
|
---|
193 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
194 | "rpccli_samr_Close_out_memory");
|
---|
195 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
196 | return tevent_req_post(req, ev);
|
---|
197 | }
|
---|
198 |
|
---|
199 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
200 | state->tmp = state->orig;
|
---|
201 |
|
---|
202 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
203 | &ndr_table_samr,
|
---|
204 | NDR_SAMR_CLOSE,
|
---|
205 | &state->tmp);
|
---|
206 | if (tevent_req_nomem(subreq, req)) {
|
---|
207 | return tevent_req_post(req, ev);
|
---|
208 | }
|
---|
209 | tevent_req_set_callback(subreq, rpccli_samr_Close_done, req);
|
---|
210 | return req;
|
---|
211 | }
|
---|
212 |
|
---|
213 | static void rpccli_samr_Close_done(struct tevent_req *subreq)
|
---|
214 | {
|
---|
215 | struct tevent_req *req = tevent_req_callback_data(
|
---|
216 | subreq, struct tevent_req);
|
---|
217 | struct rpccli_samr_Close_state *state = tevent_req_data(
|
---|
218 | req, struct rpccli_samr_Close_state);
|
---|
219 | NTSTATUS status;
|
---|
220 | TALLOC_CTX *mem_ctx;
|
---|
221 |
|
---|
222 | if (state->out_mem_ctx) {
|
---|
223 | mem_ctx = state->out_mem_ctx;
|
---|
224 | } else {
|
---|
225 | mem_ctx = state;
|
---|
226 | }
|
---|
227 |
|
---|
228 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
229 | TALLOC_FREE(subreq);
|
---|
230 | if (!NT_STATUS_IS_OK(status)) {
|
---|
231 | tevent_req_nterror(req, status);
|
---|
232 | return;
|
---|
233 | }
|
---|
234 |
|
---|
235 | /* Copy out parameters */
|
---|
236 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
237 |
|
---|
238 | /* Copy result */
|
---|
239 | state->orig.out.result = state->tmp.out.result;
|
---|
240 |
|
---|
241 | /* Reset temporary structure */
|
---|
242 | ZERO_STRUCT(state->tmp);
|
---|
243 |
|
---|
244 | tevent_req_done(req);
|
---|
245 | }
|
---|
246 |
|
---|
247 | NTSTATUS rpccli_samr_Close_recv(struct tevent_req *req,
|
---|
248 | TALLOC_CTX *mem_ctx,
|
---|
249 | NTSTATUS *result)
|
---|
250 | {
|
---|
251 | struct rpccli_samr_Close_state *state = tevent_req_data(
|
---|
252 | req, struct rpccli_samr_Close_state);
|
---|
253 | NTSTATUS status;
|
---|
254 |
|
---|
255 | if (tevent_req_is_nterror(req, &status)) {
|
---|
256 | tevent_req_received(req);
|
---|
257 | return status;
|
---|
258 | }
|
---|
259 |
|
---|
260 | /* Steal possbile out parameters to the callers context */
|
---|
261 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
262 |
|
---|
263 | /* Return result */
|
---|
264 | *result = state->orig.out.result;
|
---|
265 |
|
---|
266 | tevent_req_received(req);
|
---|
267 | return NT_STATUS_OK;
|
---|
268 | }
|
---|
269 |
|
---|
270 | NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli,
|
---|
271 | TALLOC_CTX *mem_ctx,
|
---|
272 | struct policy_handle *handle /* [in,out] [ref] */)
|
---|
273 | {
|
---|
274 | struct samr_Close r;
|
---|
275 | NTSTATUS status;
|
---|
276 |
|
---|
277 | /* In parameters */
|
---|
278 | r.in.handle = handle;
|
---|
279 |
|
---|
280 | status = cli->dispatch(cli,
|
---|
281 | mem_ctx,
|
---|
282 | &ndr_table_samr,
|
---|
283 | NDR_SAMR_CLOSE,
|
---|
284 | &r);
|
---|
285 |
|
---|
286 | if (!NT_STATUS_IS_OK(status)) {
|
---|
287 | return status;
|
---|
288 | }
|
---|
289 |
|
---|
290 | if (NT_STATUS_IS_ERR(status)) {
|
---|
291 | return status;
|
---|
292 | }
|
---|
293 |
|
---|
294 | /* Return variables */
|
---|
295 | *handle = *r.out.handle;
|
---|
296 |
|
---|
297 | /* Return result */
|
---|
298 | return r.out.result;
|
---|
299 | }
|
---|
300 |
|
---|
301 | struct rpccli_samr_SetSecurity_state {
|
---|
302 | struct samr_SetSecurity orig;
|
---|
303 | struct samr_SetSecurity tmp;
|
---|
304 | TALLOC_CTX *out_mem_ctx;
|
---|
305 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
306 | };
|
---|
307 |
|
---|
308 | static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq);
|
---|
309 |
|
---|
310 | struct tevent_req *rpccli_samr_SetSecurity_send(TALLOC_CTX *mem_ctx,
|
---|
311 | struct tevent_context *ev,
|
---|
312 | struct rpc_pipe_client *cli,
|
---|
313 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
314 | uint32_t _sec_info /* [in] */,
|
---|
315 | struct sec_desc_buf *_sdbuf /* [in] [ref] */)
|
---|
316 | {
|
---|
317 | struct tevent_req *req;
|
---|
318 | struct rpccli_samr_SetSecurity_state *state;
|
---|
319 | struct tevent_req *subreq;
|
---|
320 |
|
---|
321 | req = tevent_req_create(mem_ctx, &state,
|
---|
322 | struct rpccli_samr_SetSecurity_state);
|
---|
323 | if (req == NULL) {
|
---|
324 | return NULL;
|
---|
325 | }
|
---|
326 | state->out_mem_ctx = NULL;
|
---|
327 | state->dispatch_recv = cli->dispatch_recv;
|
---|
328 |
|
---|
329 | /* In parameters */
|
---|
330 | state->orig.in.handle = _handle;
|
---|
331 | state->orig.in.sec_info = _sec_info;
|
---|
332 | state->orig.in.sdbuf = _sdbuf;
|
---|
333 |
|
---|
334 | /* Out parameters */
|
---|
335 |
|
---|
336 | /* Result */
|
---|
337 | ZERO_STRUCT(state->orig.out.result);
|
---|
338 |
|
---|
339 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
340 | state->tmp = state->orig;
|
---|
341 |
|
---|
342 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
343 | &ndr_table_samr,
|
---|
344 | NDR_SAMR_SETSECURITY,
|
---|
345 | &state->tmp);
|
---|
346 | if (tevent_req_nomem(subreq, req)) {
|
---|
347 | return tevent_req_post(req, ev);
|
---|
348 | }
|
---|
349 | tevent_req_set_callback(subreq, rpccli_samr_SetSecurity_done, req);
|
---|
350 | return req;
|
---|
351 | }
|
---|
352 |
|
---|
353 | static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq)
|
---|
354 | {
|
---|
355 | struct tevent_req *req = tevent_req_callback_data(
|
---|
356 | subreq, struct tevent_req);
|
---|
357 | struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
|
---|
358 | req, struct rpccli_samr_SetSecurity_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 = state->dispatch_recv(subreq, mem_ctx);
|
---|
369 | TALLOC_FREE(subreq);
|
---|
370 | if (!NT_STATUS_IS_OK(status)) {
|
---|
371 | tevent_req_nterror(req, status);
|
---|
372 | return;
|
---|
373 | }
|
---|
374 |
|
---|
375 | /* Copy out parameters */
|
---|
376 |
|
---|
377 | /* Copy result */
|
---|
378 | state->orig.out.result = state->tmp.out.result;
|
---|
379 |
|
---|
380 | /* Reset temporary structure */
|
---|
381 | ZERO_STRUCT(state->tmp);
|
---|
382 |
|
---|
383 | tevent_req_done(req);
|
---|
384 | }
|
---|
385 |
|
---|
386 | NTSTATUS rpccli_samr_SetSecurity_recv(struct tevent_req *req,
|
---|
387 | TALLOC_CTX *mem_ctx,
|
---|
388 | NTSTATUS *result)
|
---|
389 | {
|
---|
390 | struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
|
---|
391 | req, struct rpccli_samr_SetSecurity_state);
|
---|
392 | NTSTATUS status;
|
---|
393 |
|
---|
394 | if (tevent_req_is_nterror(req, &status)) {
|
---|
395 | tevent_req_received(req);
|
---|
396 | return status;
|
---|
397 | }
|
---|
398 |
|
---|
399 | /* Steal possbile out parameters to the callers context */
|
---|
400 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
401 |
|
---|
402 | /* Return result */
|
---|
403 | *result = state->orig.out.result;
|
---|
404 |
|
---|
405 | tevent_req_received(req);
|
---|
406 | return NT_STATUS_OK;
|
---|
407 | }
|
---|
408 |
|
---|
409 | NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli,
|
---|
410 | TALLOC_CTX *mem_ctx,
|
---|
411 | struct policy_handle *handle /* [in] [ref] */,
|
---|
412 | uint32_t sec_info /* [in] */,
|
---|
413 | struct sec_desc_buf *sdbuf /* [in] [ref] */)
|
---|
414 | {
|
---|
415 | struct samr_SetSecurity r;
|
---|
416 | NTSTATUS status;
|
---|
417 |
|
---|
418 | /* In parameters */
|
---|
419 | r.in.handle = handle;
|
---|
420 | r.in.sec_info = sec_info;
|
---|
421 | r.in.sdbuf = sdbuf;
|
---|
422 |
|
---|
423 | status = cli->dispatch(cli,
|
---|
424 | mem_ctx,
|
---|
425 | &ndr_table_samr,
|
---|
426 | NDR_SAMR_SETSECURITY,
|
---|
427 | &r);
|
---|
428 |
|
---|
429 | if (!NT_STATUS_IS_OK(status)) {
|
---|
430 | return status;
|
---|
431 | }
|
---|
432 |
|
---|
433 | if (NT_STATUS_IS_ERR(status)) {
|
---|
434 | return status;
|
---|
435 | }
|
---|
436 |
|
---|
437 | /* Return variables */
|
---|
438 |
|
---|
439 | /* Return result */
|
---|
440 | return r.out.result;
|
---|
441 | }
|
---|
442 |
|
---|
443 | struct rpccli_samr_QuerySecurity_state {
|
---|
444 | struct samr_QuerySecurity orig;
|
---|
445 | struct samr_QuerySecurity tmp;
|
---|
446 | TALLOC_CTX *out_mem_ctx;
|
---|
447 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
448 | };
|
---|
449 |
|
---|
450 | static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq);
|
---|
451 |
|
---|
452 | struct tevent_req *rpccli_samr_QuerySecurity_send(TALLOC_CTX *mem_ctx,
|
---|
453 | struct tevent_context *ev,
|
---|
454 | struct rpc_pipe_client *cli,
|
---|
455 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
456 | uint32_t _sec_info /* [in] */,
|
---|
457 | struct sec_desc_buf **_sdbuf /* [out] [ref] */)
|
---|
458 | {
|
---|
459 | struct tevent_req *req;
|
---|
460 | struct rpccli_samr_QuerySecurity_state *state;
|
---|
461 | struct tevent_req *subreq;
|
---|
462 |
|
---|
463 | req = tevent_req_create(mem_ctx, &state,
|
---|
464 | struct rpccli_samr_QuerySecurity_state);
|
---|
465 | if (req == NULL) {
|
---|
466 | return NULL;
|
---|
467 | }
|
---|
468 | state->out_mem_ctx = NULL;
|
---|
469 | state->dispatch_recv = cli->dispatch_recv;
|
---|
470 |
|
---|
471 | /* In parameters */
|
---|
472 | state->orig.in.handle = _handle;
|
---|
473 | state->orig.in.sec_info = _sec_info;
|
---|
474 |
|
---|
475 | /* Out parameters */
|
---|
476 | state->orig.out.sdbuf = _sdbuf;
|
---|
477 |
|
---|
478 | /* Result */
|
---|
479 | ZERO_STRUCT(state->orig.out.result);
|
---|
480 |
|
---|
481 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
482 | "rpccli_samr_QuerySecurity_out_memory");
|
---|
483 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
484 | return tevent_req_post(req, ev);
|
---|
485 | }
|
---|
486 |
|
---|
487 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
488 | state->tmp = state->orig;
|
---|
489 |
|
---|
490 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
491 | &ndr_table_samr,
|
---|
492 | NDR_SAMR_QUERYSECURITY,
|
---|
493 | &state->tmp);
|
---|
494 | if (tevent_req_nomem(subreq, req)) {
|
---|
495 | return tevent_req_post(req, ev);
|
---|
496 | }
|
---|
497 | tevent_req_set_callback(subreq, rpccli_samr_QuerySecurity_done, req);
|
---|
498 | return req;
|
---|
499 | }
|
---|
500 |
|
---|
501 | static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq)
|
---|
502 | {
|
---|
503 | struct tevent_req *req = tevent_req_callback_data(
|
---|
504 | subreq, struct tevent_req);
|
---|
505 | struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
|
---|
506 | req, struct rpccli_samr_QuerySecurity_state);
|
---|
507 | NTSTATUS status;
|
---|
508 | TALLOC_CTX *mem_ctx;
|
---|
509 |
|
---|
510 | if (state->out_mem_ctx) {
|
---|
511 | mem_ctx = state->out_mem_ctx;
|
---|
512 | } else {
|
---|
513 | mem_ctx = state;
|
---|
514 | }
|
---|
515 |
|
---|
516 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
517 | TALLOC_FREE(subreq);
|
---|
518 | if (!NT_STATUS_IS_OK(status)) {
|
---|
519 | tevent_req_nterror(req, status);
|
---|
520 | return;
|
---|
521 | }
|
---|
522 |
|
---|
523 | /* Copy out parameters */
|
---|
524 | *state->orig.out.sdbuf = *state->tmp.out.sdbuf;
|
---|
525 |
|
---|
526 | /* Copy result */
|
---|
527 | state->orig.out.result = state->tmp.out.result;
|
---|
528 |
|
---|
529 | /* Reset temporary structure */
|
---|
530 | ZERO_STRUCT(state->tmp);
|
---|
531 |
|
---|
532 | tevent_req_done(req);
|
---|
533 | }
|
---|
534 |
|
---|
535 | NTSTATUS rpccli_samr_QuerySecurity_recv(struct tevent_req *req,
|
---|
536 | TALLOC_CTX *mem_ctx,
|
---|
537 | NTSTATUS *result)
|
---|
538 | {
|
---|
539 | struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
|
---|
540 | req, struct rpccli_samr_QuerySecurity_state);
|
---|
541 | NTSTATUS status;
|
---|
542 |
|
---|
543 | if (tevent_req_is_nterror(req, &status)) {
|
---|
544 | tevent_req_received(req);
|
---|
545 | return status;
|
---|
546 | }
|
---|
547 |
|
---|
548 | /* Steal possbile out parameters to the callers context */
|
---|
549 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
550 |
|
---|
551 | /* Return result */
|
---|
552 | *result = state->orig.out.result;
|
---|
553 |
|
---|
554 | tevent_req_received(req);
|
---|
555 | return NT_STATUS_OK;
|
---|
556 | }
|
---|
557 |
|
---|
558 | NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli,
|
---|
559 | TALLOC_CTX *mem_ctx,
|
---|
560 | struct policy_handle *handle /* [in] [ref] */,
|
---|
561 | uint32_t sec_info /* [in] */,
|
---|
562 | struct sec_desc_buf **sdbuf /* [out] [ref] */)
|
---|
563 | {
|
---|
564 | struct samr_QuerySecurity r;
|
---|
565 | NTSTATUS status;
|
---|
566 |
|
---|
567 | /* In parameters */
|
---|
568 | r.in.handle = handle;
|
---|
569 | r.in.sec_info = sec_info;
|
---|
570 |
|
---|
571 | status = cli->dispatch(cli,
|
---|
572 | mem_ctx,
|
---|
573 | &ndr_table_samr,
|
---|
574 | NDR_SAMR_QUERYSECURITY,
|
---|
575 | &r);
|
---|
576 |
|
---|
577 | if (!NT_STATUS_IS_OK(status)) {
|
---|
578 | return status;
|
---|
579 | }
|
---|
580 |
|
---|
581 | if (NT_STATUS_IS_ERR(status)) {
|
---|
582 | return status;
|
---|
583 | }
|
---|
584 |
|
---|
585 | /* Return variables */
|
---|
586 | *sdbuf = *r.out.sdbuf;
|
---|
587 |
|
---|
588 | /* Return result */
|
---|
589 | return r.out.result;
|
---|
590 | }
|
---|
591 |
|
---|
592 | struct rpccli_samr_Shutdown_state {
|
---|
593 | struct samr_Shutdown orig;
|
---|
594 | struct samr_Shutdown tmp;
|
---|
595 | TALLOC_CTX *out_mem_ctx;
|
---|
596 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
597 | };
|
---|
598 |
|
---|
599 | static void rpccli_samr_Shutdown_done(struct tevent_req *subreq);
|
---|
600 |
|
---|
601 | struct tevent_req *rpccli_samr_Shutdown_send(TALLOC_CTX *mem_ctx,
|
---|
602 | struct tevent_context *ev,
|
---|
603 | struct rpc_pipe_client *cli,
|
---|
604 | struct policy_handle *_connect_handle /* [in] [ref] */)
|
---|
605 | {
|
---|
606 | struct tevent_req *req;
|
---|
607 | struct rpccli_samr_Shutdown_state *state;
|
---|
608 | struct tevent_req *subreq;
|
---|
609 |
|
---|
610 | req = tevent_req_create(mem_ctx, &state,
|
---|
611 | struct rpccli_samr_Shutdown_state);
|
---|
612 | if (req == NULL) {
|
---|
613 | return NULL;
|
---|
614 | }
|
---|
615 | state->out_mem_ctx = NULL;
|
---|
616 | state->dispatch_recv = cli->dispatch_recv;
|
---|
617 |
|
---|
618 | /* In parameters */
|
---|
619 | state->orig.in.connect_handle = _connect_handle;
|
---|
620 |
|
---|
621 | /* Out parameters */
|
---|
622 |
|
---|
623 | /* Result */
|
---|
624 | ZERO_STRUCT(state->orig.out.result);
|
---|
625 |
|
---|
626 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
627 | state->tmp = state->orig;
|
---|
628 |
|
---|
629 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
630 | &ndr_table_samr,
|
---|
631 | NDR_SAMR_SHUTDOWN,
|
---|
632 | &state->tmp);
|
---|
633 | if (tevent_req_nomem(subreq, req)) {
|
---|
634 | return tevent_req_post(req, ev);
|
---|
635 | }
|
---|
636 | tevent_req_set_callback(subreq, rpccli_samr_Shutdown_done, req);
|
---|
637 | return req;
|
---|
638 | }
|
---|
639 |
|
---|
640 | static void rpccli_samr_Shutdown_done(struct tevent_req *subreq)
|
---|
641 | {
|
---|
642 | struct tevent_req *req = tevent_req_callback_data(
|
---|
643 | subreq, struct tevent_req);
|
---|
644 | struct rpccli_samr_Shutdown_state *state = tevent_req_data(
|
---|
645 | req, struct rpccli_samr_Shutdown_state);
|
---|
646 | NTSTATUS status;
|
---|
647 | TALLOC_CTX *mem_ctx;
|
---|
648 |
|
---|
649 | if (state->out_mem_ctx) {
|
---|
650 | mem_ctx = state->out_mem_ctx;
|
---|
651 | } else {
|
---|
652 | mem_ctx = state;
|
---|
653 | }
|
---|
654 |
|
---|
655 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
656 | TALLOC_FREE(subreq);
|
---|
657 | if (!NT_STATUS_IS_OK(status)) {
|
---|
658 | tevent_req_nterror(req, status);
|
---|
659 | return;
|
---|
660 | }
|
---|
661 |
|
---|
662 | /* Copy out parameters */
|
---|
663 |
|
---|
664 | /* Copy result */
|
---|
665 | state->orig.out.result = state->tmp.out.result;
|
---|
666 |
|
---|
667 | /* Reset temporary structure */
|
---|
668 | ZERO_STRUCT(state->tmp);
|
---|
669 |
|
---|
670 | tevent_req_done(req);
|
---|
671 | }
|
---|
672 |
|
---|
673 | NTSTATUS rpccli_samr_Shutdown_recv(struct tevent_req *req,
|
---|
674 | TALLOC_CTX *mem_ctx,
|
---|
675 | NTSTATUS *result)
|
---|
676 | {
|
---|
677 | struct rpccli_samr_Shutdown_state *state = tevent_req_data(
|
---|
678 | req, struct rpccli_samr_Shutdown_state);
|
---|
679 | NTSTATUS status;
|
---|
680 |
|
---|
681 | if (tevent_req_is_nterror(req, &status)) {
|
---|
682 | tevent_req_received(req);
|
---|
683 | return status;
|
---|
684 | }
|
---|
685 |
|
---|
686 | /* Steal possbile out parameters to the callers context */
|
---|
687 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
688 |
|
---|
689 | /* Return result */
|
---|
690 | *result = state->orig.out.result;
|
---|
691 |
|
---|
692 | tevent_req_received(req);
|
---|
693 | return NT_STATUS_OK;
|
---|
694 | }
|
---|
695 |
|
---|
696 | NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli,
|
---|
697 | TALLOC_CTX *mem_ctx,
|
---|
698 | struct policy_handle *connect_handle /* [in] [ref] */)
|
---|
699 | {
|
---|
700 | struct samr_Shutdown r;
|
---|
701 | NTSTATUS status;
|
---|
702 |
|
---|
703 | /* In parameters */
|
---|
704 | r.in.connect_handle = connect_handle;
|
---|
705 |
|
---|
706 | status = cli->dispatch(cli,
|
---|
707 | mem_ctx,
|
---|
708 | &ndr_table_samr,
|
---|
709 | NDR_SAMR_SHUTDOWN,
|
---|
710 | &r);
|
---|
711 |
|
---|
712 | if (!NT_STATUS_IS_OK(status)) {
|
---|
713 | return status;
|
---|
714 | }
|
---|
715 |
|
---|
716 | if (NT_STATUS_IS_ERR(status)) {
|
---|
717 | return status;
|
---|
718 | }
|
---|
719 |
|
---|
720 | /* Return variables */
|
---|
721 |
|
---|
722 | /* Return result */
|
---|
723 | return r.out.result;
|
---|
724 | }
|
---|
725 |
|
---|
726 | struct rpccli_samr_LookupDomain_state {
|
---|
727 | struct samr_LookupDomain orig;
|
---|
728 | struct samr_LookupDomain tmp;
|
---|
729 | TALLOC_CTX *out_mem_ctx;
|
---|
730 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
731 | };
|
---|
732 |
|
---|
733 | static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq);
|
---|
734 |
|
---|
735 | struct tevent_req *rpccli_samr_LookupDomain_send(TALLOC_CTX *mem_ctx,
|
---|
736 | struct tevent_context *ev,
|
---|
737 | struct rpc_pipe_client *cli,
|
---|
738 | struct policy_handle *_connect_handle /* [in] [ref] */,
|
---|
739 | struct lsa_String *_domain_name /* [in] [ref] */,
|
---|
740 | struct dom_sid2 **_sid /* [out] [ref] */)
|
---|
741 | {
|
---|
742 | struct tevent_req *req;
|
---|
743 | struct rpccli_samr_LookupDomain_state *state;
|
---|
744 | struct tevent_req *subreq;
|
---|
745 |
|
---|
746 | req = tevent_req_create(mem_ctx, &state,
|
---|
747 | struct rpccli_samr_LookupDomain_state);
|
---|
748 | if (req == NULL) {
|
---|
749 | return NULL;
|
---|
750 | }
|
---|
751 | state->out_mem_ctx = NULL;
|
---|
752 | state->dispatch_recv = cli->dispatch_recv;
|
---|
753 |
|
---|
754 | /* In parameters */
|
---|
755 | state->orig.in.connect_handle = _connect_handle;
|
---|
756 | state->orig.in.domain_name = _domain_name;
|
---|
757 |
|
---|
758 | /* Out parameters */
|
---|
759 | state->orig.out.sid = _sid;
|
---|
760 |
|
---|
761 | /* Result */
|
---|
762 | ZERO_STRUCT(state->orig.out.result);
|
---|
763 |
|
---|
764 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
765 | "rpccli_samr_LookupDomain_out_memory");
|
---|
766 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
767 | return tevent_req_post(req, ev);
|
---|
768 | }
|
---|
769 |
|
---|
770 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
771 | state->tmp = state->orig;
|
---|
772 |
|
---|
773 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
774 | &ndr_table_samr,
|
---|
775 | NDR_SAMR_LOOKUPDOMAIN,
|
---|
776 | &state->tmp);
|
---|
777 | if (tevent_req_nomem(subreq, req)) {
|
---|
778 | return tevent_req_post(req, ev);
|
---|
779 | }
|
---|
780 | tevent_req_set_callback(subreq, rpccli_samr_LookupDomain_done, req);
|
---|
781 | return req;
|
---|
782 | }
|
---|
783 |
|
---|
784 | static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq)
|
---|
785 | {
|
---|
786 | struct tevent_req *req = tevent_req_callback_data(
|
---|
787 | subreq, struct tevent_req);
|
---|
788 | struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
|
---|
789 | req, struct rpccli_samr_LookupDomain_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 = state->dispatch_recv(subreq, mem_ctx);
|
---|
800 | TALLOC_FREE(subreq);
|
---|
801 | if (!NT_STATUS_IS_OK(status)) {
|
---|
802 | tevent_req_nterror(req, status);
|
---|
803 | return;
|
---|
804 | }
|
---|
805 |
|
---|
806 | /* Copy out parameters */
|
---|
807 | *state->orig.out.sid = *state->tmp.out.sid;
|
---|
808 |
|
---|
809 | /* Copy result */
|
---|
810 | state->orig.out.result = state->tmp.out.result;
|
---|
811 |
|
---|
812 | /* Reset temporary structure */
|
---|
813 | ZERO_STRUCT(state->tmp);
|
---|
814 |
|
---|
815 | tevent_req_done(req);
|
---|
816 | }
|
---|
817 |
|
---|
818 | NTSTATUS rpccli_samr_LookupDomain_recv(struct tevent_req *req,
|
---|
819 | TALLOC_CTX *mem_ctx,
|
---|
820 | NTSTATUS *result)
|
---|
821 | {
|
---|
822 | struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
|
---|
823 | req, struct rpccli_samr_LookupDomain_state);
|
---|
824 | NTSTATUS status;
|
---|
825 |
|
---|
826 | if (tevent_req_is_nterror(req, &status)) {
|
---|
827 | tevent_req_received(req);
|
---|
828 | return status;
|
---|
829 | }
|
---|
830 |
|
---|
831 | /* Steal possbile out parameters to the callers context */
|
---|
832 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
833 |
|
---|
834 | /* Return result */
|
---|
835 | *result = state->orig.out.result;
|
---|
836 |
|
---|
837 | tevent_req_received(req);
|
---|
838 | return NT_STATUS_OK;
|
---|
839 | }
|
---|
840 |
|
---|
841 | NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
|
---|
842 | TALLOC_CTX *mem_ctx,
|
---|
843 | struct policy_handle *connect_handle /* [in] [ref] */,
|
---|
844 | struct lsa_String *domain_name /* [in] [ref] */,
|
---|
845 | struct dom_sid2 **sid /* [out] [ref] */)
|
---|
846 | {
|
---|
847 | struct samr_LookupDomain r;
|
---|
848 | NTSTATUS status;
|
---|
849 |
|
---|
850 | /* In parameters */
|
---|
851 | r.in.connect_handle = connect_handle;
|
---|
852 | r.in.domain_name = domain_name;
|
---|
853 |
|
---|
854 | status = cli->dispatch(cli,
|
---|
855 | mem_ctx,
|
---|
856 | &ndr_table_samr,
|
---|
857 | NDR_SAMR_LOOKUPDOMAIN,
|
---|
858 | &r);
|
---|
859 |
|
---|
860 | if (!NT_STATUS_IS_OK(status)) {
|
---|
861 | return status;
|
---|
862 | }
|
---|
863 |
|
---|
864 | if (NT_STATUS_IS_ERR(status)) {
|
---|
865 | return status;
|
---|
866 | }
|
---|
867 |
|
---|
868 | /* Return variables */
|
---|
869 | *sid = *r.out.sid;
|
---|
870 |
|
---|
871 | /* Return result */
|
---|
872 | return r.out.result;
|
---|
873 | }
|
---|
874 |
|
---|
875 | struct rpccli_samr_EnumDomains_state {
|
---|
876 | struct samr_EnumDomains orig;
|
---|
877 | struct samr_EnumDomains tmp;
|
---|
878 | TALLOC_CTX *out_mem_ctx;
|
---|
879 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
880 | };
|
---|
881 |
|
---|
882 | static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq);
|
---|
883 |
|
---|
884 | struct tevent_req *rpccli_samr_EnumDomains_send(TALLOC_CTX *mem_ctx,
|
---|
885 | struct tevent_context *ev,
|
---|
886 | struct rpc_pipe_client *cli,
|
---|
887 | struct policy_handle *_connect_handle /* [in] [ref] */,
|
---|
888 | uint32_t *_resume_handle /* [in,out] [ref] */,
|
---|
889 | struct samr_SamArray **_sam /* [out] [ref] */,
|
---|
890 | uint32_t _buf_size /* [in] */,
|
---|
891 | uint32_t *_num_entries /* [out] [ref] */)
|
---|
892 | {
|
---|
893 | struct tevent_req *req;
|
---|
894 | struct rpccli_samr_EnumDomains_state *state;
|
---|
895 | struct tevent_req *subreq;
|
---|
896 |
|
---|
897 | req = tevent_req_create(mem_ctx, &state,
|
---|
898 | struct rpccli_samr_EnumDomains_state);
|
---|
899 | if (req == NULL) {
|
---|
900 | return NULL;
|
---|
901 | }
|
---|
902 | state->out_mem_ctx = NULL;
|
---|
903 | state->dispatch_recv = cli->dispatch_recv;
|
---|
904 |
|
---|
905 | /* In parameters */
|
---|
906 | state->orig.in.connect_handle = _connect_handle;
|
---|
907 | state->orig.in.resume_handle = _resume_handle;
|
---|
908 | state->orig.in.buf_size = _buf_size;
|
---|
909 |
|
---|
910 | /* Out parameters */
|
---|
911 | state->orig.out.resume_handle = _resume_handle;
|
---|
912 | state->orig.out.sam = _sam;
|
---|
913 | state->orig.out.num_entries = _num_entries;
|
---|
914 |
|
---|
915 | /* Result */
|
---|
916 | ZERO_STRUCT(state->orig.out.result);
|
---|
917 |
|
---|
918 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
919 | "rpccli_samr_EnumDomains_out_memory");
|
---|
920 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
921 | return tevent_req_post(req, ev);
|
---|
922 | }
|
---|
923 |
|
---|
924 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
925 | state->tmp = state->orig;
|
---|
926 |
|
---|
927 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
928 | &ndr_table_samr,
|
---|
929 | NDR_SAMR_ENUMDOMAINS,
|
---|
930 | &state->tmp);
|
---|
931 | if (tevent_req_nomem(subreq, req)) {
|
---|
932 | return tevent_req_post(req, ev);
|
---|
933 | }
|
---|
934 | tevent_req_set_callback(subreq, rpccli_samr_EnumDomains_done, req);
|
---|
935 | return req;
|
---|
936 | }
|
---|
937 |
|
---|
938 | static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq)
|
---|
939 | {
|
---|
940 | struct tevent_req *req = tevent_req_callback_data(
|
---|
941 | subreq, struct tevent_req);
|
---|
942 | struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
|
---|
943 | req, struct rpccli_samr_EnumDomains_state);
|
---|
944 | NTSTATUS status;
|
---|
945 | TALLOC_CTX *mem_ctx;
|
---|
946 |
|
---|
947 | if (state->out_mem_ctx) {
|
---|
948 | mem_ctx = state->out_mem_ctx;
|
---|
949 | } else {
|
---|
950 | mem_ctx = state;
|
---|
951 | }
|
---|
952 |
|
---|
953 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
954 | TALLOC_FREE(subreq);
|
---|
955 | if (!NT_STATUS_IS_OK(status)) {
|
---|
956 | tevent_req_nterror(req, status);
|
---|
957 | return;
|
---|
958 | }
|
---|
959 |
|
---|
960 | /* Copy out parameters */
|
---|
961 | *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
|
---|
962 | *state->orig.out.sam = *state->tmp.out.sam;
|
---|
963 | *state->orig.out.num_entries = *state->tmp.out.num_entries;
|
---|
964 |
|
---|
965 | /* Copy result */
|
---|
966 | state->orig.out.result = state->tmp.out.result;
|
---|
967 |
|
---|
968 | /* Reset temporary structure */
|
---|
969 | ZERO_STRUCT(state->tmp);
|
---|
970 |
|
---|
971 | tevent_req_done(req);
|
---|
972 | }
|
---|
973 |
|
---|
974 | NTSTATUS rpccli_samr_EnumDomains_recv(struct tevent_req *req,
|
---|
975 | TALLOC_CTX *mem_ctx,
|
---|
976 | NTSTATUS *result)
|
---|
977 | {
|
---|
978 | struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
|
---|
979 | req, struct rpccli_samr_EnumDomains_state);
|
---|
980 | NTSTATUS status;
|
---|
981 |
|
---|
982 | if (tevent_req_is_nterror(req, &status)) {
|
---|
983 | tevent_req_received(req);
|
---|
984 | return status;
|
---|
985 | }
|
---|
986 |
|
---|
987 | /* Steal possbile out parameters to the callers context */
|
---|
988 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
989 |
|
---|
990 | /* Return result */
|
---|
991 | *result = state->orig.out.result;
|
---|
992 |
|
---|
993 | tevent_req_received(req);
|
---|
994 | return NT_STATUS_OK;
|
---|
995 | }
|
---|
996 |
|
---|
997 | NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
|
---|
998 | TALLOC_CTX *mem_ctx,
|
---|
999 | struct policy_handle *connect_handle /* [in] [ref] */,
|
---|
1000 | uint32_t *resume_handle /* [in,out] [ref] */,
|
---|
1001 | struct samr_SamArray **sam /* [out] [ref] */,
|
---|
1002 | uint32_t buf_size /* [in] */,
|
---|
1003 | uint32_t *num_entries /* [out] [ref] */)
|
---|
1004 | {
|
---|
1005 | struct samr_EnumDomains r;
|
---|
1006 | NTSTATUS status;
|
---|
1007 |
|
---|
1008 | /* In parameters */
|
---|
1009 | r.in.connect_handle = connect_handle;
|
---|
1010 | r.in.resume_handle = resume_handle;
|
---|
1011 | r.in.buf_size = buf_size;
|
---|
1012 |
|
---|
1013 | status = cli->dispatch(cli,
|
---|
1014 | mem_ctx,
|
---|
1015 | &ndr_table_samr,
|
---|
1016 | NDR_SAMR_ENUMDOMAINS,
|
---|
1017 | &r);
|
---|
1018 |
|
---|
1019 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1020 | return status;
|
---|
1021 | }
|
---|
1022 |
|
---|
1023 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1024 | return status;
|
---|
1025 | }
|
---|
1026 |
|
---|
1027 | /* Return variables */
|
---|
1028 | *resume_handle = *r.out.resume_handle;
|
---|
1029 | *sam = *r.out.sam;
|
---|
1030 | *num_entries = *r.out.num_entries;
|
---|
1031 |
|
---|
1032 | /* Return result */
|
---|
1033 | return r.out.result;
|
---|
1034 | }
|
---|
1035 |
|
---|
1036 | struct rpccli_samr_OpenDomain_state {
|
---|
1037 | struct samr_OpenDomain orig;
|
---|
1038 | struct samr_OpenDomain tmp;
|
---|
1039 | TALLOC_CTX *out_mem_ctx;
|
---|
1040 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1041 | };
|
---|
1042 |
|
---|
1043 | static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq);
|
---|
1044 |
|
---|
1045 | struct tevent_req *rpccli_samr_OpenDomain_send(TALLOC_CTX *mem_ctx,
|
---|
1046 | struct tevent_context *ev,
|
---|
1047 | struct rpc_pipe_client *cli,
|
---|
1048 | struct policy_handle *_connect_handle /* [in] [ref] */,
|
---|
1049 | uint32_t _access_mask /* [in] */,
|
---|
1050 | struct dom_sid2 *_sid /* [in] [ref] */,
|
---|
1051 | struct policy_handle *_domain_handle /* [out] [ref] */)
|
---|
1052 | {
|
---|
1053 | struct tevent_req *req;
|
---|
1054 | struct rpccli_samr_OpenDomain_state *state;
|
---|
1055 | struct tevent_req *subreq;
|
---|
1056 |
|
---|
1057 | req = tevent_req_create(mem_ctx, &state,
|
---|
1058 | struct rpccli_samr_OpenDomain_state);
|
---|
1059 | if (req == NULL) {
|
---|
1060 | return NULL;
|
---|
1061 | }
|
---|
1062 | state->out_mem_ctx = NULL;
|
---|
1063 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1064 |
|
---|
1065 | /* In parameters */
|
---|
1066 | state->orig.in.connect_handle = _connect_handle;
|
---|
1067 | state->orig.in.access_mask = _access_mask;
|
---|
1068 | state->orig.in.sid = _sid;
|
---|
1069 |
|
---|
1070 | /* Out parameters */
|
---|
1071 | state->orig.out.domain_handle = _domain_handle;
|
---|
1072 |
|
---|
1073 | /* Result */
|
---|
1074 | ZERO_STRUCT(state->orig.out.result);
|
---|
1075 |
|
---|
1076 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1077 | "rpccli_samr_OpenDomain_out_memory");
|
---|
1078 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1079 | return tevent_req_post(req, ev);
|
---|
1080 | }
|
---|
1081 |
|
---|
1082 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1083 | state->tmp = state->orig;
|
---|
1084 |
|
---|
1085 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1086 | &ndr_table_samr,
|
---|
1087 | NDR_SAMR_OPENDOMAIN,
|
---|
1088 | &state->tmp);
|
---|
1089 | if (tevent_req_nomem(subreq, req)) {
|
---|
1090 | return tevent_req_post(req, ev);
|
---|
1091 | }
|
---|
1092 | tevent_req_set_callback(subreq, rpccli_samr_OpenDomain_done, req);
|
---|
1093 | return req;
|
---|
1094 | }
|
---|
1095 |
|
---|
1096 | static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq)
|
---|
1097 | {
|
---|
1098 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1099 | subreq, struct tevent_req);
|
---|
1100 | struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
|
---|
1101 | req, struct rpccli_samr_OpenDomain_state);
|
---|
1102 | NTSTATUS status;
|
---|
1103 | TALLOC_CTX *mem_ctx;
|
---|
1104 |
|
---|
1105 | if (state->out_mem_ctx) {
|
---|
1106 | mem_ctx = state->out_mem_ctx;
|
---|
1107 | } else {
|
---|
1108 | mem_ctx = state;
|
---|
1109 | }
|
---|
1110 |
|
---|
1111 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1112 | TALLOC_FREE(subreq);
|
---|
1113 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1114 | tevent_req_nterror(req, status);
|
---|
1115 | return;
|
---|
1116 | }
|
---|
1117 |
|
---|
1118 | /* Copy out parameters */
|
---|
1119 | *state->orig.out.domain_handle = *state->tmp.out.domain_handle;
|
---|
1120 |
|
---|
1121 | /* Copy result */
|
---|
1122 | state->orig.out.result = state->tmp.out.result;
|
---|
1123 |
|
---|
1124 | /* Reset temporary structure */
|
---|
1125 | ZERO_STRUCT(state->tmp);
|
---|
1126 |
|
---|
1127 | tevent_req_done(req);
|
---|
1128 | }
|
---|
1129 |
|
---|
1130 | NTSTATUS rpccli_samr_OpenDomain_recv(struct tevent_req *req,
|
---|
1131 | TALLOC_CTX *mem_ctx,
|
---|
1132 | NTSTATUS *result)
|
---|
1133 | {
|
---|
1134 | struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
|
---|
1135 | req, struct rpccli_samr_OpenDomain_state);
|
---|
1136 | NTSTATUS status;
|
---|
1137 |
|
---|
1138 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1139 | tevent_req_received(req);
|
---|
1140 | return status;
|
---|
1141 | }
|
---|
1142 |
|
---|
1143 | /* Steal possbile out parameters to the callers context */
|
---|
1144 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1145 |
|
---|
1146 | /* Return result */
|
---|
1147 | *result = state->orig.out.result;
|
---|
1148 |
|
---|
1149 | tevent_req_received(req);
|
---|
1150 | return NT_STATUS_OK;
|
---|
1151 | }
|
---|
1152 |
|
---|
1153 | NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
|
---|
1154 | TALLOC_CTX *mem_ctx,
|
---|
1155 | struct policy_handle *connect_handle /* [in] [ref] */,
|
---|
1156 | uint32_t access_mask /* [in] */,
|
---|
1157 | struct dom_sid2 *sid /* [in] [ref] */,
|
---|
1158 | struct policy_handle *domain_handle /* [out] [ref] */)
|
---|
1159 | {
|
---|
1160 | struct samr_OpenDomain r;
|
---|
1161 | NTSTATUS status;
|
---|
1162 |
|
---|
1163 | /* In parameters */
|
---|
1164 | r.in.connect_handle = connect_handle;
|
---|
1165 | r.in.access_mask = access_mask;
|
---|
1166 | r.in.sid = sid;
|
---|
1167 |
|
---|
1168 | status = cli->dispatch(cli,
|
---|
1169 | mem_ctx,
|
---|
1170 | &ndr_table_samr,
|
---|
1171 | NDR_SAMR_OPENDOMAIN,
|
---|
1172 | &r);
|
---|
1173 |
|
---|
1174 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1175 | return status;
|
---|
1176 | }
|
---|
1177 |
|
---|
1178 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1179 | return status;
|
---|
1180 | }
|
---|
1181 |
|
---|
1182 | /* Return variables */
|
---|
1183 | *domain_handle = *r.out.domain_handle;
|
---|
1184 |
|
---|
1185 | /* Return result */
|
---|
1186 | return r.out.result;
|
---|
1187 | }
|
---|
1188 |
|
---|
1189 | struct rpccli_samr_QueryDomainInfo_state {
|
---|
1190 | struct samr_QueryDomainInfo orig;
|
---|
1191 | struct samr_QueryDomainInfo tmp;
|
---|
1192 | TALLOC_CTX *out_mem_ctx;
|
---|
1193 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1194 | };
|
---|
1195 |
|
---|
1196 | static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq);
|
---|
1197 |
|
---|
1198 | struct tevent_req *rpccli_samr_QueryDomainInfo_send(TALLOC_CTX *mem_ctx,
|
---|
1199 | struct tevent_context *ev,
|
---|
1200 | struct rpc_pipe_client *cli,
|
---|
1201 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
1202 | enum samr_DomainInfoClass _level /* [in] */,
|
---|
1203 | union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
|
---|
1204 | {
|
---|
1205 | struct tevent_req *req;
|
---|
1206 | struct rpccli_samr_QueryDomainInfo_state *state;
|
---|
1207 | struct tevent_req *subreq;
|
---|
1208 |
|
---|
1209 | req = tevent_req_create(mem_ctx, &state,
|
---|
1210 | struct rpccli_samr_QueryDomainInfo_state);
|
---|
1211 | if (req == NULL) {
|
---|
1212 | return NULL;
|
---|
1213 | }
|
---|
1214 | state->out_mem_ctx = NULL;
|
---|
1215 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1216 |
|
---|
1217 | /* In parameters */
|
---|
1218 | state->orig.in.domain_handle = _domain_handle;
|
---|
1219 | state->orig.in.level = _level;
|
---|
1220 |
|
---|
1221 | /* Out parameters */
|
---|
1222 | state->orig.out.info = _info;
|
---|
1223 |
|
---|
1224 | /* Result */
|
---|
1225 | ZERO_STRUCT(state->orig.out.result);
|
---|
1226 |
|
---|
1227 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1228 | "rpccli_samr_QueryDomainInfo_out_memory");
|
---|
1229 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1230 | return tevent_req_post(req, ev);
|
---|
1231 | }
|
---|
1232 |
|
---|
1233 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1234 | state->tmp = state->orig;
|
---|
1235 |
|
---|
1236 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1237 | &ndr_table_samr,
|
---|
1238 | NDR_SAMR_QUERYDOMAININFO,
|
---|
1239 | &state->tmp);
|
---|
1240 | if (tevent_req_nomem(subreq, req)) {
|
---|
1241 | return tevent_req_post(req, ev);
|
---|
1242 | }
|
---|
1243 | tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo_done, req);
|
---|
1244 | return req;
|
---|
1245 | }
|
---|
1246 |
|
---|
1247 | static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq)
|
---|
1248 | {
|
---|
1249 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1250 | subreq, struct tevent_req);
|
---|
1251 | struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
|
---|
1252 | req, struct rpccli_samr_QueryDomainInfo_state);
|
---|
1253 | NTSTATUS status;
|
---|
1254 | TALLOC_CTX *mem_ctx;
|
---|
1255 |
|
---|
1256 | if (state->out_mem_ctx) {
|
---|
1257 | mem_ctx = state->out_mem_ctx;
|
---|
1258 | } else {
|
---|
1259 | mem_ctx = state;
|
---|
1260 | }
|
---|
1261 |
|
---|
1262 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1263 | TALLOC_FREE(subreq);
|
---|
1264 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1265 | tevent_req_nterror(req, status);
|
---|
1266 | return;
|
---|
1267 | }
|
---|
1268 |
|
---|
1269 | /* Copy out parameters */
|
---|
1270 | *state->orig.out.info = *state->tmp.out.info;
|
---|
1271 |
|
---|
1272 | /* Copy result */
|
---|
1273 | state->orig.out.result = state->tmp.out.result;
|
---|
1274 |
|
---|
1275 | /* Reset temporary structure */
|
---|
1276 | ZERO_STRUCT(state->tmp);
|
---|
1277 |
|
---|
1278 | tevent_req_done(req);
|
---|
1279 | }
|
---|
1280 |
|
---|
1281 | NTSTATUS rpccli_samr_QueryDomainInfo_recv(struct tevent_req *req,
|
---|
1282 | TALLOC_CTX *mem_ctx,
|
---|
1283 | NTSTATUS *result)
|
---|
1284 | {
|
---|
1285 | struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
|
---|
1286 | req, struct rpccli_samr_QueryDomainInfo_state);
|
---|
1287 | NTSTATUS status;
|
---|
1288 |
|
---|
1289 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1290 | tevent_req_received(req);
|
---|
1291 | return status;
|
---|
1292 | }
|
---|
1293 |
|
---|
1294 | /* Steal possbile out parameters to the callers context */
|
---|
1295 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1296 |
|
---|
1297 | /* Return result */
|
---|
1298 | *result = state->orig.out.result;
|
---|
1299 |
|
---|
1300 | tevent_req_received(req);
|
---|
1301 | return NT_STATUS_OK;
|
---|
1302 | }
|
---|
1303 |
|
---|
1304 | NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli,
|
---|
1305 | TALLOC_CTX *mem_ctx,
|
---|
1306 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
1307 | enum samr_DomainInfoClass level /* [in] */,
|
---|
1308 | union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
|
---|
1309 | {
|
---|
1310 | struct samr_QueryDomainInfo r;
|
---|
1311 | NTSTATUS status;
|
---|
1312 |
|
---|
1313 | /* In parameters */
|
---|
1314 | r.in.domain_handle = domain_handle;
|
---|
1315 | r.in.level = level;
|
---|
1316 |
|
---|
1317 | status = cli->dispatch(cli,
|
---|
1318 | mem_ctx,
|
---|
1319 | &ndr_table_samr,
|
---|
1320 | NDR_SAMR_QUERYDOMAININFO,
|
---|
1321 | &r);
|
---|
1322 |
|
---|
1323 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1324 | return status;
|
---|
1325 | }
|
---|
1326 |
|
---|
1327 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1328 | return status;
|
---|
1329 | }
|
---|
1330 |
|
---|
1331 | /* Return variables */
|
---|
1332 | *info = *r.out.info;
|
---|
1333 |
|
---|
1334 | /* Return result */
|
---|
1335 | return r.out.result;
|
---|
1336 | }
|
---|
1337 |
|
---|
1338 | struct rpccli_samr_SetDomainInfo_state {
|
---|
1339 | struct samr_SetDomainInfo orig;
|
---|
1340 | struct samr_SetDomainInfo tmp;
|
---|
1341 | TALLOC_CTX *out_mem_ctx;
|
---|
1342 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1343 | };
|
---|
1344 |
|
---|
1345 | static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq);
|
---|
1346 |
|
---|
1347 | struct tevent_req *rpccli_samr_SetDomainInfo_send(TALLOC_CTX *mem_ctx,
|
---|
1348 | struct tevent_context *ev,
|
---|
1349 | struct rpc_pipe_client *cli,
|
---|
1350 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
1351 | enum samr_DomainInfoClass _level /* [in] */,
|
---|
1352 | union samr_DomainInfo *_info /* [in] [ref,switch_is(level)] */)
|
---|
1353 | {
|
---|
1354 | struct tevent_req *req;
|
---|
1355 | struct rpccli_samr_SetDomainInfo_state *state;
|
---|
1356 | struct tevent_req *subreq;
|
---|
1357 |
|
---|
1358 | req = tevent_req_create(mem_ctx, &state,
|
---|
1359 | struct rpccli_samr_SetDomainInfo_state);
|
---|
1360 | if (req == NULL) {
|
---|
1361 | return NULL;
|
---|
1362 | }
|
---|
1363 | state->out_mem_ctx = NULL;
|
---|
1364 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1365 |
|
---|
1366 | /* In parameters */
|
---|
1367 | state->orig.in.domain_handle = _domain_handle;
|
---|
1368 | state->orig.in.level = _level;
|
---|
1369 | state->orig.in.info = _info;
|
---|
1370 |
|
---|
1371 | /* Out parameters */
|
---|
1372 |
|
---|
1373 | /* Result */
|
---|
1374 | ZERO_STRUCT(state->orig.out.result);
|
---|
1375 |
|
---|
1376 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1377 | state->tmp = state->orig;
|
---|
1378 |
|
---|
1379 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1380 | &ndr_table_samr,
|
---|
1381 | NDR_SAMR_SETDOMAININFO,
|
---|
1382 | &state->tmp);
|
---|
1383 | if (tevent_req_nomem(subreq, req)) {
|
---|
1384 | return tevent_req_post(req, ev);
|
---|
1385 | }
|
---|
1386 | tevent_req_set_callback(subreq, rpccli_samr_SetDomainInfo_done, req);
|
---|
1387 | return req;
|
---|
1388 | }
|
---|
1389 |
|
---|
1390 | static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq)
|
---|
1391 | {
|
---|
1392 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1393 | subreq, struct tevent_req);
|
---|
1394 | struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
|
---|
1395 | req, struct rpccli_samr_SetDomainInfo_state);
|
---|
1396 | NTSTATUS status;
|
---|
1397 | TALLOC_CTX *mem_ctx;
|
---|
1398 |
|
---|
1399 | if (state->out_mem_ctx) {
|
---|
1400 | mem_ctx = state->out_mem_ctx;
|
---|
1401 | } else {
|
---|
1402 | mem_ctx = state;
|
---|
1403 | }
|
---|
1404 |
|
---|
1405 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1406 | TALLOC_FREE(subreq);
|
---|
1407 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1408 | tevent_req_nterror(req, status);
|
---|
1409 | return;
|
---|
1410 | }
|
---|
1411 |
|
---|
1412 | /* Copy out parameters */
|
---|
1413 |
|
---|
1414 | /* Copy result */
|
---|
1415 | state->orig.out.result = state->tmp.out.result;
|
---|
1416 |
|
---|
1417 | /* Reset temporary structure */
|
---|
1418 | ZERO_STRUCT(state->tmp);
|
---|
1419 |
|
---|
1420 | tevent_req_done(req);
|
---|
1421 | }
|
---|
1422 |
|
---|
1423 | NTSTATUS rpccli_samr_SetDomainInfo_recv(struct tevent_req *req,
|
---|
1424 | TALLOC_CTX *mem_ctx,
|
---|
1425 | NTSTATUS *result)
|
---|
1426 | {
|
---|
1427 | struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
|
---|
1428 | req, struct rpccli_samr_SetDomainInfo_state);
|
---|
1429 | NTSTATUS status;
|
---|
1430 |
|
---|
1431 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1432 | tevent_req_received(req);
|
---|
1433 | return status;
|
---|
1434 | }
|
---|
1435 |
|
---|
1436 | /* Steal possbile out parameters to the callers context */
|
---|
1437 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1438 |
|
---|
1439 | /* Return result */
|
---|
1440 | *result = state->orig.out.result;
|
---|
1441 |
|
---|
1442 | tevent_req_received(req);
|
---|
1443 | return NT_STATUS_OK;
|
---|
1444 | }
|
---|
1445 |
|
---|
1446 | NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli,
|
---|
1447 | TALLOC_CTX *mem_ctx,
|
---|
1448 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
1449 | enum samr_DomainInfoClass level /* [in] */,
|
---|
1450 | union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */)
|
---|
1451 | {
|
---|
1452 | struct samr_SetDomainInfo r;
|
---|
1453 | NTSTATUS status;
|
---|
1454 |
|
---|
1455 | /* In parameters */
|
---|
1456 | r.in.domain_handle = domain_handle;
|
---|
1457 | r.in.level = level;
|
---|
1458 | r.in.info = info;
|
---|
1459 |
|
---|
1460 | status = cli->dispatch(cli,
|
---|
1461 | mem_ctx,
|
---|
1462 | &ndr_table_samr,
|
---|
1463 | NDR_SAMR_SETDOMAININFO,
|
---|
1464 | &r);
|
---|
1465 |
|
---|
1466 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1467 | return status;
|
---|
1468 | }
|
---|
1469 |
|
---|
1470 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1471 | return status;
|
---|
1472 | }
|
---|
1473 |
|
---|
1474 | /* Return variables */
|
---|
1475 |
|
---|
1476 | /* Return result */
|
---|
1477 | return r.out.result;
|
---|
1478 | }
|
---|
1479 |
|
---|
1480 | struct rpccli_samr_CreateDomainGroup_state {
|
---|
1481 | struct samr_CreateDomainGroup orig;
|
---|
1482 | struct samr_CreateDomainGroup tmp;
|
---|
1483 | TALLOC_CTX *out_mem_ctx;
|
---|
1484 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1485 | };
|
---|
1486 |
|
---|
1487 | static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq);
|
---|
1488 |
|
---|
1489 | struct tevent_req *rpccli_samr_CreateDomainGroup_send(TALLOC_CTX *mem_ctx,
|
---|
1490 | struct tevent_context *ev,
|
---|
1491 | struct rpc_pipe_client *cli,
|
---|
1492 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
1493 | struct lsa_String *_name /* [in] [ref] */,
|
---|
1494 | uint32_t _access_mask /* [in] */,
|
---|
1495 | struct policy_handle *_group_handle /* [out] [ref] */,
|
---|
1496 | uint32_t *_rid /* [out] [ref] */)
|
---|
1497 | {
|
---|
1498 | struct tevent_req *req;
|
---|
1499 | struct rpccli_samr_CreateDomainGroup_state *state;
|
---|
1500 | struct tevent_req *subreq;
|
---|
1501 |
|
---|
1502 | req = tevent_req_create(mem_ctx, &state,
|
---|
1503 | struct rpccli_samr_CreateDomainGroup_state);
|
---|
1504 | if (req == NULL) {
|
---|
1505 | return NULL;
|
---|
1506 | }
|
---|
1507 | state->out_mem_ctx = NULL;
|
---|
1508 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1509 |
|
---|
1510 | /* In parameters */
|
---|
1511 | state->orig.in.domain_handle = _domain_handle;
|
---|
1512 | state->orig.in.name = _name;
|
---|
1513 | state->orig.in.access_mask = _access_mask;
|
---|
1514 |
|
---|
1515 | /* Out parameters */
|
---|
1516 | state->orig.out.group_handle = _group_handle;
|
---|
1517 | state->orig.out.rid = _rid;
|
---|
1518 |
|
---|
1519 | /* Result */
|
---|
1520 | ZERO_STRUCT(state->orig.out.result);
|
---|
1521 |
|
---|
1522 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1523 | "rpccli_samr_CreateDomainGroup_out_memory");
|
---|
1524 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1525 | return tevent_req_post(req, ev);
|
---|
1526 | }
|
---|
1527 |
|
---|
1528 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1529 | state->tmp = state->orig;
|
---|
1530 |
|
---|
1531 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1532 | &ndr_table_samr,
|
---|
1533 | NDR_SAMR_CREATEDOMAINGROUP,
|
---|
1534 | &state->tmp);
|
---|
1535 | if (tevent_req_nomem(subreq, req)) {
|
---|
1536 | return tevent_req_post(req, ev);
|
---|
1537 | }
|
---|
1538 | tevent_req_set_callback(subreq, rpccli_samr_CreateDomainGroup_done, req);
|
---|
1539 | return req;
|
---|
1540 | }
|
---|
1541 |
|
---|
1542 | static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq)
|
---|
1543 | {
|
---|
1544 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1545 | subreq, struct tevent_req);
|
---|
1546 | struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
|
---|
1547 | req, struct rpccli_samr_CreateDomainGroup_state);
|
---|
1548 | NTSTATUS status;
|
---|
1549 | TALLOC_CTX *mem_ctx;
|
---|
1550 |
|
---|
1551 | if (state->out_mem_ctx) {
|
---|
1552 | mem_ctx = state->out_mem_ctx;
|
---|
1553 | } else {
|
---|
1554 | mem_ctx = state;
|
---|
1555 | }
|
---|
1556 |
|
---|
1557 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1558 | TALLOC_FREE(subreq);
|
---|
1559 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1560 | tevent_req_nterror(req, status);
|
---|
1561 | return;
|
---|
1562 | }
|
---|
1563 |
|
---|
1564 | /* Copy out parameters */
|
---|
1565 | *state->orig.out.group_handle = *state->tmp.out.group_handle;
|
---|
1566 | *state->orig.out.rid = *state->tmp.out.rid;
|
---|
1567 |
|
---|
1568 | /* Copy result */
|
---|
1569 | state->orig.out.result = state->tmp.out.result;
|
---|
1570 |
|
---|
1571 | /* Reset temporary structure */
|
---|
1572 | ZERO_STRUCT(state->tmp);
|
---|
1573 |
|
---|
1574 | tevent_req_done(req);
|
---|
1575 | }
|
---|
1576 |
|
---|
1577 | NTSTATUS rpccli_samr_CreateDomainGroup_recv(struct tevent_req *req,
|
---|
1578 | TALLOC_CTX *mem_ctx,
|
---|
1579 | NTSTATUS *result)
|
---|
1580 | {
|
---|
1581 | struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
|
---|
1582 | req, struct rpccli_samr_CreateDomainGroup_state);
|
---|
1583 | NTSTATUS status;
|
---|
1584 |
|
---|
1585 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1586 | tevent_req_received(req);
|
---|
1587 | return status;
|
---|
1588 | }
|
---|
1589 |
|
---|
1590 | /* Steal possbile out parameters to the callers context */
|
---|
1591 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1592 |
|
---|
1593 | /* Return result */
|
---|
1594 | *result = state->orig.out.result;
|
---|
1595 |
|
---|
1596 | tevent_req_received(req);
|
---|
1597 | return NT_STATUS_OK;
|
---|
1598 | }
|
---|
1599 |
|
---|
1600 | NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
|
---|
1601 | TALLOC_CTX *mem_ctx,
|
---|
1602 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
1603 | struct lsa_String *name /* [in] [ref] */,
|
---|
1604 | uint32_t access_mask /* [in] */,
|
---|
1605 | struct policy_handle *group_handle /* [out] [ref] */,
|
---|
1606 | uint32_t *rid /* [out] [ref] */)
|
---|
1607 | {
|
---|
1608 | struct samr_CreateDomainGroup r;
|
---|
1609 | NTSTATUS status;
|
---|
1610 |
|
---|
1611 | /* In parameters */
|
---|
1612 | r.in.domain_handle = domain_handle;
|
---|
1613 | r.in.name = name;
|
---|
1614 | r.in.access_mask = access_mask;
|
---|
1615 |
|
---|
1616 | status = cli->dispatch(cli,
|
---|
1617 | mem_ctx,
|
---|
1618 | &ndr_table_samr,
|
---|
1619 | NDR_SAMR_CREATEDOMAINGROUP,
|
---|
1620 | &r);
|
---|
1621 |
|
---|
1622 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1623 | return status;
|
---|
1624 | }
|
---|
1625 |
|
---|
1626 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1627 | return status;
|
---|
1628 | }
|
---|
1629 |
|
---|
1630 | /* Return variables */
|
---|
1631 | *group_handle = *r.out.group_handle;
|
---|
1632 | *rid = *r.out.rid;
|
---|
1633 |
|
---|
1634 | /* Return result */
|
---|
1635 | return r.out.result;
|
---|
1636 | }
|
---|
1637 |
|
---|
1638 | struct rpccli_samr_EnumDomainGroups_state {
|
---|
1639 | struct samr_EnumDomainGroups orig;
|
---|
1640 | struct samr_EnumDomainGroups tmp;
|
---|
1641 | TALLOC_CTX *out_mem_ctx;
|
---|
1642 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1643 | };
|
---|
1644 |
|
---|
1645 | static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq);
|
---|
1646 |
|
---|
1647 | struct tevent_req *rpccli_samr_EnumDomainGroups_send(TALLOC_CTX *mem_ctx,
|
---|
1648 | struct tevent_context *ev,
|
---|
1649 | struct rpc_pipe_client *cli,
|
---|
1650 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
1651 | uint32_t *_resume_handle /* [in,out] [ref] */,
|
---|
1652 | struct samr_SamArray **_sam /* [out] [ref] */,
|
---|
1653 | uint32_t _max_size /* [in] */,
|
---|
1654 | uint32_t *_num_entries /* [out] [ref] */)
|
---|
1655 | {
|
---|
1656 | struct tevent_req *req;
|
---|
1657 | struct rpccli_samr_EnumDomainGroups_state *state;
|
---|
1658 | struct tevent_req *subreq;
|
---|
1659 |
|
---|
1660 | req = tevent_req_create(mem_ctx, &state,
|
---|
1661 | struct rpccli_samr_EnumDomainGroups_state);
|
---|
1662 | if (req == NULL) {
|
---|
1663 | return NULL;
|
---|
1664 | }
|
---|
1665 | state->out_mem_ctx = NULL;
|
---|
1666 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1667 |
|
---|
1668 | /* In parameters */
|
---|
1669 | state->orig.in.domain_handle = _domain_handle;
|
---|
1670 | state->orig.in.resume_handle = _resume_handle;
|
---|
1671 | state->orig.in.max_size = _max_size;
|
---|
1672 |
|
---|
1673 | /* Out parameters */
|
---|
1674 | state->orig.out.resume_handle = _resume_handle;
|
---|
1675 | state->orig.out.sam = _sam;
|
---|
1676 | state->orig.out.num_entries = _num_entries;
|
---|
1677 |
|
---|
1678 | /* Result */
|
---|
1679 | ZERO_STRUCT(state->orig.out.result);
|
---|
1680 |
|
---|
1681 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1682 | "rpccli_samr_EnumDomainGroups_out_memory");
|
---|
1683 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1684 | return tevent_req_post(req, ev);
|
---|
1685 | }
|
---|
1686 |
|
---|
1687 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1688 | state->tmp = state->orig;
|
---|
1689 |
|
---|
1690 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1691 | &ndr_table_samr,
|
---|
1692 | NDR_SAMR_ENUMDOMAINGROUPS,
|
---|
1693 | &state->tmp);
|
---|
1694 | if (tevent_req_nomem(subreq, req)) {
|
---|
1695 | return tevent_req_post(req, ev);
|
---|
1696 | }
|
---|
1697 | tevent_req_set_callback(subreq, rpccli_samr_EnumDomainGroups_done, req);
|
---|
1698 | return req;
|
---|
1699 | }
|
---|
1700 |
|
---|
1701 | static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq)
|
---|
1702 | {
|
---|
1703 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1704 | subreq, struct tevent_req);
|
---|
1705 | struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
|
---|
1706 | req, struct rpccli_samr_EnumDomainGroups_state);
|
---|
1707 | NTSTATUS status;
|
---|
1708 | TALLOC_CTX *mem_ctx;
|
---|
1709 |
|
---|
1710 | if (state->out_mem_ctx) {
|
---|
1711 | mem_ctx = state->out_mem_ctx;
|
---|
1712 | } else {
|
---|
1713 | mem_ctx = state;
|
---|
1714 | }
|
---|
1715 |
|
---|
1716 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1717 | TALLOC_FREE(subreq);
|
---|
1718 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1719 | tevent_req_nterror(req, status);
|
---|
1720 | return;
|
---|
1721 | }
|
---|
1722 |
|
---|
1723 | /* Copy out parameters */
|
---|
1724 | *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
|
---|
1725 | *state->orig.out.sam = *state->tmp.out.sam;
|
---|
1726 | *state->orig.out.num_entries = *state->tmp.out.num_entries;
|
---|
1727 |
|
---|
1728 | /* Copy result */
|
---|
1729 | state->orig.out.result = state->tmp.out.result;
|
---|
1730 |
|
---|
1731 | /* Reset temporary structure */
|
---|
1732 | ZERO_STRUCT(state->tmp);
|
---|
1733 |
|
---|
1734 | tevent_req_done(req);
|
---|
1735 | }
|
---|
1736 |
|
---|
1737 | NTSTATUS rpccli_samr_EnumDomainGroups_recv(struct tevent_req *req,
|
---|
1738 | TALLOC_CTX *mem_ctx,
|
---|
1739 | NTSTATUS *result)
|
---|
1740 | {
|
---|
1741 | struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
|
---|
1742 | req, struct rpccli_samr_EnumDomainGroups_state);
|
---|
1743 | NTSTATUS status;
|
---|
1744 |
|
---|
1745 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1746 | tevent_req_received(req);
|
---|
1747 | return status;
|
---|
1748 | }
|
---|
1749 |
|
---|
1750 | /* Steal possbile out parameters to the callers context */
|
---|
1751 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1752 |
|
---|
1753 | /* Return result */
|
---|
1754 | *result = state->orig.out.result;
|
---|
1755 |
|
---|
1756 | tevent_req_received(req);
|
---|
1757 | return NT_STATUS_OK;
|
---|
1758 | }
|
---|
1759 |
|
---|
1760 | NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
|
---|
1761 | TALLOC_CTX *mem_ctx,
|
---|
1762 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
1763 | uint32_t *resume_handle /* [in,out] [ref] */,
|
---|
1764 | struct samr_SamArray **sam /* [out] [ref] */,
|
---|
1765 | uint32_t max_size /* [in] */,
|
---|
1766 | uint32_t *num_entries /* [out] [ref] */)
|
---|
1767 | {
|
---|
1768 | struct samr_EnumDomainGroups r;
|
---|
1769 | NTSTATUS status;
|
---|
1770 |
|
---|
1771 | /* In parameters */
|
---|
1772 | r.in.domain_handle = domain_handle;
|
---|
1773 | r.in.resume_handle = resume_handle;
|
---|
1774 | r.in.max_size = max_size;
|
---|
1775 |
|
---|
1776 | status = cli->dispatch(cli,
|
---|
1777 | mem_ctx,
|
---|
1778 | &ndr_table_samr,
|
---|
1779 | NDR_SAMR_ENUMDOMAINGROUPS,
|
---|
1780 | &r);
|
---|
1781 |
|
---|
1782 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1783 | return status;
|
---|
1784 | }
|
---|
1785 |
|
---|
1786 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1787 | return status;
|
---|
1788 | }
|
---|
1789 |
|
---|
1790 | /* Return variables */
|
---|
1791 | *resume_handle = *r.out.resume_handle;
|
---|
1792 | *sam = *r.out.sam;
|
---|
1793 | *num_entries = *r.out.num_entries;
|
---|
1794 |
|
---|
1795 | /* Return result */
|
---|
1796 | return r.out.result;
|
---|
1797 | }
|
---|
1798 |
|
---|
1799 | struct rpccli_samr_CreateUser_state {
|
---|
1800 | struct samr_CreateUser orig;
|
---|
1801 | struct samr_CreateUser tmp;
|
---|
1802 | TALLOC_CTX *out_mem_ctx;
|
---|
1803 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1804 | };
|
---|
1805 |
|
---|
1806 | static void rpccli_samr_CreateUser_done(struct tevent_req *subreq);
|
---|
1807 |
|
---|
1808 | struct tevent_req *rpccli_samr_CreateUser_send(TALLOC_CTX *mem_ctx,
|
---|
1809 | struct tevent_context *ev,
|
---|
1810 | struct rpc_pipe_client *cli,
|
---|
1811 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
1812 | struct lsa_String *_account_name /* [in] [ref] */,
|
---|
1813 | uint32_t _access_mask /* [in] */,
|
---|
1814 | struct policy_handle *_user_handle /* [out] [ref] */,
|
---|
1815 | uint32_t *_rid /* [out] [ref] */)
|
---|
1816 | {
|
---|
1817 | struct tevent_req *req;
|
---|
1818 | struct rpccli_samr_CreateUser_state *state;
|
---|
1819 | struct tevent_req *subreq;
|
---|
1820 |
|
---|
1821 | req = tevent_req_create(mem_ctx, &state,
|
---|
1822 | struct rpccli_samr_CreateUser_state);
|
---|
1823 | if (req == NULL) {
|
---|
1824 | return NULL;
|
---|
1825 | }
|
---|
1826 | state->out_mem_ctx = NULL;
|
---|
1827 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1828 |
|
---|
1829 | /* In parameters */
|
---|
1830 | state->orig.in.domain_handle = _domain_handle;
|
---|
1831 | state->orig.in.account_name = _account_name;
|
---|
1832 | state->orig.in.access_mask = _access_mask;
|
---|
1833 |
|
---|
1834 | /* Out parameters */
|
---|
1835 | state->orig.out.user_handle = _user_handle;
|
---|
1836 | state->orig.out.rid = _rid;
|
---|
1837 |
|
---|
1838 | /* Result */
|
---|
1839 | ZERO_STRUCT(state->orig.out.result);
|
---|
1840 |
|
---|
1841 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1842 | "rpccli_samr_CreateUser_out_memory");
|
---|
1843 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1844 | return tevent_req_post(req, ev);
|
---|
1845 | }
|
---|
1846 |
|
---|
1847 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1848 | state->tmp = state->orig;
|
---|
1849 |
|
---|
1850 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1851 | &ndr_table_samr,
|
---|
1852 | NDR_SAMR_CREATEUSER,
|
---|
1853 | &state->tmp);
|
---|
1854 | if (tevent_req_nomem(subreq, req)) {
|
---|
1855 | return tevent_req_post(req, ev);
|
---|
1856 | }
|
---|
1857 | tevent_req_set_callback(subreq, rpccli_samr_CreateUser_done, req);
|
---|
1858 | return req;
|
---|
1859 | }
|
---|
1860 |
|
---|
1861 | static void rpccli_samr_CreateUser_done(struct tevent_req *subreq)
|
---|
1862 | {
|
---|
1863 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1864 | subreq, struct tevent_req);
|
---|
1865 | struct rpccli_samr_CreateUser_state *state = tevent_req_data(
|
---|
1866 | req, struct rpccli_samr_CreateUser_state);
|
---|
1867 | NTSTATUS status;
|
---|
1868 | TALLOC_CTX *mem_ctx;
|
---|
1869 |
|
---|
1870 | if (state->out_mem_ctx) {
|
---|
1871 | mem_ctx = state->out_mem_ctx;
|
---|
1872 | } else {
|
---|
1873 | mem_ctx = state;
|
---|
1874 | }
|
---|
1875 |
|
---|
1876 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1877 | TALLOC_FREE(subreq);
|
---|
1878 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1879 | tevent_req_nterror(req, status);
|
---|
1880 | return;
|
---|
1881 | }
|
---|
1882 |
|
---|
1883 | /* Copy out parameters */
|
---|
1884 | *state->orig.out.user_handle = *state->tmp.out.user_handle;
|
---|
1885 | *state->orig.out.rid = *state->tmp.out.rid;
|
---|
1886 |
|
---|
1887 | /* Copy result */
|
---|
1888 | state->orig.out.result = state->tmp.out.result;
|
---|
1889 |
|
---|
1890 | /* Reset temporary structure */
|
---|
1891 | ZERO_STRUCT(state->tmp);
|
---|
1892 |
|
---|
1893 | tevent_req_done(req);
|
---|
1894 | }
|
---|
1895 |
|
---|
1896 | NTSTATUS rpccli_samr_CreateUser_recv(struct tevent_req *req,
|
---|
1897 | TALLOC_CTX *mem_ctx,
|
---|
1898 | NTSTATUS *result)
|
---|
1899 | {
|
---|
1900 | struct rpccli_samr_CreateUser_state *state = tevent_req_data(
|
---|
1901 | req, struct rpccli_samr_CreateUser_state);
|
---|
1902 | NTSTATUS status;
|
---|
1903 |
|
---|
1904 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1905 | tevent_req_received(req);
|
---|
1906 | return status;
|
---|
1907 | }
|
---|
1908 |
|
---|
1909 | /* Steal possbile out parameters to the callers context */
|
---|
1910 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1911 |
|
---|
1912 | /* Return result */
|
---|
1913 | *result = state->orig.out.result;
|
---|
1914 |
|
---|
1915 | tevent_req_received(req);
|
---|
1916 | return NT_STATUS_OK;
|
---|
1917 | }
|
---|
1918 |
|
---|
1919 | NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
|
---|
1920 | TALLOC_CTX *mem_ctx,
|
---|
1921 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
1922 | struct lsa_String *account_name /* [in] [ref] */,
|
---|
1923 | uint32_t access_mask /* [in] */,
|
---|
1924 | struct policy_handle *user_handle /* [out] [ref] */,
|
---|
1925 | uint32_t *rid /* [out] [ref] */)
|
---|
1926 | {
|
---|
1927 | struct samr_CreateUser r;
|
---|
1928 | NTSTATUS status;
|
---|
1929 |
|
---|
1930 | /* In parameters */
|
---|
1931 | r.in.domain_handle = domain_handle;
|
---|
1932 | r.in.account_name = account_name;
|
---|
1933 | r.in.access_mask = access_mask;
|
---|
1934 |
|
---|
1935 | status = cli->dispatch(cli,
|
---|
1936 | mem_ctx,
|
---|
1937 | &ndr_table_samr,
|
---|
1938 | NDR_SAMR_CREATEUSER,
|
---|
1939 | &r);
|
---|
1940 |
|
---|
1941 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1942 | return status;
|
---|
1943 | }
|
---|
1944 |
|
---|
1945 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1946 | return status;
|
---|
1947 | }
|
---|
1948 |
|
---|
1949 | /* Return variables */
|
---|
1950 | *user_handle = *r.out.user_handle;
|
---|
1951 | *rid = *r.out.rid;
|
---|
1952 |
|
---|
1953 | /* Return result */
|
---|
1954 | return r.out.result;
|
---|
1955 | }
|
---|
1956 |
|
---|
1957 | struct rpccli_samr_EnumDomainUsers_state {
|
---|
1958 | struct samr_EnumDomainUsers orig;
|
---|
1959 | struct samr_EnumDomainUsers tmp;
|
---|
1960 | TALLOC_CTX *out_mem_ctx;
|
---|
1961 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1962 | };
|
---|
1963 |
|
---|
1964 | static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq);
|
---|
1965 |
|
---|
1966 | struct tevent_req *rpccli_samr_EnumDomainUsers_send(TALLOC_CTX *mem_ctx,
|
---|
1967 | struct tevent_context *ev,
|
---|
1968 | struct rpc_pipe_client *cli,
|
---|
1969 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
1970 | uint32_t *_resume_handle /* [in,out] [ref] */,
|
---|
1971 | uint32_t _acct_flags /* [in] */,
|
---|
1972 | struct samr_SamArray **_sam /* [out] [ref] */,
|
---|
1973 | uint32_t _max_size /* [in] */,
|
---|
1974 | uint32_t *_num_entries /* [out] [ref] */)
|
---|
1975 | {
|
---|
1976 | struct tevent_req *req;
|
---|
1977 | struct rpccli_samr_EnumDomainUsers_state *state;
|
---|
1978 | struct tevent_req *subreq;
|
---|
1979 |
|
---|
1980 | req = tevent_req_create(mem_ctx, &state,
|
---|
1981 | struct rpccli_samr_EnumDomainUsers_state);
|
---|
1982 | if (req == NULL) {
|
---|
1983 | return NULL;
|
---|
1984 | }
|
---|
1985 | state->out_mem_ctx = NULL;
|
---|
1986 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1987 |
|
---|
1988 | /* In parameters */
|
---|
1989 | state->orig.in.domain_handle = _domain_handle;
|
---|
1990 | state->orig.in.resume_handle = _resume_handle;
|
---|
1991 | state->orig.in.acct_flags = _acct_flags;
|
---|
1992 | state->orig.in.max_size = _max_size;
|
---|
1993 |
|
---|
1994 | /* Out parameters */
|
---|
1995 | state->orig.out.resume_handle = _resume_handle;
|
---|
1996 | state->orig.out.sam = _sam;
|
---|
1997 | state->orig.out.num_entries = _num_entries;
|
---|
1998 |
|
---|
1999 | /* Result */
|
---|
2000 | ZERO_STRUCT(state->orig.out.result);
|
---|
2001 |
|
---|
2002 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2003 | "rpccli_samr_EnumDomainUsers_out_memory");
|
---|
2004 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2005 | return tevent_req_post(req, ev);
|
---|
2006 | }
|
---|
2007 |
|
---|
2008 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2009 | state->tmp = state->orig;
|
---|
2010 |
|
---|
2011 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2012 | &ndr_table_samr,
|
---|
2013 | NDR_SAMR_ENUMDOMAINUSERS,
|
---|
2014 | &state->tmp);
|
---|
2015 | if (tevent_req_nomem(subreq, req)) {
|
---|
2016 | return tevent_req_post(req, ev);
|
---|
2017 | }
|
---|
2018 | tevent_req_set_callback(subreq, rpccli_samr_EnumDomainUsers_done, req);
|
---|
2019 | return req;
|
---|
2020 | }
|
---|
2021 |
|
---|
2022 | static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq)
|
---|
2023 | {
|
---|
2024 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2025 | subreq, struct tevent_req);
|
---|
2026 | struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
|
---|
2027 | req, struct rpccli_samr_EnumDomainUsers_state);
|
---|
2028 | NTSTATUS status;
|
---|
2029 | TALLOC_CTX *mem_ctx;
|
---|
2030 |
|
---|
2031 | if (state->out_mem_ctx) {
|
---|
2032 | mem_ctx = state->out_mem_ctx;
|
---|
2033 | } else {
|
---|
2034 | mem_ctx = state;
|
---|
2035 | }
|
---|
2036 |
|
---|
2037 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2038 | TALLOC_FREE(subreq);
|
---|
2039 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2040 | tevent_req_nterror(req, status);
|
---|
2041 | return;
|
---|
2042 | }
|
---|
2043 |
|
---|
2044 | /* Copy out parameters */
|
---|
2045 | *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
|
---|
2046 | *state->orig.out.sam = *state->tmp.out.sam;
|
---|
2047 | *state->orig.out.num_entries = *state->tmp.out.num_entries;
|
---|
2048 |
|
---|
2049 | /* Copy result */
|
---|
2050 | state->orig.out.result = state->tmp.out.result;
|
---|
2051 |
|
---|
2052 | /* Reset temporary structure */
|
---|
2053 | ZERO_STRUCT(state->tmp);
|
---|
2054 |
|
---|
2055 | tevent_req_done(req);
|
---|
2056 | }
|
---|
2057 |
|
---|
2058 | NTSTATUS rpccli_samr_EnumDomainUsers_recv(struct tevent_req *req,
|
---|
2059 | TALLOC_CTX *mem_ctx,
|
---|
2060 | NTSTATUS *result)
|
---|
2061 | {
|
---|
2062 | struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
|
---|
2063 | req, struct rpccli_samr_EnumDomainUsers_state);
|
---|
2064 | NTSTATUS status;
|
---|
2065 |
|
---|
2066 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2067 | tevent_req_received(req);
|
---|
2068 | return status;
|
---|
2069 | }
|
---|
2070 |
|
---|
2071 | /* Steal possbile out parameters to the callers context */
|
---|
2072 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2073 |
|
---|
2074 | /* Return result */
|
---|
2075 | *result = state->orig.out.result;
|
---|
2076 |
|
---|
2077 | tevent_req_received(req);
|
---|
2078 | return NT_STATUS_OK;
|
---|
2079 | }
|
---|
2080 |
|
---|
2081 | NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
|
---|
2082 | TALLOC_CTX *mem_ctx,
|
---|
2083 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
2084 | uint32_t *resume_handle /* [in,out] [ref] */,
|
---|
2085 | uint32_t acct_flags /* [in] */,
|
---|
2086 | struct samr_SamArray **sam /* [out] [ref] */,
|
---|
2087 | uint32_t max_size /* [in] */,
|
---|
2088 | uint32_t *num_entries /* [out] [ref] */)
|
---|
2089 | {
|
---|
2090 | struct samr_EnumDomainUsers r;
|
---|
2091 | NTSTATUS status;
|
---|
2092 |
|
---|
2093 | /* In parameters */
|
---|
2094 | r.in.domain_handle = domain_handle;
|
---|
2095 | r.in.resume_handle = resume_handle;
|
---|
2096 | r.in.acct_flags = acct_flags;
|
---|
2097 | r.in.max_size = max_size;
|
---|
2098 |
|
---|
2099 | status = cli->dispatch(cli,
|
---|
2100 | mem_ctx,
|
---|
2101 | &ndr_table_samr,
|
---|
2102 | NDR_SAMR_ENUMDOMAINUSERS,
|
---|
2103 | &r);
|
---|
2104 |
|
---|
2105 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2106 | return status;
|
---|
2107 | }
|
---|
2108 |
|
---|
2109 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2110 | return status;
|
---|
2111 | }
|
---|
2112 |
|
---|
2113 | /* Return variables */
|
---|
2114 | *resume_handle = *r.out.resume_handle;
|
---|
2115 | *sam = *r.out.sam;
|
---|
2116 | *num_entries = *r.out.num_entries;
|
---|
2117 |
|
---|
2118 | /* Return result */
|
---|
2119 | return r.out.result;
|
---|
2120 | }
|
---|
2121 |
|
---|
2122 | struct rpccli_samr_CreateDomAlias_state {
|
---|
2123 | struct samr_CreateDomAlias orig;
|
---|
2124 | struct samr_CreateDomAlias tmp;
|
---|
2125 | TALLOC_CTX *out_mem_ctx;
|
---|
2126 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2127 | };
|
---|
2128 |
|
---|
2129 | static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq);
|
---|
2130 |
|
---|
2131 | struct tevent_req *rpccli_samr_CreateDomAlias_send(TALLOC_CTX *mem_ctx,
|
---|
2132 | struct tevent_context *ev,
|
---|
2133 | struct rpc_pipe_client *cli,
|
---|
2134 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
2135 | struct lsa_String *_alias_name /* [in] [ref] */,
|
---|
2136 | uint32_t _access_mask /* [in] */,
|
---|
2137 | struct policy_handle *_alias_handle /* [out] [ref] */,
|
---|
2138 | uint32_t *_rid /* [out] [ref] */)
|
---|
2139 | {
|
---|
2140 | struct tevent_req *req;
|
---|
2141 | struct rpccli_samr_CreateDomAlias_state *state;
|
---|
2142 | struct tevent_req *subreq;
|
---|
2143 |
|
---|
2144 | req = tevent_req_create(mem_ctx, &state,
|
---|
2145 | struct rpccli_samr_CreateDomAlias_state);
|
---|
2146 | if (req == NULL) {
|
---|
2147 | return NULL;
|
---|
2148 | }
|
---|
2149 | state->out_mem_ctx = NULL;
|
---|
2150 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2151 |
|
---|
2152 | /* In parameters */
|
---|
2153 | state->orig.in.domain_handle = _domain_handle;
|
---|
2154 | state->orig.in.alias_name = _alias_name;
|
---|
2155 | state->orig.in.access_mask = _access_mask;
|
---|
2156 |
|
---|
2157 | /* Out parameters */
|
---|
2158 | state->orig.out.alias_handle = _alias_handle;
|
---|
2159 | state->orig.out.rid = _rid;
|
---|
2160 |
|
---|
2161 | /* Result */
|
---|
2162 | ZERO_STRUCT(state->orig.out.result);
|
---|
2163 |
|
---|
2164 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2165 | "rpccli_samr_CreateDomAlias_out_memory");
|
---|
2166 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2167 | return tevent_req_post(req, ev);
|
---|
2168 | }
|
---|
2169 |
|
---|
2170 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2171 | state->tmp = state->orig;
|
---|
2172 |
|
---|
2173 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2174 | &ndr_table_samr,
|
---|
2175 | NDR_SAMR_CREATEDOMALIAS,
|
---|
2176 | &state->tmp);
|
---|
2177 | if (tevent_req_nomem(subreq, req)) {
|
---|
2178 | return tevent_req_post(req, ev);
|
---|
2179 | }
|
---|
2180 | tevent_req_set_callback(subreq, rpccli_samr_CreateDomAlias_done, req);
|
---|
2181 | return req;
|
---|
2182 | }
|
---|
2183 |
|
---|
2184 | static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq)
|
---|
2185 | {
|
---|
2186 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2187 | subreq, struct tevent_req);
|
---|
2188 | struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
|
---|
2189 | req, struct rpccli_samr_CreateDomAlias_state);
|
---|
2190 | NTSTATUS status;
|
---|
2191 | TALLOC_CTX *mem_ctx;
|
---|
2192 |
|
---|
2193 | if (state->out_mem_ctx) {
|
---|
2194 | mem_ctx = state->out_mem_ctx;
|
---|
2195 | } else {
|
---|
2196 | mem_ctx = state;
|
---|
2197 | }
|
---|
2198 |
|
---|
2199 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2200 | TALLOC_FREE(subreq);
|
---|
2201 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2202 | tevent_req_nterror(req, status);
|
---|
2203 | return;
|
---|
2204 | }
|
---|
2205 |
|
---|
2206 | /* Copy out parameters */
|
---|
2207 | *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
|
---|
2208 | *state->orig.out.rid = *state->tmp.out.rid;
|
---|
2209 |
|
---|
2210 | /* Copy result */
|
---|
2211 | state->orig.out.result = state->tmp.out.result;
|
---|
2212 |
|
---|
2213 | /* Reset temporary structure */
|
---|
2214 | ZERO_STRUCT(state->tmp);
|
---|
2215 |
|
---|
2216 | tevent_req_done(req);
|
---|
2217 | }
|
---|
2218 |
|
---|
2219 | NTSTATUS rpccli_samr_CreateDomAlias_recv(struct tevent_req *req,
|
---|
2220 | TALLOC_CTX *mem_ctx,
|
---|
2221 | NTSTATUS *result)
|
---|
2222 | {
|
---|
2223 | struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
|
---|
2224 | req, struct rpccli_samr_CreateDomAlias_state);
|
---|
2225 | NTSTATUS status;
|
---|
2226 |
|
---|
2227 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2228 | tevent_req_received(req);
|
---|
2229 | return status;
|
---|
2230 | }
|
---|
2231 |
|
---|
2232 | /* Steal possbile out parameters to the callers context */
|
---|
2233 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2234 |
|
---|
2235 | /* Return result */
|
---|
2236 | *result = state->orig.out.result;
|
---|
2237 |
|
---|
2238 | tevent_req_received(req);
|
---|
2239 | return NT_STATUS_OK;
|
---|
2240 | }
|
---|
2241 |
|
---|
2242 | NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
|
---|
2243 | TALLOC_CTX *mem_ctx,
|
---|
2244 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
2245 | struct lsa_String *alias_name /* [in] [ref] */,
|
---|
2246 | uint32_t access_mask /* [in] */,
|
---|
2247 | struct policy_handle *alias_handle /* [out] [ref] */,
|
---|
2248 | uint32_t *rid /* [out] [ref] */)
|
---|
2249 | {
|
---|
2250 | struct samr_CreateDomAlias r;
|
---|
2251 | NTSTATUS status;
|
---|
2252 |
|
---|
2253 | /* In parameters */
|
---|
2254 | r.in.domain_handle = domain_handle;
|
---|
2255 | r.in.alias_name = alias_name;
|
---|
2256 | r.in.access_mask = access_mask;
|
---|
2257 |
|
---|
2258 | status = cli->dispatch(cli,
|
---|
2259 | mem_ctx,
|
---|
2260 | &ndr_table_samr,
|
---|
2261 | NDR_SAMR_CREATEDOMALIAS,
|
---|
2262 | &r);
|
---|
2263 |
|
---|
2264 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2265 | return status;
|
---|
2266 | }
|
---|
2267 |
|
---|
2268 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2269 | return status;
|
---|
2270 | }
|
---|
2271 |
|
---|
2272 | /* Return variables */
|
---|
2273 | *alias_handle = *r.out.alias_handle;
|
---|
2274 | *rid = *r.out.rid;
|
---|
2275 |
|
---|
2276 | /* Return result */
|
---|
2277 | return r.out.result;
|
---|
2278 | }
|
---|
2279 |
|
---|
2280 | struct rpccli_samr_EnumDomainAliases_state {
|
---|
2281 | struct samr_EnumDomainAliases orig;
|
---|
2282 | struct samr_EnumDomainAliases tmp;
|
---|
2283 | TALLOC_CTX *out_mem_ctx;
|
---|
2284 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2285 | };
|
---|
2286 |
|
---|
2287 | static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq);
|
---|
2288 |
|
---|
2289 | struct tevent_req *rpccli_samr_EnumDomainAliases_send(TALLOC_CTX *mem_ctx,
|
---|
2290 | struct tevent_context *ev,
|
---|
2291 | struct rpc_pipe_client *cli,
|
---|
2292 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
2293 | uint32_t *_resume_handle /* [in,out] [ref] */,
|
---|
2294 | struct samr_SamArray **_sam /* [out] [ref] */,
|
---|
2295 | uint32_t _max_size /* [in] */,
|
---|
2296 | uint32_t *_num_entries /* [out] [ref] */)
|
---|
2297 | {
|
---|
2298 | struct tevent_req *req;
|
---|
2299 | struct rpccli_samr_EnumDomainAliases_state *state;
|
---|
2300 | struct tevent_req *subreq;
|
---|
2301 |
|
---|
2302 | req = tevent_req_create(mem_ctx, &state,
|
---|
2303 | struct rpccli_samr_EnumDomainAliases_state);
|
---|
2304 | if (req == NULL) {
|
---|
2305 | return NULL;
|
---|
2306 | }
|
---|
2307 | state->out_mem_ctx = NULL;
|
---|
2308 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2309 |
|
---|
2310 | /* In parameters */
|
---|
2311 | state->orig.in.domain_handle = _domain_handle;
|
---|
2312 | state->orig.in.resume_handle = _resume_handle;
|
---|
2313 | state->orig.in.max_size = _max_size;
|
---|
2314 |
|
---|
2315 | /* Out parameters */
|
---|
2316 | state->orig.out.resume_handle = _resume_handle;
|
---|
2317 | state->orig.out.sam = _sam;
|
---|
2318 | state->orig.out.num_entries = _num_entries;
|
---|
2319 |
|
---|
2320 | /* Result */
|
---|
2321 | ZERO_STRUCT(state->orig.out.result);
|
---|
2322 |
|
---|
2323 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2324 | "rpccli_samr_EnumDomainAliases_out_memory");
|
---|
2325 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2326 | return tevent_req_post(req, ev);
|
---|
2327 | }
|
---|
2328 |
|
---|
2329 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2330 | state->tmp = state->orig;
|
---|
2331 |
|
---|
2332 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2333 | &ndr_table_samr,
|
---|
2334 | NDR_SAMR_ENUMDOMAINALIASES,
|
---|
2335 | &state->tmp);
|
---|
2336 | if (tevent_req_nomem(subreq, req)) {
|
---|
2337 | return tevent_req_post(req, ev);
|
---|
2338 | }
|
---|
2339 | tevent_req_set_callback(subreq, rpccli_samr_EnumDomainAliases_done, req);
|
---|
2340 | return req;
|
---|
2341 | }
|
---|
2342 |
|
---|
2343 | static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq)
|
---|
2344 | {
|
---|
2345 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2346 | subreq, struct tevent_req);
|
---|
2347 | struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
|
---|
2348 | req, struct rpccli_samr_EnumDomainAliases_state);
|
---|
2349 | NTSTATUS status;
|
---|
2350 | TALLOC_CTX *mem_ctx;
|
---|
2351 |
|
---|
2352 | if (state->out_mem_ctx) {
|
---|
2353 | mem_ctx = state->out_mem_ctx;
|
---|
2354 | } else {
|
---|
2355 | mem_ctx = state;
|
---|
2356 | }
|
---|
2357 |
|
---|
2358 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2359 | TALLOC_FREE(subreq);
|
---|
2360 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2361 | tevent_req_nterror(req, status);
|
---|
2362 | return;
|
---|
2363 | }
|
---|
2364 |
|
---|
2365 | /* Copy out parameters */
|
---|
2366 | *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
|
---|
2367 | *state->orig.out.sam = *state->tmp.out.sam;
|
---|
2368 | *state->orig.out.num_entries = *state->tmp.out.num_entries;
|
---|
2369 |
|
---|
2370 | /* Copy result */
|
---|
2371 | state->orig.out.result = state->tmp.out.result;
|
---|
2372 |
|
---|
2373 | /* Reset temporary structure */
|
---|
2374 | ZERO_STRUCT(state->tmp);
|
---|
2375 |
|
---|
2376 | tevent_req_done(req);
|
---|
2377 | }
|
---|
2378 |
|
---|
2379 | NTSTATUS rpccli_samr_EnumDomainAliases_recv(struct tevent_req *req,
|
---|
2380 | TALLOC_CTX *mem_ctx,
|
---|
2381 | NTSTATUS *result)
|
---|
2382 | {
|
---|
2383 | struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
|
---|
2384 | req, struct rpccli_samr_EnumDomainAliases_state);
|
---|
2385 | NTSTATUS status;
|
---|
2386 |
|
---|
2387 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2388 | tevent_req_received(req);
|
---|
2389 | return status;
|
---|
2390 | }
|
---|
2391 |
|
---|
2392 | /* Steal possbile out parameters to the callers context */
|
---|
2393 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2394 |
|
---|
2395 | /* Return result */
|
---|
2396 | *result = state->orig.out.result;
|
---|
2397 |
|
---|
2398 | tevent_req_received(req);
|
---|
2399 | return NT_STATUS_OK;
|
---|
2400 | }
|
---|
2401 |
|
---|
2402 | NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
|
---|
2403 | TALLOC_CTX *mem_ctx,
|
---|
2404 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
2405 | uint32_t *resume_handle /* [in,out] [ref] */,
|
---|
2406 | struct samr_SamArray **sam /* [out] [ref] */,
|
---|
2407 | uint32_t max_size /* [in] */,
|
---|
2408 | uint32_t *num_entries /* [out] [ref] */)
|
---|
2409 | {
|
---|
2410 | struct samr_EnumDomainAliases r;
|
---|
2411 | NTSTATUS status;
|
---|
2412 |
|
---|
2413 | /* In parameters */
|
---|
2414 | r.in.domain_handle = domain_handle;
|
---|
2415 | r.in.resume_handle = resume_handle;
|
---|
2416 | r.in.max_size = max_size;
|
---|
2417 |
|
---|
2418 | status = cli->dispatch(cli,
|
---|
2419 | mem_ctx,
|
---|
2420 | &ndr_table_samr,
|
---|
2421 | NDR_SAMR_ENUMDOMAINALIASES,
|
---|
2422 | &r);
|
---|
2423 |
|
---|
2424 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2425 | return status;
|
---|
2426 | }
|
---|
2427 |
|
---|
2428 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2429 | return status;
|
---|
2430 | }
|
---|
2431 |
|
---|
2432 | /* Return variables */
|
---|
2433 | *resume_handle = *r.out.resume_handle;
|
---|
2434 | *sam = *r.out.sam;
|
---|
2435 | *num_entries = *r.out.num_entries;
|
---|
2436 |
|
---|
2437 | /* Return result */
|
---|
2438 | return r.out.result;
|
---|
2439 | }
|
---|
2440 |
|
---|
2441 | struct rpccli_samr_GetAliasMembership_state {
|
---|
2442 | struct samr_GetAliasMembership orig;
|
---|
2443 | struct samr_GetAliasMembership tmp;
|
---|
2444 | TALLOC_CTX *out_mem_ctx;
|
---|
2445 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2446 | };
|
---|
2447 |
|
---|
2448 | static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq);
|
---|
2449 |
|
---|
2450 | struct tevent_req *rpccli_samr_GetAliasMembership_send(TALLOC_CTX *mem_ctx,
|
---|
2451 | struct tevent_context *ev,
|
---|
2452 | struct rpc_pipe_client *cli,
|
---|
2453 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
2454 | struct lsa_SidArray *_sids /* [in] [ref] */,
|
---|
2455 | struct samr_Ids *_rids /* [out] [ref] */)
|
---|
2456 | {
|
---|
2457 | struct tevent_req *req;
|
---|
2458 | struct rpccli_samr_GetAliasMembership_state *state;
|
---|
2459 | struct tevent_req *subreq;
|
---|
2460 |
|
---|
2461 | req = tevent_req_create(mem_ctx, &state,
|
---|
2462 | struct rpccli_samr_GetAliasMembership_state);
|
---|
2463 | if (req == NULL) {
|
---|
2464 | return NULL;
|
---|
2465 | }
|
---|
2466 | state->out_mem_ctx = NULL;
|
---|
2467 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2468 |
|
---|
2469 | /* In parameters */
|
---|
2470 | state->orig.in.domain_handle = _domain_handle;
|
---|
2471 | state->orig.in.sids = _sids;
|
---|
2472 |
|
---|
2473 | /* Out parameters */
|
---|
2474 | state->orig.out.rids = _rids;
|
---|
2475 |
|
---|
2476 | /* Result */
|
---|
2477 | ZERO_STRUCT(state->orig.out.result);
|
---|
2478 |
|
---|
2479 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2480 | "rpccli_samr_GetAliasMembership_out_memory");
|
---|
2481 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2482 | return tevent_req_post(req, ev);
|
---|
2483 | }
|
---|
2484 |
|
---|
2485 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2486 | state->tmp = state->orig;
|
---|
2487 |
|
---|
2488 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2489 | &ndr_table_samr,
|
---|
2490 | NDR_SAMR_GETALIASMEMBERSHIP,
|
---|
2491 | &state->tmp);
|
---|
2492 | if (tevent_req_nomem(subreq, req)) {
|
---|
2493 | return tevent_req_post(req, ev);
|
---|
2494 | }
|
---|
2495 | tevent_req_set_callback(subreq, rpccli_samr_GetAliasMembership_done, req);
|
---|
2496 | return req;
|
---|
2497 | }
|
---|
2498 |
|
---|
2499 | static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq)
|
---|
2500 | {
|
---|
2501 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2502 | subreq, struct tevent_req);
|
---|
2503 | struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
|
---|
2504 | req, struct rpccli_samr_GetAliasMembership_state);
|
---|
2505 | NTSTATUS status;
|
---|
2506 | TALLOC_CTX *mem_ctx;
|
---|
2507 |
|
---|
2508 | if (state->out_mem_ctx) {
|
---|
2509 | mem_ctx = state->out_mem_ctx;
|
---|
2510 | } else {
|
---|
2511 | mem_ctx = state;
|
---|
2512 | }
|
---|
2513 |
|
---|
2514 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2515 | TALLOC_FREE(subreq);
|
---|
2516 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2517 | tevent_req_nterror(req, status);
|
---|
2518 | return;
|
---|
2519 | }
|
---|
2520 |
|
---|
2521 | /* Copy out parameters */
|
---|
2522 | *state->orig.out.rids = *state->tmp.out.rids;
|
---|
2523 |
|
---|
2524 | /* Copy result */
|
---|
2525 | state->orig.out.result = state->tmp.out.result;
|
---|
2526 |
|
---|
2527 | /* Reset temporary structure */
|
---|
2528 | ZERO_STRUCT(state->tmp);
|
---|
2529 |
|
---|
2530 | tevent_req_done(req);
|
---|
2531 | }
|
---|
2532 |
|
---|
2533 | NTSTATUS rpccli_samr_GetAliasMembership_recv(struct tevent_req *req,
|
---|
2534 | TALLOC_CTX *mem_ctx,
|
---|
2535 | NTSTATUS *result)
|
---|
2536 | {
|
---|
2537 | struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
|
---|
2538 | req, struct rpccli_samr_GetAliasMembership_state);
|
---|
2539 | NTSTATUS status;
|
---|
2540 |
|
---|
2541 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2542 | tevent_req_received(req);
|
---|
2543 | return status;
|
---|
2544 | }
|
---|
2545 |
|
---|
2546 | /* Steal possbile out parameters to the callers context */
|
---|
2547 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2548 |
|
---|
2549 | /* Return result */
|
---|
2550 | *result = state->orig.out.result;
|
---|
2551 |
|
---|
2552 | tevent_req_received(req);
|
---|
2553 | return NT_STATUS_OK;
|
---|
2554 | }
|
---|
2555 |
|
---|
2556 | NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli,
|
---|
2557 | TALLOC_CTX *mem_ctx,
|
---|
2558 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
2559 | struct lsa_SidArray *sids /* [in] [ref] */,
|
---|
2560 | struct samr_Ids *rids /* [out] [ref] */)
|
---|
2561 | {
|
---|
2562 | struct samr_GetAliasMembership r;
|
---|
2563 | NTSTATUS status;
|
---|
2564 |
|
---|
2565 | /* In parameters */
|
---|
2566 | r.in.domain_handle = domain_handle;
|
---|
2567 | r.in.sids = sids;
|
---|
2568 |
|
---|
2569 | status = cli->dispatch(cli,
|
---|
2570 | mem_ctx,
|
---|
2571 | &ndr_table_samr,
|
---|
2572 | NDR_SAMR_GETALIASMEMBERSHIP,
|
---|
2573 | &r);
|
---|
2574 |
|
---|
2575 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2576 | return status;
|
---|
2577 | }
|
---|
2578 |
|
---|
2579 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2580 | return status;
|
---|
2581 | }
|
---|
2582 |
|
---|
2583 | /* Return variables */
|
---|
2584 | *rids = *r.out.rids;
|
---|
2585 |
|
---|
2586 | /* Return result */
|
---|
2587 | return r.out.result;
|
---|
2588 | }
|
---|
2589 |
|
---|
2590 | struct rpccli_samr_LookupNames_state {
|
---|
2591 | struct samr_LookupNames orig;
|
---|
2592 | struct samr_LookupNames tmp;
|
---|
2593 | TALLOC_CTX *out_mem_ctx;
|
---|
2594 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2595 | };
|
---|
2596 |
|
---|
2597 | static void rpccli_samr_LookupNames_done(struct tevent_req *subreq);
|
---|
2598 |
|
---|
2599 | struct tevent_req *rpccli_samr_LookupNames_send(TALLOC_CTX *mem_ctx,
|
---|
2600 | struct tevent_context *ev,
|
---|
2601 | struct rpc_pipe_client *cli,
|
---|
2602 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
2603 | uint32_t _num_names /* [in] [range(0,1000)] */,
|
---|
2604 | struct lsa_String *_names /* [in] [length_is(num_names),size_is(1000)] */,
|
---|
2605 | struct samr_Ids *_rids /* [out] [ref] */,
|
---|
2606 | struct samr_Ids *_types /* [out] [ref] */)
|
---|
2607 | {
|
---|
2608 | struct tevent_req *req;
|
---|
2609 | struct rpccli_samr_LookupNames_state *state;
|
---|
2610 | struct tevent_req *subreq;
|
---|
2611 |
|
---|
2612 | req = tevent_req_create(mem_ctx, &state,
|
---|
2613 | struct rpccli_samr_LookupNames_state);
|
---|
2614 | if (req == NULL) {
|
---|
2615 | return NULL;
|
---|
2616 | }
|
---|
2617 | state->out_mem_ctx = NULL;
|
---|
2618 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2619 |
|
---|
2620 | /* In parameters */
|
---|
2621 | state->orig.in.domain_handle = _domain_handle;
|
---|
2622 | state->orig.in.num_names = _num_names;
|
---|
2623 | state->orig.in.names = _names;
|
---|
2624 |
|
---|
2625 | /* Out parameters */
|
---|
2626 | state->orig.out.rids = _rids;
|
---|
2627 | state->orig.out.types = _types;
|
---|
2628 |
|
---|
2629 | /* Result */
|
---|
2630 | ZERO_STRUCT(state->orig.out.result);
|
---|
2631 |
|
---|
2632 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2633 | "rpccli_samr_LookupNames_out_memory");
|
---|
2634 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2635 | return tevent_req_post(req, ev);
|
---|
2636 | }
|
---|
2637 |
|
---|
2638 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2639 | state->tmp = state->orig;
|
---|
2640 |
|
---|
2641 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2642 | &ndr_table_samr,
|
---|
2643 | NDR_SAMR_LOOKUPNAMES,
|
---|
2644 | &state->tmp);
|
---|
2645 | if (tevent_req_nomem(subreq, req)) {
|
---|
2646 | return tevent_req_post(req, ev);
|
---|
2647 | }
|
---|
2648 | tevent_req_set_callback(subreq, rpccli_samr_LookupNames_done, req);
|
---|
2649 | return req;
|
---|
2650 | }
|
---|
2651 |
|
---|
2652 | static void rpccli_samr_LookupNames_done(struct tevent_req *subreq)
|
---|
2653 | {
|
---|
2654 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2655 | subreq, struct tevent_req);
|
---|
2656 | struct rpccli_samr_LookupNames_state *state = tevent_req_data(
|
---|
2657 | req, struct rpccli_samr_LookupNames_state);
|
---|
2658 | NTSTATUS status;
|
---|
2659 | TALLOC_CTX *mem_ctx;
|
---|
2660 |
|
---|
2661 | if (state->out_mem_ctx) {
|
---|
2662 | mem_ctx = state->out_mem_ctx;
|
---|
2663 | } else {
|
---|
2664 | mem_ctx = state;
|
---|
2665 | }
|
---|
2666 |
|
---|
2667 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2668 | TALLOC_FREE(subreq);
|
---|
2669 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2670 | tevent_req_nterror(req, status);
|
---|
2671 | return;
|
---|
2672 | }
|
---|
2673 |
|
---|
2674 | /* Copy out parameters */
|
---|
2675 | *state->orig.out.rids = *state->tmp.out.rids;
|
---|
2676 | *state->orig.out.types = *state->tmp.out.types;
|
---|
2677 |
|
---|
2678 | /* Copy result */
|
---|
2679 | state->orig.out.result = state->tmp.out.result;
|
---|
2680 |
|
---|
2681 | /* Reset temporary structure */
|
---|
2682 | ZERO_STRUCT(state->tmp);
|
---|
2683 |
|
---|
2684 | tevent_req_done(req);
|
---|
2685 | }
|
---|
2686 |
|
---|
2687 | NTSTATUS rpccli_samr_LookupNames_recv(struct tevent_req *req,
|
---|
2688 | TALLOC_CTX *mem_ctx,
|
---|
2689 | NTSTATUS *result)
|
---|
2690 | {
|
---|
2691 | struct rpccli_samr_LookupNames_state *state = tevent_req_data(
|
---|
2692 | req, struct rpccli_samr_LookupNames_state);
|
---|
2693 | NTSTATUS status;
|
---|
2694 |
|
---|
2695 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2696 | tevent_req_received(req);
|
---|
2697 | return status;
|
---|
2698 | }
|
---|
2699 |
|
---|
2700 | /* Steal possbile out parameters to the callers context */
|
---|
2701 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2702 |
|
---|
2703 | /* Return result */
|
---|
2704 | *result = state->orig.out.result;
|
---|
2705 |
|
---|
2706 | tevent_req_received(req);
|
---|
2707 | return NT_STATUS_OK;
|
---|
2708 | }
|
---|
2709 |
|
---|
2710 | NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
|
---|
2711 | TALLOC_CTX *mem_ctx,
|
---|
2712 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
2713 | uint32_t num_names /* [in] [range(0,1000)] */,
|
---|
2714 | struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */,
|
---|
2715 | struct samr_Ids *rids /* [out] [ref] */,
|
---|
2716 | struct samr_Ids *types /* [out] [ref] */)
|
---|
2717 | {
|
---|
2718 | struct samr_LookupNames r;
|
---|
2719 | NTSTATUS status;
|
---|
2720 |
|
---|
2721 | /* In parameters */
|
---|
2722 | r.in.domain_handle = domain_handle;
|
---|
2723 | r.in.num_names = num_names;
|
---|
2724 | r.in.names = names;
|
---|
2725 |
|
---|
2726 | status = cli->dispatch(cli,
|
---|
2727 | mem_ctx,
|
---|
2728 | &ndr_table_samr,
|
---|
2729 | NDR_SAMR_LOOKUPNAMES,
|
---|
2730 | &r);
|
---|
2731 |
|
---|
2732 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2733 | return status;
|
---|
2734 | }
|
---|
2735 |
|
---|
2736 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2737 | return status;
|
---|
2738 | }
|
---|
2739 |
|
---|
2740 | /* Return variables */
|
---|
2741 | *rids = *r.out.rids;
|
---|
2742 | *types = *r.out.types;
|
---|
2743 |
|
---|
2744 | /* Return result */
|
---|
2745 | return r.out.result;
|
---|
2746 | }
|
---|
2747 |
|
---|
2748 | struct rpccli_samr_LookupRids_state {
|
---|
2749 | struct samr_LookupRids orig;
|
---|
2750 | struct samr_LookupRids tmp;
|
---|
2751 | TALLOC_CTX *out_mem_ctx;
|
---|
2752 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2753 | };
|
---|
2754 |
|
---|
2755 | static void rpccli_samr_LookupRids_done(struct tevent_req *subreq);
|
---|
2756 |
|
---|
2757 | struct tevent_req *rpccli_samr_LookupRids_send(TALLOC_CTX *mem_ctx,
|
---|
2758 | struct tevent_context *ev,
|
---|
2759 | struct rpc_pipe_client *cli,
|
---|
2760 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
2761 | uint32_t _num_rids /* [in] [range(0,1000)] */,
|
---|
2762 | uint32_t *_rids /* [in] [length_is(num_rids),size_is(1000)] */,
|
---|
2763 | struct lsa_Strings *_names /* [out] [ref] */,
|
---|
2764 | struct samr_Ids *_types /* [out] [ref] */)
|
---|
2765 | {
|
---|
2766 | struct tevent_req *req;
|
---|
2767 | struct rpccli_samr_LookupRids_state *state;
|
---|
2768 | struct tevent_req *subreq;
|
---|
2769 |
|
---|
2770 | req = tevent_req_create(mem_ctx, &state,
|
---|
2771 | struct rpccli_samr_LookupRids_state);
|
---|
2772 | if (req == NULL) {
|
---|
2773 | return NULL;
|
---|
2774 | }
|
---|
2775 | state->out_mem_ctx = NULL;
|
---|
2776 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2777 |
|
---|
2778 | /* In parameters */
|
---|
2779 | state->orig.in.domain_handle = _domain_handle;
|
---|
2780 | state->orig.in.num_rids = _num_rids;
|
---|
2781 | state->orig.in.rids = _rids;
|
---|
2782 |
|
---|
2783 | /* Out parameters */
|
---|
2784 | state->orig.out.names = _names;
|
---|
2785 | state->orig.out.types = _types;
|
---|
2786 |
|
---|
2787 | /* Result */
|
---|
2788 | ZERO_STRUCT(state->orig.out.result);
|
---|
2789 |
|
---|
2790 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2791 | "rpccli_samr_LookupRids_out_memory");
|
---|
2792 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2793 | return tevent_req_post(req, ev);
|
---|
2794 | }
|
---|
2795 |
|
---|
2796 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2797 | state->tmp = state->orig;
|
---|
2798 |
|
---|
2799 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2800 | &ndr_table_samr,
|
---|
2801 | NDR_SAMR_LOOKUPRIDS,
|
---|
2802 | &state->tmp);
|
---|
2803 | if (tevent_req_nomem(subreq, req)) {
|
---|
2804 | return tevent_req_post(req, ev);
|
---|
2805 | }
|
---|
2806 | tevent_req_set_callback(subreq, rpccli_samr_LookupRids_done, req);
|
---|
2807 | return req;
|
---|
2808 | }
|
---|
2809 |
|
---|
2810 | static void rpccli_samr_LookupRids_done(struct tevent_req *subreq)
|
---|
2811 | {
|
---|
2812 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2813 | subreq, struct tevent_req);
|
---|
2814 | struct rpccli_samr_LookupRids_state *state = tevent_req_data(
|
---|
2815 | req, struct rpccli_samr_LookupRids_state);
|
---|
2816 | NTSTATUS status;
|
---|
2817 | TALLOC_CTX *mem_ctx;
|
---|
2818 |
|
---|
2819 | if (state->out_mem_ctx) {
|
---|
2820 | mem_ctx = state->out_mem_ctx;
|
---|
2821 | } else {
|
---|
2822 | mem_ctx = state;
|
---|
2823 | }
|
---|
2824 |
|
---|
2825 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2826 | TALLOC_FREE(subreq);
|
---|
2827 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2828 | tevent_req_nterror(req, status);
|
---|
2829 | return;
|
---|
2830 | }
|
---|
2831 |
|
---|
2832 | /* Copy out parameters */
|
---|
2833 | *state->orig.out.names = *state->tmp.out.names;
|
---|
2834 | *state->orig.out.types = *state->tmp.out.types;
|
---|
2835 |
|
---|
2836 | /* Copy result */
|
---|
2837 | state->orig.out.result = state->tmp.out.result;
|
---|
2838 |
|
---|
2839 | /* Reset temporary structure */
|
---|
2840 | ZERO_STRUCT(state->tmp);
|
---|
2841 |
|
---|
2842 | tevent_req_done(req);
|
---|
2843 | }
|
---|
2844 |
|
---|
2845 | NTSTATUS rpccli_samr_LookupRids_recv(struct tevent_req *req,
|
---|
2846 | TALLOC_CTX *mem_ctx,
|
---|
2847 | NTSTATUS *result)
|
---|
2848 | {
|
---|
2849 | struct rpccli_samr_LookupRids_state *state = tevent_req_data(
|
---|
2850 | req, struct rpccli_samr_LookupRids_state);
|
---|
2851 | NTSTATUS status;
|
---|
2852 |
|
---|
2853 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2854 | tevent_req_received(req);
|
---|
2855 | return status;
|
---|
2856 | }
|
---|
2857 |
|
---|
2858 | /* Steal possbile out parameters to the callers context */
|
---|
2859 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2860 |
|
---|
2861 | /* Return result */
|
---|
2862 | *result = state->orig.out.result;
|
---|
2863 |
|
---|
2864 | tevent_req_received(req);
|
---|
2865 | return NT_STATUS_OK;
|
---|
2866 | }
|
---|
2867 |
|
---|
2868 | NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
|
---|
2869 | TALLOC_CTX *mem_ctx,
|
---|
2870 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
2871 | uint32_t num_rids /* [in] [range(0,1000)] */,
|
---|
2872 | uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */,
|
---|
2873 | struct lsa_Strings *names /* [out] [ref] */,
|
---|
2874 | struct samr_Ids *types /* [out] [ref] */)
|
---|
2875 | {
|
---|
2876 | struct samr_LookupRids r;
|
---|
2877 | NTSTATUS status;
|
---|
2878 |
|
---|
2879 | /* In parameters */
|
---|
2880 | r.in.domain_handle = domain_handle;
|
---|
2881 | r.in.num_rids = num_rids;
|
---|
2882 | r.in.rids = rids;
|
---|
2883 |
|
---|
2884 | status = cli->dispatch(cli,
|
---|
2885 | mem_ctx,
|
---|
2886 | &ndr_table_samr,
|
---|
2887 | NDR_SAMR_LOOKUPRIDS,
|
---|
2888 | &r);
|
---|
2889 |
|
---|
2890 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2891 | return status;
|
---|
2892 | }
|
---|
2893 |
|
---|
2894 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2895 | return status;
|
---|
2896 | }
|
---|
2897 |
|
---|
2898 | /* Return variables */
|
---|
2899 | *names = *r.out.names;
|
---|
2900 | *types = *r.out.types;
|
---|
2901 |
|
---|
2902 | /* Return result */
|
---|
2903 | return r.out.result;
|
---|
2904 | }
|
---|
2905 |
|
---|
2906 | struct rpccli_samr_OpenGroup_state {
|
---|
2907 | struct samr_OpenGroup orig;
|
---|
2908 | struct samr_OpenGroup tmp;
|
---|
2909 | TALLOC_CTX *out_mem_ctx;
|
---|
2910 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2911 | };
|
---|
2912 |
|
---|
2913 | static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq);
|
---|
2914 |
|
---|
2915 | struct tevent_req *rpccli_samr_OpenGroup_send(TALLOC_CTX *mem_ctx,
|
---|
2916 | struct tevent_context *ev,
|
---|
2917 | struct rpc_pipe_client *cli,
|
---|
2918 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
2919 | uint32_t _access_mask /* [in] */,
|
---|
2920 | uint32_t _rid /* [in] */,
|
---|
2921 | struct policy_handle *_group_handle /* [out] [ref] */)
|
---|
2922 | {
|
---|
2923 | struct tevent_req *req;
|
---|
2924 | struct rpccli_samr_OpenGroup_state *state;
|
---|
2925 | struct tevent_req *subreq;
|
---|
2926 |
|
---|
2927 | req = tevent_req_create(mem_ctx, &state,
|
---|
2928 | struct rpccli_samr_OpenGroup_state);
|
---|
2929 | if (req == NULL) {
|
---|
2930 | return NULL;
|
---|
2931 | }
|
---|
2932 | state->out_mem_ctx = NULL;
|
---|
2933 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2934 |
|
---|
2935 | /* In parameters */
|
---|
2936 | state->orig.in.domain_handle = _domain_handle;
|
---|
2937 | state->orig.in.access_mask = _access_mask;
|
---|
2938 | state->orig.in.rid = _rid;
|
---|
2939 |
|
---|
2940 | /* Out parameters */
|
---|
2941 | state->orig.out.group_handle = _group_handle;
|
---|
2942 |
|
---|
2943 | /* Result */
|
---|
2944 | ZERO_STRUCT(state->orig.out.result);
|
---|
2945 |
|
---|
2946 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2947 | "rpccli_samr_OpenGroup_out_memory");
|
---|
2948 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2949 | return tevent_req_post(req, ev);
|
---|
2950 | }
|
---|
2951 |
|
---|
2952 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2953 | state->tmp = state->orig;
|
---|
2954 |
|
---|
2955 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2956 | &ndr_table_samr,
|
---|
2957 | NDR_SAMR_OPENGROUP,
|
---|
2958 | &state->tmp);
|
---|
2959 | if (tevent_req_nomem(subreq, req)) {
|
---|
2960 | return tevent_req_post(req, ev);
|
---|
2961 | }
|
---|
2962 | tevent_req_set_callback(subreq, rpccli_samr_OpenGroup_done, req);
|
---|
2963 | return req;
|
---|
2964 | }
|
---|
2965 |
|
---|
2966 | static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq)
|
---|
2967 | {
|
---|
2968 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2969 | subreq, struct tevent_req);
|
---|
2970 | struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
|
---|
2971 | req, struct rpccli_samr_OpenGroup_state);
|
---|
2972 | NTSTATUS status;
|
---|
2973 | TALLOC_CTX *mem_ctx;
|
---|
2974 |
|
---|
2975 | if (state->out_mem_ctx) {
|
---|
2976 | mem_ctx = state->out_mem_ctx;
|
---|
2977 | } else {
|
---|
2978 | mem_ctx = state;
|
---|
2979 | }
|
---|
2980 |
|
---|
2981 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2982 | TALLOC_FREE(subreq);
|
---|
2983 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2984 | tevent_req_nterror(req, status);
|
---|
2985 | return;
|
---|
2986 | }
|
---|
2987 |
|
---|
2988 | /* Copy out parameters */
|
---|
2989 | *state->orig.out.group_handle = *state->tmp.out.group_handle;
|
---|
2990 |
|
---|
2991 | /* Copy result */
|
---|
2992 | state->orig.out.result = state->tmp.out.result;
|
---|
2993 |
|
---|
2994 | /* Reset temporary structure */
|
---|
2995 | ZERO_STRUCT(state->tmp);
|
---|
2996 |
|
---|
2997 | tevent_req_done(req);
|
---|
2998 | }
|
---|
2999 |
|
---|
3000 | NTSTATUS rpccli_samr_OpenGroup_recv(struct tevent_req *req,
|
---|
3001 | TALLOC_CTX *mem_ctx,
|
---|
3002 | NTSTATUS *result)
|
---|
3003 | {
|
---|
3004 | struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
|
---|
3005 | req, struct rpccli_samr_OpenGroup_state);
|
---|
3006 | NTSTATUS status;
|
---|
3007 |
|
---|
3008 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3009 | tevent_req_received(req);
|
---|
3010 | return status;
|
---|
3011 | }
|
---|
3012 |
|
---|
3013 | /* Steal possbile out parameters to the callers context */
|
---|
3014 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3015 |
|
---|
3016 | /* Return result */
|
---|
3017 | *result = state->orig.out.result;
|
---|
3018 |
|
---|
3019 | tevent_req_received(req);
|
---|
3020 | return NT_STATUS_OK;
|
---|
3021 | }
|
---|
3022 |
|
---|
3023 | NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
|
---|
3024 | TALLOC_CTX *mem_ctx,
|
---|
3025 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
3026 | uint32_t access_mask /* [in] */,
|
---|
3027 | uint32_t rid /* [in] */,
|
---|
3028 | struct policy_handle *group_handle /* [out] [ref] */)
|
---|
3029 | {
|
---|
3030 | struct samr_OpenGroup r;
|
---|
3031 | NTSTATUS status;
|
---|
3032 |
|
---|
3033 | /* In parameters */
|
---|
3034 | r.in.domain_handle = domain_handle;
|
---|
3035 | r.in.access_mask = access_mask;
|
---|
3036 | r.in.rid = rid;
|
---|
3037 |
|
---|
3038 | status = cli->dispatch(cli,
|
---|
3039 | mem_ctx,
|
---|
3040 | &ndr_table_samr,
|
---|
3041 | NDR_SAMR_OPENGROUP,
|
---|
3042 | &r);
|
---|
3043 |
|
---|
3044 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3045 | return status;
|
---|
3046 | }
|
---|
3047 |
|
---|
3048 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3049 | return status;
|
---|
3050 | }
|
---|
3051 |
|
---|
3052 | /* Return variables */
|
---|
3053 | *group_handle = *r.out.group_handle;
|
---|
3054 |
|
---|
3055 | /* Return result */
|
---|
3056 | return r.out.result;
|
---|
3057 | }
|
---|
3058 |
|
---|
3059 | struct rpccli_samr_QueryGroupInfo_state {
|
---|
3060 | struct samr_QueryGroupInfo orig;
|
---|
3061 | struct samr_QueryGroupInfo tmp;
|
---|
3062 | TALLOC_CTX *out_mem_ctx;
|
---|
3063 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3064 | };
|
---|
3065 |
|
---|
3066 | static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq);
|
---|
3067 |
|
---|
3068 | struct tevent_req *rpccli_samr_QueryGroupInfo_send(TALLOC_CTX *mem_ctx,
|
---|
3069 | struct tevent_context *ev,
|
---|
3070 | struct rpc_pipe_client *cli,
|
---|
3071 | struct policy_handle *_group_handle /* [in] [ref] */,
|
---|
3072 | enum samr_GroupInfoEnum _level /* [in] */,
|
---|
3073 | union samr_GroupInfo **_info /* [out] [ref,switch_is(level)] */)
|
---|
3074 | {
|
---|
3075 | struct tevent_req *req;
|
---|
3076 | struct rpccli_samr_QueryGroupInfo_state *state;
|
---|
3077 | struct tevent_req *subreq;
|
---|
3078 |
|
---|
3079 | req = tevent_req_create(mem_ctx, &state,
|
---|
3080 | struct rpccli_samr_QueryGroupInfo_state);
|
---|
3081 | if (req == NULL) {
|
---|
3082 | return NULL;
|
---|
3083 | }
|
---|
3084 | state->out_mem_ctx = NULL;
|
---|
3085 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3086 |
|
---|
3087 | /* In parameters */
|
---|
3088 | state->orig.in.group_handle = _group_handle;
|
---|
3089 | state->orig.in.level = _level;
|
---|
3090 |
|
---|
3091 | /* Out parameters */
|
---|
3092 | state->orig.out.info = _info;
|
---|
3093 |
|
---|
3094 | /* Result */
|
---|
3095 | ZERO_STRUCT(state->orig.out.result);
|
---|
3096 |
|
---|
3097 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
3098 | "rpccli_samr_QueryGroupInfo_out_memory");
|
---|
3099 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
3100 | return tevent_req_post(req, ev);
|
---|
3101 | }
|
---|
3102 |
|
---|
3103 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3104 | state->tmp = state->orig;
|
---|
3105 |
|
---|
3106 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3107 | &ndr_table_samr,
|
---|
3108 | NDR_SAMR_QUERYGROUPINFO,
|
---|
3109 | &state->tmp);
|
---|
3110 | if (tevent_req_nomem(subreq, req)) {
|
---|
3111 | return tevent_req_post(req, ev);
|
---|
3112 | }
|
---|
3113 | tevent_req_set_callback(subreq, rpccli_samr_QueryGroupInfo_done, req);
|
---|
3114 | return req;
|
---|
3115 | }
|
---|
3116 |
|
---|
3117 | static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq)
|
---|
3118 | {
|
---|
3119 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3120 | subreq, struct tevent_req);
|
---|
3121 | struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
|
---|
3122 | req, struct rpccli_samr_QueryGroupInfo_state);
|
---|
3123 | NTSTATUS status;
|
---|
3124 | TALLOC_CTX *mem_ctx;
|
---|
3125 |
|
---|
3126 | if (state->out_mem_ctx) {
|
---|
3127 | mem_ctx = state->out_mem_ctx;
|
---|
3128 | } else {
|
---|
3129 | mem_ctx = state;
|
---|
3130 | }
|
---|
3131 |
|
---|
3132 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3133 | TALLOC_FREE(subreq);
|
---|
3134 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3135 | tevent_req_nterror(req, status);
|
---|
3136 | return;
|
---|
3137 | }
|
---|
3138 |
|
---|
3139 | /* Copy out parameters */
|
---|
3140 | *state->orig.out.info = *state->tmp.out.info;
|
---|
3141 |
|
---|
3142 | /* Copy result */
|
---|
3143 | state->orig.out.result = state->tmp.out.result;
|
---|
3144 |
|
---|
3145 | /* Reset temporary structure */
|
---|
3146 | ZERO_STRUCT(state->tmp);
|
---|
3147 |
|
---|
3148 | tevent_req_done(req);
|
---|
3149 | }
|
---|
3150 |
|
---|
3151 | NTSTATUS rpccli_samr_QueryGroupInfo_recv(struct tevent_req *req,
|
---|
3152 | TALLOC_CTX *mem_ctx,
|
---|
3153 | NTSTATUS *result)
|
---|
3154 | {
|
---|
3155 | struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
|
---|
3156 | req, struct rpccli_samr_QueryGroupInfo_state);
|
---|
3157 | NTSTATUS status;
|
---|
3158 |
|
---|
3159 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3160 | tevent_req_received(req);
|
---|
3161 | return status;
|
---|
3162 | }
|
---|
3163 |
|
---|
3164 | /* Steal possbile out parameters to the callers context */
|
---|
3165 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3166 |
|
---|
3167 | /* Return result */
|
---|
3168 | *result = state->orig.out.result;
|
---|
3169 |
|
---|
3170 | tevent_req_received(req);
|
---|
3171 | return NT_STATUS_OK;
|
---|
3172 | }
|
---|
3173 |
|
---|
3174 | NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli,
|
---|
3175 | TALLOC_CTX *mem_ctx,
|
---|
3176 | struct policy_handle *group_handle /* [in] [ref] */,
|
---|
3177 | enum samr_GroupInfoEnum level /* [in] */,
|
---|
3178 | union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */)
|
---|
3179 | {
|
---|
3180 | struct samr_QueryGroupInfo r;
|
---|
3181 | NTSTATUS status;
|
---|
3182 |
|
---|
3183 | /* In parameters */
|
---|
3184 | r.in.group_handle = group_handle;
|
---|
3185 | r.in.level = level;
|
---|
3186 |
|
---|
3187 | status = cli->dispatch(cli,
|
---|
3188 | mem_ctx,
|
---|
3189 | &ndr_table_samr,
|
---|
3190 | NDR_SAMR_QUERYGROUPINFO,
|
---|
3191 | &r);
|
---|
3192 |
|
---|
3193 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3194 | return status;
|
---|
3195 | }
|
---|
3196 |
|
---|
3197 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3198 | return status;
|
---|
3199 | }
|
---|
3200 |
|
---|
3201 | /* Return variables */
|
---|
3202 | *info = *r.out.info;
|
---|
3203 |
|
---|
3204 | /* Return result */
|
---|
3205 | return r.out.result;
|
---|
3206 | }
|
---|
3207 |
|
---|
3208 | struct rpccli_samr_SetGroupInfo_state {
|
---|
3209 | struct samr_SetGroupInfo orig;
|
---|
3210 | struct samr_SetGroupInfo tmp;
|
---|
3211 | TALLOC_CTX *out_mem_ctx;
|
---|
3212 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3213 | };
|
---|
3214 |
|
---|
3215 | static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq);
|
---|
3216 |
|
---|
3217 | struct tevent_req *rpccli_samr_SetGroupInfo_send(TALLOC_CTX *mem_ctx,
|
---|
3218 | struct tevent_context *ev,
|
---|
3219 | struct rpc_pipe_client *cli,
|
---|
3220 | struct policy_handle *_group_handle /* [in] [ref] */,
|
---|
3221 | enum samr_GroupInfoEnum _level /* [in] */,
|
---|
3222 | union samr_GroupInfo *_info /* [in] [ref,switch_is(level)] */)
|
---|
3223 | {
|
---|
3224 | struct tevent_req *req;
|
---|
3225 | struct rpccli_samr_SetGroupInfo_state *state;
|
---|
3226 | struct tevent_req *subreq;
|
---|
3227 |
|
---|
3228 | req = tevent_req_create(mem_ctx, &state,
|
---|
3229 | struct rpccli_samr_SetGroupInfo_state);
|
---|
3230 | if (req == NULL) {
|
---|
3231 | return NULL;
|
---|
3232 | }
|
---|
3233 | state->out_mem_ctx = NULL;
|
---|
3234 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3235 |
|
---|
3236 | /* In parameters */
|
---|
3237 | state->orig.in.group_handle = _group_handle;
|
---|
3238 | state->orig.in.level = _level;
|
---|
3239 | state->orig.in.info = _info;
|
---|
3240 |
|
---|
3241 | /* Out parameters */
|
---|
3242 |
|
---|
3243 | /* Result */
|
---|
3244 | ZERO_STRUCT(state->orig.out.result);
|
---|
3245 |
|
---|
3246 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3247 | state->tmp = state->orig;
|
---|
3248 |
|
---|
3249 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3250 | &ndr_table_samr,
|
---|
3251 | NDR_SAMR_SETGROUPINFO,
|
---|
3252 | &state->tmp);
|
---|
3253 | if (tevent_req_nomem(subreq, req)) {
|
---|
3254 | return tevent_req_post(req, ev);
|
---|
3255 | }
|
---|
3256 | tevent_req_set_callback(subreq, rpccli_samr_SetGroupInfo_done, req);
|
---|
3257 | return req;
|
---|
3258 | }
|
---|
3259 |
|
---|
3260 | static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq)
|
---|
3261 | {
|
---|
3262 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3263 | subreq, struct tevent_req);
|
---|
3264 | struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
|
---|
3265 | req, struct rpccli_samr_SetGroupInfo_state);
|
---|
3266 | NTSTATUS status;
|
---|
3267 | TALLOC_CTX *mem_ctx;
|
---|
3268 |
|
---|
3269 | if (state->out_mem_ctx) {
|
---|
3270 | mem_ctx = state->out_mem_ctx;
|
---|
3271 | } else {
|
---|
3272 | mem_ctx = state;
|
---|
3273 | }
|
---|
3274 |
|
---|
3275 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3276 | TALLOC_FREE(subreq);
|
---|
3277 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3278 | tevent_req_nterror(req, status);
|
---|
3279 | return;
|
---|
3280 | }
|
---|
3281 |
|
---|
3282 | /* Copy out parameters */
|
---|
3283 |
|
---|
3284 | /* Copy result */
|
---|
3285 | state->orig.out.result = state->tmp.out.result;
|
---|
3286 |
|
---|
3287 | /* Reset temporary structure */
|
---|
3288 | ZERO_STRUCT(state->tmp);
|
---|
3289 |
|
---|
3290 | tevent_req_done(req);
|
---|
3291 | }
|
---|
3292 |
|
---|
3293 | NTSTATUS rpccli_samr_SetGroupInfo_recv(struct tevent_req *req,
|
---|
3294 | TALLOC_CTX *mem_ctx,
|
---|
3295 | NTSTATUS *result)
|
---|
3296 | {
|
---|
3297 | struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
|
---|
3298 | req, struct rpccli_samr_SetGroupInfo_state);
|
---|
3299 | NTSTATUS status;
|
---|
3300 |
|
---|
3301 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3302 | tevent_req_received(req);
|
---|
3303 | return status;
|
---|
3304 | }
|
---|
3305 |
|
---|
3306 | /* Steal possbile out parameters to the callers context */
|
---|
3307 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3308 |
|
---|
3309 | /* Return result */
|
---|
3310 | *result = state->orig.out.result;
|
---|
3311 |
|
---|
3312 | tevent_req_received(req);
|
---|
3313 | return NT_STATUS_OK;
|
---|
3314 | }
|
---|
3315 |
|
---|
3316 | NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli,
|
---|
3317 | TALLOC_CTX *mem_ctx,
|
---|
3318 | struct policy_handle *group_handle /* [in] [ref] */,
|
---|
3319 | enum samr_GroupInfoEnum level /* [in] */,
|
---|
3320 | union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */)
|
---|
3321 | {
|
---|
3322 | struct samr_SetGroupInfo r;
|
---|
3323 | NTSTATUS status;
|
---|
3324 |
|
---|
3325 | /* In parameters */
|
---|
3326 | r.in.group_handle = group_handle;
|
---|
3327 | r.in.level = level;
|
---|
3328 | r.in.info = info;
|
---|
3329 |
|
---|
3330 | status = cli->dispatch(cli,
|
---|
3331 | mem_ctx,
|
---|
3332 | &ndr_table_samr,
|
---|
3333 | NDR_SAMR_SETGROUPINFO,
|
---|
3334 | &r);
|
---|
3335 |
|
---|
3336 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3337 | return status;
|
---|
3338 | }
|
---|
3339 |
|
---|
3340 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3341 | return status;
|
---|
3342 | }
|
---|
3343 |
|
---|
3344 | /* Return variables */
|
---|
3345 |
|
---|
3346 | /* Return result */
|
---|
3347 | return r.out.result;
|
---|
3348 | }
|
---|
3349 |
|
---|
3350 | struct rpccli_samr_AddGroupMember_state {
|
---|
3351 | struct samr_AddGroupMember orig;
|
---|
3352 | struct samr_AddGroupMember tmp;
|
---|
3353 | TALLOC_CTX *out_mem_ctx;
|
---|
3354 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3355 | };
|
---|
3356 |
|
---|
3357 | static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq);
|
---|
3358 |
|
---|
3359 | struct tevent_req *rpccli_samr_AddGroupMember_send(TALLOC_CTX *mem_ctx,
|
---|
3360 | struct tevent_context *ev,
|
---|
3361 | struct rpc_pipe_client *cli,
|
---|
3362 | struct policy_handle *_group_handle /* [in] [ref] */,
|
---|
3363 | uint32_t _rid /* [in] */,
|
---|
3364 | uint32_t _flags /* [in] */)
|
---|
3365 | {
|
---|
3366 | struct tevent_req *req;
|
---|
3367 | struct rpccli_samr_AddGroupMember_state *state;
|
---|
3368 | struct tevent_req *subreq;
|
---|
3369 |
|
---|
3370 | req = tevent_req_create(mem_ctx, &state,
|
---|
3371 | struct rpccli_samr_AddGroupMember_state);
|
---|
3372 | if (req == NULL) {
|
---|
3373 | return NULL;
|
---|
3374 | }
|
---|
3375 | state->out_mem_ctx = NULL;
|
---|
3376 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3377 |
|
---|
3378 | /* In parameters */
|
---|
3379 | state->orig.in.group_handle = _group_handle;
|
---|
3380 | state->orig.in.rid = _rid;
|
---|
3381 | state->orig.in.flags = _flags;
|
---|
3382 |
|
---|
3383 | /* Out parameters */
|
---|
3384 |
|
---|
3385 | /* Result */
|
---|
3386 | ZERO_STRUCT(state->orig.out.result);
|
---|
3387 |
|
---|
3388 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3389 | state->tmp = state->orig;
|
---|
3390 |
|
---|
3391 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3392 | &ndr_table_samr,
|
---|
3393 | NDR_SAMR_ADDGROUPMEMBER,
|
---|
3394 | &state->tmp);
|
---|
3395 | if (tevent_req_nomem(subreq, req)) {
|
---|
3396 | return tevent_req_post(req, ev);
|
---|
3397 | }
|
---|
3398 | tevent_req_set_callback(subreq, rpccli_samr_AddGroupMember_done, req);
|
---|
3399 | return req;
|
---|
3400 | }
|
---|
3401 |
|
---|
3402 | static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq)
|
---|
3403 | {
|
---|
3404 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3405 | subreq, struct tevent_req);
|
---|
3406 | struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
|
---|
3407 | req, struct rpccli_samr_AddGroupMember_state);
|
---|
3408 | NTSTATUS status;
|
---|
3409 | TALLOC_CTX *mem_ctx;
|
---|
3410 |
|
---|
3411 | if (state->out_mem_ctx) {
|
---|
3412 | mem_ctx = state->out_mem_ctx;
|
---|
3413 | } else {
|
---|
3414 | mem_ctx = state;
|
---|
3415 | }
|
---|
3416 |
|
---|
3417 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3418 | TALLOC_FREE(subreq);
|
---|
3419 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3420 | tevent_req_nterror(req, status);
|
---|
3421 | return;
|
---|
3422 | }
|
---|
3423 |
|
---|
3424 | /* Copy out parameters */
|
---|
3425 |
|
---|
3426 | /* Copy result */
|
---|
3427 | state->orig.out.result = state->tmp.out.result;
|
---|
3428 |
|
---|
3429 | /* Reset temporary structure */
|
---|
3430 | ZERO_STRUCT(state->tmp);
|
---|
3431 |
|
---|
3432 | tevent_req_done(req);
|
---|
3433 | }
|
---|
3434 |
|
---|
3435 | NTSTATUS rpccli_samr_AddGroupMember_recv(struct tevent_req *req,
|
---|
3436 | TALLOC_CTX *mem_ctx,
|
---|
3437 | NTSTATUS *result)
|
---|
3438 | {
|
---|
3439 | struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
|
---|
3440 | req, struct rpccli_samr_AddGroupMember_state);
|
---|
3441 | NTSTATUS status;
|
---|
3442 |
|
---|
3443 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3444 | tevent_req_received(req);
|
---|
3445 | return status;
|
---|
3446 | }
|
---|
3447 |
|
---|
3448 | /* Steal possbile out parameters to the callers context */
|
---|
3449 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3450 |
|
---|
3451 | /* Return result */
|
---|
3452 | *result = state->orig.out.result;
|
---|
3453 |
|
---|
3454 | tevent_req_received(req);
|
---|
3455 | return NT_STATUS_OK;
|
---|
3456 | }
|
---|
3457 |
|
---|
3458 | NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
|
---|
3459 | TALLOC_CTX *mem_ctx,
|
---|
3460 | struct policy_handle *group_handle /* [in] [ref] */,
|
---|
3461 | uint32_t rid /* [in] */,
|
---|
3462 | uint32_t flags /* [in] */)
|
---|
3463 | {
|
---|
3464 | struct samr_AddGroupMember r;
|
---|
3465 | NTSTATUS status;
|
---|
3466 |
|
---|
3467 | /* In parameters */
|
---|
3468 | r.in.group_handle = group_handle;
|
---|
3469 | r.in.rid = rid;
|
---|
3470 | r.in.flags = flags;
|
---|
3471 |
|
---|
3472 | status = cli->dispatch(cli,
|
---|
3473 | mem_ctx,
|
---|
3474 | &ndr_table_samr,
|
---|
3475 | NDR_SAMR_ADDGROUPMEMBER,
|
---|
3476 | &r);
|
---|
3477 |
|
---|
3478 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3479 | return status;
|
---|
3480 | }
|
---|
3481 |
|
---|
3482 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3483 | return status;
|
---|
3484 | }
|
---|
3485 |
|
---|
3486 | /* Return variables */
|
---|
3487 |
|
---|
3488 | /* Return result */
|
---|
3489 | return r.out.result;
|
---|
3490 | }
|
---|
3491 |
|
---|
3492 | struct rpccli_samr_DeleteDomainGroup_state {
|
---|
3493 | struct samr_DeleteDomainGroup orig;
|
---|
3494 | struct samr_DeleteDomainGroup tmp;
|
---|
3495 | TALLOC_CTX *out_mem_ctx;
|
---|
3496 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3497 | };
|
---|
3498 |
|
---|
3499 | static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq);
|
---|
3500 |
|
---|
3501 | struct tevent_req *rpccli_samr_DeleteDomainGroup_send(TALLOC_CTX *mem_ctx,
|
---|
3502 | struct tevent_context *ev,
|
---|
3503 | struct rpc_pipe_client *cli,
|
---|
3504 | struct policy_handle *_group_handle /* [in,out] [ref] */)
|
---|
3505 | {
|
---|
3506 | struct tevent_req *req;
|
---|
3507 | struct rpccli_samr_DeleteDomainGroup_state *state;
|
---|
3508 | struct tevent_req *subreq;
|
---|
3509 |
|
---|
3510 | req = tevent_req_create(mem_ctx, &state,
|
---|
3511 | struct rpccli_samr_DeleteDomainGroup_state);
|
---|
3512 | if (req == NULL) {
|
---|
3513 | return NULL;
|
---|
3514 | }
|
---|
3515 | state->out_mem_ctx = NULL;
|
---|
3516 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3517 |
|
---|
3518 | /* In parameters */
|
---|
3519 | state->orig.in.group_handle = _group_handle;
|
---|
3520 |
|
---|
3521 | /* Out parameters */
|
---|
3522 | state->orig.out.group_handle = _group_handle;
|
---|
3523 |
|
---|
3524 | /* Result */
|
---|
3525 | ZERO_STRUCT(state->orig.out.result);
|
---|
3526 |
|
---|
3527 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
3528 | "rpccli_samr_DeleteDomainGroup_out_memory");
|
---|
3529 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
3530 | return tevent_req_post(req, ev);
|
---|
3531 | }
|
---|
3532 |
|
---|
3533 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3534 | state->tmp = state->orig;
|
---|
3535 |
|
---|
3536 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3537 | &ndr_table_samr,
|
---|
3538 | NDR_SAMR_DELETEDOMAINGROUP,
|
---|
3539 | &state->tmp);
|
---|
3540 | if (tevent_req_nomem(subreq, req)) {
|
---|
3541 | return tevent_req_post(req, ev);
|
---|
3542 | }
|
---|
3543 | tevent_req_set_callback(subreq, rpccli_samr_DeleteDomainGroup_done, req);
|
---|
3544 | return req;
|
---|
3545 | }
|
---|
3546 |
|
---|
3547 | static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq)
|
---|
3548 | {
|
---|
3549 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3550 | subreq, struct tevent_req);
|
---|
3551 | struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
|
---|
3552 | req, struct rpccli_samr_DeleteDomainGroup_state);
|
---|
3553 | NTSTATUS status;
|
---|
3554 | TALLOC_CTX *mem_ctx;
|
---|
3555 |
|
---|
3556 | if (state->out_mem_ctx) {
|
---|
3557 | mem_ctx = state->out_mem_ctx;
|
---|
3558 | } else {
|
---|
3559 | mem_ctx = state;
|
---|
3560 | }
|
---|
3561 |
|
---|
3562 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3563 | TALLOC_FREE(subreq);
|
---|
3564 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3565 | tevent_req_nterror(req, status);
|
---|
3566 | return;
|
---|
3567 | }
|
---|
3568 |
|
---|
3569 | /* Copy out parameters */
|
---|
3570 | *state->orig.out.group_handle = *state->tmp.out.group_handle;
|
---|
3571 |
|
---|
3572 | /* Copy result */
|
---|
3573 | state->orig.out.result = state->tmp.out.result;
|
---|
3574 |
|
---|
3575 | /* Reset temporary structure */
|
---|
3576 | ZERO_STRUCT(state->tmp);
|
---|
3577 |
|
---|
3578 | tevent_req_done(req);
|
---|
3579 | }
|
---|
3580 |
|
---|
3581 | NTSTATUS rpccli_samr_DeleteDomainGroup_recv(struct tevent_req *req,
|
---|
3582 | TALLOC_CTX *mem_ctx,
|
---|
3583 | NTSTATUS *result)
|
---|
3584 | {
|
---|
3585 | struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
|
---|
3586 | req, struct rpccli_samr_DeleteDomainGroup_state);
|
---|
3587 | NTSTATUS status;
|
---|
3588 |
|
---|
3589 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3590 | tevent_req_received(req);
|
---|
3591 | return status;
|
---|
3592 | }
|
---|
3593 |
|
---|
3594 | /* Steal possbile out parameters to the callers context */
|
---|
3595 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3596 |
|
---|
3597 | /* Return result */
|
---|
3598 | *result = state->orig.out.result;
|
---|
3599 |
|
---|
3600 | tevent_req_received(req);
|
---|
3601 | return NT_STATUS_OK;
|
---|
3602 | }
|
---|
3603 |
|
---|
3604 | NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli,
|
---|
3605 | TALLOC_CTX *mem_ctx,
|
---|
3606 | struct policy_handle *group_handle /* [in,out] [ref] */)
|
---|
3607 | {
|
---|
3608 | struct samr_DeleteDomainGroup r;
|
---|
3609 | NTSTATUS status;
|
---|
3610 |
|
---|
3611 | /* In parameters */
|
---|
3612 | r.in.group_handle = group_handle;
|
---|
3613 |
|
---|
3614 | status = cli->dispatch(cli,
|
---|
3615 | mem_ctx,
|
---|
3616 | &ndr_table_samr,
|
---|
3617 | NDR_SAMR_DELETEDOMAINGROUP,
|
---|
3618 | &r);
|
---|
3619 |
|
---|
3620 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3621 | return status;
|
---|
3622 | }
|
---|
3623 |
|
---|
3624 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3625 | return status;
|
---|
3626 | }
|
---|
3627 |
|
---|
3628 | /* Return variables */
|
---|
3629 | *group_handle = *r.out.group_handle;
|
---|
3630 |
|
---|
3631 | /* Return result */
|
---|
3632 | return r.out.result;
|
---|
3633 | }
|
---|
3634 |
|
---|
3635 | struct rpccli_samr_DeleteGroupMember_state {
|
---|
3636 | struct samr_DeleteGroupMember orig;
|
---|
3637 | struct samr_DeleteGroupMember tmp;
|
---|
3638 | TALLOC_CTX *out_mem_ctx;
|
---|
3639 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3640 | };
|
---|
3641 |
|
---|
3642 | static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq);
|
---|
3643 |
|
---|
3644 | struct tevent_req *rpccli_samr_DeleteGroupMember_send(TALLOC_CTX *mem_ctx,
|
---|
3645 | struct tevent_context *ev,
|
---|
3646 | struct rpc_pipe_client *cli,
|
---|
3647 | struct policy_handle *_group_handle /* [in] [ref] */,
|
---|
3648 | uint32_t _rid /* [in] */)
|
---|
3649 | {
|
---|
3650 | struct tevent_req *req;
|
---|
3651 | struct rpccli_samr_DeleteGroupMember_state *state;
|
---|
3652 | struct tevent_req *subreq;
|
---|
3653 |
|
---|
3654 | req = tevent_req_create(mem_ctx, &state,
|
---|
3655 | struct rpccli_samr_DeleteGroupMember_state);
|
---|
3656 | if (req == NULL) {
|
---|
3657 | return NULL;
|
---|
3658 | }
|
---|
3659 | state->out_mem_ctx = NULL;
|
---|
3660 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3661 |
|
---|
3662 | /* In parameters */
|
---|
3663 | state->orig.in.group_handle = _group_handle;
|
---|
3664 | state->orig.in.rid = _rid;
|
---|
3665 |
|
---|
3666 | /* Out parameters */
|
---|
3667 |
|
---|
3668 | /* Result */
|
---|
3669 | ZERO_STRUCT(state->orig.out.result);
|
---|
3670 |
|
---|
3671 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3672 | state->tmp = state->orig;
|
---|
3673 |
|
---|
3674 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3675 | &ndr_table_samr,
|
---|
3676 | NDR_SAMR_DELETEGROUPMEMBER,
|
---|
3677 | &state->tmp);
|
---|
3678 | if (tevent_req_nomem(subreq, req)) {
|
---|
3679 | return tevent_req_post(req, ev);
|
---|
3680 | }
|
---|
3681 | tevent_req_set_callback(subreq, rpccli_samr_DeleteGroupMember_done, req);
|
---|
3682 | return req;
|
---|
3683 | }
|
---|
3684 |
|
---|
3685 | static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq)
|
---|
3686 | {
|
---|
3687 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3688 | subreq, struct tevent_req);
|
---|
3689 | struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
|
---|
3690 | req, struct rpccli_samr_DeleteGroupMember_state);
|
---|
3691 | NTSTATUS status;
|
---|
3692 | TALLOC_CTX *mem_ctx;
|
---|
3693 |
|
---|
3694 | if (state->out_mem_ctx) {
|
---|
3695 | mem_ctx = state->out_mem_ctx;
|
---|
3696 | } else {
|
---|
3697 | mem_ctx = state;
|
---|
3698 | }
|
---|
3699 |
|
---|
3700 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3701 | TALLOC_FREE(subreq);
|
---|
3702 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3703 | tevent_req_nterror(req, status);
|
---|
3704 | return;
|
---|
3705 | }
|
---|
3706 |
|
---|
3707 | /* Copy out parameters */
|
---|
3708 |
|
---|
3709 | /* Copy result */
|
---|
3710 | state->orig.out.result = state->tmp.out.result;
|
---|
3711 |
|
---|
3712 | /* Reset temporary structure */
|
---|
3713 | ZERO_STRUCT(state->tmp);
|
---|
3714 |
|
---|
3715 | tevent_req_done(req);
|
---|
3716 | }
|
---|
3717 |
|
---|
3718 | NTSTATUS rpccli_samr_DeleteGroupMember_recv(struct tevent_req *req,
|
---|
3719 | TALLOC_CTX *mem_ctx,
|
---|
3720 | NTSTATUS *result)
|
---|
3721 | {
|
---|
3722 | struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
|
---|
3723 | req, struct rpccli_samr_DeleteGroupMember_state);
|
---|
3724 | NTSTATUS status;
|
---|
3725 |
|
---|
3726 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3727 | tevent_req_received(req);
|
---|
3728 | return status;
|
---|
3729 | }
|
---|
3730 |
|
---|
3731 | /* Steal possbile out parameters to the callers context */
|
---|
3732 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3733 |
|
---|
3734 | /* Return result */
|
---|
3735 | *result = state->orig.out.result;
|
---|
3736 |
|
---|
3737 | tevent_req_received(req);
|
---|
3738 | return NT_STATUS_OK;
|
---|
3739 | }
|
---|
3740 |
|
---|
3741 | NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli,
|
---|
3742 | TALLOC_CTX *mem_ctx,
|
---|
3743 | struct policy_handle *group_handle /* [in] [ref] */,
|
---|
3744 | uint32_t rid /* [in] */)
|
---|
3745 | {
|
---|
3746 | struct samr_DeleteGroupMember r;
|
---|
3747 | NTSTATUS status;
|
---|
3748 |
|
---|
3749 | /* In parameters */
|
---|
3750 | r.in.group_handle = group_handle;
|
---|
3751 | r.in.rid = rid;
|
---|
3752 |
|
---|
3753 | status = cli->dispatch(cli,
|
---|
3754 | mem_ctx,
|
---|
3755 | &ndr_table_samr,
|
---|
3756 | NDR_SAMR_DELETEGROUPMEMBER,
|
---|
3757 | &r);
|
---|
3758 |
|
---|
3759 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3760 | return status;
|
---|
3761 | }
|
---|
3762 |
|
---|
3763 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3764 | return status;
|
---|
3765 | }
|
---|
3766 |
|
---|
3767 | /* Return variables */
|
---|
3768 |
|
---|
3769 | /* Return result */
|
---|
3770 | return r.out.result;
|
---|
3771 | }
|
---|
3772 |
|
---|
3773 | struct rpccli_samr_QueryGroupMember_state {
|
---|
3774 | struct samr_QueryGroupMember orig;
|
---|
3775 | struct samr_QueryGroupMember tmp;
|
---|
3776 | TALLOC_CTX *out_mem_ctx;
|
---|
3777 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3778 | };
|
---|
3779 |
|
---|
3780 | static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq);
|
---|
3781 |
|
---|
3782 | struct tevent_req *rpccli_samr_QueryGroupMember_send(TALLOC_CTX *mem_ctx,
|
---|
3783 | struct tevent_context *ev,
|
---|
3784 | struct rpc_pipe_client *cli,
|
---|
3785 | struct policy_handle *_group_handle /* [in] [ref] */,
|
---|
3786 | struct samr_RidTypeArray **_rids /* [out] [ref] */)
|
---|
3787 | {
|
---|
3788 | struct tevent_req *req;
|
---|
3789 | struct rpccli_samr_QueryGroupMember_state *state;
|
---|
3790 | struct tevent_req *subreq;
|
---|
3791 |
|
---|
3792 | req = tevent_req_create(mem_ctx, &state,
|
---|
3793 | struct rpccli_samr_QueryGroupMember_state);
|
---|
3794 | if (req == NULL) {
|
---|
3795 | return NULL;
|
---|
3796 | }
|
---|
3797 | state->out_mem_ctx = NULL;
|
---|
3798 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3799 |
|
---|
3800 | /* In parameters */
|
---|
3801 | state->orig.in.group_handle = _group_handle;
|
---|
3802 |
|
---|
3803 | /* Out parameters */
|
---|
3804 | state->orig.out.rids = _rids;
|
---|
3805 |
|
---|
3806 | /* Result */
|
---|
3807 | ZERO_STRUCT(state->orig.out.result);
|
---|
3808 |
|
---|
3809 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
3810 | "rpccli_samr_QueryGroupMember_out_memory");
|
---|
3811 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
3812 | return tevent_req_post(req, ev);
|
---|
3813 | }
|
---|
3814 |
|
---|
3815 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3816 | state->tmp = state->orig;
|
---|
3817 |
|
---|
3818 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3819 | &ndr_table_samr,
|
---|
3820 | NDR_SAMR_QUERYGROUPMEMBER,
|
---|
3821 | &state->tmp);
|
---|
3822 | if (tevent_req_nomem(subreq, req)) {
|
---|
3823 | return tevent_req_post(req, ev);
|
---|
3824 | }
|
---|
3825 | tevent_req_set_callback(subreq, rpccli_samr_QueryGroupMember_done, req);
|
---|
3826 | return req;
|
---|
3827 | }
|
---|
3828 |
|
---|
3829 | static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq)
|
---|
3830 | {
|
---|
3831 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3832 | subreq, struct tevent_req);
|
---|
3833 | struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
|
---|
3834 | req, struct rpccli_samr_QueryGroupMember_state);
|
---|
3835 | NTSTATUS status;
|
---|
3836 | TALLOC_CTX *mem_ctx;
|
---|
3837 |
|
---|
3838 | if (state->out_mem_ctx) {
|
---|
3839 | mem_ctx = state->out_mem_ctx;
|
---|
3840 | } else {
|
---|
3841 | mem_ctx = state;
|
---|
3842 | }
|
---|
3843 |
|
---|
3844 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3845 | TALLOC_FREE(subreq);
|
---|
3846 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3847 | tevent_req_nterror(req, status);
|
---|
3848 | return;
|
---|
3849 | }
|
---|
3850 |
|
---|
3851 | /* Copy out parameters */
|
---|
3852 | *state->orig.out.rids = *state->tmp.out.rids;
|
---|
3853 |
|
---|
3854 | /* Copy result */
|
---|
3855 | state->orig.out.result = state->tmp.out.result;
|
---|
3856 |
|
---|
3857 | /* Reset temporary structure */
|
---|
3858 | ZERO_STRUCT(state->tmp);
|
---|
3859 |
|
---|
3860 | tevent_req_done(req);
|
---|
3861 | }
|
---|
3862 |
|
---|
3863 | NTSTATUS rpccli_samr_QueryGroupMember_recv(struct tevent_req *req,
|
---|
3864 | TALLOC_CTX *mem_ctx,
|
---|
3865 | NTSTATUS *result)
|
---|
3866 | {
|
---|
3867 | struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
|
---|
3868 | req, struct rpccli_samr_QueryGroupMember_state);
|
---|
3869 | NTSTATUS status;
|
---|
3870 |
|
---|
3871 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3872 | tevent_req_received(req);
|
---|
3873 | return status;
|
---|
3874 | }
|
---|
3875 |
|
---|
3876 | /* Steal possbile out parameters to the callers context */
|
---|
3877 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3878 |
|
---|
3879 | /* Return result */
|
---|
3880 | *result = state->orig.out.result;
|
---|
3881 |
|
---|
3882 | tevent_req_received(req);
|
---|
3883 | return NT_STATUS_OK;
|
---|
3884 | }
|
---|
3885 |
|
---|
3886 | NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
|
---|
3887 | TALLOC_CTX *mem_ctx,
|
---|
3888 | struct policy_handle *group_handle /* [in] [ref] */,
|
---|
3889 | struct samr_RidTypeArray **rids /* [out] [ref] */)
|
---|
3890 | {
|
---|
3891 | struct samr_QueryGroupMember r;
|
---|
3892 | NTSTATUS status;
|
---|
3893 |
|
---|
3894 | /* In parameters */
|
---|
3895 | r.in.group_handle = group_handle;
|
---|
3896 |
|
---|
3897 | status = cli->dispatch(cli,
|
---|
3898 | mem_ctx,
|
---|
3899 | &ndr_table_samr,
|
---|
3900 | NDR_SAMR_QUERYGROUPMEMBER,
|
---|
3901 | &r);
|
---|
3902 |
|
---|
3903 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3904 | return status;
|
---|
3905 | }
|
---|
3906 |
|
---|
3907 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3908 | return status;
|
---|
3909 | }
|
---|
3910 |
|
---|
3911 | /* Return variables */
|
---|
3912 | *rids = *r.out.rids;
|
---|
3913 |
|
---|
3914 | /* Return result */
|
---|
3915 | return r.out.result;
|
---|
3916 | }
|
---|
3917 |
|
---|
3918 | struct rpccli_samr_SetMemberAttributesOfGroup_state {
|
---|
3919 | struct samr_SetMemberAttributesOfGroup orig;
|
---|
3920 | struct samr_SetMemberAttributesOfGroup tmp;
|
---|
3921 | TALLOC_CTX *out_mem_ctx;
|
---|
3922 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3923 | };
|
---|
3924 |
|
---|
3925 | static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq);
|
---|
3926 |
|
---|
3927 | struct tevent_req *rpccli_samr_SetMemberAttributesOfGroup_send(TALLOC_CTX *mem_ctx,
|
---|
3928 | struct tevent_context *ev,
|
---|
3929 | struct rpc_pipe_client *cli,
|
---|
3930 | struct policy_handle *_group_handle /* [in] [ref] */,
|
---|
3931 | uint32_t _unknown1 /* [in] */,
|
---|
3932 | uint32_t _unknown2 /* [in] */)
|
---|
3933 | {
|
---|
3934 | struct tevent_req *req;
|
---|
3935 | struct rpccli_samr_SetMemberAttributesOfGroup_state *state;
|
---|
3936 | struct tevent_req *subreq;
|
---|
3937 |
|
---|
3938 | req = tevent_req_create(mem_ctx, &state,
|
---|
3939 | struct rpccli_samr_SetMemberAttributesOfGroup_state);
|
---|
3940 | if (req == NULL) {
|
---|
3941 | return NULL;
|
---|
3942 | }
|
---|
3943 | state->out_mem_ctx = NULL;
|
---|
3944 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3945 |
|
---|
3946 | /* In parameters */
|
---|
3947 | state->orig.in.group_handle = _group_handle;
|
---|
3948 | state->orig.in.unknown1 = _unknown1;
|
---|
3949 | state->orig.in.unknown2 = _unknown2;
|
---|
3950 |
|
---|
3951 | /* Out parameters */
|
---|
3952 |
|
---|
3953 | /* Result */
|
---|
3954 | ZERO_STRUCT(state->orig.out.result);
|
---|
3955 |
|
---|
3956 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3957 | state->tmp = state->orig;
|
---|
3958 |
|
---|
3959 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3960 | &ndr_table_samr,
|
---|
3961 | NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
|
---|
3962 | &state->tmp);
|
---|
3963 | if (tevent_req_nomem(subreq, req)) {
|
---|
3964 | return tevent_req_post(req, ev);
|
---|
3965 | }
|
---|
3966 | tevent_req_set_callback(subreq, rpccli_samr_SetMemberAttributesOfGroup_done, req);
|
---|
3967 | return req;
|
---|
3968 | }
|
---|
3969 |
|
---|
3970 | static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq)
|
---|
3971 | {
|
---|
3972 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3973 | subreq, struct tevent_req);
|
---|
3974 | struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
|
---|
3975 | req, struct rpccli_samr_SetMemberAttributesOfGroup_state);
|
---|
3976 | NTSTATUS status;
|
---|
3977 | TALLOC_CTX *mem_ctx;
|
---|
3978 |
|
---|
3979 | if (state->out_mem_ctx) {
|
---|
3980 | mem_ctx = state->out_mem_ctx;
|
---|
3981 | } else {
|
---|
3982 | mem_ctx = state;
|
---|
3983 | }
|
---|
3984 |
|
---|
3985 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3986 | TALLOC_FREE(subreq);
|
---|
3987 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3988 | tevent_req_nterror(req, status);
|
---|
3989 | return;
|
---|
3990 | }
|
---|
3991 |
|
---|
3992 | /* Copy out parameters */
|
---|
3993 |
|
---|
3994 | /* Copy result */
|
---|
3995 | state->orig.out.result = state->tmp.out.result;
|
---|
3996 |
|
---|
3997 | /* Reset temporary structure */
|
---|
3998 | ZERO_STRUCT(state->tmp);
|
---|
3999 |
|
---|
4000 | tevent_req_done(req);
|
---|
4001 | }
|
---|
4002 |
|
---|
4003 | NTSTATUS rpccli_samr_SetMemberAttributesOfGroup_recv(struct tevent_req *req,
|
---|
4004 | TALLOC_CTX *mem_ctx,
|
---|
4005 | NTSTATUS *result)
|
---|
4006 | {
|
---|
4007 | struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
|
---|
4008 | req, struct rpccli_samr_SetMemberAttributesOfGroup_state);
|
---|
4009 | NTSTATUS status;
|
---|
4010 |
|
---|
4011 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4012 | tevent_req_received(req);
|
---|
4013 | return status;
|
---|
4014 | }
|
---|
4015 |
|
---|
4016 | /* Steal possbile out parameters to the callers context */
|
---|
4017 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4018 |
|
---|
4019 | /* Return result */
|
---|
4020 | *result = state->orig.out.result;
|
---|
4021 |
|
---|
4022 | tevent_req_received(req);
|
---|
4023 | return NT_STATUS_OK;
|
---|
4024 | }
|
---|
4025 |
|
---|
4026 | NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli,
|
---|
4027 | TALLOC_CTX *mem_ctx,
|
---|
4028 | struct policy_handle *group_handle /* [in] [ref] */,
|
---|
4029 | uint32_t unknown1 /* [in] */,
|
---|
4030 | uint32_t unknown2 /* [in] */)
|
---|
4031 | {
|
---|
4032 | struct samr_SetMemberAttributesOfGroup r;
|
---|
4033 | NTSTATUS status;
|
---|
4034 |
|
---|
4035 | /* In parameters */
|
---|
4036 | r.in.group_handle = group_handle;
|
---|
4037 | r.in.unknown1 = unknown1;
|
---|
4038 | r.in.unknown2 = unknown2;
|
---|
4039 |
|
---|
4040 | status = cli->dispatch(cli,
|
---|
4041 | mem_ctx,
|
---|
4042 | &ndr_table_samr,
|
---|
4043 | NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
|
---|
4044 | &r);
|
---|
4045 |
|
---|
4046 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4047 | return status;
|
---|
4048 | }
|
---|
4049 |
|
---|
4050 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4051 | return status;
|
---|
4052 | }
|
---|
4053 |
|
---|
4054 | /* Return variables */
|
---|
4055 |
|
---|
4056 | /* Return result */
|
---|
4057 | return r.out.result;
|
---|
4058 | }
|
---|
4059 |
|
---|
4060 | struct rpccli_samr_OpenAlias_state {
|
---|
4061 | struct samr_OpenAlias orig;
|
---|
4062 | struct samr_OpenAlias tmp;
|
---|
4063 | TALLOC_CTX *out_mem_ctx;
|
---|
4064 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4065 | };
|
---|
4066 |
|
---|
4067 | static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq);
|
---|
4068 |
|
---|
4069 | struct tevent_req *rpccli_samr_OpenAlias_send(TALLOC_CTX *mem_ctx,
|
---|
4070 | struct tevent_context *ev,
|
---|
4071 | struct rpc_pipe_client *cli,
|
---|
4072 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
4073 | uint32_t _access_mask /* [in] */,
|
---|
4074 | uint32_t _rid /* [in] */,
|
---|
4075 | struct policy_handle *_alias_handle /* [out] [ref] */)
|
---|
4076 | {
|
---|
4077 | struct tevent_req *req;
|
---|
4078 | struct rpccli_samr_OpenAlias_state *state;
|
---|
4079 | struct tevent_req *subreq;
|
---|
4080 |
|
---|
4081 | req = tevent_req_create(mem_ctx, &state,
|
---|
4082 | struct rpccli_samr_OpenAlias_state);
|
---|
4083 | if (req == NULL) {
|
---|
4084 | return NULL;
|
---|
4085 | }
|
---|
4086 | state->out_mem_ctx = NULL;
|
---|
4087 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4088 |
|
---|
4089 | /* In parameters */
|
---|
4090 | state->orig.in.domain_handle = _domain_handle;
|
---|
4091 | state->orig.in.access_mask = _access_mask;
|
---|
4092 | state->orig.in.rid = _rid;
|
---|
4093 |
|
---|
4094 | /* Out parameters */
|
---|
4095 | state->orig.out.alias_handle = _alias_handle;
|
---|
4096 |
|
---|
4097 | /* Result */
|
---|
4098 | ZERO_STRUCT(state->orig.out.result);
|
---|
4099 |
|
---|
4100 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4101 | "rpccli_samr_OpenAlias_out_memory");
|
---|
4102 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4103 | return tevent_req_post(req, ev);
|
---|
4104 | }
|
---|
4105 |
|
---|
4106 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4107 | state->tmp = state->orig;
|
---|
4108 |
|
---|
4109 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4110 | &ndr_table_samr,
|
---|
4111 | NDR_SAMR_OPENALIAS,
|
---|
4112 | &state->tmp);
|
---|
4113 | if (tevent_req_nomem(subreq, req)) {
|
---|
4114 | return tevent_req_post(req, ev);
|
---|
4115 | }
|
---|
4116 | tevent_req_set_callback(subreq, rpccli_samr_OpenAlias_done, req);
|
---|
4117 | return req;
|
---|
4118 | }
|
---|
4119 |
|
---|
4120 | static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq)
|
---|
4121 | {
|
---|
4122 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4123 | subreq, struct tevent_req);
|
---|
4124 | struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
|
---|
4125 | req, struct rpccli_samr_OpenAlias_state);
|
---|
4126 | NTSTATUS status;
|
---|
4127 | TALLOC_CTX *mem_ctx;
|
---|
4128 |
|
---|
4129 | if (state->out_mem_ctx) {
|
---|
4130 | mem_ctx = state->out_mem_ctx;
|
---|
4131 | } else {
|
---|
4132 | mem_ctx = state;
|
---|
4133 | }
|
---|
4134 |
|
---|
4135 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4136 | TALLOC_FREE(subreq);
|
---|
4137 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4138 | tevent_req_nterror(req, status);
|
---|
4139 | return;
|
---|
4140 | }
|
---|
4141 |
|
---|
4142 | /* Copy out parameters */
|
---|
4143 | *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
|
---|
4144 |
|
---|
4145 | /* Copy result */
|
---|
4146 | state->orig.out.result = state->tmp.out.result;
|
---|
4147 |
|
---|
4148 | /* Reset temporary structure */
|
---|
4149 | ZERO_STRUCT(state->tmp);
|
---|
4150 |
|
---|
4151 | tevent_req_done(req);
|
---|
4152 | }
|
---|
4153 |
|
---|
4154 | NTSTATUS rpccli_samr_OpenAlias_recv(struct tevent_req *req,
|
---|
4155 | TALLOC_CTX *mem_ctx,
|
---|
4156 | NTSTATUS *result)
|
---|
4157 | {
|
---|
4158 | struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
|
---|
4159 | req, struct rpccli_samr_OpenAlias_state);
|
---|
4160 | NTSTATUS status;
|
---|
4161 |
|
---|
4162 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4163 | tevent_req_received(req);
|
---|
4164 | return status;
|
---|
4165 | }
|
---|
4166 |
|
---|
4167 | /* Steal possbile out parameters to the callers context */
|
---|
4168 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4169 |
|
---|
4170 | /* Return result */
|
---|
4171 | *result = state->orig.out.result;
|
---|
4172 |
|
---|
4173 | tevent_req_received(req);
|
---|
4174 | return NT_STATUS_OK;
|
---|
4175 | }
|
---|
4176 |
|
---|
4177 | NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli,
|
---|
4178 | TALLOC_CTX *mem_ctx,
|
---|
4179 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
4180 | uint32_t access_mask /* [in] */,
|
---|
4181 | uint32_t rid /* [in] */,
|
---|
4182 | struct policy_handle *alias_handle /* [out] [ref] */)
|
---|
4183 | {
|
---|
4184 | struct samr_OpenAlias r;
|
---|
4185 | NTSTATUS status;
|
---|
4186 |
|
---|
4187 | /* In parameters */
|
---|
4188 | r.in.domain_handle = domain_handle;
|
---|
4189 | r.in.access_mask = access_mask;
|
---|
4190 | r.in.rid = rid;
|
---|
4191 |
|
---|
4192 | status = cli->dispatch(cli,
|
---|
4193 | mem_ctx,
|
---|
4194 | &ndr_table_samr,
|
---|
4195 | NDR_SAMR_OPENALIAS,
|
---|
4196 | &r);
|
---|
4197 |
|
---|
4198 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4199 | return status;
|
---|
4200 | }
|
---|
4201 |
|
---|
4202 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4203 | return status;
|
---|
4204 | }
|
---|
4205 |
|
---|
4206 | /* Return variables */
|
---|
4207 | *alias_handle = *r.out.alias_handle;
|
---|
4208 |
|
---|
4209 | /* Return result */
|
---|
4210 | return r.out.result;
|
---|
4211 | }
|
---|
4212 |
|
---|
4213 | struct rpccli_samr_QueryAliasInfo_state {
|
---|
4214 | struct samr_QueryAliasInfo orig;
|
---|
4215 | struct samr_QueryAliasInfo tmp;
|
---|
4216 | TALLOC_CTX *out_mem_ctx;
|
---|
4217 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4218 | };
|
---|
4219 |
|
---|
4220 | static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq);
|
---|
4221 |
|
---|
4222 | struct tevent_req *rpccli_samr_QueryAliasInfo_send(TALLOC_CTX *mem_ctx,
|
---|
4223 | struct tevent_context *ev,
|
---|
4224 | struct rpc_pipe_client *cli,
|
---|
4225 | struct policy_handle *_alias_handle /* [in] [ref] */,
|
---|
4226 | enum samr_AliasInfoEnum _level /* [in] */,
|
---|
4227 | union samr_AliasInfo **_info /* [out] [ref,switch_is(level)] */)
|
---|
4228 | {
|
---|
4229 | struct tevent_req *req;
|
---|
4230 | struct rpccli_samr_QueryAliasInfo_state *state;
|
---|
4231 | struct tevent_req *subreq;
|
---|
4232 |
|
---|
4233 | req = tevent_req_create(mem_ctx, &state,
|
---|
4234 | struct rpccli_samr_QueryAliasInfo_state);
|
---|
4235 | if (req == NULL) {
|
---|
4236 | return NULL;
|
---|
4237 | }
|
---|
4238 | state->out_mem_ctx = NULL;
|
---|
4239 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4240 |
|
---|
4241 | /* In parameters */
|
---|
4242 | state->orig.in.alias_handle = _alias_handle;
|
---|
4243 | state->orig.in.level = _level;
|
---|
4244 |
|
---|
4245 | /* Out parameters */
|
---|
4246 | state->orig.out.info = _info;
|
---|
4247 |
|
---|
4248 | /* Result */
|
---|
4249 | ZERO_STRUCT(state->orig.out.result);
|
---|
4250 |
|
---|
4251 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4252 | "rpccli_samr_QueryAliasInfo_out_memory");
|
---|
4253 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4254 | return tevent_req_post(req, ev);
|
---|
4255 | }
|
---|
4256 |
|
---|
4257 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4258 | state->tmp = state->orig;
|
---|
4259 |
|
---|
4260 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4261 | &ndr_table_samr,
|
---|
4262 | NDR_SAMR_QUERYALIASINFO,
|
---|
4263 | &state->tmp);
|
---|
4264 | if (tevent_req_nomem(subreq, req)) {
|
---|
4265 | return tevent_req_post(req, ev);
|
---|
4266 | }
|
---|
4267 | tevent_req_set_callback(subreq, rpccli_samr_QueryAliasInfo_done, req);
|
---|
4268 | return req;
|
---|
4269 | }
|
---|
4270 |
|
---|
4271 | static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq)
|
---|
4272 | {
|
---|
4273 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4274 | subreq, struct tevent_req);
|
---|
4275 | struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
|
---|
4276 | req, struct rpccli_samr_QueryAliasInfo_state);
|
---|
4277 | NTSTATUS status;
|
---|
4278 | TALLOC_CTX *mem_ctx;
|
---|
4279 |
|
---|
4280 | if (state->out_mem_ctx) {
|
---|
4281 | mem_ctx = state->out_mem_ctx;
|
---|
4282 | } else {
|
---|
4283 | mem_ctx = state;
|
---|
4284 | }
|
---|
4285 |
|
---|
4286 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4287 | TALLOC_FREE(subreq);
|
---|
4288 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4289 | tevent_req_nterror(req, status);
|
---|
4290 | return;
|
---|
4291 | }
|
---|
4292 |
|
---|
4293 | /* Copy out parameters */
|
---|
4294 | *state->orig.out.info = *state->tmp.out.info;
|
---|
4295 |
|
---|
4296 | /* Copy result */
|
---|
4297 | state->orig.out.result = state->tmp.out.result;
|
---|
4298 |
|
---|
4299 | /* Reset temporary structure */
|
---|
4300 | ZERO_STRUCT(state->tmp);
|
---|
4301 |
|
---|
4302 | tevent_req_done(req);
|
---|
4303 | }
|
---|
4304 |
|
---|
4305 | NTSTATUS rpccli_samr_QueryAliasInfo_recv(struct tevent_req *req,
|
---|
4306 | TALLOC_CTX *mem_ctx,
|
---|
4307 | NTSTATUS *result)
|
---|
4308 | {
|
---|
4309 | struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
|
---|
4310 | req, struct rpccli_samr_QueryAliasInfo_state);
|
---|
4311 | NTSTATUS status;
|
---|
4312 |
|
---|
4313 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4314 | tevent_req_received(req);
|
---|
4315 | return status;
|
---|
4316 | }
|
---|
4317 |
|
---|
4318 | /* Steal possbile out parameters to the callers context */
|
---|
4319 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4320 |
|
---|
4321 | /* Return result */
|
---|
4322 | *result = state->orig.out.result;
|
---|
4323 |
|
---|
4324 | tevent_req_received(req);
|
---|
4325 | return NT_STATUS_OK;
|
---|
4326 | }
|
---|
4327 |
|
---|
4328 | NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
|
---|
4329 | TALLOC_CTX *mem_ctx,
|
---|
4330 | struct policy_handle *alias_handle /* [in] [ref] */,
|
---|
4331 | enum samr_AliasInfoEnum level /* [in] */,
|
---|
4332 | union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */)
|
---|
4333 | {
|
---|
4334 | struct samr_QueryAliasInfo r;
|
---|
4335 | NTSTATUS status;
|
---|
4336 |
|
---|
4337 | /* In parameters */
|
---|
4338 | r.in.alias_handle = alias_handle;
|
---|
4339 | r.in.level = level;
|
---|
4340 |
|
---|
4341 | status = cli->dispatch(cli,
|
---|
4342 | mem_ctx,
|
---|
4343 | &ndr_table_samr,
|
---|
4344 | NDR_SAMR_QUERYALIASINFO,
|
---|
4345 | &r);
|
---|
4346 |
|
---|
4347 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4348 | return status;
|
---|
4349 | }
|
---|
4350 |
|
---|
4351 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4352 | return status;
|
---|
4353 | }
|
---|
4354 |
|
---|
4355 | /* Return variables */
|
---|
4356 | *info = *r.out.info;
|
---|
4357 |
|
---|
4358 | /* Return result */
|
---|
4359 | return r.out.result;
|
---|
4360 | }
|
---|
4361 |
|
---|
4362 | struct rpccli_samr_SetAliasInfo_state {
|
---|
4363 | struct samr_SetAliasInfo orig;
|
---|
4364 | struct samr_SetAliasInfo tmp;
|
---|
4365 | TALLOC_CTX *out_mem_ctx;
|
---|
4366 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4367 | };
|
---|
4368 |
|
---|
4369 | static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq);
|
---|
4370 |
|
---|
4371 | struct tevent_req *rpccli_samr_SetAliasInfo_send(TALLOC_CTX *mem_ctx,
|
---|
4372 | struct tevent_context *ev,
|
---|
4373 | struct rpc_pipe_client *cli,
|
---|
4374 | struct policy_handle *_alias_handle /* [in] [ref] */,
|
---|
4375 | enum samr_AliasInfoEnum _level /* [in] */,
|
---|
4376 | union samr_AliasInfo *_info /* [in] [ref,switch_is(level)] */)
|
---|
4377 | {
|
---|
4378 | struct tevent_req *req;
|
---|
4379 | struct rpccli_samr_SetAliasInfo_state *state;
|
---|
4380 | struct tevent_req *subreq;
|
---|
4381 |
|
---|
4382 | req = tevent_req_create(mem_ctx, &state,
|
---|
4383 | struct rpccli_samr_SetAliasInfo_state);
|
---|
4384 | if (req == NULL) {
|
---|
4385 | return NULL;
|
---|
4386 | }
|
---|
4387 | state->out_mem_ctx = NULL;
|
---|
4388 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4389 |
|
---|
4390 | /* In parameters */
|
---|
4391 | state->orig.in.alias_handle = _alias_handle;
|
---|
4392 | state->orig.in.level = _level;
|
---|
4393 | state->orig.in.info = _info;
|
---|
4394 |
|
---|
4395 | /* Out parameters */
|
---|
4396 |
|
---|
4397 | /* Result */
|
---|
4398 | ZERO_STRUCT(state->orig.out.result);
|
---|
4399 |
|
---|
4400 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4401 | state->tmp = state->orig;
|
---|
4402 |
|
---|
4403 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4404 | &ndr_table_samr,
|
---|
4405 | NDR_SAMR_SETALIASINFO,
|
---|
4406 | &state->tmp);
|
---|
4407 | if (tevent_req_nomem(subreq, req)) {
|
---|
4408 | return tevent_req_post(req, ev);
|
---|
4409 | }
|
---|
4410 | tevent_req_set_callback(subreq, rpccli_samr_SetAliasInfo_done, req);
|
---|
4411 | return req;
|
---|
4412 | }
|
---|
4413 |
|
---|
4414 | static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq)
|
---|
4415 | {
|
---|
4416 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4417 | subreq, struct tevent_req);
|
---|
4418 | struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
|
---|
4419 | req, struct rpccli_samr_SetAliasInfo_state);
|
---|
4420 | NTSTATUS status;
|
---|
4421 | TALLOC_CTX *mem_ctx;
|
---|
4422 |
|
---|
4423 | if (state->out_mem_ctx) {
|
---|
4424 | mem_ctx = state->out_mem_ctx;
|
---|
4425 | } else {
|
---|
4426 | mem_ctx = state;
|
---|
4427 | }
|
---|
4428 |
|
---|
4429 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4430 | TALLOC_FREE(subreq);
|
---|
4431 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4432 | tevent_req_nterror(req, status);
|
---|
4433 | return;
|
---|
4434 | }
|
---|
4435 |
|
---|
4436 | /* Copy out parameters */
|
---|
4437 |
|
---|
4438 | /* Copy result */
|
---|
4439 | state->orig.out.result = state->tmp.out.result;
|
---|
4440 |
|
---|
4441 | /* Reset temporary structure */
|
---|
4442 | ZERO_STRUCT(state->tmp);
|
---|
4443 |
|
---|
4444 | tevent_req_done(req);
|
---|
4445 | }
|
---|
4446 |
|
---|
4447 | NTSTATUS rpccli_samr_SetAliasInfo_recv(struct tevent_req *req,
|
---|
4448 | TALLOC_CTX *mem_ctx,
|
---|
4449 | NTSTATUS *result)
|
---|
4450 | {
|
---|
4451 | struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
|
---|
4452 | req, struct rpccli_samr_SetAliasInfo_state);
|
---|
4453 | NTSTATUS status;
|
---|
4454 |
|
---|
4455 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4456 | tevent_req_received(req);
|
---|
4457 | return status;
|
---|
4458 | }
|
---|
4459 |
|
---|
4460 | /* Steal possbile out parameters to the callers context */
|
---|
4461 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4462 |
|
---|
4463 | /* Return result */
|
---|
4464 | *result = state->orig.out.result;
|
---|
4465 |
|
---|
4466 | tevent_req_received(req);
|
---|
4467 | return NT_STATUS_OK;
|
---|
4468 | }
|
---|
4469 |
|
---|
4470 | NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli,
|
---|
4471 | TALLOC_CTX *mem_ctx,
|
---|
4472 | struct policy_handle *alias_handle /* [in] [ref] */,
|
---|
4473 | enum samr_AliasInfoEnum level /* [in] */,
|
---|
4474 | union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */)
|
---|
4475 | {
|
---|
4476 | struct samr_SetAliasInfo r;
|
---|
4477 | NTSTATUS status;
|
---|
4478 |
|
---|
4479 | /* In parameters */
|
---|
4480 | r.in.alias_handle = alias_handle;
|
---|
4481 | r.in.level = level;
|
---|
4482 | r.in.info = info;
|
---|
4483 |
|
---|
4484 | status = cli->dispatch(cli,
|
---|
4485 | mem_ctx,
|
---|
4486 | &ndr_table_samr,
|
---|
4487 | NDR_SAMR_SETALIASINFO,
|
---|
4488 | &r);
|
---|
4489 |
|
---|
4490 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4491 | return status;
|
---|
4492 | }
|
---|
4493 |
|
---|
4494 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4495 | return status;
|
---|
4496 | }
|
---|
4497 |
|
---|
4498 | /* Return variables */
|
---|
4499 |
|
---|
4500 | /* Return result */
|
---|
4501 | return r.out.result;
|
---|
4502 | }
|
---|
4503 |
|
---|
4504 | struct rpccli_samr_DeleteDomAlias_state {
|
---|
4505 | struct samr_DeleteDomAlias orig;
|
---|
4506 | struct samr_DeleteDomAlias tmp;
|
---|
4507 | TALLOC_CTX *out_mem_ctx;
|
---|
4508 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4509 | };
|
---|
4510 |
|
---|
4511 | static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq);
|
---|
4512 |
|
---|
4513 | struct tevent_req *rpccli_samr_DeleteDomAlias_send(TALLOC_CTX *mem_ctx,
|
---|
4514 | struct tevent_context *ev,
|
---|
4515 | struct rpc_pipe_client *cli,
|
---|
4516 | struct policy_handle *_alias_handle /* [in,out] [ref] */)
|
---|
4517 | {
|
---|
4518 | struct tevent_req *req;
|
---|
4519 | struct rpccli_samr_DeleteDomAlias_state *state;
|
---|
4520 | struct tevent_req *subreq;
|
---|
4521 |
|
---|
4522 | req = tevent_req_create(mem_ctx, &state,
|
---|
4523 | struct rpccli_samr_DeleteDomAlias_state);
|
---|
4524 | if (req == NULL) {
|
---|
4525 | return NULL;
|
---|
4526 | }
|
---|
4527 | state->out_mem_ctx = NULL;
|
---|
4528 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4529 |
|
---|
4530 | /* In parameters */
|
---|
4531 | state->orig.in.alias_handle = _alias_handle;
|
---|
4532 |
|
---|
4533 | /* Out parameters */
|
---|
4534 | state->orig.out.alias_handle = _alias_handle;
|
---|
4535 |
|
---|
4536 | /* Result */
|
---|
4537 | ZERO_STRUCT(state->orig.out.result);
|
---|
4538 |
|
---|
4539 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4540 | "rpccli_samr_DeleteDomAlias_out_memory");
|
---|
4541 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4542 | return tevent_req_post(req, ev);
|
---|
4543 | }
|
---|
4544 |
|
---|
4545 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4546 | state->tmp = state->orig;
|
---|
4547 |
|
---|
4548 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4549 | &ndr_table_samr,
|
---|
4550 | NDR_SAMR_DELETEDOMALIAS,
|
---|
4551 | &state->tmp);
|
---|
4552 | if (tevent_req_nomem(subreq, req)) {
|
---|
4553 | return tevent_req_post(req, ev);
|
---|
4554 | }
|
---|
4555 | tevent_req_set_callback(subreq, rpccli_samr_DeleteDomAlias_done, req);
|
---|
4556 | return req;
|
---|
4557 | }
|
---|
4558 |
|
---|
4559 | static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq)
|
---|
4560 | {
|
---|
4561 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4562 | subreq, struct tevent_req);
|
---|
4563 | struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
|
---|
4564 | req, struct rpccli_samr_DeleteDomAlias_state);
|
---|
4565 | NTSTATUS status;
|
---|
4566 | TALLOC_CTX *mem_ctx;
|
---|
4567 |
|
---|
4568 | if (state->out_mem_ctx) {
|
---|
4569 | mem_ctx = state->out_mem_ctx;
|
---|
4570 | } else {
|
---|
4571 | mem_ctx = state;
|
---|
4572 | }
|
---|
4573 |
|
---|
4574 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4575 | TALLOC_FREE(subreq);
|
---|
4576 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4577 | tevent_req_nterror(req, status);
|
---|
4578 | return;
|
---|
4579 | }
|
---|
4580 |
|
---|
4581 | /* Copy out parameters */
|
---|
4582 | *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
|
---|
4583 |
|
---|
4584 | /* Copy result */
|
---|
4585 | state->orig.out.result = state->tmp.out.result;
|
---|
4586 |
|
---|
4587 | /* Reset temporary structure */
|
---|
4588 | ZERO_STRUCT(state->tmp);
|
---|
4589 |
|
---|
4590 | tevent_req_done(req);
|
---|
4591 | }
|
---|
4592 |
|
---|
4593 | NTSTATUS rpccli_samr_DeleteDomAlias_recv(struct tevent_req *req,
|
---|
4594 | TALLOC_CTX *mem_ctx,
|
---|
4595 | NTSTATUS *result)
|
---|
4596 | {
|
---|
4597 | struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
|
---|
4598 | req, struct rpccli_samr_DeleteDomAlias_state);
|
---|
4599 | NTSTATUS status;
|
---|
4600 |
|
---|
4601 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4602 | tevent_req_received(req);
|
---|
4603 | return status;
|
---|
4604 | }
|
---|
4605 |
|
---|
4606 | /* Steal possbile out parameters to the callers context */
|
---|
4607 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4608 |
|
---|
4609 | /* Return result */
|
---|
4610 | *result = state->orig.out.result;
|
---|
4611 |
|
---|
4612 | tevent_req_received(req);
|
---|
4613 | return NT_STATUS_OK;
|
---|
4614 | }
|
---|
4615 |
|
---|
4616 | NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
|
---|
4617 | TALLOC_CTX *mem_ctx,
|
---|
4618 | struct policy_handle *alias_handle /* [in,out] [ref] */)
|
---|
4619 | {
|
---|
4620 | struct samr_DeleteDomAlias r;
|
---|
4621 | NTSTATUS status;
|
---|
4622 |
|
---|
4623 | /* In parameters */
|
---|
4624 | r.in.alias_handle = alias_handle;
|
---|
4625 |
|
---|
4626 | status = cli->dispatch(cli,
|
---|
4627 | mem_ctx,
|
---|
4628 | &ndr_table_samr,
|
---|
4629 | NDR_SAMR_DELETEDOMALIAS,
|
---|
4630 | &r);
|
---|
4631 |
|
---|
4632 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4633 | return status;
|
---|
4634 | }
|
---|
4635 |
|
---|
4636 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4637 | return status;
|
---|
4638 | }
|
---|
4639 |
|
---|
4640 | /* Return variables */
|
---|
4641 | *alias_handle = *r.out.alias_handle;
|
---|
4642 |
|
---|
4643 | /* Return result */
|
---|
4644 | return r.out.result;
|
---|
4645 | }
|
---|
4646 |
|
---|
4647 | struct rpccli_samr_AddAliasMember_state {
|
---|
4648 | struct samr_AddAliasMember orig;
|
---|
4649 | struct samr_AddAliasMember tmp;
|
---|
4650 | TALLOC_CTX *out_mem_ctx;
|
---|
4651 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4652 | };
|
---|
4653 |
|
---|
4654 | static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq);
|
---|
4655 |
|
---|
4656 | struct tevent_req *rpccli_samr_AddAliasMember_send(TALLOC_CTX *mem_ctx,
|
---|
4657 | struct tevent_context *ev,
|
---|
4658 | struct rpc_pipe_client *cli,
|
---|
4659 | struct policy_handle *_alias_handle /* [in] [ref] */,
|
---|
4660 | struct dom_sid2 *_sid /* [in] [ref] */)
|
---|
4661 | {
|
---|
4662 | struct tevent_req *req;
|
---|
4663 | struct rpccli_samr_AddAliasMember_state *state;
|
---|
4664 | struct tevent_req *subreq;
|
---|
4665 |
|
---|
4666 | req = tevent_req_create(mem_ctx, &state,
|
---|
4667 | struct rpccli_samr_AddAliasMember_state);
|
---|
4668 | if (req == NULL) {
|
---|
4669 | return NULL;
|
---|
4670 | }
|
---|
4671 | state->out_mem_ctx = NULL;
|
---|
4672 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4673 |
|
---|
4674 | /* In parameters */
|
---|
4675 | state->orig.in.alias_handle = _alias_handle;
|
---|
4676 | state->orig.in.sid = _sid;
|
---|
4677 |
|
---|
4678 | /* Out parameters */
|
---|
4679 |
|
---|
4680 | /* Result */
|
---|
4681 | ZERO_STRUCT(state->orig.out.result);
|
---|
4682 |
|
---|
4683 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4684 | state->tmp = state->orig;
|
---|
4685 |
|
---|
4686 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4687 | &ndr_table_samr,
|
---|
4688 | NDR_SAMR_ADDALIASMEMBER,
|
---|
4689 | &state->tmp);
|
---|
4690 | if (tevent_req_nomem(subreq, req)) {
|
---|
4691 | return tevent_req_post(req, ev);
|
---|
4692 | }
|
---|
4693 | tevent_req_set_callback(subreq, rpccli_samr_AddAliasMember_done, req);
|
---|
4694 | return req;
|
---|
4695 | }
|
---|
4696 |
|
---|
4697 | static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq)
|
---|
4698 | {
|
---|
4699 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4700 | subreq, struct tevent_req);
|
---|
4701 | struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
|
---|
4702 | req, struct rpccli_samr_AddAliasMember_state);
|
---|
4703 | NTSTATUS status;
|
---|
4704 | TALLOC_CTX *mem_ctx;
|
---|
4705 |
|
---|
4706 | if (state->out_mem_ctx) {
|
---|
4707 | mem_ctx = state->out_mem_ctx;
|
---|
4708 | } else {
|
---|
4709 | mem_ctx = state;
|
---|
4710 | }
|
---|
4711 |
|
---|
4712 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4713 | TALLOC_FREE(subreq);
|
---|
4714 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4715 | tevent_req_nterror(req, status);
|
---|
4716 | return;
|
---|
4717 | }
|
---|
4718 |
|
---|
4719 | /* Copy out parameters */
|
---|
4720 |
|
---|
4721 | /* Copy result */
|
---|
4722 | state->orig.out.result = state->tmp.out.result;
|
---|
4723 |
|
---|
4724 | /* Reset temporary structure */
|
---|
4725 | ZERO_STRUCT(state->tmp);
|
---|
4726 |
|
---|
4727 | tevent_req_done(req);
|
---|
4728 | }
|
---|
4729 |
|
---|
4730 | NTSTATUS rpccli_samr_AddAliasMember_recv(struct tevent_req *req,
|
---|
4731 | TALLOC_CTX *mem_ctx,
|
---|
4732 | NTSTATUS *result)
|
---|
4733 | {
|
---|
4734 | struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
|
---|
4735 | req, struct rpccli_samr_AddAliasMember_state);
|
---|
4736 | NTSTATUS status;
|
---|
4737 |
|
---|
4738 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4739 | tevent_req_received(req);
|
---|
4740 | return status;
|
---|
4741 | }
|
---|
4742 |
|
---|
4743 | /* Steal possbile out parameters to the callers context */
|
---|
4744 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4745 |
|
---|
4746 | /* Return result */
|
---|
4747 | *result = state->orig.out.result;
|
---|
4748 |
|
---|
4749 | tevent_req_received(req);
|
---|
4750 | return NT_STATUS_OK;
|
---|
4751 | }
|
---|
4752 |
|
---|
4753 | NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli,
|
---|
4754 | TALLOC_CTX *mem_ctx,
|
---|
4755 | struct policy_handle *alias_handle /* [in] [ref] */,
|
---|
4756 | struct dom_sid2 *sid /* [in] [ref] */)
|
---|
4757 | {
|
---|
4758 | struct samr_AddAliasMember r;
|
---|
4759 | NTSTATUS status;
|
---|
4760 |
|
---|
4761 | /* In parameters */
|
---|
4762 | r.in.alias_handle = alias_handle;
|
---|
4763 | r.in.sid = sid;
|
---|
4764 |
|
---|
4765 | status = cli->dispatch(cli,
|
---|
4766 | mem_ctx,
|
---|
4767 | &ndr_table_samr,
|
---|
4768 | NDR_SAMR_ADDALIASMEMBER,
|
---|
4769 | &r);
|
---|
4770 |
|
---|
4771 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4772 | return status;
|
---|
4773 | }
|
---|
4774 |
|
---|
4775 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4776 | return status;
|
---|
4777 | }
|
---|
4778 |
|
---|
4779 | /* Return variables */
|
---|
4780 |
|
---|
4781 | /* Return result */
|
---|
4782 | return r.out.result;
|
---|
4783 | }
|
---|
4784 |
|
---|
4785 | struct rpccli_samr_DeleteAliasMember_state {
|
---|
4786 | struct samr_DeleteAliasMember orig;
|
---|
4787 | struct samr_DeleteAliasMember tmp;
|
---|
4788 | TALLOC_CTX *out_mem_ctx;
|
---|
4789 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4790 | };
|
---|
4791 |
|
---|
4792 | static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq);
|
---|
4793 |
|
---|
4794 | struct tevent_req *rpccli_samr_DeleteAliasMember_send(TALLOC_CTX *mem_ctx,
|
---|
4795 | struct tevent_context *ev,
|
---|
4796 | struct rpc_pipe_client *cli,
|
---|
4797 | struct policy_handle *_alias_handle /* [in] [ref] */,
|
---|
4798 | struct dom_sid2 *_sid /* [in] [ref] */)
|
---|
4799 | {
|
---|
4800 | struct tevent_req *req;
|
---|
4801 | struct rpccli_samr_DeleteAliasMember_state *state;
|
---|
4802 | struct tevent_req *subreq;
|
---|
4803 |
|
---|
4804 | req = tevent_req_create(mem_ctx, &state,
|
---|
4805 | struct rpccli_samr_DeleteAliasMember_state);
|
---|
4806 | if (req == NULL) {
|
---|
4807 | return NULL;
|
---|
4808 | }
|
---|
4809 | state->out_mem_ctx = NULL;
|
---|
4810 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4811 |
|
---|
4812 | /* In parameters */
|
---|
4813 | state->orig.in.alias_handle = _alias_handle;
|
---|
4814 | state->orig.in.sid = _sid;
|
---|
4815 |
|
---|
4816 | /* Out parameters */
|
---|
4817 |
|
---|
4818 | /* Result */
|
---|
4819 | ZERO_STRUCT(state->orig.out.result);
|
---|
4820 |
|
---|
4821 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4822 | state->tmp = state->orig;
|
---|
4823 |
|
---|
4824 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4825 | &ndr_table_samr,
|
---|
4826 | NDR_SAMR_DELETEALIASMEMBER,
|
---|
4827 | &state->tmp);
|
---|
4828 | if (tevent_req_nomem(subreq, req)) {
|
---|
4829 | return tevent_req_post(req, ev);
|
---|
4830 | }
|
---|
4831 | tevent_req_set_callback(subreq, rpccli_samr_DeleteAliasMember_done, req);
|
---|
4832 | return req;
|
---|
4833 | }
|
---|
4834 |
|
---|
4835 | static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq)
|
---|
4836 | {
|
---|
4837 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4838 | subreq, struct tevent_req);
|
---|
4839 | struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
|
---|
4840 | req, struct rpccli_samr_DeleteAliasMember_state);
|
---|
4841 | NTSTATUS status;
|
---|
4842 | TALLOC_CTX *mem_ctx;
|
---|
4843 |
|
---|
4844 | if (state->out_mem_ctx) {
|
---|
4845 | mem_ctx = state->out_mem_ctx;
|
---|
4846 | } else {
|
---|
4847 | mem_ctx = state;
|
---|
4848 | }
|
---|
4849 |
|
---|
4850 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4851 | TALLOC_FREE(subreq);
|
---|
4852 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4853 | tevent_req_nterror(req, status);
|
---|
4854 | return;
|
---|
4855 | }
|
---|
4856 |
|
---|
4857 | /* Copy out parameters */
|
---|
4858 |
|
---|
4859 | /* Copy result */
|
---|
4860 | state->orig.out.result = state->tmp.out.result;
|
---|
4861 |
|
---|
4862 | /* Reset temporary structure */
|
---|
4863 | ZERO_STRUCT(state->tmp);
|
---|
4864 |
|
---|
4865 | tevent_req_done(req);
|
---|
4866 | }
|
---|
4867 |
|
---|
4868 | NTSTATUS rpccli_samr_DeleteAliasMember_recv(struct tevent_req *req,
|
---|
4869 | TALLOC_CTX *mem_ctx,
|
---|
4870 | NTSTATUS *result)
|
---|
4871 | {
|
---|
4872 | struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
|
---|
4873 | req, struct rpccli_samr_DeleteAliasMember_state);
|
---|
4874 | NTSTATUS status;
|
---|
4875 |
|
---|
4876 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4877 | tevent_req_received(req);
|
---|
4878 | return status;
|
---|
4879 | }
|
---|
4880 |
|
---|
4881 | /* Steal possbile out parameters to the callers context */
|
---|
4882 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4883 |
|
---|
4884 | /* Return result */
|
---|
4885 | *result = state->orig.out.result;
|
---|
4886 |
|
---|
4887 | tevent_req_received(req);
|
---|
4888 | return NT_STATUS_OK;
|
---|
4889 | }
|
---|
4890 |
|
---|
4891 | NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
|
---|
4892 | TALLOC_CTX *mem_ctx,
|
---|
4893 | struct policy_handle *alias_handle /* [in] [ref] */,
|
---|
4894 | struct dom_sid2 *sid /* [in] [ref] */)
|
---|
4895 | {
|
---|
4896 | struct samr_DeleteAliasMember r;
|
---|
4897 | NTSTATUS status;
|
---|
4898 |
|
---|
4899 | /* In parameters */
|
---|
4900 | r.in.alias_handle = alias_handle;
|
---|
4901 | r.in.sid = sid;
|
---|
4902 |
|
---|
4903 | status = cli->dispatch(cli,
|
---|
4904 | mem_ctx,
|
---|
4905 | &ndr_table_samr,
|
---|
4906 | NDR_SAMR_DELETEALIASMEMBER,
|
---|
4907 | &r);
|
---|
4908 |
|
---|
4909 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4910 | return status;
|
---|
4911 | }
|
---|
4912 |
|
---|
4913 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4914 | return status;
|
---|
4915 | }
|
---|
4916 |
|
---|
4917 | /* Return variables */
|
---|
4918 |
|
---|
4919 | /* Return result */
|
---|
4920 | return r.out.result;
|
---|
4921 | }
|
---|
4922 |
|
---|
4923 | struct rpccli_samr_GetMembersInAlias_state {
|
---|
4924 | struct samr_GetMembersInAlias orig;
|
---|
4925 | struct samr_GetMembersInAlias tmp;
|
---|
4926 | TALLOC_CTX *out_mem_ctx;
|
---|
4927 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4928 | };
|
---|
4929 |
|
---|
4930 | static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq);
|
---|
4931 |
|
---|
4932 | struct tevent_req *rpccli_samr_GetMembersInAlias_send(TALLOC_CTX *mem_ctx,
|
---|
4933 | struct tevent_context *ev,
|
---|
4934 | struct rpc_pipe_client *cli,
|
---|
4935 | struct policy_handle *_alias_handle /* [in] [ref] */,
|
---|
4936 | struct lsa_SidArray *_sids /* [out] [ref] */)
|
---|
4937 | {
|
---|
4938 | struct tevent_req *req;
|
---|
4939 | struct rpccli_samr_GetMembersInAlias_state *state;
|
---|
4940 | struct tevent_req *subreq;
|
---|
4941 |
|
---|
4942 | req = tevent_req_create(mem_ctx, &state,
|
---|
4943 | struct rpccli_samr_GetMembersInAlias_state);
|
---|
4944 | if (req == NULL) {
|
---|
4945 | return NULL;
|
---|
4946 | }
|
---|
4947 | state->out_mem_ctx = NULL;
|
---|
4948 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4949 |
|
---|
4950 | /* In parameters */
|
---|
4951 | state->orig.in.alias_handle = _alias_handle;
|
---|
4952 |
|
---|
4953 | /* Out parameters */
|
---|
4954 | state->orig.out.sids = _sids;
|
---|
4955 |
|
---|
4956 | /* Result */
|
---|
4957 | ZERO_STRUCT(state->orig.out.result);
|
---|
4958 |
|
---|
4959 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4960 | "rpccli_samr_GetMembersInAlias_out_memory");
|
---|
4961 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4962 | return tevent_req_post(req, ev);
|
---|
4963 | }
|
---|
4964 |
|
---|
4965 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4966 | state->tmp = state->orig;
|
---|
4967 |
|
---|
4968 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4969 | &ndr_table_samr,
|
---|
4970 | NDR_SAMR_GETMEMBERSINALIAS,
|
---|
4971 | &state->tmp);
|
---|
4972 | if (tevent_req_nomem(subreq, req)) {
|
---|
4973 | return tevent_req_post(req, ev);
|
---|
4974 | }
|
---|
4975 | tevent_req_set_callback(subreq, rpccli_samr_GetMembersInAlias_done, req);
|
---|
4976 | return req;
|
---|
4977 | }
|
---|
4978 |
|
---|
4979 | static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq)
|
---|
4980 | {
|
---|
4981 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4982 | subreq, struct tevent_req);
|
---|
4983 | struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
|
---|
4984 | req, struct rpccli_samr_GetMembersInAlias_state);
|
---|
4985 | NTSTATUS status;
|
---|
4986 | TALLOC_CTX *mem_ctx;
|
---|
4987 |
|
---|
4988 | if (state->out_mem_ctx) {
|
---|
4989 | mem_ctx = state->out_mem_ctx;
|
---|
4990 | } else {
|
---|
4991 | mem_ctx = state;
|
---|
4992 | }
|
---|
4993 |
|
---|
4994 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4995 | TALLOC_FREE(subreq);
|
---|
4996 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4997 | tevent_req_nterror(req, status);
|
---|
4998 | return;
|
---|
4999 | }
|
---|
5000 |
|
---|
5001 | /* Copy out parameters */
|
---|
5002 | *state->orig.out.sids = *state->tmp.out.sids;
|
---|
5003 |
|
---|
5004 | /* Copy result */
|
---|
5005 | state->orig.out.result = state->tmp.out.result;
|
---|
5006 |
|
---|
5007 | /* Reset temporary structure */
|
---|
5008 | ZERO_STRUCT(state->tmp);
|
---|
5009 |
|
---|
5010 | tevent_req_done(req);
|
---|
5011 | }
|
---|
5012 |
|
---|
5013 | NTSTATUS rpccli_samr_GetMembersInAlias_recv(struct tevent_req *req,
|
---|
5014 | TALLOC_CTX *mem_ctx,
|
---|
5015 | NTSTATUS *result)
|
---|
5016 | {
|
---|
5017 | struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
|
---|
5018 | req, struct rpccli_samr_GetMembersInAlias_state);
|
---|
5019 | NTSTATUS status;
|
---|
5020 |
|
---|
5021 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5022 | tevent_req_received(req);
|
---|
5023 | return status;
|
---|
5024 | }
|
---|
5025 |
|
---|
5026 | /* Steal possbile out parameters to the callers context */
|
---|
5027 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5028 |
|
---|
5029 | /* Return result */
|
---|
5030 | *result = state->orig.out.result;
|
---|
5031 |
|
---|
5032 | tevent_req_received(req);
|
---|
5033 | return NT_STATUS_OK;
|
---|
5034 | }
|
---|
5035 |
|
---|
5036 | NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli,
|
---|
5037 | TALLOC_CTX *mem_ctx,
|
---|
5038 | struct policy_handle *alias_handle /* [in] [ref] */,
|
---|
5039 | struct lsa_SidArray *sids /* [out] [ref] */)
|
---|
5040 | {
|
---|
5041 | struct samr_GetMembersInAlias r;
|
---|
5042 | NTSTATUS status;
|
---|
5043 |
|
---|
5044 | /* In parameters */
|
---|
5045 | r.in.alias_handle = alias_handle;
|
---|
5046 |
|
---|
5047 | status = cli->dispatch(cli,
|
---|
5048 | mem_ctx,
|
---|
5049 | &ndr_table_samr,
|
---|
5050 | NDR_SAMR_GETMEMBERSINALIAS,
|
---|
5051 | &r);
|
---|
5052 |
|
---|
5053 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5054 | return status;
|
---|
5055 | }
|
---|
5056 |
|
---|
5057 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5058 | return status;
|
---|
5059 | }
|
---|
5060 |
|
---|
5061 | /* Return variables */
|
---|
5062 | *sids = *r.out.sids;
|
---|
5063 |
|
---|
5064 | /* Return result */
|
---|
5065 | return r.out.result;
|
---|
5066 | }
|
---|
5067 |
|
---|
5068 | struct rpccli_samr_OpenUser_state {
|
---|
5069 | struct samr_OpenUser orig;
|
---|
5070 | struct samr_OpenUser tmp;
|
---|
5071 | TALLOC_CTX *out_mem_ctx;
|
---|
5072 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5073 | };
|
---|
5074 |
|
---|
5075 | static void rpccli_samr_OpenUser_done(struct tevent_req *subreq);
|
---|
5076 |
|
---|
5077 | struct tevent_req *rpccli_samr_OpenUser_send(TALLOC_CTX *mem_ctx,
|
---|
5078 | struct tevent_context *ev,
|
---|
5079 | struct rpc_pipe_client *cli,
|
---|
5080 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
5081 | uint32_t _access_mask /* [in] */,
|
---|
5082 | uint32_t _rid /* [in] */,
|
---|
5083 | struct policy_handle *_user_handle /* [out] [ref] */)
|
---|
5084 | {
|
---|
5085 | struct tevent_req *req;
|
---|
5086 | struct rpccli_samr_OpenUser_state *state;
|
---|
5087 | struct tevent_req *subreq;
|
---|
5088 |
|
---|
5089 | req = tevent_req_create(mem_ctx, &state,
|
---|
5090 | struct rpccli_samr_OpenUser_state);
|
---|
5091 | if (req == NULL) {
|
---|
5092 | return NULL;
|
---|
5093 | }
|
---|
5094 | state->out_mem_ctx = NULL;
|
---|
5095 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5096 |
|
---|
5097 | /* In parameters */
|
---|
5098 | state->orig.in.domain_handle = _domain_handle;
|
---|
5099 | state->orig.in.access_mask = _access_mask;
|
---|
5100 | state->orig.in.rid = _rid;
|
---|
5101 |
|
---|
5102 | /* Out parameters */
|
---|
5103 | state->orig.out.user_handle = _user_handle;
|
---|
5104 |
|
---|
5105 | /* Result */
|
---|
5106 | ZERO_STRUCT(state->orig.out.result);
|
---|
5107 |
|
---|
5108 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
5109 | "rpccli_samr_OpenUser_out_memory");
|
---|
5110 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
5111 | return tevent_req_post(req, ev);
|
---|
5112 | }
|
---|
5113 |
|
---|
5114 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5115 | state->tmp = state->orig;
|
---|
5116 |
|
---|
5117 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5118 | &ndr_table_samr,
|
---|
5119 | NDR_SAMR_OPENUSER,
|
---|
5120 | &state->tmp);
|
---|
5121 | if (tevent_req_nomem(subreq, req)) {
|
---|
5122 | return tevent_req_post(req, ev);
|
---|
5123 | }
|
---|
5124 | tevent_req_set_callback(subreq, rpccli_samr_OpenUser_done, req);
|
---|
5125 | return req;
|
---|
5126 | }
|
---|
5127 |
|
---|
5128 | static void rpccli_samr_OpenUser_done(struct tevent_req *subreq)
|
---|
5129 | {
|
---|
5130 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5131 | subreq, struct tevent_req);
|
---|
5132 | struct rpccli_samr_OpenUser_state *state = tevent_req_data(
|
---|
5133 | req, struct rpccli_samr_OpenUser_state);
|
---|
5134 | NTSTATUS status;
|
---|
5135 | TALLOC_CTX *mem_ctx;
|
---|
5136 |
|
---|
5137 | if (state->out_mem_ctx) {
|
---|
5138 | mem_ctx = state->out_mem_ctx;
|
---|
5139 | } else {
|
---|
5140 | mem_ctx = state;
|
---|
5141 | }
|
---|
5142 |
|
---|
5143 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5144 | TALLOC_FREE(subreq);
|
---|
5145 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5146 | tevent_req_nterror(req, status);
|
---|
5147 | return;
|
---|
5148 | }
|
---|
5149 |
|
---|
5150 | /* Copy out parameters */
|
---|
5151 | *state->orig.out.user_handle = *state->tmp.out.user_handle;
|
---|
5152 |
|
---|
5153 | /* Copy result */
|
---|
5154 | state->orig.out.result = state->tmp.out.result;
|
---|
5155 |
|
---|
5156 | /* Reset temporary structure */
|
---|
5157 | ZERO_STRUCT(state->tmp);
|
---|
5158 |
|
---|
5159 | tevent_req_done(req);
|
---|
5160 | }
|
---|
5161 |
|
---|
5162 | NTSTATUS rpccli_samr_OpenUser_recv(struct tevent_req *req,
|
---|
5163 | TALLOC_CTX *mem_ctx,
|
---|
5164 | NTSTATUS *result)
|
---|
5165 | {
|
---|
5166 | struct rpccli_samr_OpenUser_state *state = tevent_req_data(
|
---|
5167 | req, struct rpccli_samr_OpenUser_state);
|
---|
5168 | NTSTATUS status;
|
---|
5169 |
|
---|
5170 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5171 | tevent_req_received(req);
|
---|
5172 | return status;
|
---|
5173 | }
|
---|
5174 |
|
---|
5175 | /* Steal possbile out parameters to the callers context */
|
---|
5176 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5177 |
|
---|
5178 | /* Return result */
|
---|
5179 | *result = state->orig.out.result;
|
---|
5180 |
|
---|
5181 | tevent_req_received(req);
|
---|
5182 | return NT_STATUS_OK;
|
---|
5183 | }
|
---|
5184 |
|
---|
5185 | NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
|
---|
5186 | TALLOC_CTX *mem_ctx,
|
---|
5187 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
5188 | uint32_t access_mask /* [in] */,
|
---|
5189 | uint32_t rid /* [in] */,
|
---|
5190 | struct policy_handle *user_handle /* [out] [ref] */)
|
---|
5191 | {
|
---|
5192 | struct samr_OpenUser r;
|
---|
5193 | NTSTATUS status;
|
---|
5194 |
|
---|
5195 | /* In parameters */
|
---|
5196 | r.in.domain_handle = domain_handle;
|
---|
5197 | r.in.access_mask = access_mask;
|
---|
5198 | r.in.rid = rid;
|
---|
5199 |
|
---|
5200 | status = cli->dispatch(cli,
|
---|
5201 | mem_ctx,
|
---|
5202 | &ndr_table_samr,
|
---|
5203 | NDR_SAMR_OPENUSER,
|
---|
5204 | &r);
|
---|
5205 |
|
---|
5206 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5207 | return status;
|
---|
5208 | }
|
---|
5209 |
|
---|
5210 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5211 | return status;
|
---|
5212 | }
|
---|
5213 |
|
---|
5214 | /* Return variables */
|
---|
5215 | *user_handle = *r.out.user_handle;
|
---|
5216 |
|
---|
5217 | /* Return result */
|
---|
5218 | return r.out.result;
|
---|
5219 | }
|
---|
5220 |
|
---|
5221 | struct rpccli_samr_DeleteUser_state {
|
---|
5222 | struct samr_DeleteUser orig;
|
---|
5223 | struct samr_DeleteUser tmp;
|
---|
5224 | TALLOC_CTX *out_mem_ctx;
|
---|
5225 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5226 | };
|
---|
5227 |
|
---|
5228 | static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq);
|
---|
5229 |
|
---|
5230 | struct tevent_req *rpccli_samr_DeleteUser_send(TALLOC_CTX *mem_ctx,
|
---|
5231 | struct tevent_context *ev,
|
---|
5232 | struct rpc_pipe_client *cli,
|
---|
5233 | struct policy_handle *_user_handle /* [in,out] [ref] */)
|
---|
5234 | {
|
---|
5235 | struct tevent_req *req;
|
---|
5236 | struct rpccli_samr_DeleteUser_state *state;
|
---|
5237 | struct tevent_req *subreq;
|
---|
5238 |
|
---|
5239 | req = tevent_req_create(mem_ctx, &state,
|
---|
5240 | struct rpccli_samr_DeleteUser_state);
|
---|
5241 | if (req == NULL) {
|
---|
5242 | return NULL;
|
---|
5243 | }
|
---|
5244 | state->out_mem_ctx = NULL;
|
---|
5245 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5246 |
|
---|
5247 | /* In parameters */
|
---|
5248 | state->orig.in.user_handle = _user_handle;
|
---|
5249 |
|
---|
5250 | /* Out parameters */
|
---|
5251 | state->orig.out.user_handle = _user_handle;
|
---|
5252 |
|
---|
5253 | /* Result */
|
---|
5254 | ZERO_STRUCT(state->orig.out.result);
|
---|
5255 |
|
---|
5256 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
5257 | "rpccli_samr_DeleteUser_out_memory");
|
---|
5258 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
5259 | return tevent_req_post(req, ev);
|
---|
5260 | }
|
---|
5261 |
|
---|
5262 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5263 | state->tmp = state->orig;
|
---|
5264 |
|
---|
5265 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5266 | &ndr_table_samr,
|
---|
5267 | NDR_SAMR_DELETEUSER,
|
---|
5268 | &state->tmp);
|
---|
5269 | if (tevent_req_nomem(subreq, req)) {
|
---|
5270 | return tevent_req_post(req, ev);
|
---|
5271 | }
|
---|
5272 | tevent_req_set_callback(subreq, rpccli_samr_DeleteUser_done, req);
|
---|
5273 | return req;
|
---|
5274 | }
|
---|
5275 |
|
---|
5276 | static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq)
|
---|
5277 | {
|
---|
5278 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5279 | subreq, struct tevent_req);
|
---|
5280 | struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
|
---|
5281 | req, struct rpccli_samr_DeleteUser_state);
|
---|
5282 | NTSTATUS status;
|
---|
5283 | TALLOC_CTX *mem_ctx;
|
---|
5284 |
|
---|
5285 | if (state->out_mem_ctx) {
|
---|
5286 | mem_ctx = state->out_mem_ctx;
|
---|
5287 | } else {
|
---|
5288 | mem_ctx = state;
|
---|
5289 | }
|
---|
5290 |
|
---|
5291 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5292 | TALLOC_FREE(subreq);
|
---|
5293 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5294 | tevent_req_nterror(req, status);
|
---|
5295 | return;
|
---|
5296 | }
|
---|
5297 |
|
---|
5298 | /* Copy out parameters */
|
---|
5299 | *state->orig.out.user_handle = *state->tmp.out.user_handle;
|
---|
5300 |
|
---|
5301 | /* Copy result */
|
---|
5302 | state->orig.out.result = state->tmp.out.result;
|
---|
5303 |
|
---|
5304 | /* Reset temporary structure */
|
---|
5305 | ZERO_STRUCT(state->tmp);
|
---|
5306 |
|
---|
5307 | tevent_req_done(req);
|
---|
5308 | }
|
---|
5309 |
|
---|
5310 | NTSTATUS rpccli_samr_DeleteUser_recv(struct tevent_req *req,
|
---|
5311 | TALLOC_CTX *mem_ctx,
|
---|
5312 | NTSTATUS *result)
|
---|
5313 | {
|
---|
5314 | struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
|
---|
5315 | req, struct rpccli_samr_DeleteUser_state);
|
---|
5316 | NTSTATUS status;
|
---|
5317 |
|
---|
5318 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5319 | tevent_req_received(req);
|
---|
5320 | return status;
|
---|
5321 | }
|
---|
5322 |
|
---|
5323 | /* Steal possbile out parameters to the callers context */
|
---|
5324 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5325 |
|
---|
5326 | /* Return result */
|
---|
5327 | *result = state->orig.out.result;
|
---|
5328 |
|
---|
5329 | tevent_req_received(req);
|
---|
5330 | return NT_STATUS_OK;
|
---|
5331 | }
|
---|
5332 |
|
---|
5333 | NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli,
|
---|
5334 | TALLOC_CTX *mem_ctx,
|
---|
5335 | struct policy_handle *user_handle /* [in,out] [ref] */)
|
---|
5336 | {
|
---|
5337 | struct samr_DeleteUser r;
|
---|
5338 | NTSTATUS status;
|
---|
5339 |
|
---|
5340 | /* In parameters */
|
---|
5341 | r.in.user_handle = user_handle;
|
---|
5342 |
|
---|
5343 | status = cli->dispatch(cli,
|
---|
5344 | mem_ctx,
|
---|
5345 | &ndr_table_samr,
|
---|
5346 | NDR_SAMR_DELETEUSER,
|
---|
5347 | &r);
|
---|
5348 |
|
---|
5349 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5350 | return status;
|
---|
5351 | }
|
---|
5352 |
|
---|
5353 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5354 | return status;
|
---|
5355 | }
|
---|
5356 |
|
---|
5357 | /* Return variables */
|
---|
5358 | *user_handle = *r.out.user_handle;
|
---|
5359 |
|
---|
5360 | /* Return result */
|
---|
5361 | return r.out.result;
|
---|
5362 | }
|
---|
5363 |
|
---|
5364 | struct rpccli_samr_QueryUserInfo_state {
|
---|
5365 | struct samr_QueryUserInfo orig;
|
---|
5366 | struct samr_QueryUserInfo tmp;
|
---|
5367 | TALLOC_CTX *out_mem_ctx;
|
---|
5368 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5369 | };
|
---|
5370 |
|
---|
5371 | static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq);
|
---|
5372 |
|
---|
5373 | struct tevent_req *rpccli_samr_QueryUserInfo_send(TALLOC_CTX *mem_ctx,
|
---|
5374 | struct tevent_context *ev,
|
---|
5375 | struct rpc_pipe_client *cli,
|
---|
5376 | struct policy_handle *_user_handle /* [in] [ref] */,
|
---|
5377 | enum samr_UserInfoLevel _level /* [in] */,
|
---|
5378 | union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
|
---|
5379 | {
|
---|
5380 | struct tevent_req *req;
|
---|
5381 | struct rpccli_samr_QueryUserInfo_state *state;
|
---|
5382 | struct tevent_req *subreq;
|
---|
5383 |
|
---|
5384 | req = tevent_req_create(mem_ctx, &state,
|
---|
5385 | struct rpccli_samr_QueryUserInfo_state);
|
---|
5386 | if (req == NULL) {
|
---|
5387 | return NULL;
|
---|
5388 | }
|
---|
5389 | state->out_mem_ctx = NULL;
|
---|
5390 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5391 |
|
---|
5392 | /* In parameters */
|
---|
5393 | state->orig.in.user_handle = _user_handle;
|
---|
5394 | state->orig.in.level = _level;
|
---|
5395 |
|
---|
5396 | /* Out parameters */
|
---|
5397 | state->orig.out.info = _info;
|
---|
5398 |
|
---|
5399 | /* Result */
|
---|
5400 | ZERO_STRUCT(state->orig.out.result);
|
---|
5401 |
|
---|
5402 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
5403 | "rpccli_samr_QueryUserInfo_out_memory");
|
---|
5404 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
5405 | return tevent_req_post(req, ev);
|
---|
5406 | }
|
---|
5407 |
|
---|
5408 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5409 | state->tmp = state->orig;
|
---|
5410 |
|
---|
5411 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5412 | &ndr_table_samr,
|
---|
5413 | NDR_SAMR_QUERYUSERINFO,
|
---|
5414 | &state->tmp);
|
---|
5415 | if (tevent_req_nomem(subreq, req)) {
|
---|
5416 | return tevent_req_post(req, ev);
|
---|
5417 | }
|
---|
5418 | tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo_done, req);
|
---|
5419 | return req;
|
---|
5420 | }
|
---|
5421 |
|
---|
5422 | static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq)
|
---|
5423 | {
|
---|
5424 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5425 | subreq, struct tevent_req);
|
---|
5426 | struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
|
---|
5427 | req, struct rpccli_samr_QueryUserInfo_state);
|
---|
5428 | NTSTATUS status;
|
---|
5429 | TALLOC_CTX *mem_ctx;
|
---|
5430 |
|
---|
5431 | if (state->out_mem_ctx) {
|
---|
5432 | mem_ctx = state->out_mem_ctx;
|
---|
5433 | } else {
|
---|
5434 | mem_ctx = state;
|
---|
5435 | }
|
---|
5436 |
|
---|
5437 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5438 | TALLOC_FREE(subreq);
|
---|
5439 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5440 | tevent_req_nterror(req, status);
|
---|
5441 | return;
|
---|
5442 | }
|
---|
5443 |
|
---|
5444 | /* Copy out parameters */
|
---|
5445 | *state->orig.out.info = *state->tmp.out.info;
|
---|
5446 |
|
---|
5447 | /* Copy result */
|
---|
5448 | state->orig.out.result = state->tmp.out.result;
|
---|
5449 |
|
---|
5450 | /* Reset temporary structure */
|
---|
5451 | ZERO_STRUCT(state->tmp);
|
---|
5452 |
|
---|
5453 | tevent_req_done(req);
|
---|
5454 | }
|
---|
5455 |
|
---|
5456 | NTSTATUS rpccli_samr_QueryUserInfo_recv(struct tevent_req *req,
|
---|
5457 | TALLOC_CTX *mem_ctx,
|
---|
5458 | NTSTATUS *result)
|
---|
5459 | {
|
---|
5460 | struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
|
---|
5461 | req, struct rpccli_samr_QueryUserInfo_state);
|
---|
5462 | NTSTATUS status;
|
---|
5463 |
|
---|
5464 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5465 | tevent_req_received(req);
|
---|
5466 | return status;
|
---|
5467 | }
|
---|
5468 |
|
---|
5469 | /* Steal possbile out parameters to the callers context */
|
---|
5470 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5471 |
|
---|
5472 | /* Return result */
|
---|
5473 | *result = state->orig.out.result;
|
---|
5474 |
|
---|
5475 | tevent_req_received(req);
|
---|
5476 | return NT_STATUS_OK;
|
---|
5477 | }
|
---|
5478 |
|
---|
5479 | NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
|
---|
5480 | TALLOC_CTX *mem_ctx,
|
---|
5481 | struct policy_handle *user_handle /* [in] [ref] */,
|
---|
5482 | enum samr_UserInfoLevel level /* [in] */,
|
---|
5483 | union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
|
---|
5484 | {
|
---|
5485 | struct samr_QueryUserInfo r;
|
---|
5486 | NTSTATUS status;
|
---|
5487 |
|
---|
5488 | /* In parameters */
|
---|
5489 | r.in.user_handle = user_handle;
|
---|
5490 | r.in.level = level;
|
---|
5491 |
|
---|
5492 | status = cli->dispatch(cli,
|
---|
5493 | mem_ctx,
|
---|
5494 | &ndr_table_samr,
|
---|
5495 | NDR_SAMR_QUERYUSERINFO,
|
---|
5496 | &r);
|
---|
5497 |
|
---|
5498 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5499 | return status;
|
---|
5500 | }
|
---|
5501 |
|
---|
5502 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5503 | return status;
|
---|
5504 | }
|
---|
5505 |
|
---|
5506 | /* Return variables */
|
---|
5507 | *info = *r.out.info;
|
---|
5508 |
|
---|
5509 | /* Return result */
|
---|
5510 | return r.out.result;
|
---|
5511 | }
|
---|
5512 |
|
---|
5513 | struct rpccli_samr_SetUserInfo_state {
|
---|
5514 | struct samr_SetUserInfo orig;
|
---|
5515 | struct samr_SetUserInfo tmp;
|
---|
5516 | TALLOC_CTX *out_mem_ctx;
|
---|
5517 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5518 | };
|
---|
5519 |
|
---|
5520 | static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq);
|
---|
5521 |
|
---|
5522 | struct tevent_req *rpccli_samr_SetUserInfo_send(TALLOC_CTX *mem_ctx,
|
---|
5523 | struct tevent_context *ev,
|
---|
5524 | struct rpc_pipe_client *cli,
|
---|
5525 | struct policy_handle *_user_handle /* [in] [ref] */,
|
---|
5526 | enum samr_UserInfoLevel _level /* [in] */,
|
---|
5527 | union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
|
---|
5528 | {
|
---|
5529 | struct tevent_req *req;
|
---|
5530 | struct rpccli_samr_SetUserInfo_state *state;
|
---|
5531 | struct tevent_req *subreq;
|
---|
5532 |
|
---|
5533 | req = tevent_req_create(mem_ctx, &state,
|
---|
5534 | struct rpccli_samr_SetUserInfo_state);
|
---|
5535 | if (req == NULL) {
|
---|
5536 | return NULL;
|
---|
5537 | }
|
---|
5538 | state->out_mem_ctx = NULL;
|
---|
5539 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5540 |
|
---|
5541 | /* In parameters */
|
---|
5542 | state->orig.in.user_handle = _user_handle;
|
---|
5543 | state->orig.in.level = _level;
|
---|
5544 | state->orig.in.info = _info;
|
---|
5545 |
|
---|
5546 | /* Out parameters */
|
---|
5547 |
|
---|
5548 | /* Result */
|
---|
5549 | ZERO_STRUCT(state->orig.out.result);
|
---|
5550 |
|
---|
5551 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5552 | state->tmp = state->orig;
|
---|
5553 |
|
---|
5554 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5555 | &ndr_table_samr,
|
---|
5556 | NDR_SAMR_SETUSERINFO,
|
---|
5557 | &state->tmp);
|
---|
5558 | if (tevent_req_nomem(subreq, req)) {
|
---|
5559 | return tevent_req_post(req, ev);
|
---|
5560 | }
|
---|
5561 | tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo_done, req);
|
---|
5562 | return req;
|
---|
5563 | }
|
---|
5564 |
|
---|
5565 | static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq)
|
---|
5566 | {
|
---|
5567 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5568 | subreq, struct tevent_req);
|
---|
5569 | struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
|
---|
5570 | req, struct rpccli_samr_SetUserInfo_state);
|
---|
5571 | NTSTATUS status;
|
---|
5572 | TALLOC_CTX *mem_ctx;
|
---|
5573 |
|
---|
5574 | if (state->out_mem_ctx) {
|
---|
5575 | mem_ctx = state->out_mem_ctx;
|
---|
5576 | } else {
|
---|
5577 | mem_ctx = state;
|
---|
5578 | }
|
---|
5579 |
|
---|
5580 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5581 | TALLOC_FREE(subreq);
|
---|
5582 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5583 | tevent_req_nterror(req, status);
|
---|
5584 | return;
|
---|
5585 | }
|
---|
5586 |
|
---|
5587 | /* Copy out parameters */
|
---|
5588 |
|
---|
5589 | /* Copy result */
|
---|
5590 | state->orig.out.result = state->tmp.out.result;
|
---|
5591 |
|
---|
5592 | /* Reset temporary structure */
|
---|
5593 | ZERO_STRUCT(state->tmp);
|
---|
5594 |
|
---|
5595 | tevent_req_done(req);
|
---|
5596 | }
|
---|
5597 |
|
---|
5598 | NTSTATUS rpccli_samr_SetUserInfo_recv(struct tevent_req *req,
|
---|
5599 | TALLOC_CTX *mem_ctx,
|
---|
5600 | NTSTATUS *result)
|
---|
5601 | {
|
---|
5602 | struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
|
---|
5603 | req, struct rpccli_samr_SetUserInfo_state);
|
---|
5604 | NTSTATUS status;
|
---|
5605 |
|
---|
5606 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5607 | tevent_req_received(req);
|
---|
5608 | return status;
|
---|
5609 | }
|
---|
5610 |
|
---|
5611 | /* Steal possbile out parameters to the callers context */
|
---|
5612 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5613 |
|
---|
5614 | /* Return result */
|
---|
5615 | *result = state->orig.out.result;
|
---|
5616 |
|
---|
5617 | tevent_req_received(req);
|
---|
5618 | return NT_STATUS_OK;
|
---|
5619 | }
|
---|
5620 |
|
---|
5621 | NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli,
|
---|
5622 | TALLOC_CTX *mem_ctx,
|
---|
5623 | struct policy_handle *user_handle /* [in] [ref] */,
|
---|
5624 | enum samr_UserInfoLevel level /* [in] */,
|
---|
5625 | union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
|
---|
5626 | {
|
---|
5627 | struct samr_SetUserInfo r;
|
---|
5628 | NTSTATUS status;
|
---|
5629 |
|
---|
5630 | /* In parameters */
|
---|
5631 | r.in.user_handle = user_handle;
|
---|
5632 | r.in.level = level;
|
---|
5633 | r.in.info = info;
|
---|
5634 |
|
---|
5635 | status = cli->dispatch(cli,
|
---|
5636 | mem_ctx,
|
---|
5637 | &ndr_table_samr,
|
---|
5638 | NDR_SAMR_SETUSERINFO,
|
---|
5639 | &r);
|
---|
5640 |
|
---|
5641 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5642 | return status;
|
---|
5643 | }
|
---|
5644 |
|
---|
5645 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5646 | return status;
|
---|
5647 | }
|
---|
5648 |
|
---|
5649 | /* Return variables */
|
---|
5650 |
|
---|
5651 | /* Return result */
|
---|
5652 | return r.out.result;
|
---|
5653 | }
|
---|
5654 |
|
---|
5655 | struct rpccli_samr_ChangePasswordUser_state {
|
---|
5656 | struct samr_ChangePasswordUser orig;
|
---|
5657 | struct samr_ChangePasswordUser tmp;
|
---|
5658 | TALLOC_CTX *out_mem_ctx;
|
---|
5659 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5660 | };
|
---|
5661 |
|
---|
5662 | static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq);
|
---|
5663 |
|
---|
5664 | struct tevent_req *rpccli_samr_ChangePasswordUser_send(TALLOC_CTX *mem_ctx,
|
---|
5665 | struct tevent_context *ev,
|
---|
5666 | struct rpc_pipe_client *cli,
|
---|
5667 | struct policy_handle *_user_handle /* [in] [ref] */,
|
---|
5668 | uint8_t _lm_present /* [in] */,
|
---|
5669 | struct samr_Password *_old_lm_crypted /* [in] [unique] */,
|
---|
5670 | struct samr_Password *_new_lm_crypted /* [in] [unique] */,
|
---|
5671 | uint8_t _nt_present /* [in] */,
|
---|
5672 | struct samr_Password *_old_nt_crypted /* [in] [unique] */,
|
---|
5673 | struct samr_Password *_new_nt_crypted /* [in] [unique] */,
|
---|
5674 | uint8_t _cross1_present /* [in] */,
|
---|
5675 | struct samr_Password *_nt_cross /* [in] [unique] */,
|
---|
5676 | uint8_t _cross2_present /* [in] */,
|
---|
5677 | struct samr_Password *_lm_cross /* [in] [unique] */)
|
---|
5678 | {
|
---|
5679 | struct tevent_req *req;
|
---|
5680 | struct rpccli_samr_ChangePasswordUser_state *state;
|
---|
5681 | struct tevent_req *subreq;
|
---|
5682 |
|
---|
5683 | req = tevent_req_create(mem_ctx, &state,
|
---|
5684 | struct rpccli_samr_ChangePasswordUser_state);
|
---|
5685 | if (req == NULL) {
|
---|
5686 | return NULL;
|
---|
5687 | }
|
---|
5688 | state->out_mem_ctx = NULL;
|
---|
5689 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5690 |
|
---|
5691 | /* In parameters */
|
---|
5692 | state->orig.in.user_handle = _user_handle;
|
---|
5693 | state->orig.in.lm_present = _lm_present;
|
---|
5694 | state->orig.in.old_lm_crypted = _old_lm_crypted;
|
---|
5695 | state->orig.in.new_lm_crypted = _new_lm_crypted;
|
---|
5696 | state->orig.in.nt_present = _nt_present;
|
---|
5697 | state->orig.in.old_nt_crypted = _old_nt_crypted;
|
---|
5698 | state->orig.in.new_nt_crypted = _new_nt_crypted;
|
---|
5699 | state->orig.in.cross1_present = _cross1_present;
|
---|
5700 | state->orig.in.nt_cross = _nt_cross;
|
---|
5701 | state->orig.in.cross2_present = _cross2_present;
|
---|
5702 | state->orig.in.lm_cross = _lm_cross;
|
---|
5703 |
|
---|
5704 | /* Out parameters */
|
---|
5705 |
|
---|
5706 | /* Result */
|
---|
5707 | ZERO_STRUCT(state->orig.out.result);
|
---|
5708 |
|
---|
5709 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5710 | state->tmp = state->orig;
|
---|
5711 |
|
---|
5712 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5713 | &ndr_table_samr,
|
---|
5714 | NDR_SAMR_CHANGEPASSWORDUSER,
|
---|
5715 | &state->tmp);
|
---|
5716 | if (tevent_req_nomem(subreq, req)) {
|
---|
5717 | return tevent_req_post(req, ev);
|
---|
5718 | }
|
---|
5719 | tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser_done, req);
|
---|
5720 | return req;
|
---|
5721 | }
|
---|
5722 |
|
---|
5723 | static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq)
|
---|
5724 | {
|
---|
5725 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5726 | subreq, struct tevent_req);
|
---|
5727 | struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
|
---|
5728 | req, struct rpccli_samr_ChangePasswordUser_state);
|
---|
5729 | NTSTATUS status;
|
---|
5730 | TALLOC_CTX *mem_ctx;
|
---|
5731 |
|
---|
5732 | if (state->out_mem_ctx) {
|
---|
5733 | mem_ctx = state->out_mem_ctx;
|
---|
5734 | } else {
|
---|
5735 | mem_ctx = state;
|
---|
5736 | }
|
---|
5737 |
|
---|
5738 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5739 | TALLOC_FREE(subreq);
|
---|
5740 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5741 | tevent_req_nterror(req, status);
|
---|
5742 | return;
|
---|
5743 | }
|
---|
5744 |
|
---|
5745 | /* Copy out parameters */
|
---|
5746 |
|
---|
5747 | /* Copy result */
|
---|
5748 | state->orig.out.result = state->tmp.out.result;
|
---|
5749 |
|
---|
5750 | /* Reset temporary structure */
|
---|
5751 | ZERO_STRUCT(state->tmp);
|
---|
5752 |
|
---|
5753 | tevent_req_done(req);
|
---|
5754 | }
|
---|
5755 |
|
---|
5756 | NTSTATUS rpccli_samr_ChangePasswordUser_recv(struct tevent_req *req,
|
---|
5757 | TALLOC_CTX *mem_ctx,
|
---|
5758 | NTSTATUS *result)
|
---|
5759 | {
|
---|
5760 | struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
|
---|
5761 | req, struct rpccli_samr_ChangePasswordUser_state);
|
---|
5762 | NTSTATUS status;
|
---|
5763 |
|
---|
5764 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5765 | tevent_req_received(req);
|
---|
5766 | return status;
|
---|
5767 | }
|
---|
5768 |
|
---|
5769 | /* Steal possbile out parameters to the callers context */
|
---|
5770 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5771 |
|
---|
5772 | /* Return result */
|
---|
5773 | *result = state->orig.out.result;
|
---|
5774 |
|
---|
5775 | tevent_req_received(req);
|
---|
5776 | return NT_STATUS_OK;
|
---|
5777 | }
|
---|
5778 |
|
---|
5779 | NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
|
---|
5780 | TALLOC_CTX *mem_ctx,
|
---|
5781 | struct policy_handle *user_handle /* [in] [ref] */,
|
---|
5782 | uint8_t lm_present /* [in] */,
|
---|
5783 | struct samr_Password *old_lm_crypted /* [in] [unique] */,
|
---|
5784 | struct samr_Password *new_lm_crypted /* [in] [unique] */,
|
---|
5785 | uint8_t nt_present /* [in] */,
|
---|
5786 | struct samr_Password *old_nt_crypted /* [in] [unique] */,
|
---|
5787 | struct samr_Password *new_nt_crypted /* [in] [unique] */,
|
---|
5788 | uint8_t cross1_present /* [in] */,
|
---|
5789 | struct samr_Password *nt_cross /* [in] [unique] */,
|
---|
5790 | uint8_t cross2_present /* [in] */,
|
---|
5791 | struct samr_Password *lm_cross /* [in] [unique] */)
|
---|
5792 | {
|
---|
5793 | struct samr_ChangePasswordUser r;
|
---|
5794 | NTSTATUS status;
|
---|
5795 |
|
---|
5796 | /* In parameters */
|
---|
5797 | r.in.user_handle = user_handle;
|
---|
5798 | r.in.lm_present = lm_present;
|
---|
5799 | r.in.old_lm_crypted = old_lm_crypted;
|
---|
5800 | r.in.new_lm_crypted = new_lm_crypted;
|
---|
5801 | r.in.nt_present = nt_present;
|
---|
5802 | r.in.old_nt_crypted = old_nt_crypted;
|
---|
5803 | r.in.new_nt_crypted = new_nt_crypted;
|
---|
5804 | r.in.cross1_present = cross1_present;
|
---|
5805 | r.in.nt_cross = nt_cross;
|
---|
5806 | r.in.cross2_present = cross2_present;
|
---|
5807 | r.in.lm_cross = lm_cross;
|
---|
5808 |
|
---|
5809 | status = cli->dispatch(cli,
|
---|
5810 | mem_ctx,
|
---|
5811 | &ndr_table_samr,
|
---|
5812 | NDR_SAMR_CHANGEPASSWORDUSER,
|
---|
5813 | &r);
|
---|
5814 |
|
---|
5815 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5816 | return status;
|
---|
5817 | }
|
---|
5818 |
|
---|
5819 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5820 | return status;
|
---|
5821 | }
|
---|
5822 |
|
---|
5823 | /* Return variables */
|
---|
5824 |
|
---|
5825 | /* Return result */
|
---|
5826 | return r.out.result;
|
---|
5827 | }
|
---|
5828 |
|
---|
5829 | struct rpccli_samr_GetGroupsForUser_state {
|
---|
5830 | struct samr_GetGroupsForUser orig;
|
---|
5831 | struct samr_GetGroupsForUser tmp;
|
---|
5832 | TALLOC_CTX *out_mem_ctx;
|
---|
5833 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5834 | };
|
---|
5835 |
|
---|
5836 | static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq);
|
---|
5837 |
|
---|
5838 | struct tevent_req *rpccli_samr_GetGroupsForUser_send(TALLOC_CTX *mem_ctx,
|
---|
5839 | struct tevent_context *ev,
|
---|
5840 | struct rpc_pipe_client *cli,
|
---|
5841 | struct policy_handle *_user_handle /* [in] [ref] */,
|
---|
5842 | struct samr_RidWithAttributeArray **_rids /* [out] [ref] */)
|
---|
5843 | {
|
---|
5844 | struct tevent_req *req;
|
---|
5845 | struct rpccli_samr_GetGroupsForUser_state *state;
|
---|
5846 | struct tevent_req *subreq;
|
---|
5847 |
|
---|
5848 | req = tevent_req_create(mem_ctx, &state,
|
---|
5849 | struct rpccli_samr_GetGroupsForUser_state);
|
---|
5850 | if (req == NULL) {
|
---|
5851 | return NULL;
|
---|
5852 | }
|
---|
5853 | state->out_mem_ctx = NULL;
|
---|
5854 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5855 |
|
---|
5856 | /* In parameters */
|
---|
5857 | state->orig.in.user_handle = _user_handle;
|
---|
5858 |
|
---|
5859 | /* Out parameters */
|
---|
5860 | state->orig.out.rids = _rids;
|
---|
5861 |
|
---|
5862 | /* Result */
|
---|
5863 | ZERO_STRUCT(state->orig.out.result);
|
---|
5864 |
|
---|
5865 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
5866 | "rpccli_samr_GetGroupsForUser_out_memory");
|
---|
5867 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
5868 | return tevent_req_post(req, ev);
|
---|
5869 | }
|
---|
5870 |
|
---|
5871 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5872 | state->tmp = state->orig;
|
---|
5873 |
|
---|
5874 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5875 | &ndr_table_samr,
|
---|
5876 | NDR_SAMR_GETGROUPSFORUSER,
|
---|
5877 | &state->tmp);
|
---|
5878 | if (tevent_req_nomem(subreq, req)) {
|
---|
5879 | return tevent_req_post(req, ev);
|
---|
5880 | }
|
---|
5881 | tevent_req_set_callback(subreq, rpccli_samr_GetGroupsForUser_done, req);
|
---|
5882 | return req;
|
---|
5883 | }
|
---|
5884 |
|
---|
5885 | static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq)
|
---|
5886 | {
|
---|
5887 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5888 | subreq, struct tevent_req);
|
---|
5889 | struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
|
---|
5890 | req, struct rpccli_samr_GetGroupsForUser_state);
|
---|
5891 | NTSTATUS status;
|
---|
5892 | TALLOC_CTX *mem_ctx;
|
---|
5893 |
|
---|
5894 | if (state->out_mem_ctx) {
|
---|
5895 | mem_ctx = state->out_mem_ctx;
|
---|
5896 | } else {
|
---|
5897 | mem_ctx = state;
|
---|
5898 | }
|
---|
5899 |
|
---|
5900 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5901 | TALLOC_FREE(subreq);
|
---|
5902 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5903 | tevent_req_nterror(req, status);
|
---|
5904 | return;
|
---|
5905 | }
|
---|
5906 |
|
---|
5907 | /* Copy out parameters */
|
---|
5908 | *state->orig.out.rids = *state->tmp.out.rids;
|
---|
5909 |
|
---|
5910 | /* Copy result */
|
---|
5911 | state->orig.out.result = state->tmp.out.result;
|
---|
5912 |
|
---|
5913 | /* Reset temporary structure */
|
---|
5914 | ZERO_STRUCT(state->tmp);
|
---|
5915 |
|
---|
5916 | tevent_req_done(req);
|
---|
5917 | }
|
---|
5918 |
|
---|
5919 | NTSTATUS rpccli_samr_GetGroupsForUser_recv(struct tevent_req *req,
|
---|
5920 | TALLOC_CTX *mem_ctx,
|
---|
5921 | NTSTATUS *result)
|
---|
5922 | {
|
---|
5923 | struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
|
---|
5924 | req, struct rpccli_samr_GetGroupsForUser_state);
|
---|
5925 | NTSTATUS status;
|
---|
5926 |
|
---|
5927 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5928 | tevent_req_received(req);
|
---|
5929 | return status;
|
---|
5930 | }
|
---|
5931 |
|
---|
5932 | /* Steal possbile out parameters to the callers context */
|
---|
5933 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5934 |
|
---|
5935 | /* Return result */
|
---|
5936 | *result = state->orig.out.result;
|
---|
5937 |
|
---|
5938 | tevent_req_received(req);
|
---|
5939 | return NT_STATUS_OK;
|
---|
5940 | }
|
---|
5941 |
|
---|
5942 | NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
|
---|
5943 | TALLOC_CTX *mem_ctx,
|
---|
5944 | struct policy_handle *user_handle /* [in] [ref] */,
|
---|
5945 | struct samr_RidWithAttributeArray **rids /* [out] [ref] */)
|
---|
5946 | {
|
---|
5947 | struct samr_GetGroupsForUser r;
|
---|
5948 | NTSTATUS status;
|
---|
5949 |
|
---|
5950 | /* In parameters */
|
---|
5951 | r.in.user_handle = user_handle;
|
---|
5952 |
|
---|
5953 | status = cli->dispatch(cli,
|
---|
5954 | mem_ctx,
|
---|
5955 | &ndr_table_samr,
|
---|
5956 | NDR_SAMR_GETGROUPSFORUSER,
|
---|
5957 | &r);
|
---|
5958 |
|
---|
5959 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5960 | return status;
|
---|
5961 | }
|
---|
5962 |
|
---|
5963 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5964 | return status;
|
---|
5965 | }
|
---|
5966 |
|
---|
5967 | /* Return variables */
|
---|
5968 | *rids = *r.out.rids;
|
---|
5969 |
|
---|
5970 | /* Return result */
|
---|
5971 | return r.out.result;
|
---|
5972 | }
|
---|
5973 |
|
---|
5974 | struct rpccli_samr_QueryDisplayInfo_state {
|
---|
5975 | struct samr_QueryDisplayInfo orig;
|
---|
5976 | struct samr_QueryDisplayInfo tmp;
|
---|
5977 | TALLOC_CTX *out_mem_ctx;
|
---|
5978 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5979 | };
|
---|
5980 |
|
---|
5981 | static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq);
|
---|
5982 |
|
---|
5983 | struct tevent_req *rpccli_samr_QueryDisplayInfo_send(TALLOC_CTX *mem_ctx,
|
---|
5984 | struct tevent_context *ev,
|
---|
5985 | struct rpc_pipe_client *cli,
|
---|
5986 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
5987 | uint16_t _level /* [in] */,
|
---|
5988 | uint32_t _start_idx /* [in] */,
|
---|
5989 | uint32_t _max_entries /* [in] */,
|
---|
5990 | uint32_t _buf_size /* [in] */,
|
---|
5991 | uint32_t *_total_size /* [out] [ref] */,
|
---|
5992 | uint32_t *_returned_size /* [out] [ref] */,
|
---|
5993 | union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
|
---|
5994 | {
|
---|
5995 | struct tevent_req *req;
|
---|
5996 | struct rpccli_samr_QueryDisplayInfo_state *state;
|
---|
5997 | struct tevent_req *subreq;
|
---|
5998 |
|
---|
5999 | req = tevent_req_create(mem_ctx, &state,
|
---|
6000 | struct rpccli_samr_QueryDisplayInfo_state);
|
---|
6001 | if (req == NULL) {
|
---|
6002 | return NULL;
|
---|
6003 | }
|
---|
6004 | state->out_mem_ctx = NULL;
|
---|
6005 | state->dispatch_recv = cli->dispatch_recv;
|
---|
6006 |
|
---|
6007 | /* In parameters */
|
---|
6008 | state->orig.in.domain_handle = _domain_handle;
|
---|
6009 | state->orig.in.level = _level;
|
---|
6010 | state->orig.in.start_idx = _start_idx;
|
---|
6011 | state->orig.in.max_entries = _max_entries;
|
---|
6012 | state->orig.in.buf_size = _buf_size;
|
---|
6013 |
|
---|
6014 | /* Out parameters */
|
---|
6015 | state->orig.out.total_size = _total_size;
|
---|
6016 | state->orig.out.returned_size = _returned_size;
|
---|
6017 | state->orig.out.info = _info;
|
---|
6018 |
|
---|
6019 | /* Result */
|
---|
6020 | ZERO_STRUCT(state->orig.out.result);
|
---|
6021 |
|
---|
6022 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
6023 | "rpccli_samr_QueryDisplayInfo_out_memory");
|
---|
6024 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
6025 | return tevent_req_post(req, ev);
|
---|
6026 | }
|
---|
6027 |
|
---|
6028 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
6029 | state->tmp = state->orig;
|
---|
6030 |
|
---|
6031 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
6032 | &ndr_table_samr,
|
---|
6033 | NDR_SAMR_QUERYDISPLAYINFO,
|
---|
6034 | &state->tmp);
|
---|
6035 | if (tevent_req_nomem(subreq, req)) {
|
---|
6036 | return tevent_req_post(req, ev);
|
---|
6037 | }
|
---|
6038 | tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo_done, req);
|
---|
6039 | return req;
|
---|
6040 | }
|
---|
6041 |
|
---|
6042 | static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq)
|
---|
6043 | {
|
---|
6044 | struct tevent_req *req = tevent_req_callback_data(
|
---|
6045 | subreq, struct tevent_req);
|
---|
6046 | struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
|
---|
6047 | req, struct rpccli_samr_QueryDisplayInfo_state);
|
---|
6048 | NTSTATUS status;
|
---|
6049 | TALLOC_CTX *mem_ctx;
|
---|
6050 |
|
---|
6051 | if (state->out_mem_ctx) {
|
---|
6052 | mem_ctx = state->out_mem_ctx;
|
---|
6053 | } else {
|
---|
6054 | mem_ctx = state;
|
---|
6055 | }
|
---|
6056 |
|
---|
6057 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
6058 | TALLOC_FREE(subreq);
|
---|
6059 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6060 | tevent_req_nterror(req, status);
|
---|
6061 | return;
|
---|
6062 | }
|
---|
6063 |
|
---|
6064 | /* Copy out parameters */
|
---|
6065 | *state->orig.out.total_size = *state->tmp.out.total_size;
|
---|
6066 | *state->orig.out.returned_size = *state->tmp.out.returned_size;
|
---|
6067 | *state->orig.out.info = *state->tmp.out.info;
|
---|
6068 |
|
---|
6069 | /* Copy result */
|
---|
6070 | state->orig.out.result = state->tmp.out.result;
|
---|
6071 |
|
---|
6072 | /* Reset temporary structure */
|
---|
6073 | ZERO_STRUCT(state->tmp);
|
---|
6074 |
|
---|
6075 | tevent_req_done(req);
|
---|
6076 | }
|
---|
6077 |
|
---|
6078 | NTSTATUS rpccli_samr_QueryDisplayInfo_recv(struct tevent_req *req,
|
---|
6079 | TALLOC_CTX *mem_ctx,
|
---|
6080 | NTSTATUS *result)
|
---|
6081 | {
|
---|
6082 | struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
|
---|
6083 | req, struct rpccli_samr_QueryDisplayInfo_state);
|
---|
6084 | NTSTATUS status;
|
---|
6085 |
|
---|
6086 | if (tevent_req_is_nterror(req, &status)) {
|
---|
6087 | tevent_req_received(req);
|
---|
6088 | return status;
|
---|
6089 | }
|
---|
6090 |
|
---|
6091 | /* Steal possbile out parameters to the callers context */
|
---|
6092 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
6093 |
|
---|
6094 | /* Return result */
|
---|
6095 | *result = state->orig.out.result;
|
---|
6096 |
|
---|
6097 | tevent_req_received(req);
|
---|
6098 | return NT_STATUS_OK;
|
---|
6099 | }
|
---|
6100 |
|
---|
6101 | NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
|
---|
6102 | TALLOC_CTX *mem_ctx,
|
---|
6103 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
6104 | uint16_t level /* [in] */,
|
---|
6105 | uint32_t start_idx /* [in] */,
|
---|
6106 | uint32_t max_entries /* [in] */,
|
---|
6107 | uint32_t buf_size /* [in] */,
|
---|
6108 | uint32_t *total_size /* [out] [ref] */,
|
---|
6109 | uint32_t *returned_size /* [out] [ref] */,
|
---|
6110 | union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
|
---|
6111 | {
|
---|
6112 | struct samr_QueryDisplayInfo r;
|
---|
6113 | NTSTATUS status;
|
---|
6114 |
|
---|
6115 | /* In parameters */
|
---|
6116 | r.in.domain_handle = domain_handle;
|
---|
6117 | r.in.level = level;
|
---|
6118 | r.in.start_idx = start_idx;
|
---|
6119 | r.in.max_entries = max_entries;
|
---|
6120 | r.in.buf_size = buf_size;
|
---|
6121 |
|
---|
6122 | status = cli->dispatch(cli,
|
---|
6123 | mem_ctx,
|
---|
6124 | &ndr_table_samr,
|
---|
6125 | NDR_SAMR_QUERYDISPLAYINFO,
|
---|
6126 | &r);
|
---|
6127 |
|
---|
6128 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6129 | return status;
|
---|
6130 | }
|
---|
6131 |
|
---|
6132 | if (NT_STATUS_IS_ERR(status)) {
|
---|
6133 | return status;
|
---|
6134 | }
|
---|
6135 |
|
---|
6136 | /* Return variables */
|
---|
6137 | *total_size = *r.out.total_size;
|
---|
6138 | *returned_size = *r.out.returned_size;
|
---|
6139 | *info = *r.out.info;
|
---|
6140 |
|
---|
6141 | /* Return result */
|
---|
6142 | return r.out.result;
|
---|
6143 | }
|
---|
6144 |
|
---|
6145 | struct rpccli_samr_GetDisplayEnumerationIndex_state {
|
---|
6146 | struct samr_GetDisplayEnumerationIndex orig;
|
---|
6147 | struct samr_GetDisplayEnumerationIndex tmp;
|
---|
6148 | TALLOC_CTX *out_mem_ctx;
|
---|
6149 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
6150 | };
|
---|
6151 |
|
---|
6152 | static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq);
|
---|
6153 |
|
---|
6154 | struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex_send(TALLOC_CTX *mem_ctx,
|
---|
6155 | struct tevent_context *ev,
|
---|
6156 | struct rpc_pipe_client *cli,
|
---|
6157 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
6158 | uint16_t _level /* [in] */,
|
---|
6159 | struct lsa_String *_name /* [in] [ref] */,
|
---|
6160 | uint32_t *_idx /* [out] [ref] */)
|
---|
6161 | {
|
---|
6162 | struct tevent_req *req;
|
---|
6163 | struct rpccli_samr_GetDisplayEnumerationIndex_state *state;
|
---|
6164 | struct tevent_req *subreq;
|
---|
6165 |
|
---|
6166 | req = tevent_req_create(mem_ctx, &state,
|
---|
6167 | struct rpccli_samr_GetDisplayEnumerationIndex_state);
|
---|
6168 | if (req == NULL) {
|
---|
6169 | return NULL;
|
---|
6170 | }
|
---|
6171 | state->out_mem_ctx = NULL;
|
---|
6172 | state->dispatch_recv = cli->dispatch_recv;
|
---|
6173 |
|
---|
6174 | /* In parameters */
|
---|
6175 | state->orig.in.domain_handle = _domain_handle;
|
---|
6176 | state->orig.in.level = _level;
|
---|
6177 | state->orig.in.name = _name;
|
---|
6178 |
|
---|
6179 | /* Out parameters */
|
---|
6180 | state->orig.out.idx = _idx;
|
---|
6181 |
|
---|
6182 | /* Result */
|
---|
6183 | ZERO_STRUCT(state->orig.out.result);
|
---|
6184 |
|
---|
6185 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
6186 | "rpccli_samr_GetDisplayEnumerationIndex_out_memory");
|
---|
6187 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
6188 | return tevent_req_post(req, ev);
|
---|
6189 | }
|
---|
6190 |
|
---|
6191 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
6192 | state->tmp = state->orig;
|
---|
6193 |
|
---|
6194 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
6195 | &ndr_table_samr,
|
---|
6196 | NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
|
---|
6197 | &state->tmp);
|
---|
6198 | if (tevent_req_nomem(subreq, req)) {
|
---|
6199 | return tevent_req_post(req, ev);
|
---|
6200 | }
|
---|
6201 | tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex_done, req);
|
---|
6202 | return req;
|
---|
6203 | }
|
---|
6204 |
|
---|
6205 | static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq)
|
---|
6206 | {
|
---|
6207 | struct tevent_req *req = tevent_req_callback_data(
|
---|
6208 | subreq, struct tevent_req);
|
---|
6209 | struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
|
---|
6210 | req, struct rpccli_samr_GetDisplayEnumerationIndex_state);
|
---|
6211 | NTSTATUS status;
|
---|
6212 | TALLOC_CTX *mem_ctx;
|
---|
6213 |
|
---|
6214 | if (state->out_mem_ctx) {
|
---|
6215 | mem_ctx = state->out_mem_ctx;
|
---|
6216 | } else {
|
---|
6217 | mem_ctx = state;
|
---|
6218 | }
|
---|
6219 |
|
---|
6220 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
6221 | TALLOC_FREE(subreq);
|
---|
6222 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6223 | tevent_req_nterror(req, status);
|
---|
6224 | return;
|
---|
6225 | }
|
---|
6226 |
|
---|
6227 | /* Copy out parameters */
|
---|
6228 | *state->orig.out.idx = *state->tmp.out.idx;
|
---|
6229 |
|
---|
6230 | /* Copy result */
|
---|
6231 | state->orig.out.result = state->tmp.out.result;
|
---|
6232 |
|
---|
6233 | /* Reset temporary structure */
|
---|
6234 | ZERO_STRUCT(state->tmp);
|
---|
6235 |
|
---|
6236 | tevent_req_done(req);
|
---|
6237 | }
|
---|
6238 |
|
---|
6239 | NTSTATUS rpccli_samr_GetDisplayEnumerationIndex_recv(struct tevent_req *req,
|
---|
6240 | TALLOC_CTX *mem_ctx,
|
---|
6241 | NTSTATUS *result)
|
---|
6242 | {
|
---|
6243 | struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
|
---|
6244 | req, struct rpccli_samr_GetDisplayEnumerationIndex_state);
|
---|
6245 | NTSTATUS status;
|
---|
6246 |
|
---|
6247 | if (tevent_req_is_nterror(req, &status)) {
|
---|
6248 | tevent_req_received(req);
|
---|
6249 | return status;
|
---|
6250 | }
|
---|
6251 |
|
---|
6252 | /* Steal possbile out parameters to the callers context */
|
---|
6253 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
6254 |
|
---|
6255 | /* Return result */
|
---|
6256 | *result = state->orig.out.result;
|
---|
6257 |
|
---|
6258 | tevent_req_received(req);
|
---|
6259 | return NT_STATUS_OK;
|
---|
6260 | }
|
---|
6261 |
|
---|
6262 | NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
|
---|
6263 | TALLOC_CTX *mem_ctx,
|
---|
6264 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
6265 | uint16_t level /* [in] */,
|
---|
6266 | struct lsa_String *name /* [in] [ref] */,
|
---|
6267 | uint32_t *idx /* [out] [ref] */)
|
---|
6268 | {
|
---|
6269 | struct samr_GetDisplayEnumerationIndex r;
|
---|
6270 | NTSTATUS status;
|
---|
6271 |
|
---|
6272 | /* In parameters */
|
---|
6273 | r.in.domain_handle = domain_handle;
|
---|
6274 | r.in.level = level;
|
---|
6275 | r.in.name = name;
|
---|
6276 |
|
---|
6277 | status = cli->dispatch(cli,
|
---|
6278 | mem_ctx,
|
---|
6279 | &ndr_table_samr,
|
---|
6280 | NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
|
---|
6281 | &r);
|
---|
6282 |
|
---|
6283 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6284 | return status;
|
---|
6285 | }
|
---|
6286 |
|
---|
6287 | if (NT_STATUS_IS_ERR(status)) {
|
---|
6288 | return status;
|
---|
6289 | }
|
---|
6290 |
|
---|
6291 | /* Return variables */
|
---|
6292 | *idx = *r.out.idx;
|
---|
6293 |
|
---|
6294 | /* Return result */
|
---|
6295 | return r.out.result;
|
---|
6296 | }
|
---|
6297 |
|
---|
6298 | struct rpccli_samr_TestPrivateFunctionsDomain_state {
|
---|
6299 | struct samr_TestPrivateFunctionsDomain orig;
|
---|
6300 | struct samr_TestPrivateFunctionsDomain tmp;
|
---|
6301 | TALLOC_CTX *out_mem_ctx;
|
---|
6302 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
6303 | };
|
---|
6304 |
|
---|
6305 | static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq);
|
---|
6306 |
|
---|
6307 | struct tevent_req *rpccli_samr_TestPrivateFunctionsDomain_send(TALLOC_CTX *mem_ctx,
|
---|
6308 | struct tevent_context *ev,
|
---|
6309 | struct rpc_pipe_client *cli,
|
---|
6310 | struct policy_handle *_domain_handle /* [in] [ref] */)
|
---|
6311 | {
|
---|
6312 | struct tevent_req *req;
|
---|
6313 | struct rpccli_samr_TestPrivateFunctionsDomain_state *state;
|
---|
6314 | struct tevent_req *subreq;
|
---|
6315 |
|
---|
6316 | req = tevent_req_create(mem_ctx, &state,
|
---|
6317 | struct rpccli_samr_TestPrivateFunctionsDomain_state);
|
---|
6318 | if (req == NULL) {
|
---|
6319 | return NULL;
|
---|
6320 | }
|
---|
6321 | state->out_mem_ctx = NULL;
|
---|
6322 | state->dispatch_recv = cli->dispatch_recv;
|
---|
6323 |
|
---|
6324 | /* In parameters */
|
---|
6325 | state->orig.in.domain_handle = _domain_handle;
|
---|
6326 |
|
---|
6327 | /* Out parameters */
|
---|
6328 |
|
---|
6329 | /* Result */
|
---|
6330 | ZERO_STRUCT(state->orig.out.result);
|
---|
6331 |
|
---|
6332 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
6333 | state->tmp = state->orig;
|
---|
6334 |
|
---|
6335 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
6336 | &ndr_table_samr,
|
---|
6337 | NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
|
---|
6338 | &state->tmp);
|
---|
6339 | if (tevent_req_nomem(subreq, req)) {
|
---|
6340 | return tevent_req_post(req, ev);
|
---|
6341 | }
|
---|
6342 | tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsDomain_done, req);
|
---|
6343 | return req;
|
---|
6344 | }
|
---|
6345 |
|
---|
6346 | static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq)
|
---|
6347 | {
|
---|
6348 | struct tevent_req *req = tevent_req_callback_data(
|
---|
6349 | subreq, struct tevent_req);
|
---|
6350 | struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
|
---|
6351 | req, struct rpccli_samr_TestPrivateFunctionsDomain_state);
|
---|
6352 | NTSTATUS status;
|
---|
6353 | TALLOC_CTX *mem_ctx;
|
---|
6354 |
|
---|
6355 | if (state->out_mem_ctx) {
|
---|
6356 | mem_ctx = state->out_mem_ctx;
|
---|
6357 | } else {
|
---|
6358 | mem_ctx = state;
|
---|
6359 | }
|
---|
6360 |
|
---|
6361 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
6362 | TALLOC_FREE(subreq);
|
---|
6363 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6364 | tevent_req_nterror(req, status);
|
---|
6365 | return;
|
---|
6366 | }
|
---|
6367 |
|
---|
6368 | /* Copy out parameters */
|
---|
6369 |
|
---|
6370 | /* Copy result */
|
---|
6371 | state->orig.out.result = state->tmp.out.result;
|
---|
6372 |
|
---|
6373 | /* Reset temporary structure */
|
---|
6374 | ZERO_STRUCT(state->tmp);
|
---|
6375 |
|
---|
6376 | tevent_req_done(req);
|
---|
6377 | }
|
---|
6378 |
|
---|
6379 | NTSTATUS rpccli_samr_TestPrivateFunctionsDomain_recv(struct tevent_req *req,
|
---|
6380 | TALLOC_CTX *mem_ctx,
|
---|
6381 | NTSTATUS *result)
|
---|
6382 | {
|
---|
6383 | struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
|
---|
6384 | req, struct rpccli_samr_TestPrivateFunctionsDomain_state);
|
---|
6385 | NTSTATUS status;
|
---|
6386 |
|
---|
6387 | if (tevent_req_is_nterror(req, &status)) {
|
---|
6388 | tevent_req_received(req);
|
---|
6389 | return status;
|
---|
6390 | }
|
---|
6391 |
|
---|
6392 | /* Steal possbile out parameters to the callers context */
|
---|
6393 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
6394 |
|
---|
6395 | /* Return result */
|
---|
6396 | *result = state->orig.out.result;
|
---|
6397 |
|
---|
6398 | tevent_req_received(req);
|
---|
6399 | return NT_STATUS_OK;
|
---|
6400 | }
|
---|
6401 |
|
---|
6402 | NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli,
|
---|
6403 | TALLOC_CTX *mem_ctx,
|
---|
6404 | struct policy_handle *domain_handle /* [in] [ref] */)
|
---|
6405 | {
|
---|
6406 | struct samr_TestPrivateFunctionsDomain r;
|
---|
6407 | NTSTATUS status;
|
---|
6408 |
|
---|
6409 | /* In parameters */
|
---|
6410 | r.in.domain_handle = domain_handle;
|
---|
6411 |
|
---|
6412 | status = cli->dispatch(cli,
|
---|
6413 | mem_ctx,
|
---|
6414 | &ndr_table_samr,
|
---|
6415 | NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
|
---|
6416 | &r);
|
---|
6417 |
|
---|
6418 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6419 | return status;
|
---|
6420 | }
|
---|
6421 |
|
---|
6422 | if (NT_STATUS_IS_ERR(status)) {
|
---|
6423 | return status;
|
---|
6424 | }
|
---|
6425 |
|
---|
6426 | /* Return variables */
|
---|
6427 |
|
---|
6428 | /* Return result */
|
---|
6429 | return r.out.result;
|
---|
6430 | }
|
---|
6431 |
|
---|
6432 | struct rpccli_samr_TestPrivateFunctionsUser_state {
|
---|
6433 | struct samr_TestPrivateFunctionsUser orig;
|
---|
6434 | struct samr_TestPrivateFunctionsUser tmp;
|
---|
6435 | TALLOC_CTX *out_mem_ctx;
|
---|
6436 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
6437 | };
|
---|
6438 |
|
---|
6439 | static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq);
|
---|
6440 |
|
---|
6441 | struct tevent_req *rpccli_samr_TestPrivateFunctionsUser_send(TALLOC_CTX *mem_ctx,
|
---|
6442 | struct tevent_context *ev,
|
---|
6443 | struct rpc_pipe_client *cli,
|
---|
6444 | struct policy_handle *_user_handle /* [in] [ref] */)
|
---|
6445 | {
|
---|
6446 | struct tevent_req *req;
|
---|
6447 | struct rpccli_samr_TestPrivateFunctionsUser_state *state;
|
---|
6448 | struct tevent_req *subreq;
|
---|
6449 |
|
---|
6450 | req = tevent_req_create(mem_ctx, &state,
|
---|
6451 | struct rpccli_samr_TestPrivateFunctionsUser_state);
|
---|
6452 | if (req == NULL) {
|
---|
6453 | return NULL;
|
---|
6454 | }
|
---|
6455 | state->out_mem_ctx = NULL;
|
---|
6456 | state->dispatch_recv = cli->dispatch_recv;
|
---|
6457 |
|
---|
6458 | /* In parameters */
|
---|
6459 | state->orig.in.user_handle = _user_handle;
|
---|
6460 |
|
---|
6461 | /* Out parameters */
|
---|
6462 |
|
---|
6463 | /* Result */
|
---|
6464 | ZERO_STRUCT(state->orig.out.result);
|
---|
6465 |
|
---|
6466 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
6467 | state->tmp = state->orig;
|
---|
6468 |
|
---|
6469 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
6470 | &ndr_table_samr,
|
---|
6471 | NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
|
---|
6472 | &state->tmp);
|
---|
6473 | if (tevent_req_nomem(subreq, req)) {
|
---|
6474 | return tevent_req_post(req, ev);
|
---|
6475 | }
|
---|
6476 | tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsUser_done, req);
|
---|
6477 | return req;
|
---|
6478 | }
|
---|
6479 |
|
---|
6480 | static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq)
|
---|
6481 | {
|
---|
6482 | struct tevent_req *req = tevent_req_callback_data(
|
---|
6483 | subreq, struct tevent_req);
|
---|
6484 | struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
|
---|
6485 | req, struct rpccli_samr_TestPrivateFunctionsUser_state);
|
---|
6486 | NTSTATUS status;
|
---|
6487 | TALLOC_CTX *mem_ctx;
|
---|
6488 |
|
---|
6489 | if (state->out_mem_ctx) {
|
---|
6490 | mem_ctx = state->out_mem_ctx;
|
---|
6491 | } else {
|
---|
6492 | mem_ctx = state;
|
---|
6493 | }
|
---|
6494 |
|
---|
6495 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
6496 | TALLOC_FREE(subreq);
|
---|
6497 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6498 | tevent_req_nterror(req, status);
|
---|
6499 | return;
|
---|
6500 | }
|
---|
6501 |
|
---|
6502 | /* Copy out parameters */
|
---|
6503 |
|
---|
6504 | /* Copy result */
|
---|
6505 | state->orig.out.result = state->tmp.out.result;
|
---|
6506 |
|
---|
6507 | /* Reset temporary structure */
|
---|
6508 | ZERO_STRUCT(state->tmp);
|
---|
6509 |
|
---|
6510 | tevent_req_done(req);
|
---|
6511 | }
|
---|
6512 |
|
---|
6513 | NTSTATUS rpccli_samr_TestPrivateFunctionsUser_recv(struct tevent_req *req,
|
---|
6514 | TALLOC_CTX *mem_ctx,
|
---|
6515 | NTSTATUS *result)
|
---|
6516 | {
|
---|
6517 | struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
|
---|
6518 | req, struct rpccli_samr_TestPrivateFunctionsUser_state);
|
---|
6519 | NTSTATUS status;
|
---|
6520 |
|
---|
6521 | if (tevent_req_is_nterror(req, &status)) {
|
---|
6522 | tevent_req_received(req);
|
---|
6523 | return status;
|
---|
6524 | }
|
---|
6525 |
|
---|
6526 | /* Steal possbile out parameters to the callers context */
|
---|
6527 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
6528 |
|
---|
6529 | /* Return result */
|
---|
6530 | *result = state->orig.out.result;
|
---|
6531 |
|
---|
6532 | tevent_req_received(req);
|
---|
6533 | return NT_STATUS_OK;
|
---|
6534 | }
|
---|
6535 |
|
---|
6536 | NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
|
---|
6537 | TALLOC_CTX *mem_ctx,
|
---|
6538 | struct policy_handle *user_handle /* [in] [ref] */)
|
---|
6539 | {
|
---|
6540 | struct samr_TestPrivateFunctionsUser r;
|
---|
6541 | NTSTATUS status;
|
---|
6542 |
|
---|
6543 | /* In parameters */
|
---|
6544 | r.in.user_handle = user_handle;
|
---|
6545 |
|
---|
6546 | status = cli->dispatch(cli,
|
---|
6547 | mem_ctx,
|
---|
6548 | &ndr_table_samr,
|
---|
6549 | NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
|
---|
6550 | &r);
|
---|
6551 |
|
---|
6552 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6553 | return status;
|
---|
6554 | }
|
---|
6555 |
|
---|
6556 | if (NT_STATUS_IS_ERR(status)) {
|
---|
6557 | return status;
|
---|
6558 | }
|
---|
6559 |
|
---|
6560 | /* Return variables */
|
---|
6561 |
|
---|
6562 | /* Return result */
|
---|
6563 | return r.out.result;
|
---|
6564 | }
|
---|
6565 |
|
---|
6566 | struct rpccli_samr_GetUserPwInfo_state {
|
---|
6567 | struct samr_GetUserPwInfo orig;
|
---|
6568 | struct samr_GetUserPwInfo tmp;
|
---|
6569 | TALLOC_CTX *out_mem_ctx;
|
---|
6570 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
6571 | };
|
---|
6572 |
|
---|
6573 | static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq);
|
---|
6574 |
|
---|
6575 | struct tevent_req *rpccli_samr_GetUserPwInfo_send(TALLOC_CTX *mem_ctx,
|
---|
6576 | struct tevent_context *ev,
|
---|
6577 | struct rpc_pipe_client *cli,
|
---|
6578 | struct policy_handle *_user_handle /* [in] [ref] */,
|
---|
6579 | struct samr_PwInfo *_info /* [out] [ref] */)
|
---|
6580 | {
|
---|
6581 | struct tevent_req *req;
|
---|
6582 | struct rpccli_samr_GetUserPwInfo_state *state;
|
---|
6583 | struct tevent_req *subreq;
|
---|
6584 |
|
---|
6585 | req = tevent_req_create(mem_ctx, &state,
|
---|
6586 | struct rpccli_samr_GetUserPwInfo_state);
|
---|
6587 | if (req == NULL) {
|
---|
6588 | return NULL;
|
---|
6589 | }
|
---|
6590 | state->out_mem_ctx = NULL;
|
---|
6591 | state->dispatch_recv = cli->dispatch_recv;
|
---|
6592 |
|
---|
6593 | /* In parameters */
|
---|
6594 | state->orig.in.user_handle = _user_handle;
|
---|
6595 |
|
---|
6596 | /* Out parameters */
|
---|
6597 | state->orig.out.info = _info;
|
---|
6598 |
|
---|
6599 | /* Result */
|
---|
6600 | ZERO_STRUCT(state->orig.out.result);
|
---|
6601 |
|
---|
6602 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
6603 | "rpccli_samr_GetUserPwInfo_out_memory");
|
---|
6604 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
6605 | return tevent_req_post(req, ev);
|
---|
6606 | }
|
---|
6607 |
|
---|
6608 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
6609 | state->tmp = state->orig;
|
---|
6610 |
|
---|
6611 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
6612 | &ndr_table_samr,
|
---|
6613 | NDR_SAMR_GETUSERPWINFO,
|
---|
6614 | &state->tmp);
|
---|
6615 | if (tevent_req_nomem(subreq, req)) {
|
---|
6616 | return tevent_req_post(req, ev);
|
---|
6617 | }
|
---|
6618 | tevent_req_set_callback(subreq, rpccli_samr_GetUserPwInfo_done, req);
|
---|
6619 | return req;
|
---|
6620 | }
|
---|
6621 |
|
---|
6622 | static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq)
|
---|
6623 | {
|
---|
6624 | struct tevent_req *req = tevent_req_callback_data(
|
---|
6625 | subreq, struct tevent_req);
|
---|
6626 | struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
|
---|
6627 | req, struct rpccli_samr_GetUserPwInfo_state);
|
---|
6628 | NTSTATUS status;
|
---|
6629 | TALLOC_CTX *mem_ctx;
|
---|
6630 |
|
---|
6631 | if (state->out_mem_ctx) {
|
---|
6632 | mem_ctx = state->out_mem_ctx;
|
---|
6633 | } else {
|
---|
6634 | mem_ctx = state;
|
---|
6635 | }
|
---|
6636 |
|
---|
6637 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
6638 | TALLOC_FREE(subreq);
|
---|
6639 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6640 | tevent_req_nterror(req, status);
|
---|
6641 | return;
|
---|
6642 | }
|
---|
6643 |
|
---|
6644 | /* Copy out parameters */
|
---|
6645 | *state->orig.out.info = *state->tmp.out.info;
|
---|
6646 |
|
---|
6647 | /* Copy result */
|
---|
6648 | state->orig.out.result = state->tmp.out.result;
|
---|
6649 |
|
---|
6650 | /* Reset temporary structure */
|
---|
6651 | ZERO_STRUCT(state->tmp);
|
---|
6652 |
|
---|
6653 | tevent_req_done(req);
|
---|
6654 | }
|
---|
6655 |
|
---|
6656 | NTSTATUS rpccli_samr_GetUserPwInfo_recv(struct tevent_req *req,
|
---|
6657 | TALLOC_CTX *mem_ctx,
|
---|
6658 | NTSTATUS *result)
|
---|
6659 | {
|
---|
6660 | struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
|
---|
6661 | req, struct rpccli_samr_GetUserPwInfo_state);
|
---|
6662 | NTSTATUS status;
|
---|
6663 |
|
---|
6664 | if (tevent_req_is_nterror(req, &status)) {
|
---|
6665 | tevent_req_received(req);
|
---|
6666 | return status;
|
---|
6667 | }
|
---|
6668 |
|
---|
6669 | /* Steal possbile out parameters to the callers context */
|
---|
6670 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
6671 |
|
---|
6672 | /* Return result */
|
---|
6673 | *result = state->orig.out.result;
|
---|
6674 |
|
---|
6675 | tevent_req_received(req);
|
---|
6676 | return NT_STATUS_OK;
|
---|
6677 | }
|
---|
6678 |
|
---|
6679 | NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli,
|
---|
6680 | TALLOC_CTX *mem_ctx,
|
---|
6681 | struct policy_handle *user_handle /* [in] [ref] */,
|
---|
6682 | struct samr_PwInfo *info /* [out] [ref] */)
|
---|
6683 | {
|
---|
6684 | struct samr_GetUserPwInfo r;
|
---|
6685 | NTSTATUS status;
|
---|
6686 |
|
---|
6687 | /* In parameters */
|
---|
6688 | r.in.user_handle = user_handle;
|
---|
6689 |
|
---|
6690 | status = cli->dispatch(cli,
|
---|
6691 | mem_ctx,
|
---|
6692 | &ndr_table_samr,
|
---|
6693 | NDR_SAMR_GETUSERPWINFO,
|
---|
6694 | &r);
|
---|
6695 |
|
---|
6696 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6697 | return status;
|
---|
6698 | }
|
---|
6699 |
|
---|
6700 | if (NT_STATUS_IS_ERR(status)) {
|
---|
6701 | return status;
|
---|
6702 | }
|
---|
6703 |
|
---|
6704 | /* Return variables */
|
---|
6705 | *info = *r.out.info;
|
---|
6706 |
|
---|
6707 | /* Return result */
|
---|
6708 | return r.out.result;
|
---|
6709 | }
|
---|
6710 |
|
---|
6711 | struct rpccli_samr_RemoveMemberFromForeignDomain_state {
|
---|
6712 | struct samr_RemoveMemberFromForeignDomain orig;
|
---|
6713 | struct samr_RemoveMemberFromForeignDomain tmp;
|
---|
6714 | TALLOC_CTX *out_mem_ctx;
|
---|
6715 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
6716 | };
|
---|
6717 |
|
---|
6718 | static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq);
|
---|
6719 |
|
---|
6720 | struct tevent_req *rpccli_samr_RemoveMemberFromForeignDomain_send(TALLOC_CTX *mem_ctx,
|
---|
6721 | struct tevent_context *ev,
|
---|
6722 | struct rpc_pipe_client *cli,
|
---|
6723 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
6724 | struct dom_sid2 *_sid /* [in] [ref] */)
|
---|
6725 | {
|
---|
6726 | struct tevent_req *req;
|
---|
6727 | struct rpccli_samr_RemoveMemberFromForeignDomain_state *state;
|
---|
6728 | struct tevent_req *subreq;
|
---|
6729 |
|
---|
6730 | req = tevent_req_create(mem_ctx, &state,
|
---|
6731 | struct rpccli_samr_RemoveMemberFromForeignDomain_state);
|
---|
6732 | if (req == NULL) {
|
---|
6733 | return NULL;
|
---|
6734 | }
|
---|
6735 | state->out_mem_ctx = NULL;
|
---|
6736 | state->dispatch_recv = cli->dispatch_recv;
|
---|
6737 |
|
---|
6738 | /* In parameters */
|
---|
6739 | state->orig.in.domain_handle = _domain_handle;
|
---|
6740 | state->orig.in.sid = _sid;
|
---|
6741 |
|
---|
6742 | /* Out parameters */
|
---|
6743 |
|
---|
6744 | /* Result */
|
---|
6745 | ZERO_STRUCT(state->orig.out.result);
|
---|
6746 |
|
---|
6747 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
6748 | state->tmp = state->orig;
|
---|
6749 |
|
---|
6750 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
6751 | &ndr_table_samr,
|
---|
6752 | NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
|
---|
6753 | &state->tmp);
|
---|
6754 | if (tevent_req_nomem(subreq, req)) {
|
---|
6755 | return tevent_req_post(req, ev);
|
---|
6756 | }
|
---|
6757 | tevent_req_set_callback(subreq, rpccli_samr_RemoveMemberFromForeignDomain_done, req);
|
---|
6758 | return req;
|
---|
6759 | }
|
---|
6760 |
|
---|
6761 | static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq)
|
---|
6762 | {
|
---|
6763 | struct tevent_req *req = tevent_req_callback_data(
|
---|
6764 | subreq, struct tevent_req);
|
---|
6765 | struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
|
---|
6766 | req, struct rpccli_samr_RemoveMemberFromForeignDomain_state);
|
---|
6767 | NTSTATUS status;
|
---|
6768 | TALLOC_CTX *mem_ctx;
|
---|
6769 |
|
---|
6770 | if (state->out_mem_ctx) {
|
---|
6771 | mem_ctx = state->out_mem_ctx;
|
---|
6772 | } else {
|
---|
6773 | mem_ctx = state;
|
---|
6774 | }
|
---|
6775 |
|
---|
6776 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
6777 | TALLOC_FREE(subreq);
|
---|
6778 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6779 | tevent_req_nterror(req, status);
|
---|
6780 | return;
|
---|
6781 | }
|
---|
6782 |
|
---|
6783 | /* Copy out parameters */
|
---|
6784 |
|
---|
6785 | /* Copy result */
|
---|
6786 | state->orig.out.result = state->tmp.out.result;
|
---|
6787 |
|
---|
6788 | /* Reset temporary structure */
|
---|
6789 | ZERO_STRUCT(state->tmp);
|
---|
6790 |
|
---|
6791 | tevent_req_done(req);
|
---|
6792 | }
|
---|
6793 |
|
---|
6794 | NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain_recv(struct tevent_req *req,
|
---|
6795 | TALLOC_CTX *mem_ctx,
|
---|
6796 | NTSTATUS *result)
|
---|
6797 | {
|
---|
6798 | struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
|
---|
6799 | req, struct rpccli_samr_RemoveMemberFromForeignDomain_state);
|
---|
6800 | NTSTATUS status;
|
---|
6801 |
|
---|
6802 | if (tevent_req_is_nterror(req, &status)) {
|
---|
6803 | tevent_req_received(req);
|
---|
6804 | return status;
|
---|
6805 | }
|
---|
6806 |
|
---|
6807 | /* Steal possbile out parameters to the callers context */
|
---|
6808 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
6809 |
|
---|
6810 | /* Return result */
|
---|
6811 | *result = state->orig.out.result;
|
---|
6812 |
|
---|
6813 | tevent_req_received(req);
|
---|
6814 | return NT_STATUS_OK;
|
---|
6815 | }
|
---|
6816 |
|
---|
6817 | NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
|
---|
6818 | TALLOC_CTX *mem_ctx,
|
---|
6819 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
6820 | struct dom_sid2 *sid /* [in] [ref] */)
|
---|
6821 | {
|
---|
6822 | struct samr_RemoveMemberFromForeignDomain r;
|
---|
6823 | NTSTATUS status;
|
---|
6824 |
|
---|
6825 | /* In parameters */
|
---|
6826 | r.in.domain_handle = domain_handle;
|
---|
6827 | r.in.sid = sid;
|
---|
6828 |
|
---|
6829 | status = cli->dispatch(cli,
|
---|
6830 | mem_ctx,
|
---|
6831 | &ndr_table_samr,
|
---|
6832 | NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
|
---|
6833 | &r);
|
---|
6834 |
|
---|
6835 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6836 | return status;
|
---|
6837 | }
|
---|
6838 |
|
---|
6839 | if (NT_STATUS_IS_ERR(status)) {
|
---|
6840 | return status;
|
---|
6841 | }
|
---|
6842 |
|
---|
6843 | /* Return variables */
|
---|
6844 |
|
---|
6845 | /* Return result */
|
---|
6846 | return r.out.result;
|
---|
6847 | }
|
---|
6848 |
|
---|
6849 | struct rpccli_samr_QueryDomainInfo2_state {
|
---|
6850 | struct samr_QueryDomainInfo2 orig;
|
---|
6851 | struct samr_QueryDomainInfo2 tmp;
|
---|
6852 | TALLOC_CTX *out_mem_ctx;
|
---|
6853 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
6854 | };
|
---|
6855 |
|
---|
6856 | static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq);
|
---|
6857 |
|
---|
6858 | struct tevent_req *rpccli_samr_QueryDomainInfo2_send(TALLOC_CTX *mem_ctx,
|
---|
6859 | struct tevent_context *ev,
|
---|
6860 | struct rpc_pipe_client *cli,
|
---|
6861 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
6862 | enum samr_DomainInfoClass _level /* [in] */,
|
---|
6863 | union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
|
---|
6864 | {
|
---|
6865 | struct tevent_req *req;
|
---|
6866 | struct rpccli_samr_QueryDomainInfo2_state *state;
|
---|
6867 | struct tevent_req *subreq;
|
---|
6868 |
|
---|
6869 | req = tevent_req_create(mem_ctx, &state,
|
---|
6870 | struct rpccli_samr_QueryDomainInfo2_state);
|
---|
6871 | if (req == NULL) {
|
---|
6872 | return NULL;
|
---|
6873 | }
|
---|
6874 | state->out_mem_ctx = NULL;
|
---|
6875 | state->dispatch_recv = cli->dispatch_recv;
|
---|
6876 |
|
---|
6877 | /* In parameters */
|
---|
6878 | state->orig.in.domain_handle = _domain_handle;
|
---|
6879 | state->orig.in.level = _level;
|
---|
6880 |
|
---|
6881 | /* Out parameters */
|
---|
6882 | state->orig.out.info = _info;
|
---|
6883 |
|
---|
6884 | /* Result */
|
---|
6885 | ZERO_STRUCT(state->orig.out.result);
|
---|
6886 |
|
---|
6887 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
6888 | "rpccli_samr_QueryDomainInfo2_out_memory");
|
---|
6889 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
6890 | return tevent_req_post(req, ev);
|
---|
6891 | }
|
---|
6892 |
|
---|
6893 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
6894 | state->tmp = state->orig;
|
---|
6895 |
|
---|
6896 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
6897 | &ndr_table_samr,
|
---|
6898 | NDR_SAMR_QUERYDOMAININFO2,
|
---|
6899 | &state->tmp);
|
---|
6900 | if (tevent_req_nomem(subreq, req)) {
|
---|
6901 | return tevent_req_post(req, ev);
|
---|
6902 | }
|
---|
6903 | tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo2_done, req);
|
---|
6904 | return req;
|
---|
6905 | }
|
---|
6906 |
|
---|
6907 | static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq)
|
---|
6908 | {
|
---|
6909 | struct tevent_req *req = tevent_req_callback_data(
|
---|
6910 | subreq, struct tevent_req);
|
---|
6911 | struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
|
---|
6912 | req, struct rpccli_samr_QueryDomainInfo2_state);
|
---|
6913 | NTSTATUS status;
|
---|
6914 | TALLOC_CTX *mem_ctx;
|
---|
6915 |
|
---|
6916 | if (state->out_mem_ctx) {
|
---|
6917 | mem_ctx = state->out_mem_ctx;
|
---|
6918 | } else {
|
---|
6919 | mem_ctx = state;
|
---|
6920 | }
|
---|
6921 |
|
---|
6922 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
6923 | TALLOC_FREE(subreq);
|
---|
6924 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6925 | tevent_req_nterror(req, status);
|
---|
6926 | return;
|
---|
6927 | }
|
---|
6928 |
|
---|
6929 | /* Copy out parameters */
|
---|
6930 | *state->orig.out.info = *state->tmp.out.info;
|
---|
6931 |
|
---|
6932 | /* Copy result */
|
---|
6933 | state->orig.out.result = state->tmp.out.result;
|
---|
6934 |
|
---|
6935 | /* Reset temporary structure */
|
---|
6936 | ZERO_STRUCT(state->tmp);
|
---|
6937 |
|
---|
6938 | tevent_req_done(req);
|
---|
6939 | }
|
---|
6940 |
|
---|
6941 | NTSTATUS rpccli_samr_QueryDomainInfo2_recv(struct tevent_req *req,
|
---|
6942 | TALLOC_CTX *mem_ctx,
|
---|
6943 | NTSTATUS *result)
|
---|
6944 | {
|
---|
6945 | struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
|
---|
6946 | req, struct rpccli_samr_QueryDomainInfo2_state);
|
---|
6947 | NTSTATUS status;
|
---|
6948 |
|
---|
6949 | if (tevent_req_is_nterror(req, &status)) {
|
---|
6950 | tevent_req_received(req);
|
---|
6951 | return status;
|
---|
6952 | }
|
---|
6953 |
|
---|
6954 | /* Steal possbile out parameters to the callers context */
|
---|
6955 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
6956 |
|
---|
6957 | /* Return result */
|
---|
6958 | *result = state->orig.out.result;
|
---|
6959 |
|
---|
6960 | tevent_req_received(req);
|
---|
6961 | return NT_STATUS_OK;
|
---|
6962 | }
|
---|
6963 |
|
---|
6964 | NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli,
|
---|
6965 | TALLOC_CTX *mem_ctx,
|
---|
6966 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
6967 | enum samr_DomainInfoClass level /* [in] */,
|
---|
6968 | union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
|
---|
6969 | {
|
---|
6970 | struct samr_QueryDomainInfo2 r;
|
---|
6971 | NTSTATUS status;
|
---|
6972 |
|
---|
6973 | /* In parameters */
|
---|
6974 | r.in.domain_handle = domain_handle;
|
---|
6975 | r.in.level = level;
|
---|
6976 |
|
---|
6977 | status = cli->dispatch(cli,
|
---|
6978 | mem_ctx,
|
---|
6979 | &ndr_table_samr,
|
---|
6980 | NDR_SAMR_QUERYDOMAININFO2,
|
---|
6981 | &r);
|
---|
6982 |
|
---|
6983 | if (!NT_STATUS_IS_OK(status)) {
|
---|
6984 | return status;
|
---|
6985 | }
|
---|
6986 |
|
---|
6987 | if (NT_STATUS_IS_ERR(status)) {
|
---|
6988 | return status;
|
---|
6989 | }
|
---|
6990 |
|
---|
6991 | /* Return variables */
|
---|
6992 | *info = *r.out.info;
|
---|
6993 |
|
---|
6994 | /* Return result */
|
---|
6995 | return r.out.result;
|
---|
6996 | }
|
---|
6997 |
|
---|
6998 | struct rpccli_samr_QueryUserInfo2_state {
|
---|
6999 | struct samr_QueryUserInfo2 orig;
|
---|
7000 | struct samr_QueryUserInfo2 tmp;
|
---|
7001 | TALLOC_CTX *out_mem_ctx;
|
---|
7002 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
7003 | };
|
---|
7004 |
|
---|
7005 | static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq);
|
---|
7006 |
|
---|
7007 | struct tevent_req *rpccli_samr_QueryUserInfo2_send(TALLOC_CTX *mem_ctx,
|
---|
7008 | struct tevent_context *ev,
|
---|
7009 | struct rpc_pipe_client *cli,
|
---|
7010 | struct policy_handle *_user_handle /* [in] [ref] */,
|
---|
7011 | enum samr_UserInfoLevel _level /* [in] */,
|
---|
7012 | union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
|
---|
7013 | {
|
---|
7014 | struct tevent_req *req;
|
---|
7015 | struct rpccli_samr_QueryUserInfo2_state *state;
|
---|
7016 | struct tevent_req *subreq;
|
---|
7017 |
|
---|
7018 | req = tevent_req_create(mem_ctx, &state,
|
---|
7019 | struct rpccli_samr_QueryUserInfo2_state);
|
---|
7020 | if (req == NULL) {
|
---|
7021 | return NULL;
|
---|
7022 | }
|
---|
7023 | state->out_mem_ctx = NULL;
|
---|
7024 | state->dispatch_recv = cli->dispatch_recv;
|
---|
7025 |
|
---|
7026 | /* In parameters */
|
---|
7027 | state->orig.in.user_handle = _user_handle;
|
---|
7028 | state->orig.in.level = _level;
|
---|
7029 |
|
---|
7030 | /* Out parameters */
|
---|
7031 | state->orig.out.info = _info;
|
---|
7032 |
|
---|
7033 | /* Result */
|
---|
7034 | ZERO_STRUCT(state->orig.out.result);
|
---|
7035 |
|
---|
7036 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
7037 | "rpccli_samr_QueryUserInfo2_out_memory");
|
---|
7038 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
7039 | return tevent_req_post(req, ev);
|
---|
7040 | }
|
---|
7041 |
|
---|
7042 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
7043 | state->tmp = state->orig;
|
---|
7044 |
|
---|
7045 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
7046 | &ndr_table_samr,
|
---|
7047 | NDR_SAMR_QUERYUSERINFO2,
|
---|
7048 | &state->tmp);
|
---|
7049 | if (tevent_req_nomem(subreq, req)) {
|
---|
7050 | return tevent_req_post(req, ev);
|
---|
7051 | }
|
---|
7052 | tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo2_done, req);
|
---|
7053 | return req;
|
---|
7054 | }
|
---|
7055 |
|
---|
7056 | static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq)
|
---|
7057 | {
|
---|
7058 | struct tevent_req *req = tevent_req_callback_data(
|
---|
7059 | subreq, struct tevent_req);
|
---|
7060 | struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
|
---|
7061 | req, struct rpccli_samr_QueryUserInfo2_state);
|
---|
7062 | NTSTATUS status;
|
---|
7063 | TALLOC_CTX *mem_ctx;
|
---|
7064 |
|
---|
7065 | if (state->out_mem_ctx) {
|
---|
7066 | mem_ctx = state->out_mem_ctx;
|
---|
7067 | } else {
|
---|
7068 | mem_ctx = state;
|
---|
7069 | }
|
---|
7070 |
|
---|
7071 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
7072 | TALLOC_FREE(subreq);
|
---|
7073 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7074 | tevent_req_nterror(req, status);
|
---|
7075 | return;
|
---|
7076 | }
|
---|
7077 |
|
---|
7078 | /* Copy out parameters */
|
---|
7079 | *state->orig.out.info = *state->tmp.out.info;
|
---|
7080 |
|
---|
7081 | /* Copy result */
|
---|
7082 | state->orig.out.result = state->tmp.out.result;
|
---|
7083 |
|
---|
7084 | /* Reset temporary structure */
|
---|
7085 | ZERO_STRUCT(state->tmp);
|
---|
7086 |
|
---|
7087 | tevent_req_done(req);
|
---|
7088 | }
|
---|
7089 |
|
---|
7090 | NTSTATUS rpccli_samr_QueryUserInfo2_recv(struct tevent_req *req,
|
---|
7091 | TALLOC_CTX *mem_ctx,
|
---|
7092 | NTSTATUS *result)
|
---|
7093 | {
|
---|
7094 | struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
|
---|
7095 | req, struct rpccli_samr_QueryUserInfo2_state);
|
---|
7096 | NTSTATUS status;
|
---|
7097 |
|
---|
7098 | if (tevent_req_is_nterror(req, &status)) {
|
---|
7099 | tevent_req_received(req);
|
---|
7100 | return status;
|
---|
7101 | }
|
---|
7102 |
|
---|
7103 | /* Steal possbile out parameters to the callers context */
|
---|
7104 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
7105 |
|
---|
7106 | /* Return result */
|
---|
7107 | *result = state->orig.out.result;
|
---|
7108 |
|
---|
7109 | tevent_req_received(req);
|
---|
7110 | return NT_STATUS_OK;
|
---|
7111 | }
|
---|
7112 |
|
---|
7113 | NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
|
---|
7114 | TALLOC_CTX *mem_ctx,
|
---|
7115 | struct policy_handle *user_handle /* [in] [ref] */,
|
---|
7116 | enum samr_UserInfoLevel level /* [in] */,
|
---|
7117 | union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
|
---|
7118 | {
|
---|
7119 | struct samr_QueryUserInfo2 r;
|
---|
7120 | NTSTATUS status;
|
---|
7121 |
|
---|
7122 | /* In parameters */
|
---|
7123 | r.in.user_handle = user_handle;
|
---|
7124 | r.in.level = level;
|
---|
7125 |
|
---|
7126 | status = cli->dispatch(cli,
|
---|
7127 | mem_ctx,
|
---|
7128 | &ndr_table_samr,
|
---|
7129 | NDR_SAMR_QUERYUSERINFO2,
|
---|
7130 | &r);
|
---|
7131 |
|
---|
7132 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7133 | return status;
|
---|
7134 | }
|
---|
7135 |
|
---|
7136 | if (NT_STATUS_IS_ERR(status)) {
|
---|
7137 | return status;
|
---|
7138 | }
|
---|
7139 |
|
---|
7140 | /* Return variables */
|
---|
7141 | *info = *r.out.info;
|
---|
7142 |
|
---|
7143 | /* Return result */
|
---|
7144 | return r.out.result;
|
---|
7145 | }
|
---|
7146 |
|
---|
7147 | struct rpccli_samr_QueryDisplayInfo2_state {
|
---|
7148 | struct samr_QueryDisplayInfo2 orig;
|
---|
7149 | struct samr_QueryDisplayInfo2 tmp;
|
---|
7150 | TALLOC_CTX *out_mem_ctx;
|
---|
7151 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
7152 | };
|
---|
7153 |
|
---|
7154 | static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq);
|
---|
7155 |
|
---|
7156 | struct tevent_req *rpccli_samr_QueryDisplayInfo2_send(TALLOC_CTX *mem_ctx,
|
---|
7157 | struct tevent_context *ev,
|
---|
7158 | struct rpc_pipe_client *cli,
|
---|
7159 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
7160 | uint16_t _level /* [in] */,
|
---|
7161 | uint32_t _start_idx /* [in] */,
|
---|
7162 | uint32_t _max_entries /* [in] */,
|
---|
7163 | uint32_t _buf_size /* [in] */,
|
---|
7164 | uint32_t *_total_size /* [out] [ref] */,
|
---|
7165 | uint32_t *_returned_size /* [out] [ref] */,
|
---|
7166 | union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
|
---|
7167 | {
|
---|
7168 | struct tevent_req *req;
|
---|
7169 | struct rpccli_samr_QueryDisplayInfo2_state *state;
|
---|
7170 | struct tevent_req *subreq;
|
---|
7171 |
|
---|
7172 | req = tevent_req_create(mem_ctx, &state,
|
---|
7173 | struct rpccli_samr_QueryDisplayInfo2_state);
|
---|
7174 | if (req == NULL) {
|
---|
7175 | return NULL;
|
---|
7176 | }
|
---|
7177 | state->out_mem_ctx = NULL;
|
---|
7178 | state->dispatch_recv = cli->dispatch_recv;
|
---|
7179 |
|
---|
7180 | /* In parameters */
|
---|
7181 | state->orig.in.domain_handle = _domain_handle;
|
---|
7182 | state->orig.in.level = _level;
|
---|
7183 | state->orig.in.start_idx = _start_idx;
|
---|
7184 | state->orig.in.max_entries = _max_entries;
|
---|
7185 | state->orig.in.buf_size = _buf_size;
|
---|
7186 |
|
---|
7187 | /* Out parameters */
|
---|
7188 | state->orig.out.total_size = _total_size;
|
---|
7189 | state->orig.out.returned_size = _returned_size;
|
---|
7190 | state->orig.out.info = _info;
|
---|
7191 |
|
---|
7192 | /* Result */
|
---|
7193 | ZERO_STRUCT(state->orig.out.result);
|
---|
7194 |
|
---|
7195 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
7196 | "rpccli_samr_QueryDisplayInfo2_out_memory");
|
---|
7197 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
7198 | return tevent_req_post(req, ev);
|
---|
7199 | }
|
---|
7200 |
|
---|
7201 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
7202 | state->tmp = state->orig;
|
---|
7203 |
|
---|
7204 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
7205 | &ndr_table_samr,
|
---|
7206 | NDR_SAMR_QUERYDISPLAYINFO2,
|
---|
7207 | &state->tmp);
|
---|
7208 | if (tevent_req_nomem(subreq, req)) {
|
---|
7209 | return tevent_req_post(req, ev);
|
---|
7210 | }
|
---|
7211 | tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo2_done, req);
|
---|
7212 | return req;
|
---|
7213 | }
|
---|
7214 |
|
---|
7215 | static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq)
|
---|
7216 | {
|
---|
7217 | struct tevent_req *req = tevent_req_callback_data(
|
---|
7218 | subreq, struct tevent_req);
|
---|
7219 | struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
|
---|
7220 | req, struct rpccli_samr_QueryDisplayInfo2_state);
|
---|
7221 | NTSTATUS status;
|
---|
7222 | TALLOC_CTX *mem_ctx;
|
---|
7223 |
|
---|
7224 | if (state->out_mem_ctx) {
|
---|
7225 | mem_ctx = state->out_mem_ctx;
|
---|
7226 | } else {
|
---|
7227 | mem_ctx = state;
|
---|
7228 | }
|
---|
7229 |
|
---|
7230 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
7231 | TALLOC_FREE(subreq);
|
---|
7232 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7233 | tevent_req_nterror(req, status);
|
---|
7234 | return;
|
---|
7235 | }
|
---|
7236 |
|
---|
7237 | /* Copy out parameters */
|
---|
7238 | *state->orig.out.total_size = *state->tmp.out.total_size;
|
---|
7239 | *state->orig.out.returned_size = *state->tmp.out.returned_size;
|
---|
7240 | *state->orig.out.info = *state->tmp.out.info;
|
---|
7241 |
|
---|
7242 | /* Copy result */
|
---|
7243 | state->orig.out.result = state->tmp.out.result;
|
---|
7244 |
|
---|
7245 | /* Reset temporary structure */
|
---|
7246 | ZERO_STRUCT(state->tmp);
|
---|
7247 |
|
---|
7248 | tevent_req_done(req);
|
---|
7249 | }
|
---|
7250 |
|
---|
7251 | NTSTATUS rpccli_samr_QueryDisplayInfo2_recv(struct tevent_req *req,
|
---|
7252 | TALLOC_CTX *mem_ctx,
|
---|
7253 | NTSTATUS *result)
|
---|
7254 | {
|
---|
7255 | struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
|
---|
7256 | req, struct rpccli_samr_QueryDisplayInfo2_state);
|
---|
7257 | NTSTATUS status;
|
---|
7258 |
|
---|
7259 | if (tevent_req_is_nterror(req, &status)) {
|
---|
7260 | tevent_req_received(req);
|
---|
7261 | return status;
|
---|
7262 | }
|
---|
7263 |
|
---|
7264 | /* Steal possbile out parameters to the callers context */
|
---|
7265 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
7266 |
|
---|
7267 | /* Return result */
|
---|
7268 | *result = state->orig.out.result;
|
---|
7269 |
|
---|
7270 | tevent_req_received(req);
|
---|
7271 | return NT_STATUS_OK;
|
---|
7272 | }
|
---|
7273 |
|
---|
7274 | NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
|
---|
7275 | TALLOC_CTX *mem_ctx,
|
---|
7276 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
7277 | uint16_t level /* [in] */,
|
---|
7278 | uint32_t start_idx /* [in] */,
|
---|
7279 | uint32_t max_entries /* [in] */,
|
---|
7280 | uint32_t buf_size /* [in] */,
|
---|
7281 | uint32_t *total_size /* [out] [ref] */,
|
---|
7282 | uint32_t *returned_size /* [out] [ref] */,
|
---|
7283 | union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
|
---|
7284 | {
|
---|
7285 | struct samr_QueryDisplayInfo2 r;
|
---|
7286 | NTSTATUS status;
|
---|
7287 |
|
---|
7288 | /* In parameters */
|
---|
7289 | r.in.domain_handle = domain_handle;
|
---|
7290 | r.in.level = level;
|
---|
7291 | r.in.start_idx = start_idx;
|
---|
7292 | r.in.max_entries = max_entries;
|
---|
7293 | r.in.buf_size = buf_size;
|
---|
7294 |
|
---|
7295 | status = cli->dispatch(cli,
|
---|
7296 | mem_ctx,
|
---|
7297 | &ndr_table_samr,
|
---|
7298 | NDR_SAMR_QUERYDISPLAYINFO2,
|
---|
7299 | &r);
|
---|
7300 |
|
---|
7301 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7302 | return status;
|
---|
7303 | }
|
---|
7304 |
|
---|
7305 | if (NT_STATUS_IS_ERR(status)) {
|
---|
7306 | return status;
|
---|
7307 | }
|
---|
7308 |
|
---|
7309 | /* Return variables */
|
---|
7310 | *total_size = *r.out.total_size;
|
---|
7311 | *returned_size = *r.out.returned_size;
|
---|
7312 | *info = *r.out.info;
|
---|
7313 |
|
---|
7314 | /* Return result */
|
---|
7315 | return r.out.result;
|
---|
7316 | }
|
---|
7317 |
|
---|
7318 | struct rpccli_samr_GetDisplayEnumerationIndex2_state {
|
---|
7319 | struct samr_GetDisplayEnumerationIndex2 orig;
|
---|
7320 | struct samr_GetDisplayEnumerationIndex2 tmp;
|
---|
7321 | TALLOC_CTX *out_mem_ctx;
|
---|
7322 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
7323 | };
|
---|
7324 |
|
---|
7325 | static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq);
|
---|
7326 |
|
---|
7327 | struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex2_send(TALLOC_CTX *mem_ctx,
|
---|
7328 | struct tevent_context *ev,
|
---|
7329 | struct rpc_pipe_client *cli,
|
---|
7330 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
7331 | uint16_t _level /* [in] */,
|
---|
7332 | struct lsa_String *_name /* [in] [ref] */,
|
---|
7333 | uint32_t *_idx /* [out] [ref] */)
|
---|
7334 | {
|
---|
7335 | struct tevent_req *req;
|
---|
7336 | struct rpccli_samr_GetDisplayEnumerationIndex2_state *state;
|
---|
7337 | struct tevent_req *subreq;
|
---|
7338 |
|
---|
7339 | req = tevent_req_create(mem_ctx, &state,
|
---|
7340 | struct rpccli_samr_GetDisplayEnumerationIndex2_state);
|
---|
7341 | if (req == NULL) {
|
---|
7342 | return NULL;
|
---|
7343 | }
|
---|
7344 | state->out_mem_ctx = NULL;
|
---|
7345 | state->dispatch_recv = cli->dispatch_recv;
|
---|
7346 |
|
---|
7347 | /* In parameters */
|
---|
7348 | state->orig.in.domain_handle = _domain_handle;
|
---|
7349 | state->orig.in.level = _level;
|
---|
7350 | state->orig.in.name = _name;
|
---|
7351 |
|
---|
7352 | /* Out parameters */
|
---|
7353 | state->orig.out.idx = _idx;
|
---|
7354 |
|
---|
7355 | /* Result */
|
---|
7356 | ZERO_STRUCT(state->orig.out.result);
|
---|
7357 |
|
---|
7358 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
7359 | "rpccli_samr_GetDisplayEnumerationIndex2_out_memory");
|
---|
7360 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
7361 | return tevent_req_post(req, ev);
|
---|
7362 | }
|
---|
7363 |
|
---|
7364 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
7365 | state->tmp = state->orig;
|
---|
7366 |
|
---|
7367 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
7368 | &ndr_table_samr,
|
---|
7369 | NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
|
---|
7370 | &state->tmp);
|
---|
7371 | if (tevent_req_nomem(subreq, req)) {
|
---|
7372 | return tevent_req_post(req, ev);
|
---|
7373 | }
|
---|
7374 | tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex2_done, req);
|
---|
7375 | return req;
|
---|
7376 | }
|
---|
7377 |
|
---|
7378 | static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq)
|
---|
7379 | {
|
---|
7380 | struct tevent_req *req = tevent_req_callback_data(
|
---|
7381 | subreq, struct tevent_req);
|
---|
7382 | struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
|
---|
7383 | req, struct rpccli_samr_GetDisplayEnumerationIndex2_state);
|
---|
7384 | NTSTATUS status;
|
---|
7385 | TALLOC_CTX *mem_ctx;
|
---|
7386 |
|
---|
7387 | if (state->out_mem_ctx) {
|
---|
7388 | mem_ctx = state->out_mem_ctx;
|
---|
7389 | } else {
|
---|
7390 | mem_ctx = state;
|
---|
7391 | }
|
---|
7392 |
|
---|
7393 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
7394 | TALLOC_FREE(subreq);
|
---|
7395 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7396 | tevent_req_nterror(req, status);
|
---|
7397 | return;
|
---|
7398 | }
|
---|
7399 |
|
---|
7400 | /* Copy out parameters */
|
---|
7401 | *state->orig.out.idx = *state->tmp.out.idx;
|
---|
7402 |
|
---|
7403 | /* Copy result */
|
---|
7404 | state->orig.out.result = state->tmp.out.result;
|
---|
7405 |
|
---|
7406 | /* Reset temporary structure */
|
---|
7407 | ZERO_STRUCT(state->tmp);
|
---|
7408 |
|
---|
7409 | tevent_req_done(req);
|
---|
7410 | }
|
---|
7411 |
|
---|
7412 | NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2_recv(struct tevent_req *req,
|
---|
7413 | TALLOC_CTX *mem_ctx,
|
---|
7414 | NTSTATUS *result)
|
---|
7415 | {
|
---|
7416 | struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
|
---|
7417 | req, struct rpccli_samr_GetDisplayEnumerationIndex2_state);
|
---|
7418 | NTSTATUS status;
|
---|
7419 |
|
---|
7420 | if (tevent_req_is_nterror(req, &status)) {
|
---|
7421 | tevent_req_received(req);
|
---|
7422 | return status;
|
---|
7423 | }
|
---|
7424 |
|
---|
7425 | /* Steal possbile out parameters to the callers context */
|
---|
7426 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
7427 |
|
---|
7428 | /* Return result */
|
---|
7429 | *result = state->orig.out.result;
|
---|
7430 |
|
---|
7431 | tevent_req_received(req);
|
---|
7432 | return NT_STATUS_OK;
|
---|
7433 | }
|
---|
7434 |
|
---|
7435 | NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
|
---|
7436 | TALLOC_CTX *mem_ctx,
|
---|
7437 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
7438 | uint16_t level /* [in] */,
|
---|
7439 | struct lsa_String *name /* [in] [ref] */,
|
---|
7440 | uint32_t *idx /* [out] [ref] */)
|
---|
7441 | {
|
---|
7442 | struct samr_GetDisplayEnumerationIndex2 r;
|
---|
7443 | NTSTATUS status;
|
---|
7444 |
|
---|
7445 | /* In parameters */
|
---|
7446 | r.in.domain_handle = domain_handle;
|
---|
7447 | r.in.level = level;
|
---|
7448 | r.in.name = name;
|
---|
7449 |
|
---|
7450 | status = cli->dispatch(cli,
|
---|
7451 | mem_ctx,
|
---|
7452 | &ndr_table_samr,
|
---|
7453 | NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
|
---|
7454 | &r);
|
---|
7455 |
|
---|
7456 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7457 | return status;
|
---|
7458 | }
|
---|
7459 |
|
---|
7460 | if (NT_STATUS_IS_ERR(status)) {
|
---|
7461 | return status;
|
---|
7462 | }
|
---|
7463 |
|
---|
7464 | /* Return variables */
|
---|
7465 | *idx = *r.out.idx;
|
---|
7466 |
|
---|
7467 | /* Return result */
|
---|
7468 | return r.out.result;
|
---|
7469 | }
|
---|
7470 |
|
---|
7471 | struct rpccli_samr_CreateUser2_state {
|
---|
7472 | struct samr_CreateUser2 orig;
|
---|
7473 | struct samr_CreateUser2 tmp;
|
---|
7474 | TALLOC_CTX *out_mem_ctx;
|
---|
7475 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
7476 | };
|
---|
7477 |
|
---|
7478 | static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq);
|
---|
7479 |
|
---|
7480 | struct tevent_req *rpccli_samr_CreateUser2_send(TALLOC_CTX *mem_ctx,
|
---|
7481 | struct tevent_context *ev,
|
---|
7482 | struct rpc_pipe_client *cli,
|
---|
7483 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
7484 | struct lsa_String *_account_name /* [in] [ref] */,
|
---|
7485 | uint32_t _acct_flags /* [in] */,
|
---|
7486 | uint32_t _access_mask /* [in] */,
|
---|
7487 | struct policy_handle *_user_handle /* [out] [ref] */,
|
---|
7488 | uint32_t *_access_granted /* [out] [ref] */,
|
---|
7489 | uint32_t *_rid /* [out] [ref] */)
|
---|
7490 | {
|
---|
7491 | struct tevent_req *req;
|
---|
7492 | struct rpccli_samr_CreateUser2_state *state;
|
---|
7493 | struct tevent_req *subreq;
|
---|
7494 |
|
---|
7495 | req = tevent_req_create(mem_ctx, &state,
|
---|
7496 | struct rpccli_samr_CreateUser2_state);
|
---|
7497 | if (req == NULL) {
|
---|
7498 | return NULL;
|
---|
7499 | }
|
---|
7500 | state->out_mem_ctx = NULL;
|
---|
7501 | state->dispatch_recv = cli->dispatch_recv;
|
---|
7502 |
|
---|
7503 | /* In parameters */
|
---|
7504 | state->orig.in.domain_handle = _domain_handle;
|
---|
7505 | state->orig.in.account_name = _account_name;
|
---|
7506 | state->orig.in.acct_flags = _acct_flags;
|
---|
7507 | state->orig.in.access_mask = _access_mask;
|
---|
7508 |
|
---|
7509 | /* Out parameters */
|
---|
7510 | state->orig.out.user_handle = _user_handle;
|
---|
7511 | state->orig.out.access_granted = _access_granted;
|
---|
7512 | state->orig.out.rid = _rid;
|
---|
7513 |
|
---|
7514 | /* Result */
|
---|
7515 | ZERO_STRUCT(state->orig.out.result);
|
---|
7516 |
|
---|
7517 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
7518 | "rpccli_samr_CreateUser2_out_memory");
|
---|
7519 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
7520 | return tevent_req_post(req, ev);
|
---|
7521 | }
|
---|
7522 |
|
---|
7523 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
7524 | state->tmp = state->orig;
|
---|
7525 |
|
---|
7526 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
7527 | &ndr_table_samr,
|
---|
7528 | NDR_SAMR_CREATEUSER2,
|
---|
7529 | &state->tmp);
|
---|
7530 | if (tevent_req_nomem(subreq, req)) {
|
---|
7531 | return tevent_req_post(req, ev);
|
---|
7532 | }
|
---|
7533 | tevent_req_set_callback(subreq, rpccli_samr_CreateUser2_done, req);
|
---|
7534 | return req;
|
---|
7535 | }
|
---|
7536 |
|
---|
7537 | static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq)
|
---|
7538 | {
|
---|
7539 | struct tevent_req *req = tevent_req_callback_data(
|
---|
7540 | subreq, struct tevent_req);
|
---|
7541 | struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
|
---|
7542 | req, struct rpccli_samr_CreateUser2_state);
|
---|
7543 | NTSTATUS status;
|
---|
7544 | TALLOC_CTX *mem_ctx;
|
---|
7545 |
|
---|
7546 | if (state->out_mem_ctx) {
|
---|
7547 | mem_ctx = state->out_mem_ctx;
|
---|
7548 | } else {
|
---|
7549 | mem_ctx = state;
|
---|
7550 | }
|
---|
7551 |
|
---|
7552 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
7553 | TALLOC_FREE(subreq);
|
---|
7554 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7555 | tevent_req_nterror(req, status);
|
---|
7556 | return;
|
---|
7557 | }
|
---|
7558 |
|
---|
7559 | /* Copy out parameters */
|
---|
7560 | *state->orig.out.user_handle = *state->tmp.out.user_handle;
|
---|
7561 | *state->orig.out.access_granted = *state->tmp.out.access_granted;
|
---|
7562 | *state->orig.out.rid = *state->tmp.out.rid;
|
---|
7563 |
|
---|
7564 | /* Copy result */
|
---|
7565 | state->orig.out.result = state->tmp.out.result;
|
---|
7566 |
|
---|
7567 | /* Reset temporary structure */
|
---|
7568 | ZERO_STRUCT(state->tmp);
|
---|
7569 |
|
---|
7570 | tevent_req_done(req);
|
---|
7571 | }
|
---|
7572 |
|
---|
7573 | NTSTATUS rpccli_samr_CreateUser2_recv(struct tevent_req *req,
|
---|
7574 | TALLOC_CTX *mem_ctx,
|
---|
7575 | NTSTATUS *result)
|
---|
7576 | {
|
---|
7577 | struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
|
---|
7578 | req, struct rpccli_samr_CreateUser2_state);
|
---|
7579 | NTSTATUS status;
|
---|
7580 |
|
---|
7581 | if (tevent_req_is_nterror(req, &status)) {
|
---|
7582 | tevent_req_received(req);
|
---|
7583 | return status;
|
---|
7584 | }
|
---|
7585 |
|
---|
7586 | /* Steal possbile out parameters to the callers context */
|
---|
7587 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
7588 |
|
---|
7589 | /* Return result */
|
---|
7590 | *result = state->orig.out.result;
|
---|
7591 |
|
---|
7592 | tevent_req_received(req);
|
---|
7593 | return NT_STATUS_OK;
|
---|
7594 | }
|
---|
7595 |
|
---|
7596 | NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli,
|
---|
7597 | TALLOC_CTX *mem_ctx,
|
---|
7598 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
7599 | struct lsa_String *account_name /* [in] [ref] */,
|
---|
7600 | uint32_t acct_flags /* [in] */,
|
---|
7601 | uint32_t access_mask /* [in] */,
|
---|
7602 | struct policy_handle *user_handle /* [out] [ref] */,
|
---|
7603 | uint32_t *access_granted /* [out] [ref] */,
|
---|
7604 | uint32_t *rid /* [out] [ref] */)
|
---|
7605 | {
|
---|
7606 | struct samr_CreateUser2 r;
|
---|
7607 | NTSTATUS status;
|
---|
7608 |
|
---|
7609 | /* In parameters */
|
---|
7610 | r.in.domain_handle = domain_handle;
|
---|
7611 | r.in.account_name = account_name;
|
---|
7612 | r.in.acct_flags = acct_flags;
|
---|
7613 | r.in.access_mask = access_mask;
|
---|
7614 |
|
---|
7615 | status = cli->dispatch(cli,
|
---|
7616 | mem_ctx,
|
---|
7617 | &ndr_table_samr,
|
---|
7618 | NDR_SAMR_CREATEUSER2,
|
---|
7619 | &r);
|
---|
7620 |
|
---|
7621 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7622 | return status;
|
---|
7623 | }
|
---|
7624 |
|
---|
7625 | if (NT_STATUS_IS_ERR(status)) {
|
---|
7626 | return status;
|
---|
7627 | }
|
---|
7628 |
|
---|
7629 | /* Return variables */
|
---|
7630 | *user_handle = *r.out.user_handle;
|
---|
7631 | *access_granted = *r.out.access_granted;
|
---|
7632 | *rid = *r.out.rid;
|
---|
7633 |
|
---|
7634 | /* Return result */
|
---|
7635 | return r.out.result;
|
---|
7636 | }
|
---|
7637 |
|
---|
7638 | struct rpccli_samr_QueryDisplayInfo3_state {
|
---|
7639 | struct samr_QueryDisplayInfo3 orig;
|
---|
7640 | struct samr_QueryDisplayInfo3 tmp;
|
---|
7641 | TALLOC_CTX *out_mem_ctx;
|
---|
7642 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
7643 | };
|
---|
7644 |
|
---|
7645 | static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq);
|
---|
7646 |
|
---|
7647 | struct tevent_req *rpccli_samr_QueryDisplayInfo3_send(TALLOC_CTX *mem_ctx,
|
---|
7648 | struct tevent_context *ev,
|
---|
7649 | struct rpc_pipe_client *cli,
|
---|
7650 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
7651 | uint16_t _level /* [in] */,
|
---|
7652 | uint32_t _start_idx /* [in] */,
|
---|
7653 | uint32_t _max_entries /* [in] */,
|
---|
7654 | uint32_t _buf_size /* [in] */,
|
---|
7655 | uint32_t *_total_size /* [out] [ref] */,
|
---|
7656 | uint32_t *_returned_size /* [out] [ref] */,
|
---|
7657 | union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
|
---|
7658 | {
|
---|
7659 | struct tevent_req *req;
|
---|
7660 | struct rpccli_samr_QueryDisplayInfo3_state *state;
|
---|
7661 | struct tevent_req *subreq;
|
---|
7662 |
|
---|
7663 | req = tevent_req_create(mem_ctx, &state,
|
---|
7664 | struct rpccli_samr_QueryDisplayInfo3_state);
|
---|
7665 | if (req == NULL) {
|
---|
7666 | return NULL;
|
---|
7667 | }
|
---|
7668 | state->out_mem_ctx = NULL;
|
---|
7669 | state->dispatch_recv = cli->dispatch_recv;
|
---|
7670 |
|
---|
7671 | /* In parameters */
|
---|
7672 | state->orig.in.domain_handle = _domain_handle;
|
---|
7673 | state->orig.in.level = _level;
|
---|
7674 | state->orig.in.start_idx = _start_idx;
|
---|
7675 | state->orig.in.max_entries = _max_entries;
|
---|
7676 | state->orig.in.buf_size = _buf_size;
|
---|
7677 |
|
---|
7678 | /* Out parameters */
|
---|
7679 | state->orig.out.total_size = _total_size;
|
---|
7680 | state->orig.out.returned_size = _returned_size;
|
---|
7681 | state->orig.out.info = _info;
|
---|
7682 |
|
---|
7683 | /* Result */
|
---|
7684 | ZERO_STRUCT(state->orig.out.result);
|
---|
7685 |
|
---|
7686 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
7687 | "rpccli_samr_QueryDisplayInfo3_out_memory");
|
---|
7688 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
7689 | return tevent_req_post(req, ev);
|
---|
7690 | }
|
---|
7691 |
|
---|
7692 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
7693 | state->tmp = state->orig;
|
---|
7694 |
|
---|
7695 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
7696 | &ndr_table_samr,
|
---|
7697 | NDR_SAMR_QUERYDISPLAYINFO3,
|
---|
7698 | &state->tmp);
|
---|
7699 | if (tevent_req_nomem(subreq, req)) {
|
---|
7700 | return tevent_req_post(req, ev);
|
---|
7701 | }
|
---|
7702 | tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo3_done, req);
|
---|
7703 | return req;
|
---|
7704 | }
|
---|
7705 |
|
---|
7706 | static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq)
|
---|
7707 | {
|
---|
7708 | struct tevent_req *req = tevent_req_callback_data(
|
---|
7709 | subreq, struct tevent_req);
|
---|
7710 | struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
|
---|
7711 | req, struct rpccli_samr_QueryDisplayInfo3_state);
|
---|
7712 | NTSTATUS status;
|
---|
7713 | TALLOC_CTX *mem_ctx;
|
---|
7714 |
|
---|
7715 | if (state->out_mem_ctx) {
|
---|
7716 | mem_ctx = state->out_mem_ctx;
|
---|
7717 | } else {
|
---|
7718 | mem_ctx = state;
|
---|
7719 | }
|
---|
7720 |
|
---|
7721 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
7722 | TALLOC_FREE(subreq);
|
---|
7723 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7724 | tevent_req_nterror(req, status);
|
---|
7725 | return;
|
---|
7726 | }
|
---|
7727 |
|
---|
7728 | /* Copy out parameters */
|
---|
7729 | *state->orig.out.total_size = *state->tmp.out.total_size;
|
---|
7730 | *state->orig.out.returned_size = *state->tmp.out.returned_size;
|
---|
7731 | *state->orig.out.info = *state->tmp.out.info;
|
---|
7732 |
|
---|
7733 | /* Copy result */
|
---|
7734 | state->orig.out.result = state->tmp.out.result;
|
---|
7735 |
|
---|
7736 | /* Reset temporary structure */
|
---|
7737 | ZERO_STRUCT(state->tmp);
|
---|
7738 |
|
---|
7739 | tevent_req_done(req);
|
---|
7740 | }
|
---|
7741 |
|
---|
7742 | NTSTATUS rpccli_samr_QueryDisplayInfo3_recv(struct tevent_req *req,
|
---|
7743 | TALLOC_CTX *mem_ctx,
|
---|
7744 | NTSTATUS *result)
|
---|
7745 | {
|
---|
7746 | struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
|
---|
7747 | req, struct rpccli_samr_QueryDisplayInfo3_state);
|
---|
7748 | NTSTATUS status;
|
---|
7749 |
|
---|
7750 | if (tevent_req_is_nterror(req, &status)) {
|
---|
7751 | tevent_req_received(req);
|
---|
7752 | return status;
|
---|
7753 | }
|
---|
7754 |
|
---|
7755 | /* Steal possbile out parameters to the callers context */
|
---|
7756 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
7757 |
|
---|
7758 | /* Return result */
|
---|
7759 | *result = state->orig.out.result;
|
---|
7760 |
|
---|
7761 | tevent_req_received(req);
|
---|
7762 | return NT_STATUS_OK;
|
---|
7763 | }
|
---|
7764 |
|
---|
7765 | NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
|
---|
7766 | TALLOC_CTX *mem_ctx,
|
---|
7767 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
7768 | uint16_t level /* [in] */,
|
---|
7769 | uint32_t start_idx /* [in] */,
|
---|
7770 | uint32_t max_entries /* [in] */,
|
---|
7771 | uint32_t buf_size /* [in] */,
|
---|
7772 | uint32_t *total_size /* [out] [ref] */,
|
---|
7773 | uint32_t *returned_size /* [out] [ref] */,
|
---|
7774 | union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
|
---|
7775 | {
|
---|
7776 | struct samr_QueryDisplayInfo3 r;
|
---|
7777 | NTSTATUS status;
|
---|
7778 |
|
---|
7779 | /* In parameters */
|
---|
7780 | r.in.domain_handle = domain_handle;
|
---|
7781 | r.in.level = level;
|
---|
7782 | r.in.start_idx = start_idx;
|
---|
7783 | r.in.max_entries = max_entries;
|
---|
7784 | r.in.buf_size = buf_size;
|
---|
7785 |
|
---|
7786 | status = cli->dispatch(cli,
|
---|
7787 | mem_ctx,
|
---|
7788 | &ndr_table_samr,
|
---|
7789 | NDR_SAMR_QUERYDISPLAYINFO3,
|
---|
7790 | &r);
|
---|
7791 |
|
---|
7792 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7793 | return status;
|
---|
7794 | }
|
---|
7795 |
|
---|
7796 | if (NT_STATUS_IS_ERR(status)) {
|
---|
7797 | return status;
|
---|
7798 | }
|
---|
7799 |
|
---|
7800 | /* Return variables */
|
---|
7801 | *total_size = *r.out.total_size;
|
---|
7802 | *returned_size = *r.out.returned_size;
|
---|
7803 | *info = *r.out.info;
|
---|
7804 |
|
---|
7805 | /* Return result */
|
---|
7806 | return r.out.result;
|
---|
7807 | }
|
---|
7808 |
|
---|
7809 | struct rpccli_samr_AddMultipleMembersToAlias_state {
|
---|
7810 | struct samr_AddMultipleMembersToAlias orig;
|
---|
7811 | struct samr_AddMultipleMembersToAlias tmp;
|
---|
7812 | TALLOC_CTX *out_mem_ctx;
|
---|
7813 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
7814 | };
|
---|
7815 |
|
---|
7816 | static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq);
|
---|
7817 |
|
---|
7818 | struct tevent_req *rpccli_samr_AddMultipleMembersToAlias_send(TALLOC_CTX *mem_ctx,
|
---|
7819 | struct tevent_context *ev,
|
---|
7820 | struct rpc_pipe_client *cli,
|
---|
7821 | struct policy_handle *_alias_handle /* [in] [ref] */,
|
---|
7822 | struct lsa_SidArray *_sids /* [in] [ref] */)
|
---|
7823 | {
|
---|
7824 | struct tevent_req *req;
|
---|
7825 | struct rpccli_samr_AddMultipleMembersToAlias_state *state;
|
---|
7826 | struct tevent_req *subreq;
|
---|
7827 |
|
---|
7828 | req = tevent_req_create(mem_ctx, &state,
|
---|
7829 | struct rpccli_samr_AddMultipleMembersToAlias_state);
|
---|
7830 | if (req == NULL) {
|
---|
7831 | return NULL;
|
---|
7832 | }
|
---|
7833 | state->out_mem_ctx = NULL;
|
---|
7834 | state->dispatch_recv = cli->dispatch_recv;
|
---|
7835 |
|
---|
7836 | /* In parameters */
|
---|
7837 | state->orig.in.alias_handle = _alias_handle;
|
---|
7838 | state->orig.in.sids = _sids;
|
---|
7839 |
|
---|
7840 | /* Out parameters */
|
---|
7841 |
|
---|
7842 | /* Result */
|
---|
7843 | ZERO_STRUCT(state->orig.out.result);
|
---|
7844 |
|
---|
7845 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
7846 | state->tmp = state->orig;
|
---|
7847 |
|
---|
7848 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
7849 | &ndr_table_samr,
|
---|
7850 | NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
|
---|
7851 | &state->tmp);
|
---|
7852 | if (tevent_req_nomem(subreq, req)) {
|
---|
7853 | return tevent_req_post(req, ev);
|
---|
7854 | }
|
---|
7855 | tevent_req_set_callback(subreq, rpccli_samr_AddMultipleMembersToAlias_done, req);
|
---|
7856 | return req;
|
---|
7857 | }
|
---|
7858 |
|
---|
7859 | static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq)
|
---|
7860 | {
|
---|
7861 | struct tevent_req *req = tevent_req_callback_data(
|
---|
7862 | subreq, struct tevent_req);
|
---|
7863 | struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
|
---|
7864 | req, struct rpccli_samr_AddMultipleMembersToAlias_state);
|
---|
7865 | NTSTATUS status;
|
---|
7866 | TALLOC_CTX *mem_ctx;
|
---|
7867 |
|
---|
7868 | if (state->out_mem_ctx) {
|
---|
7869 | mem_ctx = state->out_mem_ctx;
|
---|
7870 | } else {
|
---|
7871 | mem_ctx = state;
|
---|
7872 | }
|
---|
7873 |
|
---|
7874 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
7875 | TALLOC_FREE(subreq);
|
---|
7876 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7877 | tevent_req_nterror(req, status);
|
---|
7878 | return;
|
---|
7879 | }
|
---|
7880 |
|
---|
7881 | /* Copy out parameters */
|
---|
7882 |
|
---|
7883 | /* Copy result */
|
---|
7884 | state->orig.out.result = state->tmp.out.result;
|
---|
7885 |
|
---|
7886 | /* Reset temporary structure */
|
---|
7887 | ZERO_STRUCT(state->tmp);
|
---|
7888 |
|
---|
7889 | tevent_req_done(req);
|
---|
7890 | }
|
---|
7891 |
|
---|
7892 | NTSTATUS rpccli_samr_AddMultipleMembersToAlias_recv(struct tevent_req *req,
|
---|
7893 | TALLOC_CTX *mem_ctx,
|
---|
7894 | NTSTATUS *result)
|
---|
7895 | {
|
---|
7896 | struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
|
---|
7897 | req, struct rpccli_samr_AddMultipleMembersToAlias_state);
|
---|
7898 | NTSTATUS status;
|
---|
7899 |
|
---|
7900 | if (tevent_req_is_nterror(req, &status)) {
|
---|
7901 | tevent_req_received(req);
|
---|
7902 | return status;
|
---|
7903 | }
|
---|
7904 |
|
---|
7905 | /* Steal possbile out parameters to the callers context */
|
---|
7906 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
7907 |
|
---|
7908 | /* Return result */
|
---|
7909 | *result = state->orig.out.result;
|
---|
7910 |
|
---|
7911 | tevent_req_received(req);
|
---|
7912 | return NT_STATUS_OK;
|
---|
7913 | }
|
---|
7914 |
|
---|
7915 | NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
|
---|
7916 | TALLOC_CTX *mem_ctx,
|
---|
7917 | struct policy_handle *alias_handle /* [in] [ref] */,
|
---|
7918 | struct lsa_SidArray *sids /* [in] [ref] */)
|
---|
7919 | {
|
---|
7920 | struct samr_AddMultipleMembersToAlias r;
|
---|
7921 | NTSTATUS status;
|
---|
7922 |
|
---|
7923 | /* In parameters */
|
---|
7924 | r.in.alias_handle = alias_handle;
|
---|
7925 | r.in.sids = sids;
|
---|
7926 |
|
---|
7927 | status = cli->dispatch(cli,
|
---|
7928 | mem_ctx,
|
---|
7929 | &ndr_table_samr,
|
---|
7930 | NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
|
---|
7931 | &r);
|
---|
7932 |
|
---|
7933 | if (!NT_STATUS_IS_OK(status)) {
|
---|
7934 | return status;
|
---|
7935 | }
|
---|
7936 |
|
---|
7937 | if (NT_STATUS_IS_ERR(status)) {
|
---|
7938 | return status;
|
---|
7939 | }
|
---|
7940 |
|
---|
7941 | /* Return variables */
|
---|
7942 |
|
---|
7943 | /* Return result */
|
---|
7944 | return r.out.result;
|
---|
7945 | }
|
---|
7946 |
|
---|
7947 | struct rpccli_samr_RemoveMultipleMembersFromAlias_state {
|
---|
7948 | struct samr_RemoveMultipleMembersFromAlias orig;
|
---|
7949 | struct samr_RemoveMultipleMembersFromAlias tmp;
|
---|
7950 | TALLOC_CTX *out_mem_ctx;
|
---|
7951 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
7952 | };
|
---|
7953 |
|
---|
7954 | static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq);
|
---|
7955 |
|
---|
7956 | struct tevent_req *rpccli_samr_RemoveMultipleMembersFromAlias_send(TALLOC_CTX *mem_ctx,
|
---|
7957 | struct tevent_context *ev,
|
---|
7958 | struct rpc_pipe_client *cli,
|
---|
7959 | struct policy_handle *_alias_handle /* [in] [ref] */,
|
---|
7960 | struct lsa_SidArray *_sids /* [in] [ref] */)
|
---|
7961 | {
|
---|
7962 | struct tevent_req *req;
|
---|
7963 | struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state;
|
---|
7964 | struct tevent_req *subreq;
|
---|
7965 |
|
---|
7966 | req = tevent_req_create(mem_ctx, &state,
|
---|
7967 | struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
|
---|
7968 | if (req == NULL) {
|
---|
7969 | return NULL;
|
---|
7970 | }
|
---|
7971 | state->out_mem_ctx = NULL;
|
---|
7972 | state->dispatch_recv = cli->dispatch_recv;
|
---|
7973 |
|
---|
7974 | /* In parameters */
|
---|
7975 | state->orig.in.alias_handle = _alias_handle;
|
---|
7976 | state->orig.in.sids = _sids;
|
---|
7977 |
|
---|
7978 | /* Out parameters */
|
---|
7979 |
|
---|
7980 | /* Result */
|
---|
7981 | ZERO_STRUCT(state->orig.out.result);
|
---|
7982 |
|
---|
7983 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
7984 | state->tmp = state->orig;
|
---|
7985 |
|
---|
7986 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
7987 | &ndr_table_samr,
|
---|
7988 | NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
|
---|
7989 | &state->tmp);
|
---|
7990 | if (tevent_req_nomem(subreq, req)) {
|
---|
7991 | return tevent_req_post(req, ev);
|
---|
7992 | }
|
---|
7993 | tevent_req_set_callback(subreq, rpccli_samr_RemoveMultipleMembersFromAlias_done, req);
|
---|
7994 | return req;
|
---|
7995 | }
|
---|
7996 |
|
---|
7997 | static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq)
|
---|
7998 | {
|
---|
7999 | struct tevent_req *req = tevent_req_callback_data(
|
---|
8000 | subreq, struct tevent_req);
|
---|
8001 | struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
|
---|
8002 | req, struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
|
---|
8003 | NTSTATUS status;
|
---|
8004 | TALLOC_CTX *mem_ctx;
|
---|
8005 |
|
---|
8006 | if (state->out_mem_ctx) {
|
---|
8007 | mem_ctx = state->out_mem_ctx;
|
---|
8008 | } else {
|
---|
8009 | mem_ctx = state;
|
---|
8010 | }
|
---|
8011 |
|
---|
8012 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
8013 | TALLOC_FREE(subreq);
|
---|
8014 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8015 | tevent_req_nterror(req, status);
|
---|
8016 | return;
|
---|
8017 | }
|
---|
8018 |
|
---|
8019 | /* Copy out parameters */
|
---|
8020 |
|
---|
8021 | /* Copy result */
|
---|
8022 | state->orig.out.result = state->tmp.out.result;
|
---|
8023 |
|
---|
8024 | /* Reset temporary structure */
|
---|
8025 | ZERO_STRUCT(state->tmp);
|
---|
8026 |
|
---|
8027 | tevent_req_done(req);
|
---|
8028 | }
|
---|
8029 |
|
---|
8030 | NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias_recv(struct tevent_req *req,
|
---|
8031 | TALLOC_CTX *mem_ctx,
|
---|
8032 | NTSTATUS *result)
|
---|
8033 | {
|
---|
8034 | struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
|
---|
8035 | req, struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
|
---|
8036 | NTSTATUS status;
|
---|
8037 |
|
---|
8038 | if (tevent_req_is_nterror(req, &status)) {
|
---|
8039 | tevent_req_received(req);
|
---|
8040 | return status;
|
---|
8041 | }
|
---|
8042 |
|
---|
8043 | /* Steal possbile out parameters to the callers context */
|
---|
8044 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
8045 |
|
---|
8046 | /* Return result */
|
---|
8047 | *result = state->orig.out.result;
|
---|
8048 |
|
---|
8049 | tevent_req_received(req);
|
---|
8050 | return NT_STATUS_OK;
|
---|
8051 | }
|
---|
8052 |
|
---|
8053 | NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
|
---|
8054 | TALLOC_CTX *mem_ctx,
|
---|
8055 | struct policy_handle *alias_handle /* [in] [ref] */,
|
---|
8056 | struct lsa_SidArray *sids /* [in] [ref] */)
|
---|
8057 | {
|
---|
8058 | struct samr_RemoveMultipleMembersFromAlias r;
|
---|
8059 | NTSTATUS status;
|
---|
8060 |
|
---|
8061 | /* In parameters */
|
---|
8062 | r.in.alias_handle = alias_handle;
|
---|
8063 | r.in.sids = sids;
|
---|
8064 |
|
---|
8065 | status = cli->dispatch(cli,
|
---|
8066 | mem_ctx,
|
---|
8067 | &ndr_table_samr,
|
---|
8068 | NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
|
---|
8069 | &r);
|
---|
8070 |
|
---|
8071 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8072 | return status;
|
---|
8073 | }
|
---|
8074 |
|
---|
8075 | if (NT_STATUS_IS_ERR(status)) {
|
---|
8076 | return status;
|
---|
8077 | }
|
---|
8078 |
|
---|
8079 | /* Return variables */
|
---|
8080 |
|
---|
8081 | /* Return result */
|
---|
8082 | return r.out.result;
|
---|
8083 | }
|
---|
8084 |
|
---|
8085 | struct rpccli_samr_OemChangePasswordUser2_state {
|
---|
8086 | struct samr_OemChangePasswordUser2 orig;
|
---|
8087 | struct samr_OemChangePasswordUser2 tmp;
|
---|
8088 | TALLOC_CTX *out_mem_ctx;
|
---|
8089 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
8090 | };
|
---|
8091 |
|
---|
8092 | static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq);
|
---|
8093 |
|
---|
8094 | struct tevent_req *rpccli_samr_OemChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
|
---|
8095 | struct tevent_context *ev,
|
---|
8096 | struct rpc_pipe_client *cli,
|
---|
8097 | struct lsa_AsciiString *_server /* [in] [unique] */,
|
---|
8098 | struct lsa_AsciiString *_account /* [in] [ref] */,
|
---|
8099 | struct samr_CryptPassword *_password /* [in] [unique] */,
|
---|
8100 | struct samr_Password *_hash /* [in] [unique] */)
|
---|
8101 | {
|
---|
8102 | struct tevent_req *req;
|
---|
8103 | struct rpccli_samr_OemChangePasswordUser2_state *state;
|
---|
8104 | struct tevent_req *subreq;
|
---|
8105 |
|
---|
8106 | req = tevent_req_create(mem_ctx, &state,
|
---|
8107 | struct rpccli_samr_OemChangePasswordUser2_state);
|
---|
8108 | if (req == NULL) {
|
---|
8109 | return NULL;
|
---|
8110 | }
|
---|
8111 | state->out_mem_ctx = NULL;
|
---|
8112 | state->dispatch_recv = cli->dispatch_recv;
|
---|
8113 |
|
---|
8114 | /* In parameters */
|
---|
8115 | state->orig.in.server = _server;
|
---|
8116 | state->orig.in.account = _account;
|
---|
8117 | state->orig.in.password = _password;
|
---|
8118 | state->orig.in.hash = _hash;
|
---|
8119 |
|
---|
8120 | /* Out parameters */
|
---|
8121 |
|
---|
8122 | /* Result */
|
---|
8123 | ZERO_STRUCT(state->orig.out.result);
|
---|
8124 |
|
---|
8125 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
8126 | state->tmp = state->orig;
|
---|
8127 |
|
---|
8128 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
8129 | &ndr_table_samr,
|
---|
8130 | NDR_SAMR_OEMCHANGEPASSWORDUSER2,
|
---|
8131 | &state->tmp);
|
---|
8132 | if (tevent_req_nomem(subreq, req)) {
|
---|
8133 | return tevent_req_post(req, ev);
|
---|
8134 | }
|
---|
8135 | tevent_req_set_callback(subreq, rpccli_samr_OemChangePasswordUser2_done, req);
|
---|
8136 | return req;
|
---|
8137 | }
|
---|
8138 |
|
---|
8139 | static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq)
|
---|
8140 | {
|
---|
8141 | struct tevent_req *req = tevent_req_callback_data(
|
---|
8142 | subreq, struct tevent_req);
|
---|
8143 | struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
|
---|
8144 | req, struct rpccli_samr_OemChangePasswordUser2_state);
|
---|
8145 | NTSTATUS status;
|
---|
8146 | TALLOC_CTX *mem_ctx;
|
---|
8147 |
|
---|
8148 | if (state->out_mem_ctx) {
|
---|
8149 | mem_ctx = state->out_mem_ctx;
|
---|
8150 | } else {
|
---|
8151 | mem_ctx = state;
|
---|
8152 | }
|
---|
8153 |
|
---|
8154 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
8155 | TALLOC_FREE(subreq);
|
---|
8156 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8157 | tevent_req_nterror(req, status);
|
---|
8158 | return;
|
---|
8159 | }
|
---|
8160 |
|
---|
8161 | /* Copy out parameters */
|
---|
8162 |
|
---|
8163 | /* Copy result */
|
---|
8164 | state->orig.out.result = state->tmp.out.result;
|
---|
8165 |
|
---|
8166 | /* Reset temporary structure */
|
---|
8167 | ZERO_STRUCT(state->tmp);
|
---|
8168 |
|
---|
8169 | tevent_req_done(req);
|
---|
8170 | }
|
---|
8171 |
|
---|
8172 | NTSTATUS rpccli_samr_OemChangePasswordUser2_recv(struct tevent_req *req,
|
---|
8173 | TALLOC_CTX *mem_ctx,
|
---|
8174 | NTSTATUS *result)
|
---|
8175 | {
|
---|
8176 | struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
|
---|
8177 | req, struct rpccli_samr_OemChangePasswordUser2_state);
|
---|
8178 | NTSTATUS status;
|
---|
8179 |
|
---|
8180 | if (tevent_req_is_nterror(req, &status)) {
|
---|
8181 | tevent_req_received(req);
|
---|
8182 | return status;
|
---|
8183 | }
|
---|
8184 |
|
---|
8185 | /* Steal possbile out parameters to the callers context */
|
---|
8186 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
8187 |
|
---|
8188 | /* Return result */
|
---|
8189 | *result = state->orig.out.result;
|
---|
8190 |
|
---|
8191 | tevent_req_received(req);
|
---|
8192 | return NT_STATUS_OK;
|
---|
8193 | }
|
---|
8194 |
|
---|
8195 | NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli,
|
---|
8196 | TALLOC_CTX *mem_ctx,
|
---|
8197 | struct lsa_AsciiString *server /* [in] [unique] */,
|
---|
8198 | struct lsa_AsciiString *account /* [in] [ref] */,
|
---|
8199 | struct samr_CryptPassword *password /* [in] [unique] */,
|
---|
8200 | struct samr_Password *hash /* [in] [unique] */)
|
---|
8201 | {
|
---|
8202 | struct samr_OemChangePasswordUser2 r;
|
---|
8203 | NTSTATUS status;
|
---|
8204 |
|
---|
8205 | /* In parameters */
|
---|
8206 | r.in.server = server;
|
---|
8207 | r.in.account = account;
|
---|
8208 | r.in.password = password;
|
---|
8209 | r.in.hash = hash;
|
---|
8210 |
|
---|
8211 | status = cli->dispatch(cli,
|
---|
8212 | mem_ctx,
|
---|
8213 | &ndr_table_samr,
|
---|
8214 | NDR_SAMR_OEMCHANGEPASSWORDUSER2,
|
---|
8215 | &r);
|
---|
8216 |
|
---|
8217 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8218 | return status;
|
---|
8219 | }
|
---|
8220 |
|
---|
8221 | if (NT_STATUS_IS_ERR(status)) {
|
---|
8222 | return status;
|
---|
8223 | }
|
---|
8224 |
|
---|
8225 | /* Return variables */
|
---|
8226 |
|
---|
8227 | /* Return result */
|
---|
8228 | return r.out.result;
|
---|
8229 | }
|
---|
8230 |
|
---|
8231 | struct rpccli_samr_ChangePasswordUser2_state {
|
---|
8232 | struct samr_ChangePasswordUser2 orig;
|
---|
8233 | struct samr_ChangePasswordUser2 tmp;
|
---|
8234 | TALLOC_CTX *out_mem_ctx;
|
---|
8235 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
8236 | };
|
---|
8237 |
|
---|
8238 | static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq);
|
---|
8239 |
|
---|
8240 | struct tevent_req *rpccli_samr_ChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
|
---|
8241 | struct tevent_context *ev,
|
---|
8242 | struct rpc_pipe_client *cli,
|
---|
8243 | struct lsa_String *_server /* [in] [unique] */,
|
---|
8244 | struct lsa_String *_account /* [in] [ref] */,
|
---|
8245 | struct samr_CryptPassword *_nt_password /* [in] [unique] */,
|
---|
8246 | struct samr_Password *_nt_verifier /* [in] [unique] */,
|
---|
8247 | uint8_t _lm_change /* [in] */,
|
---|
8248 | struct samr_CryptPassword *_lm_password /* [in] [unique] */,
|
---|
8249 | struct samr_Password *_lm_verifier /* [in] [unique] */)
|
---|
8250 | {
|
---|
8251 | struct tevent_req *req;
|
---|
8252 | struct rpccli_samr_ChangePasswordUser2_state *state;
|
---|
8253 | struct tevent_req *subreq;
|
---|
8254 |
|
---|
8255 | req = tevent_req_create(mem_ctx, &state,
|
---|
8256 | struct rpccli_samr_ChangePasswordUser2_state);
|
---|
8257 | if (req == NULL) {
|
---|
8258 | return NULL;
|
---|
8259 | }
|
---|
8260 | state->out_mem_ctx = NULL;
|
---|
8261 | state->dispatch_recv = cli->dispatch_recv;
|
---|
8262 |
|
---|
8263 | /* In parameters */
|
---|
8264 | state->orig.in.server = _server;
|
---|
8265 | state->orig.in.account = _account;
|
---|
8266 | state->orig.in.nt_password = _nt_password;
|
---|
8267 | state->orig.in.nt_verifier = _nt_verifier;
|
---|
8268 | state->orig.in.lm_change = _lm_change;
|
---|
8269 | state->orig.in.lm_password = _lm_password;
|
---|
8270 | state->orig.in.lm_verifier = _lm_verifier;
|
---|
8271 |
|
---|
8272 | /* Out parameters */
|
---|
8273 |
|
---|
8274 | /* Result */
|
---|
8275 | ZERO_STRUCT(state->orig.out.result);
|
---|
8276 |
|
---|
8277 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
8278 | state->tmp = state->orig;
|
---|
8279 |
|
---|
8280 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
8281 | &ndr_table_samr,
|
---|
8282 | NDR_SAMR_CHANGEPASSWORDUSER2,
|
---|
8283 | &state->tmp);
|
---|
8284 | if (tevent_req_nomem(subreq, req)) {
|
---|
8285 | return tevent_req_post(req, ev);
|
---|
8286 | }
|
---|
8287 | tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser2_done, req);
|
---|
8288 | return req;
|
---|
8289 | }
|
---|
8290 |
|
---|
8291 | static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq)
|
---|
8292 | {
|
---|
8293 | struct tevent_req *req = tevent_req_callback_data(
|
---|
8294 | subreq, struct tevent_req);
|
---|
8295 | struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
|
---|
8296 | req, struct rpccli_samr_ChangePasswordUser2_state);
|
---|
8297 | NTSTATUS status;
|
---|
8298 | TALLOC_CTX *mem_ctx;
|
---|
8299 |
|
---|
8300 | if (state->out_mem_ctx) {
|
---|
8301 | mem_ctx = state->out_mem_ctx;
|
---|
8302 | } else {
|
---|
8303 | mem_ctx = state;
|
---|
8304 | }
|
---|
8305 |
|
---|
8306 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
8307 | TALLOC_FREE(subreq);
|
---|
8308 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8309 | tevent_req_nterror(req, status);
|
---|
8310 | return;
|
---|
8311 | }
|
---|
8312 |
|
---|
8313 | /* Copy out parameters */
|
---|
8314 |
|
---|
8315 | /* Copy result */
|
---|
8316 | state->orig.out.result = state->tmp.out.result;
|
---|
8317 |
|
---|
8318 | /* Reset temporary structure */
|
---|
8319 | ZERO_STRUCT(state->tmp);
|
---|
8320 |
|
---|
8321 | tevent_req_done(req);
|
---|
8322 | }
|
---|
8323 |
|
---|
8324 | NTSTATUS rpccli_samr_ChangePasswordUser2_recv(struct tevent_req *req,
|
---|
8325 | TALLOC_CTX *mem_ctx,
|
---|
8326 | NTSTATUS *result)
|
---|
8327 | {
|
---|
8328 | struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
|
---|
8329 | req, struct rpccli_samr_ChangePasswordUser2_state);
|
---|
8330 | NTSTATUS status;
|
---|
8331 |
|
---|
8332 | if (tevent_req_is_nterror(req, &status)) {
|
---|
8333 | tevent_req_received(req);
|
---|
8334 | return status;
|
---|
8335 | }
|
---|
8336 |
|
---|
8337 | /* Steal possbile out parameters to the callers context */
|
---|
8338 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
8339 |
|
---|
8340 | /* Return result */
|
---|
8341 | *result = state->orig.out.result;
|
---|
8342 |
|
---|
8343 | tevent_req_received(req);
|
---|
8344 | return NT_STATUS_OK;
|
---|
8345 | }
|
---|
8346 |
|
---|
8347 | NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
|
---|
8348 | TALLOC_CTX *mem_ctx,
|
---|
8349 | struct lsa_String *server /* [in] [unique] */,
|
---|
8350 | struct lsa_String *account /* [in] [ref] */,
|
---|
8351 | struct samr_CryptPassword *nt_password /* [in] [unique] */,
|
---|
8352 | struct samr_Password *nt_verifier /* [in] [unique] */,
|
---|
8353 | uint8_t lm_change /* [in] */,
|
---|
8354 | struct samr_CryptPassword *lm_password /* [in] [unique] */,
|
---|
8355 | struct samr_Password *lm_verifier /* [in] [unique] */)
|
---|
8356 | {
|
---|
8357 | struct samr_ChangePasswordUser2 r;
|
---|
8358 | NTSTATUS status;
|
---|
8359 |
|
---|
8360 | /* In parameters */
|
---|
8361 | r.in.server = server;
|
---|
8362 | r.in.account = account;
|
---|
8363 | r.in.nt_password = nt_password;
|
---|
8364 | r.in.nt_verifier = nt_verifier;
|
---|
8365 | r.in.lm_change = lm_change;
|
---|
8366 | r.in.lm_password = lm_password;
|
---|
8367 | r.in.lm_verifier = lm_verifier;
|
---|
8368 |
|
---|
8369 | status = cli->dispatch(cli,
|
---|
8370 | mem_ctx,
|
---|
8371 | &ndr_table_samr,
|
---|
8372 | NDR_SAMR_CHANGEPASSWORDUSER2,
|
---|
8373 | &r);
|
---|
8374 |
|
---|
8375 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8376 | return status;
|
---|
8377 | }
|
---|
8378 |
|
---|
8379 | if (NT_STATUS_IS_ERR(status)) {
|
---|
8380 | return status;
|
---|
8381 | }
|
---|
8382 |
|
---|
8383 | /* Return variables */
|
---|
8384 |
|
---|
8385 | /* Return result */
|
---|
8386 | return r.out.result;
|
---|
8387 | }
|
---|
8388 |
|
---|
8389 | struct rpccli_samr_GetDomPwInfo_state {
|
---|
8390 | struct samr_GetDomPwInfo orig;
|
---|
8391 | struct samr_GetDomPwInfo tmp;
|
---|
8392 | TALLOC_CTX *out_mem_ctx;
|
---|
8393 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
8394 | };
|
---|
8395 |
|
---|
8396 | static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq);
|
---|
8397 |
|
---|
8398 | struct tevent_req *rpccli_samr_GetDomPwInfo_send(TALLOC_CTX *mem_ctx,
|
---|
8399 | struct tevent_context *ev,
|
---|
8400 | struct rpc_pipe_client *cli,
|
---|
8401 | struct lsa_String *_domain_name /* [in] [unique] */,
|
---|
8402 | struct samr_PwInfo *_info /* [out] [ref] */)
|
---|
8403 | {
|
---|
8404 | struct tevent_req *req;
|
---|
8405 | struct rpccli_samr_GetDomPwInfo_state *state;
|
---|
8406 | struct tevent_req *subreq;
|
---|
8407 |
|
---|
8408 | req = tevent_req_create(mem_ctx, &state,
|
---|
8409 | struct rpccli_samr_GetDomPwInfo_state);
|
---|
8410 | if (req == NULL) {
|
---|
8411 | return NULL;
|
---|
8412 | }
|
---|
8413 | state->out_mem_ctx = NULL;
|
---|
8414 | state->dispatch_recv = cli->dispatch_recv;
|
---|
8415 |
|
---|
8416 | /* In parameters */
|
---|
8417 | state->orig.in.domain_name = _domain_name;
|
---|
8418 |
|
---|
8419 | /* Out parameters */
|
---|
8420 | state->orig.out.info = _info;
|
---|
8421 |
|
---|
8422 | /* Result */
|
---|
8423 | ZERO_STRUCT(state->orig.out.result);
|
---|
8424 |
|
---|
8425 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
8426 | "rpccli_samr_GetDomPwInfo_out_memory");
|
---|
8427 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
8428 | return tevent_req_post(req, ev);
|
---|
8429 | }
|
---|
8430 |
|
---|
8431 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
8432 | state->tmp = state->orig;
|
---|
8433 |
|
---|
8434 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
8435 | &ndr_table_samr,
|
---|
8436 | NDR_SAMR_GETDOMPWINFO,
|
---|
8437 | &state->tmp);
|
---|
8438 | if (tevent_req_nomem(subreq, req)) {
|
---|
8439 | return tevent_req_post(req, ev);
|
---|
8440 | }
|
---|
8441 | tevent_req_set_callback(subreq, rpccli_samr_GetDomPwInfo_done, req);
|
---|
8442 | return req;
|
---|
8443 | }
|
---|
8444 |
|
---|
8445 | static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq)
|
---|
8446 | {
|
---|
8447 | struct tevent_req *req = tevent_req_callback_data(
|
---|
8448 | subreq, struct tevent_req);
|
---|
8449 | struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
|
---|
8450 | req, struct rpccli_samr_GetDomPwInfo_state);
|
---|
8451 | NTSTATUS status;
|
---|
8452 | TALLOC_CTX *mem_ctx;
|
---|
8453 |
|
---|
8454 | if (state->out_mem_ctx) {
|
---|
8455 | mem_ctx = state->out_mem_ctx;
|
---|
8456 | } else {
|
---|
8457 | mem_ctx = state;
|
---|
8458 | }
|
---|
8459 |
|
---|
8460 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
8461 | TALLOC_FREE(subreq);
|
---|
8462 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8463 | tevent_req_nterror(req, status);
|
---|
8464 | return;
|
---|
8465 | }
|
---|
8466 |
|
---|
8467 | /* Copy out parameters */
|
---|
8468 | *state->orig.out.info = *state->tmp.out.info;
|
---|
8469 |
|
---|
8470 | /* Copy result */
|
---|
8471 | state->orig.out.result = state->tmp.out.result;
|
---|
8472 |
|
---|
8473 | /* Reset temporary structure */
|
---|
8474 | ZERO_STRUCT(state->tmp);
|
---|
8475 |
|
---|
8476 | tevent_req_done(req);
|
---|
8477 | }
|
---|
8478 |
|
---|
8479 | NTSTATUS rpccli_samr_GetDomPwInfo_recv(struct tevent_req *req,
|
---|
8480 | TALLOC_CTX *mem_ctx,
|
---|
8481 | NTSTATUS *result)
|
---|
8482 | {
|
---|
8483 | struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
|
---|
8484 | req, struct rpccli_samr_GetDomPwInfo_state);
|
---|
8485 | NTSTATUS status;
|
---|
8486 |
|
---|
8487 | if (tevent_req_is_nterror(req, &status)) {
|
---|
8488 | tevent_req_received(req);
|
---|
8489 | return status;
|
---|
8490 | }
|
---|
8491 |
|
---|
8492 | /* Steal possbile out parameters to the callers context */
|
---|
8493 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
8494 |
|
---|
8495 | /* Return result */
|
---|
8496 | *result = state->orig.out.result;
|
---|
8497 |
|
---|
8498 | tevent_req_received(req);
|
---|
8499 | return NT_STATUS_OK;
|
---|
8500 | }
|
---|
8501 |
|
---|
8502 | NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli,
|
---|
8503 | TALLOC_CTX *mem_ctx,
|
---|
8504 | struct lsa_String *domain_name /* [in] [unique] */,
|
---|
8505 | struct samr_PwInfo *info /* [out] [ref] */)
|
---|
8506 | {
|
---|
8507 | struct samr_GetDomPwInfo r;
|
---|
8508 | NTSTATUS status;
|
---|
8509 |
|
---|
8510 | /* In parameters */
|
---|
8511 | r.in.domain_name = domain_name;
|
---|
8512 |
|
---|
8513 | status = cli->dispatch(cli,
|
---|
8514 | mem_ctx,
|
---|
8515 | &ndr_table_samr,
|
---|
8516 | NDR_SAMR_GETDOMPWINFO,
|
---|
8517 | &r);
|
---|
8518 |
|
---|
8519 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8520 | return status;
|
---|
8521 | }
|
---|
8522 |
|
---|
8523 | if (NT_STATUS_IS_ERR(status)) {
|
---|
8524 | return status;
|
---|
8525 | }
|
---|
8526 |
|
---|
8527 | /* Return variables */
|
---|
8528 | *info = *r.out.info;
|
---|
8529 |
|
---|
8530 | /* Return result */
|
---|
8531 | return r.out.result;
|
---|
8532 | }
|
---|
8533 |
|
---|
8534 | struct rpccli_samr_Connect2_state {
|
---|
8535 | struct samr_Connect2 orig;
|
---|
8536 | struct samr_Connect2 tmp;
|
---|
8537 | TALLOC_CTX *out_mem_ctx;
|
---|
8538 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
8539 | };
|
---|
8540 |
|
---|
8541 | static void rpccli_samr_Connect2_done(struct tevent_req *subreq);
|
---|
8542 |
|
---|
8543 | struct tevent_req *rpccli_samr_Connect2_send(TALLOC_CTX *mem_ctx,
|
---|
8544 | struct tevent_context *ev,
|
---|
8545 | struct rpc_pipe_client *cli,
|
---|
8546 | const char *_system_name /* [in] [unique,charset(UTF16)] */,
|
---|
8547 | uint32_t _access_mask /* [in] */,
|
---|
8548 | struct policy_handle *_connect_handle /* [out] [ref] */)
|
---|
8549 | {
|
---|
8550 | struct tevent_req *req;
|
---|
8551 | struct rpccli_samr_Connect2_state *state;
|
---|
8552 | struct tevent_req *subreq;
|
---|
8553 |
|
---|
8554 | req = tevent_req_create(mem_ctx, &state,
|
---|
8555 | struct rpccli_samr_Connect2_state);
|
---|
8556 | if (req == NULL) {
|
---|
8557 | return NULL;
|
---|
8558 | }
|
---|
8559 | state->out_mem_ctx = NULL;
|
---|
8560 | state->dispatch_recv = cli->dispatch_recv;
|
---|
8561 |
|
---|
8562 | /* In parameters */
|
---|
8563 | state->orig.in.system_name = _system_name;
|
---|
8564 | state->orig.in.access_mask = _access_mask;
|
---|
8565 |
|
---|
8566 | /* Out parameters */
|
---|
8567 | state->orig.out.connect_handle = _connect_handle;
|
---|
8568 |
|
---|
8569 | /* Result */
|
---|
8570 | ZERO_STRUCT(state->orig.out.result);
|
---|
8571 |
|
---|
8572 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
8573 | "rpccli_samr_Connect2_out_memory");
|
---|
8574 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
8575 | return tevent_req_post(req, ev);
|
---|
8576 | }
|
---|
8577 |
|
---|
8578 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
8579 | state->tmp = state->orig;
|
---|
8580 |
|
---|
8581 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
8582 | &ndr_table_samr,
|
---|
8583 | NDR_SAMR_CONNECT2,
|
---|
8584 | &state->tmp);
|
---|
8585 | if (tevent_req_nomem(subreq, req)) {
|
---|
8586 | return tevent_req_post(req, ev);
|
---|
8587 | }
|
---|
8588 | tevent_req_set_callback(subreq, rpccli_samr_Connect2_done, req);
|
---|
8589 | return req;
|
---|
8590 | }
|
---|
8591 |
|
---|
8592 | static void rpccli_samr_Connect2_done(struct tevent_req *subreq)
|
---|
8593 | {
|
---|
8594 | struct tevent_req *req = tevent_req_callback_data(
|
---|
8595 | subreq, struct tevent_req);
|
---|
8596 | struct rpccli_samr_Connect2_state *state = tevent_req_data(
|
---|
8597 | req, struct rpccli_samr_Connect2_state);
|
---|
8598 | NTSTATUS status;
|
---|
8599 | TALLOC_CTX *mem_ctx;
|
---|
8600 |
|
---|
8601 | if (state->out_mem_ctx) {
|
---|
8602 | mem_ctx = state->out_mem_ctx;
|
---|
8603 | } else {
|
---|
8604 | mem_ctx = state;
|
---|
8605 | }
|
---|
8606 |
|
---|
8607 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
8608 | TALLOC_FREE(subreq);
|
---|
8609 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8610 | tevent_req_nterror(req, status);
|
---|
8611 | return;
|
---|
8612 | }
|
---|
8613 |
|
---|
8614 | /* Copy out parameters */
|
---|
8615 | *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
|
---|
8616 |
|
---|
8617 | /* Copy result */
|
---|
8618 | state->orig.out.result = state->tmp.out.result;
|
---|
8619 |
|
---|
8620 | /* Reset temporary structure */
|
---|
8621 | ZERO_STRUCT(state->tmp);
|
---|
8622 |
|
---|
8623 | tevent_req_done(req);
|
---|
8624 | }
|
---|
8625 |
|
---|
8626 | NTSTATUS rpccli_samr_Connect2_recv(struct tevent_req *req,
|
---|
8627 | TALLOC_CTX *mem_ctx,
|
---|
8628 | NTSTATUS *result)
|
---|
8629 | {
|
---|
8630 | struct rpccli_samr_Connect2_state *state = tevent_req_data(
|
---|
8631 | req, struct rpccli_samr_Connect2_state);
|
---|
8632 | NTSTATUS status;
|
---|
8633 |
|
---|
8634 | if (tevent_req_is_nterror(req, &status)) {
|
---|
8635 | tevent_req_received(req);
|
---|
8636 | return status;
|
---|
8637 | }
|
---|
8638 |
|
---|
8639 | /* Steal possbile out parameters to the callers context */
|
---|
8640 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
8641 |
|
---|
8642 | /* Return result */
|
---|
8643 | *result = state->orig.out.result;
|
---|
8644 |
|
---|
8645 | tevent_req_received(req);
|
---|
8646 | return NT_STATUS_OK;
|
---|
8647 | }
|
---|
8648 |
|
---|
8649 | NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
|
---|
8650 | TALLOC_CTX *mem_ctx,
|
---|
8651 | const char *system_name /* [in] [unique,charset(UTF16)] */,
|
---|
8652 | uint32_t access_mask /* [in] */,
|
---|
8653 | struct policy_handle *connect_handle /* [out] [ref] */)
|
---|
8654 | {
|
---|
8655 | struct samr_Connect2 r;
|
---|
8656 | NTSTATUS status;
|
---|
8657 |
|
---|
8658 | /* In parameters */
|
---|
8659 | r.in.system_name = system_name;
|
---|
8660 | r.in.access_mask = access_mask;
|
---|
8661 |
|
---|
8662 | status = cli->dispatch(cli,
|
---|
8663 | mem_ctx,
|
---|
8664 | &ndr_table_samr,
|
---|
8665 | NDR_SAMR_CONNECT2,
|
---|
8666 | &r);
|
---|
8667 |
|
---|
8668 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8669 | return status;
|
---|
8670 | }
|
---|
8671 |
|
---|
8672 | if (NT_STATUS_IS_ERR(status)) {
|
---|
8673 | return status;
|
---|
8674 | }
|
---|
8675 |
|
---|
8676 | /* Return variables */
|
---|
8677 | *connect_handle = *r.out.connect_handle;
|
---|
8678 |
|
---|
8679 | /* Return result */
|
---|
8680 | return r.out.result;
|
---|
8681 | }
|
---|
8682 |
|
---|
8683 | struct rpccli_samr_SetUserInfo2_state {
|
---|
8684 | struct samr_SetUserInfo2 orig;
|
---|
8685 | struct samr_SetUserInfo2 tmp;
|
---|
8686 | TALLOC_CTX *out_mem_ctx;
|
---|
8687 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
8688 | };
|
---|
8689 |
|
---|
8690 | static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq);
|
---|
8691 |
|
---|
8692 | struct tevent_req *rpccli_samr_SetUserInfo2_send(TALLOC_CTX *mem_ctx,
|
---|
8693 | struct tevent_context *ev,
|
---|
8694 | struct rpc_pipe_client *cli,
|
---|
8695 | struct policy_handle *_user_handle /* [in] [ref] */,
|
---|
8696 | enum samr_UserInfoLevel _level /* [in] */,
|
---|
8697 | union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
|
---|
8698 | {
|
---|
8699 | struct tevent_req *req;
|
---|
8700 | struct rpccli_samr_SetUserInfo2_state *state;
|
---|
8701 | struct tevent_req *subreq;
|
---|
8702 |
|
---|
8703 | req = tevent_req_create(mem_ctx, &state,
|
---|
8704 | struct rpccli_samr_SetUserInfo2_state);
|
---|
8705 | if (req == NULL) {
|
---|
8706 | return NULL;
|
---|
8707 | }
|
---|
8708 | state->out_mem_ctx = NULL;
|
---|
8709 | state->dispatch_recv = cli->dispatch_recv;
|
---|
8710 |
|
---|
8711 | /* In parameters */
|
---|
8712 | state->orig.in.user_handle = _user_handle;
|
---|
8713 | state->orig.in.level = _level;
|
---|
8714 | state->orig.in.info = _info;
|
---|
8715 |
|
---|
8716 | /* Out parameters */
|
---|
8717 |
|
---|
8718 | /* Result */
|
---|
8719 | ZERO_STRUCT(state->orig.out.result);
|
---|
8720 |
|
---|
8721 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
8722 | state->tmp = state->orig;
|
---|
8723 |
|
---|
8724 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
8725 | &ndr_table_samr,
|
---|
8726 | NDR_SAMR_SETUSERINFO2,
|
---|
8727 | &state->tmp);
|
---|
8728 | if (tevent_req_nomem(subreq, req)) {
|
---|
8729 | return tevent_req_post(req, ev);
|
---|
8730 | }
|
---|
8731 | tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo2_done, req);
|
---|
8732 | return req;
|
---|
8733 | }
|
---|
8734 |
|
---|
8735 | static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq)
|
---|
8736 | {
|
---|
8737 | struct tevent_req *req = tevent_req_callback_data(
|
---|
8738 | subreq, struct tevent_req);
|
---|
8739 | struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
|
---|
8740 | req, struct rpccli_samr_SetUserInfo2_state);
|
---|
8741 | NTSTATUS status;
|
---|
8742 | TALLOC_CTX *mem_ctx;
|
---|
8743 |
|
---|
8744 | if (state->out_mem_ctx) {
|
---|
8745 | mem_ctx = state->out_mem_ctx;
|
---|
8746 | } else {
|
---|
8747 | mem_ctx = state;
|
---|
8748 | }
|
---|
8749 |
|
---|
8750 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
8751 | TALLOC_FREE(subreq);
|
---|
8752 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8753 | tevent_req_nterror(req, status);
|
---|
8754 | return;
|
---|
8755 | }
|
---|
8756 |
|
---|
8757 | /* Copy out parameters */
|
---|
8758 |
|
---|
8759 | /* Copy result */
|
---|
8760 | state->orig.out.result = state->tmp.out.result;
|
---|
8761 |
|
---|
8762 | /* Reset temporary structure */
|
---|
8763 | ZERO_STRUCT(state->tmp);
|
---|
8764 |
|
---|
8765 | tevent_req_done(req);
|
---|
8766 | }
|
---|
8767 |
|
---|
8768 | NTSTATUS rpccli_samr_SetUserInfo2_recv(struct tevent_req *req,
|
---|
8769 | TALLOC_CTX *mem_ctx,
|
---|
8770 | NTSTATUS *result)
|
---|
8771 | {
|
---|
8772 | struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
|
---|
8773 | req, struct rpccli_samr_SetUserInfo2_state);
|
---|
8774 | NTSTATUS status;
|
---|
8775 |
|
---|
8776 | if (tevent_req_is_nterror(req, &status)) {
|
---|
8777 | tevent_req_received(req);
|
---|
8778 | return status;
|
---|
8779 | }
|
---|
8780 |
|
---|
8781 | /* Steal possbile out parameters to the callers context */
|
---|
8782 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
8783 |
|
---|
8784 | /* Return result */
|
---|
8785 | *result = state->orig.out.result;
|
---|
8786 |
|
---|
8787 | tevent_req_received(req);
|
---|
8788 | return NT_STATUS_OK;
|
---|
8789 | }
|
---|
8790 |
|
---|
8791 | NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli,
|
---|
8792 | TALLOC_CTX *mem_ctx,
|
---|
8793 | struct policy_handle *user_handle /* [in] [ref] */,
|
---|
8794 | enum samr_UserInfoLevel level /* [in] */,
|
---|
8795 | union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
|
---|
8796 | {
|
---|
8797 | struct samr_SetUserInfo2 r;
|
---|
8798 | NTSTATUS status;
|
---|
8799 |
|
---|
8800 | /* In parameters */
|
---|
8801 | r.in.user_handle = user_handle;
|
---|
8802 | r.in.level = level;
|
---|
8803 | r.in.info = info;
|
---|
8804 |
|
---|
8805 | status = cli->dispatch(cli,
|
---|
8806 | mem_ctx,
|
---|
8807 | &ndr_table_samr,
|
---|
8808 | NDR_SAMR_SETUSERINFO2,
|
---|
8809 | &r);
|
---|
8810 |
|
---|
8811 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8812 | return status;
|
---|
8813 | }
|
---|
8814 |
|
---|
8815 | if (NT_STATUS_IS_ERR(status)) {
|
---|
8816 | return status;
|
---|
8817 | }
|
---|
8818 |
|
---|
8819 | /* Return variables */
|
---|
8820 |
|
---|
8821 | /* Return result */
|
---|
8822 | return r.out.result;
|
---|
8823 | }
|
---|
8824 |
|
---|
8825 | struct rpccli_samr_SetBootKeyInformation_state {
|
---|
8826 | struct samr_SetBootKeyInformation orig;
|
---|
8827 | struct samr_SetBootKeyInformation tmp;
|
---|
8828 | TALLOC_CTX *out_mem_ctx;
|
---|
8829 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
8830 | };
|
---|
8831 |
|
---|
8832 | static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq);
|
---|
8833 |
|
---|
8834 | struct tevent_req *rpccli_samr_SetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
|
---|
8835 | struct tevent_context *ev,
|
---|
8836 | struct rpc_pipe_client *cli,
|
---|
8837 | struct policy_handle *_connect_handle /* [in] [ref] */,
|
---|
8838 | uint32_t _unknown1 /* [in] */,
|
---|
8839 | uint32_t _unknown2 /* [in] */,
|
---|
8840 | uint32_t _unknown3 /* [in] */)
|
---|
8841 | {
|
---|
8842 | struct tevent_req *req;
|
---|
8843 | struct rpccli_samr_SetBootKeyInformation_state *state;
|
---|
8844 | struct tevent_req *subreq;
|
---|
8845 |
|
---|
8846 | req = tevent_req_create(mem_ctx, &state,
|
---|
8847 | struct rpccli_samr_SetBootKeyInformation_state);
|
---|
8848 | if (req == NULL) {
|
---|
8849 | return NULL;
|
---|
8850 | }
|
---|
8851 | state->out_mem_ctx = NULL;
|
---|
8852 | state->dispatch_recv = cli->dispatch_recv;
|
---|
8853 |
|
---|
8854 | /* In parameters */
|
---|
8855 | state->orig.in.connect_handle = _connect_handle;
|
---|
8856 | state->orig.in.unknown1 = _unknown1;
|
---|
8857 | state->orig.in.unknown2 = _unknown2;
|
---|
8858 | state->orig.in.unknown3 = _unknown3;
|
---|
8859 |
|
---|
8860 | /* Out parameters */
|
---|
8861 |
|
---|
8862 | /* Result */
|
---|
8863 | ZERO_STRUCT(state->orig.out.result);
|
---|
8864 |
|
---|
8865 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
8866 | state->tmp = state->orig;
|
---|
8867 |
|
---|
8868 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
8869 | &ndr_table_samr,
|
---|
8870 | NDR_SAMR_SETBOOTKEYINFORMATION,
|
---|
8871 | &state->tmp);
|
---|
8872 | if (tevent_req_nomem(subreq, req)) {
|
---|
8873 | return tevent_req_post(req, ev);
|
---|
8874 | }
|
---|
8875 | tevent_req_set_callback(subreq, rpccli_samr_SetBootKeyInformation_done, req);
|
---|
8876 | return req;
|
---|
8877 | }
|
---|
8878 |
|
---|
8879 | static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq)
|
---|
8880 | {
|
---|
8881 | struct tevent_req *req = tevent_req_callback_data(
|
---|
8882 | subreq, struct tevent_req);
|
---|
8883 | struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
|
---|
8884 | req, struct rpccli_samr_SetBootKeyInformation_state);
|
---|
8885 | NTSTATUS status;
|
---|
8886 | TALLOC_CTX *mem_ctx;
|
---|
8887 |
|
---|
8888 | if (state->out_mem_ctx) {
|
---|
8889 | mem_ctx = state->out_mem_ctx;
|
---|
8890 | } else {
|
---|
8891 | mem_ctx = state;
|
---|
8892 | }
|
---|
8893 |
|
---|
8894 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
8895 | TALLOC_FREE(subreq);
|
---|
8896 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8897 | tevent_req_nterror(req, status);
|
---|
8898 | return;
|
---|
8899 | }
|
---|
8900 |
|
---|
8901 | /* Copy out parameters */
|
---|
8902 |
|
---|
8903 | /* Copy result */
|
---|
8904 | state->orig.out.result = state->tmp.out.result;
|
---|
8905 |
|
---|
8906 | /* Reset temporary structure */
|
---|
8907 | ZERO_STRUCT(state->tmp);
|
---|
8908 |
|
---|
8909 | tevent_req_done(req);
|
---|
8910 | }
|
---|
8911 |
|
---|
8912 | NTSTATUS rpccli_samr_SetBootKeyInformation_recv(struct tevent_req *req,
|
---|
8913 | TALLOC_CTX *mem_ctx,
|
---|
8914 | NTSTATUS *result)
|
---|
8915 | {
|
---|
8916 | struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
|
---|
8917 | req, struct rpccli_samr_SetBootKeyInformation_state);
|
---|
8918 | NTSTATUS status;
|
---|
8919 |
|
---|
8920 | if (tevent_req_is_nterror(req, &status)) {
|
---|
8921 | tevent_req_received(req);
|
---|
8922 | return status;
|
---|
8923 | }
|
---|
8924 |
|
---|
8925 | /* Steal possbile out parameters to the callers context */
|
---|
8926 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
8927 |
|
---|
8928 | /* Return result */
|
---|
8929 | *result = state->orig.out.result;
|
---|
8930 |
|
---|
8931 | tevent_req_received(req);
|
---|
8932 | return NT_STATUS_OK;
|
---|
8933 | }
|
---|
8934 |
|
---|
8935 | NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
|
---|
8936 | TALLOC_CTX *mem_ctx,
|
---|
8937 | struct policy_handle *connect_handle /* [in] [ref] */,
|
---|
8938 | uint32_t unknown1 /* [in] */,
|
---|
8939 | uint32_t unknown2 /* [in] */,
|
---|
8940 | uint32_t unknown3 /* [in] */)
|
---|
8941 | {
|
---|
8942 | struct samr_SetBootKeyInformation r;
|
---|
8943 | NTSTATUS status;
|
---|
8944 |
|
---|
8945 | /* In parameters */
|
---|
8946 | r.in.connect_handle = connect_handle;
|
---|
8947 | r.in.unknown1 = unknown1;
|
---|
8948 | r.in.unknown2 = unknown2;
|
---|
8949 | r.in.unknown3 = unknown3;
|
---|
8950 |
|
---|
8951 | status = cli->dispatch(cli,
|
---|
8952 | mem_ctx,
|
---|
8953 | &ndr_table_samr,
|
---|
8954 | NDR_SAMR_SETBOOTKEYINFORMATION,
|
---|
8955 | &r);
|
---|
8956 |
|
---|
8957 | if (!NT_STATUS_IS_OK(status)) {
|
---|
8958 | return status;
|
---|
8959 | }
|
---|
8960 |
|
---|
8961 | if (NT_STATUS_IS_ERR(status)) {
|
---|
8962 | return status;
|
---|
8963 | }
|
---|
8964 |
|
---|
8965 | /* Return variables */
|
---|
8966 |
|
---|
8967 | /* Return result */
|
---|
8968 | return r.out.result;
|
---|
8969 | }
|
---|
8970 |
|
---|
8971 | struct rpccli_samr_GetBootKeyInformation_state {
|
---|
8972 | struct samr_GetBootKeyInformation orig;
|
---|
8973 | struct samr_GetBootKeyInformation tmp;
|
---|
8974 | TALLOC_CTX *out_mem_ctx;
|
---|
8975 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
8976 | };
|
---|
8977 |
|
---|
8978 | static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq);
|
---|
8979 |
|
---|
8980 | struct tevent_req *rpccli_samr_GetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
|
---|
8981 | struct tevent_context *ev,
|
---|
8982 | struct rpc_pipe_client *cli,
|
---|
8983 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
8984 | uint32_t *_unknown /* [out] [ref] */)
|
---|
8985 | {
|
---|
8986 | struct tevent_req *req;
|
---|
8987 | struct rpccli_samr_GetBootKeyInformation_state *state;
|
---|
8988 | struct tevent_req *subreq;
|
---|
8989 |
|
---|
8990 | req = tevent_req_create(mem_ctx, &state,
|
---|
8991 | struct rpccli_samr_GetBootKeyInformation_state);
|
---|
8992 | if (req == NULL) {
|
---|
8993 | return NULL;
|
---|
8994 | }
|
---|
8995 | state->out_mem_ctx = NULL;
|
---|
8996 | state->dispatch_recv = cli->dispatch_recv;
|
---|
8997 |
|
---|
8998 | /* In parameters */
|
---|
8999 | state->orig.in.domain_handle = _domain_handle;
|
---|
9000 |
|
---|
9001 | /* Out parameters */
|
---|
9002 | state->orig.out.unknown = _unknown;
|
---|
9003 |
|
---|
9004 | /* Result */
|
---|
9005 | ZERO_STRUCT(state->orig.out.result);
|
---|
9006 |
|
---|
9007 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
9008 | "rpccli_samr_GetBootKeyInformation_out_memory");
|
---|
9009 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
9010 | return tevent_req_post(req, ev);
|
---|
9011 | }
|
---|
9012 |
|
---|
9013 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
9014 | state->tmp = state->orig;
|
---|
9015 |
|
---|
9016 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
9017 | &ndr_table_samr,
|
---|
9018 | NDR_SAMR_GETBOOTKEYINFORMATION,
|
---|
9019 | &state->tmp);
|
---|
9020 | if (tevent_req_nomem(subreq, req)) {
|
---|
9021 | return tevent_req_post(req, ev);
|
---|
9022 | }
|
---|
9023 | tevent_req_set_callback(subreq, rpccli_samr_GetBootKeyInformation_done, req);
|
---|
9024 | return req;
|
---|
9025 | }
|
---|
9026 |
|
---|
9027 | static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq)
|
---|
9028 | {
|
---|
9029 | struct tevent_req *req = tevent_req_callback_data(
|
---|
9030 | subreq, struct tevent_req);
|
---|
9031 | struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
|
---|
9032 | req, struct rpccli_samr_GetBootKeyInformation_state);
|
---|
9033 | NTSTATUS status;
|
---|
9034 | TALLOC_CTX *mem_ctx;
|
---|
9035 |
|
---|
9036 | if (state->out_mem_ctx) {
|
---|
9037 | mem_ctx = state->out_mem_ctx;
|
---|
9038 | } else {
|
---|
9039 | mem_ctx = state;
|
---|
9040 | }
|
---|
9041 |
|
---|
9042 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
9043 | TALLOC_FREE(subreq);
|
---|
9044 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9045 | tevent_req_nterror(req, status);
|
---|
9046 | return;
|
---|
9047 | }
|
---|
9048 |
|
---|
9049 | /* Copy out parameters */
|
---|
9050 | *state->orig.out.unknown = *state->tmp.out.unknown;
|
---|
9051 |
|
---|
9052 | /* Copy result */
|
---|
9053 | state->orig.out.result = state->tmp.out.result;
|
---|
9054 |
|
---|
9055 | /* Reset temporary structure */
|
---|
9056 | ZERO_STRUCT(state->tmp);
|
---|
9057 |
|
---|
9058 | tevent_req_done(req);
|
---|
9059 | }
|
---|
9060 |
|
---|
9061 | NTSTATUS rpccli_samr_GetBootKeyInformation_recv(struct tevent_req *req,
|
---|
9062 | TALLOC_CTX *mem_ctx,
|
---|
9063 | NTSTATUS *result)
|
---|
9064 | {
|
---|
9065 | struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
|
---|
9066 | req, struct rpccli_samr_GetBootKeyInformation_state);
|
---|
9067 | NTSTATUS status;
|
---|
9068 |
|
---|
9069 | if (tevent_req_is_nterror(req, &status)) {
|
---|
9070 | tevent_req_received(req);
|
---|
9071 | return status;
|
---|
9072 | }
|
---|
9073 |
|
---|
9074 | /* Steal possbile out parameters to the callers context */
|
---|
9075 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
9076 |
|
---|
9077 | /* Return result */
|
---|
9078 | *result = state->orig.out.result;
|
---|
9079 |
|
---|
9080 | tevent_req_received(req);
|
---|
9081 | return NT_STATUS_OK;
|
---|
9082 | }
|
---|
9083 |
|
---|
9084 | NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli,
|
---|
9085 | TALLOC_CTX *mem_ctx,
|
---|
9086 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
9087 | uint32_t *unknown /* [out] [ref] */)
|
---|
9088 | {
|
---|
9089 | struct samr_GetBootKeyInformation r;
|
---|
9090 | NTSTATUS status;
|
---|
9091 |
|
---|
9092 | /* In parameters */
|
---|
9093 | r.in.domain_handle = domain_handle;
|
---|
9094 |
|
---|
9095 | status = cli->dispatch(cli,
|
---|
9096 | mem_ctx,
|
---|
9097 | &ndr_table_samr,
|
---|
9098 | NDR_SAMR_GETBOOTKEYINFORMATION,
|
---|
9099 | &r);
|
---|
9100 |
|
---|
9101 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9102 | return status;
|
---|
9103 | }
|
---|
9104 |
|
---|
9105 | if (NT_STATUS_IS_ERR(status)) {
|
---|
9106 | return status;
|
---|
9107 | }
|
---|
9108 |
|
---|
9109 | /* Return variables */
|
---|
9110 | *unknown = *r.out.unknown;
|
---|
9111 |
|
---|
9112 | /* Return result */
|
---|
9113 | return r.out.result;
|
---|
9114 | }
|
---|
9115 |
|
---|
9116 | struct rpccli_samr_Connect3_state {
|
---|
9117 | struct samr_Connect3 orig;
|
---|
9118 | struct samr_Connect3 tmp;
|
---|
9119 | TALLOC_CTX *out_mem_ctx;
|
---|
9120 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
9121 | };
|
---|
9122 |
|
---|
9123 | static void rpccli_samr_Connect3_done(struct tevent_req *subreq);
|
---|
9124 |
|
---|
9125 | struct tevent_req *rpccli_samr_Connect3_send(TALLOC_CTX *mem_ctx,
|
---|
9126 | struct tevent_context *ev,
|
---|
9127 | struct rpc_pipe_client *cli,
|
---|
9128 | const char *_system_name /* [in] [unique,charset(UTF16)] */,
|
---|
9129 | uint32_t _unknown /* [in] */,
|
---|
9130 | uint32_t _access_mask /* [in] */,
|
---|
9131 | struct policy_handle *_connect_handle /* [out] [ref] */)
|
---|
9132 | {
|
---|
9133 | struct tevent_req *req;
|
---|
9134 | struct rpccli_samr_Connect3_state *state;
|
---|
9135 | struct tevent_req *subreq;
|
---|
9136 |
|
---|
9137 | req = tevent_req_create(mem_ctx, &state,
|
---|
9138 | struct rpccli_samr_Connect3_state);
|
---|
9139 | if (req == NULL) {
|
---|
9140 | return NULL;
|
---|
9141 | }
|
---|
9142 | state->out_mem_ctx = NULL;
|
---|
9143 | state->dispatch_recv = cli->dispatch_recv;
|
---|
9144 |
|
---|
9145 | /* In parameters */
|
---|
9146 | state->orig.in.system_name = _system_name;
|
---|
9147 | state->orig.in.unknown = _unknown;
|
---|
9148 | state->orig.in.access_mask = _access_mask;
|
---|
9149 |
|
---|
9150 | /* Out parameters */
|
---|
9151 | state->orig.out.connect_handle = _connect_handle;
|
---|
9152 |
|
---|
9153 | /* Result */
|
---|
9154 | ZERO_STRUCT(state->orig.out.result);
|
---|
9155 |
|
---|
9156 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
9157 | "rpccli_samr_Connect3_out_memory");
|
---|
9158 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
9159 | return tevent_req_post(req, ev);
|
---|
9160 | }
|
---|
9161 |
|
---|
9162 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
9163 | state->tmp = state->orig;
|
---|
9164 |
|
---|
9165 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
9166 | &ndr_table_samr,
|
---|
9167 | NDR_SAMR_CONNECT3,
|
---|
9168 | &state->tmp);
|
---|
9169 | if (tevent_req_nomem(subreq, req)) {
|
---|
9170 | return tevent_req_post(req, ev);
|
---|
9171 | }
|
---|
9172 | tevent_req_set_callback(subreq, rpccli_samr_Connect3_done, req);
|
---|
9173 | return req;
|
---|
9174 | }
|
---|
9175 |
|
---|
9176 | static void rpccli_samr_Connect3_done(struct tevent_req *subreq)
|
---|
9177 | {
|
---|
9178 | struct tevent_req *req = tevent_req_callback_data(
|
---|
9179 | subreq, struct tevent_req);
|
---|
9180 | struct rpccli_samr_Connect3_state *state = tevent_req_data(
|
---|
9181 | req, struct rpccli_samr_Connect3_state);
|
---|
9182 | NTSTATUS status;
|
---|
9183 | TALLOC_CTX *mem_ctx;
|
---|
9184 |
|
---|
9185 | if (state->out_mem_ctx) {
|
---|
9186 | mem_ctx = state->out_mem_ctx;
|
---|
9187 | } else {
|
---|
9188 | mem_ctx = state;
|
---|
9189 | }
|
---|
9190 |
|
---|
9191 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
9192 | TALLOC_FREE(subreq);
|
---|
9193 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9194 | tevent_req_nterror(req, status);
|
---|
9195 | return;
|
---|
9196 | }
|
---|
9197 |
|
---|
9198 | /* Copy out parameters */
|
---|
9199 | *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
|
---|
9200 |
|
---|
9201 | /* Copy result */
|
---|
9202 | state->orig.out.result = state->tmp.out.result;
|
---|
9203 |
|
---|
9204 | /* Reset temporary structure */
|
---|
9205 | ZERO_STRUCT(state->tmp);
|
---|
9206 |
|
---|
9207 | tevent_req_done(req);
|
---|
9208 | }
|
---|
9209 |
|
---|
9210 | NTSTATUS rpccli_samr_Connect3_recv(struct tevent_req *req,
|
---|
9211 | TALLOC_CTX *mem_ctx,
|
---|
9212 | NTSTATUS *result)
|
---|
9213 | {
|
---|
9214 | struct rpccli_samr_Connect3_state *state = tevent_req_data(
|
---|
9215 | req, struct rpccli_samr_Connect3_state);
|
---|
9216 | NTSTATUS status;
|
---|
9217 |
|
---|
9218 | if (tevent_req_is_nterror(req, &status)) {
|
---|
9219 | tevent_req_received(req);
|
---|
9220 | return status;
|
---|
9221 | }
|
---|
9222 |
|
---|
9223 | /* Steal possbile out parameters to the callers context */
|
---|
9224 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
9225 |
|
---|
9226 | /* Return result */
|
---|
9227 | *result = state->orig.out.result;
|
---|
9228 |
|
---|
9229 | tevent_req_received(req);
|
---|
9230 | return NT_STATUS_OK;
|
---|
9231 | }
|
---|
9232 |
|
---|
9233 | NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
|
---|
9234 | TALLOC_CTX *mem_ctx,
|
---|
9235 | const char *system_name /* [in] [unique,charset(UTF16)] */,
|
---|
9236 | uint32_t unknown /* [in] */,
|
---|
9237 | uint32_t access_mask /* [in] */,
|
---|
9238 | struct policy_handle *connect_handle /* [out] [ref] */)
|
---|
9239 | {
|
---|
9240 | struct samr_Connect3 r;
|
---|
9241 | NTSTATUS status;
|
---|
9242 |
|
---|
9243 | /* In parameters */
|
---|
9244 | r.in.system_name = system_name;
|
---|
9245 | r.in.unknown = unknown;
|
---|
9246 | r.in.access_mask = access_mask;
|
---|
9247 |
|
---|
9248 | status = cli->dispatch(cli,
|
---|
9249 | mem_ctx,
|
---|
9250 | &ndr_table_samr,
|
---|
9251 | NDR_SAMR_CONNECT3,
|
---|
9252 | &r);
|
---|
9253 |
|
---|
9254 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9255 | return status;
|
---|
9256 | }
|
---|
9257 |
|
---|
9258 | if (NT_STATUS_IS_ERR(status)) {
|
---|
9259 | return status;
|
---|
9260 | }
|
---|
9261 |
|
---|
9262 | /* Return variables */
|
---|
9263 | *connect_handle = *r.out.connect_handle;
|
---|
9264 |
|
---|
9265 | /* Return result */
|
---|
9266 | return r.out.result;
|
---|
9267 | }
|
---|
9268 |
|
---|
9269 | struct rpccli_samr_Connect4_state {
|
---|
9270 | struct samr_Connect4 orig;
|
---|
9271 | struct samr_Connect4 tmp;
|
---|
9272 | TALLOC_CTX *out_mem_ctx;
|
---|
9273 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
9274 | };
|
---|
9275 |
|
---|
9276 | static void rpccli_samr_Connect4_done(struct tevent_req *subreq);
|
---|
9277 |
|
---|
9278 | struct tevent_req *rpccli_samr_Connect4_send(TALLOC_CTX *mem_ctx,
|
---|
9279 | struct tevent_context *ev,
|
---|
9280 | struct rpc_pipe_client *cli,
|
---|
9281 | const char *_system_name /* [in] [unique,charset(UTF16)] */,
|
---|
9282 | enum samr_ConnectVersion _client_version /* [in] */,
|
---|
9283 | uint32_t _access_mask /* [in] */,
|
---|
9284 | struct policy_handle *_connect_handle /* [out] [ref] */)
|
---|
9285 | {
|
---|
9286 | struct tevent_req *req;
|
---|
9287 | struct rpccli_samr_Connect4_state *state;
|
---|
9288 | struct tevent_req *subreq;
|
---|
9289 |
|
---|
9290 | req = tevent_req_create(mem_ctx, &state,
|
---|
9291 | struct rpccli_samr_Connect4_state);
|
---|
9292 | if (req == NULL) {
|
---|
9293 | return NULL;
|
---|
9294 | }
|
---|
9295 | state->out_mem_ctx = NULL;
|
---|
9296 | state->dispatch_recv = cli->dispatch_recv;
|
---|
9297 |
|
---|
9298 | /* In parameters */
|
---|
9299 | state->orig.in.system_name = _system_name;
|
---|
9300 | state->orig.in.client_version = _client_version;
|
---|
9301 | state->orig.in.access_mask = _access_mask;
|
---|
9302 |
|
---|
9303 | /* Out parameters */
|
---|
9304 | state->orig.out.connect_handle = _connect_handle;
|
---|
9305 |
|
---|
9306 | /* Result */
|
---|
9307 | ZERO_STRUCT(state->orig.out.result);
|
---|
9308 |
|
---|
9309 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
9310 | "rpccli_samr_Connect4_out_memory");
|
---|
9311 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
9312 | return tevent_req_post(req, ev);
|
---|
9313 | }
|
---|
9314 |
|
---|
9315 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
9316 | state->tmp = state->orig;
|
---|
9317 |
|
---|
9318 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
9319 | &ndr_table_samr,
|
---|
9320 | NDR_SAMR_CONNECT4,
|
---|
9321 | &state->tmp);
|
---|
9322 | if (tevent_req_nomem(subreq, req)) {
|
---|
9323 | return tevent_req_post(req, ev);
|
---|
9324 | }
|
---|
9325 | tevent_req_set_callback(subreq, rpccli_samr_Connect4_done, req);
|
---|
9326 | return req;
|
---|
9327 | }
|
---|
9328 |
|
---|
9329 | static void rpccli_samr_Connect4_done(struct tevent_req *subreq)
|
---|
9330 | {
|
---|
9331 | struct tevent_req *req = tevent_req_callback_data(
|
---|
9332 | subreq, struct tevent_req);
|
---|
9333 | struct rpccli_samr_Connect4_state *state = tevent_req_data(
|
---|
9334 | req, struct rpccli_samr_Connect4_state);
|
---|
9335 | NTSTATUS status;
|
---|
9336 | TALLOC_CTX *mem_ctx;
|
---|
9337 |
|
---|
9338 | if (state->out_mem_ctx) {
|
---|
9339 | mem_ctx = state->out_mem_ctx;
|
---|
9340 | } else {
|
---|
9341 | mem_ctx = state;
|
---|
9342 | }
|
---|
9343 |
|
---|
9344 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
9345 | TALLOC_FREE(subreq);
|
---|
9346 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9347 | tevent_req_nterror(req, status);
|
---|
9348 | return;
|
---|
9349 | }
|
---|
9350 |
|
---|
9351 | /* Copy out parameters */
|
---|
9352 | *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
|
---|
9353 |
|
---|
9354 | /* Copy result */
|
---|
9355 | state->orig.out.result = state->tmp.out.result;
|
---|
9356 |
|
---|
9357 | /* Reset temporary structure */
|
---|
9358 | ZERO_STRUCT(state->tmp);
|
---|
9359 |
|
---|
9360 | tevent_req_done(req);
|
---|
9361 | }
|
---|
9362 |
|
---|
9363 | NTSTATUS rpccli_samr_Connect4_recv(struct tevent_req *req,
|
---|
9364 | TALLOC_CTX *mem_ctx,
|
---|
9365 | NTSTATUS *result)
|
---|
9366 | {
|
---|
9367 | struct rpccli_samr_Connect4_state *state = tevent_req_data(
|
---|
9368 | req, struct rpccli_samr_Connect4_state);
|
---|
9369 | NTSTATUS status;
|
---|
9370 |
|
---|
9371 | if (tevent_req_is_nterror(req, &status)) {
|
---|
9372 | tevent_req_received(req);
|
---|
9373 | return status;
|
---|
9374 | }
|
---|
9375 |
|
---|
9376 | /* Steal possbile out parameters to the callers context */
|
---|
9377 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
9378 |
|
---|
9379 | /* Return result */
|
---|
9380 | *result = state->orig.out.result;
|
---|
9381 |
|
---|
9382 | tevent_req_received(req);
|
---|
9383 | return NT_STATUS_OK;
|
---|
9384 | }
|
---|
9385 |
|
---|
9386 | NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli,
|
---|
9387 | TALLOC_CTX *mem_ctx,
|
---|
9388 | const char *system_name /* [in] [unique,charset(UTF16)] */,
|
---|
9389 | enum samr_ConnectVersion client_version /* [in] */,
|
---|
9390 | uint32_t access_mask /* [in] */,
|
---|
9391 | struct policy_handle *connect_handle /* [out] [ref] */)
|
---|
9392 | {
|
---|
9393 | struct samr_Connect4 r;
|
---|
9394 | NTSTATUS status;
|
---|
9395 |
|
---|
9396 | /* In parameters */
|
---|
9397 | r.in.system_name = system_name;
|
---|
9398 | r.in.client_version = client_version;
|
---|
9399 | r.in.access_mask = access_mask;
|
---|
9400 |
|
---|
9401 | status = cli->dispatch(cli,
|
---|
9402 | mem_ctx,
|
---|
9403 | &ndr_table_samr,
|
---|
9404 | NDR_SAMR_CONNECT4,
|
---|
9405 | &r);
|
---|
9406 |
|
---|
9407 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9408 | return status;
|
---|
9409 | }
|
---|
9410 |
|
---|
9411 | if (NT_STATUS_IS_ERR(status)) {
|
---|
9412 | return status;
|
---|
9413 | }
|
---|
9414 |
|
---|
9415 | /* Return variables */
|
---|
9416 | *connect_handle = *r.out.connect_handle;
|
---|
9417 |
|
---|
9418 | /* Return result */
|
---|
9419 | return r.out.result;
|
---|
9420 | }
|
---|
9421 |
|
---|
9422 | struct rpccli_samr_ChangePasswordUser3_state {
|
---|
9423 | struct samr_ChangePasswordUser3 orig;
|
---|
9424 | struct samr_ChangePasswordUser3 tmp;
|
---|
9425 | TALLOC_CTX *out_mem_ctx;
|
---|
9426 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
9427 | };
|
---|
9428 |
|
---|
9429 | static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq);
|
---|
9430 |
|
---|
9431 | struct tevent_req *rpccli_samr_ChangePasswordUser3_send(TALLOC_CTX *mem_ctx,
|
---|
9432 | struct tevent_context *ev,
|
---|
9433 | struct rpc_pipe_client *cli,
|
---|
9434 | struct lsa_String *_server /* [in] [unique] */,
|
---|
9435 | struct lsa_String *_account /* [in] [ref] */,
|
---|
9436 | struct samr_CryptPassword *_nt_password /* [in] [unique] */,
|
---|
9437 | struct samr_Password *_nt_verifier /* [in] [unique] */,
|
---|
9438 | uint8_t _lm_change /* [in] */,
|
---|
9439 | struct samr_CryptPassword *_lm_password /* [in] [unique] */,
|
---|
9440 | struct samr_Password *_lm_verifier /* [in] [unique] */,
|
---|
9441 | struct samr_CryptPassword *_password3 /* [in] [unique] */,
|
---|
9442 | struct samr_DomInfo1 **_dominfo /* [out] [ref] */,
|
---|
9443 | struct samr_ChangeReject **_reject /* [out] [ref] */)
|
---|
9444 | {
|
---|
9445 | struct tevent_req *req;
|
---|
9446 | struct rpccli_samr_ChangePasswordUser3_state *state;
|
---|
9447 | struct tevent_req *subreq;
|
---|
9448 |
|
---|
9449 | req = tevent_req_create(mem_ctx, &state,
|
---|
9450 | struct rpccli_samr_ChangePasswordUser3_state);
|
---|
9451 | if (req == NULL) {
|
---|
9452 | return NULL;
|
---|
9453 | }
|
---|
9454 | state->out_mem_ctx = NULL;
|
---|
9455 | state->dispatch_recv = cli->dispatch_recv;
|
---|
9456 |
|
---|
9457 | /* In parameters */
|
---|
9458 | state->orig.in.server = _server;
|
---|
9459 | state->orig.in.account = _account;
|
---|
9460 | state->orig.in.nt_password = _nt_password;
|
---|
9461 | state->orig.in.nt_verifier = _nt_verifier;
|
---|
9462 | state->orig.in.lm_change = _lm_change;
|
---|
9463 | state->orig.in.lm_password = _lm_password;
|
---|
9464 | state->orig.in.lm_verifier = _lm_verifier;
|
---|
9465 | state->orig.in.password3 = _password3;
|
---|
9466 |
|
---|
9467 | /* Out parameters */
|
---|
9468 | state->orig.out.dominfo = _dominfo;
|
---|
9469 | state->orig.out.reject = _reject;
|
---|
9470 |
|
---|
9471 | /* Result */
|
---|
9472 | ZERO_STRUCT(state->orig.out.result);
|
---|
9473 |
|
---|
9474 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
9475 | "rpccli_samr_ChangePasswordUser3_out_memory");
|
---|
9476 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
9477 | return tevent_req_post(req, ev);
|
---|
9478 | }
|
---|
9479 |
|
---|
9480 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
9481 | state->tmp = state->orig;
|
---|
9482 |
|
---|
9483 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
9484 | &ndr_table_samr,
|
---|
9485 | NDR_SAMR_CHANGEPASSWORDUSER3,
|
---|
9486 | &state->tmp);
|
---|
9487 | if (tevent_req_nomem(subreq, req)) {
|
---|
9488 | return tevent_req_post(req, ev);
|
---|
9489 | }
|
---|
9490 | tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser3_done, req);
|
---|
9491 | return req;
|
---|
9492 | }
|
---|
9493 |
|
---|
9494 | static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq)
|
---|
9495 | {
|
---|
9496 | struct tevent_req *req = tevent_req_callback_data(
|
---|
9497 | subreq, struct tevent_req);
|
---|
9498 | struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
|
---|
9499 | req, struct rpccli_samr_ChangePasswordUser3_state);
|
---|
9500 | NTSTATUS status;
|
---|
9501 | TALLOC_CTX *mem_ctx;
|
---|
9502 |
|
---|
9503 | if (state->out_mem_ctx) {
|
---|
9504 | mem_ctx = state->out_mem_ctx;
|
---|
9505 | } else {
|
---|
9506 | mem_ctx = state;
|
---|
9507 | }
|
---|
9508 |
|
---|
9509 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
9510 | TALLOC_FREE(subreq);
|
---|
9511 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9512 | tevent_req_nterror(req, status);
|
---|
9513 | return;
|
---|
9514 | }
|
---|
9515 |
|
---|
9516 | /* Copy out parameters */
|
---|
9517 | *state->orig.out.dominfo = *state->tmp.out.dominfo;
|
---|
9518 | *state->orig.out.reject = *state->tmp.out.reject;
|
---|
9519 |
|
---|
9520 | /* Copy result */
|
---|
9521 | state->orig.out.result = state->tmp.out.result;
|
---|
9522 |
|
---|
9523 | /* Reset temporary structure */
|
---|
9524 | ZERO_STRUCT(state->tmp);
|
---|
9525 |
|
---|
9526 | tevent_req_done(req);
|
---|
9527 | }
|
---|
9528 |
|
---|
9529 | NTSTATUS rpccli_samr_ChangePasswordUser3_recv(struct tevent_req *req,
|
---|
9530 | TALLOC_CTX *mem_ctx,
|
---|
9531 | NTSTATUS *result)
|
---|
9532 | {
|
---|
9533 | struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
|
---|
9534 | req, struct rpccli_samr_ChangePasswordUser3_state);
|
---|
9535 | NTSTATUS status;
|
---|
9536 |
|
---|
9537 | if (tevent_req_is_nterror(req, &status)) {
|
---|
9538 | tevent_req_received(req);
|
---|
9539 | return status;
|
---|
9540 | }
|
---|
9541 |
|
---|
9542 | /* Steal possbile out parameters to the callers context */
|
---|
9543 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
9544 |
|
---|
9545 | /* Return result */
|
---|
9546 | *result = state->orig.out.result;
|
---|
9547 |
|
---|
9548 | tevent_req_received(req);
|
---|
9549 | return NT_STATUS_OK;
|
---|
9550 | }
|
---|
9551 |
|
---|
9552 | NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
|
---|
9553 | TALLOC_CTX *mem_ctx,
|
---|
9554 | struct lsa_String *server /* [in] [unique] */,
|
---|
9555 | struct lsa_String *account /* [in] [ref] */,
|
---|
9556 | struct samr_CryptPassword *nt_password /* [in] [unique] */,
|
---|
9557 | struct samr_Password *nt_verifier /* [in] [unique] */,
|
---|
9558 | uint8_t lm_change /* [in] */,
|
---|
9559 | struct samr_CryptPassword *lm_password /* [in] [unique] */,
|
---|
9560 | struct samr_Password *lm_verifier /* [in] [unique] */,
|
---|
9561 | struct samr_CryptPassword *password3 /* [in] [unique] */,
|
---|
9562 | struct samr_DomInfo1 **dominfo /* [out] [ref] */,
|
---|
9563 | struct samr_ChangeReject **reject /* [out] [ref] */)
|
---|
9564 | {
|
---|
9565 | struct samr_ChangePasswordUser3 r;
|
---|
9566 | NTSTATUS status;
|
---|
9567 |
|
---|
9568 | /* In parameters */
|
---|
9569 | r.in.server = server;
|
---|
9570 | r.in.account = account;
|
---|
9571 | r.in.nt_password = nt_password;
|
---|
9572 | r.in.nt_verifier = nt_verifier;
|
---|
9573 | r.in.lm_change = lm_change;
|
---|
9574 | r.in.lm_password = lm_password;
|
---|
9575 | r.in.lm_verifier = lm_verifier;
|
---|
9576 | r.in.password3 = password3;
|
---|
9577 |
|
---|
9578 | status = cli->dispatch(cli,
|
---|
9579 | mem_ctx,
|
---|
9580 | &ndr_table_samr,
|
---|
9581 | NDR_SAMR_CHANGEPASSWORDUSER3,
|
---|
9582 | &r);
|
---|
9583 |
|
---|
9584 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9585 | return status;
|
---|
9586 | }
|
---|
9587 |
|
---|
9588 | if (NT_STATUS_IS_ERR(status)) {
|
---|
9589 | return status;
|
---|
9590 | }
|
---|
9591 |
|
---|
9592 | /* Return variables */
|
---|
9593 | *dominfo = *r.out.dominfo;
|
---|
9594 | *reject = *r.out.reject;
|
---|
9595 |
|
---|
9596 | /* Return result */
|
---|
9597 | return r.out.result;
|
---|
9598 | }
|
---|
9599 |
|
---|
9600 | struct rpccli_samr_Connect5_state {
|
---|
9601 | struct samr_Connect5 orig;
|
---|
9602 | struct samr_Connect5 tmp;
|
---|
9603 | TALLOC_CTX *out_mem_ctx;
|
---|
9604 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
9605 | };
|
---|
9606 |
|
---|
9607 | static void rpccli_samr_Connect5_done(struct tevent_req *subreq);
|
---|
9608 |
|
---|
9609 | struct tevent_req *rpccli_samr_Connect5_send(TALLOC_CTX *mem_ctx,
|
---|
9610 | struct tevent_context *ev,
|
---|
9611 | struct rpc_pipe_client *cli,
|
---|
9612 | const char *_system_name /* [in] [unique,charset(UTF16)] */,
|
---|
9613 | uint32_t _access_mask /* [in] */,
|
---|
9614 | uint32_t _level_in /* [in] */,
|
---|
9615 | union samr_ConnectInfo *_info_in /* [in] [ref,switch_is(level_in)] */,
|
---|
9616 | uint32_t *_level_out /* [out] [ref] */,
|
---|
9617 | union samr_ConnectInfo *_info_out /* [out] [ref,switch_is(*level_out)] */,
|
---|
9618 | struct policy_handle *_connect_handle /* [out] [ref] */)
|
---|
9619 | {
|
---|
9620 | struct tevent_req *req;
|
---|
9621 | struct rpccli_samr_Connect5_state *state;
|
---|
9622 | struct tevent_req *subreq;
|
---|
9623 |
|
---|
9624 | req = tevent_req_create(mem_ctx, &state,
|
---|
9625 | struct rpccli_samr_Connect5_state);
|
---|
9626 | if (req == NULL) {
|
---|
9627 | return NULL;
|
---|
9628 | }
|
---|
9629 | state->out_mem_ctx = NULL;
|
---|
9630 | state->dispatch_recv = cli->dispatch_recv;
|
---|
9631 |
|
---|
9632 | /* In parameters */
|
---|
9633 | state->orig.in.system_name = _system_name;
|
---|
9634 | state->orig.in.access_mask = _access_mask;
|
---|
9635 | state->orig.in.level_in = _level_in;
|
---|
9636 | state->orig.in.info_in = _info_in;
|
---|
9637 |
|
---|
9638 | /* Out parameters */
|
---|
9639 | state->orig.out.level_out = _level_out;
|
---|
9640 | state->orig.out.info_out = _info_out;
|
---|
9641 | state->orig.out.connect_handle = _connect_handle;
|
---|
9642 |
|
---|
9643 | /* Result */
|
---|
9644 | ZERO_STRUCT(state->orig.out.result);
|
---|
9645 |
|
---|
9646 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
9647 | "rpccli_samr_Connect5_out_memory");
|
---|
9648 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
9649 | return tevent_req_post(req, ev);
|
---|
9650 | }
|
---|
9651 |
|
---|
9652 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
9653 | state->tmp = state->orig;
|
---|
9654 |
|
---|
9655 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
9656 | &ndr_table_samr,
|
---|
9657 | NDR_SAMR_CONNECT5,
|
---|
9658 | &state->tmp);
|
---|
9659 | if (tevent_req_nomem(subreq, req)) {
|
---|
9660 | return tevent_req_post(req, ev);
|
---|
9661 | }
|
---|
9662 | tevent_req_set_callback(subreq, rpccli_samr_Connect5_done, req);
|
---|
9663 | return req;
|
---|
9664 | }
|
---|
9665 |
|
---|
9666 | static void rpccli_samr_Connect5_done(struct tevent_req *subreq)
|
---|
9667 | {
|
---|
9668 | struct tevent_req *req = tevent_req_callback_data(
|
---|
9669 | subreq, struct tevent_req);
|
---|
9670 | struct rpccli_samr_Connect5_state *state = tevent_req_data(
|
---|
9671 | req, struct rpccli_samr_Connect5_state);
|
---|
9672 | NTSTATUS status;
|
---|
9673 | TALLOC_CTX *mem_ctx;
|
---|
9674 |
|
---|
9675 | if (state->out_mem_ctx) {
|
---|
9676 | mem_ctx = state->out_mem_ctx;
|
---|
9677 | } else {
|
---|
9678 | mem_ctx = state;
|
---|
9679 | }
|
---|
9680 |
|
---|
9681 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
9682 | TALLOC_FREE(subreq);
|
---|
9683 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9684 | tevent_req_nterror(req, status);
|
---|
9685 | return;
|
---|
9686 | }
|
---|
9687 |
|
---|
9688 | /* Copy out parameters */
|
---|
9689 | *state->orig.out.level_out = *state->tmp.out.level_out;
|
---|
9690 | *state->orig.out.info_out = *state->tmp.out.info_out;
|
---|
9691 | *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
|
---|
9692 |
|
---|
9693 | /* Copy result */
|
---|
9694 | state->orig.out.result = state->tmp.out.result;
|
---|
9695 |
|
---|
9696 | /* Reset temporary structure */
|
---|
9697 | ZERO_STRUCT(state->tmp);
|
---|
9698 |
|
---|
9699 | tevent_req_done(req);
|
---|
9700 | }
|
---|
9701 |
|
---|
9702 | NTSTATUS rpccli_samr_Connect5_recv(struct tevent_req *req,
|
---|
9703 | TALLOC_CTX *mem_ctx,
|
---|
9704 | NTSTATUS *result)
|
---|
9705 | {
|
---|
9706 | struct rpccli_samr_Connect5_state *state = tevent_req_data(
|
---|
9707 | req, struct rpccli_samr_Connect5_state);
|
---|
9708 | NTSTATUS status;
|
---|
9709 |
|
---|
9710 | if (tevent_req_is_nterror(req, &status)) {
|
---|
9711 | tevent_req_received(req);
|
---|
9712 | return status;
|
---|
9713 | }
|
---|
9714 |
|
---|
9715 | /* Steal possbile out parameters to the callers context */
|
---|
9716 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
9717 |
|
---|
9718 | /* Return result */
|
---|
9719 | *result = state->orig.out.result;
|
---|
9720 |
|
---|
9721 | tevent_req_received(req);
|
---|
9722 | return NT_STATUS_OK;
|
---|
9723 | }
|
---|
9724 |
|
---|
9725 | NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli,
|
---|
9726 | TALLOC_CTX *mem_ctx,
|
---|
9727 | const char *system_name /* [in] [unique,charset(UTF16)] */,
|
---|
9728 | uint32_t access_mask /* [in] */,
|
---|
9729 | uint32_t level_in /* [in] */,
|
---|
9730 | union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */,
|
---|
9731 | uint32_t *level_out /* [out] [ref] */,
|
---|
9732 | union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */,
|
---|
9733 | struct policy_handle *connect_handle /* [out] [ref] */)
|
---|
9734 | {
|
---|
9735 | struct samr_Connect5 r;
|
---|
9736 | NTSTATUS status;
|
---|
9737 |
|
---|
9738 | /* In parameters */
|
---|
9739 | r.in.system_name = system_name;
|
---|
9740 | r.in.access_mask = access_mask;
|
---|
9741 | r.in.level_in = level_in;
|
---|
9742 | r.in.info_in = info_in;
|
---|
9743 |
|
---|
9744 | status = cli->dispatch(cli,
|
---|
9745 | mem_ctx,
|
---|
9746 | &ndr_table_samr,
|
---|
9747 | NDR_SAMR_CONNECT5,
|
---|
9748 | &r);
|
---|
9749 |
|
---|
9750 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9751 | return status;
|
---|
9752 | }
|
---|
9753 |
|
---|
9754 | if (NT_STATUS_IS_ERR(status)) {
|
---|
9755 | return status;
|
---|
9756 | }
|
---|
9757 |
|
---|
9758 | /* Return variables */
|
---|
9759 | *level_out = *r.out.level_out;
|
---|
9760 | *info_out = *r.out.info_out;
|
---|
9761 | *connect_handle = *r.out.connect_handle;
|
---|
9762 |
|
---|
9763 | /* Return result */
|
---|
9764 | return r.out.result;
|
---|
9765 | }
|
---|
9766 |
|
---|
9767 | struct rpccli_samr_RidToSid_state {
|
---|
9768 | struct samr_RidToSid orig;
|
---|
9769 | struct samr_RidToSid tmp;
|
---|
9770 | TALLOC_CTX *out_mem_ctx;
|
---|
9771 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
9772 | };
|
---|
9773 |
|
---|
9774 | static void rpccli_samr_RidToSid_done(struct tevent_req *subreq);
|
---|
9775 |
|
---|
9776 | struct tevent_req *rpccli_samr_RidToSid_send(TALLOC_CTX *mem_ctx,
|
---|
9777 | struct tevent_context *ev,
|
---|
9778 | struct rpc_pipe_client *cli,
|
---|
9779 | struct policy_handle *_domain_handle /* [in] [ref] */,
|
---|
9780 | uint32_t _rid /* [in] */,
|
---|
9781 | struct dom_sid2 **_sid /* [out] [ref] */)
|
---|
9782 | {
|
---|
9783 | struct tevent_req *req;
|
---|
9784 | struct rpccli_samr_RidToSid_state *state;
|
---|
9785 | struct tevent_req *subreq;
|
---|
9786 |
|
---|
9787 | req = tevent_req_create(mem_ctx, &state,
|
---|
9788 | struct rpccli_samr_RidToSid_state);
|
---|
9789 | if (req == NULL) {
|
---|
9790 | return NULL;
|
---|
9791 | }
|
---|
9792 | state->out_mem_ctx = NULL;
|
---|
9793 | state->dispatch_recv = cli->dispatch_recv;
|
---|
9794 |
|
---|
9795 | /* In parameters */
|
---|
9796 | state->orig.in.domain_handle = _domain_handle;
|
---|
9797 | state->orig.in.rid = _rid;
|
---|
9798 |
|
---|
9799 | /* Out parameters */
|
---|
9800 | state->orig.out.sid = _sid;
|
---|
9801 |
|
---|
9802 | /* Result */
|
---|
9803 | ZERO_STRUCT(state->orig.out.result);
|
---|
9804 |
|
---|
9805 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
9806 | "rpccli_samr_RidToSid_out_memory");
|
---|
9807 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
9808 | return tevent_req_post(req, ev);
|
---|
9809 | }
|
---|
9810 |
|
---|
9811 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
9812 | state->tmp = state->orig;
|
---|
9813 |
|
---|
9814 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
9815 | &ndr_table_samr,
|
---|
9816 | NDR_SAMR_RIDTOSID,
|
---|
9817 | &state->tmp);
|
---|
9818 | if (tevent_req_nomem(subreq, req)) {
|
---|
9819 | return tevent_req_post(req, ev);
|
---|
9820 | }
|
---|
9821 | tevent_req_set_callback(subreq, rpccli_samr_RidToSid_done, req);
|
---|
9822 | return req;
|
---|
9823 | }
|
---|
9824 |
|
---|
9825 | static void rpccli_samr_RidToSid_done(struct tevent_req *subreq)
|
---|
9826 | {
|
---|
9827 | struct tevent_req *req = tevent_req_callback_data(
|
---|
9828 | subreq, struct tevent_req);
|
---|
9829 | struct rpccli_samr_RidToSid_state *state = tevent_req_data(
|
---|
9830 | req, struct rpccli_samr_RidToSid_state);
|
---|
9831 | NTSTATUS status;
|
---|
9832 | TALLOC_CTX *mem_ctx;
|
---|
9833 |
|
---|
9834 | if (state->out_mem_ctx) {
|
---|
9835 | mem_ctx = state->out_mem_ctx;
|
---|
9836 | } else {
|
---|
9837 | mem_ctx = state;
|
---|
9838 | }
|
---|
9839 |
|
---|
9840 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
9841 | TALLOC_FREE(subreq);
|
---|
9842 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9843 | tevent_req_nterror(req, status);
|
---|
9844 | return;
|
---|
9845 | }
|
---|
9846 |
|
---|
9847 | /* Copy out parameters */
|
---|
9848 | *state->orig.out.sid = *state->tmp.out.sid;
|
---|
9849 |
|
---|
9850 | /* Copy result */
|
---|
9851 | state->orig.out.result = state->tmp.out.result;
|
---|
9852 |
|
---|
9853 | /* Reset temporary structure */
|
---|
9854 | ZERO_STRUCT(state->tmp);
|
---|
9855 |
|
---|
9856 | tevent_req_done(req);
|
---|
9857 | }
|
---|
9858 |
|
---|
9859 | NTSTATUS rpccli_samr_RidToSid_recv(struct tevent_req *req,
|
---|
9860 | TALLOC_CTX *mem_ctx,
|
---|
9861 | NTSTATUS *result)
|
---|
9862 | {
|
---|
9863 | struct rpccli_samr_RidToSid_state *state = tevent_req_data(
|
---|
9864 | req, struct rpccli_samr_RidToSid_state);
|
---|
9865 | NTSTATUS status;
|
---|
9866 |
|
---|
9867 | if (tevent_req_is_nterror(req, &status)) {
|
---|
9868 | tevent_req_received(req);
|
---|
9869 | return status;
|
---|
9870 | }
|
---|
9871 |
|
---|
9872 | /* Steal possbile out parameters to the callers context */
|
---|
9873 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
9874 |
|
---|
9875 | /* Return result */
|
---|
9876 | *result = state->orig.out.result;
|
---|
9877 |
|
---|
9878 | tevent_req_received(req);
|
---|
9879 | return NT_STATUS_OK;
|
---|
9880 | }
|
---|
9881 |
|
---|
9882 | NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli,
|
---|
9883 | TALLOC_CTX *mem_ctx,
|
---|
9884 | struct policy_handle *domain_handle /* [in] [ref] */,
|
---|
9885 | uint32_t rid /* [in] */,
|
---|
9886 | struct dom_sid2 **sid /* [out] [ref] */)
|
---|
9887 | {
|
---|
9888 | struct samr_RidToSid r;
|
---|
9889 | NTSTATUS status;
|
---|
9890 |
|
---|
9891 | /* In parameters */
|
---|
9892 | r.in.domain_handle = domain_handle;
|
---|
9893 | r.in.rid = rid;
|
---|
9894 |
|
---|
9895 | status = cli->dispatch(cli,
|
---|
9896 | mem_ctx,
|
---|
9897 | &ndr_table_samr,
|
---|
9898 | NDR_SAMR_RIDTOSID,
|
---|
9899 | &r);
|
---|
9900 |
|
---|
9901 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9902 | return status;
|
---|
9903 | }
|
---|
9904 |
|
---|
9905 | if (NT_STATUS_IS_ERR(status)) {
|
---|
9906 | return status;
|
---|
9907 | }
|
---|
9908 |
|
---|
9909 | /* Return variables */
|
---|
9910 | *sid = *r.out.sid;
|
---|
9911 |
|
---|
9912 | /* Return result */
|
---|
9913 | return r.out.result;
|
---|
9914 | }
|
---|
9915 |
|
---|
9916 | struct rpccli_samr_SetDsrmPassword_state {
|
---|
9917 | struct samr_SetDsrmPassword orig;
|
---|
9918 | struct samr_SetDsrmPassword tmp;
|
---|
9919 | TALLOC_CTX *out_mem_ctx;
|
---|
9920 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
9921 | };
|
---|
9922 |
|
---|
9923 | static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq);
|
---|
9924 |
|
---|
9925 | struct tevent_req *rpccli_samr_SetDsrmPassword_send(TALLOC_CTX *mem_ctx,
|
---|
9926 | struct tevent_context *ev,
|
---|
9927 | struct rpc_pipe_client *cli,
|
---|
9928 | struct lsa_String *_name /* [in] [unique] */,
|
---|
9929 | uint32_t _unknown /* [in] */,
|
---|
9930 | struct samr_Password *_hash /* [in] [unique] */)
|
---|
9931 | {
|
---|
9932 | struct tevent_req *req;
|
---|
9933 | struct rpccli_samr_SetDsrmPassword_state *state;
|
---|
9934 | struct tevent_req *subreq;
|
---|
9935 |
|
---|
9936 | req = tevent_req_create(mem_ctx, &state,
|
---|
9937 | struct rpccli_samr_SetDsrmPassword_state);
|
---|
9938 | if (req == NULL) {
|
---|
9939 | return NULL;
|
---|
9940 | }
|
---|
9941 | state->out_mem_ctx = NULL;
|
---|
9942 | state->dispatch_recv = cli->dispatch_recv;
|
---|
9943 |
|
---|
9944 | /* In parameters */
|
---|
9945 | state->orig.in.name = _name;
|
---|
9946 | state->orig.in.unknown = _unknown;
|
---|
9947 | state->orig.in.hash = _hash;
|
---|
9948 |
|
---|
9949 | /* Out parameters */
|
---|
9950 |
|
---|
9951 | /* Result */
|
---|
9952 | ZERO_STRUCT(state->orig.out.result);
|
---|
9953 |
|
---|
9954 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
9955 | state->tmp = state->orig;
|
---|
9956 |
|
---|
9957 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
9958 | &ndr_table_samr,
|
---|
9959 | NDR_SAMR_SETDSRMPASSWORD,
|
---|
9960 | &state->tmp);
|
---|
9961 | if (tevent_req_nomem(subreq, req)) {
|
---|
9962 | return tevent_req_post(req, ev);
|
---|
9963 | }
|
---|
9964 | tevent_req_set_callback(subreq, rpccli_samr_SetDsrmPassword_done, req);
|
---|
9965 | return req;
|
---|
9966 | }
|
---|
9967 |
|
---|
9968 | static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq)
|
---|
9969 | {
|
---|
9970 | struct tevent_req *req = tevent_req_callback_data(
|
---|
9971 | subreq, struct tevent_req);
|
---|
9972 | struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
|
---|
9973 | req, struct rpccli_samr_SetDsrmPassword_state);
|
---|
9974 | NTSTATUS status;
|
---|
9975 | TALLOC_CTX *mem_ctx;
|
---|
9976 |
|
---|
9977 | if (state->out_mem_ctx) {
|
---|
9978 | mem_ctx = state->out_mem_ctx;
|
---|
9979 | } else {
|
---|
9980 | mem_ctx = state;
|
---|
9981 | }
|
---|
9982 |
|
---|
9983 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
9984 | TALLOC_FREE(subreq);
|
---|
9985 | if (!NT_STATUS_IS_OK(status)) {
|
---|
9986 | tevent_req_nterror(req, status);
|
---|
9987 | return;
|
---|
9988 | }
|
---|
9989 |
|
---|
9990 | /* Copy out parameters */
|
---|
9991 |
|
---|
9992 | /* Copy result */
|
---|
9993 | state->orig.out.result = state->tmp.out.result;
|
---|
9994 |
|
---|
9995 | /* Reset temporary structure */
|
---|
9996 | ZERO_STRUCT(state->tmp);
|
---|
9997 |
|
---|
9998 | tevent_req_done(req);
|
---|
9999 | }
|
---|
10000 |
|
---|
10001 | NTSTATUS rpccli_samr_SetDsrmPassword_recv(struct tevent_req *req,
|
---|
10002 | TALLOC_CTX *mem_ctx,
|
---|
10003 | NTSTATUS *result)
|
---|
10004 | {
|
---|
10005 | struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
|
---|
10006 | req, struct rpccli_samr_SetDsrmPassword_state);
|
---|
10007 | NTSTATUS status;
|
---|
10008 |
|
---|
10009 | if (tevent_req_is_nterror(req, &status)) {
|
---|
10010 | tevent_req_received(req);
|
---|
10011 | return status;
|
---|
10012 | }
|
---|
10013 |
|
---|
10014 | /* Steal possbile out parameters to the callers context */
|
---|
10015 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
10016 |
|
---|
10017 | /* Return result */
|
---|
10018 | *result = state->orig.out.result;
|
---|
10019 |
|
---|
10020 | tevent_req_received(req);
|
---|
10021 | return NT_STATUS_OK;
|
---|
10022 | }
|
---|
10023 |
|
---|
10024 | NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli,
|
---|
10025 | TALLOC_CTX *mem_ctx,
|
---|
10026 | struct lsa_String *name /* [in] [unique] */,
|
---|
10027 | uint32_t unknown /* [in] */,
|
---|
10028 | struct samr_Password *hash /* [in] [unique] */)
|
---|
10029 | {
|
---|
10030 | struct samr_SetDsrmPassword r;
|
---|
10031 | NTSTATUS status;
|
---|
10032 |
|
---|
10033 | /* In parameters */
|
---|
10034 | r.in.name = name;
|
---|
10035 | r.in.unknown = unknown;
|
---|
10036 | r.in.hash = hash;
|
---|
10037 |
|
---|
10038 | status = cli->dispatch(cli,
|
---|
10039 | mem_ctx,
|
---|
10040 | &ndr_table_samr,
|
---|
10041 | NDR_SAMR_SETDSRMPASSWORD,
|
---|
10042 | &r);
|
---|
10043 |
|
---|
10044 | if (!NT_STATUS_IS_OK(status)) {
|
---|
10045 | return status;
|
---|
10046 | }
|
---|
10047 |
|
---|
10048 | if (NT_STATUS_IS_ERR(status)) {
|
---|
10049 | return status;
|
---|
10050 | }
|
---|
10051 |
|
---|
10052 | /* Return variables */
|
---|
10053 |
|
---|
10054 | /* Return result */
|
---|
10055 | return r.out.result;
|
---|
10056 | }
|
---|
10057 |
|
---|
10058 | struct rpccli_samr_ValidatePassword_state {
|
---|
10059 | struct samr_ValidatePassword orig;
|
---|
10060 | struct samr_ValidatePassword tmp;
|
---|
10061 | TALLOC_CTX *out_mem_ctx;
|
---|
10062 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
10063 | };
|
---|
10064 |
|
---|
10065 | static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq);
|
---|
10066 |
|
---|
10067 | struct tevent_req *rpccli_samr_ValidatePassword_send(TALLOC_CTX *mem_ctx,
|
---|
10068 | struct tevent_context *ev,
|
---|
10069 | struct rpc_pipe_client *cli,
|
---|
10070 | enum samr_ValidatePasswordLevel _level /* [in] */,
|
---|
10071 | union samr_ValidatePasswordReq *_req /* [in] [ref,switch_is(level)] */,
|
---|
10072 | union samr_ValidatePasswordRep **_rep /* [out] [ref,switch_is(level)] */)
|
---|
10073 | {
|
---|
10074 | struct tevent_req *req;
|
---|
10075 | struct rpccli_samr_ValidatePassword_state *state;
|
---|
10076 | struct tevent_req *subreq;
|
---|
10077 |
|
---|
10078 | req = tevent_req_create(mem_ctx, &state,
|
---|
10079 | struct rpccli_samr_ValidatePassword_state);
|
---|
10080 | if (req == NULL) {
|
---|
10081 | return NULL;
|
---|
10082 | }
|
---|
10083 | state->out_mem_ctx = NULL;
|
---|
10084 | state->dispatch_recv = cli->dispatch_recv;
|
---|
10085 |
|
---|
10086 | /* In parameters */
|
---|
10087 | state->orig.in.level = _level;
|
---|
10088 | state->orig.in.req = _req;
|
---|
10089 |
|
---|
10090 | /* Out parameters */
|
---|
10091 | state->orig.out.rep = _rep;
|
---|
10092 |
|
---|
10093 | /* Result */
|
---|
10094 | ZERO_STRUCT(state->orig.out.result);
|
---|
10095 |
|
---|
10096 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
10097 | "rpccli_samr_ValidatePassword_out_memory");
|
---|
10098 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
10099 | return tevent_req_post(req, ev);
|
---|
10100 | }
|
---|
10101 |
|
---|
10102 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
10103 | state->tmp = state->orig;
|
---|
10104 |
|
---|
10105 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
10106 | &ndr_table_samr,
|
---|
10107 | NDR_SAMR_VALIDATEPASSWORD,
|
---|
10108 | &state->tmp);
|
---|
10109 | if (tevent_req_nomem(subreq, req)) {
|
---|
10110 | return tevent_req_post(req, ev);
|
---|
10111 | }
|
---|
10112 | tevent_req_set_callback(subreq, rpccli_samr_ValidatePassword_done, req);
|
---|
10113 | return req;
|
---|
10114 | }
|
---|
10115 |
|
---|
10116 | static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq)
|
---|
10117 | {
|
---|
10118 | struct tevent_req *req = tevent_req_callback_data(
|
---|
10119 | subreq, struct tevent_req);
|
---|
10120 | struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
|
---|
10121 | req, struct rpccli_samr_ValidatePassword_state);
|
---|
10122 | NTSTATUS status;
|
---|
10123 | TALLOC_CTX *mem_ctx;
|
---|
10124 |
|
---|
10125 | if (state->out_mem_ctx) {
|
---|
10126 | mem_ctx = state->out_mem_ctx;
|
---|
10127 | } else {
|
---|
10128 | mem_ctx = state;
|
---|
10129 | }
|
---|
10130 |
|
---|
10131 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
10132 | TALLOC_FREE(subreq);
|
---|
10133 | if (!NT_STATUS_IS_OK(status)) {
|
---|
10134 | tevent_req_nterror(req, status);
|
---|
10135 | return;
|
---|
10136 | }
|
---|
10137 |
|
---|
10138 | /* Copy out parameters */
|
---|
10139 | *state->orig.out.rep = *state->tmp.out.rep;
|
---|
10140 |
|
---|
10141 | /* Copy result */
|
---|
10142 | state->orig.out.result = state->tmp.out.result;
|
---|
10143 |
|
---|
10144 | /* Reset temporary structure */
|
---|
10145 | ZERO_STRUCT(state->tmp);
|
---|
10146 |
|
---|
10147 | tevent_req_done(req);
|
---|
10148 | }
|
---|
10149 |
|
---|
10150 | NTSTATUS rpccli_samr_ValidatePassword_recv(struct tevent_req *req,
|
---|
10151 | TALLOC_CTX *mem_ctx,
|
---|
10152 | NTSTATUS *result)
|
---|
10153 | {
|
---|
10154 | struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
|
---|
10155 | req, struct rpccli_samr_ValidatePassword_state);
|
---|
10156 | NTSTATUS status;
|
---|
10157 |
|
---|
10158 | if (tevent_req_is_nterror(req, &status)) {
|
---|
10159 | tevent_req_received(req);
|
---|
10160 | return status;
|
---|
10161 | }
|
---|
10162 |
|
---|
10163 | /* Steal possbile out parameters to the callers context */
|
---|
10164 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
10165 |
|
---|
10166 | /* Return result */
|
---|
10167 | *result = state->orig.out.result;
|
---|
10168 |
|
---|
10169 | tevent_req_received(req);
|
---|
10170 | return NT_STATUS_OK;
|
---|
10171 | }
|
---|
10172 |
|
---|
10173 | NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli,
|
---|
10174 | TALLOC_CTX *mem_ctx,
|
---|
10175 | enum samr_ValidatePasswordLevel level /* [in] */,
|
---|
10176 | union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */,
|
---|
10177 | union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */)
|
---|
10178 | {
|
---|
10179 | struct samr_ValidatePassword r;
|
---|
10180 | NTSTATUS status;
|
---|
10181 |
|
---|
10182 | /* In parameters */
|
---|
10183 | r.in.level = level;
|
---|
10184 | r.in.req = req;
|
---|
10185 |
|
---|
10186 | status = cli->dispatch(cli,
|
---|
10187 | mem_ctx,
|
---|
10188 | &ndr_table_samr,
|
---|
10189 | NDR_SAMR_VALIDATEPASSWORD,
|
---|
10190 | &r);
|
---|
10191 |
|
---|
10192 | if (!NT_STATUS_IS_OK(status)) {
|
---|
10193 | return status;
|
---|
10194 | }
|
---|
10195 |
|
---|
10196 | if (NT_STATUS_IS_ERR(status)) {
|
---|
10197 | return status;
|
---|
10198 | }
|
---|
10199 |
|
---|
10200 | /* Return variables */
|
---|
10201 | *rep = *r.out.rep;
|
---|
10202 |
|
---|
10203 | /* Return result */
|
---|
10204 | return r.out.result;
|
---|
10205 | }
|
---|
10206 |
|
---|