diff options
author | Günther Deschner <gd@samba.org> | 2010-04-09 00:11:00 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-09 00:27:58 +0200 |
commit | e42d5b5ae3da7d7a32428c50c8f518eab2dfbf30 (patch) | |
tree | 3c0b9f393c25084e800286db6b2ac5baeb9ca82b /librpc/gen_ndr | |
parent | dc4bf5651ee466397ab51cacaf83b519b79da5f1 (diff) | |
download | samba-e42d5b5ae3da7d7a32428c50c8f518eab2dfbf30.tar.gz samba-e42d5b5ae3da7d7a32428c50c8f518eab2dfbf30.tar.xz samba-e42d5b5ae3da7d7a32428c50c8f518eab2dfbf30.zip |
s3: re-run make samba3-idl.
Guenther
Diffstat (limited to 'librpc/gen_ndr')
-rw-r--r-- | librpc/gen_ndr/cli_winreg.c | 150 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_winreg.h | 17 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_winreg.c | 89 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_winreg.h | 5 | ||||
-rw-r--r-- | librpc/gen_ndr/srv_winreg.c | 80 | ||||
-rw-r--r-- | librpc/gen_ndr/srv_winreg.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/winreg.h | 15 |
7 files changed, 356 insertions, 2 deletions
diff --git a/librpc/gen_ndr/cli_winreg.c b/librpc/gen_ndr/cli_winreg.c index 8ca72a90ca1..57e78a7cd27 100644 --- a/librpc/gen_ndr/cli_winreg.c +++ b/librpc/gen_ndr/cli_winreg.c @@ -5490,3 +5490,153 @@ NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } +struct rpccli_winreg_DeleteKeyEx_state { + struct winreg_DeleteKeyEx orig; + struct winreg_DeleteKeyEx tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_winreg_DeleteKeyEx_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_winreg_DeleteKeyEx_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct policy_handle *_handle /* [in] [ref] */, + struct winreg_String *_key /* [in] [ref] */, + uint32_t _access_mask /* [in] */, + uint32_t _reserved /* [in] */) +{ + struct tevent_req *req; + struct rpccli_winreg_DeleteKeyEx_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_winreg_DeleteKeyEx_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.handle = _handle; + state->orig.in.key = _key; + state->orig.in.access_mask = _access_mask; + state->orig.in.reserved = _reserved; + + /* Out parameters */ + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_winreg, + NDR_WINREG_DELETEKEYEX, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_winreg_DeleteKeyEx_done, req); + return req; +} + +static void rpccli_winreg_DeleteKeyEx_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_winreg_DeleteKeyEx_state *state = tevent_req_data( + req, struct rpccli_winreg_DeleteKeyEx_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + tevent_req_done(req); +} + +NTSTATUS rpccli_winreg_DeleteKeyEx_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + WERROR *result) +{ + struct rpccli_winreg_DeleteKeyEx_state *state = tevent_req_data( + req, struct rpccli_winreg_DeleteKeyEx_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_winreg_DeleteKeyEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *key /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t reserved /* [in] */, + WERROR *werror) +{ + struct winreg_DeleteKeyEx r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.key = key; + r.in.access_mask = access_mask; + r.in.reserved = reserved; + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_DELETEKEYEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} diff --git a/librpc/gen_ndr/cli_winreg.h b/librpc/gen_ndr/cli_winreg.h index 7bbc33cffde..670958e70c5 100644 --- a/librpc/gen_ndr/cli_winreg.h +++ b/librpc/gen_ndr/cli_winreg.h @@ -576,4 +576,21 @@ NTSTATUS rpccli_winreg_QueryMultipleValues2_recv(struct tevent_req *req, NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, WERROR *werror); +struct tevent_req *rpccli_winreg_DeleteKeyEx_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct policy_handle *_handle /* [in] [ref] */, + struct winreg_String *_key /* [in] [ref] */, + uint32_t _access_mask /* [in] */, + uint32_t _reserved /* [in] */); +NTSTATUS rpccli_winreg_DeleteKeyEx_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + WERROR *result); +NTSTATUS rpccli_winreg_DeleteKeyEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *key /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t reserved /* [in] */, + WERROR *werror); #endif /* __CLI_WINREG__ */ diff --git a/librpc/gen_ndr/ndr_winreg.c b/librpc/gen_ndr/ndr_winreg.c index 7088819dd04..fcb65d42f9c 100644 --- a/librpc/gen_ndr/ndr_winreg.c +++ b/librpc/gen_ndr/ndr_winreg.c @@ -4407,6 +4407,85 @@ _PUBLIC_ void ndr_print_winreg_QueryMultipleValues2(struct ndr_print *ndr, const ndr->depth--; } +static enum ndr_err_code ndr_push_winreg_DeleteKeyEx(struct ndr_push *ndr, int flags, const struct winreg_DeleteKeyEx *r) +{ + if (flags & NDR_IN) { + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + if (r->in.key == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.key)); + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_DeleteKeyEx(struct ndr_pull *ndr, int flags, struct winreg_DeleteKeyEx *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_key_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.key); + } + _mem_save_key_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.key, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.key)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_DeleteKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKeyEx *r) +{ + ndr_print_struct(ndr, name, "winreg_DeleteKeyEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_DeleteKeyEx"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "key", r->in.key); + ndr->depth++; + ndr_print_winreg_String(ndr, "key", r->in.key); + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "reserved", r->in.reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_DeleteKeyEx"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + static const struct ndr_interface_call winreg_calls[] = { { "winreg_OpenHKCR", @@ -4688,6 +4767,14 @@ static const struct ndr_interface_call winreg_calls[] = { (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues2, false, }, + { + "winreg_DeleteKeyEx", + sizeof(struct winreg_DeleteKeyEx), + (ndr_push_flags_fn_t) ndr_push_winreg_DeleteKeyEx, + (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteKeyEx, + (ndr_print_function_t) ndr_print_winreg_DeleteKeyEx, + false, + }, { NULL, 0, NULL, NULL, NULL, false } }; @@ -4719,7 +4806,7 @@ const struct ndr_interface_table ndr_table_winreg = { NDR_WINREG_VERSION }, .helpstring = NDR_WINREG_HELPSTRING, - .num_calls = 35, + .num_calls = 36, .calls = winreg_calls, .endpoints = &winreg_endpoints, .authservices = &winreg_authservices diff --git a/librpc/gen_ndr/ndr_winreg.h b/librpc/gen_ndr/ndr_winreg.h index 8bee4dad358..39f10e2ee6c 100644 --- a/librpc/gen_ndr/ndr_winreg.h +++ b/librpc/gen_ndr/ndr_winreg.h @@ -81,7 +81,9 @@ extern const struct ndr_interface_table ndr_table_winreg; #define NDR_WINREG_QUERYMULTIPLEVALUES2 (0x22) -#define NDR_WINREG_CALL_COUNT (35) +#define NDR_WINREG_DELETEKEYEX (0x23) + +#define NDR_WINREG_CALL_COUNT (36) void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *name, uint32_t r); enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r); enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r); @@ -160,4 +162,5 @@ void ndr_print_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name, int fla void ndr_print_winreg_OpenHKPT(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPT *r); void ndr_print_winreg_OpenHKPN(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPN *r); void ndr_print_winreg_QueryMultipleValues2(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues2 *r); +void ndr_print_winreg_DeleteKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKeyEx *r); #endif /* _HEADER_NDR_winreg */ diff --git a/librpc/gen_ndr/srv_winreg.c b/librpc/gen_ndr/srv_winreg.c index d0873f8d62b..b5b4adcd887 100644 --- a/librpc/gen_ndr/srv_winreg.c +++ b/librpc/gen_ndr/srv_winreg.c @@ -2719,6 +2719,79 @@ static bool api_winreg_QueryMultipleValues2(pipes_struct *p) return true; } +static bool api_winreg_DeleteKeyEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_DeleteKeyEx *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEYEX]; + + r = talloc(talloc_tos(), struct winreg_DeleteKeyEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_DeleteKeyEx, r); + } + + r->out.result = _winreg_DeleteKeyEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_DeleteKeyEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + /* Tables */ static struct api_struct api_winreg_cmds[] = @@ -2758,6 +2831,7 @@ static struct api_struct api_winreg_cmds[] = {"WINREG_OPENHKPT", NDR_WINREG_OPENHKPT, api_winreg_OpenHKPT}, {"WINREG_OPENHKPN", NDR_WINREG_OPENHKPN, api_winreg_OpenHKPN}, {"WINREG_QUERYMULTIPLEVALUES2", NDR_WINREG_QUERYMULTIPLEVALUES2, api_winreg_QueryMultipleValues2}, + {"WINREG_DELETEKEYEX", NDR_WINREG_DELETEKEYEX, api_winreg_DeleteKeyEx}, }; void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns) @@ -3122,6 +3196,12 @@ NTSTATUS rpc_winreg_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c return NT_STATUS_OK; } + case NDR_WINREG_DELETEKEYEX: { + struct winreg_DeleteKeyEx *r = (struct winreg_DeleteKeyEx *)_r; + r->out.result = _winreg_DeleteKeyEx(cli->pipes_struct, r); + return NT_STATUS_OK; + } + default: return NT_STATUS_NOT_IMPLEMENTED; } diff --git a/librpc/gen_ndr/srv_winreg.h b/librpc/gen_ndr/srv_winreg.h index f259150e5b7..9185b1bb476 100644 --- a/librpc/gen_ndr/srv_winreg.h +++ b/librpc/gen_ndr/srv_winreg.h @@ -36,6 +36,7 @@ WERROR _winreg_SaveKeyEx(pipes_struct *p, struct winreg_SaveKeyEx *r); WERROR _winreg_OpenHKPT(pipes_struct *p, struct winreg_OpenHKPT *r); WERROR _winreg_OpenHKPN(pipes_struct *p, struct winreg_OpenHKPN *r); WERROR _winreg_QueryMultipleValues2(pipes_struct *p, struct winreg_QueryMultipleValues2 *r); +WERROR _winreg_DeleteKeyEx(pipes_struct *p, struct winreg_DeleteKeyEx *r); void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns); NTSTATUS rpc_winreg_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r); WERROR _winreg_OpenHKCR(pipes_struct *p, struct winreg_OpenHKCR *r); @@ -73,5 +74,6 @@ WERROR _winreg_SaveKeyEx(pipes_struct *p, struct winreg_SaveKeyEx *r); WERROR _winreg_OpenHKPT(pipes_struct *p, struct winreg_OpenHKPT *r); WERROR _winreg_OpenHKPN(pipes_struct *p, struct winreg_OpenHKPN *r); WERROR _winreg_QueryMultipleValues2(pipes_struct *p, struct winreg_QueryMultipleValues2 *r); +WERROR _winreg_DeleteKeyEx(pipes_struct *p, struct winreg_DeleteKeyEx *r); NTSTATUS rpc_winreg_init(void); #endif /* __SRV_WINREG__ */ diff --git a/librpc/gen_ndr/winreg.h b/librpc/gen_ndr/winreg.h index 02596cdd8e0..aa05148583a 100644 --- a/librpc/gen_ndr/winreg.h +++ b/librpc/gen_ndr/winreg.h @@ -634,4 +634,19 @@ struct winreg_QueryMultipleValues2 { }; + +struct winreg_DeleteKeyEx { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String *key;/* [ref] */ + uint32_t access_mask; + uint32_t reserved; + } in; + + struct { + WERROR result; + } out; + +}; + #endif /* _HEADER_winreg */ |