The branch, v3-5-test has been updated
       via  5dde368... s4-smbtorture: disable some spoolss printerdata tests 
which s3 does not pass at the moment.
       via  3f3c04e... s3: fix net and rpcclient after setprinterdataex changes.
       via  f67637b... s4-smbtorture: fix RPC-SPOOLSS after 
_spoolss_SetPrinterDataEx IDL change.
       via  50df20e... s3-spoolss: let _spoolss_DeletePrinterData call into 
_spoolss_DeletePrinterDataEx.
       via  a987a9f... s3-spoolss: let _spoolss_SetPrinterData call into 
_spoolss_SetPrinterDataEx.
       via  4123250... s3-spoolss: let _spoolss_GetPrinterData call into 
_spoolss_GetPrinterDataEx.
       via  b35133d... spoolss: rework spoolss_GetPrinterDataEx and 
spoolss_SetPrinterDataEx.
       via  8af757f... s3-spoolss: a default printer should have at least a 
"PrintDriverData" key.
       via  7c646c3... s3-winreg: fill in some inline comments.
       via  d9717f6... s3-winreg: remove trailing whitespace.
       via  32bec5e... s4-smbtorture: heavily expand printerdata tests in 
RPC-SPOOLSS.
       via  e96c22d... s3-spoolss: handle SEC_FLAG_MAXIMUM_ALLOWED in 
spoolss_OpenPrinterEx.
       via  cfd570a... s4-smbtorture: check more WERRORs in RPC-SPOOLSS.
       via  3f0de03... s4-smbtorture: call test_EnumPrinterDrivers with 
architecture in RPC-SPOOLSS.
      from  626ae39... s3:auth: Fix typo in debug message.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 5dde3686d951db49ae6a06a31dc43fd5c0d3162f
Author: Günther Deschner <g...@samba.org>
Date:   Mon Dec 7 14:38:24 2009 +0100

    s4-smbtorture: disable some spoolss printerdata tests which s3 does not 
pass at the moment.
    
    Guenther
    (cherry picked from commit 8de6f7178c220d0a529ed91f87760e8d172448d2)

commit 3f3c04e963d5532340b306ea4e875df2b03985d4
Author: Günther Deschner <g...@samba.org>
Date:   Mon Dec 7 11:54:26 2009 +0100

    s3: fix net and rpcclient after setprinterdataex changes.
    
    Guenther
    (cherry picked from commit c85ed0054e67413ffcd169c405ee4feda3555628)

commit f67637b63dce30b07fc95bd80ace36c9defbbb23
Author: Günther Deschner <g...@samba.org>
Date:   Sat Dec 5 00:58:45 2009 +0100

    s4-smbtorture: fix RPC-SPOOLSS after _spoolss_SetPrinterDataEx IDL change.
    
    Guenther
    (cherry picked from commit 123d8d1c2c8ea214fa1a216c92ca1a3fc1b4d6d0)

commit 50df20e01590533dbd086393ddf95835db2b71ac
Author: Günther Deschner <g...@samba.org>
Date:   Mon Dec 7 11:28:56 2009 +0100

    s3-spoolss: let _spoolss_DeletePrinterData call into 
_spoolss_DeletePrinterDataEx.
    
    Guenther
    (cherry picked from commit ef9d6580efc55ee040458b7cd76ebdc2e1276e98)

commit a987a9f33a9acba97764d1b43c106727ff653da3
Author: Günther Deschner <g...@samba.org>
Date:   Sat Dec 5 00:56:55 2009 +0100

    s3-spoolss: let _spoolss_SetPrinterData call into _spoolss_SetPrinterDataEx.
    
    Guenther
    (cherry picked from commit 167dca0cbf18baf40dd923f6f92421123d34b5a3)

commit 41232506678c06b64f193a0fae76b2bca862bd3f
Author: Günther Deschner <g...@samba.org>
Date:   Sat Dec 5 00:52:28 2009 +0100

    s3-spoolss: let _spoolss_GetPrinterData call into _spoolss_GetPrinterDataEx.
    
    Guenther
    (cherry picked from commit 778124ea32ecc9d2404ef6abd8af9d14e6320f3a)

