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_winreg.h"
|
---|
8 |
|
---|
9 | struct rpccli_winreg_OpenHKCR_state {
|
---|
10 | struct winreg_OpenHKCR orig;
|
---|
11 | struct winreg_OpenHKCR 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_winreg_OpenHKCR_done(struct tevent_req *subreq);
|
---|
17 |
|
---|
18 | struct tevent_req *rpccli_winreg_OpenHKCR_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 *_handle /* [out] [ref] */)
|
---|
24 | {
|
---|
25 | struct tevent_req *req;
|
---|
26 | struct rpccli_winreg_OpenHKCR_state *state;
|
---|
27 | struct tevent_req *subreq;
|
---|
28 |
|
---|
29 | req = tevent_req_create(mem_ctx, &state,
|
---|
30 | struct rpccli_winreg_OpenHKCR_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.handle = _handle;
|
---|
43 |
|
---|
44 | /* Result */
|
---|
45 | ZERO_STRUCT(state->orig.out.result);
|
---|
46 |
|
---|
47 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
48 | "rpccli_winreg_OpenHKCR_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_winreg,
|
---|
58 | NDR_WINREG_OPENHKCR,
|
---|
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_winreg_OpenHKCR_done, req);
|
---|
64 | return req;
|
---|
65 | }
|
---|
66 |
|
---|
67 | static void rpccli_winreg_OpenHKCR_done(struct tevent_req *subreq)
|
---|
68 | {
|
---|
69 | struct tevent_req *req = tevent_req_callback_data(
|
---|
70 | subreq, struct tevent_req);
|
---|
71 | struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
|
---|
72 | req, struct rpccli_winreg_OpenHKCR_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.handle = *state->tmp.out.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_winreg_OpenHKCR_recv(struct tevent_req *req,
|
---|
102 | TALLOC_CTX *mem_ctx,
|
---|
103 | WERROR *result)
|
---|
104 | {
|
---|
105 | struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
|
---|
106 | req, struct rpccli_winreg_OpenHKCR_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_winreg_OpenHKCR(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 *handle /* [out] [ref] */,
|
---|
129 | WERROR *werror)
|
---|
130 | {
|
---|
131 | struct winreg_OpenHKCR r;
|
---|
132 | NTSTATUS status;
|
---|
133 |
|
---|
134 | /* In parameters */
|
---|
135 | r.in.system_name = system_name;
|
---|
136 | r.in.access_mask = access_mask;
|
---|
137 |
|
---|
138 | status = cli->dispatch(cli,
|
---|
139 | mem_ctx,
|
---|
140 | &ndr_table_winreg,
|
---|
141 | NDR_WINREG_OPENHKCR,
|
---|
142 | &r);
|
---|
143 |
|
---|
144 | if (!NT_STATUS_IS_OK(status)) {
|
---|
145 | return status;
|
---|
146 | }
|
---|
147 |
|
---|
148 | if (NT_STATUS_IS_ERR(status)) {
|
---|
149 | return status;
|
---|
150 | }
|
---|
151 |
|
---|
152 | /* Return variables */
|
---|
153 | *handle = *r.out.handle;
|
---|
154 |
|
---|
155 | /* Return result */
|
---|
156 | if (werror) {
|
---|
157 | *werror = r.out.result;
|
---|
158 | }
|
---|
159 |
|
---|
160 | return werror_to_ntstatus(r.out.result);
|
---|
161 | }
|
---|
162 |
|
---|
163 | struct rpccli_winreg_OpenHKCU_state {
|
---|
164 | struct winreg_OpenHKCU orig;
|
---|
165 | struct winreg_OpenHKCU tmp;
|
---|
166 | TALLOC_CTX *out_mem_ctx;
|
---|
167 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
168 | };
|
---|
169 |
|
---|
170 | static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq);
|
---|
171 |
|
---|
172 | struct tevent_req *rpccli_winreg_OpenHKCU_send(TALLOC_CTX *mem_ctx,
|
---|
173 | struct tevent_context *ev,
|
---|
174 | struct rpc_pipe_client *cli,
|
---|
175 | uint16_t *_system_name /* [in] [unique] */,
|
---|
176 | uint32_t _access_mask /* [in] */,
|
---|
177 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
178 | {
|
---|
179 | struct tevent_req *req;
|
---|
180 | struct rpccli_winreg_OpenHKCU_state *state;
|
---|
181 | struct tevent_req *subreq;
|
---|
182 |
|
---|
183 | req = tevent_req_create(mem_ctx, &state,
|
---|
184 | struct rpccli_winreg_OpenHKCU_state);
|
---|
185 | if (req == NULL) {
|
---|
186 | return NULL;
|
---|
187 | }
|
---|
188 | state->out_mem_ctx = NULL;
|
---|
189 | state->dispatch_recv = cli->dispatch_recv;
|
---|
190 |
|
---|
191 | /* In parameters */
|
---|
192 | state->orig.in.system_name = _system_name;
|
---|
193 | state->orig.in.access_mask = _access_mask;
|
---|
194 |
|
---|
195 | /* Out parameters */
|
---|
196 | state->orig.out.handle = _handle;
|
---|
197 |
|
---|
198 | /* Result */
|
---|
199 | ZERO_STRUCT(state->orig.out.result);
|
---|
200 |
|
---|
201 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
202 | "rpccli_winreg_OpenHKCU_out_memory");
|
---|
203 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
204 | return tevent_req_post(req, ev);
|
---|
205 | }
|
---|
206 |
|
---|
207 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
208 | state->tmp = state->orig;
|
---|
209 |
|
---|
210 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
211 | &ndr_table_winreg,
|
---|
212 | NDR_WINREG_OPENHKCU,
|
---|
213 | &state->tmp);
|
---|
214 | if (tevent_req_nomem(subreq, req)) {
|
---|
215 | return tevent_req_post(req, ev);
|
---|
216 | }
|
---|
217 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCU_done, req);
|
---|
218 | return req;
|
---|
219 | }
|
---|
220 |
|
---|
221 | static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq)
|
---|
222 | {
|
---|
223 | struct tevent_req *req = tevent_req_callback_data(
|
---|
224 | subreq, struct tevent_req);
|
---|
225 | struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
|
---|
226 | req, struct rpccli_winreg_OpenHKCU_state);
|
---|
227 | NTSTATUS status;
|
---|
228 | TALLOC_CTX *mem_ctx;
|
---|
229 |
|
---|
230 | if (state->out_mem_ctx) {
|
---|
231 | mem_ctx = state->out_mem_ctx;
|
---|
232 | } else {
|
---|
233 | mem_ctx = state;
|
---|
234 | }
|
---|
235 |
|
---|
236 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
237 | TALLOC_FREE(subreq);
|
---|
238 | if (!NT_STATUS_IS_OK(status)) {
|
---|
239 | tevent_req_nterror(req, status);
|
---|
240 | return;
|
---|
241 | }
|
---|
242 |
|
---|
243 | /* Copy out parameters */
|
---|
244 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
245 |
|
---|
246 | /* Copy result */
|
---|
247 | state->orig.out.result = state->tmp.out.result;
|
---|
248 |
|
---|
249 | /* Reset temporary structure */
|
---|
250 | ZERO_STRUCT(state->tmp);
|
---|
251 |
|
---|
252 | tevent_req_done(req);
|
---|
253 | }
|
---|
254 |
|
---|
255 | NTSTATUS rpccli_winreg_OpenHKCU_recv(struct tevent_req *req,
|
---|
256 | TALLOC_CTX *mem_ctx,
|
---|
257 | WERROR *result)
|
---|
258 | {
|
---|
259 | struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
|
---|
260 | req, struct rpccli_winreg_OpenHKCU_state);
|
---|
261 | NTSTATUS status;
|
---|
262 |
|
---|
263 | if (tevent_req_is_nterror(req, &status)) {
|
---|
264 | tevent_req_received(req);
|
---|
265 | return status;
|
---|
266 | }
|
---|
267 |
|
---|
268 | /* Steal possbile out parameters to the callers context */
|
---|
269 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
270 |
|
---|
271 | /* Return result */
|
---|
272 | *result = state->orig.out.result;
|
---|
273 |
|
---|
274 | tevent_req_received(req);
|
---|
275 | return NT_STATUS_OK;
|
---|
276 | }
|
---|
277 |
|
---|
278 | NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli,
|
---|
279 | TALLOC_CTX *mem_ctx,
|
---|
280 | uint16_t *system_name /* [in] [unique] */,
|
---|
281 | uint32_t access_mask /* [in] */,
|
---|
282 | struct policy_handle *handle /* [out] [ref] */,
|
---|
283 | WERROR *werror)
|
---|
284 | {
|
---|
285 | struct winreg_OpenHKCU r;
|
---|
286 | NTSTATUS status;
|
---|
287 |
|
---|
288 | /* In parameters */
|
---|
289 | r.in.system_name = system_name;
|
---|
290 | r.in.access_mask = access_mask;
|
---|
291 |
|
---|
292 | status = cli->dispatch(cli,
|
---|
293 | mem_ctx,
|
---|
294 | &ndr_table_winreg,
|
---|
295 | NDR_WINREG_OPENHKCU,
|
---|
296 | &r);
|
---|
297 |
|
---|
298 | if (!NT_STATUS_IS_OK(status)) {
|
---|
299 | return status;
|
---|
300 | }
|
---|
301 |
|
---|
302 | if (NT_STATUS_IS_ERR(status)) {
|
---|
303 | return status;
|
---|
304 | }
|
---|
305 |
|
---|
306 | /* Return variables */
|
---|
307 | *handle = *r.out.handle;
|
---|
308 |
|
---|
309 | /* Return result */
|
---|
310 | if (werror) {
|
---|
311 | *werror = r.out.result;
|
---|
312 | }
|
---|
313 |
|
---|
314 | return werror_to_ntstatus(r.out.result);
|
---|
315 | }
|
---|
316 |
|
---|
317 | struct rpccli_winreg_OpenHKLM_state {
|
---|
318 | struct winreg_OpenHKLM orig;
|
---|
319 | struct winreg_OpenHKLM tmp;
|
---|
320 | TALLOC_CTX *out_mem_ctx;
|
---|
321 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
322 | };
|
---|
323 |
|
---|
324 | static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq);
|
---|
325 |
|
---|
326 | struct tevent_req *rpccli_winreg_OpenHKLM_send(TALLOC_CTX *mem_ctx,
|
---|
327 | struct tevent_context *ev,
|
---|
328 | struct rpc_pipe_client *cli,
|
---|
329 | uint16_t *_system_name /* [in] [unique] */,
|
---|
330 | uint32_t _access_mask /* [in] */,
|
---|
331 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
332 | {
|
---|
333 | struct tevent_req *req;
|
---|
334 | struct rpccli_winreg_OpenHKLM_state *state;
|
---|
335 | struct tevent_req *subreq;
|
---|
336 |
|
---|
337 | req = tevent_req_create(mem_ctx, &state,
|
---|
338 | struct rpccli_winreg_OpenHKLM_state);
|
---|
339 | if (req == NULL) {
|
---|
340 | return NULL;
|
---|
341 | }
|
---|
342 | state->out_mem_ctx = NULL;
|
---|
343 | state->dispatch_recv = cli->dispatch_recv;
|
---|
344 |
|
---|
345 | /* In parameters */
|
---|
346 | state->orig.in.system_name = _system_name;
|
---|
347 | state->orig.in.access_mask = _access_mask;
|
---|
348 |
|
---|
349 | /* Out parameters */
|
---|
350 | state->orig.out.handle = _handle;
|
---|
351 |
|
---|
352 | /* Result */
|
---|
353 | ZERO_STRUCT(state->orig.out.result);
|
---|
354 |
|
---|
355 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
356 | "rpccli_winreg_OpenHKLM_out_memory");
|
---|
357 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
358 | return tevent_req_post(req, ev);
|
---|
359 | }
|
---|
360 |
|
---|
361 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
362 | state->tmp = state->orig;
|
---|
363 |
|
---|
364 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
365 | &ndr_table_winreg,
|
---|
366 | NDR_WINREG_OPENHKLM,
|
---|
367 | &state->tmp);
|
---|
368 | if (tevent_req_nomem(subreq, req)) {
|
---|
369 | return tevent_req_post(req, ev);
|
---|
370 | }
|
---|
371 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKLM_done, req);
|
---|
372 | return req;
|
---|
373 | }
|
---|
374 |
|
---|
375 | static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq)
|
---|
376 | {
|
---|
377 | struct tevent_req *req = tevent_req_callback_data(
|
---|
378 | subreq, struct tevent_req);
|
---|
379 | struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
|
---|
380 | req, struct rpccli_winreg_OpenHKLM_state);
|
---|
381 | NTSTATUS status;
|
---|
382 | TALLOC_CTX *mem_ctx;
|
---|
383 |
|
---|
384 | if (state->out_mem_ctx) {
|
---|
385 | mem_ctx = state->out_mem_ctx;
|
---|
386 | } else {
|
---|
387 | mem_ctx = state;
|
---|
388 | }
|
---|
389 |
|
---|
390 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
391 | TALLOC_FREE(subreq);
|
---|
392 | if (!NT_STATUS_IS_OK(status)) {
|
---|
393 | tevent_req_nterror(req, status);
|
---|
394 | return;
|
---|
395 | }
|
---|
396 |
|
---|
397 | /* Copy out parameters */
|
---|
398 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
399 |
|
---|
400 | /* Copy result */
|
---|
401 | state->orig.out.result = state->tmp.out.result;
|
---|
402 |
|
---|
403 | /* Reset temporary structure */
|
---|
404 | ZERO_STRUCT(state->tmp);
|
---|
405 |
|
---|
406 | tevent_req_done(req);
|
---|
407 | }
|
---|
408 |
|
---|
409 | NTSTATUS rpccli_winreg_OpenHKLM_recv(struct tevent_req *req,
|
---|
410 | TALLOC_CTX *mem_ctx,
|
---|
411 | WERROR *result)
|
---|
412 | {
|
---|
413 | struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
|
---|
414 | req, struct rpccli_winreg_OpenHKLM_state);
|
---|
415 | NTSTATUS status;
|
---|
416 |
|
---|
417 | if (tevent_req_is_nterror(req, &status)) {
|
---|
418 | tevent_req_received(req);
|
---|
419 | return status;
|
---|
420 | }
|
---|
421 |
|
---|
422 | /* Steal possbile out parameters to the callers context */
|
---|
423 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
424 |
|
---|
425 | /* Return result */
|
---|
426 | *result = state->orig.out.result;
|
---|
427 |
|
---|
428 | tevent_req_received(req);
|
---|
429 | return NT_STATUS_OK;
|
---|
430 | }
|
---|
431 |
|
---|
432 | NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli,
|
---|
433 | TALLOC_CTX *mem_ctx,
|
---|
434 | uint16_t *system_name /* [in] [unique] */,
|
---|
435 | uint32_t access_mask /* [in] */,
|
---|
436 | struct policy_handle *handle /* [out] [ref] */,
|
---|
437 | WERROR *werror)
|
---|
438 | {
|
---|
439 | struct winreg_OpenHKLM r;
|
---|
440 | NTSTATUS status;
|
---|
441 |
|
---|
442 | /* In parameters */
|
---|
443 | r.in.system_name = system_name;
|
---|
444 | r.in.access_mask = access_mask;
|
---|
445 |
|
---|
446 | status = cli->dispatch(cli,
|
---|
447 | mem_ctx,
|
---|
448 | &ndr_table_winreg,
|
---|
449 | NDR_WINREG_OPENHKLM,
|
---|
450 | &r);
|
---|
451 |
|
---|
452 | if (!NT_STATUS_IS_OK(status)) {
|
---|
453 | return status;
|
---|
454 | }
|
---|
455 |
|
---|
456 | if (NT_STATUS_IS_ERR(status)) {
|
---|
457 | return status;
|
---|
458 | }
|
---|
459 |
|
---|
460 | /* Return variables */
|
---|
461 | *handle = *r.out.handle;
|
---|
462 |
|
---|
463 | /* Return result */
|
---|
464 | if (werror) {
|
---|
465 | *werror = r.out.result;
|
---|
466 | }
|
---|
467 |
|
---|
468 | return werror_to_ntstatus(r.out.result);
|
---|
469 | }
|
---|
470 |
|
---|
471 | struct rpccli_winreg_OpenHKPD_state {
|
---|
472 | struct winreg_OpenHKPD orig;
|
---|
473 | struct winreg_OpenHKPD tmp;
|
---|
474 | TALLOC_CTX *out_mem_ctx;
|
---|
475 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
476 | };
|
---|
477 |
|
---|
478 | static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq);
|
---|
479 |
|
---|
480 | struct tevent_req *rpccli_winreg_OpenHKPD_send(TALLOC_CTX *mem_ctx,
|
---|
481 | struct tevent_context *ev,
|
---|
482 | struct rpc_pipe_client *cli,
|
---|
483 | uint16_t *_system_name /* [in] [unique] */,
|
---|
484 | uint32_t _access_mask /* [in] */,
|
---|
485 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
486 | {
|
---|
487 | struct tevent_req *req;
|
---|
488 | struct rpccli_winreg_OpenHKPD_state *state;
|
---|
489 | struct tevent_req *subreq;
|
---|
490 |
|
---|
491 | req = tevent_req_create(mem_ctx, &state,
|
---|
492 | struct rpccli_winreg_OpenHKPD_state);
|
---|
493 | if (req == NULL) {
|
---|
494 | return NULL;
|
---|
495 | }
|
---|
496 | state->out_mem_ctx = NULL;
|
---|
497 | state->dispatch_recv = cli->dispatch_recv;
|
---|
498 |
|
---|
499 | /* In parameters */
|
---|
500 | state->orig.in.system_name = _system_name;
|
---|
501 | state->orig.in.access_mask = _access_mask;
|
---|
502 |
|
---|
503 | /* Out parameters */
|
---|
504 | state->orig.out.handle = _handle;
|
---|
505 |
|
---|
506 | /* Result */
|
---|
507 | ZERO_STRUCT(state->orig.out.result);
|
---|
508 |
|
---|
509 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
510 | "rpccli_winreg_OpenHKPD_out_memory");
|
---|
511 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
512 | return tevent_req_post(req, ev);
|
---|
513 | }
|
---|
514 |
|
---|
515 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
516 | state->tmp = state->orig;
|
---|
517 |
|
---|
518 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
519 | &ndr_table_winreg,
|
---|
520 | NDR_WINREG_OPENHKPD,
|
---|
521 | &state->tmp);
|
---|
522 | if (tevent_req_nomem(subreq, req)) {
|
---|
523 | return tevent_req_post(req, ev);
|
---|
524 | }
|
---|
525 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPD_done, req);
|
---|
526 | return req;
|
---|
527 | }
|
---|
528 |
|
---|
529 | static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq)
|
---|
530 | {
|
---|
531 | struct tevent_req *req = tevent_req_callback_data(
|
---|
532 | subreq, struct tevent_req);
|
---|
533 | struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
|
---|
534 | req, struct rpccli_winreg_OpenHKPD_state);
|
---|
535 | NTSTATUS status;
|
---|
536 | TALLOC_CTX *mem_ctx;
|
---|
537 |
|
---|
538 | if (state->out_mem_ctx) {
|
---|
539 | mem_ctx = state->out_mem_ctx;
|
---|
540 | } else {
|
---|
541 | mem_ctx = state;
|
---|
542 | }
|
---|
543 |
|
---|
544 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
545 | TALLOC_FREE(subreq);
|
---|
546 | if (!NT_STATUS_IS_OK(status)) {
|
---|
547 | tevent_req_nterror(req, status);
|
---|
548 | return;
|
---|
549 | }
|
---|
550 |
|
---|
551 | /* Copy out parameters */
|
---|
552 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
553 |
|
---|
554 | /* Copy result */
|
---|
555 | state->orig.out.result = state->tmp.out.result;
|
---|
556 |
|
---|
557 | /* Reset temporary structure */
|
---|
558 | ZERO_STRUCT(state->tmp);
|
---|
559 |
|
---|
560 | tevent_req_done(req);
|
---|
561 | }
|
---|
562 |
|
---|
563 | NTSTATUS rpccli_winreg_OpenHKPD_recv(struct tevent_req *req,
|
---|
564 | TALLOC_CTX *mem_ctx,
|
---|
565 | WERROR *result)
|
---|
566 | {
|
---|
567 | struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
|
---|
568 | req, struct rpccli_winreg_OpenHKPD_state);
|
---|
569 | NTSTATUS status;
|
---|
570 |
|
---|
571 | if (tevent_req_is_nterror(req, &status)) {
|
---|
572 | tevent_req_received(req);
|
---|
573 | return status;
|
---|
574 | }
|
---|
575 |
|
---|
576 | /* Steal possbile out parameters to the callers context */
|
---|
577 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
578 |
|
---|
579 | /* Return result */
|
---|
580 | *result = state->orig.out.result;
|
---|
581 |
|
---|
582 | tevent_req_received(req);
|
---|
583 | return NT_STATUS_OK;
|
---|
584 | }
|
---|
585 |
|
---|
586 | NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli,
|
---|
587 | TALLOC_CTX *mem_ctx,
|
---|
588 | uint16_t *system_name /* [in] [unique] */,
|
---|
589 | uint32_t access_mask /* [in] */,
|
---|
590 | struct policy_handle *handle /* [out] [ref] */,
|
---|
591 | WERROR *werror)
|
---|
592 | {
|
---|
593 | struct winreg_OpenHKPD r;
|
---|
594 | NTSTATUS status;
|
---|
595 |
|
---|
596 | /* In parameters */
|
---|
597 | r.in.system_name = system_name;
|
---|
598 | r.in.access_mask = access_mask;
|
---|
599 |
|
---|
600 | status = cli->dispatch(cli,
|
---|
601 | mem_ctx,
|
---|
602 | &ndr_table_winreg,
|
---|
603 | NDR_WINREG_OPENHKPD,
|
---|
604 | &r);
|
---|
605 |
|
---|
606 | if (!NT_STATUS_IS_OK(status)) {
|
---|
607 | return status;
|
---|
608 | }
|
---|
609 |
|
---|
610 | if (NT_STATUS_IS_ERR(status)) {
|
---|
611 | return status;
|
---|
612 | }
|
---|
613 |
|
---|
614 | /* Return variables */
|
---|
615 | *handle = *r.out.handle;
|
---|
616 |
|
---|
617 | /* Return result */
|
---|
618 | if (werror) {
|
---|
619 | *werror = r.out.result;
|
---|
620 | }
|
---|
621 |
|
---|
622 | return werror_to_ntstatus(r.out.result);
|
---|
623 | }
|
---|
624 |
|
---|
625 | struct rpccli_winreg_OpenHKU_state {
|
---|
626 | struct winreg_OpenHKU orig;
|
---|
627 | struct winreg_OpenHKU tmp;
|
---|
628 | TALLOC_CTX *out_mem_ctx;
|
---|
629 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
630 | };
|
---|
631 |
|
---|
632 | static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq);
|
---|
633 |
|
---|
634 | struct tevent_req *rpccli_winreg_OpenHKU_send(TALLOC_CTX *mem_ctx,
|
---|
635 | struct tevent_context *ev,
|
---|
636 | struct rpc_pipe_client *cli,
|
---|
637 | uint16_t *_system_name /* [in] [unique] */,
|
---|
638 | uint32_t _access_mask /* [in] */,
|
---|
639 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
640 | {
|
---|
641 | struct tevent_req *req;
|
---|
642 | struct rpccli_winreg_OpenHKU_state *state;
|
---|
643 | struct tevent_req *subreq;
|
---|
644 |
|
---|
645 | req = tevent_req_create(mem_ctx, &state,
|
---|
646 | struct rpccli_winreg_OpenHKU_state);
|
---|
647 | if (req == NULL) {
|
---|
648 | return NULL;
|
---|
649 | }
|
---|
650 | state->out_mem_ctx = NULL;
|
---|
651 | state->dispatch_recv = cli->dispatch_recv;
|
---|
652 |
|
---|
653 | /* In parameters */
|
---|
654 | state->orig.in.system_name = _system_name;
|
---|
655 | state->orig.in.access_mask = _access_mask;
|
---|
656 |
|
---|
657 | /* Out parameters */
|
---|
658 | state->orig.out.handle = _handle;
|
---|
659 |
|
---|
660 | /* Result */
|
---|
661 | ZERO_STRUCT(state->orig.out.result);
|
---|
662 |
|
---|
663 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
664 | "rpccli_winreg_OpenHKU_out_memory");
|
---|
665 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
666 | return tevent_req_post(req, ev);
|
---|
667 | }
|
---|
668 |
|
---|
669 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
670 | state->tmp = state->orig;
|
---|
671 |
|
---|
672 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
673 | &ndr_table_winreg,
|
---|
674 | NDR_WINREG_OPENHKU,
|
---|
675 | &state->tmp);
|
---|
676 | if (tevent_req_nomem(subreq, req)) {
|
---|
677 | return tevent_req_post(req, ev);
|
---|
678 | }
|
---|
679 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKU_done, req);
|
---|
680 | return req;
|
---|
681 | }
|
---|
682 |
|
---|
683 | static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq)
|
---|
684 | {
|
---|
685 | struct tevent_req *req = tevent_req_callback_data(
|
---|
686 | subreq, struct tevent_req);
|
---|
687 | struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
|
---|
688 | req, struct rpccli_winreg_OpenHKU_state);
|
---|
689 | NTSTATUS status;
|
---|
690 | TALLOC_CTX *mem_ctx;
|
---|
691 |
|
---|
692 | if (state->out_mem_ctx) {
|
---|
693 | mem_ctx = state->out_mem_ctx;
|
---|
694 | } else {
|
---|
695 | mem_ctx = state;
|
---|
696 | }
|
---|
697 |
|
---|
698 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
699 | TALLOC_FREE(subreq);
|
---|
700 | if (!NT_STATUS_IS_OK(status)) {
|
---|
701 | tevent_req_nterror(req, status);
|
---|
702 | return;
|
---|
703 | }
|
---|
704 |
|
---|
705 | /* Copy out parameters */
|
---|
706 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
707 |
|
---|
708 | /* Copy result */
|
---|
709 | state->orig.out.result = state->tmp.out.result;
|
---|
710 |
|
---|
711 | /* Reset temporary structure */
|
---|
712 | ZERO_STRUCT(state->tmp);
|
---|
713 |
|
---|
714 | tevent_req_done(req);
|
---|
715 | }
|
---|
716 |
|
---|
717 | NTSTATUS rpccli_winreg_OpenHKU_recv(struct tevent_req *req,
|
---|
718 | TALLOC_CTX *mem_ctx,
|
---|
719 | WERROR *result)
|
---|
720 | {
|
---|
721 | struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
|
---|
722 | req, struct rpccli_winreg_OpenHKU_state);
|
---|
723 | NTSTATUS status;
|
---|
724 |
|
---|
725 | if (tevent_req_is_nterror(req, &status)) {
|
---|
726 | tevent_req_received(req);
|
---|
727 | return status;
|
---|
728 | }
|
---|
729 |
|
---|
730 | /* Steal possbile out parameters to the callers context */
|
---|
731 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
732 |
|
---|
733 | /* Return result */
|
---|
734 | *result = state->orig.out.result;
|
---|
735 |
|
---|
736 | tevent_req_received(req);
|
---|
737 | return NT_STATUS_OK;
|
---|
738 | }
|
---|
739 |
|
---|
740 | NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli,
|
---|
741 | TALLOC_CTX *mem_ctx,
|
---|
742 | uint16_t *system_name /* [in] [unique] */,
|
---|
743 | uint32_t access_mask /* [in] */,
|
---|
744 | struct policy_handle *handle /* [out] [ref] */,
|
---|
745 | WERROR *werror)
|
---|
746 | {
|
---|
747 | struct winreg_OpenHKU r;
|
---|
748 | NTSTATUS status;
|
---|
749 |
|
---|
750 | /* In parameters */
|
---|
751 | r.in.system_name = system_name;
|
---|
752 | r.in.access_mask = access_mask;
|
---|
753 |
|
---|
754 | status = cli->dispatch(cli,
|
---|
755 | mem_ctx,
|
---|
756 | &ndr_table_winreg,
|
---|
757 | NDR_WINREG_OPENHKU,
|
---|
758 | &r);
|
---|
759 |
|
---|
760 | if (!NT_STATUS_IS_OK(status)) {
|
---|
761 | return status;
|
---|
762 | }
|
---|
763 |
|
---|
764 | if (NT_STATUS_IS_ERR(status)) {
|
---|
765 | return status;
|
---|
766 | }
|
---|
767 |
|
---|
768 | /* Return variables */
|
---|
769 | *handle = *r.out.handle;
|
---|
770 |
|
---|
771 | /* Return result */
|
---|
772 | if (werror) {
|
---|
773 | *werror = r.out.result;
|
---|
774 | }
|
---|
775 |
|
---|
776 | return werror_to_ntstatus(r.out.result);
|
---|
777 | }
|
---|
778 |
|
---|
779 | struct rpccli_winreg_CloseKey_state {
|
---|
780 | struct winreg_CloseKey orig;
|
---|
781 | struct winreg_CloseKey tmp;
|
---|
782 | TALLOC_CTX *out_mem_ctx;
|
---|
783 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
784 | };
|
---|
785 |
|
---|
786 | static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq);
|
---|
787 |
|
---|
788 | struct tevent_req *rpccli_winreg_CloseKey_send(TALLOC_CTX *mem_ctx,
|
---|
789 | struct tevent_context *ev,
|
---|
790 | struct rpc_pipe_client *cli,
|
---|
791 | struct policy_handle *_handle /* [in,out] [ref] */)
|
---|
792 | {
|
---|
793 | struct tevent_req *req;
|
---|
794 | struct rpccli_winreg_CloseKey_state *state;
|
---|
795 | struct tevent_req *subreq;
|
---|
796 |
|
---|
797 | req = tevent_req_create(mem_ctx, &state,
|
---|
798 | struct rpccli_winreg_CloseKey_state);
|
---|
799 | if (req == NULL) {
|
---|
800 | return NULL;
|
---|
801 | }
|
---|
802 | state->out_mem_ctx = NULL;
|
---|
803 | state->dispatch_recv = cli->dispatch_recv;
|
---|
804 |
|
---|
805 | /* In parameters */
|
---|
806 | state->orig.in.handle = _handle;
|
---|
807 |
|
---|
808 | /* Out parameters */
|
---|
809 | state->orig.out.handle = _handle;
|
---|
810 |
|
---|
811 | /* Result */
|
---|
812 | ZERO_STRUCT(state->orig.out.result);
|
---|
813 |
|
---|
814 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
815 | "rpccli_winreg_CloseKey_out_memory");
|
---|
816 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
817 | return tevent_req_post(req, ev);
|
---|
818 | }
|
---|
819 |
|
---|
820 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
821 | state->tmp = state->orig;
|
---|
822 |
|
---|
823 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
824 | &ndr_table_winreg,
|
---|
825 | NDR_WINREG_CLOSEKEY,
|
---|
826 | &state->tmp);
|
---|
827 | if (tevent_req_nomem(subreq, req)) {
|
---|
828 | return tevent_req_post(req, ev);
|
---|
829 | }
|
---|
830 | tevent_req_set_callback(subreq, rpccli_winreg_CloseKey_done, req);
|
---|
831 | return req;
|
---|
832 | }
|
---|
833 |
|
---|
834 | static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq)
|
---|
835 | {
|
---|
836 | struct tevent_req *req = tevent_req_callback_data(
|
---|
837 | subreq, struct tevent_req);
|
---|
838 | struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
|
---|
839 | req, struct rpccli_winreg_CloseKey_state);
|
---|
840 | NTSTATUS status;
|
---|
841 | TALLOC_CTX *mem_ctx;
|
---|
842 |
|
---|
843 | if (state->out_mem_ctx) {
|
---|
844 | mem_ctx = state->out_mem_ctx;
|
---|
845 | } else {
|
---|
846 | mem_ctx = state;
|
---|
847 | }
|
---|
848 |
|
---|
849 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
850 | TALLOC_FREE(subreq);
|
---|
851 | if (!NT_STATUS_IS_OK(status)) {
|
---|
852 | tevent_req_nterror(req, status);
|
---|
853 | return;
|
---|
854 | }
|
---|
855 |
|
---|
856 | /* Copy out parameters */
|
---|
857 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
858 |
|
---|
859 | /* Copy result */
|
---|
860 | state->orig.out.result = state->tmp.out.result;
|
---|
861 |
|
---|
862 | /* Reset temporary structure */
|
---|
863 | ZERO_STRUCT(state->tmp);
|
---|
864 |
|
---|
865 | tevent_req_done(req);
|
---|
866 | }
|
---|
867 |
|
---|
868 | NTSTATUS rpccli_winreg_CloseKey_recv(struct tevent_req *req,
|
---|
869 | TALLOC_CTX *mem_ctx,
|
---|
870 | WERROR *result)
|
---|
871 | {
|
---|
872 | struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
|
---|
873 | req, struct rpccli_winreg_CloseKey_state);
|
---|
874 | NTSTATUS status;
|
---|
875 |
|
---|
876 | if (tevent_req_is_nterror(req, &status)) {
|
---|
877 | tevent_req_received(req);
|
---|
878 | return status;
|
---|
879 | }
|
---|
880 |
|
---|
881 | /* Steal possbile out parameters to the callers context */
|
---|
882 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
883 |
|
---|
884 | /* Return result */
|
---|
885 | *result = state->orig.out.result;
|
---|
886 |
|
---|
887 | tevent_req_received(req);
|
---|
888 | return NT_STATUS_OK;
|
---|
889 | }
|
---|
890 |
|
---|
891 | NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli,
|
---|
892 | TALLOC_CTX *mem_ctx,
|
---|
893 | struct policy_handle *handle /* [in,out] [ref] */,
|
---|
894 | WERROR *werror)
|
---|
895 | {
|
---|
896 | struct winreg_CloseKey r;
|
---|
897 | NTSTATUS status;
|
---|
898 |
|
---|
899 | /* In parameters */
|
---|
900 | r.in.handle = handle;
|
---|
901 |
|
---|
902 | status = cli->dispatch(cli,
|
---|
903 | mem_ctx,
|
---|
904 | &ndr_table_winreg,
|
---|
905 | NDR_WINREG_CLOSEKEY,
|
---|
906 | &r);
|
---|
907 |
|
---|
908 | if (!NT_STATUS_IS_OK(status)) {
|
---|
909 | return status;
|
---|
910 | }
|
---|
911 |
|
---|
912 | if (NT_STATUS_IS_ERR(status)) {
|
---|
913 | return status;
|
---|
914 | }
|
---|
915 |
|
---|
916 | /* Return variables */
|
---|
917 | *handle = *r.out.handle;
|
---|
918 |
|
---|
919 | /* Return result */
|
---|
920 | if (werror) {
|
---|
921 | *werror = r.out.result;
|
---|
922 | }
|
---|
923 |
|
---|
924 | return werror_to_ntstatus(r.out.result);
|
---|
925 | }
|
---|
926 |
|
---|
927 | struct rpccli_winreg_CreateKey_state {
|
---|
928 | struct winreg_CreateKey orig;
|
---|
929 | struct winreg_CreateKey tmp;
|
---|
930 | TALLOC_CTX *out_mem_ctx;
|
---|
931 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
932 | };
|
---|
933 |
|
---|
934 | static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq);
|
---|
935 |
|
---|
936 | struct tevent_req *rpccli_winreg_CreateKey_send(TALLOC_CTX *mem_ctx,
|
---|
937 | struct tevent_context *ev,
|
---|
938 | struct rpc_pipe_client *cli,
|
---|
939 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
940 | struct winreg_String _name /* [in] */,
|
---|
941 | struct winreg_String _keyclass /* [in] */,
|
---|
942 | uint32_t _options /* [in] */,
|
---|
943 | uint32_t _access_mask /* [in] */,
|
---|
944 | struct winreg_SecBuf *_secdesc /* [in] [unique] */,
|
---|
945 | struct policy_handle *_new_handle /* [out] [ref] */,
|
---|
946 | enum winreg_CreateAction *_action_taken /* [in,out] [unique] */)
|
---|
947 | {
|
---|
948 | struct tevent_req *req;
|
---|
949 | struct rpccli_winreg_CreateKey_state *state;
|
---|
950 | struct tevent_req *subreq;
|
---|
951 |
|
---|
952 | req = tevent_req_create(mem_ctx, &state,
|
---|
953 | struct rpccli_winreg_CreateKey_state);
|
---|
954 | if (req == NULL) {
|
---|
955 | return NULL;
|
---|
956 | }
|
---|
957 | state->out_mem_ctx = NULL;
|
---|
958 | state->dispatch_recv = cli->dispatch_recv;
|
---|
959 |
|
---|
960 | /* In parameters */
|
---|
961 | state->orig.in.handle = _handle;
|
---|
962 | state->orig.in.name = _name;
|
---|
963 | state->orig.in.keyclass = _keyclass;
|
---|
964 | state->orig.in.options = _options;
|
---|
965 | state->orig.in.access_mask = _access_mask;
|
---|
966 | state->orig.in.secdesc = _secdesc;
|
---|
967 | state->orig.in.action_taken = _action_taken;
|
---|
968 |
|
---|
969 | /* Out parameters */
|
---|
970 | state->orig.out.new_handle = _new_handle;
|
---|
971 | state->orig.out.action_taken = _action_taken;
|
---|
972 |
|
---|
973 | /* Result */
|
---|
974 | ZERO_STRUCT(state->orig.out.result);
|
---|
975 |
|
---|
976 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
977 | "rpccli_winreg_CreateKey_out_memory");
|
---|
978 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
979 | return tevent_req_post(req, ev);
|
---|
980 | }
|
---|
981 |
|
---|
982 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
983 | state->tmp = state->orig;
|
---|
984 |
|
---|
985 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
986 | &ndr_table_winreg,
|
---|
987 | NDR_WINREG_CREATEKEY,
|
---|
988 | &state->tmp);
|
---|
989 | if (tevent_req_nomem(subreq, req)) {
|
---|
990 | return tevent_req_post(req, ev);
|
---|
991 | }
|
---|
992 | tevent_req_set_callback(subreq, rpccli_winreg_CreateKey_done, req);
|
---|
993 | return req;
|
---|
994 | }
|
---|
995 |
|
---|
996 | static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq)
|
---|
997 | {
|
---|
998 | struct tevent_req *req = tevent_req_callback_data(
|
---|
999 | subreq, struct tevent_req);
|
---|
1000 | struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
|
---|
1001 | req, struct rpccli_winreg_CreateKey_state);
|
---|
1002 | NTSTATUS status;
|
---|
1003 | TALLOC_CTX *mem_ctx;
|
---|
1004 |
|
---|
1005 | if (state->out_mem_ctx) {
|
---|
1006 | mem_ctx = state->out_mem_ctx;
|
---|
1007 | } else {
|
---|
1008 | mem_ctx = state;
|
---|
1009 | }
|
---|
1010 |
|
---|
1011 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1012 | TALLOC_FREE(subreq);
|
---|
1013 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1014 | tevent_req_nterror(req, status);
|
---|
1015 | return;
|
---|
1016 | }
|
---|
1017 |
|
---|
1018 | /* Copy out parameters */
|
---|
1019 | *state->orig.out.new_handle = *state->tmp.out.new_handle;
|
---|
1020 | if (state->orig.out.action_taken && state->tmp.out.action_taken) {
|
---|
1021 | *state->orig.out.action_taken = *state->tmp.out.action_taken;
|
---|
1022 | }
|
---|
1023 |
|
---|
1024 | /* Copy result */
|
---|
1025 | state->orig.out.result = state->tmp.out.result;
|
---|
1026 |
|
---|
1027 | /* Reset temporary structure */
|
---|
1028 | ZERO_STRUCT(state->tmp);
|
---|
1029 |
|
---|
1030 | tevent_req_done(req);
|
---|
1031 | }
|
---|
1032 |
|
---|
1033 | NTSTATUS rpccli_winreg_CreateKey_recv(struct tevent_req *req,
|
---|
1034 | TALLOC_CTX *mem_ctx,
|
---|
1035 | WERROR *result)
|
---|
1036 | {
|
---|
1037 | struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
|
---|
1038 | req, struct rpccli_winreg_CreateKey_state);
|
---|
1039 | NTSTATUS status;
|
---|
1040 |
|
---|
1041 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1042 | tevent_req_received(req);
|
---|
1043 | return status;
|
---|
1044 | }
|
---|
1045 |
|
---|
1046 | /* Steal possbile out parameters to the callers context */
|
---|
1047 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1048 |
|
---|
1049 | /* Return result */
|
---|
1050 | *result = state->orig.out.result;
|
---|
1051 |
|
---|
1052 | tevent_req_received(req);
|
---|
1053 | return NT_STATUS_OK;
|
---|
1054 | }
|
---|
1055 |
|
---|
1056 | NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
|
---|
1057 | TALLOC_CTX *mem_ctx,
|
---|
1058 | struct policy_handle *handle /* [in] [ref] */,
|
---|
1059 | struct winreg_String name /* [in] */,
|
---|
1060 | struct winreg_String keyclass /* [in] */,
|
---|
1061 | uint32_t options /* [in] */,
|
---|
1062 | uint32_t access_mask /* [in] */,
|
---|
1063 | struct winreg_SecBuf *secdesc /* [in] [unique] */,
|
---|
1064 | struct policy_handle *new_handle /* [out] [ref] */,
|
---|
1065 | enum winreg_CreateAction *action_taken /* [in,out] [unique] */,
|
---|
1066 | WERROR *werror)
|
---|
1067 | {
|
---|
1068 | struct winreg_CreateKey r;
|
---|
1069 | NTSTATUS status;
|
---|
1070 |
|
---|
1071 | /* In parameters */
|
---|
1072 | r.in.handle = handle;
|
---|
1073 | r.in.name = name;
|
---|
1074 | r.in.keyclass = keyclass;
|
---|
1075 | r.in.options = options;
|
---|
1076 | r.in.access_mask = access_mask;
|
---|
1077 | r.in.secdesc = secdesc;
|
---|
1078 | r.in.action_taken = action_taken;
|
---|
1079 |
|
---|
1080 | status = cli->dispatch(cli,
|
---|
1081 | mem_ctx,
|
---|
1082 | &ndr_table_winreg,
|
---|
1083 | NDR_WINREG_CREATEKEY,
|
---|
1084 | &r);
|
---|
1085 |
|
---|
1086 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1087 | return status;
|
---|
1088 | }
|
---|
1089 |
|
---|
1090 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1091 | return status;
|
---|
1092 | }
|
---|
1093 |
|
---|
1094 | /* Return variables */
|
---|
1095 | *new_handle = *r.out.new_handle;
|
---|
1096 | if (action_taken && r.out.action_taken) {
|
---|
1097 | *action_taken = *r.out.action_taken;
|
---|
1098 | }
|
---|
1099 |
|
---|
1100 | /* Return result */
|
---|
1101 | if (werror) {
|
---|
1102 | *werror = r.out.result;
|
---|
1103 | }
|
---|
1104 |
|
---|
1105 | return werror_to_ntstatus(r.out.result);
|
---|
1106 | }
|
---|
1107 |
|
---|
1108 | struct rpccli_winreg_DeleteKey_state {
|
---|
1109 | struct winreg_DeleteKey orig;
|
---|
1110 | struct winreg_DeleteKey tmp;
|
---|
1111 | TALLOC_CTX *out_mem_ctx;
|
---|
1112 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1113 | };
|
---|
1114 |
|
---|
1115 | static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq);
|
---|
1116 |
|
---|
1117 | struct tevent_req *rpccli_winreg_DeleteKey_send(TALLOC_CTX *mem_ctx,
|
---|
1118 | struct tevent_context *ev,
|
---|
1119 | struct rpc_pipe_client *cli,
|
---|
1120 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
1121 | struct winreg_String _key /* [in] */)
|
---|
1122 | {
|
---|
1123 | struct tevent_req *req;
|
---|
1124 | struct rpccli_winreg_DeleteKey_state *state;
|
---|
1125 | struct tevent_req *subreq;
|
---|
1126 |
|
---|
1127 | req = tevent_req_create(mem_ctx, &state,
|
---|
1128 | struct rpccli_winreg_DeleteKey_state);
|
---|
1129 | if (req == NULL) {
|
---|
1130 | return NULL;
|
---|
1131 | }
|
---|
1132 | state->out_mem_ctx = NULL;
|
---|
1133 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1134 |
|
---|
1135 | /* In parameters */
|
---|
1136 | state->orig.in.handle = _handle;
|
---|
1137 | state->orig.in.key = _key;
|
---|
1138 |
|
---|
1139 | /* Out parameters */
|
---|
1140 |
|
---|
1141 | /* Result */
|
---|
1142 | ZERO_STRUCT(state->orig.out.result);
|
---|
1143 |
|
---|
1144 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1145 | state->tmp = state->orig;
|
---|
1146 |
|
---|
1147 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1148 | &ndr_table_winreg,
|
---|
1149 | NDR_WINREG_DELETEKEY,
|
---|
1150 | &state->tmp);
|
---|
1151 | if (tevent_req_nomem(subreq, req)) {
|
---|
1152 | return tevent_req_post(req, ev);
|
---|
1153 | }
|
---|
1154 | tevent_req_set_callback(subreq, rpccli_winreg_DeleteKey_done, req);
|
---|
1155 | return req;
|
---|
1156 | }
|
---|
1157 |
|
---|
1158 | static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq)
|
---|
1159 | {
|
---|
1160 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1161 | subreq, struct tevent_req);
|
---|
1162 | struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
|
---|
1163 | req, struct rpccli_winreg_DeleteKey_state);
|
---|
1164 | NTSTATUS status;
|
---|
1165 | TALLOC_CTX *mem_ctx;
|
---|
1166 |
|
---|
1167 | if (state->out_mem_ctx) {
|
---|
1168 | mem_ctx = state->out_mem_ctx;
|
---|
1169 | } else {
|
---|
1170 | mem_ctx = state;
|
---|
1171 | }
|
---|
1172 |
|
---|
1173 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1174 | TALLOC_FREE(subreq);
|
---|
1175 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1176 | tevent_req_nterror(req, status);
|
---|
1177 | return;
|
---|
1178 | }
|
---|
1179 |
|
---|
1180 | /* Copy out parameters */
|
---|
1181 |
|
---|
1182 | /* Copy result */
|
---|
1183 | state->orig.out.result = state->tmp.out.result;
|
---|
1184 |
|
---|
1185 | /* Reset temporary structure */
|
---|
1186 | ZERO_STRUCT(state->tmp);
|
---|
1187 |
|
---|
1188 | tevent_req_done(req);
|
---|
1189 | }
|
---|
1190 |
|
---|
1191 | NTSTATUS rpccli_winreg_DeleteKey_recv(struct tevent_req *req,
|
---|
1192 | TALLOC_CTX *mem_ctx,
|
---|
1193 | WERROR *result)
|
---|
1194 | {
|
---|
1195 | struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
|
---|
1196 | req, struct rpccli_winreg_DeleteKey_state);
|
---|
1197 | NTSTATUS status;
|
---|
1198 |
|
---|
1199 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1200 | tevent_req_received(req);
|
---|
1201 | return status;
|
---|
1202 | }
|
---|
1203 |
|
---|
1204 | /* Steal possbile out parameters to the callers context */
|
---|
1205 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1206 |
|
---|
1207 | /* Return result */
|
---|
1208 | *result = state->orig.out.result;
|
---|
1209 |
|
---|
1210 | tevent_req_received(req);
|
---|
1211 | return NT_STATUS_OK;
|
---|
1212 | }
|
---|
1213 |
|
---|
1214 | NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli,
|
---|
1215 | TALLOC_CTX *mem_ctx,
|
---|
1216 | struct policy_handle *handle /* [in] [ref] */,
|
---|
1217 | struct winreg_String key /* [in] */,
|
---|
1218 | WERROR *werror)
|
---|
1219 | {
|
---|
1220 | struct winreg_DeleteKey r;
|
---|
1221 | NTSTATUS status;
|
---|
1222 |
|
---|
1223 | /* In parameters */
|
---|
1224 | r.in.handle = handle;
|
---|
1225 | r.in.key = key;
|
---|
1226 |
|
---|
1227 | status = cli->dispatch(cli,
|
---|
1228 | mem_ctx,
|
---|
1229 | &ndr_table_winreg,
|
---|
1230 | NDR_WINREG_DELETEKEY,
|
---|
1231 | &r);
|
---|
1232 |
|
---|
1233 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1234 | return status;
|
---|
1235 | }
|
---|
1236 |
|
---|
1237 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1238 | return status;
|
---|
1239 | }
|
---|
1240 |
|
---|
1241 | /* Return variables */
|
---|
1242 |
|
---|
1243 | /* Return result */
|
---|
1244 | if (werror) {
|
---|
1245 | *werror = r.out.result;
|
---|
1246 | }
|
---|
1247 |
|
---|
1248 | return werror_to_ntstatus(r.out.result);
|
---|
1249 | }
|
---|
1250 |
|
---|
1251 | struct rpccli_winreg_DeleteValue_state {
|
---|
1252 | struct winreg_DeleteValue orig;
|
---|
1253 | struct winreg_DeleteValue tmp;
|
---|
1254 | TALLOC_CTX *out_mem_ctx;
|
---|
1255 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1256 | };
|
---|
1257 |
|
---|
1258 | static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq);
|
---|
1259 |
|
---|
1260 | struct tevent_req *rpccli_winreg_DeleteValue_send(TALLOC_CTX *mem_ctx,
|
---|
1261 | struct tevent_context *ev,
|
---|
1262 | struct rpc_pipe_client *cli,
|
---|
1263 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
1264 | struct winreg_String _value /* [in] */)
|
---|
1265 | {
|
---|
1266 | struct tevent_req *req;
|
---|
1267 | struct rpccli_winreg_DeleteValue_state *state;
|
---|
1268 | struct tevent_req *subreq;
|
---|
1269 |
|
---|
1270 | req = tevent_req_create(mem_ctx, &state,
|
---|
1271 | struct rpccli_winreg_DeleteValue_state);
|
---|
1272 | if (req == NULL) {
|
---|
1273 | return NULL;
|
---|
1274 | }
|
---|
1275 | state->out_mem_ctx = NULL;
|
---|
1276 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1277 |
|
---|
1278 | /* In parameters */
|
---|
1279 | state->orig.in.handle = _handle;
|
---|
1280 | state->orig.in.value = _value;
|
---|
1281 |
|
---|
1282 | /* Out parameters */
|
---|
1283 |
|
---|
1284 | /* Result */
|
---|
1285 | ZERO_STRUCT(state->orig.out.result);
|
---|
1286 |
|
---|
1287 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1288 | state->tmp = state->orig;
|
---|
1289 |
|
---|
1290 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1291 | &ndr_table_winreg,
|
---|
1292 | NDR_WINREG_DELETEVALUE,
|
---|
1293 | &state->tmp);
|
---|
1294 | if (tevent_req_nomem(subreq, req)) {
|
---|
1295 | return tevent_req_post(req, ev);
|
---|
1296 | }
|
---|
1297 | tevent_req_set_callback(subreq, rpccli_winreg_DeleteValue_done, req);
|
---|
1298 | return req;
|
---|
1299 | }
|
---|
1300 |
|
---|
1301 | static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq)
|
---|
1302 | {
|
---|
1303 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1304 | subreq, struct tevent_req);
|
---|
1305 | struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
|
---|
1306 | req, struct rpccli_winreg_DeleteValue_state);
|
---|
1307 | NTSTATUS status;
|
---|
1308 | TALLOC_CTX *mem_ctx;
|
---|
1309 |
|
---|
1310 | if (state->out_mem_ctx) {
|
---|
1311 | mem_ctx = state->out_mem_ctx;
|
---|
1312 | } else {
|
---|
1313 | mem_ctx = state;
|
---|
1314 | }
|
---|
1315 |
|
---|
1316 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1317 | TALLOC_FREE(subreq);
|
---|
1318 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1319 | tevent_req_nterror(req, status);
|
---|
1320 | return;
|
---|
1321 | }
|
---|
1322 |
|
---|
1323 | /* Copy out parameters */
|
---|
1324 |
|
---|
1325 | /* Copy result */
|
---|
1326 | state->orig.out.result = state->tmp.out.result;
|
---|
1327 |
|
---|
1328 | /* Reset temporary structure */
|
---|
1329 | ZERO_STRUCT(state->tmp);
|
---|
1330 |
|
---|
1331 | tevent_req_done(req);
|
---|
1332 | }
|
---|
1333 |
|
---|
1334 | NTSTATUS rpccli_winreg_DeleteValue_recv(struct tevent_req *req,
|
---|
1335 | TALLOC_CTX *mem_ctx,
|
---|
1336 | WERROR *result)
|
---|
1337 | {
|
---|
1338 | struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
|
---|
1339 | req, struct rpccli_winreg_DeleteValue_state);
|
---|
1340 | NTSTATUS status;
|
---|
1341 |
|
---|
1342 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1343 | tevent_req_received(req);
|
---|
1344 | return status;
|
---|
1345 | }
|
---|
1346 |
|
---|
1347 | /* Steal possbile out parameters to the callers context */
|
---|
1348 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1349 |
|
---|
1350 | /* Return result */
|
---|
1351 | *result = state->orig.out.result;
|
---|
1352 |
|
---|
1353 | tevent_req_received(req);
|
---|
1354 | return NT_STATUS_OK;
|
---|
1355 | }
|
---|
1356 |
|
---|
1357 | NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli,
|
---|
1358 | TALLOC_CTX *mem_ctx,
|
---|
1359 | struct policy_handle *handle /* [in] [ref] */,
|
---|
1360 | struct winreg_String value /* [in] */,
|
---|
1361 | WERROR *werror)
|
---|
1362 | {
|
---|
1363 | struct winreg_DeleteValue r;
|
---|
1364 | NTSTATUS status;
|
---|
1365 |
|
---|
1366 | /* In parameters */
|
---|
1367 | r.in.handle = handle;
|
---|
1368 | r.in.value = value;
|
---|
1369 |
|
---|
1370 | status = cli->dispatch(cli,
|
---|
1371 | mem_ctx,
|
---|
1372 | &ndr_table_winreg,
|
---|
1373 | NDR_WINREG_DELETEVALUE,
|
---|
1374 | &r);
|
---|
1375 |
|
---|
1376 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1377 | return status;
|
---|
1378 | }
|
---|
1379 |
|
---|
1380 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1381 | return status;
|
---|
1382 | }
|
---|
1383 |
|
---|
1384 | /* Return variables */
|
---|
1385 |
|
---|
1386 | /* Return result */
|
---|
1387 | if (werror) {
|
---|
1388 | *werror = r.out.result;
|
---|
1389 | }
|
---|
1390 |
|
---|
1391 | return werror_to_ntstatus(r.out.result);
|
---|
1392 | }
|
---|
1393 |
|
---|
1394 | struct rpccli_winreg_EnumKey_state {
|
---|
1395 | struct winreg_EnumKey orig;
|
---|
1396 | struct winreg_EnumKey tmp;
|
---|
1397 | TALLOC_CTX *out_mem_ctx;
|
---|
1398 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1399 | };
|
---|
1400 |
|
---|
1401 | static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq);
|
---|
1402 |
|
---|
1403 | struct tevent_req *rpccli_winreg_EnumKey_send(TALLOC_CTX *mem_ctx,
|
---|
1404 | struct tevent_context *ev,
|
---|
1405 | struct rpc_pipe_client *cli,
|
---|
1406 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
1407 | uint32_t _enum_index /* [in] */,
|
---|
1408 | struct winreg_StringBuf *_name /* [in,out] [ref] */,
|
---|
1409 | struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
|
---|
1410 | NTTIME *_last_changed_time /* [in,out] [unique] */)
|
---|
1411 | {
|
---|
1412 | struct tevent_req *req;
|
---|
1413 | struct rpccli_winreg_EnumKey_state *state;
|
---|
1414 | struct tevent_req *subreq;
|
---|
1415 |
|
---|
1416 | req = tevent_req_create(mem_ctx, &state,
|
---|
1417 | struct rpccli_winreg_EnumKey_state);
|
---|
1418 | if (req == NULL) {
|
---|
1419 | return NULL;
|
---|
1420 | }
|
---|
1421 | state->out_mem_ctx = NULL;
|
---|
1422 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1423 |
|
---|
1424 | /* In parameters */
|
---|
1425 | state->orig.in.handle = _handle;
|
---|
1426 | state->orig.in.enum_index = _enum_index;
|
---|
1427 | state->orig.in.name = _name;
|
---|
1428 | state->orig.in.keyclass = _keyclass;
|
---|
1429 | state->orig.in.last_changed_time = _last_changed_time;
|
---|
1430 |
|
---|
1431 | /* Out parameters */
|
---|
1432 | state->orig.out.name = _name;
|
---|
1433 | state->orig.out.keyclass = _keyclass;
|
---|
1434 | state->orig.out.last_changed_time = _last_changed_time;
|
---|
1435 |
|
---|
1436 | /* Result */
|
---|
1437 | ZERO_STRUCT(state->orig.out.result);
|
---|
1438 |
|
---|
1439 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1440 | "rpccli_winreg_EnumKey_out_memory");
|
---|
1441 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1442 | return tevent_req_post(req, ev);
|
---|
1443 | }
|
---|
1444 |
|
---|
1445 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1446 | state->tmp = state->orig;
|
---|
1447 |
|
---|
1448 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1449 | &ndr_table_winreg,
|
---|
1450 | NDR_WINREG_ENUMKEY,
|
---|
1451 | &state->tmp);
|
---|
1452 | if (tevent_req_nomem(subreq, req)) {
|
---|
1453 | return tevent_req_post(req, ev);
|
---|
1454 | }
|
---|
1455 | tevent_req_set_callback(subreq, rpccli_winreg_EnumKey_done, req);
|
---|
1456 | return req;
|
---|
1457 | }
|
---|
1458 |
|
---|
1459 | static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq)
|
---|
1460 | {
|
---|
1461 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1462 | subreq, struct tevent_req);
|
---|
1463 | struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
|
---|
1464 | req, struct rpccli_winreg_EnumKey_state);
|
---|
1465 | NTSTATUS status;
|
---|
1466 | TALLOC_CTX *mem_ctx;
|
---|
1467 |
|
---|
1468 | if (state->out_mem_ctx) {
|
---|
1469 | mem_ctx = state->out_mem_ctx;
|
---|
1470 | } else {
|
---|
1471 | mem_ctx = state;
|
---|
1472 | }
|
---|
1473 |
|
---|
1474 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1475 | TALLOC_FREE(subreq);
|
---|
1476 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1477 | tevent_req_nterror(req, status);
|
---|
1478 | return;
|
---|
1479 | }
|
---|
1480 |
|
---|
1481 | /* Copy out parameters */
|
---|
1482 | *state->orig.out.name = *state->tmp.out.name;
|
---|
1483 | if (state->orig.out.keyclass && state->tmp.out.keyclass) {
|
---|
1484 | *state->orig.out.keyclass = *state->tmp.out.keyclass;
|
---|
1485 | }
|
---|
1486 | if (state->orig.out.last_changed_time && state->tmp.out.last_changed_time) {
|
---|
1487 | *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
|
---|
1488 | }
|
---|
1489 |
|
---|
1490 | /* Copy result */
|
---|
1491 | state->orig.out.result = state->tmp.out.result;
|
---|
1492 |
|
---|
1493 | /* Reset temporary structure */
|
---|
1494 | ZERO_STRUCT(state->tmp);
|
---|
1495 |
|
---|
1496 | tevent_req_done(req);
|
---|
1497 | }
|
---|
1498 |
|
---|
1499 | NTSTATUS rpccli_winreg_EnumKey_recv(struct tevent_req *req,
|
---|
1500 | TALLOC_CTX *mem_ctx,
|
---|
1501 | WERROR *result)
|
---|
1502 | {
|
---|
1503 | struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
|
---|
1504 | req, struct rpccli_winreg_EnumKey_state);
|
---|
1505 | NTSTATUS status;
|
---|
1506 |
|
---|
1507 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1508 | tevent_req_received(req);
|
---|
1509 | return status;
|
---|
1510 | }
|
---|
1511 |
|
---|
1512 | /* Steal possbile out parameters to the callers context */
|
---|
1513 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1514 |
|
---|
1515 | /* Return result */
|
---|
1516 | *result = state->orig.out.result;
|
---|
1517 |
|
---|
1518 | tevent_req_received(req);
|
---|
1519 | return NT_STATUS_OK;
|
---|
1520 | }
|
---|
1521 |
|
---|
1522 | NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli,
|
---|
1523 | TALLOC_CTX *mem_ctx,
|
---|
1524 | struct policy_handle *handle /* [in] [ref] */,
|
---|
1525 | uint32_t enum_index /* [in] */,
|
---|
1526 | struct winreg_StringBuf *name /* [in,out] [ref] */,
|
---|
1527 | struct winreg_StringBuf *keyclass /* [in,out] [unique] */,
|
---|
1528 | NTTIME *last_changed_time /* [in,out] [unique] */,
|
---|
1529 | WERROR *werror)
|
---|
1530 | {
|
---|
1531 | struct winreg_EnumKey r;
|
---|
1532 | NTSTATUS status;
|
---|
1533 |
|
---|
1534 | /* In parameters */
|
---|
1535 | r.in.handle = handle;
|
---|
1536 | r.in.enum_index = enum_index;
|
---|
1537 | r.in.name = name;
|
---|
1538 | r.in.keyclass = keyclass;
|
---|
1539 | r.in.last_changed_time = last_changed_time;
|
---|
1540 |
|
---|
1541 | status = cli->dispatch(cli,
|
---|
1542 | mem_ctx,
|
---|
1543 | &ndr_table_winreg,
|
---|
1544 | NDR_WINREG_ENUMKEY,
|
---|
1545 | &r);
|
---|
1546 |
|
---|
1547 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1548 | return status;
|
---|
1549 | }
|
---|
1550 |
|
---|
1551 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1552 | return status;
|
---|
1553 | }
|
---|
1554 |
|
---|
1555 | /* Return variables */
|
---|
1556 | *name = *r.out.name;
|
---|
1557 | if (keyclass && r.out.keyclass) {
|
---|
1558 | *keyclass = *r.out.keyclass;
|
---|
1559 | }
|
---|
1560 | if (last_changed_time && r.out.last_changed_time) {
|
---|
1561 | *last_changed_time = *r.out.last_changed_time;
|
---|
1562 | }
|
---|
1563 |
|
---|
1564 | /* Return result */
|
---|
1565 | if (werror) {
|
---|
1566 | *werror = r.out.result;
|
---|
1567 | }
|
---|
1568 |
|
---|
1569 | return werror_to_ntstatus(r.out.result);
|
---|
1570 | }
|
---|
1571 |
|
---|
1572 | struct rpccli_winreg_EnumValue_state {
|
---|
1573 | struct winreg_EnumValue orig;
|
---|
1574 | struct winreg_EnumValue tmp;
|
---|
1575 | TALLOC_CTX *out_mem_ctx;
|
---|
1576 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1577 | };
|
---|
1578 |
|
---|
1579 | static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq);
|
---|
1580 |
|
---|
1581 | struct tevent_req *rpccli_winreg_EnumValue_send(TALLOC_CTX *mem_ctx,
|
---|
1582 | struct tevent_context *ev,
|
---|
1583 | struct rpc_pipe_client *cli,
|
---|
1584 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
1585 | uint32_t _enum_index /* [in] */,
|
---|
1586 | struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
|
---|
1587 | enum winreg_Type *_type /* [in,out] [unique] */,
|
---|
1588 | uint8_t *_value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
|
---|
1589 | uint32_t *_size /* [in,out] [unique] */,
|
---|
1590 | uint32_t *_length /* [in,out] [unique] */)
|
---|
1591 | {
|
---|
1592 | struct tevent_req *req;
|
---|
1593 | struct rpccli_winreg_EnumValue_state *state;
|
---|
1594 | struct tevent_req *subreq;
|
---|
1595 |
|
---|
1596 | req = tevent_req_create(mem_ctx, &state,
|
---|
1597 | struct rpccli_winreg_EnumValue_state);
|
---|
1598 | if (req == NULL) {
|
---|
1599 | return NULL;
|
---|
1600 | }
|
---|
1601 | state->out_mem_ctx = NULL;
|
---|
1602 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1603 |
|
---|
1604 | /* In parameters */
|
---|
1605 | state->orig.in.handle = _handle;
|
---|
1606 | state->orig.in.enum_index = _enum_index;
|
---|
1607 | state->orig.in.name = _name;
|
---|
1608 | state->orig.in.type = _type;
|
---|
1609 | state->orig.in.value = _value;
|
---|
1610 | state->orig.in.size = _size;
|
---|
1611 | state->orig.in.length = _length;
|
---|
1612 |
|
---|
1613 | /* Out parameters */
|
---|
1614 | state->orig.out.name = _name;
|
---|
1615 | state->orig.out.type = _type;
|
---|
1616 | state->orig.out.value = _value;
|
---|
1617 | state->orig.out.size = _size;
|
---|
1618 | state->orig.out.length = _length;
|
---|
1619 |
|
---|
1620 | /* Result */
|
---|
1621 | ZERO_STRUCT(state->orig.out.result);
|
---|
1622 |
|
---|
1623 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1624 | "rpccli_winreg_EnumValue_out_memory");
|
---|
1625 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1626 | return tevent_req_post(req, ev);
|
---|
1627 | }
|
---|
1628 |
|
---|
1629 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1630 | state->tmp = state->orig;
|
---|
1631 |
|
---|
1632 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1633 | &ndr_table_winreg,
|
---|
1634 | NDR_WINREG_ENUMVALUE,
|
---|
1635 | &state->tmp);
|
---|
1636 | if (tevent_req_nomem(subreq, req)) {
|
---|
1637 | return tevent_req_post(req, ev);
|
---|
1638 | }
|
---|
1639 | tevent_req_set_callback(subreq, rpccli_winreg_EnumValue_done, req);
|
---|
1640 | return req;
|
---|
1641 | }
|
---|
1642 |
|
---|
1643 | static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq)
|
---|
1644 | {
|
---|
1645 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1646 | subreq, struct tevent_req);
|
---|
1647 | struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
|
---|
1648 | req, struct rpccli_winreg_EnumValue_state);
|
---|
1649 | NTSTATUS status;
|
---|
1650 | TALLOC_CTX *mem_ctx;
|
---|
1651 |
|
---|
1652 | if (state->out_mem_ctx) {
|
---|
1653 | mem_ctx = state->out_mem_ctx;
|
---|
1654 | } else {
|
---|
1655 | mem_ctx = state;
|
---|
1656 | }
|
---|
1657 |
|
---|
1658 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1659 | TALLOC_FREE(subreq);
|
---|
1660 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1661 | tevent_req_nterror(req, status);
|
---|
1662 | return;
|
---|
1663 | }
|
---|
1664 |
|
---|
1665 | /* Copy out parameters */
|
---|
1666 | *state->orig.out.name = *state->tmp.out.name;
|
---|
1667 | if (state->orig.out.type && state->tmp.out.type) {
|
---|
1668 | *state->orig.out.type = *state->tmp.out.type;
|
---|
1669 | }
|
---|
1670 | if (state->orig.out.value && state->tmp.out.value) {
|
---|
1671 | if ((*state->tmp.out.size) > (*state->tmp.in.size)) {
|
---|
1672 | tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
|
---|
1673 | return;
|
---|
1674 | }
|
---|
1675 | if ((*state->tmp.out.length) > (*state->tmp.out.size)) {
|
---|
1676 | tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
|
---|
1677 | return;
|
---|
1678 | }
|
---|
1679 | memcpy(state->orig.out.value, state->tmp.out.value, (*state->tmp.out.length) * sizeof(*state->orig.out.value));
|
---|
1680 | }
|
---|
1681 | if (state->orig.out.size && state->tmp.out.size) {
|
---|
1682 | *state->orig.out.size = *state->tmp.out.size;
|
---|
1683 | }
|
---|
1684 | if (state->orig.out.length && state->tmp.out.length) {
|
---|
1685 | *state->orig.out.length = *state->tmp.out.length;
|
---|
1686 | }
|
---|
1687 |
|
---|
1688 | /* Copy result */
|
---|
1689 | state->orig.out.result = state->tmp.out.result;
|
---|
1690 |
|
---|
1691 | /* Reset temporary structure */
|
---|
1692 | ZERO_STRUCT(state->tmp);
|
---|
1693 |
|
---|
1694 | tevent_req_done(req);
|
---|
1695 | }
|
---|
1696 |
|
---|
1697 | NTSTATUS rpccli_winreg_EnumValue_recv(struct tevent_req *req,
|
---|
1698 | TALLOC_CTX *mem_ctx,
|
---|
1699 | WERROR *result)
|
---|
1700 | {
|
---|
1701 | struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
|
---|
1702 | req, struct rpccli_winreg_EnumValue_state);
|
---|
1703 | NTSTATUS status;
|
---|
1704 |
|
---|
1705 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1706 | tevent_req_received(req);
|
---|
1707 | return status;
|
---|
1708 | }
|
---|
1709 |
|
---|
1710 | /* Steal possbile out parameters to the callers context */
|
---|
1711 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1712 |
|
---|
1713 | /* Return result */
|
---|
1714 | *result = state->orig.out.result;
|
---|
1715 |
|
---|
1716 | tevent_req_received(req);
|
---|
1717 | return NT_STATUS_OK;
|
---|
1718 | }
|
---|
1719 |
|
---|
1720 | NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
|
---|
1721 | TALLOC_CTX *mem_ctx,
|
---|
1722 | struct policy_handle *handle /* [in] [ref] */,
|
---|
1723 | uint32_t enum_index /* [in] */,
|
---|
1724 | struct winreg_ValNameBuf *name /* [in,out] [ref] */,
|
---|
1725 | enum winreg_Type *type /* [in,out] [unique] */,
|
---|
1726 | uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
|
---|
1727 | uint32_t *size /* [in,out] [unique] */,
|
---|
1728 | uint32_t *length /* [in,out] [unique] */,
|
---|
1729 | WERROR *werror)
|
---|
1730 | {
|
---|
1731 | struct winreg_EnumValue r;
|
---|
1732 | NTSTATUS status;
|
---|
1733 |
|
---|
1734 | /* In parameters */
|
---|
1735 | r.in.handle = handle;
|
---|
1736 | r.in.enum_index = enum_index;
|
---|
1737 | r.in.name = name;
|
---|
1738 | r.in.type = type;
|
---|
1739 | r.in.value = value;
|
---|
1740 | r.in.size = size;
|
---|
1741 | r.in.length = length;
|
---|
1742 |
|
---|
1743 | status = cli->dispatch(cli,
|
---|
1744 | mem_ctx,
|
---|
1745 | &ndr_table_winreg,
|
---|
1746 | NDR_WINREG_ENUMVALUE,
|
---|
1747 | &r);
|
---|
1748 |
|
---|
1749 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1750 | return status;
|
---|
1751 | }
|
---|
1752 |
|
---|
1753 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1754 | return status;
|
---|
1755 | }
|
---|
1756 |
|
---|
1757 | /* Return variables */
|
---|
1758 | *name = *r.out.name;
|
---|
1759 | if (type && r.out.type) {
|
---|
1760 | *type = *r.out.type;
|
---|
1761 | }
|
---|
1762 | if (value && r.out.value) {
|
---|
1763 | if ((*r.out.size) > (*r.in.size)) {
|
---|
1764 | return NT_STATUS_INVALID_NETWORK_RESPONSE;
|
---|
1765 | }
|
---|
1766 | if ((*r.out.length) > (*r.out.size)) {
|
---|
1767 | return NT_STATUS_INVALID_NETWORK_RESPONSE;
|
---|
1768 | }
|
---|
1769 | memcpy(value, r.out.value, (*r.out.length) * sizeof(*value));
|
---|
1770 | }
|
---|
1771 | if (size && r.out.size) {
|
---|
1772 | *size = *r.out.size;
|
---|
1773 | }
|
---|
1774 | if (length && r.out.length) {
|
---|
1775 | *length = *r.out.length;
|
---|
1776 | }
|
---|
1777 |
|
---|
1778 | /* Return result */
|
---|
1779 | if (werror) {
|
---|
1780 | *werror = r.out.result;
|
---|
1781 | }
|
---|
1782 |
|
---|
1783 | return werror_to_ntstatus(r.out.result);
|
---|
1784 | }
|
---|
1785 |
|
---|
1786 | struct rpccli_winreg_FlushKey_state {
|
---|
1787 | struct winreg_FlushKey orig;
|
---|
1788 | struct winreg_FlushKey tmp;
|
---|
1789 | TALLOC_CTX *out_mem_ctx;
|
---|
1790 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1791 | };
|
---|
1792 |
|
---|
1793 | static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq);
|
---|
1794 |
|
---|
1795 | struct tevent_req *rpccli_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
|
---|
1796 | struct tevent_context *ev,
|
---|
1797 | struct rpc_pipe_client *cli,
|
---|
1798 | struct policy_handle *_handle /* [in] [ref] */)
|
---|
1799 | {
|
---|
1800 | struct tevent_req *req;
|
---|
1801 | struct rpccli_winreg_FlushKey_state *state;
|
---|
1802 | struct tevent_req *subreq;
|
---|
1803 |
|
---|
1804 | req = tevent_req_create(mem_ctx, &state,
|
---|
1805 | struct rpccli_winreg_FlushKey_state);
|
---|
1806 | if (req == NULL) {
|
---|
1807 | return NULL;
|
---|
1808 | }
|
---|
1809 | state->out_mem_ctx = NULL;
|
---|
1810 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1811 |
|
---|
1812 | /* In parameters */
|
---|
1813 | state->orig.in.handle = _handle;
|
---|
1814 |
|
---|
1815 | /* Out parameters */
|
---|
1816 |
|
---|
1817 | /* Result */
|
---|
1818 | ZERO_STRUCT(state->orig.out.result);
|
---|
1819 |
|
---|
1820 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1821 | state->tmp = state->orig;
|
---|
1822 |
|
---|
1823 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1824 | &ndr_table_winreg,
|
---|
1825 | NDR_WINREG_FLUSHKEY,
|
---|
1826 | &state->tmp);
|
---|
1827 | if (tevent_req_nomem(subreq, req)) {
|
---|
1828 | return tevent_req_post(req, ev);
|
---|
1829 | }
|
---|
1830 | tevent_req_set_callback(subreq, rpccli_winreg_FlushKey_done, req);
|
---|
1831 | return req;
|
---|
1832 | }
|
---|
1833 |
|
---|
1834 | static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq)
|
---|
1835 | {
|
---|
1836 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1837 | subreq, struct tevent_req);
|
---|
1838 | struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
|
---|
1839 | req, struct rpccli_winreg_FlushKey_state);
|
---|
1840 | NTSTATUS status;
|
---|
1841 | TALLOC_CTX *mem_ctx;
|
---|
1842 |
|
---|
1843 | if (state->out_mem_ctx) {
|
---|
1844 | mem_ctx = state->out_mem_ctx;
|
---|
1845 | } else {
|
---|
1846 | mem_ctx = state;
|
---|
1847 | }
|
---|
1848 |
|
---|
1849 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
1850 | TALLOC_FREE(subreq);
|
---|
1851 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1852 | tevent_req_nterror(req, status);
|
---|
1853 | return;
|
---|
1854 | }
|
---|
1855 |
|
---|
1856 | /* Copy out parameters */
|
---|
1857 |
|
---|
1858 | /* Copy result */
|
---|
1859 | state->orig.out.result = state->tmp.out.result;
|
---|
1860 |
|
---|
1861 | /* Reset temporary structure */
|
---|
1862 | ZERO_STRUCT(state->tmp);
|
---|
1863 |
|
---|
1864 | tevent_req_done(req);
|
---|
1865 | }
|
---|
1866 |
|
---|
1867 | NTSTATUS rpccli_winreg_FlushKey_recv(struct tevent_req *req,
|
---|
1868 | TALLOC_CTX *mem_ctx,
|
---|
1869 | WERROR *result)
|
---|
1870 | {
|
---|
1871 | struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
|
---|
1872 | req, struct rpccli_winreg_FlushKey_state);
|
---|
1873 | NTSTATUS status;
|
---|
1874 |
|
---|
1875 | if (tevent_req_is_nterror(req, &status)) {
|
---|
1876 | tevent_req_received(req);
|
---|
1877 | return status;
|
---|
1878 | }
|
---|
1879 |
|
---|
1880 | /* Steal possbile out parameters to the callers context */
|
---|
1881 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
1882 |
|
---|
1883 | /* Return result */
|
---|
1884 | *result = state->orig.out.result;
|
---|
1885 |
|
---|
1886 | tevent_req_received(req);
|
---|
1887 | return NT_STATUS_OK;
|
---|
1888 | }
|
---|
1889 |
|
---|
1890 | NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli,
|
---|
1891 | TALLOC_CTX *mem_ctx,
|
---|
1892 | struct policy_handle *handle /* [in] [ref] */,
|
---|
1893 | WERROR *werror)
|
---|
1894 | {
|
---|
1895 | struct winreg_FlushKey r;
|
---|
1896 | NTSTATUS status;
|
---|
1897 |
|
---|
1898 | /* In parameters */
|
---|
1899 | r.in.handle = handle;
|
---|
1900 |
|
---|
1901 | status = cli->dispatch(cli,
|
---|
1902 | mem_ctx,
|
---|
1903 | &ndr_table_winreg,
|
---|
1904 | NDR_WINREG_FLUSHKEY,
|
---|
1905 | &r);
|
---|
1906 |
|
---|
1907 | if (!NT_STATUS_IS_OK(status)) {
|
---|
1908 | return status;
|
---|
1909 | }
|
---|
1910 |
|
---|
1911 | if (NT_STATUS_IS_ERR(status)) {
|
---|
1912 | return status;
|
---|
1913 | }
|
---|
1914 |
|
---|
1915 | /* Return variables */
|
---|
1916 |
|
---|
1917 | /* Return result */
|
---|
1918 | if (werror) {
|
---|
1919 | *werror = r.out.result;
|
---|
1920 | }
|
---|
1921 |
|
---|
1922 | return werror_to_ntstatus(r.out.result);
|
---|
1923 | }
|
---|
1924 |
|
---|
1925 | struct rpccli_winreg_GetKeySecurity_state {
|
---|
1926 | struct winreg_GetKeySecurity orig;
|
---|
1927 | struct winreg_GetKeySecurity tmp;
|
---|
1928 | TALLOC_CTX *out_mem_ctx;
|
---|
1929 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
1930 | };
|
---|
1931 |
|
---|
1932 | static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq);
|
---|
1933 |
|
---|
1934 | struct tevent_req *rpccli_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
|
---|
1935 | struct tevent_context *ev,
|
---|
1936 | struct rpc_pipe_client *cli,
|
---|
1937 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
1938 | uint32_t _sec_info /* [in] */,
|
---|
1939 | struct KeySecurityData *_sd /* [in,out] [ref] */)
|
---|
1940 | {
|
---|
1941 | struct tevent_req *req;
|
---|
1942 | struct rpccli_winreg_GetKeySecurity_state *state;
|
---|
1943 | struct tevent_req *subreq;
|
---|
1944 |
|
---|
1945 | req = tevent_req_create(mem_ctx, &state,
|
---|
1946 | struct rpccli_winreg_GetKeySecurity_state);
|
---|
1947 | if (req == NULL) {
|
---|
1948 | return NULL;
|
---|
1949 | }
|
---|
1950 | state->out_mem_ctx = NULL;
|
---|
1951 | state->dispatch_recv = cli->dispatch_recv;
|
---|
1952 |
|
---|
1953 | /* In parameters */
|
---|
1954 | state->orig.in.handle = _handle;
|
---|
1955 | state->orig.in.sec_info = _sec_info;
|
---|
1956 | state->orig.in.sd = _sd;
|
---|
1957 |
|
---|
1958 | /* Out parameters */
|
---|
1959 | state->orig.out.sd = _sd;
|
---|
1960 |
|
---|
1961 | /* Result */
|
---|
1962 | ZERO_STRUCT(state->orig.out.result);
|
---|
1963 |
|
---|
1964 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
1965 | "rpccli_winreg_GetKeySecurity_out_memory");
|
---|
1966 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
1967 | return tevent_req_post(req, ev);
|
---|
1968 | }
|
---|
1969 |
|
---|
1970 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
1971 | state->tmp = state->orig;
|
---|
1972 |
|
---|
1973 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
1974 | &ndr_table_winreg,
|
---|
1975 | NDR_WINREG_GETKEYSECURITY,
|
---|
1976 | &state->tmp);
|
---|
1977 | if (tevent_req_nomem(subreq, req)) {
|
---|
1978 | return tevent_req_post(req, ev);
|
---|
1979 | }
|
---|
1980 | tevent_req_set_callback(subreq, rpccli_winreg_GetKeySecurity_done, req);
|
---|
1981 | return req;
|
---|
1982 | }
|
---|
1983 |
|
---|
1984 | static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq)
|
---|
1985 | {
|
---|
1986 | struct tevent_req *req = tevent_req_callback_data(
|
---|
1987 | subreq, struct tevent_req);
|
---|
1988 | struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
|
---|
1989 | req, struct rpccli_winreg_GetKeySecurity_state);
|
---|
1990 | NTSTATUS status;
|
---|
1991 | TALLOC_CTX *mem_ctx;
|
---|
1992 |
|
---|
1993 | if (state->out_mem_ctx) {
|
---|
1994 | mem_ctx = state->out_mem_ctx;
|
---|
1995 | } else {
|
---|
1996 | mem_ctx = state;
|
---|
1997 | }
|
---|
1998 |
|
---|
1999 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2000 | TALLOC_FREE(subreq);
|
---|
2001 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2002 | tevent_req_nterror(req, status);
|
---|
2003 | return;
|
---|
2004 | }
|
---|
2005 |
|
---|
2006 | /* Copy out parameters */
|
---|
2007 | *state->orig.out.sd = *state->tmp.out.sd;
|
---|
2008 |
|
---|
2009 | /* Copy result */
|
---|
2010 | state->orig.out.result = state->tmp.out.result;
|
---|
2011 |
|
---|
2012 | /* Reset temporary structure */
|
---|
2013 | ZERO_STRUCT(state->tmp);
|
---|
2014 |
|
---|
2015 | tevent_req_done(req);
|
---|
2016 | }
|
---|
2017 |
|
---|
2018 | NTSTATUS rpccli_winreg_GetKeySecurity_recv(struct tevent_req *req,
|
---|
2019 | TALLOC_CTX *mem_ctx,
|
---|
2020 | WERROR *result)
|
---|
2021 | {
|
---|
2022 | struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
|
---|
2023 | req, struct rpccli_winreg_GetKeySecurity_state);
|
---|
2024 | NTSTATUS status;
|
---|
2025 |
|
---|
2026 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2027 | tevent_req_received(req);
|
---|
2028 | return status;
|
---|
2029 | }
|
---|
2030 |
|
---|
2031 | /* Steal possbile out parameters to the callers context */
|
---|
2032 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2033 |
|
---|
2034 | /* Return result */
|
---|
2035 | *result = state->orig.out.result;
|
---|
2036 |
|
---|
2037 | tevent_req_received(req);
|
---|
2038 | return NT_STATUS_OK;
|
---|
2039 | }
|
---|
2040 |
|
---|
2041 | NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
|
---|
2042 | TALLOC_CTX *mem_ctx,
|
---|
2043 | struct policy_handle *handle /* [in] [ref] */,
|
---|
2044 | uint32_t sec_info /* [in] */,
|
---|
2045 | struct KeySecurityData *sd /* [in,out] [ref] */,
|
---|
2046 | WERROR *werror)
|
---|
2047 | {
|
---|
2048 | struct winreg_GetKeySecurity r;
|
---|
2049 | NTSTATUS status;
|
---|
2050 |
|
---|
2051 | /* In parameters */
|
---|
2052 | r.in.handle = handle;
|
---|
2053 | r.in.sec_info = sec_info;
|
---|
2054 | r.in.sd = sd;
|
---|
2055 |
|
---|
2056 | status = cli->dispatch(cli,
|
---|
2057 | mem_ctx,
|
---|
2058 | &ndr_table_winreg,
|
---|
2059 | NDR_WINREG_GETKEYSECURITY,
|
---|
2060 | &r);
|
---|
2061 |
|
---|
2062 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2063 | return status;
|
---|
2064 | }
|
---|
2065 |
|
---|
2066 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2067 | return status;
|
---|
2068 | }
|
---|
2069 |
|
---|
2070 | /* Return variables */
|
---|
2071 | *sd = *r.out.sd;
|
---|
2072 |
|
---|
2073 | /* Return result */
|
---|
2074 | if (werror) {
|
---|
2075 | *werror = r.out.result;
|
---|
2076 | }
|
---|
2077 |
|
---|
2078 | return werror_to_ntstatus(r.out.result);
|
---|
2079 | }
|
---|
2080 |
|
---|
2081 | struct rpccli_winreg_LoadKey_state {
|
---|
2082 | struct winreg_LoadKey orig;
|
---|
2083 | struct winreg_LoadKey tmp;
|
---|
2084 | TALLOC_CTX *out_mem_ctx;
|
---|
2085 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2086 | };
|
---|
2087 |
|
---|
2088 | static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq);
|
---|
2089 |
|
---|
2090 | struct tevent_req *rpccli_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
|
---|
2091 | struct tevent_context *ev,
|
---|
2092 | struct rpc_pipe_client *cli,
|
---|
2093 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
2094 | struct winreg_String *_keyname /* [in] [unique] */,
|
---|
2095 | struct winreg_String *_filename /* [in] [unique] */)
|
---|
2096 | {
|
---|
2097 | struct tevent_req *req;
|
---|
2098 | struct rpccli_winreg_LoadKey_state *state;
|
---|
2099 | struct tevent_req *subreq;
|
---|
2100 |
|
---|
2101 | req = tevent_req_create(mem_ctx, &state,
|
---|
2102 | struct rpccli_winreg_LoadKey_state);
|
---|
2103 | if (req == NULL) {
|
---|
2104 | return NULL;
|
---|
2105 | }
|
---|
2106 | state->out_mem_ctx = NULL;
|
---|
2107 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2108 |
|
---|
2109 | /* In parameters */
|
---|
2110 | state->orig.in.handle = _handle;
|
---|
2111 | state->orig.in.keyname = _keyname;
|
---|
2112 | state->orig.in.filename = _filename;
|
---|
2113 |
|
---|
2114 | /* Out parameters */
|
---|
2115 |
|
---|
2116 | /* Result */
|
---|
2117 | ZERO_STRUCT(state->orig.out.result);
|
---|
2118 |
|
---|
2119 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2120 | state->tmp = state->orig;
|
---|
2121 |
|
---|
2122 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2123 | &ndr_table_winreg,
|
---|
2124 | NDR_WINREG_LOADKEY,
|
---|
2125 | &state->tmp);
|
---|
2126 | if (tevent_req_nomem(subreq, req)) {
|
---|
2127 | return tevent_req_post(req, ev);
|
---|
2128 | }
|
---|
2129 | tevent_req_set_callback(subreq, rpccli_winreg_LoadKey_done, req);
|
---|
2130 | return req;
|
---|
2131 | }
|
---|
2132 |
|
---|
2133 | static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq)
|
---|
2134 | {
|
---|
2135 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2136 | subreq, struct tevent_req);
|
---|
2137 | struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
|
---|
2138 | req, struct rpccli_winreg_LoadKey_state);
|
---|
2139 | NTSTATUS status;
|
---|
2140 | TALLOC_CTX *mem_ctx;
|
---|
2141 |
|
---|
2142 | if (state->out_mem_ctx) {
|
---|
2143 | mem_ctx = state->out_mem_ctx;
|
---|
2144 | } else {
|
---|
2145 | mem_ctx = state;
|
---|
2146 | }
|
---|
2147 |
|
---|
2148 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2149 | TALLOC_FREE(subreq);
|
---|
2150 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2151 | tevent_req_nterror(req, status);
|
---|
2152 | return;
|
---|
2153 | }
|
---|
2154 |
|
---|
2155 | /* Copy out parameters */
|
---|
2156 |
|
---|
2157 | /* Copy result */
|
---|
2158 | state->orig.out.result = state->tmp.out.result;
|
---|
2159 |
|
---|
2160 | /* Reset temporary structure */
|
---|
2161 | ZERO_STRUCT(state->tmp);
|
---|
2162 |
|
---|
2163 | tevent_req_done(req);
|
---|
2164 | }
|
---|
2165 |
|
---|
2166 | NTSTATUS rpccli_winreg_LoadKey_recv(struct tevent_req *req,
|
---|
2167 | TALLOC_CTX *mem_ctx,
|
---|
2168 | WERROR *result)
|
---|
2169 | {
|
---|
2170 | struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
|
---|
2171 | req, struct rpccli_winreg_LoadKey_state);
|
---|
2172 | NTSTATUS status;
|
---|
2173 |
|
---|
2174 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2175 | tevent_req_received(req);
|
---|
2176 | return status;
|
---|
2177 | }
|
---|
2178 |
|
---|
2179 | /* Steal possbile out parameters to the callers context */
|
---|
2180 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2181 |
|
---|
2182 | /* Return result */
|
---|
2183 | *result = state->orig.out.result;
|
---|
2184 |
|
---|
2185 | tevent_req_received(req);
|
---|
2186 | return NT_STATUS_OK;
|
---|
2187 | }
|
---|
2188 |
|
---|
2189 | NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli,
|
---|
2190 | TALLOC_CTX *mem_ctx,
|
---|
2191 | struct policy_handle *handle /* [in] [ref] */,
|
---|
2192 | struct winreg_String *keyname /* [in] [unique] */,
|
---|
2193 | struct winreg_String *filename /* [in] [unique] */,
|
---|
2194 | WERROR *werror)
|
---|
2195 | {
|
---|
2196 | struct winreg_LoadKey r;
|
---|
2197 | NTSTATUS status;
|
---|
2198 |
|
---|
2199 | /* In parameters */
|
---|
2200 | r.in.handle = handle;
|
---|
2201 | r.in.keyname = keyname;
|
---|
2202 | r.in.filename = filename;
|
---|
2203 |
|
---|
2204 | status = cli->dispatch(cli,
|
---|
2205 | mem_ctx,
|
---|
2206 | &ndr_table_winreg,
|
---|
2207 | NDR_WINREG_LOADKEY,
|
---|
2208 | &r);
|
---|
2209 |
|
---|
2210 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2211 | return status;
|
---|
2212 | }
|
---|
2213 |
|
---|
2214 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2215 | return status;
|
---|
2216 | }
|
---|
2217 |
|
---|
2218 | /* Return variables */
|
---|
2219 |
|
---|
2220 | /* Return result */
|
---|
2221 | if (werror) {
|
---|
2222 | *werror = r.out.result;
|
---|
2223 | }
|
---|
2224 |
|
---|
2225 | return werror_to_ntstatus(r.out.result);
|
---|
2226 | }
|
---|
2227 |
|
---|
2228 | struct rpccli_winreg_NotifyChangeKeyValue_state {
|
---|
2229 | struct winreg_NotifyChangeKeyValue orig;
|
---|
2230 | struct winreg_NotifyChangeKeyValue tmp;
|
---|
2231 | TALLOC_CTX *out_mem_ctx;
|
---|
2232 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2233 | };
|
---|
2234 |
|
---|
2235 | static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq);
|
---|
2236 |
|
---|
2237 | struct tevent_req *rpccli_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
|
---|
2238 | struct tevent_context *ev,
|
---|
2239 | struct rpc_pipe_client *cli,
|
---|
2240 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
2241 | uint8_t _watch_subtree /* [in] */,
|
---|
2242 | uint32_t _notify_filter /* [in] */,
|
---|
2243 | uint32_t _unknown /* [in] */,
|
---|
2244 | struct winreg_String _string1 /* [in] */,
|
---|
2245 | struct winreg_String _string2 /* [in] */,
|
---|
2246 | uint32_t _unknown2 /* [in] */)
|
---|
2247 | {
|
---|
2248 | struct tevent_req *req;
|
---|
2249 | struct rpccli_winreg_NotifyChangeKeyValue_state *state;
|
---|
2250 | struct tevent_req *subreq;
|
---|
2251 |
|
---|
2252 | req = tevent_req_create(mem_ctx, &state,
|
---|
2253 | struct rpccli_winreg_NotifyChangeKeyValue_state);
|
---|
2254 | if (req == NULL) {
|
---|
2255 | return NULL;
|
---|
2256 | }
|
---|
2257 | state->out_mem_ctx = NULL;
|
---|
2258 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2259 |
|
---|
2260 | /* In parameters */
|
---|
2261 | state->orig.in.handle = _handle;
|
---|
2262 | state->orig.in.watch_subtree = _watch_subtree;
|
---|
2263 | state->orig.in.notify_filter = _notify_filter;
|
---|
2264 | state->orig.in.unknown = _unknown;
|
---|
2265 | state->orig.in.string1 = _string1;
|
---|
2266 | state->orig.in.string2 = _string2;
|
---|
2267 | state->orig.in.unknown2 = _unknown2;
|
---|
2268 |
|
---|
2269 | /* Out parameters */
|
---|
2270 |
|
---|
2271 | /* Result */
|
---|
2272 | ZERO_STRUCT(state->orig.out.result);
|
---|
2273 |
|
---|
2274 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2275 | state->tmp = state->orig;
|
---|
2276 |
|
---|
2277 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2278 | &ndr_table_winreg,
|
---|
2279 | NDR_WINREG_NOTIFYCHANGEKEYVALUE,
|
---|
2280 | &state->tmp);
|
---|
2281 | if (tevent_req_nomem(subreq, req)) {
|
---|
2282 | return tevent_req_post(req, ev);
|
---|
2283 | }
|
---|
2284 | tevent_req_set_callback(subreq, rpccli_winreg_NotifyChangeKeyValue_done, req);
|
---|
2285 | return req;
|
---|
2286 | }
|
---|
2287 |
|
---|
2288 | static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq)
|
---|
2289 | {
|
---|
2290 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2291 | subreq, struct tevent_req);
|
---|
2292 | struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
|
---|
2293 | req, struct rpccli_winreg_NotifyChangeKeyValue_state);
|
---|
2294 | NTSTATUS status;
|
---|
2295 | TALLOC_CTX *mem_ctx;
|
---|
2296 |
|
---|
2297 | if (state->out_mem_ctx) {
|
---|
2298 | mem_ctx = state->out_mem_ctx;
|
---|
2299 | } else {
|
---|
2300 | mem_ctx = state;
|
---|
2301 | }
|
---|
2302 |
|
---|
2303 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2304 | TALLOC_FREE(subreq);
|
---|
2305 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2306 | tevent_req_nterror(req, status);
|
---|
2307 | return;
|
---|
2308 | }
|
---|
2309 |
|
---|
2310 | /* Copy out parameters */
|
---|
2311 |
|
---|
2312 | /* Copy result */
|
---|
2313 | state->orig.out.result = state->tmp.out.result;
|
---|
2314 |
|
---|
2315 | /* Reset temporary structure */
|
---|
2316 | ZERO_STRUCT(state->tmp);
|
---|
2317 |
|
---|
2318 | tevent_req_done(req);
|
---|
2319 | }
|
---|
2320 |
|
---|
2321 | NTSTATUS rpccli_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
|
---|
2322 | TALLOC_CTX *mem_ctx,
|
---|
2323 | WERROR *result)
|
---|
2324 | {
|
---|
2325 | struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
|
---|
2326 | req, struct rpccli_winreg_NotifyChangeKeyValue_state);
|
---|
2327 | NTSTATUS status;
|
---|
2328 |
|
---|
2329 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2330 | tevent_req_received(req);
|
---|
2331 | return status;
|
---|
2332 | }
|
---|
2333 |
|
---|
2334 | /* Steal possbile out parameters to the callers context */
|
---|
2335 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2336 |
|
---|
2337 | /* Return result */
|
---|
2338 | *result = state->orig.out.result;
|
---|
2339 |
|
---|
2340 | tevent_req_received(req);
|
---|
2341 | return NT_STATUS_OK;
|
---|
2342 | }
|
---|
2343 |
|
---|
2344 | NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
|
---|
2345 | TALLOC_CTX *mem_ctx,
|
---|
2346 | struct policy_handle *handle /* [in] [ref] */,
|
---|
2347 | uint8_t watch_subtree /* [in] */,
|
---|
2348 | uint32_t notify_filter /* [in] */,
|
---|
2349 | uint32_t unknown /* [in] */,
|
---|
2350 | struct winreg_String string1 /* [in] */,
|
---|
2351 | struct winreg_String string2 /* [in] */,
|
---|
2352 | uint32_t unknown2 /* [in] */,
|
---|
2353 | WERROR *werror)
|
---|
2354 | {
|
---|
2355 | struct winreg_NotifyChangeKeyValue r;
|
---|
2356 | NTSTATUS status;
|
---|
2357 |
|
---|
2358 | /* In parameters */
|
---|
2359 | r.in.handle = handle;
|
---|
2360 | r.in.watch_subtree = watch_subtree;
|
---|
2361 | r.in.notify_filter = notify_filter;
|
---|
2362 | r.in.unknown = unknown;
|
---|
2363 | r.in.string1 = string1;
|
---|
2364 | r.in.string2 = string2;
|
---|
2365 | r.in.unknown2 = unknown2;
|
---|
2366 |
|
---|
2367 | status = cli->dispatch(cli,
|
---|
2368 | mem_ctx,
|
---|
2369 | &ndr_table_winreg,
|
---|
2370 | NDR_WINREG_NOTIFYCHANGEKEYVALUE,
|
---|
2371 | &r);
|
---|
2372 |
|
---|
2373 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2374 | return status;
|
---|
2375 | }
|
---|
2376 |
|
---|
2377 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2378 | return status;
|
---|
2379 | }
|
---|
2380 |
|
---|
2381 | /* Return variables */
|
---|
2382 |
|
---|
2383 | /* Return result */
|
---|
2384 | if (werror) {
|
---|
2385 | *werror = r.out.result;
|
---|
2386 | }
|
---|
2387 |
|
---|
2388 | return werror_to_ntstatus(r.out.result);
|
---|
2389 | }
|
---|
2390 |
|
---|
2391 | struct rpccli_winreg_OpenKey_state {
|
---|
2392 | struct winreg_OpenKey orig;
|
---|
2393 | struct winreg_OpenKey tmp;
|
---|
2394 | TALLOC_CTX *out_mem_ctx;
|
---|
2395 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2396 | };
|
---|
2397 |
|
---|
2398 | static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq);
|
---|
2399 |
|
---|
2400 | struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
|
---|
2401 | struct tevent_context *ev,
|
---|
2402 | struct rpc_pipe_client *cli,
|
---|
2403 | struct policy_handle *_parent_handle /* [in] [ref] */,
|
---|
2404 | struct winreg_String _keyname /* [in] */,
|
---|
2405 | uint32_t _unknown /* [in] */,
|
---|
2406 | uint32_t _access_mask /* [in] */,
|
---|
2407 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
2408 | {
|
---|
2409 | struct tevent_req *req;
|
---|
2410 | struct rpccli_winreg_OpenKey_state *state;
|
---|
2411 | struct tevent_req *subreq;
|
---|
2412 |
|
---|
2413 | req = tevent_req_create(mem_ctx, &state,
|
---|
2414 | struct rpccli_winreg_OpenKey_state);
|
---|
2415 | if (req == NULL) {
|
---|
2416 | return NULL;
|
---|
2417 | }
|
---|
2418 | state->out_mem_ctx = NULL;
|
---|
2419 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2420 |
|
---|
2421 | /* In parameters */
|
---|
2422 | state->orig.in.parent_handle = _parent_handle;
|
---|
2423 | state->orig.in.keyname = _keyname;
|
---|
2424 | state->orig.in.unknown = _unknown;
|
---|
2425 | state->orig.in.access_mask = _access_mask;
|
---|
2426 |
|
---|
2427 | /* Out parameters */
|
---|
2428 | state->orig.out.handle = _handle;
|
---|
2429 |
|
---|
2430 | /* Result */
|
---|
2431 | ZERO_STRUCT(state->orig.out.result);
|
---|
2432 |
|
---|
2433 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2434 | "rpccli_winreg_OpenKey_out_memory");
|
---|
2435 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2436 | return tevent_req_post(req, ev);
|
---|
2437 | }
|
---|
2438 |
|
---|
2439 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2440 | state->tmp = state->orig;
|
---|
2441 |
|
---|
2442 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2443 | &ndr_table_winreg,
|
---|
2444 | NDR_WINREG_OPENKEY,
|
---|
2445 | &state->tmp);
|
---|
2446 | if (tevent_req_nomem(subreq, req)) {
|
---|
2447 | return tevent_req_post(req, ev);
|
---|
2448 | }
|
---|
2449 | tevent_req_set_callback(subreq, rpccli_winreg_OpenKey_done, req);
|
---|
2450 | return req;
|
---|
2451 | }
|
---|
2452 |
|
---|
2453 | static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq)
|
---|
2454 | {
|
---|
2455 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2456 | subreq, struct tevent_req);
|
---|
2457 | struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
|
---|
2458 | req, struct rpccli_winreg_OpenKey_state);
|
---|
2459 | NTSTATUS status;
|
---|
2460 | TALLOC_CTX *mem_ctx;
|
---|
2461 |
|
---|
2462 | if (state->out_mem_ctx) {
|
---|
2463 | mem_ctx = state->out_mem_ctx;
|
---|
2464 | } else {
|
---|
2465 | mem_ctx = state;
|
---|
2466 | }
|
---|
2467 |
|
---|
2468 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2469 | TALLOC_FREE(subreq);
|
---|
2470 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2471 | tevent_req_nterror(req, status);
|
---|
2472 | return;
|
---|
2473 | }
|
---|
2474 |
|
---|
2475 | /* Copy out parameters */
|
---|
2476 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
2477 |
|
---|
2478 | /* Copy result */
|
---|
2479 | state->orig.out.result = state->tmp.out.result;
|
---|
2480 |
|
---|
2481 | /* Reset temporary structure */
|
---|
2482 | ZERO_STRUCT(state->tmp);
|
---|
2483 |
|
---|
2484 | tevent_req_done(req);
|
---|
2485 | }
|
---|
2486 |
|
---|
2487 | NTSTATUS rpccli_winreg_OpenKey_recv(struct tevent_req *req,
|
---|
2488 | TALLOC_CTX *mem_ctx,
|
---|
2489 | WERROR *result)
|
---|
2490 | {
|
---|
2491 | struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
|
---|
2492 | req, struct rpccli_winreg_OpenKey_state);
|
---|
2493 | NTSTATUS status;
|
---|
2494 |
|
---|
2495 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2496 | tevent_req_received(req);
|
---|
2497 | return status;
|
---|
2498 | }
|
---|
2499 |
|
---|
2500 | /* Steal possbile out parameters to the callers context */
|
---|
2501 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2502 |
|
---|
2503 | /* Return result */
|
---|
2504 | *result = state->orig.out.result;
|
---|
2505 |
|
---|
2506 | tevent_req_received(req);
|
---|
2507 | return NT_STATUS_OK;
|
---|
2508 | }
|
---|
2509 |
|
---|
2510 | NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
|
---|
2511 | TALLOC_CTX *mem_ctx,
|
---|
2512 | struct policy_handle *parent_handle /* [in] [ref] */,
|
---|
2513 | struct winreg_String keyname /* [in] */,
|
---|
2514 | uint32_t unknown /* [in] */,
|
---|
2515 | uint32_t access_mask /* [in] */,
|
---|
2516 | struct policy_handle *handle /* [out] [ref] */,
|
---|
2517 | WERROR *werror)
|
---|
2518 | {
|
---|
2519 | struct winreg_OpenKey r;
|
---|
2520 | NTSTATUS status;
|
---|
2521 |
|
---|
2522 | /* In parameters */
|
---|
2523 | r.in.parent_handle = parent_handle;
|
---|
2524 | r.in.keyname = keyname;
|
---|
2525 | r.in.unknown = unknown;
|
---|
2526 | r.in.access_mask = access_mask;
|
---|
2527 |
|
---|
2528 | status = cli->dispatch(cli,
|
---|
2529 | mem_ctx,
|
---|
2530 | &ndr_table_winreg,
|
---|
2531 | NDR_WINREG_OPENKEY,
|
---|
2532 | &r);
|
---|
2533 |
|
---|
2534 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2535 | return status;
|
---|
2536 | }
|
---|
2537 |
|
---|
2538 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2539 | return status;
|
---|
2540 | }
|
---|
2541 |
|
---|
2542 | /* Return variables */
|
---|
2543 | *handle = *r.out.handle;
|
---|
2544 |
|
---|
2545 | /* Return result */
|
---|
2546 | if (werror) {
|
---|
2547 | *werror = r.out.result;
|
---|
2548 | }
|
---|
2549 |
|
---|
2550 | return werror_to_ntstatus(r.out.result);
|
---|
2551 | }
|
---|
2552 |
|
---|
2553 | struct rpccli_winreg_QueryInfoKey_state {
|
---|
2554 | struct winreg_QueryInfoKey orig;
|
---|
2555 | struct winreg_QueryInfoKey tmp;
|
---|
2556 | TALLOC_CTX *out_mem_ctx;
|
---|
2557 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2558 | };
|
---|
2559 |
|
---|
2560 | static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq);
|
---|
2561 |
|
---|
2562 | struct tevent_req *rpccli_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
|
---|
2563 | struct tevent_context *ev,
|
---|
2564 | struct rpc_pipe_client *cli,
|
---|
2565 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
2566 | struct winreg_String *_classname /* [in,out] [ref] */,
|
---|
2567 | uint32_t *_num_subkeys /* [out] [ref] */,
|
---|
2568 | uint32_t *_max_subkeylen /* [out] [ref] */,
|
---|
2569 | uint32_t *_max_classlen /* [out] [ref] */,
|
---|
2570 | uint32_t *_num_values /* [out] [ref] */,
|
---|
2571 | uint32_t *_max_valnamelen /* [out] [ref] */,
|
---|
2572 | uint32_t *_max_valbufsize /* [out] [ref] */,
|
---|
2573 | uint32_t *_secdescsize /* [out] [ref] */,
|
---|
2574 | NTTIME *_last_changed_time /* [out] [ref] */)
|
---|
2575 | {
|
---|
2576 | struct tevent_req *req;
|
---|
2577 | struct rpccli_winreg_QueryInfoKey_state *state;
|
---|
2578 | struct tevent_req *subreq;
|
---|
2579 |
|
---|
2580 | req = tevent_req_create(mem_ctx, &state,
|
---|
2581 | struct rpccli_winreg_QueryInfoKey_state);
|
---|
2582 | if (req == NULL) {
|
---|
2583 | return NULL;
|
---|
2584 | }
|
---|
2585 | state->out_mem_ctx = NULL;
|
---|
2586 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2587 |
|
---|
2588 | /* In parameters */
|
---|
2589 | state->orig.in.handle = _handle;
|
---|
2590 | state->orig.in.classname = _classname;
|
---|
2591 |
|
---|
2592 | /* Out parameters */
|
---|
2593 | state->orig.out.classname = _classname;
|
---|
2594 | state->orig.out.num_subkeys = _num_subkeys;
|
---|
2595 | state->orig.out.max_subkeylen = _max_subkeylen;
|
---|
2596 | state->orig.out.max_classlen = _max_classlen;
|
---|
2597 | state->orig.out.num_values = _num_values;
|
---|
2598 | state->orig.out.max_valnamelen = _max_valnamelen;
|
---|
2599 | state->orig.out.max_valbufsize = _max_valbufsize;
|
---|
2600 | state->orig.out.secdescsize = _secdescsize;
|
---|
2601 | state->orig.out.last_changed_time = _last_changed_time;
|
---|
2602 |
|
---|
2603 | /* Result */
|
---|
2604 | ZERO_STRUCT(state->orig.out.result);
|
---|
2605 |
|
---|
2606 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2607 | "rpccli_winreg_QueryInfoKey_out_memory");
|
---|
2608 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2609 | return tevent_req_post(req, ev);
|
---|
2610 | }
|
---|
2611 |
|
---|
2612 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2613 | state->tmp = state->orig;
|
---|
2614 |
|
---|
2615 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2616 | &ndr_table_winreg,
|
---|
2617 | NDR_WINREG_QUERYINFOKEY,
|
---|
2618 | &state->tmp);
|
---|
2619 | if (tevent_req_nomem(subreq, req)) {
|
---|
2620 | return tevent_req_post(req, ev);
|
---|
2621 | }
|
---|
2622 | tevent_req_set_callback(subreq, rpccli_winreg_QueryInfoKey_done, req);
|
---|
2623 | return req;
|
---|
2624 | }
|
---|
2625 |
|
---|
2626 | static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq)
|
---|
2627 | {
|
---|
2628 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2629 | subreq, struct tevent_req);
|
---|
2630 | struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
|
---|
2631 | req, struct rpccli_winreg_QueryInfoKey_state);
|
---|
2632 | NTSTATUS status;
|
---|
2633 | TALLOC_CTX *mem_ctx;
|
---|
2634 |
|
---|
2635 | if (state->out_mem_ctx) {
|
---|
2636 | mem_ctx = state->out_mem_ctx;
|
---|
2637 | } else {
|
---|
2638 | mem_ctx = state;
|
---|
2639 | }
|
---|
2640 |
|
---|
2641 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2642 | TALLOC_FREE(subreq);
|
---|
2643 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2644 | tevent_req_nterror(req, status);
|
---|
2645 | return;
|
---|
2646 | }
|
---|
2647 |
|
---|
2648 | /* Copy out parameters */
|
---|
2649 | *state->orig.out.classname = *state->tmp.out.classname;
|
---|
2650 | *state->orig.out.num_subkeys = *state->tmp.out.num_subkeys;
|
---|
2651 | *state->orig.out.max_subkeylen = *state->tmp.out.max_subkeylen;
|
---|
2652 | *state->orig.out.max_classlen = *state->tmp.out.max_classlen;
|
---|
2653 | *state->orig.out.num_values = *state->tmp.out.num_values;
|
---|
2654 | *state->orig.out.max_valnamelen = *state->tmp.out.max_valnamelen;
|
---|
2655 | *state->orig.out.max_valbufsize = *state->tmp.out.max_valbufsize;
|
---|
2656 | *state->orig.out.secdescsize = *state->tmp.out.secdescsize;
|
---|
2657 | *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
|
---|
2658 |
|
---|
2659 | /* Copy result */
|
---|
2660 | state->orig.out.result = state->tmp.out.result;
|
---|
2661 |
|
---|
2662 | /* Reset temporary structure */
|
---|
2663 | ZERO_STRUCT(state->tmp);
|
---|
2664 |
|
---|
2665 | tevent_req_done(req);
|
---|
2666 | }
|
---|
2667 |
|
---|
2668 | NTSTATUS rpccli_winreg_QueryInfoKey_recv(struct tevent_req *req,
|
---|
2669 | TALLOC_CTX *mem_ctx,
|
---|
2670 | WERROR *result)
|
---|
2671 | {
|
---|
2672 | struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
|
---|
2673 | req, struct rpccli_winreg_QueryInfoKey_state);
|
---|
2674 | NTSTATUS status;
|
---|
2675 |
|
---|
2676 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2677 | tevent_req_received(req);
|
---|
2678 | return status;
|
---|
2679 | }
|
---|
2680 |
|
---|
2681 | /* Steal possbile out parameters to the callers context */
|
---|
2682 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2683 |
|
---|
2684 | /* Return result */
|
---|
2685 | *result = state->orig.out.result;
|
---|
2686 |
|
---|
2687 | tevent_req_received(req);
|
---|
2688 | return NT_STATUS_OK;
|
---|
2689 | }
|
---|
2690 |
|
---|
2691 | NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
|
---|
2692 | TALLOC_CTX *mem_ctx,
|
---|
2693 | struct policy_handle *handle /* [in] [ref] */,
|
---|
2694 | struct winreg_String *classname /* [in,out] [ref] */,
|
---|
2695 | uint32_t *num_subkeys /* [out] [ref] */,
|
---|
2696 | uint32_t *max_subkeylen /* [out] [ref] */,
|
---|
2697 | uint32_t *max_classlen /* [out] [ref] */,
|
---|
2698 | uint32_t *num_values /* [out] [ref] */,
|
---|
2699 | uint32_t *max_valnamelen /* [out] [ref] */,
|
---|
2700 | uint32_t *max_valbufsize /* [out] [ref] */,
|
---|
2701 | uint32_t *secdescsize /* [out] [ref] */,
|
---|
2702 | NTTIME *last_changed_time /* [out] [ref] */,
|
---|
2703 | WERROR *werror)
|
---|
2704 | {
|
---|
2705 | struct winreg_QueryInfoKey r;
|
---|
2706 | NTSTATUS status;
|
---|
2707 |
|
---|
2708 | /* In parameters */
|
---|
2709 | r.in.handle = handle;
|
---|
2710 | r.in.classname = classname;
|
---|
2711 |
|
---|
2712 | status = cli->dispatch(cli,
|
---|
2713 | mem_ctx,
|
---|
2714 | &ndr_table_winreg,
|
---|
2715 | NDR_WINREG_QUERYINFOKEY,
|
---|
2716 | &r);
|
---|
2717 |
|
---|
2718 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2719 | return status;
|
---|
2720 | }
|
---|
2721 |
|
---|
2722 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2723 | return status;
|
---|
2724 | }
|
---|
2725 |
|
---|
2726 | /* Return variables */
|
---|
2727 | *classname = *r.out.classname;
|
---|
2728 | *num_subkeys = *r.out.num_subkeys;
|
---|
2729 | *max_subkeylen = *r.out.max_subkeylen;
|
---|
2730 | *max_classlen = *r.out.max_classlen;
|
---|
2731 | *num_values = *r.out.num_values;
|
---|
2732 | *max_valnamelen = *r.out.max_valnamelen;
|
---|
2733 | *max_valbufsize = *r.out.max_valbufsize;
|
---|
2734 | *secdescsize = *r.out.secdescsize;
|
---|
2735 | *last_changed_time = *r.out.last_changed_time;
|
---|
2736 |
|
---|
2737 | /* Return result */
|
---|
2738 | if (werror) {
|
---|
2739 | *werror = r.out.result;
|
---|
2740 | }
|
---|
2741 |
|
---|
2742 | return werror_to_ntstatus(r.out.result);
|
---|
2743 | }
|
---|
2744 |
|
---|
2745 | struct rpccli_winreg_QueryValue_state {
|
---|
2746 | struct winreg_QueryValue orig;
|
---|
2747 | struct winreg_QueryValue tmp;
|
---|
2748 | TALLOC_CTX *out_mem_ctx;
|
---|
2749 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2750 | };
|
---|
2751 |
|
---|
2752 | static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq);
|
---|
2753 |
|
---|
2754 | struct tevent_req *rpccli_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
|
---|
2755 | struct tevent_context *ev,
|
---|
2756 | struct rpc_pipe_client *cli,
|
---|
2757 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
2758 | struct winreg_String *_value_name /* [in] [ref] */,
|
---|
2759 | enum winreg_Type *_type /* [in,out] [unique] */,
|
---|
2760 | uint8_t *_data /* [in,out] [unique,range(0,0x4000000),length_is(data_length?*data_length:0),size_is(data_size?*data_size:0)] */,
|
---|
2761 | uint32_t *_data_size /* [in,out] [unique] */,
|
---|
2762 | uint32_t *_data_length /* [in,out] [unique] */)
|
---|
2763 | {
|
---|
2764 | struct tevent_req *req;
|
---|
2765 | struct rpccli_winreg_QueryValue_state *state;
|
---|
2766 | struct tevent_req *subreq;
|
---|
2767 |
|
---|
2768 | req = tevent_req_create(mem_ctx, &state,
|
---|
2769 | struct rpccli_winreg_QueryValue_state);
|
---|
2770 | if (req == NULL) {
|
---|
2771 | return NULL;
|
---|
2772 | }
|
---|
2773 | state->out_mem_ctx = NULL;
|
---|
2774 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2775 |
|
---|
2776 | /* In parameters */
|
---|
2777 | state->orig.in.handle = _handle;
|
---|
2778 | state->orig.in.value_name = _value_name;
|
---|
2779 | state->orig.in.type = _type;
|
---|
2780 | state->orig.in.data = _data;
|
---|
2781 | state->orig.in.data_size = _data_size;
|
---|
2782 | state->orig.in.data_length = _data_length;
|
---|
2783 |
|
---|
2784 | /* Out parameters */
|
---|
2785 | state->orig.out.type = _type;
|
---|
2786 | state->orig.out.data = _data;
|
---|
2787 | state->orig.out.data_size = _data_size;
|
---|
2788 | state->orig.out.data_length = _data_length;
|
---|
2789 |
|
---|
2790 | /* Result */
|
---|
2791 | ZERO_STRUCT(state->orig.out.result);
|
---|
2792 |
|
---|
2793 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
2794 | "rpccli_winreg_QueryValue_out_memory");
|
---|
2795 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
2796 | return tevent_req_post(req, ev);
|
---|
2797 | }
|
---|
2798 |
|
---|
2799 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2800 | state->tmp = state->orig;
|
---|
2801 |
|
---|
2802 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2803 | &ndr_table_winreg,
|
---|
2804 | NDR_WINREG_QUERYVALUE,
|
---|
2805 | &state->tmp);
|
---|
2806 | if (tevent_req_nomem(subreq, req)) {
|
---|
2807 | return tevent_req_post(req, ev);
|
---|
2808 | }
|
---|
2809 | tevent_req_set_callback(subreq, rpccli_winreg_QueryValue_done, req);
|
---|
2810 | return req;
|
---|
2811 | }
|
---|
2812 |
|
---|
2813 | static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq)
|
---|
2814 | {
|
---|
2815 | struct tevent_req *req = tevent_req_callback_data(
|
---|
2816 | subreq, struct tevent_req);
|
---|
2817 | struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
|
---|
2818 | req, struct rpccli_winreg_QueryValue_state);
|
---|
2819 | NTSTATUS status;
|
---|
2820 | TALLOC_CTX *mem_ctx;
|
---|
2821 |
|
---|
2822 | if (state->out_mem_ctx) {
|
---|
2823 | mem_ctx = state->out_mem_ctx;
|
---|
2824 | } else {
|
---|
2825 | mem_ctx = state;
|
---|
2826 | }
|
---|
2827 |
|
---|
2828 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
2829 | TALLOC_FREE(subreq);
|
---|
2830 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2831 | tevent_req_nterror(req, status);
|
---|
2832 | return;
|
---|
2833 | }
|
---|
2834 |
|
---|
2835 | /* Copy out parameters */
|
---|
2836 | if (state->orig.out.type && state->tmp.out.type) {
|
---|
2837 | *state->orig.out.type = *state->tmp.out.type;
|
---|
2838 | }
|
---|
2839 | if (state->orig.out.data && state->tmp.out.data) {
|
---|
2840 | if ((state->tmp.out.data_size?*state->tmp.out.data_size:0) > (state->tmp.in.data_size?*state->tmp.in.data_size:0)) {
|
---|
2841 | tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
|
---|
2842 | return;
|
---|
2843 | }
|
---|
2844 | if ((state->tmp.out.data_length?*state->tmp.out.data_length:0) > (state->tmp.out.data_size?*state->tmp.out.data_size:0)) {
|
---|
2845 | tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
|
---|
2846 | return;
|
---|
2847 | }
|
---|
2848 | memcpy(state->orig.out.data, state->tmp.out.data, (state->tmp.out.data_length?*state->tmp.out.data_length:0) * sizeof(*state->orig.out.data));
|
---|
2849 | }
|
---|
2850 | if (state->orig.out.data_size && state->tmp.out.data_size) {
|
---|
2851 | *state->orig.out.data_size = *state->tmp.out.data_size;
|
---|
2852 | }
|
---|
2853 | if (state->orig.out.data_length && state->tmp.out.data_length) {
|
---|
2854 | *state->orig.out.data_length = *state->tmp.out.data_length;
|
---|
2855 | }
|
---|
2856 |
|
---|
2857 | /* Copy result */
|
---|
2858 | state->orig.out.result = state->tmp.out.result;
|
---|
2859 |
|
---|
2860 | /* Reset temporary structure */
|
---|
2861 | ZERO_STRUCT(state->tmp);
|
---|
2862 |
|
---|
2863 | tevent_req_done(req);
|
---|
2864 | }
|
---|
2865 |
|
---|
2866 | NTSTATUS rpccli_winreg_QueryValue_recv(struct tevent_req *req,
|
---|
2867 | TALLOC_CTX *mem_ctx,
|
---|
2868 | WERROR *result)
|
---|
2869 | {
|
---|
2870 | struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
|
---|
2871 | req, struct rpccli_winreg_QueryValue_state);
|
---|
2872 | NTSTATUS status;
|
---|
2873 |
|
---|
2874 | if (tevent_req_is_nterror(req, &status)) {
|
---|
2875 | tevent_req_received(req);
|
---|
2876 | return status;
|
---|
2877 | }
|
---|
2878 |
|
---|
2879 | /* Steal possbile out parameters to the callers context */
|
---|
2880 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
2881 |
|
---|
2882 | /* Return result */
|
---|
2883 | *result = state->orig.out.result;
|
---|
2884 |
|
---|
2885 | tevent_req_received(req);
|
---|
2886 | return NT_STATUS_OK;
|
---|
2887 | }
|
---|
2888 |
|
---|
2889 | NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
|
---|
2890 | TALLOC_CTX *mem_ctx,
|
---|
2891 | struct policy_handle *handle /* [in] [ref] */,
|
---|
2892 | struct winreg_String *value_name /* [in] [ref] */,
|
---|
2893 | enum winreg_Type *type /* [in,out] [unique] */,
|
---|
2894 | uint8_t *data /* [in,out] [unique,range(0,0x4000000),length_is(data_length?*data_length:0),size_is(data_size?*data_size:0)] */,
|
---|
2895 | uint32_t *data_size /* [in,out] [unique] */,
|
---|
2896 | uint32_t *data_length /* [in,out] [unique] */,
|
---|
2897 | WERROR *werror)
|
---|
2898 | {
|
---|
2899 | struct winreg_QueryValue r;
|
---|
2900 | NTSTATUS status;
|
---|
2901 |
|
---|
2902 | /* In parameters */
|
---|
2903 | r.in.handle = handle;
|
---|
2904 | r.in.value_name = value_name;
|
---|
2905 | r.in.type = type;
|
---|
2906 | r.in.data = data;
|
---|
2907 | r.in.data_size = data_size;
|
---|
2908 | r.in.data_length = data_length;
|
---|
2909 |
|
---|
2910 | status = cli->dispatch(cli,
|
---|
2911 | mem_ctx,
|
---|
2912 | &ndr_table_winreg,
|
---|
2913 | NDR_WINREG_QUERYVALUE,
|
---|
2914 | &r);
|
---|
2915 |
|
---|
2916 | if (!NT_STATUS_IS_OK(status)) {
|
---|
2917 | return status;
|
---|
2918 | }
|
---|
2919 |
|
---|
2920 | if (NT_STATUS_IS_ERR(status)) {
|
---|
2921 | return status;
|
---|
2922 | }
|
---|
2923 |
|
---|
2924 | /* Return variables */
|
---|
2925 | if (type && r.out.type) {
|
---|
2926 | *type = *r.out.type;
|
---|
2927 | }
|
---|
2928 | if (data && r.out.data) {
|
---|
2929 | if ((r.out.data_size?*r.out.data_size:0) > (r.in.data_size?*r.in.data_size:0)) {
|
---|
2930 | return NT_STATUS_INVALID_NETWORK_RESPONSE;
|
---|
2931 | }
|
---|
2932 | if ((r.out.data_length?*r.out.data_length:0) > (r.out.data_size?*r.out.data_size:0)) {
|
---|
2933 | return NT_STATUS_INVALID_NETWORK_RESPONSE;
|
---|
2934 | }
|
---|
2935 | memcpy(data, r.out.data, (r.out.data_length?*r.out.data_length:0) * sizeof(*data));
|
---|
2936 | }
|
---|
2937 | if (data_size && r.out.data_size) {
|
---|
2938 | *data_size = *r.out.data_size;
|
---|
2939 | }
|
---|
2940 | if (data_length && r.out.data_length) {
|
---|
2941 | *data_length = *r.out.data_length;
|
---|
2942 | }
|
---|
2943 |
|
---|
2944 | /* Return result */
|
---|
2945 | if (werror) {
|
---|
2946 | *werror = r.out.result;
|
---|
2947 | }
|
---|
2948 |
|
---|
2949 | return werror_to_ntstatus(r.out.result);
|
---|
2950 | }
|
---|
2951 |
|
---|
2952 | struct rpccli_winreg_ReplaceKey_state {
|
---|
2953 | struct winreg_ReplaceKey orig;
|
---|
2954 | struct winreg_ReplaceKey tmp;
|
---|
2955 | TALLOC_CTX *out_mem_ctx;
|
---|
2956 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
2957 | };
|
---|
2958 |
|
---|
2959 | static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq);
|
---|
2960 |
|
---|
2961 | struct tevent_req *rpccli_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
|
---|
2962 | struct tevent_context *ev,
|
---|
2963 | struct rpc_pipe_client *cli)
|
---|
2964 | {
|
---|
2965 | struct tevent_req *req;
|
---|
2966 | struct rpccli_winreg_ReplaceKey_state *state;
|
---|
2967 | struct tevent_req *subreq;
|
---|
2968 |
|
---|
2969 | req = tevent_req_create(mem_ctx, &state,
|
---|
2970 | struct rpccli_winreg_ReplaceKey_state);
|
---|
2971 | if (req == NULL) {
|
---|
2972 | return NULL;
|
---|
2973 | }
|
---|
2974 | state->out_mem_ctx = NULL;
|
---|
2975 | state->dispatch_recv = cli->dispatch_recv;
|
---|
2976 |
|
---|
2977 | /* In parameters */
|
---|
2978 |
|
---|
2979 | /* Out parameters */
|
---|
2980 |
|
---|
2981 | /* Result */
|
---|
2982 | ZERO_STRUCT(state->orig.out.result);
|
---|
2983 |
|
---|
2984 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
2985 | state->tmp = state->orig;
|
---|
2986 |
|
---|
2987 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
2988 | &ndr_table_winreg,
|
---|
2989 | NDR_WINREG_REPLACEKEY,
|
---|
2990 | &state->tmp);
|
---|
2991 | if (tevent_req_nomem(subreq, req)) {
|
---|
2992 | return tevent_req_post(req, ev);
|
---|
2993 | }
|
---|
2994 | tevent_req_set_callback(subreq, rpccli_winreg_ReplaceKey_done, req);
|
---|
2995 | return req;
|
---|
2996 | }
|
---|
2997 |
|
---|
2998 | static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq)
|
---|
2999 | {
|
---|
3000 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3001 | subreq, struct tevent_req);
|
---|
3002 | struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
|
---|
3003 | req, struct rpccli_winreg_ReplaceKey_state);
|
---|
3004 | NTSTATUS status;
|
---|
3005 | TALLOC_CTX *mem_ctx;
|
---|
3006 |
|
---|
3007 | if (state->out_mem_ctx) {
|
---|
3008 | mem_ctx = state->out_mem_ctx;
|
---|
3009 | } else {
|
---|
3010 | mem_ctx = state;
|
---|
3011 | }
|
---|
3012 |
|
---|
3013 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3014 | TALLOC_FREE(subreq);
|
---|
3015 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3016 | tevent_req_nterror(req, status);
|
---|
3017 | return;
|
---|
3018 | }
|
---|
3019 |
|
---|
3020 | /* Copy out parameters */
|
---|
3021 |
|
---|
3022 | /* Copy result */
|
---|
3023 | state->orig.out.result = state->tmp.out.result;
|
---|
3024 |
|
---|
3025 | /* Reset temporary structure */
|
---|
3026 | ZERO_STRUCT(state->tmp);
|
---|
3027 |
|
---|
3028 | tevent_req_done(req);
|
---|
3029 | }
|
---|
3030 |
|
---|
3031 | NTSTATUS rpccli_winreg_ReplaceKey_recv(struct tevent_req *req,
|
---|
3032 | TALLOC_CTX *mem_ctx,
|
---|
3033 | WERROR *result)
|
---|
3034 | {
|
---|
3035 | struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
|
---|
3036 | req, struct rpccli_winreg_ReplaceKey_state);
|
---|
3037 | NTSTATUS status;
|
---|
3038 |
|
---|
3039 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3040 | tevent_req_received(req);
|
---|
3041 | return status;
|
---|
3042 | }
|
---|
3043 |
|
---|
3044 | /* Steal possbile out parameters to the callers context */
|
---|
3045 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3046 |
|
---|
3047 | /* Return result */
|
---|
3048 | *result = state->orig.out.result;
|
---|
3049 |
|
---|
3050 | tevent_req_received(req);
|
---|
3051 | return NT_STATUS_OK;
|
---|
3052 | }
|
---|
3053 |
|
---|
3054 | NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
|
---|
3055 | TALLOC_CTX *mem_ctx,
|
---|
3056 | WERROR *werror)
|
---|
3057 | {
|
---|
3058 | struct winreg_ReplaceKey r;
|
---|
3059 | NTSTATUS status;
|
---|
3060 |
|
---|
3061 | /* In parameters */
|
---|
3062 |
|
---|
3063 | status = cli->dispatch(cli,
|
---|
3064 | mem_ctx,
|
---|
3065 | &ndr_table_winreg,
|
---|
3066 | NDR_WINREG_REPLACEKEY,
|
---|
3067 | &r);
|
---|
3068 |
|
---|
3069 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3070 | return status;
|
---|
3071 | }
|
---|
3072 |
|
---|
3073 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3074 | return status;
|
---|
3075 | }
|
---|
3076 |
|
---|
3077 | /* Return variables */
|
---|
3078 |
|
---|
3079 | /* Return result */
|
---|
3080 | if (werror) {
|
---|
3081 | *werror = r.out.result;
|
---|
3082 | }
|
---|
3083 |
|
---|
3084 | return werror_to_ntstatus(r.out.result);
|
---|
3085 | }
|
---|
3086 |
|
---|
3087 | struct rpccli_winreg_RestoreKey_state {
|
---|
3088 | struct winreg_RestoreKey orig;
|
---|
3089 | struct winreg_RestoreKey tmp;
|
---|
3090 | TALLOC_CTX *out_mem_ctx;
|
---|
3091 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3092 | };
|
---|
3093 |
|
---|
3094 | static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq);
|
---|
3095 |
|
---|
3096 | struct tevent_req *rpccli_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
|
---|
3097 | struct tevent_context *ev,
|
---|
3098 | struct rpc_pipe_client *cli,
|
---|
3099 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
3100 | struct winreg_String *_filename /* [in] [ref] */,
|
---|
3101 | uint32_t _flags /* [in] */)
|
---|
3102 | {
|
---|
3103 | struct tevent_req *req;
|
---|
3104 | struct rpccli_winreg_RestoreKey_state *state;
|
---|
3105 | struct tevent_req *subreq;
|
---|
3106 |
|
---|
3107 | req = tevent_req_create(mem_ctx, &state,
|
---|
3108 | struct rpccli_winreg_RestoreKey_state);
|
---|
3109 | if (req == NULL) {
|
---|
3110 | return NULL;
|
---|
3111 | }
|
---|
3112 | state->out_mem_ctx = NULL;
|
---|
3113 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3114 |
|
---|
3115 | /* In parameters */
|
---|
3116 | state->orig.in.handle = _handle;
|
---|
3117 | state->orig.in.filename = _filename;
|
---|
3118 | state->orig.in.flags = _flags;
|
---|
3119 |
|
---|
3120 | /* Out parameters */
|
---|
3121 |
|
---|
3122 | /* Result */
|
---|
3123 | ZERO_STRUCT(state->orig.out.result);
|
---|
3124 |
|
---|
3125 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3126 | state->tmp = state->orig;
|
---|
3127 |
|
---|
3128 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3129 | &ndr_table_winreg,
|
---|
3130 | NDR_WINREG_RESTOREKEY,
|
---|
3131 | &state->tmp);
|
---|
3132 | if (tevent_req_nomem(subreq, req)) {
|
---|
3133 | return tevent_req_post(req, ev);
|
---|
3134 | }
|
---|
3135 | tevent_req_set_callback(subreq, rpccli_winreg_RestoreKey_done, req);
|
---|
3136 | return req;
|
---|
3137 | }
|
---|
3138 |
|
---|
3139 | static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq)
|
---|
3140 | {
|
---|
3141 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3142 | subreq, struct tevent_req);
|
---|
3143 | struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
|
---|
3144 | req, struct rpccli_winreg_RestoreKey_state);
|
---|
3145 | NTSTATUS status;
|
---|
3146 | TALLOC_CTX *mem_ctx;
|
---|
3147 |
|
---|
3148 | if (state->out_mem_ctx) {
|
---|
3149 | mem_ctx = state->out_mem_ctx;
|
---|
3150 | } else {
|
---|
3151 | mem_ctx = state;
|
---|
3152 | }
|
---|
3153 |
|
---|
3154 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3155 | TALLOC_FREE(subreq);
|
---|
3156 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3157 | tevent_req_nterror(req, status);
|
---|
3158 | return;
|
---|
3159 | }
|
---|
3160 |
|
---|
3161 | /* Copy out parameters */
|
---|
3162 |
|
---|
3163 | /* Copy result */
|
---|
3164 | state->orig.out.result = state->tmp.out.result;
|
---|
3165 |
|
---|
3166 | /* Reset temporary structure */
|
---|
3167 | ZERO_STRUCT(state->tmp);
|
---|
3168 |
|
---|
3169 | tevent_req_done(req);
|
---|
3170 | }
|
---|
3171 |
|
---|
3172 | NTSTATUS rpccli_winreg_RestoreKey_recv(struct tevent_req *req,
|
---|
3173 | TALLOC_CTX *mem_ctx,
|
---|
3174 | WERROR *result)
|
---|
3175 | {
|
---|
3176 | struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
|
---|
3177 | req, struct rpccli_winreg_RestoreKey_state);
|
---|
3178 | NTSTATUS status;
|
---|
3179 |
|
---|
3180 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3181 | tevent_req_received(req);
|
---|
3182 | return status;
|
---|
3183 | }
|
---|
3184 |
|
---|
3185 | /* Steal possbile out parameters to the callers context */
|
---|
3186 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3187 |
|
---|
3188 | /* Return result */
|
---|
3189 | *result = state->orig.out.result;
|
---|
3190 |
|
---|
3191 | tevent_req_received(req);
|
---|
3192 | return NT_STATUS_OK;
|
---|
3193 | }
|
---|
3194 |
|
---|
3195 | NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli,
|
---|
3196 | TALLOC_CTX *mem_ctx,
|
---|
3197 | struct policy_handle *handle /* [in] [ref] */,
|
---|
3198 | struct winreg_String *filename /* [in] [ref] */,
|
---|
3199 | uint32_t flags /* [in] */,
|
---|
3200 | WERROR *werror)
|
---|
3201 | {
|
---|
3202 | struct winreg_RestoreKey r;
|
---|
3203 | NTSTATUS status;
|
---|
3204 |
|
---|
3205 | /* In parameters */
|
---|
3206 | r.in.handle = handle;
|
---|
3207 | r.in.filename = filename;
|
---|
3208 | r.in.flags = flags;
|
---|
3209 |
|
---|
3210 | status = cli->dispatch(cli,
|
---|
3211 | mem_ctx,
|
---|
3212 | &ndr_table_winreg,
|
---|
3213 | NDR_WINREG_RESTOREKEY,
|
---|
3214 | &r);
|
---|
3215 |
|
---|
3216 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3217 | return status;
|
---|
3218 | }
|
---|
3219 |
|
---|
3220 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3221 | return status;
|
---|
3222 | }
|
---|
3223 |
|
---|
3224 | /* Return variables */
|
---|
3225 |
|
---|
3226 | /* Return result */
|
---|
3227 | if (werror) {
|
---|
3228 | *werror = r.out.result;
|
---|
3229 | }
|
---|
3230 |
|
---|
3231 | return werror_to_ntstatus(r.out.result);
|
---|
3232 | }
|
---|
3233 |
|
---|
3234 | struct rpccli_winreg_SaveKey_state {
|
---|
3235 | struct winreg_SaveKey orig;
|
---|
3236 | struct winreg_SaveKey tmp;
|
---|
3237 | TALLOC_CTX *out_mem_ctx;
|
---|
3238 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3239 | };
|
---|
3240 |
|
---|
3241 | static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq);
|
---|
3242 |
|
---|
3243 | struct tevent_req *rpccli_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
|
---|
3244 | struct tevent_context *ev,
|
---|
3245 | struct rpc_pipe_client *cli,
|
---|
3246 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
3247 | struct winreg_String *_filename /* [in] [ref] */,
|
---|
3248 | struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */)
|
---|
3249 | {
|
---|
3250 | struct tevent_req *req;
|
---|
3251 | struct rpccli_winreg_SaveKey_state *state;
|
---|
3252 | struct tevent_req *subreq;
|
---|
3253 |
|
---|
3254 | req = tevent_req_create(mem_ctx, &state,
|
---|
3255 | struct rpccli_winreg_SaveKey_state);
|
---|
3256 | if (req == NULL) {
|
---|
3257 | return NULL;
|
---|
3258 | }
|
---|
3259 | state->out_mem_ctx = NULL;
|
---|
3260 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3261 |
|
---|
3262 | /* In parameters */
|
---|
3263 | state->orig.in.handle = _handle;
|
---|
3264 | state->orig.in.filename = _filename;
|
---|
3265 | state->orig.in.sec_attrib = _sec_attrib;
|
---|
3266 |
|
---|
3267 | /* Out parameters */
|
---|
3268 |
|
---|
3269 | /* Result */
|
---|
3270 | ZERO_STRUCT(state->orig.out.result);
|
---|
3271 |
|
---|
3272 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3273 | state->tmp = state->orig;
|
---|
3274 |
|
---|
3275 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3276 | &ndr_table_winreg,
|
---|
3277 | NDR_WINREG_SAVEKEY,
|
---|
3278 | &state->tmp);
|
---|
3279 | if (tevent_req_nomem(subreq, req)) {
|
---|
3280 | return tevent_req_post(req, ev);
|
---|
3281 | }
|
---|
3282 | tevent_req_set_callback(subreq, rpccli_winreg_SaveKey_done, req);
|
---|
3283 | return req;
|
---|
3284 | }
|
---|
3285 |
|
---|
3286 | static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq)
|
---|
3287 | {
|
---|
3288 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3289 | subreq, struct tevent_req);
|
---|
3290 | struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
|
---|
3291 | req, struct rpccli_winreg_SaveKey_state);
|
---|
3292 | NTSTATUS status;
|
---|
3293 | TALLOC_CTX *mem_ctx;
|
---|
3294 |
|
---|
3295 | if (state->out_mem_ctx) {
|
---|
3296 | mem_ctx = state->out_mem_ctx;
|
---|
3297 | } else {
|
---|
3298 | mem_ctx = state;
|
---|
3299 | }
|
---|
3300 |
|
---|
3301 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3302 | TALLOC_FREE(subreq);
|
---|
3303 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3304 | tevent_req_nterror(req, status);
|
---|
3305 | return;
|
---|
3306 | }
|
---|
3307 |
|
---|
3308 | /* Copy out parameters */
|
---|
3309 |
|
---|
3310 | /* Copy result */
|
---|
3311 | state->orig.out.result = state->tmp.out.result;
|
---|
3312 |
|
---|
3313 | /* Reset temporary structure */
|
---|
3314 | ZERO_STRUCT(state->tmp);
|
---|
3315 |
|
---|
3316 | tevent_req_done(req);
|
---|
3317 | }
|
---|
3318 |
|
---|
3319 | NTSTATUS rpccli_winreg_SaveKey_recv(struct tevent_req *req,
|
---|
3320 | TALLOC_CTX *mem_ctx,
|
---|
3321 | WERROR *result)
|
---|
3322 | {
|
---|
3323 | struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
|
---|
3324 | req, struct rpccli_winreg_SaveKey_state);
|
---|
3325 | NTSTATUS status;
|
---|
3326 |
|
---|
3327 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3328 | tevent_req_received(req);
|
---|
3329 | return status;
|
---|
3330 | }
|
---|
3331 |
|
---|
3332 | /* Steal possbile out parameters to the callers context */
|
---|
3333 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3334 |
|
---|
3335 | /* Return result */
|
---|
3336 | *result = state->orig.out.result;
|
---|
3337 |
|
---|
3338 | tevent_req_received(req);
|
---|
3339 | return NT_STATUS_OK;
|
---|
3340 | }
|
---|
3341 |
|
---|
3342 | NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
|
---|
3343 | TALLOC_CTX *mem_ctx,
|
---|
3344 | struct policy_handle *handle /* [in] [ref] */,
|
---|
3345 | struct winreg_String *filename /* [in] [ref] */,
|
---|
3346 | struct KeySecurityAttribute *sec_attrib /* [in] [unique] */,
|
---|
3347 | WERROR *werror)
|
---|
3348 | {
|
---|
3349 | struct winreg_SaveKey r;
|
---|
3350 | NTSTATUS status;
|
---|
3351 |
|
---|
3352 | /* In parameters */
|
---|
3353 | r.in.handle = handle;
|
---|
3354 | r.in.filename = filename;
|
---|
3355 | r.in.sec_attrib = sec_attrib;
|
---|
3356 |
|
---|
3357 | status = cli->dispatch(cli,
|
---|
3358 | mem_ctx,
|
---|
3359 | &ndr_table_winreg,
|
---|
3360 | NDR_WINREG_SAVEKEY,
|
---|
3361 | &r);
|
---|
3362 |
|
---|
3363 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3364 | return status;
|
---|
3365 | }
|
---|
3366 |
|
---|
3367 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3368 | return status;
|
---|
3369 | }
|
---|
3370 |
|
---|
3371 | /* Return variables */
|
---|
3372 |
|
---|
3373 | /* Return result */
|
---|
3374 | if (werror) {
|
---|
3375 | *werror = r.out.result;
|
---|
3376 | }
|
---|
3377 |
|
---|
3378 | return werror_to_ntstatus(r.out.result);
|
---|
3379 | }
|
---|
3380 |
|
---|
3381 | struct rpccli_winreg_SetKeySecurity_state {
|
---|
3382 | struct winreg_SetKeySecurity orig;
|
---|
3383 | struct winreg_SetKeySecurity tmp;
|
---|
3384 | TALLOC_CTX *out_mem_ctx;
|
---|
3385 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3386 | };
|
---|
3387 |
|
---|
3388 | static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq);
|
---|
3389 |
|
---|
3390 | struct tevent_req *rpccli_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
|
---|
3391 | struct tevent_context *ev,
|
---|
3392 | struct rpc_pipe_client *cli,
|
---|
3393 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
3394 | uint32_t _sec_info /* [in] */,
|
---|
3395 | struct KeySecurityData *_sd /* [in] [ref] */)
|
---|
3396 | {
|
---|
3397 | struct tevent_req *req;
|
---|
3398 | struct rpccli_winreg_SetKeySecurity_state *state;
|
---|
3399 | struct tevent_req *subreq;
|
---|
3400 |
|
---|
3401 | req = tevent_req_create(mem_ctx, &state,
|
---|
3402 | struct rpccli_winreg_SetKeySecurity_state);
|
---|
3403 | if (req == NULL) {
|
---|
3404 | return NULL;
|
---|
3405 | }
|
---|
3406 | state->out_mem_ctx = NULL;
|
---|
3407 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3408 |
|
---|
3409 | /* In parameters */
|
---|
3410 | state->orig.in.handle = _handle;
|
---|
3411 | state->orig.in.sec_info = _sec_info;
|
---|
3412 | state->orig.in.sd = _sd;
|
---|
3413 |
|
---|
3414 | /* Out parameters */
|
---|
3415 |
|
---|
3416 | /* Result */
|
---|
3417 | ZERO_STRUCT(state->orig.out.result);
|
---|
3418 |
|
---|
3419 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3420 | state->tmp = state->orig;
|
---|
3421 |
|
---|
3422 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3423 | &ndr_table_winreg,
|
---|
3424 | NDR_WINREG_SETKEYSECURITY,
|
---|
3425 | &state->tmp);
|
---|
3426 | if (tevent_req_nomem(subreq, req)) {
|
---|
3427 | return tevent_req_post(req, ev);
|
---|
3428 | }
|
---|
3429 | tevent_req_set_callback(subreq, rpccli_winreg_SetKeySecurity_done, req);
|
---|
3430 | return req;
|
---|
3431 | }
|
---|
3432 |
|
---|
3433 | static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq)
|
---|
3434 | {
|
---|
3435 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3436 | subreq, struct tevent_req);
|
---|
3437 | struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
|
---|
3438 | req, struct rpccli_winreg_SetKeySecurity_state);
|
---|
3439 | NTSTATUS status;
|
---|
3440 | TALLOC_CTX *mem_ctx;
|
---|
3441 |
|
---|
3442 | if (state->out_mem_ctx) {
|
---|
3443 | mem_ctx = state->out_mem_ctx;
|
---|
3444 | } else {
|
---|
3445 | mem_ctx = state;
|
---|
3446 | }
|
---|
3447 |
|
---|
3448 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3449 | TALLOC_FREE(subreq);
|
---|
3450 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3451 | tevent_req_nterror(req, status);
|
---|
3452 | return;
|
---|
3453 | }
|
---|
3454 |
|
---|
3455 | /* Copy out parameters */
|
---|
3456 |
|
---|
3457 | /* Copy result */
|
---|
3458 | state->orig.out.result = state->tmp.out.result;
|
---|
3459 |
|
---|
3460 | /* Reset temporary structure */
|
---|
3461 | ZERO_STRUCT(state->tmp);
|
---|
3462 |
|
---|
3463 | tevent_req_done(req);
|
---|
3464 | }
|
---|
3465 |
|
---|
3466 | NTSTATUS rpccli_winreg_SetKeySecurity_recv(struct tevent_req *req,
|
---|
3467 | TALLOC_CTX *mem_ctx,
|
---|
3468 | WERROR *result)
|
---|
3469 | {
|
---|
3470 | struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
|
---|
3471 | req, struct rpccli_winreg_SetKeySecurity_state);
|
---|
3472 | NTSTATUS status;
|
---|
3473 |
|
---|
3474 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3475 | tevent_req_received(req);
|
---|
3476 | return status;
|
---|
3477 | }
|
---|
3478 |
|
---|
3479 | /* Steal possbile out parameters to the callers context */
|
---|
3480 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3481 |
|
---|
3482 | /* Return result */
|
---|
3483 | *result = state->orig.out.result;
|
---|
3484 |
|
---|
3485 | tevent_req_received(req);
|
---|
3486 | return NT_STATUS_OK;
|
---|
3487 | }
|
---|
3488 |
|
---|
3489 | NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
|
---|
3490 | TALLOC_CTX *mem_ctx,
|
---|
3491 | struct policy_handle *handle /* [in] [ref] */,
|
---|
3492 | uint32_t sec_info /* [in] */,
|
---|
3493 | struct KeySecurityData *sd /* [in] [ref] */,
|
---|
3494 | WERROR *werror)
|
---|
3495 | {
|
---|
3496 | struct winreg_SetKeySecurity r;
|
---|
3497 | NTSTATUS status;
|
---|
3498 |
|
---|
3499 | /* In parameters */
|
---|
3500 | r.in.handle = handle;
|
---|
3501 | r.in.sec_info = sec_info;
|
---|
3502 | r.in.sd = sd;
|
---|
3503 |
|
---|
3504 | status = cli->dispatch(cli,
|
---|
3505 | mem_ctx,
|
---|
3506 | &ndr_table_winreg,
|
---|
3507 | NDR_WINREG_SETKEYSECURITY,
|
---|
3508 | &r);
|
---|
3509 |
|
---|
3510 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3511 | return status;
|
---|
3512 | }
|
---|
3513 |
|
---|
3514 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3515 | return status;
|
---|
3516 | }
|
---|
3517 |
|
---|
3518 | /* Return variables */
|
---|
3519 |
|
---|
3520 | /* Return result */
|
---|
3521 | if (werror) {
|
---|
3522 | *werror = r.out.result;
|
---|
3523 | }
|
---|
3524 |
|
---|
3525 | return werror_to_ntstatus(r.out.result);
|
---|
3526 | }
|
---|
3527 |
|
---|
3528 | struct rpccli_winreg_SetValue_state {
|
---|
3529 | struct winreg_SetValue orig;
|
---|
3530 | struct winreg_SetValue tmp;
|
---|
3531 | TALLOC_CTX *out_mem_ctx;
|
---|
3532 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3533 | };
|
---|
3534 |
|
---|
3535 | static void rpccli_winreg_SetValue_done(struct tevent_req *subreq);
|
---|
3536 |
|
---|
3537 | struct tevent_req *rpccli_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
|
---|
3538 | struct tevent_context *ev,
|
---|
3539 | struct rpc_pipe_client *cli,
|
---|
3540 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
3541 | struct winreg_String _name /* [in] */,
|
---|
3542 | enum winreg_Type _type /* [in] */,
|
---|
3543 | uint8_t *_data /* [in] [ref,size_is(size)] */,
|
---|
3544 | uint32_t _size /* [in] */)
|
---|
3545 | {
|
---|
3546 | struct tevent_req *req;
|
---|
3547 | struct rpccli_winreg_SetValue_state *state;
|
---|
3548 | struct tevent_req *subreq;
|
---|
3549 |
|
---|
3550 | req = tevent_req_create(mem_ctx, &state,
|
---|
3551 | struct rpccli_winreg_SetValue_state);
|
---|
3552 | if (req == NULL) {
|
---|
3553 | return NULL;
|
---|
3554 | }
|
---|
3555 | state->out_mem_ctx = NULL;
|
---|
3556 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3557 |
|
---|
3558 | /* In parameters */
|
---|
3559 | state->orig.in.handle = _handle;
|
---|
3560 | state->orig.in.name = _name;
|
---|
3561 | state->orig.in.type = _type;
|
---|
3562 | state->orig.in.data = _data;
|
---|
3563 | state->orig.in.size = _size;
|
---|
3564 |
|
---|
3565 | /* Out parameters */
|
---|
3566 |
|
---|
3567 | /* Result */
|
---|
3568 | ZERO_STRUCT(state->orig.out.result);
|
---|
3569 |
|
---|
3570 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3571 | state->tmp = state->orig;
|
---|
3572 |
|
---|
3573 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3574 | &ndr_table_winreg,
|
---|
3575 | NDR_WINREG_SETVALUE,
|
---|
3576 | &state->tmp);
|
---|
3577 | if (tevent_req_nomem(subreq, req)) {
|
---|
3578 | return tevent_req_post(req, ev);
|
---|
3579 | }
|
---|
3580 | tevent_req_set_callback(subreq, rpccli_winreg_SetValue_done, req);
|
---|
3581 | return req;
|
---|
3582 | }
|
---|
3583 |
|
---|
3584 | static void rpccli_winreg_SetValue_done(struct tevent_req *subreq)
|
---|
3585 | {
|
---|
3586 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3587 | subreq, struct tevent_req);
|
---|
3588 | struct rpccli_winreg_SetValue_state *state = tevent_req_data(
|
---|
3589 | req, struct rpccli_winreg_SetValue_state);
|
---|
3590 | NTSTATUS status;
|
---|
3591 | TALLOC_CTX *mem_ctx;
|
---|
3592 |
|
---|
3593 | if (state->out_mem_ctx) {
|
---|
3594 | mem_ctx = state->out_mem_ctx;
|
---|
3595 | } else {
|
---|
3596 | mem_ctx = state;
|
---|
3597 | }
|
---|
3598 |
|
---|
3599 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3600 | TALLOC_FREE(subreq);
|
---|
3601 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3602 | tevent_req_nterror(req, status);
|
---|
3603 | return;
|
---|
3604 | }
|
---|
3605 |
|
---|
3606 | /* Copy out parameters */
|
---|
3607 |
|
---|
3608 | /* Copy result */
|
---|
3609 | state->orig.out.result = state->tmp.out.result;
|
---|
3610 |
|
---|
3611 | /* Reset temporary structure */
|
---|
3612 | ZERO_STRUCT(state->tmp);
|
---|
3613 |
|
---|
3614 | tevent_req_done(req);
|
---|
3615 | }
|
---|
3616 |
|
---|
3617 | NTSTATUS rpccli_winreg_SetValue_recv(struct tevent_req *req,
|
---|
3618 | TALLOC_CTX *mem_ctx,
|
---|
3619 | WERROR *result)
|
---|
3620 | {
|
---|
3621 | struct rpccli_winreg_SetValue_state *state = tevent_req_data(
|
---|
3622 | req, struct rpccli_winreg_SetValue_state);
|
---|
3623 | NTSTATUS status;
|
---|
3624 |
|
---|
3625 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3626 | tevent_req_received(req);
|
---|
3627 | return status;
|
---|
3628 | }
|
---|
3629 |
|
---|
3630 | /* Steal possbile out parameters to the callers context */
|
---|
3631 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3632 |
|
---|
3633 | /* Return result */
|
---|
3634 | *result = state->orig.out.result;
|
---|
3635 |
|
---|
3636 | tevent_req_received(req);
|
---|
3637 | return NT_STATUS_OK;
|
---|
3638 | }
|
---|
3639 |
|
---|
3640 | NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
|
---|
3641 | TALLOC_CTX *mem_ctx,
|
---|
3642 | struct policy_handle *handle /* [in] [ref] */,
|
---|
3643 | struct winreg_String name /* [in] */,
|
---|
3644 | enum winreg_Type type /* [in] */,
|
---|
3645 | uint8_t *data /* [in] [ref,size_is(size)] */,
|
---|
3646 | uint32_t size /* [in] */,
|
---|
3647 | WERROR *werror)
|
---|
3648 | {
|
---|
3649 | struct winreg_SetValue r;
|
---|
3650 | NTSTATUS status;
|
---|
3651 |
|
---|
3652 | /* In parameters */
|
---|
3653 | r.in.handle = handle;
|
---|
3654 | r.in.name = name;
|
---|
3655 | r.in.type = type;
|
---|
3656 | r.in.data = data;
|
---|
3657 | r.in.size = size;
|
---|
3658 |
|
---|
3659 | status = cli->dispatch(cli,
|
---|
3660 | mem_ctx,
|
---|
3661 | &ndr_table_winreg,
|
---|
3662 | NDR_WINREG_SETVALUE,
|
---|
3663 | &r);
|
---|
3664 |
|
---|
3665 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3666 | return status;
|
---|
3667 | }
|
---|
3668 |
|
---|
3669 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3670 | return status;
|
---|
3671 | }
|
---|
3672 |
|
---|
3673 | /* Return variables */
|
---|
3674 |
|
---|
3675 | /* Return result */
|
---|
3676 | if (werror) {
|
---|
3677 | *werror = r.out.result;
|
---|
3678 | }
|
---|
3679 |
|
---|
3680 | return werror_to_ntstatus(r.out.result);
|
---|
3681 | }
|
---|
3682 |
|
---|
3683 | struct rpccli_winreg_UnLoadKey_state {
|
---|
3684 | struct winreg_UnLoadKey orig;
|
---|
3685 | struct winreg_UnLoadKey tmp;
|
---|
3686 | TALLOC_CTX *out_mem_ctx;
|
---|
3687 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3688 | };
|
---|
3689 |
|
---|
3690 | static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq);
|
---|
3691 |
|
---|
3692 | struct tevent_req *rpccli_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
|
---|
3693 | struct tevent_context *ev,
|
---|
3694 | struct rpc_pipe_client *cli)
|
---|
3695 | {
|
---|
3696 | struct tevent_req *req;
|
---|
3697 | struct rpccli_winreg_UnLoadKey_state *state;
|
---|
3698 | struct tevent_req *subreq;
|
---|
3699 |
|
---|
3700 | req = tevent_req_create(mem_ctx, &state,
|
---|
3701 | struct rpccli_winreg_UnLoadKey_state);
|
---|
3702 | if (req == NULL) {
|
---|
3703 | return NULL;
|
---|
3704 | }
|
---|
3705 | state->out_mem_ctx = NULL;
|
---|
3706 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3707 |
|
---|
3708 | /* In parameters */
|
---|
3709 |
|
---|
3710 | /* Out parameters */
|
---|
3711 |
|
---|
3712 | /* Result */
|
---|
3713 | ZERO_STRUCT(state->orig.out.result);
|
---|
3714 |
|
---|
3715 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3716 | state->tmp = state->orig;
|
---|
3717 |
|
---|
3718 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3719 | &ndr_table_winreg,
|
---|
3720 | NDR_WINREG_UNLOADKEY,
|
---|
3721 | &state->tmp);
|
---|
3722 | if (tevent_req_nomem(subreq, req)) {
|
---|
3723 | return tevent_req_post(req, ev);
|
---|
3724 | }
|
---|
3725 | tevent_req_set_callback(subreq, rpccli_winreg_UnLoadKey_done, req);
|
---|
3726 | return req;
|
---|
3727 | }
|
---|
3728 |
|
---|
3729 | static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq)
|
---|
3730 | {
|
---|
3731 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3732 | subreq, struct tevent_req);
|
---|
3733 | struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
|
---|
3734 | req, struct rpccli_winreg_UnLoadKey_state);
|
---|
3735 | NTSTATUS status;
|
---|
3736 | TALLOC_CTX *mem_ctx;
|
---|
3737 |
|
---|
3738 | if (state->out_mem_ctx) {
|
---|
3739 | mem_ctx = state->out_mem_ctx;
|
---|
3740 | } else {
|
---|
3741 | mem_ctx = state;
|
---|
3742 | }
|
---|
3743 |
|
---|
3744 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3745 | TALLOC_FREE(subreq);
|
---|
3746 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3747 | tevent_req_nterror(req, status);
|
---|
3748 | return;
|
---|
3749 | }
|
---|
3750 |
|
---|
3751 | /* Copy out parameters */
|
---|
3752 |
|
---|
3753 | /* Copy result */
|
---|
3754 | state->orig.out.result = state->tmp.out.result;
|
---|
3755 |
|
---|
3756 | /* Reset temporary structure */
|
---|
3757 | ZERO_STRUCT(state->tmp);
|
---|
3758 |
|
---|
3759 | tevent_req_done(req);
|
---|
3760 | }
|
---|
3761 |
|
---|
3762 | NTSTATUS rpccli_winreg_UnLoadKey_recv(struct tevent_req *req,
|
---|
3763 | TALLOC_CTX *mem_ctx,
|
---|
3764 | WERROR *result)
|
---|
3765 | {
|
---|
3766 | struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
|
---|
3767 | req, struct rpccli_winreg_UnLoadKey_state);
|
---|
3768 | NTSTATUS status;
|
---|
3769 |
|
---|
3770 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3771 | tevent_req_received(req);
|
---|
3772 | return status;
|
---|
3773 | }
|
---|
3774 |
|
---|
3775 | /* Steal possbile out parameters to the callers context */
|
---|
3776 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3777 |
|
---|
3778 | /* Return result */
|
---|
3779 | *result = state->orig.out.result;
|
---|
3780 |
|
---|
3781 | tevent_req_received(req);
|
---|
3782 | return NT_STATUS_OK;
|
---|
3783 | }
|
---|
3784 |
|
---|
3785 | NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
|
---|
3786 | TALLOC_CTX *mem_ctx,
|
---|
3787 | WERROR *werror)
|
---|
3788 | {
|
---|
3789 | struct winreg_UnLoadKey r;
|
---|
3790 | NTSTATUS status;
|
---|
3791 |
|
---|
3792 | /* In parameters */
|
---|
3793 |
|
---|
3794 | status = cli->dispatch(cli,
|
---|
3795 | mem_ctx,
|
---|
3796 | &ndr_table_winreg,
|
---|
3797 | NDR_WINREG_UNLOADKEY,
|
---|
3798 | &r);
|
---|
3799 |
|
---|
3800 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3801 | return status;
|
---|
3802 | }
|
---|
3803 |
|
---|
3804 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3805 | return status;
|
---|
3806 | }
|
---|
3807 |
|
---|
3808 | /* Return variables */
|
---|
3809 |
|
---|
3810 | /* Return result */
|
---|
3811 | if (werror) {
|
---|
3812 | *werror = r.out.result;
|
---|
3813 | }
|
---|
3814 |
|
---|
3815 | return werror_to_ntstatus(r.out.result);
|
---|
3816 | }
|
---|
3817 |
|
---|
3818 | struct rpccli_winreg_InitiateSystemShutdown_state {
|
---|
3819 | struct winreg_InitiateSystemShutdown orig;
|
---|
3820 | struct winreg_InitiateSystemShutdown tmp;
|
---|
3821 | TALLOC_CTX *out_mem_ctx;
|
---|
3822 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3823 | };
|
---|
3824 |
|
---|
3825 | static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq);
|
---|
3826 |
|
---|
3827 | struct tevent_req *rpccli_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
|
---|
3828 | struct tevent_context *ev,
|
---|
3829 | struct rpc_pipe_client *cli,
|
---|
3830 | uint16_t *_hostname /* [in] [unique] */,
|
---|
3831 | struct lsa_StringLarge *_message /* [in] [unique] */,
|
---|
3832 | uint32_t _timeout /* [in] */,
|
---|
3833 | uint8_t _force_apps /* [in] */,
|
---|
3834 | uint8_t _do_reboot /* [in] */)
|
---|
3835 | {
|
---|
3836 | struct tevent_req *req;
|
---|
3837 | struct rpccli_winreg_InitiateSystemShutdown_state *state;
|
---|
3838 | struct tevent_req *subreq;
|
---|
3839 |
|
---|
3840 | req = tevent_req_create(mem_ctx, &state,
|
---|
3841 | struct rpccli_winreg_InitiateSystemShutdown_state);
|
---|
3842 | if (req == NULL) {
|
---|
3843 | return NULL;
|
---|
3844 | }
|
---|
3845 | state->out_mem_ctx = NULL;
|
---|
3846 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3847 |
|
---|
3848 | /* In parameters */
|
---|
3849 | state->orig.in.hostname = _hostname;
|
---|
3850 | state->orig.in.message = _message;
|
---|
3851 | state->orig.in.timeout = _timeout;
|
---|
3852 | state->orig.in.force_apps = _force_apps;
|
---|
3853 | state->orig.in.do_reboot = _do_reboot;
|
---|
3854 |
|
---|
3855 | /* Out parameters */
|
---|
3856 |
|
---|
3857 | /* Result */
|
---|
3858 | ZERO_STRUCT(state->orig.out.result);
|
---|
3859 |
|
---|
3860 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
3861 | state->tmp = state->orig;
|
---|
3862 |
|
---|
3863 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
3864 | &ndr_table_winreg,
|
---|
3865 | NDR_WINREG_INITIATESYSTEMSHUTDOWN,
|
---|
3866 | &state->tmp);
|
---|
3867 | if (tevent_req_nomem(subreq, req)) {
|
---|
3868 | return tevent_req_post(req, ev);
|
---|
3869 | }
|
---|
3870 | tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdown_done, req);
|
---|
3871 | return req;
|
---|
3872 | }
|
---|
3873 |
|
---|
3874 | static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq)
|
---|
3875 | {
|
---|
3876 | struct tevent_req *req = tevent_req_callback_data(
|
---|
3877 | subreq, struct tevent_req);
|
---|
3878 | struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
|
---|
3879 | req, struct rpccli_winreg_InitiateSystemShutdown_state);
|
---|
3880 | NTSTATUS status;
|
---|
3881 | TALLOC_CTX *mem_ctx;
|
---|
3882 |
|
---|
3883 | if (state->out_mem_ctx) {
|
---|
3884 | mem_ctx = state->out_mem_ctx;
|
---|
3885 | } else {
|
---|
3886 | mem_ctx = state;
|
---|
3887 | }
|
---|
3888 |
|
---|
3889 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
3890 | TALLOC_FREE(subreq);
|
---|
3891 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3892 | tevent_req_nterror(req, status);
|
---|
3893 | return;
|
---|
3894 | }
|
---|
3895 |
|
---|
3896 | /* Copy out parameters */
|
---|
3897 |
|
---|
3898 | /* Copy result */
|
---|
3899 | state->orig.out.result = state->tmp.out.result;
|
---|
3900 |
|
---|
3901 | /* Reset temporary structure */
|
---|
3902 | ZERO_STRUCT(state->tmp);
|
---|
3903 |
|
---|
3904 | tevent_req_done(req);
|
---|
3905 | }
|
---|
3906 |
|
---|
3907 | NTSTATUS rpccli_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
|
---|
3908 | TALLOC_CTX *mem_ctx,
|
---|
3909 | WERROR *result)
|
---|
3910 | {
|
---|
3911 | struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
|
---|
3912 | req, struct rpccli_winreg_InitiateSystemShutdown_state);
|
---|
3913 | NTSTATUS status;
|
---|
3914 |
|
---|
3915 | if (tevent_req_is_nterror(req, &status)) {
|
---|
3916 | tevent_req_received(req);
|
---|
3917 | return status;
|
---|
3918 | }
|
---|
3919 |
|
---|
3920 | /* Steal possbile out parameters to the callers context */
|
---|
3921 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
3922 |
|
---|
3923 | /* Return result */
|
---|
3924 | *result = state->orig.out.result;
|
---|
3925 |
|
---|
3926 | tevent_req_received(req);
|
---|
3927 | return NT_STATUS_OK;
|
---|
3928 | }
|
---|
3929 |
|
---|
3930 | NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
|
---|
3931 | TALLOC_CTX *mem_ctx,
|
---|
3932 | uint16_t *hostname /* [in] [unique] */,
|
---|
3933 | struct lsa_StringLarge *message /* [in] [unique] */,
|
---|
3934 | uint32_t timeout /* [in] */,
|
---|
3935 | uint8_t force_apps /* [in] */,
|
---|
3936 | uint8_t do_reboot /* [in] */,
|
---|
3937 | WERROR *werror)
|
---|
3938 | {
|
---|
3939 | struct winreg_InitiateSystemShutdown r;
|
---|
3940 | NTSTATUS status;
|
---|
3941 |
|
---|
3942 | /* In parameters */
|
---|
3943 | r.in.hostname = hostname;
|
---|
3944 | r.in.message = message;
|
---|
3945 | r.in.timeout = timeout;
|
---|
3946 | r.in.force_apps = force_apps;
|
---|
3947 | r.in.do_reboot = do_reboot;
|
---|
3948 |
|
---|
3949 | status = cli->dispatch(cli,
|
---|
3950 | mem_ctx,
|
---|
3951 | &ndr_table_winreg,
|
---|
3952 | NDR_WINREG_INITIATESYSTEMSHUTDOWN,
|
---|
3953 | &r);
|
---|
3954 |
|
---|
3955 | if (!NT_STATUS_IS_OK(status)) {
|
---|
3956 | return status;
|
---|
3957 | }
|
---|
3958 |
|
---|
3959 | if (NT_STATUS_IS_ERR(status)) {
|
---|
3960 | return status;
|
---|
3961 | }
|
---|
3962 |
|
---|
3963 | /* Return variables */
|
---|
3964 |
|
---|
3965 | /* Return result */
|
---|
3966 | if (werror) {
|
---|
3967 | *werror = r.out.result;
|
---|
3968 | }
|
---|
3969 |
|
---|
3970 | return werror_to_ntstatus(r.out.result);
|
---|
3971 | }
|
---|
3972 |
|
---|
3973 | struct rpccli_winreg_AbortSystemShutdown_state {
|
---|
3974 | struct winreg_AbortSystemShutdown orig;
|
---|
3975 | struct winreg_AbortSystemShutdown tmp;
|
---|
3976 | TALLOC_CTX *out_mem_ctx;
|
---|
3977 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
3978 | };
|
---|
3979 |
|
---|
3980 | static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq);
|
---|
3981 |
|
---|
3982 | struct tevent_req *rpccli_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
|
---|
3983 | struct tevent_context *ev,
|
---|
3984 | struct rpc_pipe_client *cli,
|
---|
3985 | uint16_t *_server /* [in] [unique] */)
|
---|
3986 | {
|
---|
3987 | struct tevent_req *req;
|
---|
3988 | struct rpccli_winreg_AbortSystemShutdown_state *state;
|
---|
3989 | struct tevent_req *subreq;
|
---|
3990 |
|
---|
3991 | req = tevent_req_create(mem_ctx, &state,
|
---|
3992 | struct rpccli_winreg_AbortSystemShutdown_state);
|
---|
3993 | if (req == NULL) {
|
---|
3994 | return NULL;
|
---|
3995 | }
|
---|
3996 | state->out_mem_ctx = NULL;
|
---|
3997 | state->dispatch_recv = cli->dispatch_recv;
|
---|
3998 |
|
---|
3999 | /* In parameters */
|
---|
4000 | state->orig.in.server = _server;
|
---|
4001 |
|
---|
4002 | /* Out parameters */
|
---|
4003 |
|
---|
4004 | /* Result */
|
---|
4005 | ZERO_STRUCT(state->orig.out.result);
|
---|
4006 |
|
---|
4007 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4008 | state->tmp = state->orig;
|
---|
4009 |
|
---|
4010 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4011 | &ndr_table_winreg,
|
---|
4012 | NDR_WINREG_ABORTSYSTEMSHUTDOWN,
|
---|
4013 | &state->tmp);
|
---|
4014 | if (tevent_req_nomem(subreq, req)) {
|
---|
4015 | return tevent_req_post(req, ev);
|
---|
4016 | }
|
---|
4017 | tevent_req_set_callback(subreq, rpccli_winreg_AbortSystemShutdown_done, req);
|
---|
4018 | return req;
|
---|
4019 | }
|
---|
4020 |
|
---|
4021 | static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq)
|
---|
4022 | {
|
---|
4023 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4024 | subreq, struct tevent_req);
|
---|
4025 | struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
|
---|
4026 | req, struct rpccli_winreg_AbortSystemShutdown_state);
|
---|
4027 | NTSTATUS status;
|
---|
4028 | TALLOC_CTX *mem_ctx;
|
---|
4029 |
|
---|
4030 | if (state->out_mem_ctx) {
|
---|
4031 | mem_ctx = state->out_mem_ctx;
|
---|
4032 | } else {
|
---|
4033 | mem_ctx = state;
|
---|
4034 | }
|
---|
4035 |
|
---|
4036 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4037 | TALLOC_FREE(subreq);
|
---|
4038 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4039 | tevent_req_nterror(req, status);
|
---|
4040 | return;
|
---|
4041 | }
|
---|
4042 |
|
---|
4043 | /* Copy out parameters */
|
---|
4044 |
|
---|
4045 | /* Copy result */
|
---|
4046 | state->orig.out.result = state->tmp.out.result;
|
---|
4047 |
|
---|
4048 | /* Reset temporary structure */
|
---|
4049 | ZERO_STRUCT(state->tmp);
|
---|
4050 |
|
---|
4051 | tevent_req_done(req);
|
---|
4052 | }
|
---|
4053 |
|
---|
4054 | NTSTATUS rpccli_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
|
---|
4055 | TALLOC_CTX *mem_ctx,
|
---|
4056 | WERROR *result)
|
---|
4057 | {
|
---|
4058 | struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
|
---|
4059 | req, struct rpccli_winreg_AbortSystemShutdown_state);
|
---|
4060 | NTSTATUS status;
|
---|
4061 |
|
---|
4062 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4063 | tevent_req_received(req);
|
---|
4064 | return status;
|
---|
4065 | }
|
---|
4066 |
|
---|
4067 | /* Steal possbile out parameters to the callers context */
|
---|
4068 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4069 |
|
---|
4070 | /* Return result */
|
---|
4071 | *result = state->orig.out.result;
|
---|
4072 |
|
---|
4073 | tevent_req_received(req);
|
---|
4074 | return NT_STATUS_OK;
|
---|
4075 | }
|
---|
4076 |
|
---|
4077 | NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
|
---|
4078 | TALLOC_CTX *mem_ctx,
|
---|
4079 | uint16_t *server /* [in] [unique] */,
|
---|
4080 | WERROR *werror)
|
---|
4081 | {
|
---|
4082 | struct winreg_AbortSystemShutdown r;
|
---|
4083 | NTSTATUS status;
|
---|
4084 |
|
---|
4085 | /* In parameters */
|
---|
4086 | r.in.server = server;
|
---|
4087 |
|
---|
4088 | status = cli->dispatch(cli,
|
---|
4089 | mem_ctx,
|
---|
4090 | &ndr_table_winreg,
|
---|
4091 | NDR_WINREG_ABORTSYSTEMSHUTDOWN,
|
---|
4092 | &r);
|
---|
4093 |
|
---|
4094 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4095 | return status;
|
---|
4096 | }
|
---|
4097 |
|
---|
4098 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4099 | return status;
|
---|
4100 | }
|
---|
4101 |
|
---|
4102 | /* Return variables */
|
---|
4103 |
|
---|
4104 | /* Return result */
|
---|
4105 | if (werror) {
|
---|
4106 | *werror = r.out.result;
|
---|
4107 | }
|
---|
4108 |
|
---|
4109 | return werror_to_ntstatus(r.out.result);
|
---|
4110 | }
|
---|
4111 |
|
---|
4112 | struct rpccli_winreg_GetVersion_state {
|
---|
4113 | struct winreg_GetVersion orig;
|
---|
4114 | struct winreg_GetVersion tmp;
|
---|
4115 | TALLOC_CTX *out_mem_ctx;
|
---|
4116 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4117 | };
|
---|
4118 |
|
---|
4119 | static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq);
|
---|
4120 |
|
---|
4121 | struct tevent_req *rpccli_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
|
---|
4122 | struct tevent_context *ev,
|
---|
4123 | struct rpc_pipe_client *cli,
|
---|
4124 | struct policy_handle *_handle /* [in] [ref] */,
|
---|
4125 | uint32_t *_version /* [out] [ref] */)
|
---|
4126 | {
|
---|
4127 | struct tevent_req *req;
|
---|
4128 | struct rpccli_winreg_GetVersion_state *state;
|
---|
4129 | struct tevent_req *subreq;
|
---|
4130 |
|
---|
4131 | req = tevent_req_create(mem_ctx, &state,
|
---|
4132 | struct rpccli_winreg_GetVersion_state);
|
---|
4133 | if (req == NULL) {
|
---|
4134 | return NULL;
|
---|
4135 | }
|
---|
4136 | state->out_mem_ctx = NULL;
|
---|
4137 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4138 |
|
---|
4139 | /* In parameters */
|
---|
4140 | state->orig.in.handle = _handle;
|
---|
4141 |
|
---|
4142 | /* Out parameters */
|
---|
4143 | state->orig.out.version = _version;
|
---|
4144 |
|
---|
4145 | /* Result */
|
---|
4146 | ZERO_STRUCT(state->orig.out.result);
|
---|
4147 |
|
---|
4148 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4149 | "rpccli_winreg_GetVersion_out_memory");
|
---|
4150 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4151 | return tevent_req_post(req, ev);
|
---|
4152 | }
|
---|
4153 |
|
---|
4154 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4155 | state->tmp = state->orig;
|
---|
4156 |
|
---|
4157 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4158 | &ndr_table_winreg,
|
---|
4159 | NDR_WINREG_GETVERSION,
|
---|
4160 | &state->tmp);
|
---|
4161 | if (tevent_req_nomem(subreq, req)) {
|
---|
4162 | return tevent_req_post(req, ev);
|
---|
4163 | }
|
---|
4164 | tevent_req_set_callback(subreq, rpccli_winreg_GetVersion_done, req);
|
---|
4165 | return req;
|
---|
4166 | }
|
---|
4167 |
|
---|
4168 | static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq)
|
---|
4169 | {
|
---|
4170 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4171 | subreq, struct tevent_req);
|
---|
4172 | struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
|
---|
4173 | req, struct rpccli_winreg_GetVersion_state);
|
---|
4174 | NTSTATUS status;
|
---|
4175 | TALLOC_CTX *mem_ctx;
|
---|
4176 |
|
---|
4177 | if (state->out_mem_ctx) {
|
---|
4178 | mem_ctx = state->out_mem_ctx;
|
---|
4179 | } else {
|
---|
4180 | mem_ctx = state;
|
---|
4181 | }
|
---|
4182 |
|
---|
4183 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4184 | TALLOC_FREE(subreq);
|
---|
4185 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4186 | tevent_req_nterror(req, status);
|
---|
4187 | return;
|
---|
4188 | }
|
---|
4189 |
|
---|
4190 | /* Copy out parameters */
|
---|
4191 | *state->orig.out.version = *state->tmp.out.version;
|
---|
4192 |
|
---|
4193 | /* Copy result */
|
---|
4194 | state->orig.out.result = state->tmp.out.result;
|
---|
4195 |
|
---|
4196 | /* Reset temporary structure */
|
---|
4197 | ZERO_STRUCT(state->tmp);
|
---|
4198 |
|
---|
4199 | tevent_req_done(req);
|
---|
4200 | }
|
---|
4201 |
|
---|
4202 | NTSTATUS rpccli_winreg_GetVersion_recv(struct tevent_req *req,
|
---|
4203 | TALLOC_CTX *mem_ctx,
|
---|
4204 | WERROR *result)
|
---|
4205 | {
|
---|
4206 | struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
|
---|
4207 | req, struct rpccli_winreg_GetVersion_state);
|
---|
4208 | NTSTATUS status;
|
---|
4209 |
|
---|
4210 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4211 | tevent_req_received(req);
|
---|
4212 | return status;
|
---|
4213 | }
|
---|
4214 |
|
---|
4215 | /* Steal possbile out parameters to the callers context */
|
---|
4216 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4217 |
|
---|
4218 | /* Return result */
|
---|
4219 | *result = state->orig.out.result;
|
---|
4220 |
|
---|
4221 | tevent_req_received(req);
|
---|
4222 | return NT_STATUS_OK;
|
---|
4223 | }
|
---|
4224 |
|
---|
4225 | NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
|
---|
4226 | TALLOC_CTX *mem_ctx,
|
---|
4227 | struct policy_handle *handle /* [in] [ref] */,
|
---|
4228 | uint32_t *version /* [out] [ref] */,
|
---|
4229 | WERROR *werror)
|
---|
4230 | {
|
---|
4231 | struct winreg_GetVersion r;
|
---|
4232 | NTSTATUS status;
|
---|
4233 |
|
---|
4234 | /* In parameters */
|
---|
4235 | r.in.handle = handle;
|
---|
4236 |
|
---|
4237 | status = cli->dispatch(cli,
|
---|
4238 | mem_ctx,
|
---|
4239 | &ndr_table_winreg,
|
---|
4240 | NDR_WINREG_GETVERSION,
|
---|
4241 | &r);
|
---|
4242 |
|
---|
4243 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4244 | return status;
|
---|
4245 | }
|
---|
4246 |
|
---|
4247 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4248 | return status;
|
---|
4249 | }
|
---|
4250 |
|
---|
4251 | /* Return variables */
|
---|
4252 | *version = *r.out.version;
|
---|
4253 |
|
---|
4254 | /* Return result */
|
---|
4255 | if (werror) {
|
---|
4256 | *werror = r.out.result;
|
---|
4257 | }
|
---|
4258 |
|
---|
4259 | return werror_to_ntstatus(r.out.result);
|
---|
4260 | }
|
---|
4261 |
|
---|
4262 | struct rpccli_winreg_OpenHKCC_state {
|
---|
4263 | struct winreg_OpenHKCC orig;
|
---|
4264 | struct winreg_OpenHKCC tmp;
|
---|
4265 | TALLOC_CTX *out_mem_ctx;
|
---|
4266 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4267 | };
|
---|
4268 |
|
---|
4269 | static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq);
|
---|
4270 |
|
---|
4271 | struct tevent_req *rpccli_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
|
---|
4272 | struct tevent_context *ev,
|
---|
4273 | struct rpc_pipe_client *cli,
|
---|
4274 | uint16_t *_system_name /* [in] [unique] */,
|
---|
4275 | uint32_t _access_mask /* [in] */,
|
---|
4276 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
4277 | {
|
---|
4278 | struct tevent_req *req;
|
---|
4279 | struct rpccli_winreg_OpenHKCC_state *state;
|
---|
4280 | struct tevent_req *subreq;
|
---|
4281 |
|
---|
4282 | req = tevent_req_create(mem_ctx, &state,
|
---|
4283 | struct rpccli_winreg_OpenHKCC_state);
|
---|
4284 | if (req == NULL) {
|
---|
4285 | return NULL;
|
---|
4286 | }
|
---|
4287 | state->out_mem_ctx = NULL;
|
---|
4288 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4289 |
|
---|
4290 | /* In parameters */
|
---|
4291 | state->orig.in.system_name = _system_name;
|
---|
4292 | state->orig.in.access_mask = _access_mask;
|
---|
4293 |
|
---|
4294 | /* Out parameters */
|
---|
4295 | state->orig.out.handle = _handle;
|
---|
4296 |
|
---|
4297 | /* Result */
|
---|
4298 | ZERO_STRUCT(state->orig.out.result);
|
---|
4299 |
|
---|
4300 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4301 | "rpccli_winreg_OpenHKCC_out_memory");
|
---|
4302 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4303 | return tevent_req_post(req, ev);
|
---|
4304 | }
|
---|
4305 |
|
---|
4306 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4307 | state->tmp = state->orig;
|
---|
4308 |
|
---|
4309 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4310 | &ndr_table_winreg,
|
---|
4311 | NDR_WINREG_OPENHKCC,
|
---|
4312 | &state->tmp);
|
---|
4313 | if (tevent_req_nomem(subreq, req)) {
|
---|
4314 | return tevent_req_post(req, ev);
|
---|
4315 | }
|
---|
4316 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCC_done, req);
|
---|
4317 | return req;
|
---|
4318 | }
|
---|
4319 |
|
---|
4320 | static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq)
|
---|
4321 | {
|
---|
4322 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4323 | subreq, struct tevent_req);
|
---|
4324 | struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
|
---|
4325 | req, struct rpccli_winreg_OpenHKCC_state);
|
---|
4326 | NTSTATUS status;
|
---|
4327 | TALLOC_CTX *mem_ctx;
|
---|
4328 |
|
---|
4329 | if (state->out_mem_ctx) {
|
---|
4330 | mem_ctx = state->out_mem_ctx;
|
---|
4331 | } else {
|
---|
4332 | mem_ctx = state;
|
---|
4333 | }
|
---|
4334 |
|
---|
4335 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4336 | TALLOC_FREE(subreq);
|
---|
4337 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4338 | tevent_req_nterror(req, status);
|
---|
4339 | return;
|
---|
4340 | }
|
---|
4341 |
|
---|
4342 | /* Copy out parameters */
|
---|
4343 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
4344 |
|
---|
4345 | /* Copy result */
|
---|
4346 | state->orig.out.result = state->tmp.out.result;
|
---|
4347 |
|
---|
4348 | /* Reset temporary structure */
|
---|
4349 | ZERO_STRUCT(state->tmp);
|
---|
4350 |
|
---|
4351 | tevent_req_done(req);
|
---|
4352 | }
|
---|
4353 |
|
---|
4354 | NTSTATUS rpccli_winreg_OpenHKCC_recv(struct tevent_req *req,
|
---|
4355 | TALLOC_CTX *mem_ctx,
|
---|
4356 | WERROR *result)
|
---|
4357 | {
|
---|
4358 | struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
|
---|
4359 | req, struct rpccli_winreg_OpenHKCC_state);
|
---|
4360 | NTSTATUS status;
|
---|
4361 |
|
---|
4362 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4363 | tevent_req_received(req);
|
---|
4364 | return status;
|
---|
4365 | }
|
---|
4366 |
|
---|
4367 | /* Steal possbile out parameters to the callers context */
|
---|
4368 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4369 |
|
---|
4370 | /* Return result */
|
---|
4371 | *result = state->orig.out.result;
|
---|
4372 |
|
---|
4373 | tevent_req_received(req);
|
---|
4374 | return NT_STATUS_OK;
|
---|
4375 | }
|
---|
4376 |
|
---|
4377 | NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
|
---|
4378 | TALLOC_CTX *mem_ctx,
|
---|
4379 | uint16_t *system_name /* [in] [unique] */,
|
---|
4380 | uint32_t access_mask /* [in] */,
|
---|
4381 | struct policy_handle *handle /* [out] [ref] */,
|
---|
4382 | WERROR *werror)
|
---|
4383 | {
|
---|
4384 | struct winreg_OpenHKCC r;
|
---|
4385 | NTSTATUS status;
|
---|
4386 |
|
---|
4387 | /* In parameters */
|
---|
4388 | r.in.system_name = system_name;
|
---|
4389 | r.in.access_mask = access_mask;
|
---|
4390 |
|
---|
4391 | status = cli->dispatch(cli,
|
---|
4392 | mem_ctx,
|
---|
4393 | &ndr_table_winreg,
|
---|
4394 | NDR_WINREG_OPENHKCC,
|
---|
4395 | &r);
|
---|
4396 |
|
---|
4397 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4398 | return status;
|
---|
4399 | }
|
---|
4400 |
|
---|
4401 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4402 | return status;
|
---|
4403 | }
|
---|
4404 |
|
---|
4405 | /* Return variables */
|
---|
4406 | *handle = *r.out.handle;
|
---|
4407 |
|
---|
4408 | /* Return result */
|
---|
4409 | if (werror) {
|
---|
4410 | *werror = r.out.result;
|
---|
4411 | }
|
---|
4412 |
|
---|
4413 | return werror_to_ntstatus(r.out.result);
|
---|
4414 | }
|
---|
4415 |
|
---|
4416 | struct rpccli_winreg_OpenHKDD_state {
|
---|
4417 | struct winreg_OpenHKDD orig;
|
---|
4418 | struct winreg_OpenHKDD tmp;
|
---|
4419 | TALLOC_CTX *out_mem_ctx;
|
---|
4420 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4421 | };
|
---|
4422 |
|
---|
4423 | static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq);
|
---|
4424 |
|
---|
4425 | struct tevent_req *rpccli_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
|
---|
4426 | struct tevent_context *ev,
|
---|
4427 | struct rpc_pipe_client *cli,
|
---|
4428 | uint16_t *_system_name /* [in] [unique] */,
|
---|
4429 | uint32_t _access_mask /* [in] */,
|
---|
4430 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
4431 | {
|
---|
4432 | struct tevent_req *req;
|
---|
4433 | struct rpccli_winreg_OpenHKDD_state *state;
|
---|
4434 | struct tevent_req *subreq;
|
---|
4435 |
|
---|
4436 | req = tevent_req_create(mem_ctx, &state,
|
---|
4437 | struct rpccli_winreg_OpenHKDD_state);
|
---|
4438 | if (req == NULL) {
|
---|
4439 | return NULL;
|
---|
4440 | }
|
---|
4441 | state->out_mem_ctx = NULL;
|
---|
4442 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4443 |
|
---|
4444 | /* In parameters */
|
---|
4445 | state->orig.in.system_name = _system_name;
|
---|
4446 | state->orig.in.access_mask = _access_mask;
|
---|
4447 |
|
---|
4448 | /* Out parameters */
|
---|
4449 | state->orig.out.handle = _handle;
|
---|
4450 |
|
---|
4451 | /* Result */
|
---|
4452 | ZERO_STRUCT(state->orig.out.result);
|
---|
4453 |
|
---|
4454 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4455 | "rpccli_winreg_OpenHKDD_out_memory");
|
---|
4456 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4457 | return tevent_req_post(req, ev);
|
---|
4458 | }
|
---|
4459 |
|
---|
4460 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4461 | state->tmp = state->orig;
|
---|
4462 |
|
---|
4463 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4464 | &ndr_table_winreg,
|
---|
4465 | NDR_WINREG_OPENHKDD,
|
---|
4466 | &state->tmp);
|
---|
4467 | if (tevent_req_nomem(subreq, req)) {
|
---|
4468 | return tevent_req_post(req, ev);
|
---|
4469 | }
|
---|
4470 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKDD_done, req);
|
---|
4471 | return req;
|
---|
4472 | }
|
---|
4473 |
|
---|
4474 | static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq)
|
---|
4475 | {
|
---|
4476 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4477 | subreq, struct tevent_req);
|
---|
4478 | struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
|
---|
4479 | req, struct rpccli_winreg_OpenHKDD_state);
|
---|
4480 | NTSTATUS status;
|
---|
4481 | TALLOC_CTX *mem_ctx;
|
---|
4482 |
|
---|
4483 | if (state->out_mem_ctx) {
|
---|
4484 | mem_ctx = state->out_mem_ctx;
|
---|
4485 | } else {
|
---|
4486 | mem_ctx = state;
|
---|
4487 | }
|
---|
4488 |
|
---|
4489 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4490 | TALLOC_FREE(subreq);
|
---|
4491 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4492 | tevent_req_nterror(req, status);
|
---|
4493 | return;
|
---|
4494 | }
|
---|
4495 |
|
---|
4496 | /* Copy out parameters */
|
---|
4497 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
4498 |
|
---|
4499 | /* Copy result */
|
---|
4500 | state->orig.out.result = state->tmp.out.result;
|
---|
4501 |
|
---|
4502 | /* Reset temporary structure */
|
---|
4503 | ZERO_STRUCT(state->tmp);
|
---|
4504 |
|
---|
4505 | tevent_req_done(req);
|
---|
4506 | }
|
---|
4507 |
|
---|
4508 | NTSTATUS rpccli_winreg_OpenHKDD_recv(struct tevent_req *req,
|
---|
4509 | TALLOC_CTX *mem_ctx,
|
---|
4510 | WERROR *result)
|
---|
4511 | {
|
---|
4512 | struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
|
---|
4513 | req, struct rpccli_winreg_OpenHKDD_state);
|
---|
4514 | NTSTATUS status;
|
---|
4515 |
|
---|
4516 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4517 | tevent_req_received(req);
|
---|
4518 | return status;
|
---|
4519 | }
|
---|
4520 |
|
---|
4521 | /* Steal possbile out parameters to the callers context */
|
---|
4522 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4523 |
|
---|
4524 | /* Return result */
|
---|
4525 | *result = state->orig.out.result;
|
---|
4526 |
|
---|
4527 | tevent_req_received(req);
|
---|
4528 | return NT_STATUS_OK;
|
---|
4529 | }
|
---|
4530 |
|
---|
4531 | NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
|
---|
4532 | TALLOC_CTX *mem_ctx,
|
---|
4533 | uint16_t *system_name /* [in] [unique] */,
|
---|
4534 | uint32_t access_mask /* [in] */,
|
---|
4535 | struct policy_handle *handle /* [out] [ref] */,
|
---|
4536 | WERROR *werror)
|
---|
4537 | {
|
---|
4538 | struct winreg_OpenHKDD r;
|
---|
4539 | NTSTATUS status;
|
---|
4540 |
|
---|
4541 | /* In parameters */
|
---|
4542 | r.in.system_name = system_name;
|
---|
4543 | r.in.access_mask = access_mask;
|
---|
4544 |
|
---|
4545 | status = cli->dispatch(cli,
|
---|
4546 | mem_ctx,
|
---|
4547 | &ndr_table_winreg,
|
---|
4548 | NDR_WINREG_OPENHKDD,
|
---|
4549 | &r);
|
---|
4550 |
|
---|
4551 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4552 | return status;
|
---|
4553 | }
|
---|
4554 |
|
---|
4555 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4556 | return status;
|
---|
4557 | }
|
---|
4558 |
|
---|
4559 | /* Return variables */
|
---|
4560 | *handle = *r.out.handle;
|
---|
4561 |
|
---|
4562 | /* Return result */
|
---|
4563 | if (werror) {
|
---|
4564 | *werror = r.out.result;
|
---|
4565 | }
|
---|
4566 |
|
---|
4567 | return werror_to_ntstatus(r.out.result);
|
---|
4568 | }
|
---|
4569 |
|
---|
4570 | struct rpccli_winreg_QueryMultipleValues_state {
|
---|
4571 | struct winreg_QueryMultipleValues orig;
|
---|
4572 | struct winreg_QueryMultipleValues tmp;
|
---|
4573 | TALLOC_CTX *out_mem_ctx;
|
---|
4574 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4575 | };
|
---|
4576 |
|
---|
4577 | static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq);
|
---|
4578 |
|
---|
4579 | struct tevent_req *rpccli_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
|
---|
4580 | struct tevent_context *ev,
|
---|
4581 | struct rpc_pipe_client *cli,
|
---|
4582 | struct policy_handle *_key_handle /* [in] [ref] */,
|
---|
4583 | struct QueryMultipleValue *_values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
|
---|
4584 | uint32_t _num_values /* [in] */,
|
---|
4585 | uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
|
---|
4586 | uint32_t *_buffer_size /* [in,out] [ref] */)
|
---|
4587 | {
|
---|
4588 | struct tevent_req *req;
|
---|
4589 | struct rpccli_winreg_QueryMultipleValues_state *state;
|
---|
4590 | struct tevent_req *subreq;
|
---|
4591 |
|
---|
4592 | req = tevent_req_create(mem_ctx, &state,
|
---|
4593 | struct rpccli_winreg_QueryMultipleValues_state);
|
---|
4594 | if (req == NULL) {
|
---|
4595 | return NULL;
|
---|
4596 | }
|
---|
4597 | state->out_mem_ctx = NULL;
|
---|
4598 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4599 |
|
---|
4600 | /* In parameters */
|
---|
4601 | state->orig.in.key_handle = _key_handle;
|
---|
4602 | state->orig.in.values = _values;
|
---|
4603 | state->orig.in.num_values = _num_values;
|
---|
4604 | state->orig.in.buffer = _buffer;
|
---|
4605 | state->orig.in.buffer_size = _buffer_size;
|
---|
4606 |
|
---|
4607 | /* Out parameters */
|
---|
4608 | state->orig.out.values = _values;
|
---|
4609 | state->orig.out.buffer = _buffer;
|
---|
4610 | state->orig.out.buffer_size = _buffer_size;
|
---|
4611 |
|
---|
4612 | /* Result */
|
---|
4613 | ZERO_STRUCT(state->orig.out.result);
|
---|
4614 |
|
---|
4615 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
4616 | "rpccli_winreg_QueryMultipleValues_out_memory");
|
---|
4617 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
4618 | return tevent_req_post(req, ev);
|
---|
4619 | }
|
---|
4620 |
|
---|
4621 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4622 | state->tmp = state->orig;
|
---|
4623 |
|
---|
4624 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4625 | &ndr_table_winreg,
|
---|
4626 | NDR_WINREG_QUERYMULTIPLEVALUES,
|
---|
4627 | &state->tmp);
|
---|
4628 | if (tevent_req_nomem(subreq, req)) {
|
---|
4629 | return tevent_req_post(req, ev);
|
---|
4630 | }
|
---|
4631 | tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues_done, req);
|
---|
4632 | return req;
|
---|
4633 | }
|
---|
4634 |
|
---|
4635 | static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq)
|
---|
4636 | {
|
---|
4637 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4638 | subreq, struct tevent_req);
|
---|
4639 | struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
|
---|
4640 | req, struct rpccli_winreg_QueryMultipleValues_state);
|
---|
4641 | NTSTATUS status;
|
---|
4642 | TALLOC_CTX *mem_ctx;
|
---|
4643 |
|
---|
4644 | if (state->out_mem_ctx) {
|
---|
4645 | mem_ctx = state->out_mem_ctx;
|
---|
4646 | } else {
|
---|
4647 | mem_ctx = state;
|
---|
4648 | }
|
---|
4649 |
|
---|
4650 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4651 | TALLOC_FREE(subreq);
|
---|
4652 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4653 | tevent_req_nterror(req, status);
|
---|
4654 | return;
|
---|
4655 | }
|
---|
4656 |
|
---|
4657 | /* Copy out parameters */
|
---|
4658 | memcpy(state->orig.out.values, state->tmp.out.values, (state->tmp.in.num_values) * sizeof(*state->orig.out.values));
|
---|
4659 | if (state->orig.out.buffer && state->tmp.out.buffer) {
|
---|
4660 | if ((*state->tmp.out.buffer_size) > (*state->tmp.in.buffer_size)) {
|
---|
4661 | tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
|
---|
4662 | return;
|
---|
4663 | }
|
---|
4664 | memcpy(state->orig.out.buffer, state->tmp.out.buffer, (*state->tmp.out.buffer_size) * sizeof(*state->orig.out.buffer));
|
---|
4665 | }
|
---|
4666 | *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
|
---|
4667 |
|
---|
4668 | /* Copy result */
|
---|
4669 | state->orig.out.result = state->tmp.out.result;
|
---|
4670 |
|
---|
4671 | /* Reset temporary structure */
|
---|
4672 | ZERO_STRUCT(state->tmp);
|
---|
4673 |
|
---|
4674 | tevent_req_done(req);
|
---|
4675 | }
|
---|
4676 |
|
---|
4677 | NTSTATUS rpccli_winreg_QueryMultipleValues_recv(struct tevent_req *req,
|
---|
4678 | TALLOC_CTX *mem_ctx,
|
---|
4679 | WERROR *result)
|
---|
4680 | {
|
---|
4681 | struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
|
---|
4682 | req, struct rpccli_winreg_QueryMultipleValues_state);
|
---|
4683 | NTSTATUS status;
|
---|
4684 |
|
---|
4685 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4686 | tevent_req_received(req);
|
---|
4687 | return status;
|
---|
4688 | }
|
---|
4689 |
|
---|
4690 | /* Steal possbile out parameters to the callers context */
|
---|
4691 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4692 |
|
---|
4693 | /* Return result */
|
---|
4694 | *result = state->orig.out.result;
|
---|
4695 |
|
---|
4696 | tevent_req_received(req);
|
---|
4697 | return NT_STATUS_OK;
|
---|
4698 | }
|
---|
4699 |
|
---|
4700 | NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
|
---|
4701 | TALLOC_CTX *mem_ctx,
|
---|
4702 | struct policy_handle *key_handle /* [in] [ref] */,
|
---|
4703 | struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
|
---|
4704 | uint32_t num_values /* [in] */,
|
---|
4705 | uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
|
---|
4706 | uint32_t *buffer_size /* [in,out] [ref] */,
|
---|
4707 | WERROR *werror)
|
---|
4708 | {
|
---|
4709 | struct winreg_QueryMultipleValues r;
|
---|
4710 | NTSTATUS status;
|
---|
4711 |
|
---|
4712 | /* In parameters */
|
---|
4713 | r.in.key_handle = key_handle;
|
---|
4714 | r.in.values = values;
|
---|
4715 | r.in.num_values = num_values;
|
---|
4716 | r.in.buffer = buffer;
|
---|
4717 | r.in.buffer_size = buffer_size;
|
---|
4718 |
|
---|
4719 | status = cli->dispatch(cli,
|
---|
4720 | mem_ctx,
|
---|
4721 | &ndr_table_winreg,
|
---|
4722 | NDR_WINREG_QUERYMULTIPLEVALUES,
|
---|
4723 | &r);
|
---|
4724 |
|
---|
4725 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4726 | return status;
|
---|
4727 | }
|
---|
4728 |
|
---|
4729 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4730 | return status;
|
---|
4731 | }
|
---|
4732 |
|
---|
4733 | /* Return variables */
|
---|
4734 | memcpy(values, r.out.values, (r.in.num_values) * sizeof(*values));
|
---|
4735 | if (buffer && r.out.buffer) {
|
---|
4736 | if ((*r.out.buffer_size) > (*r.in.buffer_size)) {
|
---|
4737 | return NT_STATUS_INVALID_NETWORK_RESPONSE;
|
---|
4738 | }
|
---|
4739 | memcpy(buffer, r.out.buffer, (*r.out.buffer_size) * sizeof(*buffer));
|
---|
4740 | }
|
---|
4741 | *buffer_size = *r.out.buffer_size;
|
---|
4742 |
|
---|
4743 | /* Return result */
|
---|
4744 | if (werror) {
|
---|
4745 | *werror = r.out.result;
|
---|
4746 | }
|
---|
4747 |
|
---|
4748 | return werror_to_ntstatus(r.out.result);
|
---|
4749 | }
|
---|
4750 |
|
---|
4751 | struct rpccli_winreg_InitiateSystemShutdownEx_state {
|
---|
4752 | struct winreg_InitiateSystemShutdownEx orig;
|
---|
4753 | struct winreg_InitiateSystemShutdownEx tmp;
|
---|
4754 | TALLOC_CTX *out_mem_ctx;
|
---|
4755 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4756 | };
|
---|
4757 |
|
---|
4758 | static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq);
|
---|
4759 |
|
---|
4760 | struct tevent_req *rpccli_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
|
---|
4761 | struct tevent_context *ev,
|
---|
4762 | struct rpc_pipe_client *cli,
|
---|
4763 | uint16_t *_hostname /* [in] [unique] */,
|
---|
4764 | struct lsa_StringLarge *_message /* [in] [unique] */,
|
---|
4765 | uint32_t _timeout /* [in] */,
|
---|
4766 | uint8_t _force_apps /* [in] */,
|
---|
4767 | uint8_t _do_reboot /* [in] */,
|
---|
4768 | uint32_t _reason /* [in] */)
|
---|
4769 | {
|
---|
4770 | struct tevent_req *req;
|
---|
4771 | struct rpccli_winreg_InitiateSystemShutdownEx_state *state;
|
---|
4772 | struct tevent_req *subreq;
|
---|
4773 |
|
---|
4774 | req = tevent_req_create(mem_ctx, &state,
|
---|
4775 | struct rpccli_winreg_InitiateSystemShutdownEx_state);
|
---|
4776 | if (req == NULL) {
|
---|
4777 | return NULL;
|
---|
4778 | }
|
---|
4779 | state->out_mem_ctx = NULL;
|
---|
4780 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4781 |
|
---|
4782 | /* In parameters */
|
---|
4783 | state->orig.in.hostname = _hostname;
|
---|
4784 | state->orig.in.message = _message;
|
---|
4785 | state->orig.in.timeout = _timeout;
|
---|
4786 | state->orig.in.force_apps = _force_apps;
|
---|
4787 | state->orig.in.do_reboot = _do_reboot;
|
---|
4788 | state->orig.in.reason = _reason;
|
---|
4789 |
|
---|
4790 | /* Out parameters */
|
---|
4791 |
|
---|
4792 | /* Result */
|
---|
4793 | ZERO_STRUCT(state->orig.out.result);
|
---|
4794 |
|
---|
4795 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4796 | state->tmp = state->orig;
|
---|
4797 |
|
---|
4798 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4799 | &ndr_table_winreg,
|
---|
4800 | NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
|
---|
4801 | &state->tmp);
|
---|
4802 | if (tevent_req_nomem(subreq, req)) {
|
---|
4803 | return tevent_req_post(req, ev);
|
---|
4804 | }
|
---|
4805 | tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdownEx_done, req);
|
---|
4806 | return req;
|
---|
4807 | }
|
---|
4808 |
|
---|
4809 | static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq)
|
---|
4810 | {
|
---|
4811 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4812 | subreq, struct tevent_req);
|
---|
4813 | struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
|
---|
4814 | req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
|
---|
4815 | NTSTATUS status;
|
---|
4816 | TALLOC_CTX *mem_ctx;
|
---|
4817 |
|
---|
4818 | if (state->out_mem_ctx) {
|
---|
4819 | mem_ctx = state->out_mem_ctx;
|
---|
4820 | } else {
|
---|
4821 | mem_ctx = state;
|
---|
4822 | }
|
---|
4823 |
|
---|
4824 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4825 | TALLOC_FREE(subreq);
|
---|
4826 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4827 | tevent_req_nterror(req, status);
|
---|
4828 | return;
|
---|
4829 | }
|
---|
4830 |
|
---|
4831 | /* Copy out parameters */
|
---|
4832 |
|
---|
4833 | /* Copy result */
|
---|
4834 | state->orig.out.result = state->tmp.out.result;
|
---|
4835 |
|
---|
4836 | /* Reset temporary structure */
|
---|
4837 | ZERO_STRUCT(state->tmp);
|
---|
4838 |
|
---|
4839 | tevent_req_done(req);
|
---|
4840 | }
|
---|
4841 |
|
---|
4842 | NTSTATUS rpccli_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
|
---|
4843 | TALLOC_CTX *mem_ctx,
|
---|
4844 | WERROR *result)
|
---|
4845 | {
|
---|
4846 | struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
|
---|
4847 | req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
|
---|
4848 | NTSTATUS status;
|
---|
4849 |
|
---|
4850 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4851 | tevent_req_received(req);
|
---|
4852 | return status;
|
---|
4853 | }
|
---|
4854 |
|
---|
4855 | /* Steal possbile out parameters to the callers context */
|
---|
4856 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
4857 |
|
---|
4858 | /* Return result */
|
---|
4859 | *result = state->orig.out.result;
|
---|
4860 |
|
---|
4861 | tevent_req_received(req);
|
---|
4862 | return NT_STATUS_OK;
|
---|
4863 | }
|
---|
4864 |
|
---|
4865 | NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
|
---|
4866 | TALLOC_CTX *mem_ctx,
|
---|
4867 | uint16_t *hostname /* [in] [unique] */,
|
---|
4868 | struct lsa_StringLarge *message /* [in] [unique] */,
|
---|
4869 | uint32_t timeout /* [in] */,
|
---|
4870 | uint8_t force_apps /* [in] */,
|
---|
4871 | uint8_t do_reboot /* [in] */,
|
---|
4872 | uint32_t reason /* [in] */,
|
---|
4873 | WERROR *werror)
|
---|
4874 | {
|
---|
4875 | struct winreg_InitiateSystemShutdownEx r;
|
---|
4876 | NTSTATUS status;
|
---|
4877 |
|
---|
4878 | /* In parameters */
|
---|
4879 | r.in.hostname = hostname;
|
---|
4880 | r.in.message = message;
|
---|
4881 | r.in.timeout = timeout;
|
---|
4882 | r.in.force_apps = force_apps;
|
---|
4883 | r.in.do_reboot = do_reboot;
|
---|
4884 | r.in.reason = reason;
|
---|
4885 |
|
---|
4886 | status = cli->dispatch(cli,
|
---|
4887 | mem_ctx,
|
---|
4888 | &ndr_table_winreg,
|
---|
4889 | NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
|
---|
4890 | &r);
|
---|
4891 |
|
---|
4892 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4893 | return status;
|
---|
4894 | }
|
---|
4895 |
|
---|
4896 | if (NT_STATUS_IS_ERR(status)) {
|
---|
4897 | return status;
|
---|
4898 | }
|
---|
4899 |
|
---|
4900 | /* Return variables */
|
---|
4901 |
|
---|
4902 | /* Return result */
|
---|
4903 | if (werror) {
|
---|
4904 | *werror = r.out.result;
|
---|
4905 | }
|
---|
4906 |
|
---|
4907 | return werror_to_ntstatus(r.out.result);
|
---|
4908 | }
|
---|
4909 |
|
---|
4910 | struct rpccli_winreg_SaveKeyEx_state {
|
---|
4911 | struct winreg_SaveKeyEx orig;
|
---|
4912 | struct winreg_SaveKeyEx tmp;
|
---|
4913 | TALLOC_CTX *out_mem_ctx;
|
---|
4914 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
4915 | };
|
---|
4916 |
|
---|
4917 | static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq);
|
---|
4918 |
|
---|
4919 | struct tevent_req *rpccli_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
|
---|
4920 | struct tevent_context *ev,
|
---|
4921 | struct rpc_pipe_client *cli)
|
---|
4922 | {
|
---|
4923 | struct tevent_req *req;
|
---|
4924 | struct rpccli_winreg_SaveKeyEx_state *state;
|
---|
4925 | struct tevent_req *subreq;
|
---|
4926 |
|
---|
4927 | req = tevent_req_create(mem_ctx, &state,
|
---|
4928 | struct rpccli_winreg_SaveKeyEx_state);
|
---|
4929 | if (req == NULL) {
|
---|
4930 | return NULL;
|
---|
4931 | }
|
---|
4932 | state->out_mem_ctx = NULL;
|
---|
4933 | state->dispatch_recv = cli->dispatch_recv;
|
---|
4934 |
|
---|
4935 | /* In parameters */
|
---|
4936 |
|
---|
4937 | /* Out parameters */
|
---|
4938 |
|
---|
4939 | /* Result */
|
---|
4940 | ZERO_STRUCT(state->orig.out.result);
|
---|
4941 |
|
---|
4942 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
4943 | state->tmp = state->orig;
|
---|
4944 |
|
---|
4945 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
4946 | &ndr_table_winreg,
|
---|
4947 | NDR_WINREG_SAVEKEYEX,
|
---|
4948 | &state->tmp);
|
---|
4949 | if (tevent_req_nomem(subreq, req)) {
|
---|
4950 | return tevent_req_post(req, ev);
|
---|
4951 | }
|
---|
4952 | tevent_req_set_callback(subreq, rpccli_winreg_SaveKeyEx_done, req);
|
---|
4953 | return req;
|
---|
4954 | }
|
---|
4955 |
|
---|
4956 | static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq)
|
---|
4957 | {
|
---|
4958 | struct tevent_req *req = tevent_req_callback_data(
|
---|
4959 | subreq, struct tevent_req);
|
---|
4960 | struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
|
---|
4961 | req, struct rpccli_winreg_SaveKeyEx_state);
|
---|
4962 | NTSTATUS status;
|
---|
4963 | TALLOC_CTX *mem_ctx;
|
---|
4964 |
|
---|
4965 | if (state->out_mem_ctx) {
|
---|
4966 | mem_ctx = state->out_mem_ctx;
|
---|
4967 | } else {
|
---|
4968 | mem_ctx = state;
|
---|
4969 | }
|
---|
4970 |
|
---|
4971 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
4972 | TALLOC_FREE(subreq);
|
---|
4973 | if (!NT_STATUS_IS_OK(status)) {
|
---|
4974 | tevent_req_nterror(req, status);
|
---|
4975 | return;
|
---|
4976 | }
|
---|
4977 |
|
---|
4978 | /* Copy out parameters */
|
---|
4979 |
|
---|
4980 | /* Copy result */
|
---|
4981 | state->orig.out.result = state->tmp.out.result;
|
---|
4982 |
|
---|
4983 | /* Reset temporary structure */
|
---|
4984 | ZERO_STRUCT(state->tmp);
|
---|
4985 |
|
---|
4986 | tevent_req_done(req);
|
---|
4987 | }
|
---|
4988 |
|
---|
4989 | NTSTATUS rpccli_winreg_SaveKeyEx_recv(struct tevent_req *req,
|
---|
4990 | TALLOC_CTX *mem_ctx,
|
---|
4991 | WERROR *result)
|
---|
4992 | {
|
---|
4993 | struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
|
---|
4994 | req, struct rpccli_winreg_SaveKeyEx_state);
|
---|
4995 | NTSTATUS status;
|
---|
4996 |
|
---|
4997 | if (tevent_req_is_nterror(req, &status)) {
|
---|
4998 | tevent_req_received(req);
|
---|
4999 | return status;
|
---|
5000 | }
|
---|
5001 |
|
---|
5002 | /* Steal possbile out parameters to the callers context */
|
---|
5003 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5004 |
|
---|
5005 | /* Return result */
|
---|
5006 | *result = state->orig.out.result;
|
---|
5007 |
|
---|
5008 | tevent_req_received(req);
|
---|
5009 | return NT_STATUS_OK;
|
---|
5010 | }
|
---|
5011 |
|
---|
5012 | NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
|
---|
5013 | TALLOC_CTX *mem_ctx,
|
---|
5014 | WERROR *werror)
|
---|
5015 | {
|
---|
5016 | struct winreg_SaveKeyEx r;
|
---|
5017 | NTSTATUS status;
|
---|
5018 |
|
---|
5019 | /* In parameters */
|
---|
5020 |
|
---|
5021 | status = cli->dispatch(cli,
|
---|
5022 | mem_ctx,
|
---|
5023 | &ndr_table_winreg,
|
---|
5024 | NDR_WINREG_SAVEKEYEX,
|
---|
5025 | &r);
|
---|
5026 |
|
---|
5027 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5028 | return status;
|
---|
5029 | }
|
---|
5030 |
|
---|
5031 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5032 | return status;
|
---|
5033 | }
|
---|
5034 |
|
---|
5035 | /* Return variables */
|
---|
5036 |
|
---|
5037 | /* Return result */
|
---|
5038 | if (werror) {
|
---|
5039 | *werror = r.out.result;
|
---|
5040 | }
|
---|
5041 |
|
---|
5042 | return werror_to_ntstatus(r.out.result);
|
---|
5043 | }
|
---|
5044 |
|
---|
5045 | struct rpccli_winreg_OpenHKPT_state {
|
---|
5046 | struct winreg_OpenHKPT orig;
|
---|
5047 | struct winreg_OpenHKPT tmp;
|
---|
5048 | TALLOC_CTX *out_mem_ctx;
|
---|
5049 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5050 | };
|
---|
5051 |
|
---|
5052 | static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq);
|
---|
5053 |
|
---|
5054 | struct tevent_req *rpccli_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
|
---|
5055 | struct tevent_context *ev,
|
---|
5056 | struct rpc_pipe_client *cli,
|
---|
5057 | uint16_t *_system_name /* [in] [unique] */,
|
---|
5058 | uint32_t _access_mask /* [in] */,
|
---|
5059 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
5060 | {
|
---|
5061 | struct tevent_req *req;
|
---|
5062 | struct rpccli_winreg_OpenHKPT_state *state;
|
---|
5063 | struct tevent_req *subreq;
|
---|
5064 |
|
---|
5065 | req = tevent_req_create(mem_ctx, &state,
|
---|
5066 | struct rpccli_winreg_OpenHKPT_state);
|
---|
5067 | if (req == NULL) {
|
---|
5068 | return NULL;
|
---|
5069 | }
|
---|
5070 | state->out_mem_ctx = NULL;
|
---|
5071 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5072 |
|
---|
5073 | /* In parameters */
|
---|
5074 | state->orig.in.system_name = _system_name;
|
---|
5075 | state->orig.in.access_mask = _access_mask;
|
---|
5076 |
|
---|
5077 | /* Out parameters */
|
---|
5078 | state->orig.out.handle = _handle;
|
---|
5079 |
|
---|
5080 | /* Result */
|
---|
5081 | ZERO_STRUCT(state->orig.out.result);
|
---|
5082 |
|
---|
5083 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
5084 | "rpccli_winreg_OpenHKPT_out_memory");
|
---|
5085 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
5086 | return tevent_req_post(req, ev);
|
---|
5087 | }
|
---|
5088 |
|
---|
5089 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5090 | state->tmp = state->orig;
|
---|
5091 |
|
---|
5092 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5093 | &ndr_table_winreg,
|
---|
5094 | NDR_WINREG_OPENHKPT,
|
---|
5095 | &state->tmp);
|
---|
5096 | if (tevent_req_nomem(subreq, req)) {
|
---|
5097 | return tevent_req_post(req, ev);
|
---|
5098 | }
|
---|
5099 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPT_done, req);
|
---|
5100 | return req;
|
---|
5101 | }
|
---|
5102 |
|
---|
5103 | static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq)
|
---|
5104 | {
|
---|
5105 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5106 | subreq, struct tevent_req);
|
---|
5107 | struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
|
---|
5108 | req, struct rpccli_winreg_OpenHKPT_state);
|
---|
5109 | NTSTATUS status;
|
---|
5110 | TALLOC_CTX *mem_ctx;
|
---|
5111 |
|
---|
5112 | if (state->out_mem_ctx) {
|
---|
5113 | mem_ctx = state->out_mem_ctx;
|
---|
5114 | } else {
|
---|
5115 | mem_ctx = state;
|
---|
5116 | }
|
---|
5117 |
|
---|
5118 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5119 | TALLOC_FREE(subreq);
|
---|
5120 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5121 | tevent_req_nterror(req, status);
|
---|
5122 | return;
|
---|
5123 | }
|
---|
5124 |
|
---|
5125 | /* Copy out parameters */
|
---|
5126 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
5127 |
|
---|
5128 | /* Copy result */
|
---|
5129 | state->orig.out.result = state->tmp.out.result;
|
---|
5130 |
|
---|
5131 | /* Reset temporary structure */
|
---|
5132 | ZERO_STRUCT(state->tmp);
|
---|
5133 |
|
---|
5134 | tevent_req_done(req);
|
---|
5135 | }
|
---|
5136 |
|
---|
5137 | NTSTATUS rpccli_winreg_OpenHKPT_recv(struct tevent_req *req,
|
---|
5138 | TALLOC_CTX *mem_ctx,
|
---|
5139 | WERROR *result)
|
---|
5140 | {
|
---|
5141 | struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
|
---|
5142 | req, struct rpccli_winreg_OpenHKPT_state);
|
---|
5143 | NTSTATUS status;
|
---|
5144 |
|
---|
5145 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5146 | tevent_req_received(req);
|
---|
5147 | return status;
|
---|
5148 | }
|
---|
5149 |
|
---|
5150 | /* Steal possbile out parameters to the callers context */
|
---|
5151 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5152 |
|
---|
5153 | /* Return result */
|
---|
5154 | *result = state->orig.out.result;
|
---|
5155 |
|
---|
5156 | tevent_req_received(req);
|
---|
5157 | return NT_STATUS_OK;
|
---|
5158 | }
|
---|
5159 |
|
---|
5160 | NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli,
|
---|
5161 | TALLOC_CTX *mem_ctx,
|
---|
5162 | uint16_t *system_name /* [in] [unique] */,
|
---|
5163 | uint32_t access_mask /* [in] */,
|
---|
5164 | struct policy_handle *handle /* [out] [ref] */,
|
---|
5165 | WERROR *werror)
|
---|
5166 | {
|
---|
5167 | struct winreg_OpenHKPT r;
|
---|
5168 | NTSTATUS status;
|
---|
5169 |
|
---|
5170 | /* In parameters */
|
---|
5171 | r.in.system_name = system_name;
|
---|
5172 | r.in.access_mask = access_mask;
|
---|
5173 |
|
---|
5174 | status = cli->dispatch(cli,
|
---|
5175 | mem_ctx,
|
---|
5176 | &ndr_table_winreg,
|
---|
5177 | NDR_WINREG_OPENHKPT,
|
---|
5178 | &r);
|
---|
5179 |
|
---|
5180 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5181 | return status;
|
---|
5182 | }
|
---|
5183 |
|
---|
5184 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5185 | return status;
|
---|
5186 | }
|
---|
5187 |
|
---|
5188 | /* Return variables */
|
---|
5189 | *handle = *r.out.handle;
|
---|
5190 |
|
---|
5191 | /* Return result */
|
---|
5192 | if (werror) {
|
---|
5193 | *werror = r.out.result;
|
---|
5194 | }
|
---|
5195 |
|
---|
5196 | return werror_to_ntstatus(r.out.result);
|
---|
5197 | }
|
---|
5198 |
|
---|
5199 | struct rpccli_winreg_OpenHKPN_state {
|
---|
5200 | struct winreg_OpenHKPN orig;
|
---|
5201 | struct winreg_OpenHKPN tmp;
|
---|
5202 | TALLOC_CTX *out_mem_ctx;
|
---|
5203 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5204 | };
|
---|
5205 |
|
---|
5206 | static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq);
|
---|
5207 |
|
---|
5208 | struct tevent_req *rpccli_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
|
---|
5209 | struct tevent_context *ev,
|
---|
5210 | struct rpc_pipe_client *cli,
|
---|
5211 | uint16_t *_system_name /* [in] [unique] */,
|
---|
5212 | uint32_t _access_mask /* [in] */,
|
---|
5213 | struct policy_handle *_handle /* [out] [ref] */)
|
---|
5214 | {
|
---|
5215 | struct tevent_req *req;
|
---|
5216 | struct rpccli_winreg_OpenHKPN_state *state;
|
---|
5217 | struct tevent_req *subreq;
|
---|
5218 |
|
---|
5219 | req = tevent_req_create(mem_ctx, &state,
|
---|
5220 | struct rpccli_winreg_OpenHKPN_state);
|
---|
5221 | if (req == NULL) {
|
---|
5222 | return NULL;
|
---|
5223 | }
|
---|
5224 | state->out_mem_ctx = NULL;
|
---|
5225 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5226 |
|
---|
5227 | /* In parameters */
|
---|
5228 | state->orig.in.system_name = _system_name;
|
---|
5229 | state->orig.in.access_mask = _access_mask;
|
---|
5230 |
|
---|
5231 | /* Out parameters */
|
---|
5232 | state->orig.out.handle = _handle;
|
---|
5233 |
|
---|
5234 | /* Result */
|
---|
5235 | ZERO_STRUCT(state->orig.out.result);
|
---|
5236 |
|
---|
5237 | state->out_mem_ctx = talloc_named_const(state, 0,
|
---|
5238 | "rpccli_winreg_OpenHKPN_out_memory");
|
---|
5239 | if (tevent_req_nomem(state->out_mem_ctx, req)) {
|
---|
5240 | return tevent_req_post(req, ev);
|
---|
5241 | }
|
---|
5242 |
|
---|
5243 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5244 | state->tmp = state->orig;
|
---|
5245 |
|
---|
5246 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5247 | &ndr_table_winreg,
|
---|
5248 | NDR_WINREG_OPENHKPN,
|
---|
5249 | &state->tmp);
|
---|
5250 | if (tevent_req_nomem(subreq, req)) {
|
---|
5251 | return tevent_req_post(req, ev);
|
---|
5252 | }
|
---|
5253 | tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPN_done, req);
|
---|
5254 | return req;
|
---|
5255 | }
|
---|
5256 |
|
---|
5257 | static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq)
|
---|
5258 | {
|
---|
5259 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5260 | subreq, struct tevent_req);
|
---|
5261 | struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
|
---|
5262 | req, struct rpccli_winreg_OpenHKPN_state);
|
---|
5263 | NTSTATUS status;
|
---|
5264 | TALLOC_CTX *mem_ctx;
|
---|
5265 |
|
---|
5266 | if (state->out_mem_ctx) {
|
---|
5267 | mem_ctx = state->out_mem_ctx;
|
---|
5268 | } else {
|
---|
5269 | mem_ctx = state;
|
---|
5270 | }
|
---|
5271 |
|
---|
5272 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5273 | TALLOC_FREE(subreq);
|
---|
5274 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5275 | tevent_req_nterror(req, status);
|
---|
5276 | return;
|
---|
5277 | }
|
---|
5278 |
|
---|
5279 | /* Copy out parameters */
|
---|
5280 | *state->orig.out.handle = *state->tmp.out.handle;
|
---|
5281 |
|
---|
5282 | /* Copy result */
|
---|
5283 | state->orig.out.result = state->tmp.out.result;
|
---|
5284 |
|
---|
5285 | /* Reset temporary structure */
|
---|
5286 | ZERO_STRUCT(state->tmp);
|
---|
5287 |
|
---|
5288 | tevent_req_done(req);
|
---|
5289 | }
|
---|
5290 |
|
---|
5291 | NTSTATUS rpccli_winreg_OpenHKPN_recv(struct tevent_req *req,
|
---|
5292 | TALLOC_CTX *mem_ctx,
|
---|
5293 | WERROR *result)
|
---|
5294 | {
|
---|
5295 | struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
|
---|
5296 | req, struct rpccli_winreg_OpenHKPN_state);
|
---|
5297 | NTSTATUS status;
|
---|
5298 |
|
---|
5299 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5300 | tevent_req_received(req);
|
---|
5301 | return status;
|
---|
5302 | }
|
---|
5303 |
|
---|
5304 | /* Steal possbile out parameters to the callers context */
|
---|
5305 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5306 |
|
---|
5307 | /* Return result */
|
---|
5308 | *result = state->orig.out.result;
|
---|
5309 |
|
---|
5310 | tevent_req_received(req);
|
---|
5311 | return NT_STATUS_OK;
|
---|
5312 | }
|
---|
5313 |
|
---|
5314 | NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli,
|
---|
5315 | TALLOC_CTX *mem_ctx,
|
---|
5316 | uint16_t *system_name /* [in] [unique] */,
|
---|
5317 | uint32_t access_mask /* [in] */,
|
---|
5318 | struct policy_handle *handle /* [out] [ref] */,
|
---|
5319 | WERROR *werror)
|
---|
5320 | {
|
---|
5321 | struct winreg_OpenHKPN r;
|
---|
5322 | NTSTATUS status;
|
---|
5323 |
|
---|
5324 | /* In parameters */
|
---|
5325 | r.in.system_name = system_name;
|
---|
5326 | r.in.access_mask = access_mask;
|
---|
5327 |
|
---|
5328 | status = cli->dispatch(cli,
|
---|
5329 | mem_ctx,
|
---|
5330 | &ndr_table_winreg,
|
---|
5331 | NDR_WINREG_OPENHKPN,
|
---|
5332 | &r);
|
---|
5333 |
|
---|
5334 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5335 | return status;
|
---|
5336 | }
|
---|
5337 |
|
---|
5338 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5339 | return status;
|
---|
5340 | }
|
---|
5341 |
|
---|
5342 | /* Return variables */
|
---|
5343 | *handle = *r.out.handle;
|
---|
5344 |
|
---|
5345 | /* Return result */
|
---|
5346 | if (werror) {
|
---|
5347 | *werror = r.out.result;
|
---|
5348 | }
|
---|
5349 |
|
---|
5350 | return werror_to_ntstatus(r.out.result);
|
---|
5351 | }
|
---|
5352 |
|
---|
5353 | struct rpccli_winreg_QueryMultipleValues2_state {
|
---|
5354 | struct winreg_QueryMultipleValues2 orig;
|
---|
5355 | struct winreg_QueryMultipleValues2 tmp;
|
---|
5356 | TALLOC_CTX *out_mem_ctx;
|
---|
5357 | NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
|
---|
5358 | };
|
---|
5359 |
|
---|
5360 | static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq);
|
---|
5361 |
|
---|
5362 | struct tevent_req *rpccli_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
|
---|
5363 | struct tevent_context *ev,
|
---|
5364 | struct rpc_pipe_client *cli)
|
---|
5365 | {
|
---|
5366 | struct tevent_req *req;
|
---|
5367 | struct rpccli_winreg_QueryMultipleValues2_state *state;
|
---|
5368 | struct tevent_req *subreq;
|
---|
5369 |
|
---|
5370 | req = tevent_req_create(mem_ctx, &state,
|
---|
5371 | struct rpccli_winreg_QueryMultipleValues2_state);
|
---|
5372 | if (req == NULL) {
|
---|
5373 | return NULL;
|
---|
5374 | }
|
---|
5375 | state->out_mem_ctx = NULL;
|
---|
5376 | state->dispatch_recv = cli->dispatch_recv;
|
---|
5377 |
|
---|
5378 | /* In parameters */
|
---|
5379 |
|
---|
5380 | /* Out parameters */
|
---|
5381 |
|
---|
5382 | /* Result */
|
---|
5383 | ZERO_STRUCT(state->orig.out.result);
|
---|
5384 |
|
---|
5385 | /* make a temporary copy, that we pass to the dispatch function */
|
---|
5386 | state->tmp = state->orig;
|
---|
5387 |
|
---|
5388 | subreq = cli->dispatch_send(state, ev, cli,
|
---|
5389 | &ndr_table_winreg,
|
---|
5390 | NDR_WINREG_QUERYMULTIPLEVALUES2,
|
---|
5391 | &state->tmp);
|
---|
5392 | if (tevent_req_nomem(subreq, req)) {
|
---|
5393 | return tevent_req_post(req, ev);
|
---|
5394 | }
|
---|
5395 | tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues2_done, req);
|
---|
5396 | return req;
|
---|
5397 | }
|
---|
5398 |
|
---|
5399 | static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq)
|
---|
5400 | {
|
---|
5401 | struct tevent_req *req = tevent_req_callback_data(
|
---|
5402 | subreq, struct tevent_req);
|
---|
5403 | struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
|
---|
5404 | req, struct rpccli_winreg_QueryMultipleValues2_state);
|
---|
5405 | NTSTATUS status;
|
---|
5406 | TALLOC_CTX *mem_ctx;
|
---|
5407 |
|
---|
5408 | if (state->out_mem_ctx) {
|
---|
5409 | mem_ctx = state->out_mem_ctx;
|
---|
5410 | } else {
|
---|
5411 | mem_ctx = state;
|
---|
5412 | }
|
---|
5413 |
|
---|
5414 | status = state->dispatch_recv(subreq, mem_ctx);
|
---|
5415 | TALLOC_FREE(subreq);
|
---|
5416 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5417 | tevent_req_nterror(req, status);
|
---|
5418 | return;
|
---|
5419 | }
|
---|
5420 |
|
---|
5421 | /* Copy out parameters */
|
---|
5422 |
|
---|
5423 | /* Copy result */
|
---|
5424 | state->orig.out.result = state->tmp.out.result;
|
---|
5425 |
|
---|
5426 | /* Reset temporary structure */
|
---|
5427 | ZERO_STRUCT(state->tmp);
|
---|
5428 |
|
---|
5429 | tevent_req_done(req);
|
---|
5430 | }
|
---|
5431 |
|
---|
5432 | NTSTATUS rpccli_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
|
---|
5433 | TALLOC_CTX *mem_ctx,
|
---|
5434 | WERROR *result)
|
---|
5435 | {
|
---|
5436 | struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
|
---|
5437 | req, struct rpccli_winreg_QueryMultipleValues2_state);
|
---|
5438 | NTSTATUS status;
|
---|
5439 |
|
---|
5440 | if (tevent_req_is_nterror(req, &status)) {
|
---|
5441 | tevent_req_received(req);
|
---|
5442 | return status;
|
---|
5443 | }
|
---|
5444 |
|
---|
5445 | /* Steal possbile out parameters to the callers context */
|
---|
5446 | talloc_steal(mem_ctx, state->out_mem_ctx);
|
---|
5447 |
|
---|
5448 | /* Return result */
|
---|
5449 | *result = state->orig.out.result;
|
---|
5450 |
|
---|
5451 | tevent_req_received(req);
|
---|
5452 | return NT_STATUS_OK;
|
---|
5453 | }
|
---|
5454 |
|
---|
5455 | NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli,
|
---|
5456 | TALLOC_CTX *mem_ctx,
|
---|
5457 | WERROR *werror)
|
---|
5458 | {
|
---|
5459 | struct winreg_QueryMultipleValues2 r;
|
---|
5460 | NTSTATUS status;
|
---|
5461 |
|
---|
5462 | /* In parameters */
|
---|
5463 |
|
---|
5464 | status = cli->dispatch(cli,
|
---|
5465 | mem_ctx,
|
---|
5466 | &ndr_table_winreg,
|
---|
5467 | NDR_WINREG_QUERYMULTIPLEVALUES2,
|
---|
5468 | &r);
|
---|
5469 |
|
---|
5470 | if (!NT_STATUS_IS_OK(status)) {
|
---|
5471 | return status;
|
---|
5472 | }
|
---|
5473 |
|
---|
5474 | if (NT_STATUS_IS_ERR(status)) {
|
---|
5475 | return status;
|
---|
5476 | }
|
---|
5477 |
|
---|
5478 | /* Return variables */
|
---|
5479 |
|
---|
5480 | /* Return result */
|
---|
5481 | if (werror) {
|
---|
5482 | *werror = r.out.result;
|
---|
5483 | }
|
---|
5484 |
|
---|
5485 | return werror_to_ntstatus(r.out.result);
|
---|
5486 | }
|
---|
5487 |
|
---|