diff options
Diffstat (limited to 'source3/librpc/gen_ndr/srv_initshutdown.c')
-rw-r--r-- | source3/librpc/gen_ndr/srv_initshutdown.c | 129 |
1 files changed, 75 insertions, 54 deletions
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; } |