1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3-dcerpc: Use DATA_BLOB instead of prs_struct for req_data

Signed-off-by: Günther Deschner <gd@samba.org>
This commit is contained in:
Simo Sorce 2010-07-15 08:48:51 -04:00 committed by Günther Deschner
parent 8e9cd4144e
commit 8f2bfa88b5
3 changed files with 11 additions and 19 deletions

View File

@ -4849,7 +4849,7 @@ struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct rpc_pipe_client *cli,
uint8_t op_num,
prs_struct *req_data);
DATA_BLOB *req_data);
NTSTATUS rpc_api_pipe_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
DATA_BLOB *reply_pdu);
struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,

View File

@ -2033,7 +2033,7 @@ struct rpc_api_pipe_req_state {
struct rpc_pipe_client *cli;
uint8_t op_num;
uint32_t call_id;
prs_struct *req_data;
DATA_BLOB *req_data;
uint32_t req_data_sent;
DATA_BLOB rpc_out;
DATA_BLOB reply_pdu;
@ -2048,7 +2048,7 @@ struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct rpc_pipe_client *cli,
uint8_t op_num,
prs_struct *req_data)
DATA_BLOB *req_data)
{
struct tevent_req *req, *subreq;
struct rpc_api_pipe_req_state *state;
@ -2122,7 +2122,7 @@ static NTSTATUS prepare_next_frag(struct rpc_api_pipe_req_state *state,
NTSTATUS status;
union dcerpc_payload u;
data_left = prs_offset(state->req_data) - state->req_data_sent;
data_left = state->req_data->length - state->req_data_sent;
data_sent_thistime = calculate_data_len_tosend(
state->cli, data_left, &frag_len, &auth_len, &ss_padding);
@ -2139,7 +2139,7 @@ static NTSTATUS prepare_next_frag(struct rpc_api_pipe_req_state *state,
ZERO_STRUCT(u.request);
u.request.alloc_hint = prs_offset(state->req_data);
u.request.alloc_hint = state->req_data->length;
u.request.context_id = 0;
u.request.opnum = state->op_num;
@ -2160,8 +2160,7 @@ static NTSTATUS prepare_next_frag(struct rpc_api_pipe_req_state *state,
/* Copy in the data, plus any ss padding. */
if (!data_blob_append(NULL, &state->rpc_out,
prs_data_p(state->req_data)
+ state->req_data_sent,
state->req_data->data + state->req_data_sent,
data_sent_thistime)) {
return NT_STATUS_NO_MEMORY;
}

View File

@ -24,7 +24,7 @@
struct cli_do_rpc_ndr_state {
const struct ndr_interface_call *call;
prs_struct q_ps;
DATA_BLOB q_pdu;
DATA_BLOB r_pdu;
void *r;
};
@ -41,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);
@ -65,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);
}
@ -77,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);
}