From c4013df0c18779191d124dcb3ee35499900b54e0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 15 Sep 2006 18:32:43 +0000 Subject: r18560: * Add in the winreg and initshutdown IDL files * rename PI_SHUTDOWN from include/smb.h to PI_INITSHUTDOWN for compatibility with pidl libndr output (This used to be commit 23a882861311d9d6ca45af1bfcc90d05846ba3a9) --- source3/librpc/gen_ndr/srv_initshutdown.c | 177 ++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 source3/librpc/gen_ndr/srv_initshutdown.c (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c new file mode 100644 index 0000000000..ba7a20a6d5 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -0,0 +1,177 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_initshutdown.h" + +static BOOL api_initshutdown_Init(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct initshutdown_Init r; + TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_Init"); + + 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_initshutdown_Init(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _initshutdown_Init(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_initshutdown_Init(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_initshutdown_Abort(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct initshutdown_Abort r; + TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_Abort"); + + 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_initshutdown_Abort(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _initshutdown_Abort(p, r.in.server); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_initshutdown_Abort(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_initshutdown_InitEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct initshutdown_InitEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_InitEx"); + + 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_initshutdown_InitEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _initshutdown_InitEx(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot, r.in.reason); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_initshutdown_InitEx(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_initshutdown_cmds[] = +{ + {"INITSHUTDOWN_INIT", DCERPC_INITSHUTDOWN_INIT, api_initshutdown_Init}, + {"INITSHUTDOWN_ABORT", DCERPC_INITSHUTDOWN_ABORT, api_initshutdown_Abort}, + {"INITSHUTDOWN_INITEX", DCERPC_INITSHUTDOWN_INITEX, api_initshutdown_InitEx}, +}; + +void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_initshutdown_cmds; + *n_fns = sizeof(api_initshutdown_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_initshutdown_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct)); +} -- 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_initshutdown.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index ba7a20a6d5..0bcadf423f 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -31,8 +31,14 @@ static BOOL api_initshutdown_Init(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(initshutdown_Init, &r); + r.out.result = _initshutdown_Init(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(initshutdown_Init, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -81,8 +87,14 @@ static BOOL api_initshutdown_Abort(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(initshutdown_Abort, &r); + r.out.result = _initshutdown_Abort(p, r.in.server); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); @@ -131,8 +143,14 @@ static BOOL api_initshutdown_InitEx(pipes_struct *p) return False; } + if (DEBUGLEVEL >= 10) + NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &r); + r.out.result = _initshutdown_InitEx(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot, r.in.reason); + if (DEBUGLEVEL >= 10) + NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &r); + push = ndr_push_init_ctx(mem_ctx); if (push == NULL) { talloc_free(mem_ctx); -- 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_initshutdown.c | 36 +++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 0bcadf423f..fab8288188 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -21,8 +21,10 @@ static BOOL api_initshutdown_Init(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_initshutdown_Init(pull, NDR_IN, &r); @@ -36,6 +38,12 @@ static BOOL api_initshutdown_Init(pipes_struct *p) r.out.result = _initshutdown_Init(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot); + 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(initshutdown_Init, &r); @@ -52,7 +60,7 @@ static BOOL api_initshutdown_Init(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; } @@ -77,8 +85,10 @@ static BOOL api_initshutdown_Abort(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_initshutdown_Abort(pull, NDR_IN, &r); @@ -92,6 +102,12 @@ static BOOL api_initshutdown_Abort(pipes_struct *p) r.out.result = _initshutdown_Abort(p, r.in.server); + 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(initshutdown_Abort, &r); @@ -108,7 +124,7 @@ static BOOL api_initshutdown_Abort(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; } @@ -133,8 +149,10 @@ static BOOL api_initshutdown_InitEx(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_initshutdown_InitEx(pull, NDR_IN, &r); @@ -148,6 +166,12 @@ static BOOL api_initshutdown_InitEx(pipes_struct *p) r.out.result = _initshutdown_InitEx(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot, r.in.reason); + 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(initshutdown_InitEx, &r); @@ -164,7 +188,7 @@ static BOOL api_initshutdown_InitEx(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 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_initshutdown.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index fab8288188..41c10129d5 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -36,7 +36,7 @@ static BOOL api_initshutdown_Init(pipes_struct *p) if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(initshutdown_Init, &r); - r.out.result = _initshutdown_Init(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot); + r.out.result = _initshutdown_Init(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -100,7 +100,7 @@ static BOOL api_initshutdown_Abort(pipes_struct *p) if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(initshutdown_Abort, &r); - r.out.result = _initshutdown_Abort(p, r.in.server); + r.out.result = _initshutdown_Abort(p, &r); if (p->rng_fault_state) { talloc_free(mem_ctx); @@ -164,7 +164,7 @@ static BOOL api_initshutdown_InitEx(pipes_struct *p) if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &r); - r.out.result = _initshutdown_InitEx(p, r.in.hostname, r.in.message, r.in.timeout, r.in.force_apps, r.in.reboot, r.in.reason); + r.out.result = _initshutdown_InitEx(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_initshutdown.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 41c10129d5..b47ca9b600 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -202,9 +202,9 @@ static BOOL api_initshutdown_InitEx(pipes_struct *p) /* Tables */ static struct api_struct api_initshutdown_cmds[] = { - {"INITSHUTDOWN_INIT", DCERPC_INITSHUTDOWN_INIT, api_initshutdown_Init}, - {"INITSHUTDOWN_ABORT", DCERPC_INITSHUTDOWN_ABORT, api_initshutdown_Abort}, - {"INITSHUTDOWN_INITEX", DCERPC_INITSHUTDOWN_INITEX, api_initshutdown_InitEx}, + {"INITSHUTDOWN_INIT", NDR_INITSHUTDOWN_INIT, api_initshutdown_Init}, + {"INITSHUTDOWN_ABORT", NDR_INITSHUTDOWN_ABORT, api_initshutdown_Abort}, + {"INITSHUTDOWN_INITEX", NDR_INITSHUTDOWN_INITEX, api_initshutdown_InitEx}, }; void initshutdown_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_initshutdown.c | 129 +++++++++++++++++------------- 1 file changed, 75 insertions(+), 54 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index b47ca9b600..3a7ce728ce 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -8,192 +8,213 @@ static BOOL api_initshutdown_Init(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct initshutdown_Init r; - TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_Init"); + struct initshutdown_Init *r; - if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { - talloc_free(mem_ctx); + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT]; + + r = talloc(NULL, struct initshutdown_Init); + if (r == NULL) { + return False; + } + + 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_initshutdown_Init(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(initshutdown_Init, &r); + NDR_PRINT_IN_DEBUG(initshutdown_Init, r); - r.out.result = _initshutdown_Init(p, &r); + r->out.result = _initshutdown_Init(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(initshutdown_Init, &r); + NDR_PRINT_OUT_DEBUG(initshutdown_Init, 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_initshutdown_Init(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_initshutdown_Abort(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct initshutdown_Abort r; - TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_Abort"); + struct initshutdown_Abort *r; + + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT]; + + r = talloc(NULL, struct initshutdown_Abort); + 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_initshutdown_Abort(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(initshutdown_Abort, &r); + NDR_PRINT_IN_DEBUG(initshutdown_Abort, r); - r.out.result = _initshutdown_Abort(p, &r); + r->out.result = _initshutdown_Abort(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(initshutdown_Abort, &r); + NDR_PRINT_OUT_DEBUG(initshutdown_Abort, 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_initshutdown_Abort(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_initshutdown_InitEx(pipes_struct *p) { + const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; NTSTATUS status; DATA_BLOB blob; - struct initshutdown_InitEx r; - TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_InitEx"); + struct initshutdown_InitEx *r; + + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX]; + + r = talloc(NULL, struct initshutdown_InitEx); + 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_initshutdown_InitEx(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(initshutdown_InitEx, &r); + NDR_PRINT_IN_DEBUG(initshutdown_InitEx, r); - r.out.result = _initshutdown_InitEx(p, &r); + r->out.result = _initshutdown_InitEx(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(initshutdown_InitEx, &r); + NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, 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_initshutdown_InitEx(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_initshutdown.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 3a7ce728ce..9b20bd7115 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -6,7 +6,7 @@ #include "includes.h" #include "librpc/gen_ndr/srv_initshutdown.h" -static BOOL api_initshutdown_Init(pipes_struct *p) +static bool api_initshutdown_Init(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -77,7 +77,7 @@ static BOOL api_initshutdown_Init(pipes_struct *p) return True; } -static BOOL api_initshutdown_Abort(pipes_struct *p) +static bool api_initshutdown_Abort(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; @@ -148,7 +148,7 @@ static BOOL api_initshutdown_Abort(pipes_struct *p) return True; } -static BOOL api_initshutdown_InitEx(pipes_struct *p) +static bool api_initshutdown_InitEx(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_initshutdown.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 9b20bd7115..56fbf42957 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -11,7 +11,7 @@ static bool api_initshutdown_Init(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 initshutdown_Init *r; @@ -34,8 +34,8 @@ static bool api_initshutdown_Init(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; } @@ -60,8 +60,8 @@ static bool api_initshutdown_Init(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; } @@ -82,7 +82,7 @@ static bool api_initshutdown_Abort(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 initshutdown_Abort *r; @@ -105,8 +105,8 @@ static bool api_initshutdown_Abort(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; } @@ -131,8 +131,8 @@ static bool api_initshutdown_Abort(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; } @@ -153,7 +153,7 @@ static bool api_initshutdown_InitEx(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 initshutdown_InitEx *r; @@ -176,8 +176,8 @@ static bool api_initshutdown_InitEx(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; } @@ -202,8 +202,8 @@ static bool api_initshutdown_InitEx(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_initshutdown.c | 168 ++++++++++++++++-------------- 1 file changed, 87 insertions(+), 81 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 56fbf42957..794adea81b 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -14,67 +14,69 @@ static bool api_initshutdown_Init(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct initshutdown_Init *r; - + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT]; - + r = talloc(NULL, struct initshutdown_Init); 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(initshutdown_Init, r); - + } + r->out.result = _initshutdown_Init(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(initshutdown_Init, 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_initshutdown_Abort(pipes_struct *p) @@ -85,67 +87,69 @@ static bool api_initshutdown_Abort(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct initshutdown_Abort *r; - + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT]; - + r = talloc(NULL, struct initshutdown_Abort); 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(initshutdown_Abort, r); - + } + r->out.result = _initshutdown_Abort(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(initshutdown_Abort, 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_initshutdown_InitEx(pipes_struct *p) @@ -156,67 +160,69 @@ static bool api_initshutdown_InitEx(pipes_struct *p) enum ndr_err_code ndr_err; DATA_BLOB blob; struct initshutdown_InitEx *r; - + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX]; - + r = talloc(NULL, struct initshutdown_InitEx); 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(initshutdown_InitEx, r); - + } + r->out.result = _initshutdown_InitEx(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(initshutdown_InitEx, 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_initshutdown.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 794adea81b..f24530c1c1 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -17,7 +17,7 @@ static bool api_initshutdown_Init(pipes_struct *p) call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT]; - r = talloc(NULL, struct initshutdown_Init); + r = talloc(talloc_tos(), struct initshutdown_Init); if (r == NULL) { return false; } @@ -90,7 +90,7 @@ static bool api_initshutdown_Abort(pipes_struct *p) call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT]; - r = talloc(NULL, struct initshutdown_Abort); + r = talloc(talloc_tos(), struct initshutdown_Abort); if (r == NULL) { return false; } @@ -163,7 +163,7 @@ static bool api_initshutdown_InitEx(pipes_struct *p) call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX]; - r = talloc(NULL, struct initshutdown_InitEx); + r = talloc(talloc_tos(), struct initshutdown_InitEx); 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_initshutdown.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c') diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index f24530c1c1..00a89661b5 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -242,5 +242,5 @@ void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns) NTSTATUS rpc_initshutdown_init(void) { - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct)); + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", &ndr_table_initshutdown.syntax_id, api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct)); } -- cgit