s3: re-run make samba3-idl.
authorGünther Deschner <gd@samba.org>
Tue, 9 Mar 2010 13:08:57 +0000 (14:08 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 6 May 2010 12:08:33 +0000 (14:08 +0200)
Guenther

The last 16 patches address bug #6727 (Printer issues on 3.4.x).
(cherry picked from commit 7586069115f9b385bba40c7c022a5b516463736f)

librpc/gen_ndr/cli_spoolss.c
librpc/gen_ndr/cli_spoolss.h
librpc/gen_ndr/ndr_spoolss.c
librpc/gen_ndr/ndr_spoolss.h
librpc/gen_ndr/spoolss.h
librpc/gen_ndr/srv_spoolss.c

index 10dd8b4c6c67a488abe232332fbb3114892c7125..88209713889872b2c323263717112b8969861b5e 100644 (file)
@@ -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 */
index eb1e8dd61faf585c5b56551e37427f39e6b38b91..0ee28e5ce9aea20cb1f32f0941f37699a18ff919 100644 (file)
@@ -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);
index cca1b12680d936617b346bc804ff61b1dbd8431f..59d987f3526e6b5a397bf95b633dca92224f79f6 100644 (file)
@@ -18650,8 +18650,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 +18670,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 +18714,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 +18745,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 +18785,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 +22252,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 +22273,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 +22284,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 +22309,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 +22322,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 +22335,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 +22369,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 +22381,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 +22393,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 +22406,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 +22425,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 +22457,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 +26542,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 +26581,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 +26614,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 +26652,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 +26698,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 +26711,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 +26724,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 +26757,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++;
index 00f89b667e27404e062efefdcf86844839ff3b4d..288ef3c776c7966a5cebfa48ffc5e2af3146ede1 100644 (file)
@@ -563,22 +563,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);
index a2487b283e2e9509395baaacbedcc72ad10afa29..04bdbcc07113632f9bef282e40b4d791f12c6520 100644 (file)
@@ -1560,8 +1560,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 +2153,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 +2162,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 +2170,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 +2895,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 +2916,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;
index 9e58eb52a54dfa8c24cf742e3f1487daecc5f2c0..3cfe40c47dc34b1018f82277921a04d42784f9ef 100644 (file)
@@ -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;
                        }