The branch, master has been updated via 64cec9984346ce1c8aeb170cd55be6e7e6784919 (commit) via 9877f3d574392681ef121f8c9c038596f6d333dc (commit) via 742270eb2dd521fa5010786536f000823fb67188 (commit) via 41234af8c48db99b65a3c5a0e19874dc90e4af05 (commit) via 055a047e7698d091f6abe2cc350e977aafd121fe (commit) from df17774412b8a31880ec26f4a23c45ad1213ffdf (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 64cec9984346ce1c8aeb170cd55be6e7e6784919 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 16 16:42:21 2009 +0100 s4-smbtorture: fix spoolss test after count out,ref idl changes. Guenther commit 9877f3d574392681ef121f8c9c038596f6d333dc Author: Günther Deschner <g...@samba.org> Date: Mon Feb 16 16:41:48 2009 +0100 s4-spoolss: fix spoolss server after out,ref count pointer changes. Guenther commit 742270eb2dd521fa5010786536f000823fb67188 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 16 16:40:54 2009 +0100 spoolss: fix spoolss helper for out ref count pointer. Guenther commit 41234af8c48db99b65a3c5a0e19874dc90e4af05 Author: Günther Deschner <g...@samba.org> Date: Tue Feb 17 16:15:32 2009 +0100 s3: re-run make samba3-idl. Guenther commit 055a047e7698d091f6abe2cc350e977aafd121fe Author: Günther Deschner <g...@samba.org> Date: Mon Feb 16 16:25:30 2009 +0100 spoolss: in enum-calls make [out] count a ref pointer. Guenther ----------------------------------------------------------------------- Summary of changes: librpc/gen_ndr/cli_spoolss.c | 56 +++++----- librpc/gen_ndr/cli_spoolss.h | 28 ++-- librpc/gen_ndr/ndr_spoolss.c | 175 +++++++++++++++++++++------ librpc/gen_ndr/spoolss.h | 42 +++--- librpc/gen_ndr/srv_spoolss.c | 105 ++++++++++++++-- librpc/idl/spoolss.idl | 56 +++++----- librpc/ndr/ndr_spoolss_buf.c | 6 +- source4/ntptr/simple_ldb/ntptr_simple_ldb.c | 9 +- source4/rpc_server/spoolss/dcesrv_spoolss.c | 20 ++-- source4/torture/rpc/samba3rpc.c | 4 +- source4/torture/rpc/spoolss.c | 36 +++++-- source4/torture/rpc/spoolss_win.c | 8 +- 12 files changed, 378 insertions(+), 167 deletions(-) Changeset truncated at 500 lines: diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 0c70b83..72b5e2e 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -13,9 +13,9 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror) { struct spoolss_EnumPrinters r; @@ -51,11 +51,11 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; if (info && r.out.info) { - memcpy(info, r.out.info, count * sizeof(*info)); + memcpy(info, r.out.info, *count * sizeof(*info)); } *needed = *r.out.needed; - return NT_STATUS_NOT_SUPPORTED; /* Return result */ if (werror) { @@ -230,9 +230,9 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror) { struct spoolss_EnumJobs r; @@ -269,11 +269,11 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; if (info && r.out.info) { - memcpy(info, r.out.info, count * sizeof(*info)); + memcpy(info, r.out.info, *count * sizeof(*info)); } *needed = *r.out.needed; - return NT_STATUS_NOT_SUPPORTED; /* Return result */ if (werror) { @@ -527,9 +527,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror) { struct spoolss_EnumPrinterDrivers r; @@ -565,11 +565,11 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; if (info && r.out.info) { - memcpy(info, r.out.info, count * sizeof(*info)); + memcpy(info, r.out.info, *count * sizeof(*info)); } *needed = *r.out.needed; - return NT_STATUS_NOT_SUPPORTED; /* Return result */ if (werror) { @@ -780,9 +780,9 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror) { struct spoolss_EnumPrintProcessors r; @@ -818,11 +818,11 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; if (info && r.out.info) { - memcpy(info, r.out.info, count * sizeof(*info)); + memcpy(info, r.out.info, *count * sizeof(*info)); } *needed = *r.out.needed; - return NT_STATUS_NOT_SUPPORTED; /* Return result */ if (werror) { @@ -1684,9 +1684,9 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror) { struct spoolss_EnumForms r; @@ -1721,11 +1721,11 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; if (info && r.out.info) { - memcpy(info, r.out.info, count * sizeof(*info)); + memcpy(info, r.out.info, *count * sizeof(*info)); } *needed = *r.out.needed; - return NT_STATUS_NOT_SUPPORTED; /* Return result */ if (werror) { @@ -1741,9 +1741,9 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror) { struct spoolss_EnumPorts r; @@ -1778,11 +1778,11 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; if (info && r.out.info) { - memcpy(info, r.out.info, count * sizeof(*info)); + memcpy(info, r.out.info, *count * sizeof(*info)); } *needed = *r.out.needed; - return NT_STATUS_NOT_SUPPORTED; /* Return result */ if (werror) { @@ -1798,9 +1798,9 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror) { struct spoolss_EnumMonitors r; @@ -1835,11 +1835,11 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; if (info && r.out.info) { - memcpy(info, r.out.info, count * sizeof(*info)); + memcpy(info, r.out.info, *count * sizeof(*info)); } *needed = *r.out.needed; - return NT_STATUS_NOT_SUPPORTED; /* Return result */ if (werror) { diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index 80795c3..6314ec2 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -8,9 +8,9 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -45,9 +45,9 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -86,9 +86,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -123,9 +123,9 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -238,9 +238,9 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -248,9 +248,9 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -258,9 +258,9 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, uint32_t level /* [in] */, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, - union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, + uint32_t *count /* [out] [ref] */, + union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, uint32_t *needed /* [out] [ref] */, - uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index fe1d733..b9164e3 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -12501,7 +12501,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinters(struct ndr_push *ndr, return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count)); + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -12516,6 +12519,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; TALLOC_CTX *_mem_save_needed_0; + TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -12554,6 +12558,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); + NDR_PULL_ALLOC(ndr, r->out.count); + ZERO_STRUCTP(r->out.count); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -12575,7 +12581,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -12657,12 +12669,16 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinters(struct ndr_print *ndr, const char * if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrinters"); ndr->depth++; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; if (r->out.info) { - ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->out.count); + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<r->out.count;cntr_info_1++) { + for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { char *idx_1=NULL; if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); @@ -12677,7 +12693,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinters(struct ndr_print *ndr, const char * ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); ndr->depth--; - ndr_print_uint32(ndr, "count", r->out.count); ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -13076,7 +13091,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumJobs(struct ndr_push *ndr, int return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count)); + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -13090,6 +13108,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; TALLOC_CTX *_mem_save_needed_0; + TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -13118,6 +13137,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); + NDR_PULL_ALLOC(ndr, r->out.count); + ZERO_STRUCTP(r->out.count); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -13139,7 +13160,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -13220,12 +13247,16 @@ _PUBLIC_ void ndr_print_spoolss_EnumJobs(struct ndr_print *ndr, const char *name if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumJobs"); ndr->depth++; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; if (r->out.info) { - ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->out.count); + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<r->out.count;cntr_info_1++) { + for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { char *idx_1=NULL; if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); @@ -13240,7 +13271,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumJobs(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); ndr->depth--; - ndr_print_uint32(ndr, "count", r->out.count); ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -13698,7 +13728,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinterDrivers(struct ndr_push return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count)); + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -13715,6 +13748,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; TALLOC_CTX *_mem_save_needed_0; + TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -13770,6 +13804,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); + NDR_PULL_ALLOC(ndr, r->out.count); + ZERO_STRUCTP(r->out.count); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -13791,7 +13827,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -13878,12 +13920,16 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDrivers(struct ndr_print *ndr, const if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrinterDrivers"); ndr->depth++; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; if (r->out.info) { - ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->out.count); + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<r->out.count;cntr_info_1++) { + for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { char *idx_1=NULL; if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); @@ -13898,7 +13944,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDrivers(struct ndr_print *ndr, const ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); ndr->depth--; - ndr_print_uint32(ndr, "count", r->out.count); ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -14381,7 +14426,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrintProcessors(struct ndr_push return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count)); + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); -- Samba Shared Repository