From 18a48df488f5fcf9b55abf61b09778bdc15373d7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 21 Aug 2007 12:20:33 +0000 Subject: r24594: pass down the ndr_interface_table in the samba3 client bindings instead of the pull and push functions metze (This used to be commit 5e3d4df9bca069708d72f548dc5ddfc7708ac122) --- source3/rpc_client/ndr.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c index 86d75ab024..c7044aa7d9 100644 --- a/source3/rpc_client/ndr.c +++ b/source3/rpc_client/ndr.c @@ -22,24 +22,29 @@ #include "includes.h" -NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - int p_idx, int opnum, void *data, - ndr_pull_flags_fn_t pull_fn, ndr_push_flags_fn_t push_fn) +NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, int p_idx, + const struct ndr_interface_table *table, + uint32 opnum, void *r) { prs_struct q_ps, r_ps; + const struct ndr_interface_call *call; struct ndr_pull *pull; DATA_BLOB blob; struct ndr_push *push; NTSTATUS status; SMB_ASSERT(cli->pipe_idx == p_idx); + SMB_ASSERT(table->num_calls > opnum); + + call = &table->calls[opnum]; push = ndr_push_init_ctx(mem_ctx); if (!push) { return NT_STATUS_NO_MEMORY; } - status = push_fn(push, NDR_IN, data); + status = call->ndr_push(push, NDR_IN, r); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -80,7 +85,7 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, /* have the ndr parser alloc memory for us */ pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = pull_fn(pull, NDR_OUT, data); + status = call->ndr_pull(pull, NDR_OUT, r); talloc_free(pull); if (!NT_STATUS_IS_OK(status)) { -- cgit