diff options
author | bubulle <bubulle@alioth.debian.org> | 2010-05-11 17:53:04 +0000 |
---|---|---|
committer | bubulle <bubulle@alioth.debian.org> | 2010-05-11 17:53:04 +0000 |
commit | 1b77db997b6a2ce389356509415a6e5e540bcfe0 (patch) | |
tree | 1176a4321bc8a28a50c3f2508f20a6d882c53466 /librpc | |
parent | 07f55c11814d88882bf8ed2e46831c4bdef75a41 (diff) | |
download | samba-1b77db997b6a2ce389356509415a6e5e540bcfe0.tar.gz |
Load samba-3.4.8 into branches/samba/upstream.upstream/3.4.8_dfsg
git-svn-id: svn://svn.debian.org/svn/pkg-samba/branches/samba/upstream@3469 fc4039ab-9d04-0410-8cac-899223bdd6b0
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.c | 20 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.h | 12 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.c | 381 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.h | 17 | ||||
-rw-r--r-- | librpc/gen_ndr/spoolss.h | 87 | ||||
-rw-r--r-- | librpc/gen_ndr/srv_spoolss.c | 12 | ||||
-rw-r--r-- | librpc/idl/spoolss.idl | 61 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.c | 140 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.h | 3 |
9 files changed, 241 insertions, 492 deletions
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 10dd8b4c6c..8820971388 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -1301,9 +1301,9 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, - uint32_t offered /* [in] */, enum winreg_Type *type /* [out] [ref] */, - union spoolss_PrinterData *data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */, + uint8_t *data /* [out] [ref,size_is(offered)] */, + uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -1339,7 +1339,7 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, /* Return variables */ *type = *r.out.type; - *data = *r.out.data; + memcpy(data, r.out.data, (r.in.offered) * sizeof(*data)); *needed = *r.out.needed; /* Return result */ @@ -1355,8 +1355,8 @@ NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, enum winreg_Type type /* [in] */, - union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */, - uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */, + uint8_t *data /* [in] [ref,size_is(offered)] */, + uint32_t offered /* [in] */, WERROR *werror) { struct spoolss_SetPrinterData r; @@ -1367,7 +1367,7 @@ NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, r.in.value_name = value_name; r.in.type = type; r.in.data = data; - r.in._offered = _offered; + r.in.offered = offered; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &r); @@ -3652,7 +3652,7 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, enum winreg_Type type /* [in] */, - uint8_t *buffer /* [in] [ref,size_is(offered)] */, + uint8_t *data /* [in] [ref,size_is(offered)] */, uint32_t offered /* [in] */, WERROR *werror) { @@ -3664,7 +3664,7 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli, r.in.key_name = key_name; r.in.value_name = value_name; r.in.type = type; - r.in.buffer = buffer; + r.in.data = data; r.in.offered = offered; if (DEBUGLEVEL >= 10) { @@ -3705,7 +3705,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, enum winreg_Type *type /* [out] [ref] */, - uint8_t *buffer /* [out] [ref,size_is(offered)] */, + uint8_t *data /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) @@ -3743,7 +3743,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, /* Return variables */ *type = *r.out.type; - memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer)); + memcpy(data, r.out.data, (r.in.offered) * sizeof(*data)); *needed = *r.out.needed; /* Return result */ diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index eb1e8dd61f..0ee28e5ce9 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -190,9 +190,9 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, - uint32_t offered /* [in] */, enum winreg_Type *type /* [out] [ref] */, - union spoolss_PrinterData *data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */, + uint8_t *data /* [out] [ref,size_is(offered)] */, + uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, @@ -200,8 +200,8 @@ NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, enum winreg_Type type /* [in] */, - union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */, - uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */, + uint8_t *data /* [in] [ref,size_is(offered)] */, + uint32_t offered /* [in] */, WERROR *werror); NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -471,7 +471,7 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, enum winreg_Type type /* [in] */, - uint8_t *buffer /* [in] [ref,size_is(offered)] */, + uint8_t *data /* [in] [ref,size_is(offered)] */, uint32_t offered /* [in] */, WERROR *werror); NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, @@ -480,7 +480,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, enum winreg_Type *type /* [out] [ref] */, - uint8_t *buffer /* [out] [ref,size_is(offered)] */, + uint8_t *data /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index cca1b12680..ef3fd3d0e9 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -6146,12 +6146,12 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo2(struct ndr_push *ndr, NDR_CHECK(ndr_push_unique_ptr(ndr, r->drivername)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->location)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->devmode_ptr)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->sepfile)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->printprocessor)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->datatype)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->secdesc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->secdesc_ptr)); NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->defaultpriority)); @@ -6204,14 +6204,6 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo2(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->location, ndr_charset_length(r->location, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->devmode) { - { - struct ndr_push *_ndr_devmode; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1)); - NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1)); - } - } if (r->sepfile) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->sepfile, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); @@ -6236,14 +6228,6 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo2(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->parameters, ndr_charset_length(r->parameters, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->secdesc) { - { - struct ndr_push *_ndr_secdesc; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1)); - } - } } return NDR_ERR_SUCCESS; } @@ -6264,8 +6248,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, TALLOC_CTX *_mem_save_comment_0; uint32_t _ptr_location; TALLOC_CTX *_mem_save_location_0; - uint32_t _ptr_devmode; - TALLOC_CTX *_mem_save_devmode_0; uint32_t _ptr_sepfile; TALLOC_CTX *_mem_save_sepfile_0; uint32_t _ptr_printprocessor; @@ -6274,8 +6256,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, TALLOC_CTX *_mem_save_datatype_0; uint32_t _ptr_parameters; TALLOC_CTX *_mem_save_parameters_0; - uint32_t _ptr_secdesc; - TALLOC_CTX *_mem_save_secdesc_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); @@ -6320,12 +6300,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, } else { r->location = NULL; } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); - if (_ptr_devmode) { - NDR_PULL_ALLOC(ndr, r->devmode); - } else { - r->devmode = NULL; - } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->devmode_ptr)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sepfile)); if (_ptr_sepfile) { NDR_PULL_ALLOC(ndr, r->sepfile); @@ -6350,12 +6325,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, } else { r->parameters = NULL; } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); - if (_ptr_secdesc) { - NDR_PULL_ALLOC(ndr, r->secdesc); - } else { - r->secdesc = NULL; - } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->secdesc_ptr)); NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); if (r->priority > 99) { @@ -6453,17 +6423,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->location, ndr_get_array_length(ndr, &r->location), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_location_0, 0); } - if (r->devmode) { - _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); - { - struct ndr_pull *_ndr_devmode; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1)); - NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); - } if (r->sepfile) { _mem_save_sepfile_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->sepfile, 0); @@ -6512,17 +6471,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->parameters, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0); } - if (r->secdesc) { - _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); - { - struct ndr_pull *_ndr_secdesc; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); - } } return NDR_ERR_SUCCESS; } @@ -6573,12 +6521,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo2(struct ndr_print *ndr, const cha ndr_print_string(ndr, "location", r->location); } ndr->depth--; - ndr_print_ptr(ndr, "devmode", r->devmode); - ndr->depth++; - if (r->devmode) { - ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode); - } - ndr->depth--; + ndr_print_uint32(ndr, "devmode_ptr", r->devmode_ptr); ndr_print_ptr(ndr, "sepfile", r->sepfile); ndr->depth++; if (r->sepfile) { @@ -6603,12 +6546,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo2(struct ndr_print *ndr, const cha ndr_print_string(ndr, "parameters", r->parameters); } ndr->depth--; - ndr_print_ptr(ndr, "secdesc", r->secdesc); - ndr->depth++; - if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); - } - ndr->depth--; + ndr_print_uint32(ndr, "secdesc_ptr", r->secdesc_ptr); ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes); ndr_print_uint32(ndr, "priority", r->priority); ndr_print_uint32(ndr, "defaultpriority", r->defaultpriority); @@ -6941,6 +6879,66 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo7(struct ndr_print *ndr, const cha ndr->depth--; } +static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo8(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->devmode_ptr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo8(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->devmode_ptr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo8(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo8 *r) +{ + ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo8"); + ndr->depth++; + ndr_print_uint32(ndr, "devmode_ptr", r->devmode_ptr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo9(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->devmode_ptr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo9(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->devmode_ptr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo9(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo9 *r) +{ + ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo9"); + ndr->depth++; + ndr_print_uint32(ndr, "devmode_ptr", r->devmode_ptr); + ndr->depth--; +} + static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_SetPrinterInfo *r) { if (ndr_flags & NDR_SCALARS) { @@ -7045,13 +7043,13 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo(struct ndr_push *ndr, i case 8: if (r->info8) { - NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info8)); + NDR_CHECK(ndr_push_spoolss_SetPrinterInfo8(ndr, NDR_SCALARS, r->info8)); } break; case 9: if (r->info9) { - NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info9)); + NDR_CHECK(ndr_push_spoolss_SetPrinterInfo9(ndr, NDR_SCALARS, r->info9)); } break; @@ -7267,7 +7265,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo(struct ndr_pull *ndr, i if (r->info8) { _mem_save_info8_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->info8, 0); - NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info8)); + NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo8(ndr, NDR_SCALARS, r->info8)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info8_0, 0); } break; @@ -7276,7 +7274,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo(struct ndr_pull *ndr, i if (r->info9) { _mem_save_info9_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->info9, 0); - NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info9)); + NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo9(ndr, NDR_SCALARS, r->info9)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info9_0, 0); } break; @@ -7371,7 +7369,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo(struct ndr_print *ndr, const char ndr_print_ptr(ndr, "info8", r->info8); ndr->depth++; if (r->info8) { - ndr_print_spoolss_DeviceModeInfo(ndr, "info8", r->info8); + ndr_print_spoolss_SetPrinterInfo8(ndr, "info8", r->info8); } ndr->depth--; break; @@ -7380,7 +7378,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo(struct ndr_print *ndr, const char ndr_print_ptr(ndr, "info9", r->info9); ndr->depth++; if (r->info9) { - ndr_print_spoolss_DeviceModeInfo(ndr, "info9", r->info9); + ndr_print_spoolss_SetPrinterInfo9(ndr, "info9", r->info9); } ndr->depth--; break; @@ -18650,8 +18648,13 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterEnumValues(struct ndr_push *n } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m_term(r->value_name))); NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_spoolss_PrinterData(r->data, r->type, ndr->iconv_convenience, ndr->flags))); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data)); + ndr->flags = _flags_save_DATA_BLOB; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data->length)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r)); @@ -18665,16 +18668,20 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterEnumValues(struct ndr_push *n } ndr->flags = _flags_save_string; } - if (r->data) { - NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data)); - { - struct ndr_push *_ndr_data; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_data, 0, r->data_length)); - NDR_CHECK(ndr_push_set_switch_value(_ndr_data, r->data, r->type)); - NDR_CHECK(ndr_push_spoolss_PrinterData(_ndr_data, NDR_SCALARS|NDR_BUFFERS, r->data)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_data, 0, r->data_length)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->data) { + NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data)); + { + struct ndr_push *_ndr_data; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_data, 0, r->data->length)); + NDR_CHECK(ndr_push_DATA_BLOB(_ndr_data, NDR_SCALARS, *r->data)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_data, 0, r->data->length)); + } + NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data)); } - NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data)); + ndr->flags = _flags_save_DATA_BLOB; } } ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset); @@ -18705,12 +18712,17 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterEnumValues(struct ndr_pull *n } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_name_len)); NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data, _ptr_data)); - } else { - r->data = NULL; + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data, _ptr_data)); + } else { + r->data = NULL; + } + ndr->flags = _flags_save_DATA_BLOB; } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_length)); } @@ -18731,21 +18743,25 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterEnumValues(struct ndr_pull *n } ndr->flags = _flags_save_string; } - if (r->data) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data)); - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - { - struct ndr_pull *_ndr_data; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 0, r->data_length)); - NDR_CHECK(ndr_pull_set_switch_value(_ndr_data, r->data, r->type)); - NDR_CHECK(ndr_pull_spoolss_PrinterData(_ndr_data, NDR_SCALARS|NDR_BUFFERS, r->data)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_data, 0, r->data_length)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->data) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data)); + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + { + struct ndr_pull *_ndr_data; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 0, r->data_length)); + NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_data, NDR_SCALARS, r->data)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_data, 0, r->data_length)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + ndr->offset = _relative_save_offset; } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - ndr->offset = _relative_save_offset; + ndr->flags = _flags_save_DATA_BLOB; } } ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset); @@ -18767,11 +18783,10 @@ _PUBLIC_ void ndr_print_spoolss_PrinterEnumValues(struct ndr_print *ndr, const c ndr_print_ptr(ndr, "data", r->data); ndr->depth++; if (r->data) { - ndr_print_set_switch_value(ndr, r->data, r->type); - ndr_print_spoolss_PrinterData(ndr, "data", r->data); + ndr_print_DATA_BLOB(ndr, "data", *r->data); } ndr->depth--; - ndr_print_uint32(ndr, "data_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_spoolss_PrinterData(r->data, r->type, ndr->iconv_convenience, ndr->flags):r->data_length); + ndr_print_uint32(ndr, "data_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->data->length:r->data_length); ndr->depth--; } @@ -22235,7 +22250,7 @@ _PUBLIC_ void ndr_print_spoolss_ScheduleJob(struct ndr_print *ndr, const char *n ndr->depth--; } -_PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct _spoolss_GetPrinterData *r) +static enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -22256,7 +22271,8 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr if (r->out.data == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.data)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.offered)); if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -22266,11 +22282,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr return NDR_ERR_SUCCESS; } -_PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct _spoolss_GetPrinterData *r) +static 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_data_0; TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -22292,8 +22307,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr 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.data); - ZERO_STRUCTP(r->out.data); + NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.offered); + memset(r->out.data, 0, (r->in.offered) * sizeof(*r->out.data)); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); } @@ -22305,13 +22320,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_winreg_Type(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.data)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.data); + NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); } - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); + 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.needed); } @@ -22320,44 +22333,9 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr 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; -} - -_PUBLIC_ enum ndr_err_code ndr_push___spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct __spoolss_GetPrinterData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); - } - if (flags & NDR_OUT) { - if (r->out.data == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.data, r->in.type)); - NDR_CHECK(ndr_push_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.data)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull___spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct __spoolss_GetPrinterData *r) -{ - TALLOC_CTX *_mem_save_data_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); - NDR_PULL_ALLOC(ndr, r->out.data); - ZERO_STRUCTP(r->out.data); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.data); + if (r->out.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.offered)); } - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.data, r->in.type)); - NDR_CHECK(ndr_pull_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); } return NDR_ERR_SUCCESS; } @@ -22389,8 +22367,7 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterData(struct ndr_print *ndr, const char ndr->depth--; ndr_print_ptr(ndr, "data", r->out.data); 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_array_uint8(ndr, "data", r->out.data, r->in.offered); ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; @@ -22402,7 +22379,7 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterData(struct ndr_print *ndr, const char ndr->depth--; } -_PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct _spoolss_SetPrinterData *r) +static enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -22414,8 +22391,12 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterData(struct ndr_push *ndr NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.value_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.value_name, ndr_charset_length(r->in.value_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->in.data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in._offered)); + if (r->in.data == 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->in.data, r->in.offered)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -22423,21 +22404,6 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterData(struct ndr_push *ndr return NDR_ERR_SUCCESS; } -_PUBLIC_ enum ndr_err_code ndr_push___spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct __spoolss_SetPrinterData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); - } - if (flags & NDR_OUT) { - if (r->out.data == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.data, r->in.type)); - NDR_CHECK(ndr_push_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.data)); - } - return NDR_ERR_SUCCESS; -} - static enum ndr_err_code ndr_pull_spoolss_SetPrinterData(struct ndr_pull *ndr, int flags, struct spoolss_SetPrinterData *r) { TALLOC_CTX *_mem_save_handle_0; @@ -22457,14 +22423,15 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterData(struct ndr_pull *ndr, i 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_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); - { - struct ndr_pull *_ndr_data; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 4, -1)); - NDR_CHECK(ndr_pull_set_switch_value(_ndr_data, &r->in.data, r->in.type)); - NDR_CHECK(ndr_pull_spoolss_PrinterData(_ndr_data, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_data, 4, -1)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data))); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + if (r->in.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.offered)); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in._offered)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -22488,9 +22455,11 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterData(struct ndr_print *ndr, const char ndr->depth--; ndr_print_string(ndr, "value_name", r->in.value_name); ndr_print_winreg_Type(ndr, "type", r->in.type); - ndr_print_set_switch_value(ndr, &r->in.data, r->in.type); - ndr_print_spoolss_PrinterData(ndr, "data", &r->in.data); - ndr_print_uint32(ndr, "_offered", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_spoolss_PrinterData(&r->in.data, r->in.type, ndr->iconv_convenience, flags):r->in._offered); + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->in.data, r->in.offered); + ndr->depth--; + ndr_print_uint32(ndr, "offered", r->in.offered); ndr->depth--; } if (flags & NDR_OUT) { @@ -26571,11 +26540,11 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterDataEx(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.value_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.value_name, ndr_charset_length(r->in.value_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); - if (r->in.buffer == NULL) { + if (r->in.data == 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->in.buffer, r->in.offered)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.offered)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { @@ -26610,14 +26579,14 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterDataEx(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_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); + NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer))); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data))); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); - if (r->in.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.offered)); + if (r->in.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.offered)); } } if (flags & NDR_OUT) { @@ -26643,9 +26612,9 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterDataEx(struct ndr_print *ndr, const ch ndr_print_string(ndr, "key_name", r->in.key_name); ndr_print_string(ndr, "value_name", r->in.value_name); ndr_print_winreg_Type(ndr, "type", r->in.type); - ndr_print_ptr(ndr, "buffer", r->in.buffer); + ndr_print_ptr(ndr, "data", r->in.data); ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.offered); + ndr_print_array_uint8(ndr, "data", r->in.data, r->in.offered); ndr->depth--; ndr_print_uint32(ndr, "offered", r->in.offered); ndr->depth--; @@ -26681,11 +26650,11 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr, return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); - if (r->out.buffer == NULL) { + 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.offered)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.offered)); if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -26727,8 +26696,8 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, 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(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.offered); + memset(r->out.data, 0, (r->in.offered) * sizeof(*r->out.data)); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); } @@ -26740,11 +26709,11 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_winreg_Type(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)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + 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.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + 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.needed); } @@ -26753,8 +26722,8 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, 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)); + if (r->out.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.offered)); } } return NDR_ERR_SUCCESS; @@ -26786,9 +26755,9 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch ndr->depth++; ndr_print_winreg_Type(ndr, "type", *r->out.type); ndr->depth--; - ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr_print_ptr(ndr, "data", r->out.data); ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered); + ndr_print_array_uint8(ndr, "data", r->out.data, r->in.offered); ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index 00f89b667e..fcbec8ea9b 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -302,6 +302,8 @@ void ndr_print_spoolss_SetPrinterInfo4(struct ndr_print *ndr, const char *name, void ndr_print_spoolss_SetPrinterInfo5(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo5 *r); void ndr_print_spoolss_SetPrinterInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo6 *r); void ndr_print_spoolss_SetPrinterInfo7(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo7 *r); +void ndr_print_spoolss_SetPrinterInfo8(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo8 *r); +void ndr_print_spoolss_SetPrinterInfo9(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo9 *r); void ndr_print_spoolss_SetPrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_SetPrinterInfo *r); void ndr_print_spoolss_SetPrinterInfoCtr(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfoCtr *r); enum ndr_err_code ndr_push_spoolss_StringArray(struct ndr_push *ndr, int ndr_flags, const struct spoolss_StringArray *r); @@ -563,22 +565,7 @@ void ndr_print_spoolss_ReadPrinter(struct ndr_print *ndr, const char *name, int void ndr_print_spoolss_EndDocPrinter(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EndDocPrinter *r); void ndr_print_spoolss_AddJob(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_AddJob *r); void ndr_print_spoolss_ScheduleJob(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_ScheduleJob *r); -enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct _spoolss_GetPrinterData *r); -enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct _spoolss_GetPrinterData *r); -void ndr_print__spoolss_GetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_GetPrinterData *r); -enum ndr_err_code ndr_push___spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct __spoolss_GetPrinterData *r); -enum ndr_err_code ndr_pull___spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct __spoolss_GetPrinterData *r); -void ndr_print___spoolss_GetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_GetPrinterData *r); -enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r); -enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterData *r); void ndr_print_spoolss_GetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_GetPrinterData *r); -enum ndr_err_code ndr_push__spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct _spoolss_SetPrinterData *r); -enum ndr_err_code ndr_pull__spoolss_SetPrinterData(struct ndr_pull *ndr, int flags, struct _spoolss_SetPrinterData *r); -void ndr_print__spoolss_SetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_SetPrinterData *r); -enum ndr_err_code ndr_push___spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct __spoolss_SetPrinterData *r); -enum ndr_err_code ndr_pull___spoolss_SetPrinterData(struct ndr_pull *ndr, int flags, struct __spoolss_SetPrinterData *r); -void ndr_print___spoolss_SetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_SetPrinterData *r); -enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r); void ndr_print_spoolss_SetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_SetPrinterData *r); void ndr_print_spoolss_WaitForPrinterChange(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_WaitForPrinterChange *r); enum ndr_err_code ndr_push_spoolss_ClosePrinter(struct ndr_push *ndr, int flags, const struct spoolss_ClosePrinter *r); diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index a2487b283e..4dbdccc918 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -658,12 +658,12 @@ struct spoolss_SetPrinterInfo2 { const char *drivername;/* [unique,charset(UTF16)] */ const char *comment;/* [unique,charset(UTF16)] */ const char *location;/* [unique,charset(UTF16)] */ - struct spoolss_DeviceMode *devmode;/* [unique,subcontext(0)] */ + uint32_t devmode_ptr; const char *sepfile;/* [unique,charset(UTF16)] */ const char *printprocessor;/* [unique,charset(UTF16)] */ const char *datatype;/* [unique,charset(UTF16)] */ const char *parameters;/* [unique,charset(UTF16)] */ - struct security_descriptor *secdesc;/* [unique,subcontext(0)] */ + uint32_t secdesc_ptr; uint32_t attributes; uint32_t priority;/* [range(0,99)] */ uint32_t defaultpriority; @@ -701,6 +701,14 @@ struct spoolss_SetPrinterInfo7 { uint32_t action; }; +struct spoolss_SetPrinterInfo8 { + uint32_t devmode_ptr; +}; + +struct spoolss_SetPrinterInfo9 { + uint32_t devmode_ptr; +}; + union spoolss_SetPrinterInfo { struct spoolss_SetPrinterInfo0 *info0;/* [unique,case(0)] */ struct spoolss_SetPrinterInfo1 *info1;/* [unique,case] */ @@ -710,8 +718,8 @@ union spoolss_SetPrinterInfo { struct spoolss_SetPrinterInfo5 *info5;/* [unique,case(5)] */ struct spoolss_SetPrinterInfo6 *info6;/* [unique,case(6)] */ struct spoolss_SetPrinterInfo7 *info7;/* [unique,case(7)] */ - struct spoolss_DeviceModeInfo *info8;/* [unique,case(8)] */ - struct spoolss_DeviceModeInfo *info9;/* [unique,case(9)] */ + struct spoolss_SetPrinterInfo8 *info8;/* [unique,case(8)] */ + struct spoolss_SetPrinterInfo9 *info9;/* [unique,case(9)] */ }/* [switch_type(uint32)] */; struct spoolss_SetPrinterInfoCtr { @@ -1560,8 +1568,8 @@ struct spoolss_PrinterEnumValues { const char * value_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t value_name_len;/* [value(2*strlen_m_term(value_name))] */ enum winreg_Type type; - union spoolss_PrinterData *data;/* [relative,subcontext_size(r->data_length),subcontext(0),switch_is(type)] */ - uint32_t data_length;/* [value(ndr_size_spoolss_PrinterData(data,type,ndr->iconv_convenience,ndr->flags))] */ + DATA_BLOB *data;/* [relative,subcontext_size(data_length),subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ + uint32_t data_length;/* [value(data->length)] */ }/* [relative_base,gensize,public] */; union spoolss_KeyNames { @@ -2153,35 +2161,6 @@ struct spoolss_ScheduleJob { }; -struct _spoolss_GetPrinterData { - struct { - struct policy_handle *handle;/* [ref] */ - const char *value_name;/* [charset(UTF16)] */ - uint32_t offered; - } in; - - struct { - enum winreg_Type *type;/* [ref] */ - DATA_BLOB *data;/* [ref] */ - uint32_t *needed;/* [ref] */ - WERROR result; - } out; - -}; - - -struct __spoolss_GetPrinterData { - struct { - enum winreg_Type type; - } in; - - struct { - union spoolss_PrinterData *data;/* [ref,switch_is(type)] */ - } out; - -}; - - struct spoolss_GetPrinterData { struct { struct policy_handle *handle;/* [ref] */ @@ -2191,7 +2170,7 @@ struct spoolss_GetPrinterData { struct { enum winreg_Type *type;/* [ref] */ - union spoolss_PrinterData *data;/* [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */ + uint8_t *data;/* [ref,size_is(offered)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2199,41 +2178,13 @@ struct spoolss_GetPrinterData { }; -struct _spoolss_SetPrinterData { - struct { - struct policy_handle *handle;/* [ref] */ - const char *value_name;/* [charset(UTF16)] */ - enum winreg_Type type; - DATA_BLOB data; - uint32_t _offered; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct __spoolss_SetPrinterData { - struct { - enum winreg_Type type; - } in; - - struct { - union spoolss_PrinterData *data;/* [ref,switch_is(type)] */ - } out; - -}; - - struct spoolss_SetPrinterData { struct { struct policy_handle *handle;/* [ref] */ const char *value_name;/* [charset(UTF16)] */ enum winreg_Type type; - union spoolss_PrinterData data;/* [subcontext(4),switch_is(type)] */ - uint32_t _offered;/* [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */ + uint8_t *data;/* [ref,size_is(offered)] */ + uint32_t offered; } in; struct { @@ -2952,7 +2903,7 @@ struct spoolss_SetPrinterDataEx { const char *key_name;/* [charset(UTF16)] */ const char *value_name;/* [charset(UTF16)] */ enum winreg_Type type; - uint8_t *buffer;/* [ref,size_is(offered)] */ + uint8_t *data;/* [ref,size_is(offered)] */ uint32_t offered; } in; @@ -2973,7 +2924,7 @@ struct spoolss_GetPrinterDataEx { struct { enum winreg_Type *type;/* [ref] */ - uint8_t *buffer;/* [ref,size_is(offered)] */ + uint8_t *data;/* [ref,size_is(offered)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c index 9e58eb52a5..3cfe40c47d 100644 --- a/librpc/gen_ndr/srv_spoolss.c +++ b/librpc/gen_ndr/srv_spoolss.c @@ -2119,7 +2119,7 @@ static bool api_spoolss_GetPrinterData(pipes_struct *p) return false; } - r->out.data = talloc_zero(r, union spoolss_PrinterData); + r->out.data = talloc_zero_array(r, uint8_t, r->in.offered); if (r->out.data == NULL) { talloc_free(r); return false; @@ -6118,8 +6118,8 @@ static bool api_spoolss_GetPrinterDataEx(pipes_struct *p) return false; } - r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered); - if (r->out.buffer == NULL) { + r->out.data = talloc_zero_array(r, uint8_t, r->in.offered); + if (r->out.data == NULL) { talloc_free(r); return false; } @@ -7882,7 +7882,7 @@ 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); + r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.offered); if (r->out.data == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8366,8 +8366,8 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered); - if (r->out.buffer == NULL) { + r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.offered); + if (r->out.data == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl index 0201cba61e..accf96a221 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -700,12 +700,12 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") [string,charset(UTF16)] uint16 *drivername; [string,charset(UTF16)] uint16 *comment; [string,charset(UTF16)] uint16 *location; - [subcontext(0)] spoolss_DeviceMode *devmode; + uint32 devmode_ptr; [string,charset(UTF16)] uint16 *sepfile; [string,charset(UTF16)] uint16 *printprocessor; [string,charset(UTF16)] uint16 *datatype; [string,charset(UTF16)] uint16 *parameters; - [subcontext(0)] security_descriptor *secdesc; + uint32 secdesc_ptr; spoolss_PrinterAttributes attributes; [range(0,99)] uint32 priority; uint32 defaultpriority; @@ -743,6 +743,14 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") spoolss_DsPrintAction action; } spoolss_SetPrinterInfo7; + typedef struct { + uint32 devmode_ptr; + } spoolss_SetPrinterInfo8; + + typedef struct { + uint32 devmode_ptr; + } spoolss_SetPrinterInfo9; + typedef [switch_type(uint32)] union { [case(0)] spoolss_SetPrinterInfo0 *info0; [case(1)] spoolss_SetPrinterInfo1 *info1; @@ -752,8 +760,8 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") [case(5)] spoolss_SetPrinterInfo5 *info5; [case(6)] spoolss_SetPrinterInfo6 *info6; [case(7)] spoolss_SetPrinterInfo7 *info7; - [case(8)] spoolss_DeviceModeInfo *info8; - [case(9)] spoolss_DeviceModeInfo *info9; + [case(8)] spoolss_SetPrinterInfo8 *info8; + [case(9)] spoolss_SetPrinterInfo9 *info9; [default]; } spoolss_SetPrinterInfo; @@ -1328,46 +1336,23 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") [default,flag(NDR_REMAINING)] DATA_BLOB data; } spoolss_PrinterData; - [noopnum,noprint,public] WERROR _spoolss_GetPrinterData( + WERROR spoolss_GetPrinterData( [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 value_name[], - [in] uint32 offered, [out,ref] winreg_Type *type, - [out,ref] DATA_BLOB *data, - [out,ref] uint32 *needed - ); - [noopnum,noprint,public] void __spoolss_GetPrinterData( - [in] winreg_Type type, - [out,ref,switch_is(type)] spoolss_PrinterData *data - ); - [nopull,nopush,public] WERROR spoolss_GetPrinterData( - [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 value_name[], + [out,ref] [size_is(offered)] uint8 *data, [in] uint32 offered, - [out,ref] winreg_Type *type, - [out,ref,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData *data, [out,ref] uint32 *needed ); /******************/ /* Function: 0x1b */ - [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData( + WERROR spoolss_SetPrinterData( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 value_name[], - [in] winreg_Type type, - [in] DATA_BLOB data, - [in] uint32 _offered - ); - [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData( - [in] winreg_Type type, - [out,ref,switch_is(type)] spoolss_PrinterData *data - ); - [nopush] WERROR spoolss_SetPrinterData( - [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 value_name[], - [in] winreg_Type type, - [in,subcontext(4),switch_is(type)] spoolss_PrinterData data, - [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered + [in] [string,charset(UTF16)] uint16 value_name[], + [in] winreg_Type type, + [in,ref] [size_is(offered)] uint8 *data, + [in] uint32 offered ); /******************/ @@ -2252,7 +2237,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") [in] [string,charset(UTF16)] uint16 key_name[], [in] [string,charset(UTF16)] uint16 value_name[], [in] winreg_Type type, - [in,ref] [size_is(offered)] uint8 *buffer, + [in,ref] [size_is(offered)] uint8 *data, [in] uint32 offered ); @@ -2263,7 +2248,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") [in] [string,charset(UTF16)] uint16 key_name[], [in] [string,charset(UTF16)] uint16 value_name[], [out,ref] winreg_Type *type, - [out,ref] [size_is(offered)] uint8 *buffer, + [out,ref] [size_is(offered)] uint8 *data, [in] uint32 offered, [out,ref] uint32 *needed ); @@ -2275,8 +2260,8 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") [relative] nstring *value_name; [value(2*strlen_m_term(value_name))] uint32 value_name_len; winreg_Type type; - [relative,switch_is(type),subcontext(0),subcontext_size(r->data_length)] spoolss_PrinterData *data; - [value(ndr_size_spoolss_PrinterData(data, type, ndr->iconv_convenience, ndr->flags))] uint32 data_length; + [relative,subcontext(0),subcontext_size(data_length),flag(NDR_REMAINING)] DATA_BLOB *data; + [value(data->length)] uint32 data_length; } spoolss_PrinterEnumValues; [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx( diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index 2ce347714b..9078c629a3 100644 --- a/librpc/ndr/ndr_spoolss_buf.c +++ b/librpc/ndr/ndr_spoolss_buf.c @@ -557,146 +557,6 @@ uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinterDataEx); } -/* - spoolss_GetPrinterData -*/ -enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r) -{ - struct _spoolss_GetPrinterData _r; - if (flags & NDR_IN) { - _r.in.handle = r->in.handle; - _r.in.value_name= r->in.value_name; - _r.in.offered = r->in.offered; - NDR_CHECK(ndr_push__spoolss_GetPrinterData(ndr, flags, &_r)); - } - if (flags & NDR_OUT) { - struct ndr_push *_ndr_info; - DATA_BLOB blob = data_blob(NULL, 0); - _r.in.handle = r->in.handle; - _r.in.value_name= r->in.value_name; - _r.in.offered = r->in.offered; - _r.out.type = r->out.type; - _r.out.data = &blob; - _r.out.needed = r->out.needed; - _r.out.result = r->out.result; - { - struct __spoolss_GetPrinterData __r; - DATA_BLOB _blob; - _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience); - NDR_ERR_HAVE_NO_MEMORY(_ndr_info); - _ndr_info->flags= ndr->flags; - __r.in.type = *r->out.type; - __r.out.data = r->out.data; - NDR_CHECK(ndr_push___spoolss_GetPrinterData(_ndr_info, flags, &__r)); - if (r->in.offered > _ndr_info->offset) { - uint32_t _padding_len = r->in.offered - _ndr_info->offset; - NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len)); - } - _blob = ndr_push_blob(_ndr_info); - _r.out.data = &_blob; - } - NDR_CHECK(ndr_push__spoolss_GetPrinterData(ndr, flags, &_r)); - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterData *r) -{ - struct _spoolss_GetPrinterData _r; - if (flags & NDR_IN) { - DATA_BLOB blob = data_blob(NULL,0); - ZERO_STRUCT(r->out); - - _r.in.handle = r->in.handle; - _r.in.value_name= r->in.value_name; - _r.in.offered = r->in.offered; - _r.out.type = r->out.type; - _r.out.data = &blob; - _r.out.needed = r->out.needed; - NDR_CHECK(ndr_pull__spoolss_GetPrinterData(ndr, flags, &_r)); - r->in.handle = _r.in.handle; - r->in.value_name= _r.in.value_name; - r->in.offered = _r.in.offered; - r->out.needed = _r.out.needed; - } - if (flags & NDR_OUT) { - DATA_BLOB blob = data_blob_talloc(ndr,NULL,0); - _r.in.handle = r->in.handle; - _r.in.value_name= r->in.value_name; - _r.in.offered = r->in.offered; - _r.out.type = r->out.type; - _r.out.data = &blob; - _r.out.needed = r->out.needed; - _r.out.result = r->out.result; - NDR_CHECK(ndr_pull__spoolss_GetPrinterData(ndr, flags, &_r)); - r->out.type = _r.out.type; - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.data); - } - ZERO_STRUCTP(r->out.data); - r->out.needed = _r.out.needed; - r->out.result = _r.out.result; - if (_r.out.data && _r.out.data->length != r->in.offered) { - return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, - "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]", - (unsigned)r->in.offered, (unsigned)_r.out.data->length); - } - if (_r.out.data && _r.out.data->length > 0 && *r->out.needed <= _r.out.data->length) { - struct __spoolss_GetPrinterData __r; - struct ndr_pull *_ndr_data = ndr_pull_init_blob(_r.out.data, ndr, ndr->iconv_convenience); - NDR_ERR_HAVE_NO_MEMORY(_ndr_data); - _ndr_data->flags= ndr->flags; - __r.in.type = *r->out.type; - __r.out.data = r->out.data; - NDR_CHECK(ndr_pull___spoolss_GetPrinterData(_ndr_data, flags, &__r)); - r->out.data = __r.out.data; - } else { - *r->out.type = REG_NONE; - } - } - return NDR_ERR_SUCCESS; -} - -/* - spoolss_SetPrinterData -*/ -enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r) -{ - struct _spoolss_SetPrinterData _r; - if (flags & NDR_IN) { - struct ndr_push *_ndr_data; - struct __spoolss_SetPrinterData __r; - DATA_BLOB _data_blob_data; - - _ndr_data = ndr_push_init_ctx(ndr, ndr->iconv_convenience); - NDR_ERR_HAVE_NO_MEMORY(_ndr_data); - _ndr_data->flags= ndr->flags; - - __r.in.type = r->in.type; - __r.out.data = discard_const_p(union spoolss_PrinterData, &r->in.data); - NDR_CHECK(ndr_push___spoolss_SetPrinterData(_ndr_data, NDR_OUT, &__r)); - _data_blob_data = ndr_push_blob(_ndr_data); - - _r.in.handle = r->in.handle; - _r.in.value_name= r->in.value_name; - _r.in.type = r->in.type; - _r.in.data = _data_blob_data; - _r.in._offered = _data_blob_data.length; - _r.out.result = r->out.result; - NDR_CHECK(ndr_push__spoolss_SetPrinterData(ndr, flags, &_r)); - } - if (flags & NDR_OUT) { - _r.in.handle = r->in.handle; - _r.in.value_name= r->in.value_name; - _r.in.type = r->in.type; - _r.in.data = data_blob(NULL,0), - _r.in._offered = r->in._offered; - _r.out.result = r->out.result; - NDR_CHECK(ndr_push__spoolss_SetPrinterData(ndr, flags, &_r)); - } - return NDR_ERR_SUCCESS; -} - uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic, uint32_t flags) { if (!devmode) return 0; diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h index e72d16a839..b1020802d0 100644 --- a/librpc/ndr/ndr_spoolss_buf.h +++ b/librpc/ndr/ndr_spoolss_buf.h @@ -42,9 +42,6 @@ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int f enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r); uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t count, struct spoolss_PrinterEnumValues *info); -enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r); -enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterData *r); -enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r); uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic, uint32_t flags); size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic, int flags); _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r); |