From e5db7fee0f5cb3bd7434cdefebabc7a8376aa0d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 15 Sep 2006 22:49:27 +0000 Subject: r18572: Use the autogenerated client and server for the echo interface and implement some of the missing functions. RPC-ECHO now passes against Samba3. (This used to be commit 9e9a05366176454cc1779acc6c2b6070743f5939) --- source3/librpc/gen_ndr/srv_echo.c | 568 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 568 insertions(+) create mode 100644 source3/librpc/gen_ndr/srv_echo.c (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c new file mode 100644 index 0000000000..d3dc7b9e1f --- /dev/null +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -0,0 +1,568 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_echo.h" + +static BOOL api_echo_AddOne(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_AddOne r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_AddOne"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_AddOne(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.out_data = talloc_size(mem_ctx, sizeof(*r.out.out_data)); + if (r.out.out_data == NULL) { + talloc_free(mem_ctx); + return False; + } + + _echo_AddOne(p, r.in.in_data, r.out.out_data); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_AddOne(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_EchoData(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_EchoData r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_EchoData"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_EchoData(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.out_data = talloc_array_size(mem_ctx, sizeof(*r.out.out_data), r.in.len); + if (r.out.out_data == NULL) { + talloc_free(mem_ctx); + return False; + } + + _echo_EchoData(p, r.in.len, r.in.in_data, r.out.out_data); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_EchoData(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_SinkData(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_SinkData r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_SinkData"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_SinkData(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + _echo_SinkData(p, r.in.len, r.in.data); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_SinkData(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_SourceData(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_SourceData r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_SourceData"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_SourceData(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.data = talloc_array_size(mem_ctx, sizeof(*r.out.data), r.in.len); + if (r.out.data == NULL) { + talloc_free(mem_ctx); + return False; + } + + _echo_SourceData(p, r.in.len, r.out.data); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_SourceData(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_TestCall(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_TestCall r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestCall"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_TestCall(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.s2 = talloc_size(mem_ctx, sizeof(*r.out.s2)); + if (r.out.s2 == NULL) { + talloc_free(mem_ctx); + return False; + } + + _echo_TestCall(p, r.in.s1, r.out.s2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_TestCall(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_TestCall2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_TestCall2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestCall2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_TestCall2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.info = talloc_size(mem_ctx, sizeof(*r.out.info)); + if (r.out.info == NULL) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _echo_TestCall2(p, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_TestCall2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_TestSleep(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_TestSleep r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestSleep"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_TestSleep(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _echo_TestSleep(p, r.in.seconds); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_TestSleep(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_TestEnum(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_TestEnum r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestEnum"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_TestEnum(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.foo1 = r.in.foo1; + r.out.foo2 = r.in.foo2; + r.out.foo3 = r.in.foo3; + _echo_TestEnum(p, r.in.foo1, r.in.foo2, r.in.foo3); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_TestEnum(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_TestSurrounding(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_TestSurrounding r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestSurrounding"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_TestSurrounding(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.data = r.in.data; + _echo_TestSurrounding(p, r.in.data); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_TestSurrounding(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_echo_TestDoublePointer(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct echo_TestDoublePointer r; + TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestDoublePointer"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_echo_TestDoublePointer(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _echo_TestDoublePointer(p, r.in.data); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_echo_TestDoublePointer(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + + +/* Tables */ +static struct api_struct api_rpcecho_cmds[] = +{ + {"ECHO_ADDONE", DCERPC_ECHO_ADDONE, api_echo_AddOne}, + {"ECHO_ECHODATA", DCERPC_ECHO_ECHODATA, api_echo_EchoData}, + {"ECHO_SINKDATA", DCERPC_ECHO_SINKDATA, api_echo_SinkData}, + {"ECHO_SOURCEDATA", DCERPC_ECHO_SOURCEDATA, api_echo_SourceData}, + {"ECHO_TESTCALL", DCERPC_ECHO_TESTCALL, api_echo_TestCall}, + {"ECHO_TESTCALL2", DCERPC_ECHO_TESTCALL2, api_echo_TestCall2}, + {"ECHO_TESTSLEEP", DCERPC_ECHO_TESTSLEEP, api_echo_TestSleep}, + {"ECHO_TESTENUM", DCERPC_ECHO_TESTENUM, api_echo_TestEnum}, + {"ECHO_TESTSURROUNDING", DCERPC_ECHO_TESTSURROUNDING, api_echo_TestSurrounding}, + {"ECHO_TESTDOUBLEPOINTER", DCERPC_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer}, +}; + +void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_rpcecho_cmds; + *n_fns = sizeof(api_rpcecho_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_rpcecho_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct)); +} -- cgit From 8c79b4cbc152dd4df11d3916739bc851b6db2e86 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 19 Sep 2006 22:22:57 +0000 Subject: r18690: Regenerate RPC files after pidl changes. (This used to be commit 87d34305374e867eeac9d75d5d690c6b15570e6e) --- source3/librpc/gen_ndr/srv_echo.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index d3dc7b9e1f..578760358e 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -31,6 +31,7 @@ static BOOL api_echo_AddOne(pipes_struct *p) return False; } + ZERO_STRUCT(r.out); r.out.out_data = talloc_size(mem_ctx, sizeof(*r.out.out_data)); if (r.out.out_data == NULL) { talloc_free(mem_ctx); @@ -87,6 +88,7 @@ static BOOL api_echo_EchoData(pipes_struct *p) return False; } + ZERO_STRUCT(r.out); r.out.out_data = talloc_array_size(mem_ctx, sizeof(*r.out.out_data), r.in.len); if (r.out.out_data == NULL) { talloc_free(mem_ctx); @@ -193,6 +195,7 @@ static BOOL api_echo_SourceData(pipes_struct *p) return False; } + ZERO_STRUCT(r.out); r.out.data = talloc_array_size(mem_ctx, sizeof(*r.out.data), r.in.len); if (r.out.data == NULL) { talloc_free(mem_ctx); @@ -249,6 +252,7 @@ static BOOL api_echo_TestCall(pipes_struct *p) return False; } + ZERO_STRUCT(r.out); r.out.s2 = talloc_size(mem_ctx, sizeof(*r.out.s2)); if (r.out.s2 == NULL) { talloc_free(mem_ctx); @@ -305,6 +309,7 @@ static BOOL api_echo_TestCall2(pipes_struct *p) return False; } + ZERO_STRUCT(r.out); r.out.info = talloc_size(mem_ctx, sizeof(*r.out.info)); if (r.out.info == NULL) { talloc_free(mem_ctx); @@ -411,6 +416,7 @@ static BOOL api_echo_TestEnum(pipes_struct *p) return False; } + ZERO_STRUCT(r.out); r.out.foo1 = r.in.foo1; r.out.foo2 = r.in.foo2; r.out.foo3 = r.in.foo3; @@ -464,6 +470,7 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) return False; } + ZERO_STRUCT(r.out); r.out.data = r.in.data; _echo_TestSurrounding(p, r.in.data); -- cgit From e3068ef054b6c500e9d9be16ffebda5cb2402f3a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 19 Sep 2006 22:39:15 +0000 Subject: r18692: Dump debug data when DEBUGLEVEL >= 10 (This used to be commit 503d1a27d5838718355fdd37968c3670f53b1cd7) --- source3/librpc/gen_ndr/srv_echo.c | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 578760358e..5a313003ea 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -31,6 +31,9 @@ static BOOL api_echo_AddOne(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_AddOne, &r); + ZERO_STRUCT(r.out); r.out.out_data = talloc_size(mem_ctx, sizeof(*r.out.out_data)); if (r.out.out_data == NULL) { @@ -40,6 +43,9 @@ static BOOL api_echo_AddOne(pipes_struct *p) _echo_AddOne(p, r.in.in_data, r.out.out_data); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_AddOne, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -88,6 +94,9 @@ static BOOL api_echo_EchoData(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_EchoData, &r); + ZERO_STRUCT(r.out); r.out.out_data = talloc_array_size(mem_ctx, sizeof(*r.out.out_data), r.in.len); if (r.out.out_data == NULL) { @@ -97,6 +106,9 @@ static BOOL api_echo_EchoData(pipes_struct *p) _echo_EchoData(p, r.in.len, r.in.in_data, r.out.out_data); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_EchoData, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -145,8 +157,14 @@ static BOOL api_echo_SinkData(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_SinkData, &r); + _echo_SinkData(p, r.in.len, r.in.data); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_SinkData, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -195,6 +213,9 @@ static BOOL api_echo_SourceData(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_SourceData, &r); + ZERO_STRUCT(r.out); r.out.data = talloc_array_size(mem_ctx, sizeof(*r.out.data), r.in.len); if (r.out.data == NULL) { @@ -204,6 +225,9 @@ static BOOL api_echo_SourceData(pipes_struct *p) _echo_SourceData(p, r.in.len, r.out.data); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_SourceData, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -252,6 +276,9 @@ static BOOL api_echo_TestCall(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_TestCall, &r); + ZERO_STRUCT(r.out); r.out.s2 = talloc_size(mem_ctx, sizeof(*r.out.s2)); if (r.out.s2 == NULL) { @@ -261,6 +288,9 @@ static BOOL api_echo_TestCall(pipes_struct *p) _echo_TestCall(p, r.in.s1, r.out.s2); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_TestCall, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -309,6 +339,9 @@ static BOOL api_echo_TestCall2(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_TestCall2, &r); + ZERO_STRUCT(r.out); r.out.info = talloc_size(mem_ctx, sizeof(*r.out.info)); if (r.out.info == NULL) { @@ -318,6 +351,9 @@ static BOOL api_echo_TestCall2(pipes_struct *p) r.out.result = _echo_TestCall2(p, r.in.level, r.out.info); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -366,8 +402,14 @@ static BOOL api_echo_TestSleep(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_TestSleep, &r); + r.out.result = _echo_TestSleep(p, r.in.seconds); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -416,12 +458,18 @@ static BOOL api_echo_TestEnum(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_TestEnum, &r); + ZERO_STRUCT(r.out); r.out.foo1 = r.in.foo1; r.out.foo2 = r.in.foo2; r.out.foo3 = r.in.foo3; _echo_TestEnum(p, r.in.foo1, r.in.foo2, r.in.foo3); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -470,10 +518,16 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &r); + ZERO_STRUCT(r.out); r.out.data = r.in.data; _echo_TestSurrounding(p, r.in.data); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -522,8 +576,14 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r); + r.out.result = _echo_TestDoublePointer(p, r.in.data); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); -- cgit From 7cf3a10756a0b462d49235c91099312416319ae6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 19 Sep 2006 22:47:30 +0000 Subject: r18695: Zero initialize ref ptrs as well. (This used to be commit 3295122173b0794880e68ea60f51d41b9b170ff4) --- source3/librpc/gen_ndr/srv_echo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 5a313003ea..444c934bea 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -35,7 +35,7 @@ static BOOL api_echo_AddOne(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_AddOne, &r); ZERO_STRUCT(r.out); - r.out.out_data = talloc_size(mem_ctx, sizeof(*r.out.out_data)); + r.out.out_data = talloc_zero_size(mem_ctx, sizeof(*r.out.out_data)); if (r.out.out_data == NULL) { talloc_free(mem_ctx); return False; @@ -98,7 +98,7 @@ static BOOL api_echo_EchoData(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_EchoData, &r); ZERO_STRUCT(r.out); - r.out.out_data = talloc_array_size(mem_ctx, sizeof(*r.out.out_data), r.in.len); + r.out.out_data = talloc_zero_size(mem_ctx, sizeof(*r.out.out_data) * r.in.len); if (r.out.out_data == NULL) { talloc_free(mem_ctx); return False; @@ -217,7 +217,7 @@ static BOOL api_echo_SourceData(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_SourceData, &r); ZERO_STRUCT(r.out); - r.out.data = talloc_array_size(mem_ctx, sizeof(*r.out.data), r.in.len); + r.out.data = talloc_zero_size(mem_ctx, sizeof(*r.out.data) * r.in.len); if (r.out.data == NULL) { talloc_free(mem_ctx); return False; @@ -280,7 +280,7 @@ static BOOL api_echo_TestCall(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_TestCall, &r); ZERO_STRUCT(r.out); - r.out.s2 = talloc_size(mem_ctx, sizeof(*r.out.s2)); + r.out.s2 = talloc_zero_size(mem_ctx, sizeof(*r.out.s2)); if (r.out.s2 == NULL) { talloc_free(mem_ctx); return False; @@ -343,7 +343,7 @@ static BOOL api_echo_TestCall2(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_TestCall2, &r); ZERO_STRUCT(r.out); - r.out.info = talloc_size(mem_ctx, sizeof(*r.out.info)); + r.out.info = talloc_zero_size(mem_ctx, sizeof(*r.out.info)); if (r.out.info == NULL) { talloc_free(mem_ctx); return False; -- cgit From 6b0b563fa43ad4c7de3573dc7962a2698e140f72 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 10 Oct 2006 07:55:46 +0000 Subject: r19221: Monster-Checkin after "make idl" (This used to be commit 416466a16f58ac644baacaa2522c4e98176d0e70) --- source3/librpc/gen_ndr/srv_echo.c | 120 +++++++++++++++++++++++++++++++------- 1 file changed, 100 insertions(+), 20 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 444c934bea..e72d1eafe2 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -21,8 +21,10 @@ static BOOL api_echo_AddOne(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_AddOne(pull, NDR_IN, &r); @@ -43,6 +45,12 @@ static BOOL api_echo_AddOne(pipes_struct *p) _echo_AddOne(p, r.in.in_data, r.out.out_data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_AddOne, &r); @@ -59,7 +67,7 @@ static BOOL api_echo_AddOne(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -84,8 +92,10 @@ static BOOL api_echo_EchoData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_EchoData(pull, NDR_IN, &r); @@ -106,6 +116,12 @@ static BOOL api_echo_EchoData(pipes_struct *p) _echo_EchoData(p, r.in.len, r.in.in_data, r.out.out_data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_EchoData, &r); @@ -122,7 +138,7 @@ static BOOL api_echo_EchoData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -147,8 +163,10 @@ static BOOL api_echo_SinkData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_SinkData(pull, NDR_IN, &r); @@ -162,6 +180,12 @@ static BOOL api_echo_SinkData(pipes_struct *p) _echo_SinkData(p, r.in.len, r.in.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_SinkData, &r); @@ -178,7 +202,7 @@ static BOOL api_echo_SinkData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -203,8 +227,10 @@ static BOOL api_echo_SourceData(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_SourceData(pull, NDR_IN, &r); @@ -225,6 +251,12 @@ static BOOL api_echo_SourceData(pipes_struct *p) _echo_SourceData(p, r.in.len, r.out.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_SourceData, &r); @@ -241,7 +273,7 @@ static BOOL api_echo_SourceData(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -266,8 +298,10 @@ static BOOL api_echo_TestCall(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestCall(pull, NDR_IN, &r); @@ -288,6 +322,12 @@ static BOOL api_echo_TestCall(pipes_struct *p) _echo_TestCall(p, r.in.s1, r.out.s2); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestCall, &r); @@ -304,7 +344,7 @@ static BOOL api_echo_TestCall(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -329,8 +369,10 @@ static BOOL api_echo_TestCall2(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestCall2(pull, NDR_IN, &r); @@ -351,6 +393,12 @@ static BOOL api_echo_TestCall2(pipes_struct *p) r.out.result = _echo_TestCall2(p, r.in.level, r.out.info); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r); @@ -367,7 +415,7 @@ static BOOL api_echo_TestCall2(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -392,8 +440,10 @@ static BOOL api_echo_TestSleep(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestSleep(pull, NDR_IN, &r); @@ -407,6 +457,12 @@ static BOOL api_echo_TestSleep(pipes_struct *p) r.out.result = _echo_TestSleep(p, r.in.seconds); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r); @@ -423,7 +479,7 @@ static BOOL api_echo_TestSleep(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -448,8 +504,10 @@ static BOOL api_echo_TestEnum(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestEnum(pull, NDR_IN, &r); @@ -467,6 +525,12 @@ static BOOL api_echo_TestEnum(pipes_struct *p) r.out.foo3 = r.in.foo3; _echo_TestEnum(p, r.in.foo1, r.in.foo2, r.in.foo3); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r); @@ -483,7 +547,7 @@ static BOOL api_echo_TestEnum(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -508,8 +572,10 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestSurrounding(pull, NDR_IN, &r); @@ -525,6 +591,12 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) r.out.data = r.in.data; _echo_TestSurrounding(p, r.in.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r); @@ -541,7 +613,7 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } @@ -566,8 +638,10 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) } pull = ndr_pull_init_blob(&blob, mem_ctx); - if (pull == NULL) + if (pull == NULL) { + talloc_free(mem_ctx); return False; + } pull->flags |= LIBNDR_FLAG_REF_ALLOC; status = ndr_pull_echo_TestDoublePointer(pull, NDR_IN, &r); @@ -581,6 +655,12 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) r.out.result = _echo_TestDoublePointer(p, r.in.data); + if (p->rng_fault_state) { + talloc_free(mem_ctx); + /* Return True here, srv_pipe_hnd.c will take care */ + return True; + } + if (DEBUGLEVEL >= 10) NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r); @@ -597,7 +677,7 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) } blob = ndr_push_blob(push); - if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { talloc_free(mem_ctx); return False; } -- cgit From e2e7ad91a9aa3b8a1270e1148550fee9e3fedc79 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 16 Jan 2007 17:48:59 +0000 Subject: r20837: Use real type name, to fix compilation with -WC++-compat (This used to be commit 840485686d2b3765bd01fbe442f712803d1f4c0f) --- source3/librpc/gen_ndr/srv_echo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index e72d1eafe2..eb4cf894b8 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -37,7 +37,7 @@ static BOOL api_echo_AddOne(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_AddOne, &r); ZERO_STRUCT(r.out); - r.out.out_data = talloc_zero_size(mem_ctx, sizeof(*r.out.out_data)); + r.out.out_data = talloc_zero(mem_ctx, uint32_t); if (r.out.out_data == NULL) { talloc_free(mem_ctx); return False; @@ -108,7 +108,7 @@ static BOOL api_echo_EchoData(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_EchoData, &r); ZERO_STRUCT(r.out); - r.out.out_data = talloc_zero_size(mem_ctx, sizeof(*r.out.out_data) * r.in.len); + r.out.out_data = talloc_zero_array(mem_ctx, uint8_t, r.in.len); if (r.out.out_data == NULL) { talloc_free(mem_ctx); return False; @@ -243,7 +243,7 @@ static BOOL api_echo_SourceData(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_SourceData, &r); ZERO_STRUCT(r.out); - r.out.data = talloc_zero_size(mem_ctx, sizeof(*r.out.data) * r.in.len); + r.out.data = talloc_zero_array(mem_ctx, uint8_t, r.in.len); if (r.out.data == NULL) { talloc_free(mem_ctx); return False; @@ -314,7 +314,7 @@ static BOOL api_echo_TestCall(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_TestCall, &r); ZERO_STRUCT(r.out); - r.out.s2 = talloc_zero_size(mem_ctx, sizeof(*r.out.s2)); + r.out.s2 = talloc_zero(mem_ctx, const char *); if (r.out.s2 == NULL) { talloc_free(mem_ctx); return False; @@ -385,7 +385,7 @@ static BOOL api_echo_TestCall2(pipes_struct *p) NDR_PRINT_IN_DEBUG(echo_TestCall2, &r); ZERO_STRUCT(r.out); - r.out.info = talloc_zero_size(mem_ctx, sizeof(*r.out.info)); + r.out.info = talloc_zero(mem_ctx, union echo_Info); if (r.out.info == NULL) { talloc_free(mem_ctx); return False; -- cgit From d6b3fce078869de35334c0805ff141dc8bcf5f65 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 18 Jan 2007 10:18:59 +0000 Subject: r20875: Pass DCE/RPC server call arguments as a struct rather than as separate arguments. This makes it a bit more similar to the Samba4 code. (This used to be commit 0596badb410a58e7a715e2b17bc0bef0489a2448) --- source3/librpc/gen_ndr/srv_echo.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index eb4cf894b8..046f448040 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -43,7 +43,7 @@ static BOOL api_echo_AddOne(pipes_struct *p) return False; } - _echo_AddOne(p, r.in.in_data, r.out.out_data); + _echo_AddOne(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -114,7 +114,7 @@ static BOOL api_echo_EchoData(pipes_struct *p) return False; } - _echo_EchoData(p, r.in.len, r.in.in_data, r.out.out_data); + _echo_EchoData(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -178,7 +178,7 @@ static BOOL api_echo_SinkData(pipes_struct *p) if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(echo_SinkData, &r); - _echo_SinkData(p, r.in.len, r.in.data); + _echo_SinkData(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -249,7 +249,7 @@ static BOOL api_echo_SourceData(pipes_struct *p) return False; } - _echo_SourceData(p, r.in.len, r.out.data); + _echo_SourceData(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -320,7 +320,7 @@ static BOOL api_echo_TestCall(pipes_struct *p) return False; } - _echo_TestCall(p, r.in.s1, r.out.s2); + _echo_TestCall(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -391,7 +391,7 @@ static BOOL api_echo_TestCall2(pipes_struct *p) return False; } - r.out.result = _echo_TestCall2(p, r.in.level, r.out.info); + r.out.result = _echo_TestCall2(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -455,7 +455,7 @@ static BOOL api_echo_TestSleep(pipes_struct *p) if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(echo_TestSleep, &r); - r.out.result = _echo_TestSleep(p, r.in.seconds); + r.out.result = _echo_TestSleep(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -523,7 +523,7 @@ static BOOL api_echo_TestEnum(pipes_struct *p) r.out.foo1 = r.in.foo1; r.out.foo2 = r.in.foo2; r.out.foo3 = r.in.foo3; - _echo_TestEnum(p, r.in.foo1, r.in.foo2, r.in.foo3); + _echo_TestEnum(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -589,7 +589,7 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) ZERO_STRUCT(r.out); r.out.data = r.in.data; - _echo_TestSurrounding(p, r.in.data); + _echo_TestSurrounding(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -653,7 +653,7 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r); - r.out.result = _echo_TestDoublePointer(p, r.in.data); + r.out.result = _echo_TestDoublePointer(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); -- cgit From 8da26d3f96ac66e3f0be8aaec209867d3f285e49 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 22:10:11 +0000 Subject: r24561: merge from SAMBA_4_0: rename some DCERPC_ prefixes into NDR_ metze (This used to be commit 8f07b8ab658ae3d63487ca5fb20065318cdd9d0e) --- source3/librpc/gen_ndr/srv_echo.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 046f448040..298a4ba874 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -691,16 +691,16 @@ static BOOL api_echo_TestDoublePointer(pipes_struct *p) /* Tables */ static struct api_struct api_rpcecho_cmds[] = { - {"ECHO_ADDONE", DCERPC_ECHO_ADDONE, api_echo_AddOne}, - {"ECHO_ECHODATA", DCERPC_ECHO_ECHODATA, api_echo_EchoData}, - {"ECHO_SINKDATA", DCERPC_ECHO_SINKDATA, api_echo_SinkData}, - {"ECHO_SOURCEDATA", DCERPC_ECHO_SOURCEDATA, api_echo_SourceData}, - {"ECHO_TESTCALL", DCERPC_ECHO_TESTCALL, api_echo_TestCall}, - {"ECHO_TESTCALL2", DCERPC_ECHO_TESTCALL2, api_echo_TestCall2}, - {"ECHO_TESTSLEEP", DCERPC_ECHO_TESTSLEEP, api_echo_TestSleep}, - {"ECHO_TESTENUM", DCERPC_ECHO_TESTENUM, api_echo_TestEnum}, - {"ECHO_TESTSURROUNDING", DCERPC_ECHO_TESTSURROUNDING, api_echo_TestSurrounding}, - {"ECHO_TESTDOUBLEPOINTER", DCERPC_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer}, + {"ECHO_ADDONE", NDR_ECHO_ADDONE, api_echo_AddOne}, + {"ECHO_ECHODATA", NDR_ECHO_ECHODATA, api_echo_EchoData}, + {"ECHO_SINKDATA", NDR_ECHO_SINKDATA, api_echo_SinkData}, + {"ECHO_SOURCEDATA", NDR_ECHO_SOURCEDATA, api_echo_SourceData}, + {"ECHO_TESTCALL", NDR_ECHO_TESTCALL, api_echo_TestCall}, + {"ECHO_TESTCALL2", NDR_ECHO_TESTCALL2, api_echo_TestCall2}, + {"ECHO_TESTSLEEP", NDR_ECHO_TESTSLEEP, api_echo_TestSleep}, + {"ECHO_TESTENUM", NDR_ECHO_TESTENUM, api_echo_TestEnum}, + {"ECHO_TESTSURROUNDING", NDR_ECHO_TESTSURROUNDING, api_echo_TestSurrounding}, + {"ECHO_TESTDOUBLEPOINTER", NDR_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer}, }; void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns) -- cgit From 96567fa3ea92e5447b66a23514df392f1f7d353c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 21 Aug 2007 14:06:46 +0000 Subject: r24597: - talloc request structure for the samba3 server bindings and make that the primary context for the request which the implementations can also use. - go via functions pointers in the ndr_interface_table instead of calling functions directly. metze (This used to be commit 5c4d998300d0c9836eb3cc6c3cd8ee4f262396b8) --- source3/librpc/gen_ndr/srv_echo.c | 482 ++++++++++++++++++++++---------------- 1 file changed, 276 insertions(+), 206 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 298a4ba874..e5315ba9f7 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -8,681 +8,751 @@ static BOOL api_echo_AddOne(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_AddOne r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_AddOne"); + struct echo_AddOne *r; - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + call = &ndr_table_rpcecho.calls[NDR_ECHO_ADDONE]; + + r = talloc(NULL, struct echo_AddOne); + if (r == NULL) { return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return False; + } + + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_AddOne(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_AddOne, &r); + NDR_PRINT_IN_DEBUG(echo_AddOne, r); - ZERO_STRUCT(r.out); - r.out.out_data = talloc_zero(mem_ctx, uint32_t); - if (r.out.out_data == NULL) { - talloc_free(mem_ctx); + ZERO_STRUCT(r->out); + r->out.out_data = talloc_zero(r, uint32_t); + if (r->out.out_data == NULL) { + talloc_free(r); return False; } - _echo_AddOne(p, &r); + _echo_AddOne(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_AddOne, &r); + NDR_PRINT_OUT_DEBUG(echo_AddOne, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_AddOne(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_EchoData(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_EchoData r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_EchoData"); + struct echo_EchoData *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_ECHODATA]; - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + r = talloc(NULL, struct echo_EchoData); + if (r == NULL) { return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return False; + } + + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_EchoData(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_EchoData, &r); + NDR_PRINT_IN_DEBUG(echo_EchoData, r); - ZERO_STRUCT(r.out); - r.out.out_data = talloc_zero_array(mem_ctx, uint8_t, r.in.len); - if (r.out.out_data == NULL) { - talloc_free(mem_ctx); + ZERO_STRUCT(r->out); + r->out.out_data = talloc_zero_array(r, uint8_t, r->in.len); + if (r->out.out_data == NULL) { + talloc_free(r); return False; } - _echo_EchoData(p, &r); + _echo_EchoData(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_EchoData, &r); + NDR_PRINT_OUT_DEBUG(echo_EchoData, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_EchoData(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_SinkData(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_SinkData r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_SinkData"); + struct echo_SinkData *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_SINKDATA]; + + r = talloc(NULL, struct echo_SinkData); + if (r == NULL) { + return False; + } - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_SinkData(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_SinkData, &r); + NDR_PRINT_IN_DEBUG(echo_SinkData, r); - _echo_SinkData(p, &r); + _echo_SinkData(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_SinkData, &r); + NDR_PRINT_OUT_DEBUG(echo_SinkData, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_SinkData(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_SourceData(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_SourceData r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_SourceData"); + struct echo_SourceData *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_SOURCEDATA]; + + r = talloc(NULL, struct echo_SourceData); + if (r == NULL) { + return False; + } - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_SourceData(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_SourceData, &r); + NDR_PRINT_IN_DEBUG(echo_SourceData, r); - ZERO_STRUCT(r.out); - r.out.data = talloc_zero_array(mem_ctx, uint8_t, r.in.len); - if (r.out.data == NULL) { - talloc_free(mem_ctx); + ZERO_STRUCT(r->out); + r->out.data = talloc_zero_array(r, uint8_t, r->in.len); + if (r->out.data == NULL) { + talloc_free(r); return False; } - _echo_SourceData(p, &r); + _echo_SourceData(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_SourceData, &r); + NDR_PRINT_OUT_DEBUG(echo_SourceData, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_SourceData(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_TestCall(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_TestCall r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestCall"); + struct echo_TestCall *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL]; + + r = talloc(NULL, struct echo_TestCall); + if (r == NULL) { + return False; + } - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_TestCall(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_TestCall, &r); + NDR_PRINT_IN_DEBUG(echo_TestCall, r); - ZERO_STRUCT(r.out); - r.out.s2 = talloc_zero(mem_ctx, const char *); - if (r.out.s2 == NULL) { - talloc_free(mem_ctx); + ZERO_STRUCT(r->out); + r->out.s2 = talloc_zero(r, const char *); + if (r->out.s2 == NULL) { + talloc_free(r); return False; } - _echo_TestCall(p, &r); + _echo_TestCall(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_TestCall, &r); + NDR_PRINT_OUT_DEBUG(echo_TestCall, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_TestCall(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_TestCall2(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_TestCall2 r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestCall2"); + struct echo_TestCall2 *r; - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL2]; + + r = talloc(NULL, struct echo_TestCall2); + if (r == NULL) { return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return False; + } + + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_TestCall2(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_TestCall2, &r); + NDR_PRINT_IN_DEBUG(echo_TestCall2, r); - ZERO_STRUCT(r.out); - r.out.info = talloc_zero(mem_ctx, union echo_Info); - if (r.out.info == NULL) { - talloc_free(mem_ctx); + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union echo_Info); + if (r->out.info == NULL) { + talloc_free(r); return False; } - r.out.result = _echo_TestCall2(p, &r); + r->out.result = _echo_TestCall2(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r); + NDR_PRINT_OUT_DEBUG(echo_TestCall2, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_TestCall2(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_TestSleep(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_TestSleep r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestSleep"); + struct echo_TestSleep *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSLEEP]; - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + r = talloc(NULL, struct echo_TestSleep); + if (r == NULL) { return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return False; + } + + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_TestSleep(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_TestSleep, &r); + NDR_PRINT_IN_DEBUG(echo_TestSleep, r); - r.out.result = _echo_TestSleep(p, &r); + r->out.result = _echo_TestSleep(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r); + NDR_PRINT_OUT_DEBUG(echo_TestSleep, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_TestSleep(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_TestEnum(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_TestEnum r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestEnum"); + struct echo_TestEnum *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTENUM]; + + r = talloc(NULL, struct echo_TestEnum); + if (r == NULL) { + return False; + } - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_TestEnum(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_TestEnum, &r); + NDR_PRINT_IN_DEBUG(echo_TestEnum, r); - ZERO_STRUCT(r.out); - r.out.foo1 = r.in.foo1; - r.out.foo2 = r.in.foo2; - r.out.foo3 = r.in.foo3; - _echo_TestEnum(p, &r); + ZERO_STRUCT(r->out); + r->out.foo1 = r->in.foo1; + r->out.foo2 = r->in.foo2; + r->out.foo3 = r->in.foo3; + _echo_TestEnum(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r); + NDR_PRINT_OUT_DEBUG(echo_TestEnum, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_TestEnum(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_TestSurrounding(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_TestSurrounding r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestSurrounding"); + struct echo_TestSurrounding *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSURROUNDING]; + + r = talloc(NULL, struct echo_TestSurrounding); + if (r == NULL) { + return False; + } - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_TestSurrounding(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &r); + NDR_PRINT_IN_DEBUG(echo_TestSurrounding, r); - ZERO_STRUCT(r.out); - r.out.data = r.in.data; - _echo_TestSurrounding(p, &r); + ZERO_STRUCT(r->out); + r->out.data = r->in.data; + _echo_TestSurrounding(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r); + NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_TestSurrounding(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } static BOOL api_echo_TestDoublePointer(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct echo_TestDoublePointer r; - TALLOC_CTX *mem_ctx = talloc_init("api_echo_TestDoublePointer"); + struct echo_TestDoublePointer *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTDOUBLEPOINTER]; + + r = talloc(NULL, struct echo_TestDoublePointer); + if (r == NULL) { + return False; + } - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); return False; } - pull = ndr_pull_init_blob(&blob, mem_ctx); + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = ndr_pull_echo_TestDoublePointer(pull, NDR_IN, &r); + status = call->ndr_pull(pull, NDR_IN, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } if (DEBUGLEVEL >= 10) - NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r); + NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, r); - r.out.result = _echo_TestDoublePointer(p, &r); + r->out.result = _echo_TestDoublePointer(p, r); if (p->rng_fault_state) { - talloc_free(mem_ctx); + talloc_free(r); /* Return True here, srv_pipe_hnd.c will take care */ return True; } if (DEBUGLEVEL >= 10) - NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r); + NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, r); - push = ndr_push_init_ctx(mem_ctx); + push = ndr_push_init_ctx(r); if (push == NULL) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - status = ndr_push_echo_TestDoublePointer(push, NDR_OUT, &r); + status = call->ndr_push(push, NDR_OUT, r); if (NT_STATUS_IS_ERR(status)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } blob = ndr_push_blob(push); if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { - talloc_free(mem_ctx); + talloc_free(r); return False; } - talloc_free(mem_ctx); + talloc_free(r); return True; } -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/librpc/gen_ndr/srv_echo.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index e5315ba9f7..558988e14b 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -6,7 +6,7 @@ #include "includes.h" #include "librpc/gen_ndr/srv_echo.h" -static BOOL api_echo_AddOne(pipes_struct *p) +static bool api_echo_AddOne(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -84,7 +84,7 @@ static BOOL api_echo_AddOne(pipes_struct *p) return True; } -static BOOL api_echo_EchoData(pipes_struct *p) +static bool api_echo_EchoData(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -162,7 +162,7 @@ static BOOL api_echo_EchoData(pipes_struct *p) return True; } -static BOOL api_echo_SinkData(pipes_struct *p) +static bool api_echo_SinkData(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -233,7 +233,7 @@ static BOOL api_echo_SinkData(pipes_struct *p) return True; } -static BOOL api_echo_SourceData(pipes_struct *p) +static bool api_echo_SourceData(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -311,7 +311,7 @@ static BOOL api_echo_SourceData(pipes_struct *p) return True; } -static BOOL api_echo_TestCall(pipes_struct *p) +static bool api_echo_TestCall(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -389,7 +389,7 @@ static BOOL api_echo_TestCall(pipes_struct *p) return True; } -static BOOL api_echo_TestCall2(pipes_struct *p) +static bool api_echo_TestCall2(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -467,7 +467,7 @@ static BOOL api_echo_TestCall2(pipes_struct *p) return True; } -static BOOL api_echo_TestSleep(pipes_struct *p) +static bool api_echo_TestSleep(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -538,7 +538,7 @@ static BOOL api_echo_TestSleep(pipes_struct *p) return True; } -static BOOL api_echo_TestEnum(pipes_struct *p) +static bool api_echo_TestEnum(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -613,7 +613,7 @@ static BOOL api_echo_TestEnum(pipes_struct *p) return True; } -static BOOL api_echo_TestSurrounding(pipes_struct *p) +static bool api_echo_TestSurrounding(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -686,7 +686,7 @@ static BOOL api_echo_TestSurrounding(pipes_struct *p) return True; } -static BOOL api_echo_TestDoublePointer(pipes_struct *p) +static bool api_echo_TestDoublePointer(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; -- cgit From 08ace73dbbcef5543bbaee9ba7ee16a0bd42a395 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Nov 2007 14:38:47 +0100 Subject: rerun make idl metze (This used to be commit 53a636828d2ba01603401086f4a5f72f9b5ea214) --- source3/librpc/gen_ndr/srv_echo.c | 100 +++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 558988e14b..7e292985bc 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -11,7 +11,7 @@ static bool api_echo_AddOne(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_AddOne *r; @@ -34,8 +34,8 @@ static bool api_echo_AddOne(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -67,8 +67,8 @@ static bool api_echo_AddOne(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -89,7 +89,7 @@ static bool api_echo_EchoData(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_EchoData *r; @@ -112,8 +112,8 @@ static bool api_echo_EchoData(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -145,8 +145,8 @@ static bool api_echo_EchoData(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -167,7 +167,7 @@ static bool api_echo_SinkData(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_SinkData *r; @@ -190,8 +190,8 @@ static bool api_echo_SinkData(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -216,8 +216,8 @@ static bool api_echo_SinkData(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -238,7 +238,7 @@ static bool api_echo_SourceData(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_SourceData *r; @@ -261,8 +261,8 @@ static bool api_echo_SourceData(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -294,8 +294,8 @@ static bool api_echo_SourceData(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -316,7 +316,7 @@ static bool api_echo_TestCall(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestCall *r; @@ -339,8 +339,8 @@ static bool api_echo_TestCall(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -372,8 +372,8 @@ static bool api_echo_TestCall(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -394,7 +394,7 @@ static bool api_echo_TestCall2(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestCall2 *r; @@ -417,8 +417,8 @@ static bool api_echo_TestCall2(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -450,8 +450,8 @@ static bool api_echo_TestCall2(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -472,7 +472,7 @@ static bool api_echo_TestSleep(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestSleep *r; @@ -495,8 +495,8 @@ static bool api_echo_TestSleep(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -521,8 +521,8 @@ static bool api_echo_TestSleep(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -543,7 +543,7 @@ static bool api_echo_TestEnum(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestEnum *r; @@ -566,8 +566,8 @@ static bool api_echo_TestEnum(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -596,8 +596,8 @@ static bool api_echo_TestEnum(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -618,7 +618,7 @@ static bool api_echo_TestSurrounding(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestSurrounding *r; @@ -641,8 +641,8 @@ static bool api_echo_TestSurrounding(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -669,8 +669,8 @@ static bool api_echo_TestSurrounding(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -691,7 +691,7 @@ static bool api_echo_TestDoublePointer(pipes_struct *p) const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; - NTSTATUS status; + enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestDoublePointer *r; @@ -714,8 +714,8 @@ static bool api_echo_TestDoublePointer(pipes_struct *p) } pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = call->ndr_pull(pull, NDR_IN, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } @@ -740,8 +740,8 @@ static bool api_echo_TestDoublePointer(pipes_struct *p) return False; } - status = call->ndr_push(push, NDR_OUT, r); - if (NT_STATUS_IS_ERR(status)) { + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); return False; } -- cgit From 3d87cba590b714e95c4e02946bdba8588c3d3700 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 9 Jan 2008 12:28:44 +0100 Subject: Re-run make idl to get even nicer pidl generated server code. Guenther (This used to be commit 6169dea4dc3c4fc5eb1caefde828ed896cf048c5) --- source3/librpc/gen_ndr/srv_echo.c | 580 ++++++++++++++++++++------------------ 1 file changed, 300 insertions(+), 280 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 7e292985bc..de5fc9cd46 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -14,74 +14,76 @@ static bool api_echo_AddOne(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_AddOne *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_ADDONE]; - + r = talloc(NULL, struct echo_AddOne); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_AddOne, r); - + } + ZERO_STRUCT(r->out); r->out.out_data = talloc_zero(r, uint32_t); if (r->out.out_data == NULL) { talloc_free(r); - return False; + return false; } - + _echo_AddOne(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_AddOne, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_EchoData(pipes_struct *p) @@ -92,74 +94,76 @@ static bool api_echo_EchoData(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_EchoData *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_ECHODATA]; - + r = talloc(NULL, struct echo_EchoData); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_EchoData, r); - + } + ZERO_STRUCT(r->out); r->out.out_data = talloc_zero_array(r, uint8_t, r->in.len); if (r->out.out_data == NULL) { talloc_free(r); - return False; + return false; } - + _echo_EchoData(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_EchoData, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_SinkData(pipes_struct *p) @@ -170,67 +174,69 @@ static bool api_echo_SinkData(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_SinkData *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_SINKDATA]; - + r = talloc(NULL, struct echo_SinkData); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_SinkData, r); - + } + _echo_SinkData(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_SinkData, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_SourceData(pipes_struct *p) @@ -241,74 +247,76 @@ static bool api_echo_SourceData(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_SourceData *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_SOURCEDATA]; - + r = talloc(NULL, struct echo_SourceData); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_SourceData, r); - + } + ZERO_STRUCT(r->out); r->out.data = talloc_zero_array(r, uint8_t, r->in.len); if (r->out.data == NULL) { talloc_free(r); - return False; + return false; } - + _echo_SourceData(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_SourceData, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_TestCall(pipes_struct *p) @@ -319,74 +327,76 @@ static bool api_echo_TestCall(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestCall *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL]; - + r = talloc(NULL, struct echo_TestCall); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_TestCall, r); - + } + ZERO_STRUCT(r->out); r->out.s2 = talloc_zero(r, const char *); if (r->out.s2 == NULL) { talloc_free(r); - return False; + return false; } - + _echo_TestCall(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_TestCall, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_TestCall2(pipes_struct *p) @@ -397,74 +407,76 @@ static bool api_echo_TestCall2(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestCall2 *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL2]; - + r = talloc(NULL, struct echo_TestCall2); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_TestCall2, r); - + } + ZERO_STRUCT(r->out); r->out.info = talloc_zero(r, union echo_Info); if (r->out.info == NULL) { talloc_free(r); - return False; + return false; } - + r->out.result = _echo_TestCall2(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_TestCall2, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_TestSleep(pipes_struct *p) @@ -475,67 +487,69 @@ static bool api_echo_TestSleep(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestSleep *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSLEEP]; - + r = talloc(NULL, struct echo_TestSleep); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_TestSleep, r); - + } + r->out.result = _echo_TestSleep(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_TestSleep, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_TestEnum(pipes_struct *p) @@ -546,71 +560,73 @@ static bool api_echo_TestEnum(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestEnum *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTENUM]; - + r = talloc(NULL, struct echo_TestEnum); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_TestEnum, r); - + } + ZERO_STRUCT(r->out); r->out.foo1 = r->in.foo1; r->out.foo2 = r->in.foo2; r->out.foo3 = r->in.foo3; _echo_TestEnum(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_TestEnum, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_TestSurrounding(pipes_struct *p) @@ -621,69 +637,71 @@ static bool api_echo_TestSurrounding(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestSurrounding *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSURROUNDING]; - + r = talloc(NULL, struct echo_TestSurrounding); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_TestSurrounding, r); - + } + ZERO_STRUCT(r->out); r->out.data = r->in.data; _echo_TestSurrounding(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } static bool api_echo_TestDoublePointer(pipes_struct *p) @@ -694,67 +712,69 @@ static bool api_echo_TestDoublePointer(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct echo_TestDoublePointer *r; - + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTDOUBLEPOINTER]; - + r = talloc(NULL, struct echo_TestDoublePointer); if (r == NULL) { - return False; + return false; } - + if (!prs_data_blob(&p->in_data.data, &blob, r)) { talloc_free(r); - return False; + return false; } - + pull = ndr_pull_init_blob(&blob, r); if (pull == NULL) { talloc_free(r); - return False; + return false; } - + pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = call->ndr_pull(pull, NDR_IN, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, r); - + } + r->out.result = _echo_TestDoublePointer(p, r); - + if (p->rng_fault_state) { talloc_free(r); - /* Return True here, srv_pipe_hnd.c will take care */ - return True; + /* Return true here, srv_pipe_hnd.c will take care */ + return true; } - - if (DEBUGLEVEL >= 10) + + if (DEBUGLEVEL >= 10) { NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, r); - + } + push = ndr_push_init_ctx(r); if (push == NULL) { talloc_free(r); - return False; + return false; } - + ndr_err = call->ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); - return False; + return false; } - + blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) { + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { talloc_free(r); - return False; + return false; } - + talloc_free(r); - - return True; + + return true; } -- cgit From 485cb23b16e62a37180b95bd5c409de6ee162084 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 11 Feb 2008 09:15:30 +0100 Subject: rerun 'make idl' metze (This used to be commit 55c74832f3a4052d8b15f01b233aab97f7001bbe) --- source3/librpc/gen_ndr/srv_echo.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index de5fc9cd46..3f725049cd 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -17,7 +17,7 @@ static bool api_echo_AddOne(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_ADDONE]; - r = talloc(NULL, struct echo_AddOne); + r = talloc(talloc_tos(), struct echo_AddOne); if (r == NULL) { return false; } @@ -97,7 +97,7 @@ static bool api_echo_EchoData(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_ECHODATA]; - r = talloc(NULL, struct echo_EchoData); + r = talloc(talloc_tos(), struct echo_EchoData); if (r == NULL) { return false; } @@ -177,7 +177,7 @@ static bool api_echo_SinkData(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_SINKDATA]; - r = talloc(NULL, struct echo_SinkData); + r = talloc(talloc_tos(), struct echo_SinkData); if (r == NULL) { return false; } @@ -250,7 +250,7 @@ static bool api_echo_SourceData(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_SOURCEDATA]; - r = talloc(NULL, struct echo_SourceData); + r = talloc(talloc_tos(), struct echo_SourceData); if (r == NULL) { return false; } @@ -330,7 +330,7 @@ static bool api_echo_TestCall(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL]; - r = talloc(NULL, struct echo_TestCall); + r = talloc(talloc_tos(), struct echo_TestCall); if (r == NULL) { return false; } @@ -410,7 +410,7 @@ static bool api_echo_TestCall2(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL2]; - r = talloc(NULL, struct echo_TestCall2); + r = talloc(talloc_tos(), struct echo_TestCall2); if (r == NULL) { return false; } @@ -490,7 +490,7 @@ static bool api_echo_TestSleep(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSLEEP]; - r = talloc(NULL, struct echo_TestSleep); + r = talloc(talloc_tos(), struct echo_TestSleep); if (r == NULL) { return false; } @@ -563,7 +563,7 @@ static bool api_echo_TestEnum(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTENUM]; - r = talloc(NULL, struct echo_TestEnum); + r = talloc(talloc_tos(), struct echo_TestEnum); if (r == NULL) { return false; } @@ -640,7 +640,7 @@ static bool api_echo_TestSurrounding(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSURROUNDING]; - r = talloc(NULL, struct echo_TestSurrounding); + r = talloc(talloc_tos(), struct echo_TestSurrounding); if (r == NULL) { return false; } @@ -715,7 +715,7 @@ static bool api_echo_TestDoublePointer(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTDOUBLEPOINTER]; - r = talloc(NULL, struct echo_TestDoublePointer); + r = talloc(talloc_tos(), struct echo_TestDoublePointer); if (r == NULL) { return false; } -- cgit From e0f3ea2cbeb61cb02be85d2b315948985bac27a8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 12 Jul 2008 23:17:23 +0200 Subject: In api_pipe_bind_req(), check for the iface id, not the pipe name This requires to store the rpc_interface in "struct rpc_table" (This used to be commit 654f8de8497aff29f9b1f1822b6a8e734ff329e0) --- source3/librpc/gen_ndr/srv_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/librpc/gen_ndr/srv_echo.c') diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index 3f725049cd..b8b38dad13 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -801,5 +801,5 @@ void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns) NTSTATUS rpc_rpcecho_init(void) { - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct)); + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", &ndr_table_rpcecho.syntax_id, api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct)); } -- cgit