}
struct dcerpc_binding_handle_call_params_state {
+ struct tevent_context *ev;
struct dcerpc_binding_handle *h;
const struct ndr_interface_call *call;
struct dcerpc_binding_handle_call_params *params;
uint32_t out_pipe_idx;
};
+static void dcerpc_binding_handle_call_params_cleanup(struct tevent_req *req);
static void dcerpc_binding_handle_call_params_in_done(struct tevent_req *subreq);
static void dcerpc_binding_handle_call_params_next_pipe(struct tevent_req *req);
static void dcerpc_binding_handle_call_params_done(struct tevent_req *subreq);
return tevent_req_post(req, ev);
}
+ state->ev = ev;
state->h = h;
state->call = &table->calls[opnum];
state->params = params;
return tevent_req_post(req, ev);
}
+ tevent_req_defer_callback(req, ev);
+
/* setup for a ndr_push_* call */
state->push = ndr_push_init_ctx(state);
if (tevent_req_nomem(state->push, req)) {
}
if (state->in_flags & LIBNDR_FLAG_INCOMPLETE_BUFFER) {
- tevent_req_defer_callback(req, ev);
dcerpc_binding_handle_call_params_pipe_setup(req);
if (!tevent_req_is_in_progress(req)) {
return tevent_req_post(req, ev);
return req;
}
+static void dcerpc_binding_handle_call_params_cleanup(struct tevent_req *req)
+{
+ struct dcerpc_binding_handle_call_params_state *state =
+ tevent_req_data(req,
+ struct dcerpc_binding_handle_call_params_state);
+
+ dcerpc_pipe_handle_connection_disconnect(state->pc);
+ state->pc = NULL;
+ state->call_pipe = NULL;
+
+ tevent_req_post(req, state->ev);
+}
+
static void dcerpc_binding_handle_call_params_in_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(subreq,
error = dcerpc_binding_handle_raw_call_in_recv(subreq);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, error)) {
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
state->ph);
if (!ok) {
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER_MIX);
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
state->ph);
if (!ok) {
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER_MIX);
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
subreq = NULL;
if (!NT_STATUS_IS_OK(error)) {
TALLOC_FREE(state->subreq);
- dcerpc_pipe_handle_connection_disconnect(state->pc);
- state->pc = NULL;
- state->call_pipe = NULL;
tevent_req_nterror(req, error);
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
* this is a protocol error
*/
tevent_req_nterror(req, NT_STATUS_RPC_PROTOCOL_ERROR);
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
if (state->pull == NULL) {
state->pull = ndr_pull_init_blob(&state->response, state);
if (tevent_req_nomem(state->pull, req)) {
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
state->pull->flags = state->push->flags;
state->call);
}
tevent_req_nterror(req, error);
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
}
state->call);
}
tevent_req_nterror(req, error);
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
state->call);
if (!NT_STATUS_IS_OK(error)) {
tevent_req_nterror(req, error);
+ dcerpc_binding_handle_call_params_cleanup(req);
return;
}
}
// }
//}
- //ndr_err = ndr_pull_pop(call_state->pull);
+ ndr_err = ndr_pull_pop(call_state->pull);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
NTSTATUS error;
error = ndr_map_error2ntstatus(ndr_err);