diff options
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.c | 56 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.h | 28 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.c | 175 | ||||
-rw-r--r-- | librpc/gen_ndr/spoolss.h | 42 | ||||
-rw-r--r-- | librpc/gen_ndr/srv_spoolss.c | 105 |
5 files changed, 294 insertions, 112 deletions
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 0c70b83e3c..72b5e2ecda 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 80795c3954..6314ec2bca 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 fe1d733b44..b9164e3c83 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -14398,6 +14446,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(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); @@ -14453,6 +14502,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(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)); @@ -14474,7 +14525,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(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; @@ -14561,12 +14618,16 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrintProcessors(struct ndr_print *ndr, const if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrintProcessors"); 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); @@ -14581,7 +14642,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrintProcessors(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--; } @@ -16072,7 +16132,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumForms(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; @@ -16086,6 +16149,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(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); @@ -16112,6 +16176,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(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)); @@ -16133,7 +16199,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(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; @@ -16212,12 +16284,16 @@ _PUBLIC_ void ndr_print_spoolss_EnumForms(struct ndr_print *ndr, const char *nam if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumForms"); 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); @@ -16232,7 +16308,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumForms(struct ndr_print *ndr, const char *nam 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--; } @@ -16265,7 +16340,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPorts(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; @@ -16280,6 +16358,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(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); @@ -16317,6 +16396,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(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)); @@ -16338,7 +16419,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(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; @@ -16419,12 +16506,16 @@ _PUBLIC_ void ndr_print_spoolss_EnumPorts(struct ndr_print *ndr, const char *nam if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPorts"); 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); @@ -16439,7 +16530,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumPorts(struct ndr_print *ndr, const char *nam 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--; } @@ -16472,7 +16562,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumMonitors(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; @@ -16487,6 +16580,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(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); @@ -16524,6 +16618,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(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)); @@ -16545,7 +16641,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(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; @@ -16626,12 +16728,16 @@ _PUBLIC_ void ndr_print_spoolss_EnumMonitors(struct ndr_print *ndr, const char * if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumMonitors"); 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); @@ -16646,7 +16752,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumMonitors(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--; } diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index 751085c1cc..f3f430de32 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -1161,7 +1161,7 @@ struct _spoolss_EnumPrinters { struct { DATA_BLOB *info;/* [unique] */ uint32_t *needed;/* [ref] */ - uint32_t count; + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -1191,9 +1191,9 @@ struct spoolss_EnumPrinters { } in; struct { - union spoolss_PrinterInfo *info;/* [unique,switch_is(level),size_is(count)] */ + uint32_t *count;/* [ref] */ + union spoolss_PrinterInfo *info;/* [unique,switch_is(level),size_is(*count)] */ uint32_t *needed;/* [ref] */ - uint32_t count; WERROR result; } out; @@ -1262,7 +1262,7 @@ struct _spoolss_EnumJobs { struct { DATA_BLOB *info;/* [unique] */ uint32_t *needed;/* [ref] */ - uint32_t count; + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -1293,9 +1293,9 @@ struct spoolss_EnumJobs { } in; struct { - union spoolss_JobInfo *info;/* [unique,switch_is(level),size_is(count)] */ + uint32_t *count;/* [ref] */ + union spoolss_JobInfo *info;/* [unique,switch_is(level),size_is(*count)] */ uint32_t *needed;/* [ref] */ - uint32_t count; WERROR result; } out; @@ -1381,7 +1381,7 @@ struct _spoolss_EnumPrinterDrivers { struct { DATA_BLOB *info;/* [unique] */ uint32_t *needed;/* [ref] */ - uint32_t count; + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -1411,9 +1411,9 @@ struct spoolss_EnumPrinterDrivers { } in; struct { - union spoolss_DriverInfo *info;/* [unique,switch_is(level),size_is(count)] */ + uint32_t *count;/* [ref] */ + union spoolss_DriverInfo *info;/* [unique,switch_is(level),size_is(*count)] */ uint32_t *needed;/* [ref] */ - uint32_t count; WERROR result; } out; @@ -1487,7 +1487,7 @@ struct _spoolss_EnumPrintProcessors { struct { DATA_BLOB *info;/* [unique] */ uint32_t *needed;/* [ref] */ - uint32_t count; + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -1517,9 +1517,9 @@ struct spoolss_EnumPrintProcessors { } in; struct { - union spoolss_PrintProcessorInfo *info;/* [unique,switch_is(level),size_is(count)] */ + uint32_t *count;/* [ref] */ + union spoolss_PrintProcessorInfo *info;/* [unique,switch_is(level),size_is(*count)] */ uint32_t *needed;/* [ref] */ - uint32_t count; WERROR result; } out; @@ -1839,7 +1839,7 @@ struct _spoolss_EnumForms { struct { DATA_BLOB *info;/* [unique] */ uint32_t *needed;/* [ref] */ - uint32_t count; + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -1868,9 +1868,9 @@ struct spoolss_EnumForms { } in; struct { - union spoolss_FormInfo *info;/* [unique,switch_is(level),size_is(count)] */ + uint32_t *count;/* [ref] */ + union spoolss_FormInfo *info;/* [unique,switch_is(level),size_is(*count)] */ uint32_t *needed;/* [ref] */ - uint32_t count; WERROR result; } out; @@ -1888,7 +1888,7 @@ struct _spoolss_EnumPorts { struct { DATA_BLOB *info;/* [unique] */ uint32_t *needed;/* [ref] */ - uint32_t count; + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -1917,9 +1917,9 @@ struct spoolss_EnumPorts { } in; struct { - union spoolss_PortInfo *info;/* [unique,switch_is(level),size_is(count)] */ + uint32_t *count;/* [ref] */ + union spoolss_PortInfo *info;/* [unique,switch_is(level),size_is(*count)] */ uint32_t *needed;/* [ref] */ - uint32_t count; WERROR result; } out; @@ -1937,7 +1937,7 @@ struct _spoolss_EnumMonitors { struct { DATA_BLOB *info;/* [unique] */ uint32_t *needed;/* [ref] */ - uint32_t count; + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -1966,9 +1966,9 @@ struct spoolss_EnumMonitors { } in; struct { - union spoolss_MonitorInfo *info;/* [unique,switch_is(level),size_is(count)] */ + uint32_t *count;/* [ref] */ + union spoolss_MonitorInfo *info;/* [unique,switch_is(level),size_is(*count)] */ uint32_t *needed;/* [ref] */ - uint32_t count; WERROR result; } out; diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c index eaee600b62..f48cf51b9b 100644 --- a/librpc/gen_ndr/srv_spoolss.c +++ b/librpc/gen_ndr/srv_spoolss.c @@ -45,7 +45,13 @@ static bool api_spoolss_EnumPrinters(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(r, union spoolss_PrinterInfo, r->out.count); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero_array(r, union spoolss_PrinterInfo, *r->out.count); if (r->out.info == NULL) { talloc_free(r); return false; @@ -370,7 +376,13 @@ static bool api_spoolss_EnumJobs(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(r, union spoolss_JobInfo, r->out.count); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero_array(r, union spoolss_JobInfo, *r->out.count); if (r->out.info == NULL) { talloc_free(r); return false; @@ -834,7 +846,13 @@ static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(r, union spoolss_DriverInfo, r->out.count); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero_array(r, union spoolss_DriverInfo, *r->out.count); if (r->out.info == NULL) { talloc_free(r); return false; @@ -1225,7 +1243,13 @@ static bool api_spoolss_EnumPrintProcessors(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(r, union spoolss_PrintProcessorInfo, r->out.count); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero_array(r, union spoolss_PrintProcessorInfo, *r->out.count); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2688,7 +2712,13 @@ static bool api_spoolss_EnumForms(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(r, union spoolss_FormInfo, r->out.count); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero_array(r, union spoolss_FormInfo, *r->out.count); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2774,7 +2804,13 @@ static bool api_spoolss_EnumPorts(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(r, union spoolss_PortInfo, r->out.count); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero_array(r, union spoolss_PortInfo, *r->out.count); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2860,7 +2896,13 @@ static bool api_spoolss_EnumMonitors(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(r, union spoolss_MonitorInfo, r->out.count); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero_array(r, union spoolss_MonitorInfo, *r->out.count); if (r->out.info == NULL) { talloc_free(r); return false; @@ -7491,7 +7533,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTERS: { struct spoolss_EnumPrinters *r = (struct spoolss_EnumPrinters *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrinterInfo, r->out.count); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrinterInfo, *r->out.count); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7543,7 +7590,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMJOBS: { struct spoolss_EnumJobs *r = (struct spoolss_EnumJobs *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(mem_ctx, union spoolss_JobInfo, r->out.count); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero_array(mem_ctx, union spoolss_JobInfo, *r->out.count); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7601,7 +7653,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTERDRIVERS: { struct spoolss_EnumPrinterDrivers *r = (struct spoolss_EnumPrinterDrivers *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(mem_ctx, union spoolss_DriverInfo, r->out.count); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero_array(mem_ctx, union spoolss_DriverInfo, *r->out.count); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7653,7 +7710,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTPROCESSORS: { struct spoolss_EnumPrintProcessors *r = (struct spoolss_EnumPrintProcessors *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrintProcessorInfo, r->out.count); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrintProcessorInfo, *r->out.count); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7832,7 +7894,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMFORMS: { struct spoolss_EnumForms *r = (struct spoolss_EnumForms *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(mem_ctx, union spoolss_FormInfo, r->out.count); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero_array(mem_ctx, union spoolss_FormInfo, *r->out.count); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7849,7 +7916,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPORTS: { struct spoolss_EnumPorts *r = (struct spoolss_EnumPorts *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(mem_ctx, union spoolss_PortInfo, r->out.count); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero_array(mem_ctx, union spoolss_PortInfo, *r->out.count); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7866,7 +7938,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMMONITORS: { struct spoolss_EnumMonitors *r = (struct spoolss_EnumMonitors *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero_array(mem_ctx, union spoolss_MonitorInfo, r->out.count); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero_array(mem_ctx, union spoolss_MonitorInfo, *r->out.count); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } |