uint16_t *surrounding;/* [size_is(x)] */
};
+struct echo_BytePipe;
+struct echo_BytePipe_chunk {
+ uint32_t count;
+ uint8_t *array;
+};
+
struct echo_AddOne {
struct {
};
+
+struct echo_BytePipeIn {
+ struct {
+ uint32_t value;
+ struct echo_BytePipe *bp;/* [ref] */
+ } in;
+
+ struct {
+ uint32_t result;
+ } out;
+
+};
+
#endif /* _HEADER_rpcecho */
#endif /* _PIDL_HEADER_rpcecho */
ndr->depth--;
}
+static enum ndr_err_code ndr_push_echo_BytePipe_chunk(struct ndr_push *ndr, int ndr_flags, const struct echo_BytePipe_chunk *r)
+{
+ NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 5));
+ NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->array, r->count));
+ NDR_CHECK(ndr_push_trailer_align(ndr, 5));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+
+ NDR_CHECK(ndr_push_pipe_chunk_trailer(ndr, ndr_flags, r->count));
+
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_echo_BytePipe_chunk(struct ndr_pull *ndr, int ndr_flags, struct echo_BytePipe_chunk *r)
+{
+ uint32_t size_array_0 = 0;
+ NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 5));
+ NDR_CHECK(ndr_pull_uint3264(ndr, NDR_SCALARS, &r->count));
+ size_array_0 = r->count;
+ NDR_PULL_ALLOC_N(ndr, r->array, size_array_0);
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->array, size_array_0));
+ NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+
+ NDR_CHECK(ndr_check_pipe_chunk_trailer(ndr, ndr_flags, r->count));
+
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_echo_BytePipe_chunk(struct ndr_print *ndr, const char *name, const struct echo_BytePipe_chunk *r)
+{
+ ndr_print_struct(ndr, name, "echo_BytePipe_chunk");
+ if (r == NULL) { ndr_print_null(ndr); return; }
+ ndr->depth++;
+ ndr_print_uint3264(ndr, "count", r->count);
+ ndr_print_array_uint8(ndr, "array", r->array, r->count);
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const struct echo_AddOne *r)
{
NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
ndr->depth--;
}
+static enum ndr_err_code ndr_push_echo_BytePipeIn(struct ndr_push *ndr, int flags, const struct echo_BytePipeIn *r)
+{
+ NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.value));
+ }
+ if (flags & NDR_OUT) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result));
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_echo_BytePipeIn(struct ndr_pull *ndr, int flags, struct echo_BytePipeIn *r)
+{
+ NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.value));
+ }
+ if (flags & NDR_OUT) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result));
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_echo_BytePipeIn(struct ndr_print *ndr, const char *name, int flags, const struct echo_BytePipeIn *r)
+{
+ ndr_print_struct(ndr, name, "echo_BytePipeIn");
+ if (r == NULL) { ndr_print_null(ndr); return; }
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "echo_BytePipeIn");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "value", r->in.value);
+ ndr_print_ptr(ndr, "bp", r->in.bp);
+ ndr->depth++;
+ ndr->depth--;
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "echo_BytePipeIn");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "result", r->out.result);
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
+static const struct ndr_interface_call_pipe echo_BytePipeIn_in_pipes[] = {
+ {
+ "in.bp",
+ "echo_BytePipe_chunk",
+ sizeof(struct echo_BytePipe_chunk),
+ (ndr_push_flags_fn_t) ndr_push_echo_BytePipe_chunk,
+ (ndr_pull_flags_fn_t) ndr_pull_echo_BytePipe_chunk,
+ (ndr_print_fn_t) ndr_print_echo_BytePipe_chunk,
+ },
+ { NULL, NULL, 0, NULL, NULL, NULL }
+};
+
static const struct ndr_interface_call rpcecho_calls[] = {
{
"echo_AddOne",
{ 0, NULL },
{ 0, NULL },
},
+ {
+ "echo_BytePipeIn",
+ sizeof(struct echo_BytePipeIn),
+ (ndr_push_flags_fn_t) ndr_push_echo_BytePipeIn,
+ (ndr_pull_flags_fn_t) ndr_pull_echo_BytePipeIn,
+ (ndr_print_function_t) ndr_print_echo_BytePipeIn,
+ { 1, echo_BytePipeIn_in_pipes },
+ { 0, NULL },
+ },
{ NULL, 0, NULL, NULL, NULL }
};
NDR_RPCECHO_VERSION
},
.helpstring = NDR_RPCECHO_HELPSTRING,
- .num_calls = 10,
+ .num_calls = 11,
.calls = rpcecho_calls,
.endpoints = &rpcecho_endpoints,
.authservices = &rpcecho_authservices
#define NDR_ECHO_TESTDOUBLEPOINTER (0x09)
-#define NDR_RPCECHO_CALL_COUNT (10)
+#define NDR_ECHO_BYTEPIPEIN (0x0a)
+
+#define NDR_RPCECHO_CALL_COUNT (11)
enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r);
enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r);
void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r);
void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r);
void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r);
void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r);
+void ndr_print_echo_BytePipe_chunk(struct ndr_print *ndr, const char *name, const struct echo_BytePipe_chunk *r);
void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r);
void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r);
void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r);
void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r);
void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r);
void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r);
+void ndr_print_echo_BytePipeIn(struct ndr_print *ndr, const char *name, int flags, const struct echo_BytePipeIn *r);
#endif /* _HEADER_NDR_rpcecho */
/* rpcecho - client functions generated by pidl */
+struct echo_BytePipe {
+ struct dcerpc_pipe_handle_connection *pc;
+};
+
+struct echo_BytePipe *dcerpc_echo_BytePipe_create(TALLOC_CTX *mem_ctx)
+{
+ struct echo_BytePipe *p;
+
+ p = talloc_zero(mem_ctx, struct echo_BytePipe);
+ if (p == NULL) {
+ return NULL;
+ }
+
+ /* the pipe is disconnected by default */
+ p->pc = dcerpc_pipe_handle_connection_create(p,
+ "echo_BytePipe_chunk",
+ sizeof(struct echo_BytePipe_chunk));
+ if (p->pc == NULL) {
+ TALLOC_FREE(p);
+ return NULL;
+ }
+
+ return p;
+}
+
+struct dcerpc_echo_BytePipe_chunk_push_state {
+ uint8_t dummy;
+};
+
+static void dcerpc_echo_BytePipe_chunk_push_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipe_chunk_push_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct echo_BytePipe *p,
+ const struct echo_BytePipe_chunk *chunk)
+{
+ struct tevent_req *req;
+ struct dcerpc_echo_BytePipe_chunk_push_state *state;
+ struct tevent_req *subreq;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct dcerpc_echo_BytePipe_chunk_push_state);
+ if (req == NULL) {
+ return NULL;
+ }
+
+ subreq = dcerpc_pipe_handle_push_send(state, ev,
+ p->pc, chunk);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, dcerpc_echo_BytePipe_chunk_push_done, req);
+
+ return req;
+}
+
+static void dcerpc_echo_BytePipe_chunk_push_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req =
+ tevent_req_callback_data(subreq,
+ struct tevent_req);
+ NTSTATUS status;
+
+ status = dcerpc_pipe_handle_push_recv(subreq);
+ TALLOC_FREE(subreq);
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
+
+ tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipe_chunk_push_recv(struct tevent_req *req)
+{
+ struct dcerpc_echo_BytePipe_chunk_push_state *state =
+ tevent_req_data(req,
+ struct dcerpc_echo_BytePipe_chunk_push_state);
+ NTSTATUS status;
+
+ if (tevent_req_is_nterror(req, &status)) {
+ /*
+ * We want the tevent_req_data() protection,
+ * but don't need 'state', so just pretend we use it
+ * in order to avoid compiler warnings.
+ */
+ state->dummy = 0;
+ tevent_req_received(req);
+ return status;
+ }
+
+ tevent_req_received(req);
+ return NT_STATUS_OK;
+}
+
+struct dcerpc_echo_BytePipe_chunk_pull_state {
+ struct echo_BytePipe_chunk *chunk;
+};
+
+static void dcerpc_echo_BytePipe_chunk_pull_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipe_chunk_pull_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct echo_BytePipe *p)
+{
+ struct tevent_req *req;
+ struct dcerpc_echo_BytePipe_chunk_pull_state *state;
+ struct tevent_req *subreq;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct dcerpc_echo_BytePipe_chunk_pull_state);
+ if (req == NULL) {
+ return NULL;
+ }
+ state->chunk = talloc_zero(state, struct echo_BytePipe_chunk);
+ if (tevent_req_nomem(state->chunk, req)) {
+ return tevent_req_post(req, ev);
+ }
+
+ subreq = dcerpc_pipe_handle_pull_send(state, ev,
+ p->pc, state->chunk, state->chunk);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, dcerpc_echo_BytePipe_chunk_pull_done, req);
+
+ return req;
+}
+
+static void dcerpc_echo_BytePipe_chunk_pull_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req =
+ tevent_req_callback_data(subreq,
+ struct tevent_req);
+ NTSTATUS status;
+
+ status = dcerpc_pipe_handle_pull_recv(subreq);
+ TALLOC_FREE(subreq);
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
+
+ tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipe_chunk_pull_recv(struct tevent_req *req,
+ TALLOC_CTX *mem_ctx,
+ struct echo_BytePipe_chunk **chunk)
+{
+ struct dcerpc_echo_BytePipe_chunk_pull_state *state =
+ tevent_req_data(req,
+ struct dcerpc_echo_BytePipe_chunk_pull_state);
+ NTSTATUS status;
+
+ if (tevent_req_is_nterror(req, &status)) {
+ tevent_req_received(req);
+ return status;
+ }
+
+ *chunk = talloc_move(mem_ctx, &state->chunk);
+
+ tevent_req_received(req);
+ return NT_STATUS_OK;
+}
+
struct dcerpc_echo_AddOne_r_state {
TALLOC_CTX *out_mem_ctx;
};
return NT_STATUS_OK;
}
+struct dcerpc_echo_BytePipeIn_r_state {
+ struct dcerpc_pipe_handle_connection *in_pipes[1];
+ struct dcerpc_binding_handle_call_params params;
+ TALLOC_CTX *out_mem_ctx;
+};
+
+static void dcerpc_echo_BytePipeIn_r_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipeIn_r_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h,
+ struct echo_BytePipeIn *r)
+{
+ struct tevent_req *req;
+ struct dcerpc_echo_BytePipeIn_r_state *state;
+ struct tevent_req *subreq;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct dcerpc_echo_BytePipeIn_r_state);
+ if (req == NULL) {
+ return NULL;
+ }
+
+ state->out_mem_ctx = NULL;
+
+ if (r->in.bp == NULL) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER_MIX);
+ return tevent_req_post(req, ev);
+ }
+ state->in_pipes[0] = r->in.bp->pc;
+ state->params.r_mem = state;
+ state->params.r_ptr = r;
+ state->params.in.num_pipes = 1;
+ state->params.in.pipes = state->in_pipes;
+ state->params.out.num_pipes = 0;
+ state->params.out.pipes = NULL;
+
+ subreq = dcerpc_binding_handle_call_params_send(state, ev, h,
+ NULL, &ndr_table_rpcecho,
+ NDR_ECHO_BYTEPIPEIN, &state->params);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, dcerpc_echo_BytePipeIn_r_done, req);
+
+ return req;
+}
+
+static void dcerpc_echo_BytePipeIn_r_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req =
+ tevent_req_callback_data(subreq,
+ struct tevent_req);
+ NTSTATUS status;
+
+ status = dcerpc_binding_handle_call_params_recv(subreq);
+ TALLOC_FREE(subreq);
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
+
+ tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipeIn_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
+{
+ struct dcerpc_echo_BytePipeIn_r_state *state =
+ tevent_req_data(req,
+ struct dcerpc_echo_BytePipeIn_r_state);
+ NTSTATUS status;
+
+ if (tevent_req_is_nterror(req, &status)) {
+ tevent_req_received(req);
+ return status;
+ }
+
+ talloc_steal(mem_ctx, state->out_mem_ctx);
+
+ tevent_req_received(req);
+ return NT_STATUS_OK;
+}
+
+struct dcerpc_echo_BytePipeIn_state {
+ struct echo_BytePipeIn orig;
+ struct echo_BytePipeIn tmp;
+ TALLOC_CTX *out_mem_ctx;
+};
+
+static void dcerpc_echo_BytePipeIn_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipeIn_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h,
+ uint32_t _value /* [in] */,
+ struct echo_BytePipe *_bp /* [in] [ref] */)
+{
+ struct tevent_req *req;
+ struct dcerpc_echo_BytePipeIn_state *state;
+ struct tevent_req *subreq;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct dcerpc_echo_BytePipeIn_state);
+ if (req == NULL) {
+ return NULL;
+ }
+ state->out_mem_ctx = NULL;
+
+ /* In parameters */
+ state->orig.in.value = _value;
+ state->orig.in.bp = _bp;
+
+ /* Out parameters */
+
+ /* Result */
+ ZERO_STRUCT(state->orig.out.result);
+
+ /* make a temporary copy, that we pass to the dispatch function */
+ state->tmp = state->orig;
+
+ subreq = dcerpc_echo_BytePipeIn_r_send(state, ev, h, &state->tmp);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, dcerpc_echo_BytePipeIn_done, req);
+ return req;
+}
+
+static void dcerpc_echo_BytePipeIn_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct dcerpc_echo_BytePipeIn_state *state = tevent_req_data(
+ req, struct dcerpc_echo_BytePipeIn_state);
+ NTSTATUS status;
+ TALLOC_CTX *mem_ctx;
+
+ if (state->out_mem_ctx) {
+ mem_ctx = state->out_mem_ctx;
+ } else {
+ mem_ctx = state;
+ }
+
+ status = dcerpc_echo_BytePipeIn_r_recv(subreq, mem_ctx);
+ TALLOC_FREE(subreq);
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
+
+ /* Copy out parameters */
+
+ /* Copy result */
+ state->orig.out.result = state->tmp.out.result;
+
+ /* Reset temporary structure */
+ ZERO_STRUCT(state->tmp);
+
+ tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipeIn_recv(struct tevent_req *req,
+ TALLOC_CTX *mem_ctx,
+ uint32_t *result)
+{
+ struct dcerpc_echo_BytePipeIn_state *state = tevent_req_data(
+ req, struct dcerpc_echo_BytePipeIn_state);
+ NTSTATUS status;
+
+ if (tevent_req_is_nterror(req, &status)) {
+ tevent_req_received(req);
+ return status;
+ }
+
+ /* Steal possible out parameters to the callers context */
+ talloc_steal(mem_ctx, state->out_mem_ctx);
+
+ /* Return result */
+ *result = state->orig.out.result;
+
+ tevent_req_received(req);
+ return NT_STATUS_OK;
+}
+
extern const struct ndr_interface_table ndr_table_rpcecho;
+/* echo_BytePipe */
+struct echo_BytePipe;
+struct echo_BytePipe *dcerpc_echo_BytePipe_create(TALLOC_CTX *mem_ctx);
+struct tevent_req *dcerpc_echo_BytePipe_chunk_push_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct echo_BytePipe *p,
+ const struct echo_BytePipe_chunk *chunk);
+NTSTATUS dcerpc_echo_BytePipe_chunk_push_recv(struct tevent_req *req);
+struct tevent_req *dcerpc_echo_BytePipe_chunk_pull_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct echo_BytePipe *p);
+NTSTATUS dcerpc_echo_BytePipe_chunk_pull_recv(struct tevent_req *req,
+ TALLOC_CTX *mem_ctx,
+ struct echo_BytePipe_chunk **chunk);
+
struct tevent_req *dcerpc_echo_AddOne_r_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct dcerpc_binding_handle *h,
uint16_t ***_data /* [in] [ref] */,
uint16_t *result);
+struct tevent_req *dcerpc_echo_BytePipeIn_r_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h,
+ struct echo_BytePipeIn *r);
+NTSTATUS dcerpc_echo_BytePipeIn_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+/*
+ * The following function is skipped because
+ * it uses pipes:
+ *
+ * dcerpc_echo_BytePipeIn_r()
+ */
+
+struct tevent_req *dcerpc_echo_BytePipeIn_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h,
+ uint32_t _value /* [in] */,
+ struct echo_BytePipe *_bp /* [in] [ref] */);
+NTSTATUS dcerpc_echo_BytePipeIn_recv(struct tevent_req *req,
+ TALLOC_CTX *mem_ctx,
+ uint32_t *result);
+/*
+ * The following function is skipped because
+ * it uses pipes:
+ *
+ * dcerpc_echo_BytePipeIn()
+ */
+
+
#endif /* _HEADER_RPC_rpcecho */
}
break;
}
+ case 10: {
+ struct echo_BytePipeIn *r2 = (struct echo_BytePipeIn *)r;
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_IN, r2);
+ }
+ r2->out.result = dcesrv_echo_BytePipeIn(dce_call, mem_ctx, r2);
+ if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
+ DEBUG(5,("function echo_BytePipeIn will reply async\n"));
+ }
+ break;
+ }
default:
dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
}
break;
}
+ case 10: {
+ struct echo_BytePipeIn *r2 = (struct echo_BytePipeIn *)r;
+ if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
+ DEBUG(5,("function echo_BytePipeIn replied async\n"));
+ }
+ if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
+ NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_OUT | NDR_SET_VALUES, r2);
+ }
+ if (dce_call->fault_code != 0) {
+ DEBUG(2,("dcerpc_fault %s in echo_BytePipeIn\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
+ }
+ break;
+ }
default:
dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
return true;
}
+static bool api_echo_BytePipeIn(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct echo_BytePipeIn *r;
+
+ call = &ndr_table_rpcecho.calls[NDR_ECHO_BYTEPIPEIN];
+
+ r = talloc(talloc_tos(), struct echo_BytePipeIn);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_IN, r);
+ }
+
+ r->out.result = _echo_BytePipeIn(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
/* Tables */
static struct api_struct api_rpcecho_cmds[] =
{"ECHO_TESTENUM", NDR_ECHO_TESTENUM, api_echo_TestEnum},
{"ECHO_TESTSURROUNDING", NDR_ECHO_TESTSURROUNDING, api_echo_TestSurrounding},
{"ECHO_TESTDOUBLEPOINTER", NDR_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer},
+ {"ECHO_BYTEPIPEIN", NDR_ECHO_BYTEPIPEIN, api_echo_BytePipeIn},
};
void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns)
void _echo_TestEnum(struct pipes_struct *p, struct echo_TestEnum *r);
void _echo_TestSurrounding(struct pipes_struct *p, struct echo_TestSurrounding *r);
uint16 _echo_TestDoublePointer(struct pipes_struct *p, struct echo_TestDoublePointer *r);
+uint32 _echo_BytePipeIn(struct pipes_struct *p, struct echo_BytePipeIn *r);
void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns);
struct rpc_srv_callbacks;
NTSTATUS rpc_rpcecho_init(const struct rpc_srv_callbacks *rpc_srv_cb);