From 4f6556d6c0c9b82770e14ce9002a90fd187e9b6c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 5 Feb 2009 02:08:04 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/misc.h | 6 ++++++ librpc/gen_ndr/ndr_misc.c | 36 ++++++++++++++++++++++++++++++++++++ librpc/gen_ndr/ndr_misc.h | 3 +++ 3 files changed, 45 insertions(+) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/misc.h b/librpc/gen_ndr/misc.h index de4abdcae5..e000cb0624 100644 --- a/librpc/gen_ndr/misc.h +++ b/librpc/gen_ndr/misc.h @@ -42,4 +42,10 @@ enum netr_SchannelType #endif ; +struct KRB5_EDATA_NTSTATUS { + NTSTATUS ntstatus; + uint32_t unknown1; + uint32_t unknown2; +}/* [public] */; + #endif /* _HEADER_misc */ diff --git a/librpc/gen_ndr/ndr_misc.c b/librpc/gen_ndr/ndr_misc.c index 83c977245a..28c8560819 100644 --- a/librpc/gen_ndr/ndr_misc.c +++ b/librpc/gen_ndr/ndr_misc.c @@ -132,3 +132,39 @@ _PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *nam ndr_print_enum(ndr, name, "ENUM", val, r); } +_PUBLIC_ enum ndr_err_code ndr_push_KRB5_EDATA_NTSTATUS(struct ndr_push *ndr, int ndr_flags, const struct KRB5_EDATA_NTSTATUS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->ntstatus)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_KRB5_EDATA_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, struct KRB5_EDATA_NTSTATUS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->ntstatus)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_KRB5_EDATA_NTSTATUS(struct ndr_print *ndr, const char *name, const struct KRB5_EDATA_NTSTATUS *r) +{ + ndr_print_struct(ndr, name, "KRB5_EDATA_NTSTATUS"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "ntstatus", r->ntstatus); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr->depth--; +} + diff --git a/librpc/gen_ndr/ndr_misc.h b/librpc/gen_ndr/ndr_misc.h index a38b3c9948..938c946b73 100644 --- a/librpc/gen_ndr/ndr_misc.h +++ b/librpc/gen_ndr/ndr_misc.h @@ -20,4 +20,7 @@ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const stru enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r); enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r); void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r); +enum ndr_err_code ndr_push_KRB5_EDATA_NTSTATUS(struct ndr_push *ndr, int ndr_flags, const struct KRB5_EDATA_NTSTATUS *r); +enum ndr_err_code ndr_pull_KRB5_EDATA_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, struct KRB5_EDATA_NTSTATUS *r); +void ndr_print_KRB5_EDATA_NTSTATUS(struct ndr_print *ndr, const char *name, const struct KRB5_EDATA_NTSTATUS *r); #endif /* _HEADER_NDR_misc */ -- cgit From cf15c687d279d3807caa90560d8799d6b00f005b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 13:57:13 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/cli_spoolss.c | 100 ++++---- librpc/gen_ndr/cli_spoolss.h | 49 ++-- librpc/gen_ndr/ndr_spoolss.c | 527 +++++++++++++++++++++++++++++++++++-------- librpc/gen_ndr/spoolss.h | 51 ++--- librpc/gen_ndr/srv_spoolss.c | 47 ++-- 5 files changed, 551 insertions(+), 223 deletions(-) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 1071f2a3a8..dfb0060d8b 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -173,7 +173,7 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_GetJob r; @@ -212,7 +212,7 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli, if (info && r.out.info) { *info = *r.out.info; } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -427,7 +427,7 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_GetPrinter r; @@ -465,7 +465,7 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli, if (info && r.out.info) { *info = *r.out.info; } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -624,7 +624,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_GetPrinterDriverDirectory r; @@ -663,7 +663,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli, if (info && r.out.info) { *info = *r.out.info; } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -868,7 +868,7 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, uint32_t level /* [in] */, union spoolss_DocumentInfo info /* [in] [switch_is(level)] */, - uint32_t job_id /* [out] */, + uint32_t *job_id /* [out] [ref] */, WERROR *werror) { struct spoolss_StartDocPrinter r; @@ -902,7 +902,7 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; + *job_id = *r.out.job_id; /* Return result */ if (werror) { @@ -960,7 +960,7 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, DATA_BLOB data /* [in] */, uint32_t _data_size /* [in] [value(r->in.data.length)] */, - uint32_t num_written /* [out] */, + uint32_t *num_written /* [out] [ref] */, WERROR *werror) { struct spoolss_WritePrinter r; @@ -994,7 +994,7 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; + *num_written = *r.out.num_written; /* Return result */ if (werror) { @@ -1093,9 +1093,9 @@ NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, + uint8_t *data /* [out] [ref,size_is(data_size)] */, uint32_t data_size /* [in] */, - DATA_BLOB data /* [out] */, - uint32_t _data_size /* [out] [value(r->out.data.length)] */, + uint32_t *_data_size /* [out] [ref] */, WERROR *werror) { struct spoolss_ReadPrinter r; @@ -1128,8 +1128,8 @@ NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; + memcpy(data, r.out.data, r.in.data_size * sizeof(*data)); + *_data_size = *r.out._data_size; /* Return result */ if (werror) { @@ -1553,7 +1553,7 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_GetForm r; @@ -1592,7 +1592,7 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli, if (info && r.out.info) { *info = *r.out.info; } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -2494,9 +2494,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli, uint32_t client_major_version /* [in] */, uint32_t client_minor_version /* [in] */, DATA_BLOB *info /* [out] [unique] */, - uint32_t needed /* [out] */, - uint32_t server_major_version /* [out] */, - uint32_t server_minor_version /* [out] */, + uint32_t *needed /* [out] [ref] */, + uint32_t *server_major_version /* [out] [ref] */, + uint32_t *server_minor_version /* [out] [ref] */, WERROR *werror) { struct spoolss_GetPrinterDriver2 r; @@ -2537,9 +2537,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli, if (info && r.out.info) { *info = *r.out.info; } - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; + *server_major_version = *r.out.server_major_version; + *server_minor_version = *r.out.server_minor_version; /* Return result */ if (werror) { @@ -3637,10 +3637,10 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, + uint32_t *type /* [out] [ref] */, + uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - uint32_t type /* [out] */, - DATA_BLOB buffer /* [out] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_GetPrinterDataEx r; @@ -3675,9 +3675,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; + *type = *r.out.type; + memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer)); + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -3691,10 +3691,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, + uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - DATA_BLOB buffer /* [out] */, - uint32_t needed /* [out] */, - uint32_t count /* [out] */, + uint32_t *needed /* [out] [ref] */, + uint32_t *count /* [out] [ref] */, WERROR *werror) { struct spoolss_EnumPrinterDataEx r; @@ -3728,9 +3728,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; + memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer)); + *needed = *r.out.needed; + *count = *r.out.count; /* Return result */ if (werror) { @@ -3744,9 +3744,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint32_t key_buffer_size /* [out] */, - uint16_t *key_buffer /* [out] */, - uint32_t needed /* [in,out] */, + uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */, + uint32_t key_buffer_size /* [in] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_EnumPrinterKey r; @@ -3755,7 +3755,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, /* In parameters */ r.in.handle = handle; r.in.key_name = key_name; - r.in.needed = needed; + r.in.key_buffer_size = key_buffer_size; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r); @@ -3780,9 +3780,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; - memcpy(key_buffer, r.out.key_buffer, key_buffer_size * sizeof(*key_buffer)); - return NT_STATUS_NOT_SUPPORTED; + memcpy(key_buffer, r.out.key_buffer, r.in.key_buffer_size / 2 * sizeof(*key_buffer)); + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -4091,11 +4090,10 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli, const char *function_name /* [in] [charset(UTF16)] */, DATA_BLOB in_data /* [in] */, uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */, - uint32_t offered /* [in] */, - uint32_t unknown1 /* [in] */, - DATA_BLOB out_data /* [out] */, - uint32_t needed /* [out] */, - uint32_t unknown2 /* [out] */, + uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */, + uint32_t out_data_size /* [in] */, + uint32_t *needed /* [out] [ref] */, + uint32_t *status_code /* [in,out] [ref] */, WERROR *werror) { struct spoolss_XcvData r; @@ -4106,8 +4104,8 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli, r.in.function_name = function_name; r.in.in_data = in_data; r.in._in_data_length = _in_data_length; - r.in.offered = offered; - r.in.unknown1 = unknown1; + r.in.out_data_size = out_data_size; + r.in.status_code = status_code; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_XcvData, &r); @@ -4132,9 +4130,9 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; + memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data)); + *needed = *r.out.needed; + *status_code = *r.out.status_code; /* Return result */ if (werror) { diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index ba7de89413..b1adf39e4d 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -35,7 +35,7 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -72,7 +72,7 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -99,7 +99,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -130,7 +130,7 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, uint32_t level /* [in] */, union spoolss_DocumentInfo info /* [in] [switch_is(level)] */, - uint32_t job_id /* [out] */, + uint32_t *job_id /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -141,7 +141,7 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, DATA_BLOB data /* [in] */, uint32_t _data_size /* [in] [value(r->in.data.length)] */, - uint32_t num_written /* [out] */, + uint32_t *num_written /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -154,9 +154,9 @@ NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, + uint8_t *data /* [out] [ref,size_is(data_size)] */, uint32_t data_size /* [in] */, - DATA_BLOB data /* [out] */, - uint32_t _data_size /* [out] [value(r->out.data.length)] */, + uint32_t *_data_size /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -211,7 +211,7 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -311,9 +311,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli, uint32_t client_major_version /* [in] */, uint32_t client_minor_version /* [in] */, DATA_BLOB *info /* [out] [unique] */, - uint32_t needed /* [out] */, - uint32_t server_major_version /* [out] */, - uint32_t server_minor_version /* [out] */, + uint32_t *needed /* [out] [ref] */, + uint32_t *server_major_version /* [out] [ref] */, + uint32_t *server_minor_version /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -441,27 +441,27 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, + uint32_t *type /* [out] [ref] */, + uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - uint32_t type /* [out] */, - DATA_BLOB buffer /* [out] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, + uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - DATA_BLOB buffer /* [out] */, - uint32_t needed /* [out] */, - uint32_t count /* [out] */, + uint32_t *needed /* [out] [ref] */, + uint32_t *count /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint32_t key_buffer_size /* [out] */, - uint16_t *key_buffer /* [out] */, - uint32_t needed /* [in,out] */, + uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */, + uint32_t key_buffer_size /* [in] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -493,11 +493,10 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli, const char *function_name /* [in] [charset(UTF16)] */, DATA_BLOB in_data /* [in] */, uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */, - uint32_t offered /* [in] */, - uint32_t unknown1 /* [in] */, - DATA_BLOB out_data /* [out] */, - uint32_t needed /* [out] */, - uint32_t unknown2 /* [out] */, + uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */, + uint32_t out_data_size /* [in] */, + uint32_t *needed /* [out] [ref] */, + uint32_t *status_code /* [in,out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPrinterDriverEx(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 a677f532db..77321b4997 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -9447,7 +9447,10 @@ static enum ndr_err_code ndr_push_spoolss_GetJob(struct ndr_push *ndr, int flags NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); } } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -9460,6 +9463,7 @@ static enum ndr_err_code ndr_pull_spoolss_GetJob(struct ndr_pull *ndr, int flags TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9485,6 +9489,8 @@ static enum ndr_err_code ndr_pull_spoolss_GetJob(struct ndr_pull *ndr, int flags NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -9505,7 +9511,13 @@ static enum ndr_err_code ndr_pull_spoolss_GetJob(struct ndr_pull *ndr, int flags } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -9546,7 +9558,10 @@ _PUBLIC_ void ndr_print_spoolss_GetJob(struct ndr_print *ndr, const char *name, ndr_print_spoolss_JobInfo(ndr, "info", r->out.info); } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -9932,7 +9947,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_GetPrinter(struct ndr_push *ndr, int NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); } } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -9945,6 +9963,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinter(struct ndr_pull *ndr, int TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9969,6 +9988,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinter(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -9989,7 +10010,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinter(struct ndr_pull *ndr, int } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -10029,7 +10056,10 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinter(struct ndr_print *ndr, const char *na ndr_print_spoolss_PrinterInfo(ndr, "info", r->out.info); } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -10378,7 +10408,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_GetPrinterDriverDirectory(struct ndr NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); } } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -10394,6 +10427,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinterDriverDirectory(struct ndr TALLOC_CTX *_mem_save_environment_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -10447,6 +10481,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinterDriverDirectory(struct ndr NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -10467,7 +10503,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinterDriverDirectory(struct ndr } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -10515,7 +10557,10 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDriverDirectory(struct ndr_print *ndr, ndr_print_spoolss_DriverDirectoryInfo(ndr, "info", r->out.info); } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -10955,7 +11000,10 @@ static enum ndr_err_code ndr_push_spoolss_StartDocPrinter(struct ndr_push *ndr, NDR_CHECK(ndr_push_spoolss_DocumentInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.job_id)); + if (r->out.job_id == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.job_id)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -10964,6 +11012,7 @@ static enum ndr_err_code ndr_push_spoolss_StartDocPrinter(struct ndr_push *ndr, static enum ndr_err_code ndr_pull_spoolss_StartDocPrinter(struct ndr_pull *ndr, int flags, struct spoolss_StartDocPrinter *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_job_id_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -10977,9 +11026,17 @@ static enum ndr_err_code ndr_pull_spoolss_StartDocPrinter(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level)); NDR_CHECK(ndr_pull_spoolss_DocumentInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); + NDR_PULL_ALLOC(ndr, r->out.job_id); + ZERO_STRUCTP(r->out.job_id); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.job_id)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.job_id); + } + _mem_save_job_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.job_id, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.job_id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_job_id_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -11007,7 +11064,10 @@ _PUBLIC_ void ndr_print_spoolss_StartDocPrinter(struct ndr_print *ndr, const cha if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_StartDocPrinter"); ndr->depth++; - ndr_print_uint32(ndr, "job_id", r->out.job_id); + ndr_print_ptr(ndr, "job_id", r->out.job_id); + ndr->depth++; + ndr_print_uint32(ndr, "job_id", *r->out.job_id); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -11082,7 +11142,10 @@ static enum ndr_err_code ndr_push_spoolss_WritePrinter(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.data.length)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.num_written)); + if (r->out.num_written == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_written)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -11091,6 +11154,7 @@ static enum ndr_err_code ndr_push_spoolss_WritePrinter(struct ndr_push *ndr, int static enum ndr_err_code ndr_pull_spoolss_WritePrinter(struct ndr_pull *ndr, int flags, struct spoolss_WritePrinter *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_num_written_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11103,9 +11167,17 @@ static enum ndr_err_code ndr_pull_spoolss_WritePrinter(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->in.data)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in._data_size)); + NDR_PULL_ALLOC(ndr, r->out.num_written); + ZERO_STRUCTP(r->out.num_written); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.num_written)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_written); + } + _mem_save_num_written_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_written, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_written)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_written_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -11132,7 +11204,10 @@ _PUBLIC_ void ndr_print_spoolss_WritePrinter(struct ndr_print *ndr, const char * if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_WritePrinter"); ndr->depth++; - ndr_print_uint32(ndr, "num_written", r->out.num_written); + ndr_print_ptr(ndr, "num_written", r->out.num_written); + ndr->depth++; + ndr_print_uint32(ndr, "num_written", *r->out.num_written); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -11263,8 +11338,15 @@ static enum ndr_err_code ndr_push_spoolss_ReadPrinter(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.data_size)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.data.length)); + if (r->out.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.data_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.data_size)); + if (r->out._data_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out._data_size)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -11273,6 +11355,7 @@ static enum ndr_err_code ndr_push_spoolss_ReadPrinter(struct ndr_push *ndr, int static enum ndr_err_code ndr_pull_spoolss_ReadPrinter(struct ndr_pull *ndr, int flags, struct spoolss_ReadPrinter *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save__data_size_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11284,11 +11367,28 @@ static enum ndr_err_code ndr_pull_spoolss_ReadPrinter(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.data_size)); + NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.data_size); + memset(CONST_DISCARD(struct spoolss_ReadPrinter *,r->out.data), 0, (r->in.data_size) * sizeof(*r->out.data)); + NDR_PULL_ALLOC(ndr, r->out._data_size); + ZERO_STRUCTP(r->out._data_size); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.data)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out._data_size)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out._data_size); + } + _mem_save__data_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out._data_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out._data_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save__data_size_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.data_size)); + } } return NDR_ERR_SUCCESS; } @@ -11313,8 +11413,14 @@ _PUBLIC_ void ndr_print_spoolss_ReadPrinter(struct ndr_print *ndr, const char *n if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_ReadPrinter"); ndr->depth++; - ndr_print_DATA_BLOB(ndr, "data", r->out.data); - ndr_print_uint32(ndr, "_data_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->out.data.length:r->out._data_size); + ndr_print_ptr(ndr, "data", r->out.data); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->out.data, r->in.data_size); + ndr->depth--; + ndr_print_ptr(ndr, "_data_size", r->out._data_size); + ndr->depth++; + ndr_print_uint32(ndr, "_data_size", *r->out._data_size); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -11948,7 +12054,10 @@ static enum ndr_err_code ndr_push_spoolss_GetForm(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); } } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -11961,6 +12070,7 @@ static enum ndr_err_code ndr_pull_spoolss_GetForm(struct ndr_pull *ndr, int flag TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11992,6 +12102,8 @@ static enum ndr_err_code ndr_pull_spoolss_GetForm(struct ndr_pull *ndr, int flag NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -12012,7 +12124,13 @@ static enum ndr_err_code ndr_pull_spoolss_GetForm(struct ndr_pull *ndr, int flag } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -12053,7 +12171,10 @@ _PUBLIC_ void ndr_print_spoolss_GetForm(struct ndr_print *ndr, const char *name, ndr_print_spoolss_FormInfo(ndr, "info", r->out.info); } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -13429,9 +13550,18 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDriver2(struct ndr_push *ndr if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.server_major_version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.server_minor_version)); + if (r->out.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); + if (r->out.server_major_version == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.server_major_version)); + if (r->out.server_minor_version == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.server_minor_version)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -13446,6 +13576,9 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDriver2(struct ndr_pull *ndr TALLOC_CTX *_mem_save_architecture_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; + TALLOC_CTX *_mem_save_server_major_version_0; + TALLOC_CTX *_mem_save_server_minor_version_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -13490,6 +13623,12 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDriver2(struct ndr_pull *ndr NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_major_version)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_minor_version)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); + NDR_PULL_ALLOC(ndr, r->out.server_major_version); + ZERO_STRUCTP(r->out.server_major_version); + NDR_PULL_ALLOC(ndr, r->out.server_minor_version); + ZERO_STRUCTP(r->out.server_minor_version); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -13504,9 +13643,27 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDriver2(struct ndr_pull *ndr NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.server_major_version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.server_minor_version)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.server_major_version); + } + _mem_save_server_major_version_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.server_major_version, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.server_major_version)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_major_version_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.server_minor_version); + } + _mem_save_server_minor_version_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.server_minor_version, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.server_minor_version)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_minor_version_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -13553,9 +13710,18 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDriver2(struct ndr_print *ndr, const c ndr_print_DATA_BLOB(ndr, "info", *r->out.info); } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); - ndr_print_uint32(ndr, "server_major_version", r->out.server_major_version); - ndr_print_uint32(ndr, "server_minor_version", r->out.server_minor_version); + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; + ndr_print_ptr(ndr, "server_major_version", r->out.server_major_version); + ndr->depth++; + ndr_print_uint32(ndr, "server_major_version", *r->out.server_major_version); + ndr->depth--; + ndr_print_ptr(ndr, "server_minor_version", r->out.server_minor_version); + ndr->depth++; + ndr_print_uint32(ndr, "server_minor_version", *r->out.server_minor_version); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -15217,9 +15383,19 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.type)); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.buffer)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.type)); + if (r->out.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered)); + if (r->out.needed == NULL) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -15228,6 +15404,8 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr, static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterDataEx *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_type_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -15253,12 +15431,37 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.value_name, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.type); + ZERO_STRUCTP(r->out.type); + NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered); + memset(CONST_DISCARD(struct spoolss_GetPrinterDataEx *,r->out.buffer), 0, (r->in.offered) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.type)); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.buffer)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.type); + } + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered)); + } } return NDR_ERR_SUCCESS; } @@ -15285,9 +15488,18 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_GetPrinterDataEx"); ndr->depth++; - ndr_print_uint32(ndr, "type", r->out.type); - ndr_print_DATA_BLOB(ndr, "buffer", r->out.buffer); - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "type", r->out.type); + ndr->depth++; + ndr_print_uint32(ndr, "type", *r->out.type); + ndr->depth--; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -15308,9 +15520,19 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.buffer)); - 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.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered)); + if (r->out.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); + 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; @@ -15319,6 +15541,8 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_needed_0; + TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -15337,12 +15561,37 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered); + memset(CONST_DISCARD(struct spoolss_EnumPrinterDataEx *,r->out.buffer), 0, (r->in.offered) * sizeof(*r->out.buffer)); + 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_DATA_BLOB(ndr, NDR_SCALARS, &r->out.buffer)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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); + 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)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered)); + } } return NDR_ERR_SUCCESS; } @@ -15368,9 +15617,18 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrinterDataEx"); ndr->depth++; - ndr_print_DATA_BLOB(ndr, "buffer", r->out.buffer); - ndr_print_uint32(ndr, "needed", r->out.needed); - ndr_print_uint32(ndr, "count", r->out.count); + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -15379,7 +15637,7 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterKey *r) { - uint32_t cntr_key_buffer_0; + uint32_t cntr_key_buffer_1; if (flags & NDR_IN) { if (r->in.handle == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -15389,14 +15647,20 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.key_name, ndr_charset_length(r->in.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.needed)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.key_buffer_size)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.key_buffer_size)); - for (cntr_key_buffer_0 = 0; cntr_key_buffer_0 < r->out.key_buffer_size; cntr_key_buffer_0++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.key_buffer[cntr_key_buffer_0])); + if (r->out.key_buffer == NULL) { + 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->in.key_buffer_size / 2)); + for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.key_buffer[cntr_key_buffer_1])); + } + if (r->out.needed == NULL) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -15404,9 +15668,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterKey *r) { - uint32_t cntr_key_buffer_0; + uint32_t cntr_key_buffer_1; TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_key_buffer_0; + TALLOC_CTX *_mem_save_key_buffer_1; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -15424,26 +15689,41 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr, } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.needed)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.key_buffer_size)); + NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, r->in.key_buffer_size / 2); + memset(CONST_DISCARD(struct spoolss_EnumPrinterKey *,r->out.key_buffer), 0, (r->in.key_buffer_size / 2) * sizeof(*r->out.key_buffer)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.key_buffer_size)); - NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, r->out.key_buffer_size); - _mem_save_key_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.key_buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, ndr_get_array_size(ndr, &r->out.key_buffer)); + } + _mem_save_key_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.key_buffer, 0); - for (cntr_key_buffer_0 = 0; cntr_key_buffer_0 < r->out.key_buffer_size; cntr_key_buffer_0++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.key_buffer[cntr_key_buffer_0])); + for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.key_buffer[cntr_key_buffer_1])); } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_0, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_1, 0); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.key_buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.key_buffer, r->in.key_buffer_size / 2)); + } } return NDR_ERR_SUCCESS; } _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterKey *r) { - uint32_t cntr_key_buffer_0; + uint32_t cntr_key_buffer_1; ndr_print_struct(ndr, name, "spoolss_EnumPrinterKey"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -15457,24 +15737,29 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; ndr_print_string(ndr, "key_name", r->in.key_name); - ndr_print_uint32(ndr, "needed", r->in.needed); + ndr_print_uint32(ndr, "key_buffer_size", r->in.key_buffer_size); ndr->depth--; } if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrinterKey"); ndr->depth++; - ndr_print_uint32(ndr, "key_buffer_size", r->out.key_buffer_size); - ndr->print(ndr, "%s: ARRAY(%d)", "key_buffer", (int)r->out.key_buffer_size); + ndr_print_ptr(ndr, "key_buffer", r->out.key_buffer); ndr->depth++; - for (cntr_key_buffer_0=0;cntr_key_buffer_0out.key_buffer_size;cntr_key_buffer_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_key_buffer_0) != -1) { - ndr_print_uint16(ndr, "key_buffer", r->out.key_buffer[cntr_key_buffer_0]); - free(idx_0); + ndr->print(ndr, "%s: ARRAY(%d)", "key_buffer", (int)r->in.key_buffer_size / 2); + ndr->depth++; + for (cntr_key_buffer_1=0;cntr_key_buffer_1in.key_buffer_size / 2;cntr_key_buffer_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_key_buffer_1) != -1) { + ndr_print_uint16(ndr, "key_buffer", r->out.key_buffer[cntr_key_buffer_1]); + free(idx_1); } } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -15821,13 +16106,26 @@ static enum ndr_err_code ndr_push_spoolss_XcvData(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.function_name, ndr_charset_length(r->in.function_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->in.in_data)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data.length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.out_data_size)); + if (r->in.status_code == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.status_code)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.out_data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.unknown2)); + if (r->out.out_data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.out_data_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.out_data, r->in.out_data_size)); + if (r->out.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); + if (r->out.status_code == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.status_code)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -15836,6 +16134,8 @@ static enum ndr_err_code ndr_push_spoolss_XcvData(struct ndr_push *ndr, int flag static enum ndr_err_code ndr_pull_spoolss_XcvData(struct ndr_pull *ndr, int flags, struct spoolss_XcvData *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_needed_0; + TALLOC_CTX *_mem_save_status_code_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -15855,14 +16155,45 @@ static enum ndr_err_code ndr_pull_spoolss_XcvData(struct ndr_pull *ndr, int flag NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.function_name, ndr_get_array_length(ndr, &r->in.function_name), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->in.in_data)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in._in_data_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.out_data_size)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.status_code); + } + _mem_save_status_code_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.status_code, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.status_code)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_status_code_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC_N(ndr, r->out.out_data, r->in.out_data_size); + memset(CONST_DISCARD(struct spoolss_XcvData *,r->out.out_data), 0, (r->in.out_data_size) * sizeof(*r->out.out_data)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); + NDR_PULL_ALLOC(ndr, r->out.status_code); + *r->out.status_code = *r->in.status_code; } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.out_data)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.unknown2)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.out_data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.status_code); + } + _mem_save_status_code_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.status_code, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.status_code)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_status_code_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.out_data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.out_data, r->in.out_data_size)); + } } return NDR_ERR_SUCCESS; } @@ -15884,16 +16215,28 @@ _PUBLIC_ void ndr_print_spoolss_XcvData(struct ndr_print *ndr, const char *name, ndr_print_string(ndr, "function_name", r->in.function_name); ndr_print_DATA_BLOB(ndr, "in_data", r->in.in_data); ndr_print_uint32(ndr, "_in_data_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->in.in_data.length:r->in._in_data_length); - ndr_print_uint32(ndr, "offered", r->in.offered); - ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "out_data_size", r->in.out_data_size); + ndr_print_ptr(ndr, "status_code", r->in.status_code); + ndr->depth++; + ndr_print_uint32(ndr, "status_code", *r->in.status_code); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_XcvData"); ndr->depth++; - ndr_print_DATA_BLOB(ndr, "out_data", r->out.out_data); - ndr_print_uint32(ndr, "needed", r->out.needed); - ndr_print_uint32(ndr, "unknown2", r->out.unknown2); + ndr_print_ptr(ndr, "out_data", r->out.out_data); + ndr->depth++; + ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.out_data_size); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; + ndr_print_ptr(ndr, "status_code", r->out.status_code); + ndr->depth++; + ndr_print_uint32(ndr, "status_code", *r->out.status_code); + ndr->depth--; 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 49eb799079..59d5c44d3d 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -842,7 +842,7 @@ struct spoolss_GetJob { struct { union spoolss_JobInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -949,7 +949,7 @@ struct spoolss_GetPrinter { struct { union spoolss_PrinterInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1034,7 +1034,7 @@ struct spoolss_GetPrinterDriverDirectory { struct { union spoolss_DriverDirectoryInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1131,7 +1131,7 @@ struct spoolss_StartDocPrinter { } in; struct { - uint32_t job_id; + uint32_t *job_id;/* [ref] */ WERROR result; } out; @@ -1158,7 +1158,7 @@ struct spoolss_WritePrinter { } in; struct { - uint32_t num_written; + uint32_t *num_written;/* [ref] */ WERROR result; } out; @@ -1196,8 +1196,8 @@ struct spoolss_ReadPrinter { } in; struct { - DATA_BLOB data; - uint32_t _data_size;/* [value(r->out.data.length)] */ + uint8_t *data;/* [ref,size_is(data_size)] */ + uint32_t *_data_size;/* [ref] */ WERROR result; } out; @@ -1381,7 +1381,7 @@ struct spoolss_GetForm { struct { union spoolss_FormInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1697,9 +1697,9 @@ struct spoolss_GetPrinterDriver2 { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; - uint32_t server_major_version; - uint32_t server_minor_version; + uint32_t *needed;/* [ref] */ + uint32_t *server_major_version;/* [ref] */ + uint32_t *server_minor_version;/* [ref] */ WERROR result; } out; @@ -1987,9 +1987,9 @@ struct spoolss_GetPrinterDataEx { } in; struct { - uint32_t type; - DATA_BLOB buffer; - uint32_t needed; + uint32_t *type;/* [ref] */ + uint8_t *buffer;/* [ref,size_is(offered)] */ + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2004,9 +2004,9 @@ struct spoolss_EnumPrinterDataEx { } in; struct { - DATA_BLOB buffer; - uint32_t needed; - uint32_t count; + uint8_t *buffer;/* [ref,size_is(offered)] */ + uint32_t *needed;/* [ref] */ + uint32_t *count;/* [ref] */ WERROR result; } out; @@ -2017,13 +2017,12 @@ struct spoolss_EnumPrinterKey { struct { struct policy_handle *handle;/* [ref] */ const char *key_name;/* [charset(UTF16)] */ - uint32_t needed; + uint32_t key_buffer_size; } in; struct { - uint32_t key_buffer_size; - uint16_t *key_buffer; - uint32_t needed; + uint16_t *key_buffer;/* [ref,size_is(key_buffer_size/2)] */ + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2098,14 +2097,14 @@ struct spoolss_XcvData { const char *function_name;/* [charset(UTF16)] */ DATA_BLOB in_data; uint32_t _in_data_length;/* [value(r->in.in_data.length)] */ - uint32_t offered; - uint32_t unknown1; + uint32_t out_data_size; + uint32_t *status_code;/* [ref] */ } in; struct { - DATA_BLOB out_data; - uint32_t needed; - uint32_t unknown2; + uint8_t *out_data;/* [ref,size_is(out_data_size)] */ + uint32_t *needed;/* [ref] */ + uint32_t *status_code;/* [ref] */ WERROR result; } out; diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c index abf49766a4..1f7d29f39f 100644 --- a/librpc/gen_ndr/srv_spoolss.c +++ b/librpc/gen_ndr/srv_spoolss.c @@ -1787,7 +1787,7 @@ static bool api_spoolss_ReadPrinter(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.data = talloc_zero(r, DATA_BLOB); + r->out.data = talloc_zero_array(r, uint8_t, r->in.data_size); if (r->out.data == NULL) { talloc_free(r); return false; @@ -6064,7 +6064,7 @@ static bool api_spoolss_GetPrinterDataEx(pipes_struct *p) return false; } - r->out.buffer = talloc_zero(r, DATA_BLOB); + r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered); if (r->out.buffer == NULL) { talloc_free(r); return false; @@ -6150,7 +6150,7 @@ static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero(r, DATA_BLOB); + r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered); if (r->out.buffer == NULL) { talloc_free(r); return false; @@ -6242,15 +6242,14 @@ static bool api_spoolss_EnumPrinterKey(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.needed = r->in.needed; - r->out.key_buffer_size = talloc_zero(r, uint32_t); - if (r->out.key_buffer_size == NULL) { + r->out.key_buffer = talloc_zero_array(r, uint16_t, r->in.key_buffer_size / 2); + if (r->out.key_buffer == NULL) { talloc_free(r); return false; } - r->out.key_buffer = talloc_zero_array(r, uint16_t, r->out.key_buffer_size); - if (r->out.key_buffer == NULL) { + r->out.needed = talloc_zero(r, uint32_t); + if (r->out.needed == NULL) { talloc_free(r); return false; } @@ -6840,7 +6839,8 @@ static bool api_spoolss_XcvData(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.out_data = talloc_zero(r, DATA_BLOB); + r->out.status_code = r->in.status_code; + r->out.out_data = talloc_zero_array(r, uint8_t, r->in.out_data_size); if (r->out.out_data == NULL) { talloc_free(r); return false; @@ -6852,12 +6852,6 @@ static bool api_spoolss_XcvData(pipes_struct *p) return false; } - r->out.unknown2 = talloc_zero(r, uint32_t); - if (r->out.unknown2 == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_XcvData(p, r); if (p->rng_fault_state) { @@ -7770,7 +7764,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_READPRINTER: { struct spoolss_ReadPrinter *r = (struct spoolss_ReadPrinter *)_r; ZERO_STRUCT(r->out); - r->out.data = talloc_zero(mem_ctx, DATA_BLOB); + r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_size); if (r->out.data == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8266,7 +8260,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB); + r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered); if (r->out.buffer == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8283,7 +8277,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTERDATAEX: { struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r; ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB); + r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered); if (r->out.buffer == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8305,14 +8299,13 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTERKEY: { struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r; ZERO_STRUCT(r->out); - r->out.needed = r->in.needed; - r->out.key_buffer_size = talloc_zero(mem_ctx, uint32_t); - if (r->out.key_buffer_size == NULL) { + r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->in.key_buffer_size / 2); + if (r->out.key_buffer == NULL) { return NT_STATUS_NO_MEMORY; } - r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->out.key_buffer_size); - if (r->out.key_buffer == NULL) { + r->out.needed = talloc_zero(mem_ctx, uint32_t); + if (r->out.needed == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8365,7 +8358,8 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_XCVDATA: { struct spoolss_XcvData *r = (struct spoolss_XcvData *)_r; ZERO_STRUCT(r->out); - r->out.out_data = talloc_zero(mem_ctx, DATA_BLOB); + r->out.status_code = r->in.status_code; + r->out.out_data = talloc_zero_array(mem_ctx, uint8_t, r->in.out_data_size); if (r->out.out_data == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8375,11 +8369,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.unknown2 = talloc_zero(mem_ctx, uint32_t); - if (r->out.unknown2 == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_XcvData(cli->pipes_struct, r); return NT_STATUS_OK; } -- cgit From 0155b5c8439d829c8ced81cd0198830de095cca6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 17:13:58 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/cli_spoolss.c | 32 ++++----- librpc/gen_ndr/cli_spoolss.h | 16 ++--- librpc/gen_ndr/ndr_spoolss.c | 168 ++++++++++++++++++++++++++++++++++++------- librpc/gen_ndr/spoolss.h | 32 ++++----- 4 files changed, 184 insertions(+), 64 deletions(-) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index dfb0060d8b..04065c830b 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -14,7 +14,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror) { @@ -54,7 +54,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, if (info && r.out.info) { memcpy(info, r.out.info, count * sizeof(*info)); } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; return NT_STATUS_NOT_SUPPORTED; /* Return result */ @@ -231,7 +231,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror) { @@ -272,7 +272,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, if (info && r.out.info) { memcpy(info, r.out.info, count * sizeof(*info)); } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; return NT_STATUS_NOT_SUPPORTED; /* Return result */ @@ -524,7 +524,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror) { @@ -564,7 +564,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, if (info && r.out.info) { memcpy(info, r.out.info, count * sizeof(*info)); } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; return NT_STATUS_NOT_SUPPORTED; /* Return result */ @@ -771,7 +771,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror) { @@ -811,7 +811,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, if (info && r.out.info) { memcpy(info, r.out.info, count * sizeof(*info)); } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; return NT_STATUS_NOT_SUPPORTED; /* Return result */ @@ -1271,7 +1271,7 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, uint32_t offered /* [in] */, enum spoolss_PrinterDataType type /* [out] */, union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_GetPrinterData r; @@ -1307,7 +1307,7 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, /* Return variables */ return NT_STATUS_NOT_SUPPORTED; return NT_STATUS_NOT_SUPPORTED; - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -1658,7 +1658,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror) { @@ -1697,7 +1697,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, if (info && r.out.info) { memcpy(info, r.out.info, count * sizeof(*info)); } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; return NT_STATUS_NOT_SUPPORTED; /* Return result */ @@ -1715,7 +1715,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror) { @@ -1754,7 +1754,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, if (info && r.out.info) { memcpy(info, r.out.info, count * sizeof(*info)); } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; return NT_STATUS_NOT_SUPPORTED; /* Return result */ @@ -1772,7 +1772,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror) { @@ -1811,7 +1811,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, if (info && r.out.info) { memcpy(info, r.out.info, count * sizeof(*info)); } - return NT_STATUS_NOT_SUPPORTED; + *needed = *r.out.needed; return NT_STATUS_NOT_SUPPORTED; /* Return result */ diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index b1adf39e4d..bea04404a2 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -9,7 +9,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli, @@ -46,7 +46,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli, @@ -85,7 +85,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli, @@ -119,7 +119,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli, @@ -175,7 +175,7 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, uint32_t offered /* [in] */, enum spoolss_PrinterDataType type /* [out] */, union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -227,7 +227,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, @@ -237,7 +237,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, @@ -247,7 +247,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */, - uint32_t needed /* [out] */, + uint32_t *needed /* [out] [ref] */, uint32_t count /* [out] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli, diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index 77321b4997..20d32559f1 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -9029,7 +9029,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinters(struct ndr_push *ndr, if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -9044,6 +9047,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, TALLOC_CTX *_mem_save_server_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9080,6 +9084,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -9094,7 +9100,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -9193,7 +9205,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinters(struct ndr_print *ndr, const char * ndr->depth--; } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + 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--; @@ -9589,7 +9604,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumJobs(struct ndr_push *ndr, int if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -9603,6 +9621,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9629,6 +9648,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -9643,7 +9664,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -9741,7 +9768,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumJobs(struct ndr_print *ndr, const char *name ndr->depth--; } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + 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--; @@ -10136,7 +10166,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinterDrivers(struct ndr_push if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -10153,6 +10186,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull TALLOC_CTX *_mem_save_environment_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -10206,6 +10240,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -10220,7 +10256,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -10324,7 +10366,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDrivers(struct ndr_print *ndr, const ndr->depth--; } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + 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--; @@ -10751,7 +10796,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrintProcessors(struct ndr_push if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -10768,6 +10816,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(struct ndr_pull TALLOC_CTX *_mem_save_environment_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -10821,6 +10870,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(struct ndr_pull NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -10835,7 +10886,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(struct ndr_pull NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -10939,7 +10996,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrintProcessors(struct ndr_print *ndr, const ndr->depth--; } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + 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--; @@ -11582,7 +11642,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr if (flags & NDR_OUT) { NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->out.type)); NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -11591,6 +11654,7 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct _spoolss_GetPrinterData *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11609,11 +11673,19 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.value_name, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, &r->out.type)); NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.data)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -11669,7 +11741,10 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterData(struct ndr_print *ndr, const char ndr_print_spoolss_PrinterDataType(ndr, "type", r->out.type); ndr_print_set_switch_value(ndr, &r->out.data, r->out.type); ndr_print_spoolss_PrinterData(ndr, "data", &r->out.data); - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -12278,7 +12353,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumForms(struct ndr_push *ndr, int if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -12292,6 +12370,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(struct ndr_pull *ndr, int TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -12316,6 +12395,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -12330,7 +12411,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -12426,7 +12513,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumForms(struct ndr_print *ndr, const char *nam ndr->depth--; } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + 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--; @@ -12456,7 +12546,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPorts(struct ndr_push *ndr, int if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -12471,6 +12564,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(struct ndr_pull *ndr, int TALLOC_CTX *_mem_save_servername_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -12506,6 +12600,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -12520,7 +12616,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -12618,7 +12720,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPorts(struct ndr_print *ndr, const char *nam ndr->depth--; } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + 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--; @@ -12648,7 +12753,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumMonitors(struct ndr_push *ndr, if (r->out.info) { NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (r->out.needed == NULL) { + 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)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -12663,6 +12771,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(struct ndr_pull *ndr, TALLOC_CTX *_mem_save_servername_0; TALLOC_CTX *_mem_save_buffer_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -12698,6 +12807,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); @@ -12712,7 +12823,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(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)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -12810,7 +12927,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumMonitors(struct ndr_print *ndr, const char * ndr->depth--; } ndr->depth--; - ndr_print_uint32(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "needed", r->out.needed); + 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 59d5c44d3d..fc32177a91 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -760,7 +760,7 @@ struct _spoolss_EnumPrinters { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -792,7 +792,7 @@ struct spoolss_EnumPrinters { struct { union spoolss_PrinterInfo *info;/* [unique,switch_is(level),size_is(count)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -861,7 +861,7 @@ struct _spoolss_EnumJobs { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -894,7 +894,7 @@ struct spoolss_EnumJobs { struct { union spoolss_JobInfo *info;/* [unique,switch_is(level),size_is(count)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -975,7 +975,7 @@ struct _spoolss_EnumPrinterDrivers { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1007,7 +1007,7 @@ struct spoolss_EnumPrinterDrivers { struct { union spoolss_DriverInfo *info;/* [unique,switch_is(level),size_is(count)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1075,7 +1075,7 @@ struct _spoolss_EnumPrintProcessors { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1107,7 +1107,7 @@ struct spoolss_EnumPrintProcessors { struct { union spoolss_PrintProcessorInfo *info;/* [unique,switch_is(level),size_is(count)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1242,7 +1242,7 @@ struct _spoolss_GetPrinterData { struct { enum spoolss_PrinterDataType type; DATA_BLOB data; - uint32_t needed; + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1271,7 +1271,7 @@ struct spoolss_GetPrinterData { struct { enum spoolss_PrinterDataType type; union spoolss_PrinterData data;/* [subcontext_size(offered),subcontext(4),switch_is(type)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1413,7 +1413,7 @@ struct _spoolss_EnumForms { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1444,7 +1444,7 @@ struct spoolss_EnumForms { struct { union spoolss_FormInfo *info;/* [unique,switch_is(level),size_is(count)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1462,7 +1462,7 @@ struct _spoolss_EnumPorts { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1493,7 +1493,7 @@ struct spoolss_EnumPorts { struct { union spoolss_PortInfo *info;/* [unique,switch_is(level),size_is(count)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1511,7 +1511,7 @@ struct _spoolss_EnumMonitors { struct { DATA_BLOB *info;/* [unique] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; @@ -1542,7 +1542,7 @@ struct spoolss_EnumMonitors { struct { union spoolss_MonitorInfo *info;/* [unique,switch_is(level),size_is(count)] */ - uint32_t needed; + uint32_t *needed;/* [ref] */ uint32_t count; WERROR result; } out; -- cgit From 6f38fe3e66d1af1ed22dd8ddf88798d39c0f826b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 18:35:01 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/cli_spoolss.c | 6 +++--- librpc/gen_ndr/cli_spoolss.h | 4 ++-- librpc/gen_ndr/ndr_spoolss.c | 23 +++++++++++++++++++---- librpc/gen_ndr/spoolss.h | 6 +++--- 4 files changed, 27 insertions(+), 12 deletions(-) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 04065c830b..d8dc5a91c3 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -1269,8 +1269,8 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, uint32_t offered /* [in] */, - enum spoolss_PrinterDataType type /* [out] */, - union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */, + enum spoolss_PrinterDataType *type /* [out] [ref] */, + union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -1305,7 +1305,7 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, } /* Return variables */ - return NT_STATUS_NOT_SUPPORTED; + *type = *r.out.type; return NT_STATUS_NOT_SUPPORTED; *needed = *r.out.needed; diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index bea04404a2..6a4ffb0b84 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -173,8 +173,8 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, uint32_t offered /* [in] */, - enum spoolss_PrinterDataType type /* [out] */, - union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */, + enum spoolss_PrinterDataType *type /* [out] [ref] */, + union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index 20d32559f1..3d2191a2b2 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -11640,7 +11640,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->out.type)); + if (r->out.type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, *r->out.type)); NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.data)); if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -11654,6 +11657,7 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct _spoolss_GetPrinterData *r) { TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_type_0; TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11673,11 +11677,19 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.value_name, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.type); + ZERO_STRUCTP(r->out.type); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, &r->out.type)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.type); + } + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.data)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.needed); @@ -11738,8 +11750,11 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterData(struct ndr_print *ndr, const char if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_GetPrinterData"); ndr->depth++; - ndr_print_spoolss_PrinterDataType(ndr, "type", r->out.type); - ndr_print_set_switch_value(ndr, &r->out.data, r->out.type); + ndr_print_ptr(ndr, "type", r->out.type); + ndr->depth++; + ndr_print_spoolss_PrinterDataType(ndr, "type", *r->out.type); + ndr->depth--; + ndr_print_set_switch_value(ndr, &r->out.data, *r->out.type); ndr_print_spoolss_PrinterData(ndr, "data", &r->out.data); ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index fc32177a91..692e9a919b 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -1240,7 +1240,7 @@ struct _spoolss_GetPrinterData { } in; struct { - enum spoolss_PrinterDataType type; + enum spoolss_PrinterDataType *type;/* [ref] */ DATA_BLOB data; uint32_t *needed;/* [ref] */ WERROR result; @@ -1269,8 +1269,8 @@ struct spoolss_GetPrinterData { } in; struct { - enum spoolss_PrinterDataType type; - union spoolss_PrinterData data;/* [subcontext_size(offered),subcontext(4),switch_is(type)] */ + enum spoolss_PrinterDataType *type;/* [ref] */ + union spoolss_PrinterData data;/* [subcontext_size(offered),subcontext(4),switch_is(*type)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; -- cgit From 1bb22b55274c6d9661acb8c051f8489287a9a2cd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 18:52:42 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/srv_spoolss.c | 88 -------------------------------------------- 1 file changed, 88 deletions(-) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c index 1f7d29f39f..64af1c4a16 100644 --- a/librpc/gen_ndr/srv_spoolss.c +++ b/librpc/gen_ndr/srv_spoolss.c @@ -57,12 +57,6 @@ static bool api_spoolss_EnumPrinters(pipes_struct *p) return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_EnumPrinters(p, r); if (p->rng_fault_state) { @@ -388,12 +382,6 @@ static bool api_spoolss_EnumJobs(pipes_struct *p) return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_EnumJobs(p, r); if (p->rng_fault_state) { @@ -858,12 +846,6 @@ static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p) return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_EnumPrinterDrivers(p, r); if (p->rng_fault_state) { @@ -1255,12 +1237,6 @@ static bool api_spoolss_EnumPrintProcessors(pipes_struct *p) return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_EnumPrintProcessors(p, r); if (p->rng_fault_state) { @@ -2098,12 +2074,6 @@ static bool api_spoolss_GetPrinterData(pipes_struct *p) return false; } - r->out.data = talloc_zero(r, union spoolss_PrinterData); - if (r->out.data == NULL) { - talloc_free(r); - return false; - } - r->out.needed = talloc_zero(r, uint32_t); if (r->out.needed == NULL) { talloc_free(r); @@ -2722,12 +2692,6 @@ static bool api_spoolss_EnumForms(pipes_struct *p) return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_EnumForms(p, r); if (p->rng_fault_state) { @@ -2814,12 +2778,6 @@ static bool api_spoolss_EnumPorts(pipes_struct *p) return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_EnumPorts(p, r); if (p->rng_fault_state) { @@ -2906,12 +2864,6 @@ static bool api_spoolss_EnumMonitors(pipes_struct *p) return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - r->out.result = _spoolss_EnumMonitors(p, r); if (p->rng_fault_state) { @@ -7527,11 +7479,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_EnumPrinters(cli->pipes_struct, r); return NT_STATUS_OK; } @@ -7584,11 +7531,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_EnumJobs(cli->pipes_struct, r); return NT_STATUS_OK; } @@ -7647,11 +7589,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_EnumPrinterDrivers(cli->pipes_struct, r); return NT_STATUS_OK; } @@ -7704,11 +7641,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_EnumPrintProcessors(cli->pipes_struct, r); return NT_STATUS_OK; } @@ -7804,11 +7736,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.data = talloc_zero(mem_ctx, union spoolss_PrinterData); - if (r->out.data == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.needed = talloc_zero(mem_ctx, uint32_t); if (r->out.needed == NULL) { return NT_STATUS_NO_MEMORY; @@ -7886,11 +7813,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_EnumForms(cli->pipes_struct, r); return NT_STATUS_OK; } @@ -7908,11 +7830,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_EnumPorts(cli->pipes_struct, r); return NT_STATUS_OK; } @@ -7930,11 +7847,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { - return NT_STATUS_NO_MEMORY; - } - r->out.result = _spoolss_EnumMonitors(cli->pipes_struct, r); return NT_STATUS_OK; } -- cgit From 6a6eb90803dc47140fda1984e148a98f4bb898da Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Sat, 7 Feb 2009 00:45:19 -0800 Subject: librpc: Re-run make idl_full from source3 --- librpc/gen_ndr/cli_spoolss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index d8dc5a91c3..0255d00b0f 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -3397,7 +3397,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli, } /* Return variables */ - memcpy(value_name, r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name)); + memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name)); *value_needed = *r.out.value_needed; *printerdata_type = *r.out.printerdata_type; *buffer = *r.out.buffer; -- cgit From 15243c13e914b1ecc6f0eec924cc587a4069c62b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 9 Feb 2009 01:32:28 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/cli_spoolss.c | 6 ++++-- librpc/gen_ndr/cli_spoolss.h | 3 ++- librpc/gen_ndr/ndr_spoolss.c | 44 ++++++++++++++++++++++++++++---------------- librpc/gen_ndr/spoolss.h | 6 +++++- 4 files changed, 39 insertions(+), 20 deletions(-) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 0255d00b0f..ec0b43a539 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -675,7 +675,6 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, const char *server /* [in] [unique,charset(UTF16)] */, const char *architecture /* [in] [charset(UTF16)] */, const char *driver /* [in] [charset(UTF16)] */, @@ -685,7 +684,6 @@ NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli, NTSTATUS status; /* In parameters */ - r.in.handle = handle; r.in.server = server; r.in.architecture = architecture; r.in.driver = driver; @@ -3840,12 +3838,16 @@ NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *key_name /* [in] [charset(UTF16)] */, WERROR *werror) { struct spoolss_DeletePrinterKey r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; + r.in.key_name = key_name; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &r); diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index 6a4ffb0b84..f534eabc90 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -103,7 +103,6 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, const char *server /* [in] [unique,charset(UTF16)] */, const char *architecture /* [in] [charset(UTF16)] */, const char *driver /* [in] [charset(UTF16)] */, @@ -471,6 +470,8 @@ NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *key_name /* [in] [charset(UTF16)] */, WERROR *werror); NTSTATUS rpccli_spoolss_53(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 3d2191a2b2..df4a629335 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -10615,10 +10615,6 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDriverDirectory(struct ndr_print *ndr, static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriver(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterDriver *r) { if (flags & NDR_IN) { - if (r->in.handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); if (r->in.server) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16))); @@ -10644,16 +10640,8 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriver(struct ndr_push *n static enum ndr_err_code ndr_pull_spoolss_DeletePrinterDriver(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterDriver *r) { uint32_t _ptr_server; - TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_server_0; if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); if (_ptr_server) { NDR_PULL_ALLOC(ndr, r->in.server); @@ -10703,10 +10691,6 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDriver(struct ndr_print *ndr, const if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "spoolss_DeletePrinterDriver"); ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; ndr_print_ptr(ndr, "server", r->in.server); ndr->depth++; if (r->in.server) { @@ -15985,6 +15969,14 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDataEx(struct ndr_print *ndr, const static enum ndr_err_code ndr_push_spoolss_DeletePrinterKey(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterKey *r) { if (flags & NDR_IN) { + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.key_name, ndr_charset_length(r->in.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -15994,7 +15986,22 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterKey(struct ndr_push *ndr, static enum ndr_err_code ndr_pull_spoolss_DeletePrinterKey(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterKey *r) { + TALLOC_CTX *_mem_save_handle_0; if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.key_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.key_name)); + if (ndr_get_array_length(ndr, &r->in.key_name) > ndr_get_array_size(ndr, &r->in.key_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.key_name), ndr_get_array_length(ndr, &r->in.key_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -16012,6 +16019,11 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterKey(struct ndr_print *ndr, const ch if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "spoolss_DeletePrinterKey"); ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_string(ndr, "key_name", r->in.key_name); ndr->depth--; } if (flags & NDR_OUT) { diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index 692e9a919b..0d93ce4401 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -1043,7 +1043,6 @@ struct spoolss_GetPrinterDriverDirectory { struct spoolss_DeletePrinterDriver { struct { - struct policy_handle *handle;/* [ref] */ const char *server;/* [unique,charset(UTF16)] */ const char *architecture;/* [charset(UTF16)] */ const char *driver;/* [charset(UTF16)] */ @@ -2044,6 +2043,11 @@ struct spoolss_DeletePrinterDataEx { struct spoolss_DeletePrinterKey { + struct { + struct policy_handle *handle;/* [ref] */ + const char *key_name;/* [charset(UTF16)] */ + } in; + struct { WERROR result; } out; -- cgit From 43040b316ce70849a90f059d1fb6f234088df14b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 9 Feb 2009 11:11:28 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/cli_spoolss.c | 10 +++++ librpc/gen_ndr/cli_spoolss.h | 5 +++ librpc/gen_ndr/ndr_spoolss.c | 87 ++++++++++++++++++++++++++++++++++++++++++++ librpc/gen_ndr/ndr_spoolss.h | 3 ++ librpc/gen_ndr/spoolss.h | 13 +++++++ 5 files changed, 118 insertions(+) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index ec0b43a539..63f89778af 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -3924,12 +3924,22 @@ NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server /* [in] [unique,charset(UTF16)] */, + const char *architecture /* [in] [charset(UTF16)] */, + const char *driver /* [in] [charset(UTF16)] */, + uint32_t delete_flags /* [in] */, + uint32_t version /* [in] */, WERROR *werror) { struct spoolss_DeletePrinterDriverEx r; NTSTATUS status; /* In parameters */ + r.in.server = server; + r.in.architecture = architecture; + r.in.driver = driver; + r.in.delete_flags = delete_flags; + r.in.version = version; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &r); diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index f534eabc90..a77878bcfe 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -478,6 +478,11 @@ NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server /* [in] [unique,charset(UTF16)] */, + const char *architecture /* [in] [charset(UTF16)] */, + const char *driver /* [in] [charset(UTF16)] */, + uint32_t delete_flags /* [in] */, + uint32_t version /* [in] */, WERROR *werror); NTSTATUS rpccli_spoolss_55(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 df4a629335..7f66abe3ef 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -9006,6 +9006,30 @@ _PUBLIC_ void ndr_print_spoolss_UserLevel(struct ndr_print *ndr, const char *nam } } +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DeleteDriverFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DeleteDriverFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_DeleteDriverFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DPD_DELETE_UNUSED_FILES", DPD_DELETE_UNUSED_FILES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DPD_DELETE_SPECIFIC_VERSION", DPD_DELETE_SPECIFIC_VERSION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DPD_DELETE_ALL_FILES", DPD_DELETE_ALL_FILES, r); + ndr->depth--; +} + _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinters *r) { if (flags & NDR_IN) { @@ -16079,6 +16103,23 @@ _PUBLIC_ void ndr_print_spoolss_53(struct ndr_print *ndr, const char *name, int static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriverEx(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterDriverEx *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server, ndr_charset_length(r->in.server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.architecture, ndr_charset_length(r->in.architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.driver, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.driver, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.driver, ndr_charset_length(r->in.driver, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_spoolss_DeleteDriverFlags(ndr, NDR_SCALARS, r->in.delete_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.version)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -16088,7 +16129,43 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriverEx(struct ndr_push static enum ndr_err_code ndr_pull_spoolss_DeletePrinterDriverEx(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterDriverEx *r) { + uint32_t _ptr_server; + TALLOC_CTX *_mem_save_server_0; if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server)); + if (ndr_get_array_length(ndr, &r->in.server) > ndr_get_array_size(ndr, &r->in.server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server), ndr_get_array_length(ndr, &r->in.server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.architecture)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.architecture)); + if (ndr_get_array_length(ndr, &r->in.architecture) > ndr_get_array_size(ndr, &r->in.architecture)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.architecture), ndr_get_array_length(ndr, &r->in.architecture)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.architecture, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.driver)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.driver)); + if (ndr_get_array_length(ndr, &r->in.driver) > ndr_get_array_size(ndr, &r->in.driver)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.driver), ndr_get_array_length(ndr, &r->in.driver)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.driver), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.driver, ndr_get_array_length(ndr, &r->in.driver), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_spoolss_DeleteDriverFlags(ndr, NDR_SCALARS, &r->in.delete_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.version)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -16106,6 +16183,16 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDriverEx(struct ndr_print *ndr, con if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "spoolss_DeletePrinterDriverEx"); ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_string(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_string(ndr, "architecture", r->in.architecture); + ndr_print_string(ndr, "driver", r->in.driver); + ndr_print_spoolss_DeleteDriverFlags(ndr, "delete_flags", r->in.delete_flags); + ndr_print_uint32(ndr, "version", r->in.version); ndr->depth--; } if (flags & NDR_OUT) { diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index d5b8ca9bc0..12027993ef 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -305,6 +305,9 @@ void ndr_print_spoolss_Notify(struct ndr_print *ndr, const char *name, const str void ndr_print_spoolss_NotifyInfo(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyInfo *r); void ndr_print_spoolss_UserLevel1(struct ndr_print *ndr, const char *name, const struct spoolss_UserLevel1 *r); void ndr_print_spoolss_UserLevel(struct ndr_print *ndr, const char *name, const union spoolss_UserLevel *r); +enum ndr_err_code ndr_push_spoolss_DeleteDriverFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_spoolss_DeleteDriverFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_spoolss_DeleteDriverFlags(struct ndr_print *ndr, const char *name, uint32_t r); enum ndr_err_code ndr_push__spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinters *r); enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinters *r); void ndr_print__spoolss_EnumPrinters(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_EnumPrinters *r); diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index 0d93ce4401..cfb802f7fb 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -748,6 +748,11 @@ union spoolss_UserLevel { #define PRINTER_ACCESS_USE ( 0x00000008 ) #define JOB_ACCESS_ADMINISTER ( 0x00000010 ) +/* bitmap spoolss_DeleteDriverFlags */ +#define DPD_DELETE_UNUSED_FILES ( 0x00000001 ) +#define DPD_DELETE_SPECIFIC_VERSION ( 0x00000002 ) +#define DPD_DELETE_ALL_FILES ( 0x00000004 ) + struct _spoolss_EnumPrinters { struct { @@ -2064,6 +2069,14 @@ struct spoolss_53 { struct spoolss_DeletePrinterDriverEx { + struct { + const char *server;/* [unique,charset(UTF16)] */ + const char *architecture;/* [charset(UTF16)] */ + const char *driver;/* [charset(UTF16)] */ + uint32_t delete_flags; + uint32_t version; + } in; + struct { WERROR result; } out; -- cgit From 4d78ece6571d4c8f051188ff1be06080c1b2b1a9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 9 Feb 2009 15:22:37 +0100 Subject: s3-spoolss: move PRINTER_ENUM_ICONMASK to IDL. Guenther --- librpc/gen_ndr/spoolss.h | 1 + 1 file changed, 1 insertion(+) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index cfb802f7fb..ddf514a08a 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -8,6 +8,7 @@ #ifndef _HEADER_spoolss #define _HEADER_spoolss +#define PRINTER_ENUM_ICONMASK ( (PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8) ) #define SPOOLSS_ARCHITECTURE_NT_X86 ( "Windows NT x86" ) #define SERVER_ALL_ACCESS ( SEC_STD_REQUIRED|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE ) #define SERVER_READ ( SEC_STD_READ_CONTROL|SERVER_ACCESS_ENUMERATE ) -- cgit From 1dadf17be847e3f93b72988bcc7e8620a8d5908c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 9 Feb 2009 14:54:02 +0100 Subject: s3: re-run make samba3-idl. Guenther --- librpc/gen_ndr/cli_spoolss.c | 16 +++++ librpc/gen_ndr/cli_spoolss.h | 8 +++ librpc/gen_ndr/ndr_spoolss.c | 165 +++++++++++++++++++++++++++++++++++++++++++ librpc/gen_ndr/ndr_spoolss.h | 1 + librpc/gen_ndr/spoolss.h | 43 +++++++++++ 5 files changed, 233 insertions(+) (limited to 'librpc/gen_ndr') diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 63f89778af..18086843ca 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -722,12 +722,20 @@ NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server /* [in] [unique,charset(UTF16)] */, + const char *architecture /* [in] [charset(UTF16)] */, + const char *path_name /* [in] [charset(UTF16)] */, + const char *print_processor_name /* [in] [charset(UTF16)] */, WERROR *werror) { struct spoolss_AddPrintProcessor r; NTSTATUS status; /* In parameters */ + r.in.server = server; + r.in.architecture = architecture; + r.in.path_name = path_name; + r.in.print_processor_name = print_processor_name; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &r); @@ -2768,12 +2776,20 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t flags /* [in] */, + uint32_t bufsize /* [in] [range(0,512)] */, + uint8_t *buffer /* [in] [unique,size_is(bufsize)] */, WERROR *werror) { struct spoolss_RouterReplyPrinter r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; + r.in.flags = flags; + r.in.bufsize = bufsize; + r.in.buffer = buffer; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r); diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index a77878bcfe..516c2c069d 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -109,6 +109,10 @@ NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server /* [in] [unique,charset(UTF16)] */, + const char *architecture /* [in] [charset(UTF16)] */, + const char *path_name /* [in] [charset(UTF16)] */, + const char *print_processor_name /* [in] [charset(UTF16)] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -338,6 +342,10 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t flags /* [in] */, + uint32_t bufsize /* [in] [range(0,512)] */, + uint8_t *buffer /* [in] [unique,size_is(bufsize)] */, WERROR *werror); NTSTATUS rpccli_spoolss_ReplyClosePrinter(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 7f66abe3ef..c7cf5164b8 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -8054,6 +8054,47 @@ _PUBLIC_ void ndr_print_spoolss_MonitorInfo(struct ndr_print *ndr, const char *n } } +static enum ndr_err_code ndr_push_spoolss_PrinterChangeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_PrinterChangeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINTER", PRINTER_CHANGE_ADD_PRINTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_PRINTER", PRINTER_CHANGE_SET_PRINTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINTER", PRINTER_CHANGE_DELETE_PRINTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_FAILED_CONNECTION_PRINTER", PRINTER_CHANGE_FAILED_CONNECTION_PRINTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_JOB", PRINTER_CHANGE_ADD_JOB, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_JOB", PRINTER_CHANGE_SET_JOB, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_JOB", PRINTER_CHANGE_DELETE_JOB, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_WRITE_JOB", PRINTER_CHANGE_WRITE_JOB, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_FORM", PRINTER_CHANGE_ADD_FORM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_FORM", PRINTER_CHANGE_SET_FORM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_FORM", PRINTER_CHANGE_DELETE_FORM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PORT", PRINTER_CHANGE_ADD_PORT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_CONFIGURE_PORT", PRINTER_CHANGE_CONFIGURE_PORT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PORT", PRINTER_CHANGE_DELETE_PORT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINT_PROCESSOR", PRINTER_CHANGE_ADD_PRINT_PROCESSOR, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINT_PROCESSOR", PRINTER_CHANGE_DELETE_PRINT_PROCESSOR, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINTER_DRIVER", PRINTER_CHANGE_ADD_PRINTER_DRIVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_PRINTER_DRIVER", PRINTER_CHANGE_SET_PRINTER_DRIVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINTER_DRIVER", PRINTER_CHANGE_DELETE_PRINTER_DRIVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_TIMEOUT", PRINTER_CHANGE_TIMEOUT, r); + ndr->depth--; +} + static enum ndr_err_code ndr_push_spoolss_Field(struct ndr_push *ndr, int ndr_flags, enum spoolss_Field r) { NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); @@ -10737,6 +10778,25 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDriver(struct ndr_print *ndr, const static enum ndr_err_code ndr_push_spoolss_AddPrintProcessor(struct ndr_push *ndr, int flags, const struct spoolss_AddPrintProcessor *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server, ndr_charset_length(r->in.server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.architecture, ndr_charset_length(r->in.architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path_name, ndr_charset_length(r->in.path_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.print_processor_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.print_processor_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.print_processor_name, ndr_charset_length(r->in.print_processor_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -10746,7 +10806,48 @@ static enum ndr_err_code ndr_push_spoolss_AddPrintProcessor(struct ndr_push *ndr static enum ndr_err_code ndr_pull_spoolss_AddPrintProcessor(struct ndr_pull *ndr, int flags, struct spoolss_AddPrintProcessor *r) { + uint32_t _ptr_server; + TALLOC_CTX *_mem_save_server_0; if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server)); + if (ndr_get_array_length(ndr, &r->in.server) > ndr_get_array_size(ndr, &r->in.server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server), ndr_get_array_length(ndr, &r->in.server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.architecture)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.architecture)); + if (ndr_get_array_length(ndr, &r->in.architecture) > ndr_get_array_size(ndr, &r->in.architecture)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.architecture), ndr_get_array_length(ndr, &r->in.architecture)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.architecture, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path_name)); + if (ndr_get_array_length(ndr, &r->in.path_name) > ndr_get_array_size(ndr, &r->in.path_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path_name), ndr_get_array_length(ndr, &r->in.path_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path_name, ndr_get_array_length(ndr, &r->in.path_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.print_processor_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.print_processor_name)); + if (ndr_get_array_length(ndr, &r->in.print_processor_name) > ndr_get_array_size(ndr, &r->in.print_processor_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.print_processor_name), ndr_get_array_length(ndr, &r->in.print_processor_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.print_processor_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.print_processor_name, ndr_get_array_length(ndr, &r->in.print_processor_name), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -10764,6 +10865,15 @@ _PUBLIC_ void ndr_print_spoolss_AddPrintProcessor(struct ndr_print *ndr, const c if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "spoolss_AddPrintProcessor"); ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_string(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_string(ndr, "architecture", r->in.architecture); + ndr_print_string(ndr, "path_name", r->in.path_name); + ndr_print_string(ndr, "print_processor_name", r->in.print_processor_name); ndr->depth--; } if (flags & NDR_OUT) { @@ -14139,6 +14249,17 @@ _PUBLIC_ void ndr_print_spoolss_ReplyOpenPrinter(struct ndr_print *ndr, const ch static enum ndr_err_code ndr_push_spoolss_RouterReplyPrinter(struct ndr_push *ndr, int flags, const struct spoolss_RouterReplyPrinter *r) { if (flags & NDR_IN) { + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_spoolss_PrinterChangeFlags(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.buffer)); + if (r->in.buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.bufsize)); + } } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -14148,7 +14269,39 @@ static enum ndr_err_code ndr_push_spoolss_RouterReplyPrinter(struct ndr_push *nd static enum ndr_err_code ndr_pull_spoolss_RouterReplyPrinter(struct ndr_pull *ndr, int flags, struct spoolss_RouterReplyPrinter *r) { + uint32_t _ptr_buffer; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_buffer_0; if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_spoolss_PrinterChangeFlags(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bufsize)); + if (r->in.bufsize > 512) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); + if (_ptr_buffer) { + NDR_PULL_ALLOC(ndr, r->in.buffer); + } else { + r->in.buffer = NULL; + } + if (r->in.buffer) { + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); + NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); + } + if (r->in.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.bufsize)); + } } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -14166,6 +14319,18 @@ _PUBLIC_ void ndr_print_spoolss_RouterReplyPrinter(struct ndr_print *ndr, const if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "spoolss_RouterReplyPrinter"); ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_spoolss_PrinterChangeFlags(ndr, "flags", r->in.flags); + ndr_print_uint32(ndr, "bufsize", r->in.bufsize); + ndr_print_ptr(ndr, "buffer", r->in.buffer); + ndr->depth++; + if (r->in.buffer) { + ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.bufsize); + } + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index 12027993ef..41ff65278b 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -292,6 +292,7 @@ void ndr_print_spoolss_MonitorInfo2(struct ndr_print *ndr, const char *name, con enum ndr_err_code ndr_push_spoolss_MonitorInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_MonitorInfo *r); enum ndr_err_code ndr_pull_spoolss_MonitorInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_MonitorInfo *r); void ndr_print_spoolss_MonitorInfo(struct ndr_print *ndr, const char *name, const union spoolss_MonitorInfo *r); +void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, enum spoolss_Field r); void ndr_print_spoolss_NotifyType(struct ndr_print *ndr, const char *name, enum spoolss_NotifyType r); void ndr_print_spoolss_NotifyOptionsArray(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyOptionsArray *r); diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index ddf514a08a..36950b0f64 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -10,6 +10,13 @@ #define PRINTER_ENUM_ICONMASK ( (PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8) ) #define SPOOLSS_ARCHITECTURE_NT_X86 ( "Windows NT x86" ) +#define PRINTER_CHANGE_PRINTER ( (PRINTER_CHANGE_ADD_PRINTER|PRINTER_CHANGE_SET_PRINTER|PRINTER_CHANGE_DELETE_PRINTER|PRINTER_CHANGE_FAILED_CONNECTION_PRINTER) ) +#define PRINTER_CHANGE_JOB ( (PRINTER_CHANGE_ADD_JOB|PRINTER_CHANGE_SET_JOB|PRINTER_CHANGE_DELETE_JOB|PRINTER_CHANGE_WRITE_JOB) ) +#define PRINTER_CHANGE_FORM ( (PRINTER_CHANGE_ADD_FORM|PRINTER_CHANGE_SET_FORM|PRINTER_CHANGE_DELETE_FORM) ) +#define PRINTER_CHANGE_PORT ( (PRINTER_CHANGE_ADD_PORT|PRINTER_CHANGE_CONFIGURE_PORT|PRINTER_CHANGE_DELETE_PORT) ) +#define PRINTER_CHANGE_PRINT_PROCESSOR ( (PRINTER_CHANGE_ADD_PRINT_PROCESSOR|PRINTER_CHANGE_DELETE_PRINT_PROCESSOR) ) +#define PRINTER_CHANGE_PRINTER_DRIVER ( (PRINTER_CHANGE_ADD_PRINTER_DRIVER|PRINTER_CHANGE_SET_PRINTER_DRIVER|PRINTER_CHANGE_DELETE_PRINTER_DRIVER) ) +#define PRINTER_CHANGE_ALL ( (PRINTER_CHANGE_JOB|PRINTER_CHANGE_FORM|PRINTER_CHANGE_PORT|PRINTER_CHANGE_PRINT_PROCESSOR|PRINTER_CHANGE_PRINTER_DRIVER) ) #define SERVER_ALL_ACCESS ( SEC_STD_REQUIRED|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE ) #define SERVER_READ ( SEC_STD_READ_CONTROL|SERVER_ACCESS_ENUMERATE ) #define SERVER_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE ) @@ -597,6 +604,28 @@ union spoolss_MonitorInfo { struct spoolss_MonitorInfo2 info2;/* [case(2)] */ }/* [relative_base,nodiscriminant,public] */; +/* bitmap spoolss_PrinterChangeFlags */ +#define PRINTER_CHANGE_ADD_PRINTER ( 0x00000001 ) +#define PRINTER_CHANGE_SET_PRINTER ( 0x00000002 ) +#define PRINTER_CHANGE_DELETE_PRINTER ( 0x00000004 ) +#define PRINTER_CHANGE_FAILED_CONNECTION_PRINTER ( 0x00000008 ) +#define PRINTER_CHANGE_ADD_JOB ( 0x00000100 ) +#define PRINTER_CHANGE_SET_JOB ( 0x00000200 ) +#define PRINTER_CHANGE_DELETE_JOB ( 0x00000400 ) +#define PRINTER_CHANGE_WRITE_JOB ( 0x00000800 ) +#define PRINTER_CHANGE_ADD_FORM ( 0x00010000 ) +#define PRINTER_CHANGE_SET_FORM ( 0x00020000 ) +#define PRINTER_CHANGE_DELETE_FORM ( 0x00040000 ) +#define PRINTER_CHANGE_ADD_PORT ( 0x00100000 ) +#define PRINTER_CHANGE_CONFIGURE_PORT ( 0x00200000 ) +#define PRINTER_CHANGE_DELETE_PORT ( 0x00400000 ) +#define PRINTER_CHANGE_ADD_PRINT_PROCESSOR ( 0x01000000 ) +#define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR ( 0x04000000 ) +#define PRINTER_CHANGE_ADD_PRINTER_DRIVER ( 0x10000000 ) +#define PRINTER_CHANGE_SET_PRINTER_DRIVER ( 0x20000000 ) +#define PRINTER_CHANGE_DELETE_PRINTER_DRIVER ( 0x40000000 ) +#define PRINTER_CHANGE_TIMEOUT ( 0x80000000 ) + enum spoolss_Field #ifndef USE_UINT_ENUMS { @@ -1062,6 +1091,13 @@ struct spoolss_DeletePrinterDriver { struct spoolss_AddPrintProcessor { + struct { + const char *server;/* [unique,charset(UTF16)] */ + const char *architecture;/* [charset(UTF16)] */ + const char *path_name;/* [charset(UTF16)] */ + const char *print_processor_name;/* [charset(UTF16)] */ + } in; + struct { WERROR result; } out; @@ -1765,6 +1801,13 @@ struct spoolss_ReplyOpenPrinter { struct spoolss_RouterReplyPrinter { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t flags; + uint32_t bufsize;/* [range(0,512)] */ + uint8_t *buffer;/* [unique,size_is(bufsize)] */ + } in; + struct { WERROR result; } out; -- cgit