commit b35133dcc618e169045e078c53873bf0694f74f0
Author: Günther Deschner <g...@samba.org>
Date:   Sat Dec 5 00:50:18 2009 +0100

    spoolss: rework spoolss_GetPrinterDataEx and spoolss_SetPrinterDataEx.
    
    Guenther
    (cherry picked from commit 08823166a13d5ec3027b0c5a0db5e684b8e3c3b6)

commit 8af757fe7c95ffba02d00d010fa5360943724574
Author: Günther Deschner <g...@samba.org>
Date:   Fri Dec 4 17:22:25 2009 +0100

    s3-spoolss: a default printer should have at least a "PrintDriverData" key.
    
    Guenther
    (cherry picked from commit a367b2b5df30b92ccacc4fc15c07c1fd955c7d5b)

commit 7c646c39d7b05fa3c98edf012bca0e8057e70d57
Author: Günther Deschner <g...@samba.org>
Date:   Fri Dec 4 13:33:49 2009 +0100

    s3-winreg: fill in some inline comments.
    
    Guenther
    (cherry picked from commit 1bc83b984d6f074a5a7c7d3e7f6de4a2278fee4c)

commit d9717f661ed06e833ba895831f59424476ed4831
Author: Günther Deschner <g...@samba.org>
Date:   Fri Dec 4 13:29:08 2009 +0100

    s3-winreg: remove trailing whitespace.
    
    Guenther
    (cherry picked from commit 5d46530053fa7728d1d4903a3d92f238202ab0d8)

commit 32bec5e5f09eec603b4fc366707bbd320dc804a3
Author: Günther Deschner <g...@samba.org>
Date:   Fri Dec 4 02:54:33 2009 +0100

    s4-smbtorture: heavily expand printerdata tests in RPC-SPOOLSS.
    
    Including new tests for:
    - spoolss_SetPrinterDataEx
    - spoolss_DeletePrinterDataEx
    - spoolss_DeletePrinterKey
    
    Guenther
    (cherry picked from commit 02fe8630395879ffa761d75c7d7b75fc7cda5e4c)

commit e96c22d8d16a520c2ee9f49f71c26d1cb86f148f
Author: Günther Deschner <g...@samba.org>
Date:   Thu Dec 3 23:23:36 2009 +0100

    s3-spoolss: handle SEC_FLAG_MAXIMUM_ALLOWED in spoolss_OpenPrinterEx.
    
    In case someone (smbtorture4) requests SEC_FLAG_MAXIMUM_ALLOWED, translate 
it
    to a request of PRINTER_ACCESS_ADMINISTER.
    
    Guenther
    (cherry picked from commit 459a968fb4d6f96ea7f310f331d3547e2e466d6a)

commit cfd570a0128db42429a48ab6001f20d99d8dbfeb
Author: Günther Deschner <g...@samba.org>
Date:   Thu Dec 3 22:38:38 2009 +0100

    s4-smbtorture: check more WERRORs in RPC-SPOOLSS.
    
    Guenther
    (cherry picked from commit 2f0548fd98ccbe9695d4e6ae0e21e5ceca76ac68)

commit 3f0de03ca9d6e075e10943d9e511134231809b16
Author: Günther Deschner <g...@samba.org>
Date:   Thu Dec 3 22:05:35 2009 +0100

    s4-smbtorture: call test_EnumPrinterDrivers with architecture in 
RPC-SPOOLSS.
    
    Guenther
    (cherry picked from commit 4e20a6f83b981ae0948ce1b9ec0a39162b38b512)

-----------------------------------------------------------------------

Summary of changes:
 librpc/gen_ndr/cli_spoolss.c        |   30 +-
 librpc/gen_ndr/cli_spoolss.h        |   16 +-
 librpc/gen_ndr/ndr_spoolss.c        |  114 ++++++---
 librpc/gen_ndr/ndr_spoolss.h        |   15 +
 librpc/gen_ndr/spoolss.h            |   63 +++++-
 librpc/gen_ndr/srv_spoolss.c        |    8 +-
 librpc/idl/spoolss.idl              |   41 +++-
 librpc/ndr/ndr_spoolss_buf.c        |  147 +++++++++++
 librpc/ndr/ndr_spoolss_buf.h        |    3 +
 source3/printing/nt_printing.c      |    7 +
 source3/rpc_server/srv_spoolss_nt.c |  296 ++++++---------------
 source3/rpc_server/srv_winreg_nt.c  |  128 ++++++----
 source3/rpcclient/cmd_spoolss.c     |   23 +--
 source3/utils/net_rpc_printer.c     |   13 +-
 source4/torture/rpc/spoolss.c       |  495 ++++++++++++++++++++++++++---------
 15 files changed, 922 insertions(+), 477 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index 0a5c2a6..e63a781 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -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]  */,
-                                                       uint8_t *_buffer /* 
[in] [ref,size_is(offered)] */,
-                                                       uint32_t _offered /* 
[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))] 
*/)
 {
        struct tevent_req *req;
        struct rpccli_spoolss_SetPrinterDataEx_state *state;
@@ -11730,8 +11730,8 @@ struct tevent_req 
*rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
        state->orig.in.key_name = _key_name;
        state->orig.in.value_name = _value_name;
        state->orig.in.type = _type;
-       state->orig.in.buffer = _buffer;
-       state->orig.in.offered = _offered;
+       state->orig.in.data = _data;
+       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]  */,
-                                        uint8_t *buffer /* [in] 
[ref,size_is(offered)] */,
-                                        uint32_t offered /* [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))] 
*/,
                                         WERROR *werror)
 {
        struct spoolss_SetPrinterDataEx r;
@@ -11826,8 +11826,8 @@ 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.offered = offered;
+       r.in.data = data;
+       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)] */,
-                                                       enum winreg_Type *_type 
/* [out] [ref] */,
-                                                       uint8_t *_buffer /* 
[out] [ref,size_is(offered)] */,
                                                        uint32_t _offered /* 
[in]  */,
+                                                       enum winreg_Type *_type 
/* [out] [ref] */,
+                                                       union 
spoolss_PrinterData *_data /* [out] 
[subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
                                                        uint32_t *_needed /* 
[out] [ref] */)
 {
        struct tevent_req *req;
@@ -11893,7 +11893,7 @@ struct tevent_req 
*rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
 
        /* Out parameters */
        state->orig.out.type = _type;
-       state->orig.out.buffer = _buffer;
+       state->orig.out.data = _data;
        state->orig.out.needed = _needed;
 
        /* Result */
@@ -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;
-       memcpy(state->orig.out.buffer, state->tmp.out.buffer, 
(state->tmp.in.offered) * sizeof(*state->orig.out.buffer));
+       *state->orig.out.data = *state->tmp.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)] */,
-                                        enum winreg_Type *type /* [out] [ref] 
*/,
-                                        uint8_t *buffer /* [out] 
[ref,size_is(offered)] */,
                                         uint32_t offered /* [in]  */,
+                                        enum winreg_Type *type /* [out] [ref] 
*/,
+                                        union spoolss_PrinterData *data /* 
[out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
                                         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;
-       memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
+       *data = *r.out.data;
        *needed = *r.out.needed;
 
        /* Return result */
diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h
index 58a45ee..f2c1353 100644
--- a/librpc/gen_ndr/cli_spoolss.h
+++ b/librpc/gen_ndr/cli_spoolss.h
@@ -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]  */,
-                                                       uint8_t *_buffer /* 
[in] [ref,size_is(offered)] */,
-                                                       uint32_t _offered /* 
[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))] 
*/);
 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]  */,
-                                        uint8_t *buffer /* [in] 
[ref,size_is(offered)] */,
-                                        uint32_t offered /* [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))] 
*/,
                                         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)] */,
-                                                       enum winreg_Type *_type 
/* [out] [ref] */,
-                                                       uint8_t *_buffer /* 
[out] [ref,size_is(offered)] */,
                                                        uint32_t _offered /* 
[in]  */,
+                                                       enum winreg_Type *_type 
/* [out] [ref] */,
+                                                       union 
spoolss_PrinterData *_data /* [out] 
[subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
                                                        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)] */,
-                                        enum winreg_Type *type /* [out] [ref] 
*/,
-                                        uint8_t *buffer /* [out] 
[ref,size_is(offered)] */,
                                         uint32_t offered /* [in]  */,
