summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-05 17:17:49 +0100
committerKarolin Seeger <kseeger@samba.org>2010-03-29 09:41:02 +0200
commit97668127c48056ad62d8ca36b59ab1e20f8dbda6 (patch)
treecafe856ce6d1fe720b5be6b053f81d9edfa454a9
parent09d831877d35a4c1577097585f448480bd0ca4ed (diff)
downloadsamba-97668127c48056ad62d8ca36b59ab1e20f8dbda6.tar.gz
samba-97668127c48056ad62d8ca36b59ab1e20f8dbda6.tar.xz
samba-97668127c48056ad62d8ca36b59ab1e20f8dbda6.zip
s3: re-run make samba3-idl.
Guenther (cherry picked from commit ffbc52150d7e2101da05fafd7ce8ed16967db253)
-rw-r--r--librpc/gen_ndr/cli_spoolss.c48
-rw-r--r--librpc/gen_ndr/cli_spoolss.h32
-rw-r--r--librpc/gen_ndr/ndr_spoolss.c305
-rw-r--r--librpc/gen_ndr/ndr_spoolss.h30
-rw-r--r--librpc/gen_ndr/spoolss.h130
-rw-r--r--librpc/gen_ndr/srv_spoolss.c8
6 files changed, 166 insertions, 387 deletions
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index c6bb8ed6adc..c674f940b14 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -4152,9 +4152,9 @@ struct tevent_req *rpccli_spoolss_GetPrinterData_send(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *cli,
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] */)
{
struct tevent_req *req;
@@ -4226,7 +4226,7 @@ static void rpccli_spoolss_GetPrinterData_done(struct tevent_req *subreq)
/* Copy out parameters */
*state->orig.out.type = *state->tmp.out.type;
- *state->orig.out.data = *state->tmp.out.data;
+ memcpy(state->orig.out.data, state->tmp.out.data, (state->tmp.in.offered) * sizeof(*state->orig.out.data));
*state->orig.out.needed = *state->tmp.out.needed;
/* Copy result */
@@ -4265,9 +4265,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)
{
@@ -4295,7 +4295,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 */
@@ -4321,8 +4321,8 @@ struct tevent_req *rpccli_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
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] */)
{
struct tevent_req *req;
struct rpccli_spoolss_SetPrinterData_state *state;
@@ -4341,7 +4341,7 @@ struct tevent_req *rpccli_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
state->orig.in.value_name = _value_name;
state->orig.in.type = _type;
state->orig.in.data = _data;
- state->orig.in._offered = __offered;
+ state->orig.in.offered = _offered;
/* Out parameters */
@@ -4423,8 +4423,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;
@@ -4435,7 +4435,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;
status = cli->dispatch(cli,
mem_ctx,
@@ -11710,8 +11710,8 @@ struct tevent_req *rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
const char *_key_name /* [in] [charset(UTF16)] */,
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] */)
{
struct tevent_req *req;
struct rpccli_spoolss_SetPrinterDataEx_state *state;
@@ -11731,7 +11731,7 @@ struct tevent_req *rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
state->orig.in.value_name = _value_name;
state->orig.in.type = _type;
state->orig.in.data = _data;
- state->orig.in._offered = __offered;
+ state->orig.in.offered = _offered;
/* Out parameters */
@@ -11814,8 +11814,8 @@ 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] */,
- 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_SetPrinterDataEx r;
@@ -11827,7 +11827,7 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(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;
status = cli->dispatch(cli,
mem_ctx,
@@ -11868,9 +11868,9 @@ struct tevent_req *rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
struct policy_handle *_handle /* [in] [ref] */,
const char *_key_name /* [in] [charset(UTF16)] */,
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] */)
{
struct tevent_req *req;
@@ -11943,7 +11943,7 @@ static void rpccli_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq)
/* Copy out parameters */
*state->orig.out.type = *state->tmp.out.type;
- *state->orig.out.data = *state->tmp.out.data;
+ memcpy(state->orig.out.data, state->tmp.out.data, (state->tmp.in.offered) * sizeof(*state->orig.out.data));
*state->orig.out.needed = *state->tmp.out.needed;
/* Copy result */
@@ -11983,9 +11983,9 @@ 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 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)
{
@@ -12014,7 +12014,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(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 */
diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h
index cae24be225f..f5e554d88de 100644
--- a/librpc/gen_ndr/cli_spoolss.h
+++ b/librpc/gen_ndr/cli_spoolss.h
@@ -478,9 +478,9 @@ struct tevent_req *rpccli_spoolss_GetPrinterData_send(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *cli,
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] */);
NTSTATUS rpccli_spoolss_GetPrinterData_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
@@ -489,9 +489,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);
struct tevent_req *rpccli_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
@@ -500,8 +500,8 @@ struct tevent_req *rpccli_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
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] */);
NTSTATUS rpccli_spoolss_SetPrinterData_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
WERROR *result);
@@ -510,8 +510,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 tevent_req *rpccli_spoolss_WaitForPrinterChange_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
@@ -1199,8 +1199,8 @@ struct tevent_req *rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
const char *_key_name /* [in] [charset(UTF16)] */,
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] */);
NTSTATUS rpccli_spoolss_SetPrinterDataEx_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
WERROR *result);
@@ -1210,8 +1210,8 @@ 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] */,
- 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 tevent_req *rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
@@ -1219,9 +1219,9 @@ struct tevent_req *rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
struct policy_handle *_handle /* [in] [ref] */,
const char *_key_name /* [in] [charset(UTF16)] */,
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] */);
NTSTATUS rpccli_spoolss_GetPrinterDataEx_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
@@ -1231,9 +1231,9 @@ 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 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);
struct tevent_req *rpccli_spoolss_EnumPrinterDataEx_send(TALLOC_CTX *mem_ctx,
diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c
index fe749010634..af555d75ee6 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -19532,8 +19532,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));
NDR_CHECK(ndr_push_trailer_align(ndr, 5));
}
if (ndr_flags & NDR_BUFFERS) {
@@ -19548,16 +19553,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);
@@ -19588,12 +19597,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));
NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
@@ -19615,21 +19629,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);
@@ -19651,11 +19669,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--;
}
@@ -23405,7 +23422,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) {
@@ -23426,7 +23443,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_uint3264(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");
}
@@ -23436,11 +23454,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);
@@ -23462,8 +23479,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);
}
@@ -23475,13 +23492,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);
}
@@ -23490,44 +23505,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;
}
@@ -23559,8 +23539,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++;
@@ -23572,7 +23551,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) {
@@ -23584,8 +23563,12 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterData(struct ndr_push *ndr
NDR_CHECK(ndr_push_uint3264(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_uint3264(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));
@@ -23593,21 +23576,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;
@@ -23627,14 +23595,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));
@@ -23658,9 +23627,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) {
@@ -27812,7 +27783,7 @@ _PUBLIC_ void ndr_print_spoolss_4c(struct ndr_print *ndr, const char *name, int
ndr->depth--;
}
-_PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_SetPrinterDataEx *r)
+static enum ndr_err_code ndr_push_spoolss_SetPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterDataEx *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -27828,8 +27799,12 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterDataEx(struct ndr_push *n
NDR_CHECK(ndr_push_uint3264(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_uint3264(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));
@@ -27837,21 +27812,6 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterDataEx(struct ndr_push *n
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ enum ndr_err_code ndr_push___spoolss_SetPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_SetPrinterDataEx *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_SetPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_SetPrinterDataEx *r)
{
TALLOC_CTX *_mem_save_handle_0;
@@ -27878,14 +27838,15 @@ 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));
- {
- 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));
@@ -27910,9 +27871,11 @@ _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_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) {
@@ -27924,7 +27887,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterDataEx(struct ndr_print *ndr, const ch
ndr->depth--;
}
-_PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_GetPrinterDataEx *r)
+static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterDataEx *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -27949,7 +27912,8 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterDataEx(struct ndr_push *n
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_uint3264(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");
}
@@ -27959,11 +27923,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterDataEx(struct ndr_push *n
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_GetPrinterDataEx *r)
+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_data_0;
TALLOC_CTX *_mem_save_needed_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -27992,8 +27955,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterDataEx(struct ndr_pull *n
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);
}
@@ -28005,13 +27968,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterDataEx(struct ndr_pull *n
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);
}
@@ -28020,44 +27981,9 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterDataEx(struct ndr_pull *n
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_GetPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_GetPrinterDataEx *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_GetPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_GetPrinterDataEx *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;
}
@@ -28090,8 +28016,7 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch
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++;
diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h
index 0591980c145..71390b57d27 100644
--- a/librpc/gen_ndr/ndr_spoolss.h
+++ b/librpc/gen_ndr/ndr_spoolss.h
@@ -611,22 +611,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);
@@ -723,22 +708,7 @@ void ndr_print_spoolss_DeletePrinterData(struct ndr_print *ndr, const char *name
void ndr_print_spoolss_4a(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_4a *r);
void ndr_print_spoolss_4b(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_4b *r);
void ndr_print_spoolss_4c(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_4c *r);
-enum ndr_err_code ndr_push__spoolss_SetPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_SetPrinterDataEx *r);
-enum ndr_err_code ndr_pull__spoolss_SetPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_SetPrinterDataEx *r);
-void ndr_print__spoolss_SetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_SetPrinterDataEx *r);
-enum ndr_err_code ndr_push___spoolss_SetPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_SetPrinterDataEx *r);
-enum ndr_err_code ndr_pull___spoolss_SetPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_SetPrinterDataEx *r);
-void ndr_print___spoolss_SetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_SetPrinterDataEx *r);
-enum ndr_err_code ndr_push_spoolss_SetPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterDataEx *r);
void ndr_print_spoolss_SetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_SetPrinterDataEx *r);
-enum ndr_err_code ndr_push__spoolss_GetPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_GetPrinterDataEx *r);
-enum ndr_err_code ndr_pull__spoolss_GetPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_GetPrinterDataEx *r);
-void ndr_print__spoolss_GetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_GetPrinterDataEx *r);
-enum ndr_err_code ndr_push___spoolss_GetPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_GetPrinterDataEx *r);
-enum ndr_err_code ndr_pull___spoolss_GetPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_GetPrinterDataEx *r);
-void ndr_print___spoolss_GetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_GetPrinterDataEx *r);
-enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterDataEx *r);
-enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterDataEx *r);
void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_GetPrinterDataEx *r);
enum ndr_err_code ndr_push__spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinterDataEx *r);
enum ndr_err_code ndr_pull__spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinterDataEx *r);
diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h
index 945453c3599..fc7114ada04 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -2068,8 +2068,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 {
@@ -2686,35 +2686,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] */
@@ -2724,7 +2695,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;
@@ -2732,41 +2703,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 {
@@ -3490,82 +3433,23 @@ struct spoolss_4c {
};
-struct _spoolss_SetPrinterDataEx {
- struct {
- struct policy_handle *handle;/* [ref] */
- const char *key_name;/* [charset(UTF16)] */
- const char *value_name;/* [charset(UTF16)] */
- enum winreg_Type type;
- DATA_BLOB data;
- uint32_t _offered;
- } in;
-
- struct {
- WERROR result;
- } out;
-
-};
-
-
-struct __spoolss_SetPrinterDataEx {
- struct {
- enum winreg_Type type;
- } in;
-
- struct {
- union spoolss_PrinterData *data;/* [ref,switch_is(type)] */
- } out;
-
-};
-
-
struct spoolss_SetPrinterDataEx {
struct {
struct policy_handle *handle;/* [ref] */
const char *key_name;/* [charset(UTF16)] */
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))] */
- } in;
-
- struct {
- WERROR result;
- } out;
-
-};
-
-
-struct _spoolss_GetPrinterDataEx {
- struct {
- struct policy_handle *handle;/* [ref] */
- const char *key_name;/* [charset(UTF16)] */
- const char *value_name;/* [charset(UTF16)] */
+ uint8_t *data;/* [ref,size_is(offered)] */
uint32_t offered;
} in;
struct {
- enum winreg_Type *type;/* [ref] */
- DATA_BLOB *data;/* [ref] */
- uint32_t *needed;/* [ref] */
WERROR result;
} out;
};
-struct __spoolss_GetPrinterDataEx {
- struct {
- enum winreg_Type type;
- } in;
-
- struct {
- union spoolss_PrinterData *data;/* [ref,switch_is(type)] */
- } out;
-
-};
-
-
struct spoolss_GetPrinterDataEx {
struct {
struct policy_handle *handle;/* [ref] */
@@ -3576,7 +3460,7 @@ struct spoolss_GetPrinterDataEx {
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;
diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index cc11d122bef..236467a00b5 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -2139,7 +2139,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;
@@ -6147,7 +6147,7 @@ static bool api_spoolss_GetPrinterDataEx(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;
@@ -8979,7 +8979,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;
}
@@ -9471,7 +9471,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;
}