From e181b889784e6aed47e2fcc86add736d0b04daf2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 8 Nov 2009 19:38:01 +0100 Subject: Revert "s3: Do not reference ndr_table_ in the cli_ routines directly" This reverts commit daa964013bc5d036f4da571ce22c0052ef40943a. --- source3/include/client.h | 4 +- source3/include/proto.h | 16 ++----- source3/librpc/gen_ndr/cli_wbint.c | 92 ++++++++++++++++++------------------ source3/librpc/gen_ndr/srv_wbint.c | 2 +- source3/librpc/gen_ndr/srv_wbint.h | 2 +- source3/rpc_client/ndr.c | 21 ++------ source3/rpc_server/srv_pipe_hnd.c | 3 +- source3/winbindd/winbindd_dual_ndr.c | 11 ++--- 8 files changed, 63 insertions(+), 88 deletions(-) (limited to 'source3') diff --git a/source3/include/client.h b/source3/include/client.h index 3b3931bb6b..82d94b055f 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -123,14 +123,14 @@ struct rpc_pipe_client { NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const char *interface, uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r); struct tevent_req *(*dispatch_send)( TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const char *interface, uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r); NTSTATUS (*dispatch_recv)(struct tevent_req *req, diff --git a/source3/include/proto.h b/source3/include/proto.h index a0355732e7..8ee5591e05 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5310,13 +5310,8 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host, NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path, const struct ndr_syntax_id *abstract_syntax, struct rpc_pipe_client **presult); -NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, - const struct ndr_syntax_id *abstract_syntax, - NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *interface, - uint32_t interface_version, - uint32_t opnum, void *r), +NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax, + NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r), struct auth_serversupplied_info *serversupplied_info, struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, @@ -5639,15 +5634,14 @@ void init_samr_CryptPassword(const char *pwd, struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const char *interface, - uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r); NTSTATUS cli_do_rpc_ndr_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx); NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const char *interface, uint32_t interface_version, - uint32_t opnum, void *r); + const struct ndr_interface_table *table, + uint32 opnum, void *r); /* The following definitions come from rpc_parse/parse_misc.c */ diff --git a/source3/librpc/gen_ndr/cli_wbint.c b/source3/librpc/gen_ndr/cli_wbint.c index 9b64375b95..3115a20d9d 100644 --- a/source3/librpc/gen_ndr/cli_wbint.c +++ b/source3/librpc/gen_ndr/cli_wbint.c @@ -49,7 +49,7 @@ struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_PING, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -122,7 +122,7 @@ NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_PING, &r); @@ -191,7 +191,7 @@ struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPSID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -275,7 +275,7 @@ NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPSID, &r); @@ -348,7 +348,7 @@ struct tevent_req *rpccli_wbint_LookupName_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPNAME, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -434,7 +434,7 @@ NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPNAME, &r); @@ -502,7 +502,7 @@ struct tevent_req *rpccli_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SID2UID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -584,7 +584,7 @@ NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SID2UID, &r); @@ -651,7 +651,7 @@ struct tevent_req *rpccli_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SID2GID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -733,7 +733,7 @@ NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SID2GID, &r); @@ -800,7 +800,7 @@ struct tevent_req *rpccli_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_UID2SID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -882,7 +882,7 @@ NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_UID2SID, &r); @@ -949,7 +949,7 @@ struct tevent_req *rpccli_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_GID2SID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1031,7 +1031,7 @@ NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_GID2SID, &r); @@ -1094,7 +1094,7 @@ struct tevent_req *rpccli_wbint_AllocateUid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_ALLOCATEUID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1172,7 +1172,7 @@ NTSTATUS rpccli_wbint_AllocateUid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_ALLOCATEUID, &r); @@ -1235,7 +1235,7 @@ struct tevent_req *rpccli_wbint_AllocateGid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_ALLOCATEGID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1313,7 +1313,7 @@ NTSTATUS rpccli_wbint_AllocateGid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_ALLOCATEGID, &r); @@ -1378,7 +1378,7 @@ struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYUSER, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1458,7 +1458,7 @@ NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYUSER, &r); @@ -1523,7 +1523,7 @@ struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPUSERALIASES, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1603,7 +1603,7 @@ NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPUSERALIASES, &r); @@ -1668,7 +1668,7 @@ struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPUSERGROUPS, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1748,7 +1748,7 @@ NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPUSERGROUPS, &r); @@ -1811,7 +1811,7 @@ struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYSEQUENCENUMBER, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1889,7 +1889,7 @@ NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYSEQUENCENUMBER, &r); @@ -1956,7 +1956,7 @@ struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPGROUPMEMBERS, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2038,7 +2038,7 @@ NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPGROUPMEMBERS, &r); @@ -2101,7 +2101,7 @@ struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYUSERLIST, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2179,7 +2179,7 @@ NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYUSERLIST, &r); @@ -2242,7 +2242,7 @@ struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYGROUPLIST, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2320,7 +2320,7 @@ NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_QUERYGROUPLIST, &r); @@ -2391,7 +2391,7 @@ struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_DSGETDCNAME, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2477,7 +2477,7 @@ NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_DSGETDCNAME, &r); @@ -2542,7 +2542,7 @@ struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPRIDS, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2622,7 +2622,7 @@ NTSTATUS rpccli_wbint_LookupRids(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_LOOKUPRIDS, &r); @@ -2677,7 +2677,7 @@ struct tevent_req *rpccli_wbint_CheckMachineAccount_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_CHECKMACHINEACCOUNT, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2753,7 +2753,7 @@ NTSTATUS rpccli_wbint_CheckMachineAccount(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_CHECKMACHINEACCOUNT, &r); @@ -2807,7 +2807,7 @@ struct tevent_req *rpccli_wbint_ChangeMachineAccount_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_CHANGEMACHINEACCOUNT, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2883,7 +2883,7 @@ NTSTATUS rpccli_wbint_ChangeMachineAccount(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_CHANGEMACHINEACCOUNT, &r); @@ -2943,7 +2943,7 @@ struct tevent_req *rpccli_wbint_SetMapping_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SETMAPPING, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -3025,7 +3025,7 @@ NTSTATUS rpccli_wbint_SetMapping(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SETMAPPING, &r); @@ -3085,7 +3085,7 @@ struct tevent_req *rpccli_wbint_RemoveMapping_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_REMOVEMAPPING, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -3167,7 +3167,7 @@ NTSTATUS rpccli_wbint_RemoveMapping(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_REMOVEMAPPING, &r); @@ -3225,7 +3225,7 @@ struct tevent_req *rpccli_wbint_SetHWM_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SETHWM, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -3305,7 +3305,7 @@ NTSTATUS rpccli_wbint_SetHWM(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - NDR_WBINT_UUID, NDR_WBINT_VERSION, + &ndr_table_wbint, NDR_WBINT_SETHWM, &r); diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c index 08a346a3f6..0f39cd93e1 100644 --- a/source3/librpc/gen_ndr/srv_wbint.c +++ b/source3/librpc/gen_ndr/srv_wbint.c @@ -1864,7 +1864,7 @@ void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns) *n_fns = sizeof(api_wbint_cmds) / sizeof(struct api_struct); } -NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *interface, uint32_t interface_version, uint32_t opnum, void *_r) +NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r) { if (cli->pipes_struct == NULL) { return NT_STATUS_INVALID_PARAMETER; diff --git a/source3/librpc/gen_ndr/srv_wbint.h b/source3/librpc/gen_ndr/srv_wbint.h index 1e7f15ecec..c8c04fb3cc 100644 --- a/source3/librpc/gen_ndr/srv_wbint.h +++ b/source3/librpc/gen_ndr/srv_wbint.h @@ -25,7 +25,7 @@ NTSTATUS _wbint_SetMapping(pipes_struct *p, struct wbint_SetMapping *r); NTSTATUS _wbint_RemoveMapping(pipes_struct *p, struct wbint_RemoveMapping *r); NTSTATUS _wbint_SetHWM(pipes_struct *p, struct wbint_SetHWM *r); void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *interface, uint32_t interface_version, uint32_t opnum, void *r); +NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r); void _wbint_Ping(pipes_struct *p, struct wbint_Ping *r); NTSTATUS _wbint_LookupSid(pipes_struct *p, struct wbint_LookupSid *r); NTSTATUS _wbint_LookupName(pipes_struct *p, struct wbint_LookupName *r); diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c index 1db6ff7290..6433a7d196 100644 --- a/source3/rpc_client/ndr.c +++ b/source3/rpc_client/ndr.c @@ -33,15 +33,12 @@ static void cli_do_rpc_ndr_done(struct tevent_req *subreq); struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const char *interface, - uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r) { struct tevent_req *req, *subreq; struct cli_do_rpc_ndr_state *state; - struct ndr_syntax_id syntax; - const struct ndr_interface_table *table; struct ndr_push *push; DATA_BLOB blob; enum ndr_err_code ndr_err; @@ -53,17 +50,6 @@ struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx, return NULL; } - if (!ndr_syntax_from_string(interface, interface_version, &syntax)) { - tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); - return tevent_req_post(req, ev); - } - - table = get_iface_from_syntax(&syntax); - if (table == NULL) { - tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); - return tevent_req_post(req, ev); - } - if (!ndr_syntax_id_equal(&table->syntax_id, &cli->abstract_syntax) || (opnum >= table->num_calls)) { tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); @@ -170,7 +156,7 @@ NTSTATUS cli_do_rpc_ndr_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx) NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const char *interface, uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r) { TALLOC_CTX *frame = talloc_stackframe(); @@ -184,8 +170,7 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, goto fail; } - req = cli_do_rpc_ndr_send(frame, ev, cli, interface, interface_version, - opnum, r); + req = cli_do_rpc_ndr_send(frame, ev, cli, table, opnum, r); if (req == NULL) { status = NT_STATUS_NO_MEMORY; goto fail; diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 254241c743..5d5eb0eeb1 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -1464,8 +1464,7 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax, NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const char *interface, - uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r), struct auth_serversupplied_info *serversupplied_info, struct rpc_pipe_client **presult) diff --git a/source3/winbindd/winbindd_dual_ndr.c b/source3/winbindd/winbindd_dual_ndr.c index eb018aa87e..8a23ce48e0 100644 --- a/source3/winbindd/winbindd_dual_ndr.c +++ b/source3/winbindd/winbindd_dual_ndr.c @@ -51,8 +51,7 @@ static void wb_ndr_dispatch_done(struct tevent_req *subreq); static struct tevent_req *wb_ndr_dispatch_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const char *interface, - uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r) { @@ -70,7 +69,7 @@ static struct tevent_req *wb_ndr_dispatch_send(TALLOC_CTX *mem_ctx, } state->r = r; - state->call = &ndr_table_wbint.calls[opnum]; + state->call = &table->calls[opnum]; state->transport = transport; state->opnum = opnum; @@ -168,8 +167,7 @@ static NTSTATUS wb_ndr_dispatch_recv(struct tevent_req *req, static NTSTATUS wb_ndr_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const char *interface, - uint32_t interface_version, + const struct ndr_interface_table *table, uint32_t opnum, void *r) { TALLOC_CTX *frame = talloc_stackframe(); @@ -183,8 +181,7 @@ static NTSTATUS wb_ndr_dispatch(struct rpc_pipe_client *cli, goto fail; } - req = wb_ndr_dispatch_send(frame, ev, cli, interface, - interface_version, opnum, r); + req = wb_ndr_dispatch_send(frame, ev, cli, table, opnum, r); if (req == NULL) { status = NT_STATUS_NO_MEMORY; goto fail; -- cgit