summaryrefslogtreecommitdiff
path: root/source3/rpc_client/ndr.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-07-15 20:50:06 -0400
committerSimo Sorce <idra@samba.org>2010-07-15 20:50:06 -0400
commit2f249538ac8f2a54d9c8f8dbf0107db2f33bfe16 (patch)
tree00eb61080648488e0d4d5e370f4d30827f4e9228 /source3/rpc_client/ndr.c
parent0ab8e8be62bcbb1f6441f745736fcee7cbd559eb (diff)
parent5f8678f34be57ccbbf9d9c93ee34b1d8f09c75c4 (diff)
downloadsamba-2f249538ac8f2a54d9c8f8dbf0107db2f33bfe16.tar.gz
samba-2f249538ac8f2a54d9c8f8dbf0107db2f33bfe16.tar.bz2
samba-2f249538ac8f2a54d9c8f8dbf0107db2f33bfe16.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/rpc_client/ndr.c')
-rw-r--r--source3/rpc_client/ndr.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c
index 8e03f2e015..a1642c03ff 100644
--- a/source3/rpc_client/ndr.c
+++ b/source3/rpc_client/ndr.c
@@ -24,7 +24,8 @@
struct cli_do_rpc_ndr_state {
const struct ndr_interface_call *call;
- prs_struct q_ps, r_ps;
+ DATA_BLOB q_pdu;
+ DATA_BLOB r_pdu;
void *r;
};
@@ -40,9 +41,7 @@ struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req, *subreq;
struct cli_do_rpc_ndr_state *state;
struct ndr_push *push;
- DATA_BLOB blob;
enum ndr_err_code ndr_err;
- bool ret;
req = tevent_req_create(mem_ctx, &state,
struct cli_do_rpc_ndr_state);
@@ -64,7 +63,7 @@ struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx,
state->call->name, NDR_IN, r);
}
- push = ndr_push_init_ctx(talloc_tos());
+ push = ndr_push_init_ctx(state);
if (tevent_req_nomem(push, req)) {
return tevent_req_post(req, ev);
}
@@ -76,16 +75,11 @@ struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- blob = ndr_push_blob(push);
- ret = prs_init_data_blob(&state->q_ps, &blob, state);
+ state->q_pdu = ndr_push_blob(push);
+ talloc_steal(mem_ctx, state->q_pdu.data);
TALLOC_FREE(push);
- if (!ret) {
- tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
- return tevent_req_post(req, ev);
- }
-
- subreq = rpc_api_pipe_req_send(state, ev, cli, opnum, &state->q_ps);
+ subreq = rpc_api_pipe_req_send(state, ev, cli, opnum, &state->q_pdu);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
@@ -101,7 +95,7 @@ static void cli_do_rpc_ndr_done(struct tevent_req *subreq)
req, struct cli_do_rpc_ndr_state);
NTSTATUS status;
- status = rpc_api_pipe_req_recv(subreq, state, &state->r_ps);
+ status = rpc_api_pipe_req_recv(subreq, state, &state->r_pdu);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);
@@ -117,19 +111,12 @@ NTSTATUS cli_do_rpc_ndr_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
struct ndr_pull *pull;
enum ndr_err_code ndr_err;
NTSTATUS status;
- DATA_BLOB blob;
- bool ret;
if (tevent_req_is_nterror(req, &status)) {
return status;
}
- ret = prs_data_blob(&state->r_ps, &blob, talloc_tos());
- if (!ret) {
- return NT_STATUS_NO_MEMORY;
- }
-
- pull = ndr_pull_init_blob(&blob, mem_ctx);
+ pull = ndr_pull_init_blob(&state->r_pdu, mem_ctx);
if (pull == NULL) {
return NT_STATUS_NO_MEMORY;
}