+                                        enum winreg_Type *type /* [out] [ref] 
*/,
+                                        union spoolss_PrinterData *data /* 
[out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
                                         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 a91f5ab..e09802f 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -27248,7 +27248,7 @@ _PUBLIC_ void ndr_print_spoolss_4c(struct ndr_print 
*ndr, const char *name, int
        ndr->depth--;
 }
 
-static enum ndr_err_code ndr_push_spoolss_SetPrinterDataEx(struct ndr_push 
*ndr, int flags, const struct spoolss_SetPrinterDataEx *r)
+_PUBLIC_ 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) {
@@ -27264,12 +27264,8 @@ static enum ndr_err_code 
ndr_push_spoolss_SetPrinterDataEx(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));
-               if (r->in.buffer == 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.buffer, 
r->in.offered));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
+               NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->in.data));
+               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));
@@ -27277,6 +27273,21 @@ static enum ndr_err_code 
ndr_push_spoolss_SetPrinterDataEx(struct ndr_push *ndr,
        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;
@@ -27303,15 +27314,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));
-               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC_N(ndr, r->in.buffer, 
ndr_get_array_size(ndr, &r->in.buffer));
-               }
-               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, 
ndr_get_array_size(ndr, &r->in.buffer)));
-               NDR_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));
+               {
+                       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_uint32(ndr, NDR_SCALARS, &r->in._offered));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
@@ -27336,11 +27346,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->depth++;
-               ndr_print_array_uint8(ndr, "buffer", r->in.buffer, 
r->in.offered);
-               ndr->depth--;
-               ndr_print_uint32(ndr, "offered", r->in.offered);
+               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->depth--;
        }
        if (flags & NDR_OUT) {
@@ -27352,7 +27360,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterDataEx(struct 
ndr_print *ndr, const ch
        ndr->depth--;
 }
 
-static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push 
*ndr, int flags, const struct spoolss_GetPrinterDataEx *r)
+_PUBLIC_ 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) {
@@ -27374,11 +27382,10 @@ 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_uint3264(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_DATA_BLOB(ndr, NDR_SCALARS, *r->out.data));
                if (r->out.needed == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, 
"NULL [ref] pointer");
                }
@@ -27388,10 +27395,11 @@ static enum ndr_err_code 
ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr,
        return NDR_ERR_SUCCESS;
 }
 
-static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull 
*ndr, int flags, struct spoolss_GetPrinterDataEx *r)
+_PUBLIC_ 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);
@@ -27420,8 +27428,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(ndr, r->out.data);
+               ZERO_STRUCTP(r->out.data);
                NDR_PULL_ALLOC(ndr, r->out.needed);
                ZERO_STRUCTP(r->out.needed);
        }
@@ -27433,11 +27441,13 @@ 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));
                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(ndr, r->out.data);
                }
-               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, 
ndr_get_array_size(ndr, &r->out.buffer)));
+               _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);
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->out.needed);
                }
@@ -27446,9 +27456,44 @@ 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));
+       }
+       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);
+               }
+               _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;
 }
@@ -27479,9 +27524,10 @@ _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_set_switch_value(ndr, r->out.data, *r->out.type);
+               ndr_print_spoolss_PrinterData(ndr, "data", r->out.data);
                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 895e1e9..1c31a95 100644
--- a/librpc/gen_ndr/ndr_spoolss.h
+++ b/librpc/gen_ndr/ndr_spoolss.h
@@ -716,7 +716,22 @@ 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 e209cb4..d6c267c 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -3468,23 +3468,82 @@ 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;
-               uint8_t *buffer;/* [ref,size_is(offered)] */
+               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)] */
                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] */
@@ -3495,7 +3554,7 @@ struct spoolss_GetPrinterDataEx {
 
        struct {
                enum winreg_Type *type;/* [ref] */
-               uint8_t *buffer;/* [ref,size_is(offered)] */
+               union spoolss_PrinterData *data;/* 
[subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */
                uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index 3b981f0..bc50c0b 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -6147,8 +6147,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(r, union spoolss_PrinterData);
+       if (r->out.data == NULL) {
                talloc_free(r);
                return false;
        }


-- 
Samba Shared Repository

Reply via email to