object = h->object;
}
+ if (state->ops->raw_call_in_send == NULL) {
+ if (in_flags & LIBNDR_FLAG_INCOMPLETE_BUFFER) {
+ tevent_req_nterror(req, NT_STATUS_RPC_CANNOT_SUPPORT);
+ return tevent_req_post(req, ev);
+ }
+ }
+
state->subreq = state->ops->raw_call_send(state, ev, h,
object, opnum,
in_flags, in_data, in_length);
goto fail;
}
+ if (in_flags & LIBNDR_FLAG_INCOMPLETE_BUFFER) {
+ talloc_free(frame);
+ return NT_STATUS_INVALID_PARAMETER_MIX;
+ }
+
subreq = dcerpc_binding_handle_raw_call_send(frame, ev,
h, object, opnum,
in_flags,
return status;
}
+struct dcerpc_binding_handle_raw_call_in_state {
+ const struct dcerpc_binding_handle_ops *ops;
+ struct tevent_context *ev;
+ struct tevent_req *subreq;
+};
+
+static void dcerpc_binding_handle_raw_call_in_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_binding_handle_raw_call_in_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct tevent_req *raw_call_req,
+ uint32_t in_flags,
+ const uint8_t *in_data,
+ size_t in_length)
+{
+ struct dcerpc_binding_handle_raw_call_state *raw_call_state =
+ tevent_req_data(raw_call_req,
+ struct dcerpc_binding_handle_raw_call_state);
+ struct tevent_req *req;
+ struct dcerpc_binding_handle_raw_call_in_state *state;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct dcerpc_binding_handle_raw_call_in_state);
+ if (req == NULL) {
+ return NULL;
+ }
+ state->ops = raw_call_state->ops;
+ state->ev = ev;
+
+ if (state->ev != raw_call_state->ev) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER_MIX);
+ return tevent_req_post(req, ev);
+ }
+
+ if (state->ops->raw_call_in_send == NULL) {
+ tevent_req_nterror(req, NT_STATUS_RPC_CANNOT_SUPPORT);
+ return tevent_req_post(req, ev);
+ }
+
+ state->subreq = state->ops->raw_call_in_send(state, ev,
+ raw_call_state->subreq,
+ in_flags,
+ in_data,
+ in_length);
+ if (tevent_req_nomem(state->subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+
+ tevent_req_set_callback(state->subreq,
+ dcerpc_binding_handle_raw_call_in_done,
+ req);
+ return req;
+}
+
+static void dcerpc_binding_handle_raw_call_in_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req =
+ tevent_req_callback_data(subreq,
+ struct tevent_req);
+
+ if (tevent_req_is_in_progress(subreq)) {
+ tevent_req_notify_callback(req);
+ return;
+ }
+
+ tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_binding_handle_raw_call_in_recv(struct tevent_req *req)
+{
+ struct dcerpc_binding_handle_raw_call_in_state *state =
+ tevent_req_data(req,
+ struct dcerpc_binding_handle_raw_call_in_state);
+ NTSTATUS error;
+
+ if (!tevent_req_is_in_progress(req)) {
+ if (tevent_req_is_nterror(req, &error)) {
+ tevent_req_received(req);
+ return error;
+ }
+ }
+
+ error = state->ops->raw_call_in_recv(state->subreq);
+ if (!NT_STATUS_IS_OK(error)) {
+ tevent_req_received(req);
+ return error;
+ }
+
+ if (tevent_req_is_in_progress(state->subreq)) {
+ return NT_STATUS_OK;
+ }
+
+ tevent_req_received(req);
+ return error;
+}
+
struct dcerpc_binding_handle_disconnect_state {
const struct dcerpc_binding_handle_ops *ops;
};
uint8_t **out_data,
size_t *out_length,
uint32_t *out_flags);
+ struct tevent_req *(*raw_call_in_send)(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct tevent_req *raw_call_req,
+ uint32_t in_flags,
+ const uint8_t *in_data,
+ size_t in_length);
+ NTSTATUS (*raw_call_in_recv)(struct tevent_req *req);
struct tevent_req *(*disconnect_send)(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
uint8_t **out_data,
size_t *out_length,
uint32_t *out_flags);
+struct tevent_req *dcerpc_binding_handle_raw_call_in_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct tevent_req *raw_call_req,
+ uint32_t in_flags,
+ const uint8_t *in_data,
+ size_t in_length);
+NTSTATUS dcerpc_binding_handle_raw_call_in_recv(struct tevent_req *req);
struct tevent_req *dcerpc_binding_handle_disconnect_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,