summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-09-20 18:43:57 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-01-06 12:28:18 +0100
commit7dd880f4b91dd55f800fe3b7097684acdd3297ca (patch)
tree3fc91ff4c5b50cfbe6ddc430153f396297c09059
parent29266c0a9075d466a2e580206e9018b278bce972 (diff)
downloadsamba-7dd880f4b91dd55f800fe3b7097684acdd3297ca.tar.gz
s3-iremotewinspool: add generated server stubs and no longer compile autogenerated ones
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--source3/rpc_server/spoolss/srv_iremotewinspool.c6023
-rwxr-xr-xsource3/rpc_server/wscript_build2
2 files changed, 6024 insertions, 1 deletions
diff --git a/source3/rpc_server/spoolss/srv_iremotewinspool.c b/source3/rpc_server/spoolss/srv_iremotewinspool.c
new file mode 100644
index 00000000000..269450af6c2
--- /dev/null
+++ b/source3/rpc_server/spoolss/srv_iremotewinspool.c
@@ -0,0 +1,6023 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * server auto-generated by pidl. DO NOT MODIFY!
+ */
+
+#include "includes.h"
+#include "ntdomain.h"
+#include "bin/default/librpc/gen_ndr/srv_winspool.h"
+
+static bool api_winspool_AsyncOpenPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncOpenPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCOPENPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncOpenPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncOpenPrinter, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pHandle = talloc_zero(r, struct policy_handle);
+ if (r->out.pHandle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncOpenPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncOpenPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinter, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pHandle = talloc_zero(r, struct policy_handle);
+ if (r->out.pHandle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncAddPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSetJob(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSetJob *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETJOB];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSetJob);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJob, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncSetJob(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJob, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetJob(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetJob *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETJOB];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetJob);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJob, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pJob = r->in.pJob;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetJob(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJob, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumJobs(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumJobs *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMJOBS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumJobs);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobs, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pJob = r->in.pJob;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumJobs(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobs, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddJob(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddJob *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDJOB];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddJob);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddJob, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pAddJob = r->in.pAddJob;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncAddJob(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddJob, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncScheduleJob(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncScheduleJob *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSCHEDULEJOB];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncScheduleJob);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncScheduleJob, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncScheduleJob(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncScheduleJob, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinter, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSetPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSetPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSetPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinter, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncSetPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinter, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pPrinter = r->in.pPrinter;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncStartDocPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncStartDocPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSTARTDOCPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncStartDocPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartDocPrinter, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pJobId = talloc_zero(r, uint32_t);
+ if (r->out.pJobId == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncStartDocPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartDocPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncStartPagePrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncStartPagePrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSTARTPAGEPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncStartPagePrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartPagePrinter, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncStartPagePrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncStartPagePrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncWritePrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncWritePrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCWRITEPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncWritePrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncWritePrinter, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pcWritten = talloc_zero(r, uint32_t);
+ if (r->out.pcWritten == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncWritePrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncWritePrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEndPagePrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEndPagePrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENDPAGEPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEndPagePrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndPagePrinter, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncEndPagePrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndPagePrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEndDocPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEndDocPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENDDOCPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEndDocPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndDocPrinter, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncEndDocPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEndDocPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAbortPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAbortPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCABORTPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAbortPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAbortPrinter, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncAbortPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAbortPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetPrinterData(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetPrinterData *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDATA];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterData);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterData, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pType = talloc_zero(r, uint32_t);
+ if (r->out.pType == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pData = talloc_zero_array(r, uint8_t, r->in.nSize);
+ if (r->out.pData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetPrinterData(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterData, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetPrinterDataEx(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetPrinterDataEx *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDATAEX];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDataEx);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDataEx, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pType = talloc_zero(r, uint32_t);
+ if (r->out.pType == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pData = talloc_zero_array(r, uint8_t, r->in.nSize);
+ if (r->out.pData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetPrinterDataEx(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSetPrinterData(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSetPrinterData *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPRINTERDATA];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSetPrinterData);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterData, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncSetPrinterData(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterData, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSetPrinterDataEx(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSetPrinterDataEx *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPRINTERDATAEX];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSetPrinterDataEx);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterDataEx, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncSetPrinterDataEx(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncClosePrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncClosePrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCCLOSEPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncClosePrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncClosePrinter, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.phPrinter = r->in.phPrinter;
+ r->out.result = _winspool_AsyncClosePrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncClosePrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddForm(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddForm *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDFORM];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddForm);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddForm, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncAddForm(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddForm, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeleteForm(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeleteForm *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEFORM];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeleteForm);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteForm, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeleteForm(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteForm, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetForm(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetForm *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETFORM];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetForm);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetForm, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pForm = r->in.pForm;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetForm(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetForm, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSetForm(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSetForm *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETFORM];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSetForm);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetForm, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncSetForm(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetForm, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumForms(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumForms *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMFORMS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumForms);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumForms, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pForm = r->in.pForm;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumForms(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumForms, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetPrinterDriver(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetPrinterDriver *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDRIVER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDriver);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriver, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pDriver = r->in.pDriver;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pdwServerMaxVersion = talloc_zero(r, uint32_t);
+ if (r->out.pdwServerMaxVersion == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pdwServerMinVersion = talloc_zero(r, uint32_t);
+ if (r->out.pdwServerMinVersion == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetPrinterDriver(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriver, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPrinterData(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPrinterData *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERDATA];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterData);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterData, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pValueName = talloc_zero_array(r, uint16_t, r->in.cbValueName / 2);
+ if (r->out.pValueName == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcbValueName = talloc_zero(r, uint32_t);
+ if (r->out.pcbValueName == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pType = talloc_zero(r, uint32_t);
+ if (r->out.pType == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pData = talloc_zero_array(r, uint8_t, r->in.cbData);
+ if (r->out.pData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcbData = talloc_zero(r, uint32_t);
+ if (r->out.pcbData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPrinterData(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterData, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPrinterDataEx(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPrinterDataEx *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERDATAEX];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterDataEx);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDataEx, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pEnumValues = talloc_zero_array(r, uint8_t, r->in.cbEnumValues);
+ if (r->out.pEnumValues == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcbEnumValues = talloc_zero(r, uint32_t);
+ if (r->out.pcbEnumValues == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pnEnumValues = talloc_zero(r, uint32_t);
+ if (r->out.pnEnumValues == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPrinterDataEx(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPrinterKey(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPrinterKey *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERKEY];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterKey);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterKey, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pSubkey = talloc_zero_array(r, uint16_t, r->in.cbSubkey / 2);
+ if (r->out.pSubkey == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcbSubkey = talloc_zero(r, uint32_t);
+ if (r->out.pcbSubkey == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPrinterKey(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterKey, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinterData(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinterData *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDATA];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterData);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterData, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrinterData(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterData, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinterDataEx(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinterDataEx *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDATAEX];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDataEx);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDataEx, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrinterDataEx(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDataEx, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinterKey(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinterKey *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERKEY];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterKey);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterKey, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrinterKey(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterKey, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncXcvData(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncXcvData *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCXCVDATA];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncXcvData);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncXcvData, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pdwStatus = r->in.pdwStatus;
+ r->out.pOutputData = talloc_zero_array(r, uint8_t, r->in.cbOutputData);
+ if (r->out.pOutputData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcbOutputNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbOutputNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncXcvData(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncXcvData, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSendRecvBidiData(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSendRecvBidiData *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSENDRECVBIDIDATA];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSendRecvBidiData);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSendRecvBidiData, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.ppRespData = talloc_zero(r, struct RPC_BIDI_RESPONSE_CONTAINER *);
+ if (r->out.ppRespData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncSendRecvBidiData(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSendRecvBidiData, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncCreatePrinterIC(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncCreatePrinterIC *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCCREATEPRINTERIC];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncCreatePrinterIC);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCreatePrinterIC, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pHandle = talloc_zero(r, struct policy_handle);
+ if (r->out.pHandle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncCreatePrinterIC(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCreatePrinterIC, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncPlayGdiScriptOnPrinterIC(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncPlayGdiScriptOnPrinterIC *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncPlayGdiScriptOnPrinterIC);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncPlayGdiScriptOnPrinterIC, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pOut = talloc_zero_array(r, uint8_t, r->in.cOut);
+ if (r->out.pOut == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncPlayGdiScriptOnPrinterIC(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncPlayGdiScriptOnPrinterIC, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinterIC(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinterIC *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERIC];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterIC);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterIC, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.phPrinterIC = r->in.phPrinterIC;
+ r->out.result = _winspool_AsyncDeletePrinterIC(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterIC, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPrinters(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPrinters *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinters);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinters, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pPrinterEnum = r->in.pPrinterEnum;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPrinters(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinters, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddPrinterDriver(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddPrinterDriver *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPRINTERDRIVER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddPrinterDriver);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinterDriver, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncAddPrinterDriver(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrinterDriver, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPrinterDrivers(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPrinterDrivers *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTERDRIVERS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPrinterDrivers);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDrivers, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pDrivers = r->in.pDrivers;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPrinterDrivers(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrinterDrivers, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetPrinterDriverDirectory(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetPrinterDriverDirectory *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDriverDirectory);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverDirectory, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pDriverDirectory = r->in.pDriverDirectory;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetPrinterDriverDirectory(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverDirectory, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinterDriver(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinterDriver *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDriver);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriver, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrinterDriver(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriver, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinterDriverEx(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinterDriverEx *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVEREX];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDriverEx);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverEx, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrinterDriverEx(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverEx, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddPrintProcessor(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddPrintProcessor *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPRINTPROCESSOR];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddPrintProcessor);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrintProcessor, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncAddPrintProcessor(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPrintProcessor, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPrintProcessors(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPrintProcessors *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPrintProcessors);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessors, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pPrintProcessorInfo = r->in.pPrintProcessorInfo;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPrintProcessors(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessors, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetPrintProcessorDirectory(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetPrintProcessorDirectory *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetPrintProcessorDirectory);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrintProcessorDirectory, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pPrintProcessorDirectory = r->in.pPrintProcessorDirectory;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetPrintProcessorDirectory(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrintProcessorDirectory, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPorts(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPorts *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPORTS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPorts);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPorts, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pPort = r->in.pPort;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPorts(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPorts, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumMonitors(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumMonitors *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMMONITORS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumMonitors);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumMonitors, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pMonitor = r->in.pMonitor;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumMonitors(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumMonitors, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddPort(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddPort *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPORT];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddPort);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPort, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncAddPort(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPort, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSetPort(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSetPort *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETPORT];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSetPort);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPort, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncSetPort(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetPort, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddMonitor(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddMonitor *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDMONITOR];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddMonitor);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddMonitor, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncAddMonitor(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddMonitor, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeleteMonitor(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeleteMonitor *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEMONITOR];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeleteMonitor);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteMonitor, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeleteMonitor(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteMonitor, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrintProcessor(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrintProcessor *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTPROCESSOR];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrintProcessor);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrintProcessor, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrintProcessor(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrintProcessor, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPrintProcessorDatatypes(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPrintProcessorDatatypes *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPrintProcessorDatatypes);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessorDatatypes, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pDatatypes = r->in.pDatatypes;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPrintProcessorDatatypes(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPrintProcessorDatatypes, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncAddPerMachineConnection(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncAddPerMachineConnection *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCADDPERMACHINECONNECTION];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncAddPerMachineConnection);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPerMachineConnection, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncAddPerMachineConnection(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncAddPerMachineConnection, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePerMachineConnection(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePerMachineConnection *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPERMACHINECONNECTION];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePerMachineConnection);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePerMachineConnection, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePerMachineConnection(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePerMachineConnection, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumPerMachineConnections(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumPerMachineConnections *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumPerMachineConnections);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPerMachineConnections, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pPrinterEnum = r->in.pPrinterEnum;
+ r->out.pcbNeeded = talloc_zero(r, uint32_t);
+ if (r->out.pcbNeeded == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcReturned = talloc_zero(r, uint32_t);
+ if (r->out.pcReturned == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumPerMachineConnections(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumPerMachineConnections, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_SyncRegisterForRemoteNotifications(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_SyncRegisterForRemoteNotifications *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS];
+
+ r = talloc(talloc_tos(), struct winspool_SyncRegisterForRemoteNotifications);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRegisterForRemoteNotifications, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.phRpcHandle = talloc_zero(r, struct policy_handle);
+ if (r->out.phRpcHandle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_SyncRegisterForRemoteNotifications(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRegisterForRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_SyncUnRegisterForRemoteNotifications(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_SyncUnRegisterForRemoteNotifications *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS];
+
+ r = talloc(talloc_tos(), struct winspool_SyncUnRegisterForRemoteNotifications);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_SyncUnRegisterForRemoteNotifications, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.phRpcHandle = r->in.phRpcHandle;
+ r->out.result = _winspool_SyncUnRegisterForRemoteNotifications(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_SyncUnRegisterForRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_SyncRefreshRemoteNotifications(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_SyncRefreshRemoteNotifications *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS];
+
+ r = talloc(talloc_tos(), struct winspool_SyncRefreshRemoteNotifications);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRefreshRemoteNotifications, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.ppNotifyData = talloc_zero(r, struct winspool_PrintPropertiesCollection *);
+ if (r->out.ppNotifyData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_SyncRefreshRemoteNotifications(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_SyncRefreshRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetRemoteNotifications(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetRemoteNotifications *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetRemoteNotifications);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetRemoteNotifications, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.ppNotifyData = talloc_zero(r, struct winspool_PrintPropertiesCollection *);
+ if (r->out.ppNotifyData == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetRemoteNotifications(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetRemoteNotifications, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncInstallPrinterDriverFromPackage(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncInstallPrinterDriverFromPackage *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncInstallPrinterDriverFromPackage);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncInstallPrinterDriverFromPackage, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncInstallPrinterDriverFromPackage(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncInstallPrinterDriverFromPackage, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncUploadPrinterDriverPackage(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncUploadPrinterDriverPackage *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncUploadPrinterDriverPackage);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncUploadPrinterDriverPackage, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pszDestInfPath = r->in.pszDestInfPath;
+ r->out.pcchDestInfPath = r->in.pcchDestInfPath;
+ r->out.result = _winspool_AsyncUploadPrinterDriverPackage(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncUploadPrinterDriverPackage, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetCorePrinterDrivers(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetCorePrinterDrivers *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETCOREPRINTERDRIVERS];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetCorePrinterDrivers);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetCorePrinterDrivers, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pCorePrinterDrivers = talloc_zero_array(r, struct spoolss_CorePrinterDriver, r->in.cCorePrinterDrivers);
+ if (r->out.pCorePrinterDrivers == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetCorePrinterDrivers(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetCorePrinterDrivers, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncCorePrinterDriverInstalled(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncCorePrinterDriverInstalled *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncCorePrinterDriverInstalled);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCorePrinterDriverInstalled, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pbDriverInstalled = talloc_zero(r, int32_t);
+ if (r->out.pbDriverInstalled == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncCorePrinterDriverInstalled(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncCorePrinterDriverInstalled, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetPrinterDriverPackagePath(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetPrinterDriverPackagePath *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetPrinterDriverPackagePath);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverPackagePath, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pszDriverPackageCab = r->in.pszDriverPackageCab;
+ r->out.pcchRequiredSize = talloc_zero(r, uint32_t);
+ if (r->out.pcchRequiredSize == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetPrinterDriverPackagePath(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetPrinterDriverPackagePath, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeletePrinterDriverPackage(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeletePrinterDriverPackage *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeletePrinterDriverPackage);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverPackage, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeletePrinterDriverPackage(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeletePrinterDriverPackage, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncReadPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncReadPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCREADPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncReadPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncReadPrinter, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pBuf = talloc_zero_array(r, uint8_t, r->in.cbBuf);
+ if (r->out.pBuf == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.pcNoBytesRead = talloc_zero(r, uint32_t);
+ if (r->out.pcNoBytesRead == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncReadPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncReadPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncResetPrinter(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncResetPrinter *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCRESETPRINTER];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncResetPrinter);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncResetPrinter, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncResetPrinter(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncResetPrinter, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncGetJobNamedPropertyValue(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncGetJobNamedPropertyValue *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncGetJobNamedPropertyValue);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJobNamedPropertyValue, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pValue = talloc_zero(r, struct spoolss_PrintPropertyValue);
+ if (r->out.pValue == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncGetJobNamedPropertyValue(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncGetJobNamedPropertyValue, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncSetJobNamedProperty(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncSetJobNamedProperty *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCSETJOBNAMEDPROPERTY];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncSetJobNamedProperty);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJobNamedProperty, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncSetJobNamedProperty(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncSetJobNamedProperty, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncDeleteJobNamedProperty(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncDeleteJobNamedProperty *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncDeleteJobNamedProperty);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteJobNamedProperty, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncDeleteJobNamedProperty(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncDeleteJobNamedProperty, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncEnumJobNamedProperties(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncEnumJobNamedProperties *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncEnumJobNamedProperties);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobNamedProperties, NDR_IN, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.pcProperties = talloc_zero(r, uint32_t);
+ if (r->out.pcProperties == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.ppProperties = talloc_zero(r, struct spoolss_PrintNamedProperty *);
+ if (r->out.ppProperties == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.result = _winspool_AsyncEnumJobNamedProperties(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncEnumJobNamedProperties, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+static bool api_winspool_AsyncLogJobInfoForBranchOffice(struct pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ struct winspool_AsyncLogJobInfoForBranchOffice *r;
+
+ call = &ndr_table_iremotewinspool.calls[NDR_WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE];
+
+ r = talloc(talloc_tos(), struct winspool_AsyncLogJobInfoForBranchOffice);
+ if (r == NULL) {
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&p->in_data.data, r);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (p->endian) {
+ pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+ }
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncLogJobInfoForBranchOffice, NDR_IN, r);
+ }
+
+ r->out.result = _winspool_AsyncLogJobInfoForBranchOffice(p, r);
+
+ if (p->fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_FUNCTION_DEBUG(winspool_AsyncLogJobInfoForBranchOffice, NDR_OUT | NDR_SET_VALUES, r);
+ }
+
+ push = ndr_push_init_ctx(r);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ /*
+ * carry over the pointer count to the reply in case we are
+ * using full pointer. See NDR specification for full pointers
+ */
+ push->ptr_count = pull->ptr_count;
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ p->out_data.rdata = ndr_push_blob(push);
+ talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+ talloc_free(r);
+
+ return true;
+}
+
+
+/* Tables */
+static struct api_struct api_iremotewinspool_cmds[] =
+{
+ {"WINSPOOL_ASYNCOPENPRINTER", NDR_WINSPOOL_ASYNCOPENPRINTER, api_winspool_AsyncOpenPrinter},
+ {"WINSPOOL_ASYNCADDPRINTER", NDR_WINSPOOL_ASYNCADDPRINTER, api_winspool_AsyncAddPrinter},
+ {"WINSPOOL_ASYNCSETJOB", NDR_WINSPOOL_ASYNCSETJOB, api_winspool_AsyncSetJob},
+ {"WINSPOOL_ASYNCGETJOB", NDR_WINSPOOL_ASYNCGETJOB, api_winspool_AsyncGetJob},
+ {"WINSPOOL_ASYNCENUMJOBS", NDR_WINSPOOL_ASYNCENUMJOBS, api_winspool_AsyncEnumJobs},
+ {"WINSPOOL_ASYNCADDJOB", NDR_WINSPOOL_ASYNCADDJOB, api_winspool_AsyncAddJob},
+ {"WINSPOOL_ASYNCSCHEDULEJOB", NDR_WINSPOOL_ASYNCSCHEDULEJOB, api_winspool_AsyncScheduleJob},
+ {"WINSPOOL_ASYNCDELETEPRINTER", NDR_WINSPOOL_ASYNCDELETEPRINTER, api_winspool_AsyncDeletePrinter},
+ {"WINSPOOL_ASYNCSETPRINTER", NDR_WINSPOOL_ASYNCSETPRINTER, api_winspool_AsyncSetPrinter},
+ {"WINSPOOL_ASYNCGETPRINTER", NDR_WINSPOOL_ASYNCGETPRINTER, api_winspool_AsyncGetPrinter},
+ {"WINSPOOL_ASYNCSTARTDOCPRINTER", NDR_WINSPOOL_ASYNCSTARTDOCPRINTER, api_winspool_AsyncStartDocPrinter},
+ {"WINSPOOL_ASYNCSTARTPAGEPRINTER", NDR_WINSPOOL_ASYNCSTARTPAGEPRINTER, api_winspool_AsyncStartPagePrinter},
+ {"WINSPOOL_ASYNCWRITEPRINTER", NDR_WINSPOOL_ASYNCWRITEPRINTER, api_winspool_AsyncWritePrinter},
+ {"WINSPOOL_ASYNCENDPAGEPRINTER", NDR_WINSPOOL_ASYNCENDPAGEPRINTER, api_winspool_AsyncEndPagePrinter},
+ {"WINSPOOL_ASYNCENDDOCPRINTER", NDR_WINSPOOL_ASYNCENDDOCPRINTER, api_winspool_AsyncEndDocPrinter},
+ {"WINSPOOL_ASYNCABORTPRINTER", NDR_WINSPOOL_ASYNCABORTPRINTER, api_winspool_AsyncAbortPrinter},
+ {"WINSPOOL_ASYNCGETPRINTERDATA", NDR_WINSPOOL_ASYNCGETPRINTERDATA, api_winspool_AsyncGetPrinterData},
+ {"WINSPOOL_ASYNCGETPRINTERDATAEX", NDR_WINSPOOL_ASYNCGETPRINTERDATAEX, api_winspool_AsyncGetPrinterDataEx},
+ {"WINSPOOL_ASYNCSETPRINTERDATA", NDR_WINSPOOL_ASYNCSETPRINTERDATA, api_winspool_AsyncSetPrinterData},
+ {"WINSPOOL_ASYNCSETPRINTERDATAEX", NDR_WINSPOOL_ASYNCSETPRINTERDATAEX, api_winspool_AsyncSetPrinterDataEx},
+ {"WINSPOOL_ASYNCCLOSEPRINTER", NDR_WINSPOOL_ASYNCCLOSEPRINTER, api_winspool_AsyncClosePrinter},
+ {"WINSPOOL_ASYNCADDFORM", NDR_WINSPOOL_ASYNCADDFORM, api_winspool_AsyncAddForm},
+ {"WINSPOOL_ASYNCDELETEFORM", NDR_WINSPOOL_ASYNCDELETEFORM, api_winspool_AsyncDeleteForm},
+ {"WINSPOOL_ASYNCGETFORM", NDR_WINSPOOL_ASYNCGETFORM, api_winspool_AsyncGetForm},
+ {"WINSPOOL_ASYNCSETFORM", NDR_WINSPOOL_ASYNCSETFORM, api_winspool_AsyncSetForm},
+ {"WINSPOOL_ASYNCENUMFORMS", NDR_WINSPOOL_ASYNCENUMFORMS, api_winspool_AsyncEnumForms},
+ {"WINSPOOL_ASYNCGETPRINTERDRIVER", NDR_WINSPOOL_ASYNCGETPRINTERDRIVER, api_winspool_AsyncGetPrinterDriver},
+ {"WINSPOOL_ASYNCENUMPRINTERDATA", NDR_WINSPOOL_ASYNCENUMPRINTERDATA, api_winspool_AsyncEnumPrinterData},
+ {"WINSPOOL_ASYNCENUMPRINTERDATAEX", NDR_WINSPOOL_ASYNCENUMPRINTERDATAEX, api_winspool_AsyncEnumPrinterDataEx},
+ {"WINSPOOL_ASYNCENUMPRINTERKEY", NDR_WINSPOOL_ASYNCENUMPRINTERKEY, api_winspool_AsyncEnumPrinterKey},
+ {"WINSPOOL_ASYNCDELETEPRINTERDATA", NDR_WINSPOOL_ASYNCDELETEPRINTERDATA, api_winspool_AsyncDeletePrinterData},
+ {"WINSPOOL_ASYNCDELETEPRINTERDATAEX", NDR_WINSPOOL_ASYNCDELETEPRINTERDATAEX, api_winspool_AsyncDeletePrinterDataEx},
+ {"WINSPOOL_ASYNCDELETEPRINTERKEY", NDR_WINSPOOL_ASYNCDELETEPRINTERKEY, api_winspool_AsyncDeletePrinterKey},
+ {"WINSPOOL_ASYNCXCVDATA", NDR_WINSPOOL_ASYNCXCVDATA, api_winspool_AsyncXcvData},
+ {"WINSPOOL_ASYNCSENDRECVBIDIDATA", NDR_WINSPOOL_ASYNCSENDRECVBIDIDATA, api_winspool_AsyncSendRecvBidiData},
+ {"WINSPOOL_ASYNCCREATEPRINTERIC", NDR_WINSPOOL_ASYNCCREATEPRINTERIC, api_winspool_AsyncCreatePrinterIC},
+ {"WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC", NDR_WINSPOOL_ASYNCPLAYGDISCRIPTONPRINTERIC, api_winspool_AsyncPlayGdiScriptOnPrinterIC},
+ {"WINSPOOL_ASYNCDELETEPRINTERIC", NDR_WINSPOOL_ASYNCDELETEPRINTERIC, api_winspool_AsyncDeletePrinterIC},
+ {"WINSPOOL_ASYNCENUMPRINTERS", NDR_WINSPOOL_ASYNCENUMPRINTERS, api_winspool_AsyncEnumPrinters},
+ {"WINSPOOL_ASYNCADDPRINTERDRIVER", NDR_WINSPOOL_ASYNCADDPRINTERDRIVER, api_winspool_AsyncAddPrinterDriver},
+ {"WINSPOOL_ASYNCENUMPRINTERDRIVERS", NDR_WINSPOOL_ASYNCENUMPRINTERDRIVERS, api_winspool_AsyncEnumPrinterDrivers},
+ {"WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY", NDR_WINSPOOL_ASYNCGETPRINTERDRIVERDIRECTORY, api_winspool_AsyncGetPrinterDriverDirectory},
+ {"WINSPOOL_ASYNCDELETEPRINTERDRIVER", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVER, api_winspool_AsyncDeletePrinterDriver},
+ {"WINSPOOL_ASYNCDELETEPRINTERDRIVEREX", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVEREX, api_winspool_AsyncDeletePrinterDriverEx},
+ {"WINSPOOL_ASYNCADDPRINTPROCESSOR", NDR_WINSPOOL_ASYNCADDPRINTPROCESSOR, api_winspool_AsyncAddPrintProcessor},
+ {"WINSPOOL_ASYNCENUMPRINTPROCESSORS", NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORS, api_winspool_AsyncEnumPrintProcessors},
+ {"WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY", NDR_WINSPOOL_ASYNCGETPRINTPROCESSORDIRECTORY, api_winspool_AsyncGetPrintProcessorDirectory},
+ {"WINSPOOL_ASYNCENUMPORTS", NDR_WINSPOOL_ASYNCENUMPORTS, api_winspool_AsyncEnumPorts},
+ {"WINSPOOL_ASYNCENUMMONITORS", NDR_WINSPOOL_ASYNCENUMMONITORS, api_winspool_AsyncEnumMonitors},
+ {"WINSPOOL_ASYNCADDPORT", NDR_WINSPOOL_ASYNCADDPORT, api_winspool_AsyncAddPort},
+ {"WINSPOOL_ASYNCSETPORT", NDR_WINSPOOL_ASYNCSETPORT, api_winspool_AsyncSetPort},
+ {"WINSPOOL_ASYNCADDMONITOR", NDR_WINSPOOL_ASYNCADDMONITOR, api_winspool_AsyncAddMonitor},
+ {"WINSPOOL_ASYNCDELETEMONITOR", NDR_WINSPOOL_ASYNCDELETEMONITOR, api_winspool_AsyncDeleteMonitor},
+ {"WINSPOOL_ASYNCDELETEPRINTPROCESSOR", NDR_WINSPOOL_ASYNCDELETEPRINTPROCESSOR, api_winspool_AsyncDeletePrintProcessor},
+ {"WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES", NDR_WINSPOOL_ASYNCENUMPRINTPROCESSORDATATYPES, api_winspool_AsyncEnumPrintProcessorDatatypes},
+ {"WINSPOOL_ASYNCADDPERMACHINECONNECTION", NDR_WINSPOOL_ASYNCADDPERMACHINECONNECTION, api_winspool_AsyncAddPerMachineConnection},
+ {"WINSPOOL_ASYNCDELETEPERMACHINECONNECTION", NDR_WINSPOOL_ASYNCDELETEPERMACHINECONNECTION, api_winspool_AsyncDeletePerMachineConnection},
+ {"WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS", NDR_WINSPOOL_ASYNCENUMPERMACHINECONNECTIONS, api_winspool_AsyncEnumPerMachineConnections},
+ {"WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCREGISTERFORREMOTENOTIFICATIONS, api_winspool_SyncRegisterForRemoteNotifications},
+ {"WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCUNREGISTERFORREMOTENOTIFICATIONS, api_winspool_SyncUnRegisterForRemoteNotifications},
+ {"WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS", NDR_WINSPOOL_SYNCREFRESHREMOTENOTIFICATIONS, api_winspool_SyncRefreshRemoteNotifications},
+ {"WINSPOOL_ASYNCGETREMOTENOTIFICATIONS", NDR_WINSPOOL_ASYNCGETREMOTENOTIFICATIONS, api_winspool_AsyncGetRemoteNotifications},
+ {"WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE", NDR_WINSPOOL_ASYNCINSTALLPRINTERDRIVERFROMPACKAGE, api_winspool_AsyncInstallPrinterDriverFromPackage},
+ {"WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE", NDR_WINSPOOL_ASYNCUPLOADPRINTERDRIVERPACKAGE, api_winspool_AsyncUploadPrinterDriverPackage},
+ {"WINSPOOL_ASYNCGETCOREPRINTERDRIVERS", NDR_WINSPOOL_ASYNCGETCOREPRINTERDRIVERS, api_winspool_AsyncGetCorePrinterDrivers},
+ {"WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED", NDR_WINSPOOL_ASYNCCOREPRINTERDRIVERINSTALLED, api_winspool_AsyncCorePrinterDriverInstalled},
+ {"WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH", NDR_WINSPOOL_ASYNCGETPRINTERDRIVERPACKAGEPATH, api_winspool_AsyncGetPrinterDriverPackagePath},
+ {"WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE", NDR_WINSPOOL_ASYNCDELETEPRINTERDRIVERPACKAGE, api_winspool_AsyncDeletePrinterDriverPackage},
+ {"WINSPOOL_ASYNCREADPRINTER", NDR_WINSPOOL_ASYNCREADPRINTER, api_winspool_AsyncReadPrinter},
+ {"WINSPOOL_ASYNCRESETPRINTER", NDR_WINSPOOL_ASYNCRESETPRINTER, api_winspool_AsyncResetPrinter},
+ {"WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE", NDR_WINSPOOL_ASYNCGETJOBNAMEDPROPERTYVALUE, api_winspool_AsyncGetJobNamedPropertyValue},
+ {"WINSPOOL_ASYNCSETJOBNAMEDPROPERTY", NDR_WINSPOOL_ASYNCSETJOBNAMEDPROPERTY, api_winspool_AsyncSetJobNamedProperty},
+ {"WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY", NDR_WINSPOOL_ASYNCDELETEJOBNAMEDPROPERTY, api_winspool_AsyncDeleteJobNamedProperty},
+ {"WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES", NDR_WINSPOOL_ASYNCENUMJOBNAMEDPROPERTIES, api_winspool_AsyncEnumJobNamedProperties},
+ {"WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE", NDR_WINSPOOL_ASYNCLOGJOBINFOFORBRANCHOFFICE, api_winspool_AsyncLogJobInfoForBranchOffice},
+};
+
+const struct api_struct *iremotewinspool_get_pipe_fns(int *n_fns)
+{
+ *n_fns = sizeof(api_iremotewinspool_cmds) / sizeof(struct api_struct);
+ return api_iremotewinspool_cmds;
+}
+
+NTSTATUS rpc_iremotewinspool_init(const struct rpc_srv_callbacks *rpc_srv_cb)
+{
+ return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "iremotewinspool", "iremotewinspool", &ndr_table_iremotewinspool, api_iremotewinspool_cmds, sizeof(api_iremotewinspool_cmds) / sizeof(struct api_struct), rpc_srv_cb);
+}
+
+NTSTATUS rpc_iremotewinspool_shutdown(void)
+{
+ return rpc_srv_unregister(&ndr_table_iremotewinspool);
+}
diff --git a/source3/rpc_server/wscript_build b/source3/rpc_server/wscript_build
index 1c84f019946..cfce367dfaf 100755
--- a/source3/rpc_server/wscript_build
+++ b/source3/rpc_server/wscript_build
@@ -110,7 +110,7 @@ bld.SAMBA3_SUBSYSTEM('RPC_SPOOLSS',
bld.SAMBA3_SUBSYSTEM('RPC_IREMOTEWINSPOOL',
source='''
spoolss/srv_iremotewinspool_nt.c
- ../../librpc/gen_ndr/srv_winspool.c
+ spoolss/srv_iremotewinspool.c
''',
deps='RPC_SPOOLSS')