Merge branch 'master' of ssh://git.samba.org/data/git/samba
authorJelmer Vernooij <jelmer@samba.org>
Mon, 9 Feb 2009 15:51:46 +0000 (16:51 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 9 Feb 2009 15:51:46 +0000 (16:51 +0100)
123 files changed:
docs-xml/manpages-3/mount.cifs.8.xml
docs-xml/smbdotconf/ldap/ldapssl.xml
docs-xml/smbdotconf/ldap/ldapsslads.xml [new file with mode: 0644]
examples/VFS/Makefile.in
examples/VFS/configure.in
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
lib/async_req/async_sock.c
lib/async_req/async_sock.h
librpc/gen_ndr/cli_spoolss.c
librpc/gen_ndr/cli_spoolss.h
librpc/gen_ndr/misc.h
librpc/gen_ndr/ndr_misc.c
librpc/gen_ndr/ndr_misc.h
librpc/gen_ndr/ndr_spoolss.c
librpc/gen_ndr/ndr_spoolss.h
librpc/gen_ndr/spoolss.h
librpc/gen_ndr/srv_spoolss.c
librpc/idl/misc.idl
librpc/idl/spoolss.idl
librpc/ndr/ndr_spoolss_buf.c
pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
source3/Makefile.in
source3/client/mount.cifs.c
source3/client/umount.cifs.c
source3/configure.in
source3/groupdb/mapping_ldb.c
source3/include/ads.h
source3/include/ntdomain.h
source3/include/proto.h
source3/include/rpc_client.h
source3/include/rpc_spoolss.h
source3/include/smb.h
source3/include/wbc_async.h [new file with mode: 0644]
source3/lib/netapi/examples/server/server_getinfo.c
source3/lib/netapi/netapi.h
source3/lib/netapi/serverinfo.c
source3/lib/netapi/tests/Makefile.in
source3/lib/netapi/tests/common.h
source3/lib/netapi/tests/netapitest.c
source3/lib/netapi/tests/netserver.c [new file with mode: 0644]
source3/lib/util_sock.c
source3/lib/wb_reqtrans.c
source3/lib/wbclient.c
source3/libads/kerberos.c
source3/libads/ldap_printer.c
source3/librpc/gen_ndr/libnetapi.h
source3/librpc/gen_ndr/ndr_libnetapi.c
source3/librpc/gen_ndr/ndr_libnetapi.h
source3/librpc/idl/libnetapi.idl
source3/libsmb/libsmb_xattr.c
source3/modules/onefs.h
source3/modules/onefs_streams.c
source3/modules/vfs_onefs.c
source3/passdb/pdb_get_set.c
source3/printing/nt_printing.c
source3/rpc_client/cli_spoolss.c
source3/rpc_parse/parse_prs.c
source3/rpc_parse/parse_spoolss.c
source3/rpc_server/srv_eventlog_lib.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_pipe_hnd.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_spoolss.c
source3/rpc_server/srv_spoolss_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpcclient/cmd_spoolss.c
source3/smbd/lanman.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/torture/torture.c
source3/utils/net_conf.c
source3/utils/net_rpc_printer.c
source3/winbindd/idmap_tdb.c
source3/winbindd/idmap_tdb2.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_user.c
source4/Makefile
source4/auth/credentials/pycredentials.c
source4/auth/credentials/pycredentials.h
source4/auth/ntlm/auth.c
source4/auth/pyauth.h
source4/lib/ldb/pyldb.c
source4/lib/registry/patchfile_preg.c
source4/lib/registry/pyregistry.c
source4/lib/registry/regf.c
source4/libcli/smb2/request.c
source4/librpc/config.mk
source4/librpc/rpc/pyrpc.c
source4/ntptr/simple_ldb/ntptr_simple_ldb.c
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_aio.c
source4/ntvfs/posix/pvfs_flush.c
source4/ntvfs/posix/pvfs_fsinfo.c
source4/ntvfs/posix/pvfs_ioctl.c
source4/ntvfs/posix/pvfs_lock.c
source4/ntvfs/posix/pvfs_mkdir.c
source4/ntvfs/posix/pvfs_open.c
source4/ntvfs/posix/pvfs_oplock.c
source4/ntvfs/posix/pvfs_qfileinfo.c
source4/ntvfs/posix/pvfs_read.c
source4/ntvfs/posix/pvfs_rename.c
source4/ntvfs/posix/pvfs_resolve.c
source4/ntvfs/posix/pvfs_search.c
source4/ntvfs/posix/pvfs_seek.c
source4/ntvfs/posix/pvfs_setfileinfo.c
source4/ntvfs/posix/pvfs_unlink.c
source4/ntvfs/posix/pvfs_util.c
source4/ntvfs/posix/pvfs_wait.c
source4/ntvfs/posix/pvfs_write.c
source4/ntvfs/posix/vfs_posix.c
source4/param/pyparam.c
source4/rpc_server/spoolss/dcesrv_spoolss.c
source4/selftest/skip
source4/torture/ldap/uptodatevector.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/spoolss.c
source4/torture/rpc/spoolss_win.c
testprogs/win32/npecho/GNUmakefile
testprogs/win32/npecho/NMakefile
testprogs/win32/npecho/npecho_client2.c [new file with mode: 0755]
testprogs/win32/npecho/npecho_server2.c [new file with mode: 0755]

index 00711e0de041231a111f90e3a7f3b3d3bd39d1e3..c386592f1df4622b844e0ff63888ad064cc9bcfa 100644 (file)
@@ -372,9 +372,9 @@ port 445 is tried and if no response then port 139 is tried.
                 <term>noacl</term>
                 <listitem><para>Do not allow POSIX ACL operations even if server would support them.</para><para>
                The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
-               version 3.10 and later.  Setting POSIX ACLs requires enabling both XATTR and
+               version 3.0.10 and later.  Setting POSIX ACLs requires enabling both XATTR and
                then POSIX support in the CIFS configuration options when building the cifs
-               module.  POSIX ACL support can be disabled on a per mount basic by specifying
+               module.  POSIX ACL support can be disabled on a per mount basis by specifying
                "noacl" on mount.</para>
                </listitem>
        </varlistentry>
index b2e953736b21bbf6006378837fb0937a5ab361d7..fa7fea94d0663637715d3095a9bfd29aaed3e693 100644 (file)
@@ -13,9 +13,9 @@
        script.</para>
 
        <para>LDAP connections should be secured where possible. This may be
-       done setting either this parameter to
+       done setting <emphasis>either</emphasis> this parameter to
        <parameter moreinfo="none">Start_tls</parameter>
-       or by specifying <parameter moreinfo="none">ldaps://</parameter> in
+       <emphasis>or</emphasis> by specifying <parameter moreinfo="none">ldaps://</parameter> in
         the URL argument of <smbconfoption name="passdb backend"/>.</para>
 
        <para>The <smbconfoption name="ldap ssl"/> can be set to one of
                        communicating with the directory server.</para>
                </listitem>
        </itemizedlist>
+       <para>
+       Please note that this parameter does only affect <emphasis>rpc</emphasis>
+       methods. To enable the LDAPv3 StartTLS extended operation (RFC2830) for
+       <emphasis>ads</emphasis>, set
+       <smbconfoption name="ldap ssl">yes</smbconfoption>
+       <emphasis>and</emphasis>
+       <smbconfoption name="ldap ssl ads">yes</smbconfoption>.
+       See <refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum>
+       for more information on <smbconfoption name="ldap ssl ads"/>.
+        </para>
+
 </description>
 <value type="default">start tls</value>
 </samba:parameter>
diff --git a/docs-xml/smbdotconf/ldap/ldapsslads.xml b/docs-xml/smbdotconf/ldap/ldapsslads.xml
new file mode 100644 (file)
index 0000000..e6998cb
--- /dev/null
@@ -0,0 +1,21 @@
+<samba:parameter name="ldap ssl ads"
+                context="G"
+                type="boolean"
+                 advanced="1" developer="1"
+                xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+       <para>This option is used to define whether or not Samba should
+       use SSL when connecting to the ldap server using
+       <emphasis>ads</emphasis> methods.
+       Rpc methods are not affected by this parameter. Please note, that
+       this parameter won't have any effect if <smbconfoption name="ldap ssl"/>
+       is set to <parameter>no</parameter>.
+       </para>
+
+       <para>See <refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum>
+       for more information on <smbconfoption name="ldap ssl"/>.
+       </para>
+
+</description>
+<value type="default">no</value>
+</samba:parameter>
index 4de0efd29e856ba5489ba6450033ce3ec793cb24..8fe414a9e8c6e00bfb19ad67ec90d2e527160300 100644 (file)
@@ -9,12 +9,14 @@ SHLIBEXT      = @SHLIBEXT@
 OBJEXT         = @OBJEXT@ 
 FLAGS          =  $(CFLAGS) $(CPPFLAGS) -fPIC \
                -Iinclude -I$(SAMBA_SOURCE)/include \
-               -I$(SAMBA_SOURCE)/popt  \
-               -I$(SAMBA_SOURCE)/lib/replace  \
-               -I$(SAMBA_SOURCE)/lib/talloc  \
-               -I$(SAMBA_SOURCE)/lib/tdb/include  \
-               -I$(SAMBA_SOURCE)/smbwrapper \
+               -I$(SAMBA_SOURCE)/../popt  \
+               -I$(SAMBA_SOURCE)/../lib/replace  \
+               -I$(SAMBA_SOURCE)/../lib/talloc  \
+               -I$(SAMBA_SOURCE)/../lib/tevent  \
+               -I$(SAMBA_SOURCE)/../lib/tdb/include  \
                -I$(SAMBA_SOURCE)/librpc \
+               -I$(SAMBA_SOURCE)/../librpc \
+               -I$(SAMBA_SOURCE)/../ \
                -I$(SAMBA_SOURCE) -I.
 
 
index b8e10d482b820773c6f1e277cf173f632997d9b0..4e9d46544dbc6be7036cb8be87be65867a2b95ac 100644 (file)
@@ -27,11 +27,11 @@ AC_ARG_WITH(fhs,
 
 AC_SUBST(libdir)
 
-SAMBA_SOURCE="../../source"
+SAMBA_SOURCE="../../source3"
 ####################################################
 # set the location location of the samba source tree
 AC_ARG_WITH(samba-source,
-[  --with-samba-source=DIR Where is the samba source tree (../../source)],
+[  --with-samba-source=DIR Where is the samba source tree (../../source3)],
 [ case "$withval" in
   yes|no)
   #
@@ -337,11 +337,11 @@ AC_CACHE_CHECK([whether building shared libraries actually works],
    ac_cv_shlib_works=no
    # try building a trivial shared library
    if test "$PICSUFFIX" = "po"; then
-     $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/../../source/tests/shlib.c &&
+     $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/../../tests/shlib.c &&
        $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
        ac_cv_shlib_works=yes
    else
-     $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c &&
+     $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.$PICSUFFIX ${srcdir-.}/../../tests/shlib.c &&
        mv shlib.$PICSUFFIX shlib.po &&
        $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
        ac_cv_shlib_works=yes
index 48b497922a594fa6e41d96c7d96e2c070adb59a4..2eb7a9477634729ad266037ffd77496d43928e24 100644 (file)
@@ -52,9 +52,9 @@ static void skel_disconnect(vfs_handle_struct *handle, connection_struct *conn)
        return;
 }
 
-static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle,  const char *path,
-       bool small_query, SMB_BIG_UINT *bsize,
-       SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static uint64_t skel_disk_free(vfs_handle_struct *handle,  const char *path,
+       bool small_query, uint64_t *bsize,
+       uint64_t *dfree, uint64_t *dsize)
 {
        return vfswrap_disk_free(NULL,  path, small_query, bsize, 
                                         dfree, dsize);
index f5562a5f444d9dabb01a9b8f0a615c8ff45f4c44..5670965417277617b7c4cf0a8ee416750365b2e5 100644 (file)
@@ -46,9 +46,9 @@ static void skel_disconnect(vfs_handle_struct *handle)
        SMB_VFS_NEXT_DISCONNECT(handle);
 }
 
-static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle,  const char *path,
-       bool small_query, SMB_BIG_UINT *bsize,
-       SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static uint64_t skel_disk_free(vfs_handle_struct *handle,  const char *path,
+       bool small_query, uint64_t *bsize,
+       uint64_t *dfree, uint64_t *dsize)
 {
        return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, 
                                         dfree, dsize);
index b99232066905073e47e3dc8b46c80f4ec706da84..46ad29d053473ce952b19dd7800b4f6ac1e17bef 100644 (file)
@@ -94,6 +94,55 @@ struct async_syscall_state {
        int sys_errno;
 };
 
+/**
+ * @brief Map async_req states to unix-style errnos
+ * @param[in]  req     The async req to get the state from
+ * @param[out] err     Pointer to take the unix-style errno
+ *
+ * @return true if the async_req is in an error state, false otherwise
+ */
+
+bool async_req_is_errno(struct async_req *req, int *err)
+{
+       enum async_req_state state;
+       uint64_t error;
+
+       if (!async_req_is_error(req, &state, &error)) {
+               return false;
+       }
+
+       switch (state) {
+       case ASYNC_REQ_USER_ERROR:
+               *err = (int)error;
+               break;
+       case ASYNC_REQ_TIMED_OUT:
+#ifdef HAVE_ETIMEDOUT
+               *err = ETIMEDOUT;
+#else
+               *err = EIO;
+#endif
+               break;
+       case ASYNC_REQ_NO_MEMORY:
+               *err = ENOMEM;
+               break;
+       default:
+               *err = EIO;
+               break;
+       }
+       return true;
+}
+
+int async_req_simple_recv_errno(struct async_req *req)
+{
+       int err;
+
+       if (async_req_is_errno(req, &err)) {
+               return err;
+       }
+
+       return 0;
+}
+
 /**
  * @brief Create a new async syscall req
  * @param[in] mem_ctx  The memory context to hang the result off
@@ -239,7 +288,7 @@ static void async_send_callback(struct tevent_context *ev,
        struct param_send *p = &state->param.param_send;
 
        if (state->syscall_type != ASYNC_SYSCALL_SEND) {
-               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_error(req, EIO);
                return;
        }
 
@@ -306,7 +355,7 @@ static void async_sendall_callback(struct tevent_context *ev,
        struct param_sendall *p = &state->param.param_sendall;
 
        if (state->syscall_type != ASYNC_SYSCALL_SENDALL) {
-               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_error(req, EIO);
                return;
        }
 
@@ -316,18 +365,18 @@ static void async_sendall_callback(struct tevent_context *ev,
        state->sys_errno = errno;
 
        if (state->result.result_ssize_t == -1) {
-               async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
+               async_req_error(req, state->sys_errno);
                return;
        }
 
        if (state->result.result_ssize_t == 0) {
-               async_req_nterror(req, NT_STATUS_END_OF_FILE);
+               async_req_error(req, EOF);
                return;
        }
 
        p->sent += state->result.result_ssize_t;
        if (p->sent > p->length) {
-               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_error(req, EIO);
                return;
        }
 
@@ -374,9 +423,20 @@ struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        return result;
 }
 
-NTSTATUS sendall_recv(struct async_req *req)
+ssize_t sendall_recv(struct async_req *req, int *perr)
 {
-       return async_req_simple_recv_ntstatus(req);
+       struct async_syscall_state *state = talloc_get_type_abort(
+               req->private_data, struct async_syscall_state);
+       int err;
+
+       err = async_req_simple_recv_errno(req);
+
+       if (err != 0) {
+               *perr = err;
+               return -1;
+       }
+
+       return state->result.result_ssize_t;
 }
 
 /**
@@ -398,7 +458,7 @@ static void async_recv_callback(struct tevent_context *ev,
        struct param_recv *p = &state->param.param_recv;
 
        if (state->syscall_type != ASYNC_SYSCALL_RECV) {
-               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_error(req, EIO);
                return;
        }
 
@@ -466,7 +526,7 @@ static void async_recvall_callback(struct tevent_context *ev,
        struct param_recvall *p = &state->param.param_recvall;
 
        if (state->syscall_type != ASYNC_SYSCALL_RECVALL) {
-               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_error(req, EIO);
                return;
        }
 
@@ -476,18 +536,18 @@ static void async_recvall_callback(struct tevent_context *ev,
        state->sys_errno = errno;
 
        if (state->result.result_ssize_t == -1) {
-               async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
+               async_req_error(req, state->sys_errno);
                return;
        }
 
        if (state->result.result_ssize_t == 0) {
-               async_req_nterror(req, NT_STATUS_END_OF_FILE);
+               async_req_error(req, EIO);
                return;
        }
 
        p->received += state->result.result_ssize_t;
        if (p->received > p->length) {
-               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_error(req, EIO);
                return;
        }
 
@@ -533,9 +593,20 @@ struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        return result;
 }
 
-NTSTATUS recvall_recv(struct async_req *req)
+ssize_t recvall_recv(struct async_req *req, int *perr)
 {
-       return async_req_simple_recv_ntstatus(req);
+       struct async_syscall_state *state = talloc_get_type_abort(
+               req->private_data, struct async_syscall_state);
+       int err;
+
+       err = async_req_simple_recv_errno(req);
+
+       if (err != 0) {
+               *perr = err;
+               return -1;
+       }
+
+       return state->result.result_ssize_t;
 }
 
 struct async_connect_state {
@@ -570,7 +641,6 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
        struct async_req *result;
        struct async_connect_state *state;
        struct tevent_fd *fde;
-       NTSTATUS status;
 
        if (!async_req_setup(mem_ctx, &result, &state,
                             struct async_connect_state)) {
@@ -595,7 +665,6 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
        state->result = connect(fd, address, address_len);
        if (state->result == 0) {
                state->sys_errno = 0;
-               status = NT_STATUS_OK;
                goto post_status;
        }
 
@@ -617,17 +686,16 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
        fde = tevent_add_fd(ev, state, fd, TEVENT_FD_READ | TEVENT_FD_WRITE,
                           async_connect_connected, result);
        if (fde == NULL) {
-               status = NT_STATUS_NO_MEMORY;
+               state->sys_errno = ENOMEM;
                goto post_status;
        }
        return result;
 
  post_errno:
        state->sys_errno = errno;
-       status = map_nt_error_from_unix(state->sys_errno);
  post_status:
        fcntl(fd, F_SETFL, state->old_sockflags);
-       if (!async_post_ntstatus(result, ev, status)) {
+       if (!async_post_error(result, ev, state->sys_errno)) {
                goto fail;
        }
        return result;
@@ -675,7 +743,7 @@ static void async_connect_connected(struct tevent_context *ev,
                DEBUG(10, ("connect returned %s\n", strerror(errno)));
 
                fcntl(state->fd, F_SETFL, state->old_sockflags);
-               async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
+               async_req_error(req, state->sys_errno);
                return;
        }
 
@@ -683,21 +751,23 @@ static void async_connect_connected(struct tevent_context *ev,
        async_req_done(req);
 }
 
-NTSTATUS async_connect_recv(struct async_req *req, int *perrno)
+int async_connect_recv(struct async_req *req, int *perrno)
 {
        struct async_connect_state *state = talloc_get_type_abort(
                req->private_data, struct async_connect_state);
-       NTSTATUS status;
+       int err;
 
        fcntl(state->fd, F_SETFL, state->old_sockflags);
 
-       *perrno = state->sys_errno;
 
-       if (async_req_is_nterror(req, &status)) {
-               return status;
+       if (async_req_is_errno(req, &err)) {
+               *perrno = err;
+               return -1;
        }
        if (state->sys_errno == 0) {
-               return NT_STATUS_OK;
+               return 0;
        }
-       return map_nt_error_from_unix(state->sys_errno);
+
+       *perrno = state->sys_errno;
+       return -1;
 }
index fd41acacbbc7ef942418d1b365ddd5de191adb28..c8739e9ed6b3c383388065b674aa6caae7e13df7 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "includes.h"
 
+bool async_req_is_errno(struct async_req *req, int *err);
+int async_req_simple_recv_errno(struct async_req *req);
+
 ssize_t async_syscall_result_ssize_t(struct async_req *req, int *perrno);
 size_t async_syscall_result_size_t(struct async_req *req, int *perrno);
 int async_syscall_result_int(struct async_req *req, int *perrno);
@@ -36,16 +39,16 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
                                     struct tevent_context *ev,
                                     int fd, const struct sockaddr *address,
                                     socklen_t address_len);
-NTSTATUS async_connect_recv(struct async_req *req, int *perrno);
+int async_connect_recv(struct async_req *req, int *perrno);
 
 struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                               int fd, const void *buffer, size_t length,
                               int flags);
-NTSTATUS sendall_recv(struct async_req *req);
+ssize_t sendall_recv(struct async_req *req, int *perr);
 
 struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                               int fd, void *buffer, size_t length,
                               int flags);
-NTSTATUS recvall_recv(struct async_req *req);
+ssize_t recvall_recv(struct async_req *req, int *perr);
 
 #endif
index 1071f2a3a86d402d657edd5fa1bf081d414396a8..18086843cab1d0465aa1c34e71a2f12be8968a6b 100644 (file)
@@ -14,7 +14,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
                                     DATA_BLOB *buffer /* [in] [unique] */,
                                     uint32_t offered /* [in]  */,
                                     union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                    uint32_t needed /* [out]  */,
+                                    uint32_t *needed /* [out] [ref] */,
                                     uint32_t count /* [out]  */,
                                     WERROR *werror)
 {
@@ -54,7 +54,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                memcpy(info, r.out.info, count * sizeof(*info));
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
        return NT_STATUS_NOT_SUPPORTED;
 
        /* Return result */
@@ -173,7 +173,7 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
                               DATA_BLOB *buffer /* [in] [unique] */,
                               uint32_t offered /* [in]  */,
                               union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                              uint32_t needed /* [out]  */,
+                              uint32_t *needed /* [out] [ref] */,
                               WERROR *werror)
 {
        struct spoolss_GetJob r;
@@ -212,7 +212,7 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                *info = *r.out.info;
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -231,7 +231,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
                                 DATA_BLOB *buffer /* [in] [unique] */,
                                 uint32_t offered /* [in]  */,
                                 union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                uint32_t needed /* [out]  */,
+                                uint32_t *needed /* [out] [ref] */,
                                 uint32_t count /* [out]  */,
                                 WERROR *werror)
 {
@@ -272,7 +272,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                memcpy(info, r.out.info, count * sizeof(*info));
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
        return NT_STATUS_NOT_SUPPORTED;
 
        /* Return result */
@@ -427,7 +427,7 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
                                   DATA_BLOB *buffer /* [in] [unique] */,
                                   uint32_t offered /* [in]  */,
                                   union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                                  uint32_t needed /* [out]  */,
+                                  uint32_t *needed /* [out] [ref] */,
                                   WERROR *werror)
 {
        struct spoolss_GetPrinter r;
@@ -465,7 +465,7 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                *info = *r.out.info;
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -524,7 +524,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
                                           DATA_BLOB *buffer /* [in] [unique] */,
                                           uint32_t offered /* [in]  */,
                                           union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                          uint32_t needed /* [out]  */,
+                                          uint32_t *needed /* [out] [ref] */,
                                           uint32_t count /* [out]  */,
                                           WERROR *werror)
 {
@@ -564,7 +564,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                memcpy(info, r.out.info, count * sizeof(*info));
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
        return NT_STATUS_NOT_SUPPORTED;
 
        /* Return result */
@@ -624,7 +624,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
                                                  DATA_BLOB *buffer /* [in] [unique] */,
                                                  uint32_t offered /* [in]  */,
                                                  union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                                                 uint32_t needed /* [out]  */,
+                                                 uint32_t *needed /* [out] [ref] */,
                                                  WERROR *werror)
 {
        struct spoolss_GetPrinterDriverDirectory r;
@@ -663,7 +663,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                *info = *r.out.info;
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -675,7 +675,6 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
-                                           struct policy_handle *handle /* [in] [ref] */,
                                            const char *server /* [in] [unique,charset(UTF16)] */,
                                            const char *architecture /* [in] [charset(UTF16)] */,
                                            const char *driver /* [in] [charset(UTF16)] */,
@@ -685,7 +684,6 @@ NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
        r.in.server = server;
        r.in.architecture = architecture;
        r.in.driver = driver;
@@ -724,12 +722,20 @@ NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
+                                         const char *server /* [in] [unique,charset(UTF16)] */,
+                                         const char *architecture /* [in] [charset(UTF16)] */,
+                                         const char *path_name /* [in] [charset(UTF16)] */,
+                                         const char *print_processor_name /* [in] [charset(UTF16)] */,
                                          WERROR *werror)
 {
        struct spoolss_AddPrintProcessor r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.server = server;
+       r.in.architecture = architecture;
+       r.in.path_name = path_name;
+       r.in.print_processor_name = print_processor_name;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &r);
@@ -771,7 +777,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
                                            DATA_BLOB *buffer /* [in] [unique] */,
                                            uint32_t offered /* [in]  */,
                                            union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                           uint32_t needed /* [out]  */,
+                                           uint32_t *needed /* [out] [ref] */,
                                            uint32_t count /* [out]  */,
                                            WERROR *werror)
 {
@@ -811,7 +817,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                memcpy(info, r.out.info, count * sizeof(*info));
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
        return NT_STATUS_NOT_SUPPORTED;
 
        /* Return result */
@@ -868,7 +874,7 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        uint32_t level /* [in]  */,
                                        union spoolss_DocumentInfo info /* [in] [switch_is(level)] */,
-                                       uint32_t job_id /* [out]  */,
+                                       uint32_t *job_id /* [out] [ref] */,
                                        WERROR *werror)
 {
        struct spoolss_StartDocPrinter r;
@@ -902,7 +908,7 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       return NT_STATUS_NOT_SUPPORTED;
+       *job_id = *r.out.job_id;
 
        /* Return result */
        if (werror) {
@@ -960,7 +966,7 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     DATA_BLOB data /* [in]  */,
                                     uint32_t _data_size /* [in] [value(r->in.data.length)] */,
-                                    uint32_t num_written /* [out]  */,
+                                    uint32_t *num_written /* [out] [ref] */,
                                     WERROR *werror)
 {
        struct spoolss_WritePrinter r;
@@ -994,7 +1000,7 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       return NT_STATUS_NOT_SUPPORTED;
+       *num_written = *r.out.num_written;
 
        /* Return result */
        if (werror) {
@@ -1093,9 +1099,9 @@ NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
 NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
+                                   uint8_t *data /* [out] [ref,size_is(data_size)] */,
                                    uint32_t data_size /* [in]  */,
-                                   DATA_BLOB data /* [out]  */,
-                                   uint32_t _data_size /* [out] [value(r->out.data.length)] */,
+                                   uint32_t *_data_size /* [out] [ref] */,
                                    WERROR *werror)
 {
        struct spoolss_ReadPrinter r;
@@ -1128,8 +1134,8 @@ NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
+       memcpy(data, r.out.data, r.in.data_size * sizeof(*data));
+       *_data_size = *r.out._data_size;
 
        /* Return result */
        if (werror) {
@@ -1269,9 +1275,9 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
                                       struct policy_handle *handle /* [in] [ref] */,
                                       const char *value_name /* [in] [charset(UTF16)] */,
                                       uint32_t offered /* [in]  */,
-                                      enum spoolss_PrinterDataType type /* [out]  */,
-                                      union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */,
-                                      uint32_t needed /* [out]  */,
+                                      enum spoolss_PrinterDataType *type /* [out] [ref] */,
+                                      union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */,
+                                      uint32_t *needed /* [out] [ref] */,
                                       WERROR *werror)
 {
        struct spoolss_GetPrinterData r;
@@ -1305,9 +1311,9 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *type = *r.out.type;
        return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -1553,7 +1559,7 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
                                DATA_BLOB *buffer /* [in] [unique] */,
                                uint32_t offered /* [in]  */,
                                union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                               uint32_t needed /* [out]  */,
+                               uint32_t *needed /* [out] [ref] */,
                                WERROR *werror)
 {
        struct spoolss_GetForm r;
@@ -1592,7 +1598,7 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                *info = *r.out.info;
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -1658,7 +1664,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
                                  DATA_BLOB *buffer /* [in] [unique] */,
                                  uint32_t offered /* [in]  */,
                                  union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                 uint32_t needed /* [out]  */,
+                                 uint32_t *needed /* [out] [ref] */,
                                  uint32_t count /* [out]  */,
                                  WERROR *werror)
 {
@@ -1697,7 +1703,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                memcpy(info, r.out.info, count * sizeof(*info));
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
        return NT_STATUS_NOT_SUPPORTED;
 
        /* Return result */
@@ -1715,7 +1721,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
                                  DATA_BLOB *buffer /* [in] [unique] */,
                                  uint32_t offered /* [in]  */,
                                  union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                 uint32_t needed /* [out]  */,
+                                 uint32_t *needed /* [out] [ref] */,
                                  uint32_t count /* [out]  */,
                                  WERROR *werror)
 {
@@ -1754,7 +1760,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                memcpy(info, r.out.info, count * sizeof(*info));
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
        return NT_STATUS_NOT_SUPPORTED;
 
        /* Return result */
@@ -1772,7 +1778,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
                                     DATA_BLOB *buffer /* [in] [unique] */,
                                     uint32_t offered /* [in]  */,
                                     union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                    uint32_t needed /* [out]  */,
+                                    uint32_t *needed /* [out] [ref] */,
                                     uint32_t count /* [out]  */,
                                     WERROR *werror)
 {
@@ -1811,7 +1817,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                memcpy(info, r.out.info, count * sizeof(*info));
        }
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
        return NT_STATUS_NOT_SUPPORTED;
 
        /* Return result */
@@ -2494,9 +2500,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
                                          uint32_t client_major_version /* [in]  */,
                                          uint32_t client_minor_version /* [in]  */,
                                          DATA_BLOB *info /* [out] [unique] */,
-                                         uint32_t needed /* [out]  */,
-                                         uint32_t server_major_version /* [out]  */,
-                                         uint32_t server_minor_version /* [out]  */,
+                                         uint32_t *needed /* [out] [ref] */,
+                                         uint32_t *server_major_version /* [out] [ref] */,
+                                         uint32_t *server_minor_version /* [out] [ref] */,
                                          WERROR *werror)
 {
        struct spoolss_GetPrinterDriver2 r;
@@ -2537,9 +2543,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
        if (info && r.out.info) {
                *info = *r.out.info;
        }
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
+       *needed = *r.out.needed;
+       *server_major_version = *r.out.server_major_version;
+       *server_minor_version = *r.out.server_minor_version;
 
        /* Return result */
        if (werror) {
@@ -2770,12 +2776,20 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *handle /* [in] [ref] */,
+                                          uint32_t flags /* [in]  */,
+                                          uint32_t bufsize /* [in] [range(0,512)] */,
+                                          uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
                                           WERROR *werror)
 {
        struct spoolss_RouterReplyPrinter r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
+       r.in.flags = flags;
+       r.in.bufsize = bufsize;
+       r.in.buffer = buffer;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
@@ -3397,7 +3411,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       memcpy(value_name, r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
+       memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
        *value_needed = *r.out.value_needed;
        *printerdata_type = *r.out.printerdata_type;
        *buffer = *r.out.buffer;
@@ -3637,10 +3651,10 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         const char *key_name /* [in] [charset(UTF16)] */,
                                         const char *value_name /* [in] [charset(UTF16)] */,
+                                        uint32_t *type /* [out] [ref] */,
+                                        uint8_t *buffer /* [out] [ref,size_is(offered)] */,
                                         uint32_t offered /* [in]  */,
-                                        uint32_t type /* [out]  */,
-                                        DATA_BLOB buffer /* [out]  */,
-                                        uint32_t needed /* [out]  */,
+                                        uint32_t *needed /* [out] [ref] */,
                                         WERROR *werror)
 {
        struct spoolss_GetPrinterDataEx r;
@@ -3675,9 +3689,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
+       *type = *r.out.type;
+       memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -3691,10 +3705,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
                                          const char *key_name /* [in] [charset(UTF16)] */,
+                                         uint8_t *buffer /* [out] [ref,size_is(offered)] */,
                                          uint32_t offered /* [in]  */,
-                                         DATA_BLOB buffer /* [out]  */,
-                                         uint32_t needed /* [out]  */,
-                                         uint32_t count /* [out]  */,
+                                         uint32_t *needed /* [out] [ref] */,
+                                         uint32_t *count /* [out] [ref] */,
                                          WERROR *werror)
 {
        struct spoolss_EnumPrinterDataEx r;
@@ -3728,9 +3742,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
+       memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+       *needed = *r.out.needed;
+       *count = *r.out.count;
 
        /* Return result */
        if (werror) {
@@ -3744,9 +3758,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
                                       const char *key_name /* [in] [charset(UTF16)] */,
-                                      uint32_t key_buffer_size /* [out]  */,
-                                      uint16_t *key_buffer /* [out]  */,
-                                      uint32_t needed /* [in,out]  */,
+                                      uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */,
+                                      uint32_t key_buffer_size /* [in]  */,
+                                      uint32_t *needed /* [out] [ref] */,
                                       WERROR *werror)
 {
        struct spoolss_EnumPrinterKey r;
@@ -3755,7 +3769,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
        /* In parameters */
        r.in.handle = handle;
        r.in.key_name = key_name;
-       r.in.needed = needed;
+       r.in.key_buffer_size = key_buffer_size;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r);
@@ -3780,9 +3794,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       return NT_STATUS_NOT_SUPPORTED;
-       memcpy(key_buffer, r.out.key_buffer, key_buffer_size * sizeof(*key_buffer));
-       return NT_STATUS_NOT_SUPPORTED;
+       memcpy(key_buffer, r.out.key_buffer, r.in.key_buffer_size / 2 * sizeof(*key_buffer));
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -3841,12 +3854,16 @@ NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        const char *key_name /* [in] [charset(UTF16)] */,
                                         WERROR *werror)
 {
        struct spoolss_DeletePrinterKey r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
+       r.in.key_name = key_name;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &r);
@@ -3923,12 +3940,22 @@ NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
+                                             const char *server /* [in] [unique,charset(UTF16)] */,
+                                             const char *architecture /* [in] [charset(UTF16)] */,
+                                             const char *driver /* [in] [charset(UTF16)] */,
+                                             uint32_t delete_flags /* [in]  */,
+                                             uint32_t version /* [in]  */,
                                              WERROR *werror)
 {
        struct spoolss_DeletePrinterDriverEx r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.server = server;
+       r.in.architecture = architecture;
+       r.in.driver = driver;
+       r.in.delete_flags = delete_flags;
+       r.in.version = version;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &r);
@@ -4091,11 +4118,10 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
                                const char *function_name /* [in] [charset(UTF16)] */,
                                DATA_BLOB in_data /* [in]  */,
                                uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */,
-                               uint32_t offered /* [in]  */,
-                               uint32_t unknown1 /* [in]  */,
-                               DATA_BLOB out_data /* [out]  */,
-                               uint32_t needed /* [out]  */,
-                               uint32_t unknown2 /* [out]  */,
+                               uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */,
+                               uint32_t out_data_size /* [in]  */,
+                               uint32_t *needed /* [out] [ref] */,
+                               uint32_t *status_code /* [in,out] [ref] */,
                                WERROR *werror)
 {
        struct spoolss_XcvData r;
@@ -4106,8 +4132,8 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
        r.in.function_name = function_name;
        r.in.in_data = in_data;
        r.in._in_data_length = _in_data_length;
-       r.in.offered = offered;
-       r.in.unknown1 = unknown1;
+       r.in.out_data_size = out_data_size;
+       r.in.status_code = status_code;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_XcvData, &r);
@@ -4132,9 +4158,9 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
-       return NT_STATUS_NOT_SUPPORTED;
+       memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data));
+       *needed = *r.out.needed;
+       *status_code = *r.out.status_code;
 
        /* Return result */
        if (werror) {
index ba7de894132a39c6eafe7503fc2874a822808006..516c2c069d0e08c164bff87c7fe0d23b2e62ed3d 100644 (file)
@@ -9,7 +9,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
                                     DATA_BLOB *buffer /* [in] [unique] */,
                                     uint32_t offered /* [in]  */,
                                     union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                    uint32_t needed /* [out]  */,
+                                    uint32_t *needed /* [out] [ref] */,
                                     uint32_t count /* [out]  */,
                                     WERROR *werror);
 NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
@@ -35,7 +35,7 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
                               DATA_BLOB *buffer /* [in] [unique] */,
                               uint32_t offered /* [in]  */,
                               union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                              uint32_t needed /* [out]  */,
+                              uint32_t *needed /* [out] [ref] */,
                               WERROR *werror);
 NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
@@ -46,7 +46,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
                                 DATA_BLOB *buffer /* [in] [unique] */,
                                 uint32_t offered /* [in]  */,
                                 union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                uint32_t needed /* [out]  */,
+                                uint32_t *needed /* [out] [ref] */,
                                 uint32_t count /* [out]  */,
                                 WERROR *werror);
 NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
@@ -72,7 +72,7 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
                                   DATA_BLOB *buffer /* [in] [unique] */,
                                   uint32_t offered /* [in]  */,
                                   union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                                  uint32_t needed /* [out]  */,
+                                  uint32_t *needed /* [out] [ref] */,
                                   WERROR *werror);
 NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
@@ -85,7 +85,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
                                           DATA_BLOB *buffer /* [in] [unique] */,
                                           uint32_t offered /* [in]  */,
                                           union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                          uint32_t needed /* [out]  */,
+                                          uint32_t *needed /* [out] [ref] */,
                                           uint32_t count /* [out]  */,
                                           WERROR *werror);
 NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
@@ -99,17 +99,20 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
                                                  DATA_BLOB *buffer /* [in] [unique] */,
                                                  uint32_t offered /* [in]  */,
                                                  union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                                                 uint32_t needed /* [out]  */,
+                                                 uint32_t *needed /* [out] [ref] */,
                                                  WERROR *werror);
 NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
-                                           struct policy_handle *handle /* [in] [ref] */,
                                            const char *server /* [in] [unique,charset(UTF16)] */,
                                            const char *architecture /* [in] [charset(UTF16)] */,
                                            const char *driver /* [in] [charset(UTF16)] */,
                                            WERROR *werror);
 NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
+                                         const char *server /* [in] [unique,charset(UTF16)] */,
+                                         const char *architecture /* [in] [charset(UTF16)] */,
+                                         const char *path_name /* [in] [charset(UTF16)] */,
+                                         const char *print_processor_name /* [in] [charset(UTF16)] */,
                                          WERROR *werror);
 NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
@@ -119,7 +122,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
                                            DATA_BLOB *buffer /* [in] [unique] */,
                                            uint32_t offered /* [in]  */,
                                            union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                           uint32_t needed /* [out]  */,
+                                           uint32_t *needed /* [out] [ref] */,
                                            uint32_t count /* [out]  */,
                                            WERROR *werror);
 NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
@@ -130,7 +133,7 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        uint32_t level /* [in]  */,
                                        union spoolss_DocumentInfo info /* [in] [switch_is(level)] */,
-                                       uint32_t job_id /* [out]  */,
+                                       uint32_t *job_id /* [out] [ref] */,
                                        WERROR *werror);
 NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
@@ -141,7 +144,7 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     DATA_BLOB data /* [in]  */,
                                     uint32_t _data_size /* [in] [value(r->in.data.length)] */,
-                                    uint32_t num_written /* [out]  */,
+                                    uint32_t *num_written /* [out] [ref] */,
                                     WERROR *werror);
 NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
@@ -154,9 +157,9 @@ NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
 NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
+                                   uint8_t *data /* [out] [ref,size_is(data_size)] */,
                                    uint32_t data_size /* [in]  */,
-                                   DATA_BLOB data /* [out]  */,
-                                   uint32_t _data_size /* [out] [value(r->out.data.length)] */,
+                                   uint32_t *_data_size /* [out] [ref] */,
                                    WERROR *werror);
 NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
@@ -173,9 +176,9 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
                                       struct policy_handle *handle /* [in] [ref] */,
                                       const char *value_name /* [in] [charset(UTF16)] */,
                                       uint32_t offered /* [in]  */,
-                                      enum spoolss_PrinterDataType type /* [out]  */,
-                                      union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */,
-                                      uint32_t needed /* [out]  */,
+                                      enum spoolss_PrinterDataType *type /* [out] [ref] */,
+                                      union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */,
+                                      uint32_t *needed /* [out] [ref] */,
                                       WERROR *werror);
 NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
@@ -211,7 +214,7 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
                                DATA_BLOB *buffer /* [in] [unique] */,
                                uint32_t offered /* [in]  */,
                                union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                               uint32_t needed /* [out]  */,
+                               uint32_t *needed /* [out] [ref] */,
                                WERROR *werror);
 NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
@@ -227,7 +230,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
                                  DATA_BLOB *buffer /* [in] [unique] */,
                                  uint32_t offered /* [in]  */,
                                  union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                 uint32_t needed /* [out]  */,
+                                 uint32_t *needed /* [out] [ref] */,
                                  uint32_t count /* [out]  */,
                                  WERROR *werror);
 NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
@@ -237,7 +240,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
                                  DATA_BLOB *buffer /* [in] [unique] */,
                                  uint32_t offered /* [in]  */,
                                  union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                 uint32_t needed /* [out]  */,
+                                 uint32_t *needed /* [out] [ref] */,
                                  uint32_t count /* [out]  */,
                                  WERROR *werror);
 NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
@@ -247,7 +250,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
                                     DATA_BLOB *buffer /* [in] [unique] */,
                                     uint32_t offered /* [in]  */,
                                     union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
-                                    uint32_t needed /* [out]  */,
+                                    uint32_t *needed /* [out] [ref] */,
                                     uint32_t count /* [out]  */,
                                     WERROR *werror);
 NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
@@ -311,9 +314,9 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
                                          uint32_t client_major_version /* [in]  */,
                                          uint32_t client_minor_version /* [in]  */,
                                          DATA_BLOB *info /* [out] [unique] */,
-                                         uint32_t needed /* [out]  */,
-                                         uint32_t server_major_version /* [out]  */,
-                                         uint32_t server_minor_version /* [out]  */,
+                                         uint32_t *needed /* [out] [ref] */,
+                                         uint32_t *server_major_version /* [out] [ref] */,
+                                         uint32_t *server_minor_version /* [out] [ref] */,
                                          WERROR *werror);
 NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
                                                           TALLOC_CTX *mem_ctx,
@@ -339,6 +342,10 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
                                         WERROR *werror);
 NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *handle /* [in] [ref] */,
+                                          uint32_t flags /* [in]  */,
+                                          uint32_t bufsize /* [in] [range(0,512)] */,
+                                          uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
                                           WERROR *werror);
 NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
@@ -441,27 +448,27 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         const char *key_name /* [in] [charset(UTF16)] */,
                                         const char *value_name /* [in] [charset(UTF16)] */,
+                                        uint32_t *type /* [out] [ref] */,
+                                        uint8_t *buffer /* [out] [ref,size_is(offered)] */,
                                         uint32_t offered /* [in]  */,
-                                        uint32_t type /* [out]  */,
-                                        DATA_BLOB buffer /* [out]  */,
-                                        uint32_t needed /* [out]  */,
+                                        uint32_t *needed /* [out] [ref] */,
                                         WERROR *werror);
 NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
                                          const char *key_name /* [in] [charset(UTF16)] */,
+                                         uint8_t *buffer /* [out] [ref,size_is(offered)] */,
                                          uint32_t offered /* [in]  */,
-                                         DATA_BLOB buffer /* [out]  */,
-                                         uint32_t needed /* [out]  */,
-                                         uint32_t count /* [out]  */,
+                                         uint32_t *needed /* [out] [ref] */,
+                                         uint32_t *count /* [out] [ref] */,
                                          WERROR *werror);
 NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
                                       const char *key_name /* [in] [charset(UTF16)] */,
-                                      uint32_t key_buffer_size /* [out]  */,
-                                      uint16_t *key_buffer /* [out]  */,
-                                      uint32_t needed /* [in,out]  */,
+                                      uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */,
+                                      uint32_t key_buffer_size /* [in]  */,
+                                      uint32_t *needed /* [out] [ref] */,
                                       WERROR *werror);
 NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
@@ -471,12 +478,19 @@ NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
                                            WERROR *werror);
 NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        const char *key_name /* [in] [charset(UTF16)] */,
                                         WERROR *werror);
 NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
 NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
+                                             const char *server /* [in] [unique,charset(UTF16)] */,
+                                             const char *architecture /* [in] [charset(UTF16)] */,
+                                             const char *driver /* [in] [charset(UTF16)] */,
+                                             uint32_t delete_flags /* [in]  */,
+                                             uint32_t version /* [in]  */,
                                              WERROR *werror);
 NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
@@ -493,11 +507,10 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
                                const char *function_name /* [in] [charset(UTF16)] */,
                                DATA_BLOB in_data /* [in]  */,
                                uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */,
-                               uint32_t offered /* [in]  */,
-                               uint32_t unknown1 /* [in]  */,
-                               DATA_BLOB out_data /* [out]  */,
-                               uint32_t needed /* [out]  */,
-                               uint32_t unknown2 /* [out]  */,
+                               uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */,
+                               uint32_t out_data_size /* [in]  */,
+                               uint32_t *needed /* [out] [ref] */,
+                               uint32_t *status_code /* [in,out] [ref] */,
                                WERROR *werror);
 NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
index de4abdcae5932fdf1db707bef0dbaedf17ad4cb9..e000cb0624e84e7f518e322802d2be2503406f5f 100644 (file)
@@ -42,4 +42,10 @@ enum netr_SchannelType
 #endif
 ;
 
+struct KRB5_EDATA_NTSTATUS {
+       NTSTATUS ntstatus;
+       uint32_t unknown1;
+       uint32_t unknown2;
+}/* [public] */;
+
 #endif /* _HEADER_misc */
index 83c977245af834cb1c3e6ee5574dd13bc31ad85d..28c856081927b64c4bc1d46975b3754f03d272a6 100644 (file)
@@ -132,3 +132,39 @@ _PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *nam
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
 
+_PUBLIC_ enum ndr_err_code ndr_push_KRB5_EDATA_NTSTATUS(struct ndr_push *ndr, int ndr_flags, const struct KRB5_EDATA_NTSTATUS *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->ntstatus));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_KRB5_EDATA_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, struct KRB5_EDATA_NTSTATUS *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->ntstatus));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_KRB5_EDATA_NTSTATUS(struct ndr_print *ndr, const char *name, const struct KRB5_EDATA_NTSTATUS *r)
+{
+       ndr_print_struct(ndr, name, "KRB5_EDATA_NTSTATUS");
+       ndr->depth++;
+       ndr_print_NTSTATUS(ndr, "ntstatus", r->ntstatus);
+       ndr_print_uint32(ndr, "unknown1", r->unknown1);
+       ndr_print_uint32(ndr, "unknown2", r->unknown2);
+       ndr->depth--;
+}
+
index a38b3c994806da4a95364e5dd462f6d27dffdfb3..938c946b73b16f3d4ea38c3a42ffaec1d7e9ad02 100644 (file)
@@ -20,4 +20,7 @@ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const stru
 enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r);
 enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r);
 void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r);
+enum ndr_err_code ndr_push_KRB5_EDATA_NTSTATUS(struct ndr_push *ndr, int ndr_flags, const struct KRB5_EDATA_NTSTATUS *r);
+enum ndr_err_code ndr_pull_KRB5_EDATA_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, struct KRB5_EDATA_NTSTATUS *r);
+void ndr_print_KRB5_EDATA_NTSTATUS(struct ndr_print *ndr, const char *name, const struct KRB5_EDATA_NTSTATUS *r);
 #endif /* _HEADER_NDR_misc */
index a677f532db9d506d694345e6061a52abb28e10b5..c7cf5164b8d94efa117a9b1fe3434abb83b961b2 100644 (file)
@@ -8054,6 +8054,47 @@ _PUBLIC_ void ndr_print_spoolss_MonitorInfo(struct ndr_print *ndr, const char *n
        }
 }
 
+static enum ndr_err_code ndr_push_spoolss_PrinterChangeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_spoolss_PrinterChangeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+       ndr_print_uint32(ndr, name, r);
+       ndr->depth++;
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINTER", PRINTER_CHANGE_ADD_PRINTER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_PRINTER", PRINTER_CHANGE_SET_PRINTER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINTER", PRINTER_CHANGE_DELETE_PRINTER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_FAILED_CONNECTION_PRINTER", PRINTER_CHANGE_FAILED_CONNECTION_PRINTER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_JOB", PRINTER_CHANGE_ADD_JOB, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_JOB", PRINTER_CHANGE_SET_JOB, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_JOB", PRINTER_CHANGE_DELETE_JOB, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_WRITE_JOB", PRINTER_CHANGE_WRITE_JOB, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_FORM", PRINTER_CHANGE_ADD_FORM, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_FORM", PRINTER_CHANGE_SET_FORM, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_FORM", PRINTER_CHANGE_DELETE_FORM, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PORT", PRINTER_CHANGE_ADD_PORT, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_CONFIGURE_PORT", PRINTER_CHANGE_CONFIGURE_PORT, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PORT", PRINTER_CHANGE_DELETE_PORT, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINT_PROCESSOR", PRINTER_CHANGE_ADD_PRINT_PROCESSOR, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINT_PROCESSOR", PRINTER_CHANGE_DELETE_PRINT_PROCESSOR, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINTER_DRIVER", PRINTER_CHANGE_ADD_PRINTER_DRIVER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_PRINTER_DRIVER", PRINTER_CHANGE_SET_PRINTER_DRIVER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINTER_DRIVER", PRINTER_CHANGE_DELETE_PRINTER_DRIVER, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_TIMEOUT", PRINTER_CHANGE_TIMEOUT, r);
+       ndr->depth--;
+}
+
 static enum ndr_err_code ndr_push_spoolss_Field(struct ndr_push *ndr, int ndr_flags, enum spoolss_Field r)
 {
        NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
@@ -9006,6 +9047,30 @@ _PUBLIC_ void ndr_print_spoolss_UserLevel(struct ndr_print *ndr, const char *nam
        }
 }
 
+_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DeleteDriverFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DeleteDriverFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_spoolss_DeleteDriverFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+       ndr_print_uint32(ndr, name, r);
+       ndr->depth++;
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DPD_DELETE_UNUSED_FILES", DPD_DELETE_UNUSED_FILES, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DPD_DELETE_SPECIFIC_VERSION", DPD_DELETE_SPECIFIC_VERSION, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DPD_DELETE_ALL_FILES", DPD_DELETE_ALL_FILES, r);
+       ndr->depth--;
+}
+
 _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinters *r)
 {
        if (flags & NDR_IN) {
@@ -9029,7 +9094,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinters(struct ndr_push *ndr,
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
@@ -9044,6 +9112,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr,
        TALLOC_CTX *_mem_save_server_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -9080,6 +9149,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr,
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -9094,7 +9165,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr,
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
@@ -9193,7 +9270,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinters(struct ndr_print *ndr, const char *
                        ndr->depth--;
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_uint32(ndr, "count", r->out.count);
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -9447,7 +9527,10 @@ static enum ndr_err_code ndr_push_spoolss_GetJob(struct ndr_push *ndr, int flags
                                NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered));
                        }
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -9460,6 +9543,7 @@ static enum ndr_err_code ndr_pull_spoolss_GetJob(struct ndr_pull *ndr, int flags
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -9485,6 +9569,8 @@ static enum ndr_err_code ndr_pull_spoolss_GetJob(struct ndr_pull *ndr, int flags
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -9505,7 +9591,13 @@ static enum ndr_err_code ndr_pull_spoolss_GetJob(struct ndr_pull *ndr, int flags
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -9546,7 +9638,10 @@ _PUBLIC_ void ndr_print_spoolss_GetJob(struct ndr_print *ndr, const char *name,
                        ndr_print_spoolss_JobInfo(ndr, "info", r->out.info);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -9574,7 +9669,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumJobs(struct ndr_push *ndr, int
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
@@ -9588,6 +9686,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -9614,6 +9713,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -9628,7 +9729,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumJobs(struct ndr_pull *ndr, int
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
@@ -9726,7 +9833,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumJobs(struct ndr_print *ndr, const char *name
                        ndr->depth--;
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_uint32(ndr, "count", r->out.count);
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -9932,7 +10042,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_GetPrinter(struct ndr_push *ndr, int
                                NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered));
                        }
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -9945,6 +10058,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinter(struct ndr_pull *ndr, int
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -9969,6 +10083,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinter(struct ndr_pull *ndr, int
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -9989,7 +10105,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinter(struct ndr_pull *ndr, int
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -10029,7 +10151,10 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinter(struct ndr_print *ndr, const char *na
                        ndr_print_spoolss_PrinterInfo(ndr, "info", r->out.info);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -10106,7 +10231,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinterDrivers(struct ndr_push
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
@@ -10123,6 +10251,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull
        TALLOC_CTX *_mem_save_environment_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -10176,6 +10305,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -10190,7 +10321,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDrivers(struct ndr_pull
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
@@ -10294,7 +10431,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDrivers(struct ndr_print *ndr, const
                        ndr->depth--;
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_uint32(ndr, "count", r->out.count);
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -10378,7 +10518,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_GetPrinterDriverDirectory(struct ndr
                                NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered));
                        }
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -10394,6 +10537,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinterDriverDirectory(struct ndr
        TALLOC_CTX *_mem_save_environment_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -10447,6 +10591,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinterDriverDirectory(struct ndr
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -10467,7 +10613,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_GetPrinterDriverDirectory(struct ndr
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -10515,7 +10667,10 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDriverDirectory(struct ndr_print *ndr,
                        ndr_print_spoolss_DriverDirectoryInfo(ndr, "info", r->out.info);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -10525,10 +10680,6 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDriverDirectory(struct ndr_print *ndr,
 static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriver(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterDriver *r)
 {
        if (flags & NDR_IN) {
-               if (r->in.handle == NULL) {
-                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
-               }
-               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server));
                if (r->in.server) {
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16)));
@@ -10554,16 +10705,8 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriver(struct ndr_push *n
 static enum ndr_err_code ndr_pull_spoolss_DeletePrinterDriver(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterDriver *r)
 {
        uint32_t _ptr_server;
-       TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_server_0;
        if (flags & NDR_IN) {
-               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-                       NDR_PULL_ALLOC(ndr, r->in.handle);
-               }
-               _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
-               NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server));
                if (_ptr_server) {
                        NDR_PULL_ALLOC(ndr, r->in.server);
@@ -10613,10 +10756,6 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDriver(struct ndr_print *ndr, const
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_DeletePrinterDriver");
                ndr->depth++;
-               ndr_print_ptr(ndr, "handle", r->in.handle);
-               ndr->depth++;
-               ndr_print_policy_handle(ndr, "handle", r->in.handle);
-               ndr->depth--;
                ndr_print_ptr(ndr, "server", r->in.server);
                ndr->depth++;
                if (r->in.server) {
@@ -10639,6 +10778,25 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDriver(struct ndr_print *ndr, const
 static enum ndr_err_code ndr_push_spoolss_AddPrintProcessor(struct ndr_push *ndr, int flags, const struct spoolss_AddPrintProcessor *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server));
+               if (r->in.server) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server, ndr_charset_length(r->in.server, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.architecture, ndr_charset_length(r->in.architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path_name, ndr_charset_length(r->in.path_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.print_processor_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.print_processor_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.print_processor_name, ndr_charset_length(r->in.print_processor_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
@@ -10648,7 +10806,48 @@ static enum ndr_err_code ndr_push_spoolss_AddPrintProcessor(struct ndr_push *ndr
 
 static enum ndr_err_code ndr_pull_spoolss_AddPrintProcessor(struct ndr_pull *ndr, int flags, struct spoolss_AddPrintProcessor *r)
 {
+       uint32_t _ptr_server;
+       TALLOC_CTX *_mem_save_server_0;
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server));
+               if (_ptr_server) {
+                       NDR_PULL_ALLOC(ndr, r->in.server);
+               } else {
+                       r->in.server = NULL;
+               }
+               if (r->in.server) {
+                       _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server));
+                       if (ndr_get_array_length(ndr, &r->in.server) > ndr_get_array_size(ndr, &r->in.server)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server), ndr_get_array_length(ndr, &r->in.server));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0);
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.architecture));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.architecture));
+               if (ndr_get_array_length(ndr, &r->in.architecture) > ndr_get_array_size(ndr, &r->in.architecture)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.architecture), ndr_get_array_length(ndr, &r->in.architecture));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.architecture, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path_name));
+               if (ndr_get_array_length(ndr, &r->in.path_name) > ndr_get_array_size(ndr, &r->in.path_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path_name), ndr_get_array_length(ndr, &r->in.path_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path_name, ndr_get_array_length(ndr, &r->in.path_name), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.print_processor_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.print_processor_name));
+               if (ndr_get_array_length(ndr, &r->in.print_processor_name) > ndr_get_array_size(ndr, &r->in.print_processor_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.print_processor_name), ndr_get_array_length(ndr, &r->in.print_processor_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.print_processor_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.print_processor_name, ndr_get_array_length(ndr, &r->in.print_processor_name), sizeof(uint16_t), CH_UTF16));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
@@ -10666,6 +10865,15 @@ _PUBLIC_ void ndr_print_spoolss_AddPrintProcessor(struct ndr_print *ndr, const c
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_AddPrintProcessor");
                ndr->depth++;
+               ndr_print_ptr(ndr, "server", r->in.server);
+               ndr->depth++;
+               if (r->in.server) {
+                       ndr_print_string(ndr, "server", r->in.server);
+               }
+               ndr->depth--;
+               ndr_print_string(ndr, "architecture", r->in.architecture);
+               ndr_print_string(ndr, "path_name", r->in.path_name);
+               ndr_print_string(ndr, "print_processor_name", r->in.print_processor_name);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -10706,7 +10914,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrintProcessors(struct ndr_push
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
@@ -10723,6 +10934,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(struct ndr_pull
        TALLOC_CTX *_mem_save_environment_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -10776,6 +10988,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(struct ndr_pull
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -10790,7 +11004,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcessors(struct ndr_pull
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
@@ -10894,7 +11114,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrintProcessors(struct ndr_print *ndr, const
                        ndr->depth--;
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_uint32(ndr, "count", r->out.count);
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -10955,7 +11178,10 @@ static enum ndr_err_code ndr_push_spoolss_StartDocPrinter(struct ndr_push *ndr,
                NDR_CHECK(ndr_push_spoolss_DocumentInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.job_id));
+               if (r->out.job_id == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.job_id));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -10964,6 +11190,7 @@ static enum ndr_err_code ndr_push_spoolss_StartDocPrinter(struct ndr_push *ndr,
 static enum ndr_err_code ndr_pull_spoolss_StartDocPrinter(struct ndr_pull *ndr, int flags, struct spoolss_StartDocPrinter *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_job_id_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -10977,9 +11204,17 @@ static enum ndr_err_code ndr_pull_spoolss_StartDocPrinter(struct ndr_pull *ndr,
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
                NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level));
                NDR_CHECK(ndr_pull_spoolss_DocumentInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info));
+               NDR_PULL_ALLOC(ndr, r->out.job_id);
+               ZERO_STRUCTP(r->out.job_id);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.job_id));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.job_id);
+               }
+               _mem_save_job_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.job_id, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.job_id));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_job_id_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -11007,7 +11242,10 @@ _PUBLIC_ void ndr_print_spoolss_StartDocPrinter(struct ndr_print *ndr, const cha
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_StartDocPrinter");
                ndr->depth++;
-               ndr_print_uint32(ndr, "job_id", r->out.job_id);
+               ndr_print_ptr(ndr, "job_id", r->out.job_id);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "job_id", *r->out.job_id);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -11082,7 +11320,10 @@ static enum ndr_err_code ndr_push_spoolss_WritePrinter(struct ndr_push *ndr, int
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.data.length));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.num_written));
+               if (r->out.num_written == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_written));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -11091,6 +11332,7 @@ static enum ndr_err_code ndr_push_spoolss_WritePrinter(struct ndr_push *ndr, int
 static enum ndr_err_code ndr_pull_spoolss_WritePrinter(struct ndr_pull *ndr, int flags, struct spoolss_WritePrinter *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_num_written_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -11103,9 +11345,17 @@ static enum ndr_err_code ndr_pull_spoolss_WritePrinter(struct ndr_pull *ndr, int
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->in.data));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in._data_size));
+               NDR_PULL_ALLOC(ndr, r->out.num_written);
+               ZERO_STRUCTP(r->out.num_written);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.num_written));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.num_written);
+               }
+               _mem_save_num_written_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.num_written, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_written));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_written_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -11132,7 +11382,10 @@ _PUBLIC_ void ndr_print_spoolss_WritePrinter(struct ndr_print *ndr, const char *
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_WritePrinter");
                ndr->depth++;
-               ndr_print_uint32(ndr, "num_written", r->out.num_written);
+               ndr_print_ptr(ndr, "num_written", r->out.num_written);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "num_written", *r->out.num_written);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -11263,8 +11516,15 @@ static enum ndr_err_code ndr_push_spoolss_ReadPrinter(struct ndr_push *ndr, int
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.data_size));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.data));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.data.length));
+               if (r->out.data == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.data_size));
+               NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.data_size));
+               if (r->out._data_size == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out._data_size));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -11273,6 +11533,7 @@ static enum ndr_err_code ndr_push_spoolss_ReadPrinter(struct ndr_push *ndr, int
 static enum ndr_err_code ndr_pull_spoolss_ReadPrinter(struct ndr_pull *ndr, int flags, struct spoolss_ReadPrinter *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save__data_size_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -11284,11 +11545,28 @@ static enum ndr_err_code ndr_pull_spoolss_ReadPrinter(struct ndr_pull *ndr, int
                NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.data_size));
+               NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.data_size);
+               memset(CONST_DISCARD(struct spoolss_ReadPrinter *,r->out.data), 0, (r->in.data_size) * sizeof(*r->out.data));
+               NDR_PULL_ALLOC(ndr, r->out._data_size);
+               ZERO_STRUCTP(r->out._data_size);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.data));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out._data_size));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data));
+               }
+               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data)));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out._data_size);
+               }
+               _mem_save__data_size_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out._data_size, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out._data_size));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save__data_size_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+               if (r->out.data) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.data_size));
+               }
        }
        return NDR_ERR_SUCCESS;
 }
@@ -11313,8 +11591,14 @@ _PUBLIC_ void ndr_print_spoolss_ReadPrinter(struct ndr_print *ndr, const char *n
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_ReadPrinter");
                ndr->depth++;
-               ndr_print_DATA_BLOB(ndr, "data", r->out.data);
-               ndr_print_uint32(ndr, "_data_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->out.data.length:r->out._data_size);
+               ndr_print_ptr(ndr, "data", r->out.data);
+               ndr->depth++;
+               ndr_print_array_uint8(ndr, "data", r->out.data, r->in.data_size);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "_data_size", r->out._data_size);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "_data_size", *r->out._data_size);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -11474,9 +11758,15 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->out.type));
+               if (r->out.type == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, *r->out.type));
                NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.data));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -11485,6 +11775,8 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr
 _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct _spoolss_GetPrinterData *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_type_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -11503,11 +11795,27 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.value_name, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.type);
+               ZERO_STRUCTP(r->out.type);
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, &r->out.type));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.type);
+               }
+               _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->out.type));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.data));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -11560,10 +11868,16 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterData(struct ndr_print *ndr, const char
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_GetPrinterData");
                ndr->depth++;
-               ndr_print_spoolss_PrinterDataType(ndr, "type", r->out.type);
-               ndr_print_set_switch_value(ndr, &r->out.data, r->out.type);
+               ndr_print_ptr(ndr, "type", r->out.type);
+               ndr->depth++;
+               ndr_print_spoolss_PrinterDataType(ndr, "type", *r->out.type);
+               ndr->depth--;
+               ndr_print_set_switch_value(ndr, &r->out.data, *r->out.type);
                ndr_print_spoolss_PrinterData(ndr, "data", &r->out.data);
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -11948,7 +12262,10 @@ static enum ndr_err_code ndr_push_spoolss_GetForm(struct ndr_push *ndr, int flag
                                NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered));
                        }
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -11961,6 +12278,7 @@ static enum ndr_err_code ndr_pull_spoolss_GetForm(struct ndr_pull *ndr, int flag
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -11992,6 +12310,8 @@ static enum ndr_err_code ndr_pull_spoolss_GetForm(struct ndr_pull *ndr, int flag
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -12012,7 +12332,13 @@ static enum ndr_err_code ndr_pull_spoolss_GetForm(struct ndr_pull *ndr, int flag
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -12053,7 +12379,10 @@ _PUBLIC_ void ndr_print_spoolss_GetForm(struct ndr_print *ndr, const char *name,
                        ndr_print_spoolss_FormInfo(ndr, "info", r->out.info);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -12157,7 +12486,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumForms(struct ndr_push *ndr, int
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
@@ -12171,6 +12503,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(struct ndr_pull *ndr, int
        TALLOC_CTX *_mem_save_handle_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -12195,6 +12528,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(struct ndr_pull *ndr, int
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -12209,7 +12544,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumForms(struct ndr_pull *ndr, int
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
@@ -12305,7 +12646,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumForms(struct ndr_print *ndr, const char *nam
                        ndr->depth--;
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_uint32(ndr, "count", r->out.count);
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -12335,7 +12679,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPorts(struct ndr_push *ndr, int
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
@@ -12350,6 +12697,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(struct ndr_pull *ndr, int
        TALLOC_CTX *_mem_save_servername_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -12385,6 +12733,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(struct ndr_pull *ndr, int
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -12399,7 +12749,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPorts(struct ndr_pull *ndr, int
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
@@ -12497,7 +12853,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPorts(struct ndr_print *ndr, const char *nam
                        ndr->depth--;
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_uint32(ndr, "count", r->out.count);
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -12527,7 +12886,10 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumMonitors(struct ndr_push *ndr,
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
@@ -12542,6 +12904,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(struct ndr_pull *ndr,
        TALLOC_CTX *_mem_save_servername_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -12577,6 +12940,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(struct ndr_pull *ndr,
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
                }
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -12591,7 +12956,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumMonitors(struct ndr_pull *ndr,
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
@@ -12689,7 +13060,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumMonitors(struct ndr_print *ndr, const char *
                        ndr->depth--;
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_uint32(ndr, "count", r->out.count);
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
@@ -13429,9 +13803,18 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDriver2(struct ndr_push *ndr
                if (r->out.info) {
                        NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info));
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.server_major_version));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.server_minor_version));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
+               if (r->out.server_major_version == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.server_major_version));
+               if (r->out.server_minor_version == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.server_minor_version));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -13446,6 +13829,9 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDriver2(struct ndr_pull *ndr
        TALLOC_CTX *_mem_save_architecture_0;
        TALLOC_CTX *_mem_save_buffer_0;
        TALLOC_CTX *_mem_save_info_0;
+       TALLOC_CTX *_mem_save_needed_0;
+       TALLOC_CTX *_mem_save_server_major_version_0;
+       TALLOC_CTX *_mem_save_server_minor_version_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -13490,6 +13876,12 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDriver2(struct ndr_pull *ndr
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_major_version));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_minor_version));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
+               NDR_PULL_ALLOC(ndr, r->out.server_major_version);
+               ZERO_STRUCTP(r->out.server_major_version);
+               NDR_PULL_ALLOC(ndr, r->out.server_minor_version);
+               ZERO_STRUCTP(r->out.server_minor_version);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
@@ -13504,9 +13896,27 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDriver2(struct ndr_pull *ndr
                        NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.server_major_version));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.server_minor_version));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.server_major_version);
+               }
+               _mem_save_server_major_version_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.server_major_version, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.server_major_version));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_major_version_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.server_minor_version);
+               }
+               _mem_save_server_minor_version_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.server_minor_version, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.server_minor_version));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_minor_version_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -13553,9 +13963,18 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDriver2(struct ndr_print *ndr, const c
                        ndr_print_DATA_BLOB(ndr, "info", *r->out.info);
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
-               ndr_print_uint32(ndr, "server_major_version", r->out.server_major_version);
-               ndr_print_uint32(ndr, "server_minor_version", r->out.server_minor_version);
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "server_major_version", r->out.server_major_version);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "server_major_version", *r->out.server_major_version);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "server_minor_version", r->out.server_minor_version);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "server_minor_version", *r->out.server_minor_version);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -13830,6 +14249,17 @@ _PUBLIC_ void ndr_print_spoolss_ReplyOpenPrinter(struct ndr_print *ndr, const ch
 static enum ndr_err_code ndr_push_spoolss_RouterReplyPrinter(struct ndr_push *ndr, int flags, const struct spoolss_RouterReplyPrinter *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_CHECK(ndr_push_spoolss_PrinterChangeFlags(ndr, NDR_SCALARS, r->in.flags));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.buffer));
+               if (r->in.buffer) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize));
+                       NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.bufsize));
+               }
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
@@ -13839,7 +14269,39 @@ static enum ndr_err_code ndr_push_spoolss_RouterReplyPrinter(struct ndr_push *nd
 
 static enum ndr_err_code ndr_pull_spoolss_RouterReplyPrinter(struct ndr_pull *ndr, int flags, struct spoolss_RouterReplyPrinter *r)
 {
+       uint32_t _ptr_buffer;
+       TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_buffer_0;
        if (flags & NDR_IN) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.handle);
+               }
+               _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_spoolss_PrinterChangeFlags(ndr, NDR_SCALARS, &r->in.flags));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bufsize));
+               if (r->in.bufsize > 512) {
+                       return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+               }
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
+               if (_ptr_buffer) {
+                       NDR_PULL_ALLOC(ndr, r->in.buffer);
+               } else {
+                       r->in.buffer = NULL;
+               }
+               if (r->in.buffer) {
+                       _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer));
+                       NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer));
+                       NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
+               }
+               if (r->in.buffer) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.bufsize));
+               }
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
@@ -13857,6 +14319,18 @@ _PUBLIC_ void ndr_print_spoolss_RouterReplyPrinter(struct ndr_print *ndr, const
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_RouterReplyPrinter");
                ndr->depth++;
+               ndr_print_ptr(ndr, "handle", r->in.handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "handle", r->in.handle);
+               ndr->depth--;
+               ndr_print_spoolss_PrinterChangeFlags(ndr, "flags", r->in.flags);
+               ndr_print_uint32(ndr, "bufsize", r->in.bufsize);
+               ndr_print_ptr(ndr, "buffer", r->in.buffer);
+               ndr->depth++;
+               if (r->in.buffer) {
+                       ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.bufsize);
+               }
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -15217,9 +15691,19 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr,
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.type));
-               NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.buffer));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               if (r->out.type == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.type));
+               if (r->out.buffer == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
+               NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -15228,6 +15712,8 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr,
 static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterDataEx *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_type_0;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -15253,12 +15739,37 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr,
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.value_name, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC(ndr, r->out.type);
+               ZERO_STRUCTP(r->out.type);
+               NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
+               memset(CONST_DISCARD(struct spoolss_GetPrinterDataEx *,r->out.buffer), 0, (r->in.offered) * sizeof(*r->out.buffer));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.type));
-               NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.buffer));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.type);
+               }
+               _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.type));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
+               }
+               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+               if (r->out.buffer) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered));
+               }
        }
        return NDR_ERR_SUCCESS;
 }
@@ -15285,9 +15796,18 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_GetPrinterDataEx");
                ndr->depth++;
-               ndr_print_uint32(ndr, "type", r->out.type);
-               ndr_print_DATA_BLOB(ndr, "buffer", r->out.buffer);
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr_print_ptr(ndr, "type", r->out.type);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "type", *r->out.type);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "buffer", r->out.buffer);
+               ndr->depth++;
+               ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -15308,9 +15828,19 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.buffer));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count));
+               if (r->out.buffer == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
+               NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
+               if (r->out.count == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -15319,6 +15849,8 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n
 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_needed_0;
+       TALLOC_CTX *_mem_save_count_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -15337,12 +15869,37 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+               NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
+               memset(CONST_DISCARD(struct spoolss_EnumPrinterDataEx *,r->out.buffer), 0, (r->in.offered) * sizeof(*r->out.buffer));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
+               NDR_PULL_ALLOC(ndr, r->out.count);
+               ZERO_STRUCTP(r->out.count);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.buffer));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.count));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
+               }
+               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.count);
+               }
+               _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+               if (r->out.buffer) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered));
+               }
        }
        return NDR_ERR_SUCCESS;
 }
@@ -15368,9 +15925,18 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_EnumPrinterDataEx");
                ndr->depth++;
-               ndr_print_DATA_BLOB(ndr, "buffer", r->out.buffer);
-               ndr_print_uint32(ndr, "needed", r->out.needed);
-               ndr_print_uint32(ndr, "count", r->out.count);
+               ndr_print_ptr(ndr, "buffer", r->out.buffer);
+               ndr->depth++;
+               ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "count", r->out.count);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "count", *r->out.count);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -15379,7 +15945,7 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c
 
 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterKey *r)
 {
-       uint32_t cntr_key_buffer_0;
+       uint32_t cntr_key_buffer_1;
        if (flags & NDR_IN) {
                if (r->in.handle == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
@@ -15389,14 +15955,20 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr,
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16)));
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.key_name, ndr_charset_length(r->in.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.needed));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.key_buffer_size));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.key_buffer_size));
-               for (cntr_key_buffer_0 = 0; cntr_key_buffer_0 < r->out.key_buffer_size; cntr_key_buffer_0++) {
-                       NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.key_buffer[cntr_key_buffer_0]));
+               if (r->out.key_buffer == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.key_buffer_size / 2));
+               for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) {
+                       NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.key_buffer[cntr_key_buffer_1]));
+               }
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -15404,9 +15976,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr,
 
 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterKey *r)
 {
-       uint32_t cntr_key_buffer_0;
+       uint32_t cntr_key_buffer_1;
        TALLOC_CTX *_mem_save_handle_0;
-       TALLOC_CTX *_mem_save_key_buffer_0;
+       TALLOC_CTX *_mem_save_key_buffer_1;
+       TALLOC_CTX *_mem_save_needed_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -15424,26 +15997,41 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr,
                }
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t)));
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.needed));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.key_buffer_size));
+               NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, r->in.key_buffer_size / 2);
+               memset(CONST_DISCARD(struct spoolss_EnumPrinterKey *,r->out.key_buffer), 0, (r->in.key_buffer_size / 2) * sizeof(*r->out.key_buffer));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.key_buffer_size));
-               NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, r->out.key_buffer_size);
-               _mem_save_key_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->out.key_buffer));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, ndr_get_array_size(ndr, &r->out.key_buffer));
+               }
+               _mem_save_key_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr);
                NDR_PULL_SET_MEM_CTX(ndr, r->out.key_buffer, 0);
-               for (cntr_key_buffer_0 = 0; cntr_key_buffer_0 < r->out.key_buffer_size; cntr_key_buffer_0++) {
-                       NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.key_buffer[cntr_key_buffer_0]));
+               for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) {
+                       NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.key_buffer[cntr_key_buffer_1]));
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_1, 0);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
                }
-               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_0, 0);
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+               if (r->out.key_buffer) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.key_buffer, r->in.key_buffer_size / 2));
+               }
        }
        return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterKey *r)
 {
-       uint32_t cntr_key_buffer_0;
+       uint32_t cntr_key_buffer_1;
        ndr_print_struct(ndr, name, "spoolss_EnumPrinterKey");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
@@ -15457,24 +16045,29 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char
                ndr_print_policy_handle(ndr, "handle", r->in.handle);
                ndr->depth--;
                ndr_print_string(ndr, "key_name", r->in.key_name);
-               ndr_print_uint32(ndr, "needed", r->in.needed);
+               ndr_print_uint32(ndr, "key_buffer_size", r->in.key_buffer_size);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_EnumPrinterKey");
                ndr->depth++;
-               ndr_print_uint32(ndr, "key_buffer_size", r->out.key_buffer_size);
-               ndr->print(ndr, "%s: ARRAY(%d)", "key_buffer", (int)r->out.key_buffer_size);
+               ndr_print_ptr(ndr, "key_buffer", r->out.key_buffer);
+               ndr->depth++;
+               ndr->print(ndr, "%s: ARRAY(%d)", "key_buffer", (int)r->in.key_buffer_size / 2);
                ndr->depth++;
-               for (cntr_key_buffer_0=0;cntr_key_buffer_0<r->out.key_buffer_size;cntr_key_buffer_0++) {
-                       char *idx_0=NULL;
-                       if (asprintf(&idx_0, "[%d]", cntr_key_buffer_0) != -1) {
-                               ndr_print_uint16(ndr, "key_buffer", r->out.key_buffer[cntr_key_buffer_0]);
-                               free(idx_0);
+               for (cntr_key_buffer_1=0;cntr_key_buffer_1<r->in.key_buffer_size / 2;cntr_key_buffer_1++) {
+                       char *idx_1=NULL;
+                       if (asprintf(&idx_1, "[%d]", cntr_key_buffer_1) != -1) {
+                               ndr_print_uint16(ndr, "key_buffer", r->out.key_buffer[cntr_key_buffer_1]);
+                               free(idx_1);
                        }
                }
                ndr->depth--;
-               ndr_print_uint32(ndr, "needed", r->out.needed);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -15565,6 +16158,14 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDataEx(struct ndr_print *ndr, const
 static enum ndr_err_code ndr_push_spoolss_DeletePrinterKey(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterKey *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.key_name, ndr_charset_length(r->in.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
@@ -15574,7 +16175,22 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterKey(struct ndr_push *ndr,
 
 static enum ndr_err_code ndr_pull_spoolss_DeletePrinterKey(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterKey *r)
 {
+       TALLOC_CTX *_mem_save_handle_0;
        if (flags & NDR_IN) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.handle);
+               }
+               _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.key_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.key_name));
+               if (ndr_get_array_length(ndr, &r->in.key_name) > ndr_get_array_size(ndr, &r->in.key_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.key_name), ndr_get_array_length(ndr, &r->in.key_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
@@ -15592,6 +16208,11 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterKey(struct ndr_print *ndr, const ch
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_DeletePrinterKey");
                ndr->depth++;
+               ndr_print_ptr(ndr, "handle", r->in.handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "handle", r->in.handle);
+               ndr->depth--;
+               ndr_print_string(ndr, "key_name", r->in.key_name);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -15647,6 +16268,23 @@ _PUBLIC_ void ndr_print_spoolss_53(struct ndr_print *ndr, const char *name, int
 static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriverEx(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterDriverEx *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server));
+               if (r->in.server) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server, ndr_charset_length(r->in.server, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.architecture, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.architecture, ndr_charset_length(r->in.architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.driver, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.driver, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.driver, ndr_charset_length(r->in.driver, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_spoolss_DeleteDriverFlags(ndr, NDR_SCALARS, r->in.delete_flags));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.version));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
@@ -15656,7 +16294,43 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterDriverEx(struct ndr_push
 
 static enum ndr_err_code ndr_pull_spoolss_DeletePrinterDriverEx(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterDriverEx *r)
 {
+       uint32_t _ptr_server;
+       TALLOC_CTX *_mem_save_server_0;
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server));
+               if (_ptr_server) {
+                       NDR_PULL_ALLOC(ndr, r->in.server);
+               } else {
+                       r->in.server = NULL;
+               }
+               if (r->in.server) {
+                       _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server));
+                       if (ndr_get_array_length(ndr, &r->in.server) > ndr_get_array_size(ndr, &r->in.server)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server), ndr_get_array_length(ndr, &r->in.server));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0);
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.architecture));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.architecture));
+               if (ndr_get_array_length(ndr, &r->in.architecture) > ndr_get_array_size(ndr, &r->in.architecture)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.architecture), ndr_get_array_length(ndr, &r->in.architecture));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.architecture, ndr_get_array_length(ndr, &r->in.architecture), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.driver));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.driver));
+               if (ndr_get_array_length(ndr, &r->in.driver) > ndr_get_array_size(ndr, &r->in.driver)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.driver), ndr_get_array_length(ndr, &r->in.driver));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.driver), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.driver, ndr_get_array_length(ndr, &r->in.driver), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_spoolss_DeleteDriverFlags(ndr, NDR_SCALARS, &r->in.delete_flags));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.version));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
@@ -15674,6 +16348,16 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterDriverEx(struct ndr_print *ndr, con
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_DeletePrinterDriverEx");
                ndr->depth++;
+               ndr_print_ptr(ndr, "server", r->in.server);
+               ndr->depth++;
+               if (r->in.server) {
+                       ndr_print_string(ndr, "server", r->in.server);
+               }
+               ndr->depth--;
+               ndr_print_string(ndr, "architecture", r->in.architecture);
+               ndr_print_string(ndr, "driver", r->in.driver);
+               ndr_print_spoolss_DeleteDriverFlags(ndr, "delete_flags", r->in.delete_flags);
+               ndr_print_uint32(ndr, "version", r->in.version);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -15821,13 +16505,26 @@ static enum ndr_err_code ndr_push_spoolss_XcvData(struct ndr_push *ndr, int flag
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.function_name, ndr_charset_length(r->in.function_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->in.in_data));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data.length));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.out_data_size));
+               if (r->in.status_code == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.status_code));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.out_data));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.needed));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.unknown2));
+               if (r->out.out_data == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.out_data_size));
+               NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.out_data, r->in.out_data_size));
+               if (r->out.needed == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
+               if (r->out.status_code == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.status_code));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -15836,6 +16533,8 @@ static enum ndr_err_code ndr_push_spoolss_XcvData(struct ndr_push *ndr, int flag
 static enum ndr_err_code ndr_pull_spoolss_XcvData(struct ndr_pull *ndr, int flags, struct spoolss_XcvData *r)
 {
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_needed_0;
+       TALLOC_CTX *_mem_save_status_code_0;
        if (flags & NDR_IN) {
                ZERO_STRUCT(r->out);
 
@@ -15855,14 +16554,45 @@ static enum ndr_err_code ndr_pull_spoolss_XcvData(struct ndr_pull *ndr, int flag
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.function_name, ndr_get_array_length(ndr, &r->in.function_name), sizeof(uint16_t), CH_UTF16));
                NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->in.in_data));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in._in_data_length));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.out_data_size));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.status_code);
+               }
+               _mem_save_status_code_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.status_code, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.status_code));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_status_code_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC_N(ndr, r->out.out_data, r->in.out_data_size);
+               memset(CONST_DISCARD(struct spoolss_XcvData *,r->out.out_data), 0, (r->in.out_data_size) * sizeof(*r->out.out_data));
+               NDR_PULL_ALLOC(ndr, r->out.needed);
+               ZERO_STRUCTP(r->out.needed);
+               NDR_PULL_ALLOC(ndr, r->out.status_code);
+               *r->out.status_code = *r->in.status_code;
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.out_data));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.needed));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.unknown2));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->out.out_data));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC_N(ndr, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data));
+               }
+               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data)));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.needed);
+               }
+               _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.status_code);
+               }
+               _mem_save_status_code_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.status_code, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.status_code));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_status_code_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+               if (r->out.out_data) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.out_data, r->in.out_data_size));
+               }
        }
        return NDR_ERR_SUCCESS;
 }
@@ -15884,16 +16614,28 @@ _PUBLIC_ void ndr_print_spoolss_XcvData(struct ndr_print *ndr, const char *name,
                ndr_print_string(ndr, "function_name", r->in.function_name);
                ndr_print_DATA_BLOB(ndr, "in_data", r->in.in_data);
                ndr_print_uint32(ndr, "_in_data_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->in.in_data.length:r->in._in_data_length);
-               ndr_print_uint32(ndr, "offered", r->in.offered);
-               ndr_print_uint32(ndr, "unknown1", r->in.unknown1);
+               ndr_print_uint32(ndr, "out_data_size", r->in.out_data_size);
+               ndr_print_ptr(ndr, "status_code", r->in.status_code);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "status_code", *r->in.status_code);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_XcvData");
                ndr->depth++;
-               ndr_print_DATA_BLOB(ndr, "out_data", r->out.out_data);
-               ndr_print_uint32(ndr, "needed", r->out.needed);
-               ndr_print_uint32(ndr, "unknown2", r->out.unknown2);
+               ndr_print_ptr(ndr, "out_data", r->out.out_data);
+               ndr->depth++;
+               ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.out_data_size);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "needed", r->out.needed);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "needed", *r->out.needed);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "status_code", r->out.status_code);
+               ndr->depth++;
+               ndr_print_uint32(ndr, "status_code", *r->out.status_code);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
index d5b8ca9bc06b0acb1d29a74709d61d6fd2f7b581..41ff65278b5b176fac788b34e0c90fef02b5b35c 100644 (file)
@@ -292,6 +292,7 @@ void ndr_print_spoolss_MonitorInfo2(struct ndr_print *ndr, const char *name, con
 enum ndr_err_code ndr_push_spoolss_MonitorInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_MonitorInfo *r);
 enum ndr_err_code ndr_pull_spoolss_MonitorInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_MonitorInfo *r);
 void ndr_print_spoolss_MonitorInfo(struct ndr_print *ndr, const char *name, const union spoolss_MonitorInfo *r);
+void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const char *name, uint32_t r);
 void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, enum spoolss_Field r);
 void ndr_print_spoolss_NotifyType(struct ndr_print *ndr, const char *name, enum spoolss_NotifyType r);
 void ndr_print_spoolss_NotifyOptionsArray(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyOptionsArray *r);
@@ -305,6 +306,9 @@ void ndr_print_spoolss_Notify(struct ndr_print *ndr, const char *name, const str
 void ndr_print_spoolss_NotifyInfo(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyInfo *r);
 void ndr_print_spoolss_UserLevel1(struct ndr_print *ndr, const char *name, const struct spoolss_UserLevel1 *r);
 void ndr_print_spoolss_UserLevel(struct ndr_print *ndr, const char *name, const union spoolss_UserLevel *r);
+enum ndr_err_code ndr_push_spoolss_DeleteDriverFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+enum ndr_err_code ndr_pull_spoolss_DeleteDriverFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+void ndr_print_spoolss_DeleteDriverFlags(struct ndr_print *ndr, const char *name, uint32_t r);
 enum ndr_err_code ndr_push__spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinters *r);
 enum ndr_err_code ndr_pull__spoolss_EnumPrinters(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinters *r);
 void ndr_print__spoolss_EnumPrinters(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_EnumPrinters *r);
index 49eb7990799b3478f4d33b35ce48c2c690b0fd83..36950b0f6436d7a9dd8bbcd62b45cea449495ed0 100644 (file)
@@ -8,7 +8,15 @@
 #ifndef _HEADER_spoolss
 #define _HEADER_spoolss
 
+#define PRINTER_ENUM_ICONMASK  ( (PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8) )
 #define SPOOLSS_ARCHITECTURE_NT_X86    ( "Windows NT x86" )
+#define PRINTER_CHANGE_PRINTER ( (PRINTER_CHANGE_ADD_PRINTER|PRINTER_CHANGE_SET_PRINTER|PRINTER_CHANGE_DELETE_PRINTER|PRINTER_CHANGE_FAILED_CONNECTION_PRINTER) )
+#define PRINTER_CHANGE_JOB     ( (PRINTER_CHANGE_ADD_JOB|PRINTER_CHANGE_SET_JOB|PRINTER_CHANGE_DELETE_JOB|PRINTER_CHANGE_WRITE_JOB) )
+#define PRINTER_CHANGE_FORM    ( (PRINTER_CHANGE_ADD_FORM|PRINTER_CHANGE_SET_FORM|PRINTER_CHANGE_DELETE_FORM) )
+#define PRINTER_CHANGE_PORT    ( (PRINTER_CHANGE_ADD_PORT|PRINTER_CHANGE_CONFIGURE_PORT|PRINTER_CHANGE_DELETE_PORT) )
+#define PRINTER_CHANGE_PRINT_PROCESSOR ( (PRINTER_CHANGE_ADD_PRINT_PROCESSOR|PRINTER_CHANGE_DELETE_PRINT_PROCESSOR) )
+#define PRINTER_CHANGE_PRINTER_DRIVER  ( (PRINTER_CHANGE_ADD_PRINTER_DRIVER|PRINTER_CHANGE_SET_PRINTER_DRIVER|PRINTER_CHANGE_DELETE_PRINTER_DRIVER) )
+#define PRINTER_CHANGE_ALL     ( (PRINTER_CHANGE_JOB|PRINTER_CHANGE_FORM|PRINTER_CHANGE_PORT|PRINTER_CHANGE_PRINT_PROCESSOR|PRINTER_CHANGE_PRINTER_DRIVER) )
 #define SERVER_ALL_ACCESS      ( SEC_STD_REQUIRED|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE )
 #define SERVER_READ    ( SEC_STD_READ_CONTROL|SERVER_ACCESS_ENUMERATE )
 #define SERVER_WRITE   ( STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE )
@@ -596,6 +604,28 @@ union spoolss_MonitorInfo {
        struct spoolss_MonitorInfo2 info2;/* [case(2)] */
 }/* [relative_base,nodiscriminant,public] */;
 
+/* bitmap spoolss_PrinterChangeFlags */
+#define PRINTER_CHANGE_ADD_PRINTER ( 0x00000001 )
+#define PRINTER_CHANGE_SET_PRINTER ( 0x00000002 )
+#define PRINTER_CHANGE_DELETE_PRINTER ( 0x00000004 )
+#define PRINTER_CHANGE_FAILED_CONNECTION_PRINTER ( 0x00000008 )
+#define PRINTER_CHANGE_ADD_JOB ( 0x00000100 )
+#define PRINTER_CHANGE_SET_JOB ( 0x00000200 )
+#define PRINTER_CHANGE_DELETE_JOB ( 0x00000400 )
+#define PRINTER_CHANGE_WRITE_JOB ( 0x00000800 )
+#define PRINTER_CHANGE_ADD_FORM ( 0x00010000 )
+#define PRINTER_CHANGE_SET_FORM ( 0x00020000 )
+#define PRINTER_CHANGE_DELETE_FORM ( 0x00040000 )
+#define PRINTER_CHANGE_ADD_PORT ( 0x00100000 )
+#define PRINTER_CHANGE_CONFIGURE_PORT ( 0x00200000 )
+#define PRINTER_CHANGE_DELETE_PORT ( 0x00400000 )
+#define PRINTER_CHANGE_ADD_PRINT_PROCESSOR ( 0x01000000 )
+#define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR ( 0x04000000 )
+#define PRINTER_CHANGE_ADD_PRINTER_DRIVER ( 0x10000000 )
+#define PRINTER_CHANGE_SET_PRINTER_DRIVER ( 0x20000000 )
+#define PRINTER_CHANGE_DELETE_PRINTER_DRIVER ( 0x40000000 )
+#define PRINTER_CHANGE_TIMEOUT ( 0x80000000 )
+
 enum spoolss_Field
 #ifndef USE_UINT_ENUMS
  {
@@ -748,6 +778,11 @@ union spoolss_UserLevel {
 #define PRINTER_ACCESS_USE ( 0x00000008 )
 #define JOB_ACCESS_ADMINISTER ( 0x00000010 )
 
+/* bitmap spoolss_DeleteDriverFlags */
+#define DPD_DELETE_UNUSED_FILES ( 0x00000001 )
+#define DPD_DELETE_SPECIFIC_VERSION ( 0x00000002 )
+#define DPD_DELETE_ALL_FILES ( 0x00000004 )
+
 
 struct _spoolss_EnumPrinters {
        struct {
@@ -760,7 +795,7 @@ struct _spoolss_EnumPrinters {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -792,7 +827,7 @@ struct spoolss_EnumPrinters {
 
        struct {
                union spoolss_PrinterInfo *info;/* [unique,switch_is(level),size_is(count)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -842,7 +877,7 @@ struct spoolss_GetJob {
 
        struct {
                union spoolss_JobInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -861,7 +896,7 @@ struct _spoolss_EnumJobs {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -894,7 +929,7 @@ struct spoolss_EnumJobs {
 
        struct {
                union spoolss_JobInfo *info;/* [unique,switch_is(level),size_is(count)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -949,7 +984,7 @@ struct spoolss_GetPrinter {
 
        struct {
                union spoolss_PrinterInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -975,7 +1010,7 @@ struct _spoolss_EnumPrinterDrivers {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1007,7 +1042,7 @@ struct spoolss_EnumPrinterDrivers {
 
        struct {
                union spoolss_DriverInfo *info;/* [unique,switch_is(level),size_is(count)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1034,7 +1069,7 @@ struct spoolss_GetPrinterDriverDirectory {
 
        struct {
                union spoolss_DriverDirectoryInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -1043,7 +1078,6 @@ struct spoolss_GetPrinterDriverDirectory {
 
 struct spoolss_DeletePrinterDriver {
        struct {
-               struct policy_handle *handle;/* [ref] */
                const char *server;/* [unique,charset(UTF16)] */
                const char *architecture;/* [charset(UTF16)] */
                const char *driver;/* [charset(UTF16)] */
@@ -1057,6 +1091,13 @@ struct spoolss_DeletePrinterDriver {
 
 
 struct spoolss_AddPrintProcessor {
+       struct {
+               const char *server;/* [unique,charset(UTF16)] */
+               const char *architecture;/* [charset(UTF16)] */
+               const char *path_name;/* [charset(UTF16)] */
+               const char *print_processor_name;/* [charset(UTF16)] */
+       } in;
+
        struct {
                WERROR result;
        } out;
@@ -1075,7 +1116,7 @@ struct _spoolss_EnumPrintProcessors {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1107,7 +1148,7 @@ struct spoolss_EnumPrintProcessors {
 
        struct {
                union spoolss_PrintProcessorInfo *info;/* [unique,switch_is(level),size_is(count)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1131,7 +1172,7 @@ struct spoolss_StartDocPrinter {
        } in;
 
        struct {
-               uint32_t job_id;
+               uint32_t *job_id;/* [ref] */
                WERROR result;
        } out;
 
@@ -1158,7 +1199,7 @@ struct spoolss_WritePrinter {
        } in;
 
        struct {
-               uint32_t num_written;
+               uint32_t *num_written;/* [ref] */
                WERROR result;
        } out;
 
@@ -1196,8 +1237,8 @@ struct spoolss_ReadPrinter {
        } in;
 
        struct {
-               DATA_BLOB data;
-               uint32_t _data_size;/* [value(r->out.data.length)] */
+               uint8_t *data;/* [ref,size_is(data_size)] */
+               uint32_t *_data_size;/* [ref] */
                WERROR result;
        } out;
 
@@ -1240,9 +1281,9 @@ struct _spoolss_GetPrinterData {
        } in;
 
        struct {
-               enum spoolss_PrinterDataType type;
+               enum spoolss_PrinterDataType *type;/* [ref] */
                DATA_BLOB data;
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -1269,9 +1310,9 @@ struct spoolss_GetPrinterData {
        } in;
 
        struct {
-               enum spoolss_PrinterDataType type;
-               union spoolss_PrinterData data;/* [subcontext_size(offered),subcontext(4),switch_is(type)] */
-               uint32_t needed;
+               enum spoolss_PrinterDataType *type;/* [ref] */
+               union spoolss_PrinterData data;/* [subcontext_size(offered),subcontext(4),switch_is(*type)] */
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -1381,7 +1422,7 @@ struct spoolss_GetForm {
 
        struct {
                union spoolss_FormInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -1413,7 +1454,7 @@ struct _spoolss_EnumForms {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1444,7 +1485,7 @@ struct spoolss_EnumForms {
 
        struct {
                union spoolss_FormInfo *info;/* [unique,switch_is(level),size_is(count)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1462,7 +1503,7 @@ struct _spoolss_EnumPorts {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1493,7 +1534,7 @@ struct spoolss_EnumPorts {
 
        struct {
                union spoolss_PortInfo *info;/* [unique,switch_is(level),size_is(count)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1511,7 +1552,7 @@ struct _spoolss_EnumMonitors {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1542,7 +1583,7 @@ struct spoolss_EnumMonitors {
 
        struct {
                union spoolss_MonitorInfo *info;/* [unique,switch_is(level),size_is(count)] */
-               uint32_t needed;
+               uint32_t *needed;/* [ref] */
                uint32_t count;
                WERROR result;
        } out;
@@ -1697,9 +1738,9 @@ struct spoolss_GetPrinterDriver2 {
 
        struct {
                DATA_BLOB *info;/* [unique] */
-               uint32_t needed;
-               uint32_t server_major_version;
-               uint32_t server_minor_version;
+               uint32_t *needed;/* [ref] */
+               uint32_t *server_major_version;/* [ref] */
+               uint32_t *server_minor_version;/* [ref] */
                WERROR result;
        } out;
 
@@ -1760,6 +1801,13 @@ struct spoolss_ReplyOpenPrinter {
 
 
 struct spoolss_RouterReplyPrinter {
+       struct {
+               struct policy_handle *handle;/* [ref] */
+               uint32_t flags;
+               uint32_t bufsize;/* [range(0,512)] */
+               uint8_t *buffer;/* [unique,size_is(bufsize)] */
+       } in;
+
        struct {
                WERROR result;
        } out;
@@ -1987,9 +2035,9 @@ struct spoolss_GetPrinterDataEx {
        } in;
 
        struct {
-               uint32_t type;
-               DATA_BLOB buffer;
-               uint32_t needed;
+               uint32_t *type;/* [ref] */
+               uint8_t *buffer;/* [ref,size_is(offered)] */
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -2004,9 +2052,9 @@ struct spoolss_EnumPrinterDataEx {
        } in;
 
        struct {
-               DATA_BLOB buffer;
-               uint32_t needed;
-               uint32_t count;
+               uint8_t *buffer;/* [ref,size_is(offered)] */
+               uint32_t *needed;/* [ref] */
+               uint32_t *count;/* [ref] */
                WERROR result;
        } out;
 
@@ -2017,13 +2065,12 @@ struct spoolss_EnumPrinterKey {
        struct {
                struct policy_handle *handle;/* [ref] */
                const char *key_name;/* [charset(UTF16)] */
-               uint32_t needed;
+               uint32_t key_buffer_size;
        } in;
 
        struct {
-               uint32_t key_buffer_size;
-               uint16_t *key_buffer;
-               uint32_t needed;
+               uint16_t *key_buffer;/* [ref,size_is(key_buffer_size/2)] */
+               uint32_t *needed;/* [ref] */
                WERROR result;
        } out;
 
@@ -2045,6 +2092,11 @@ struct spoolss_DeletePrinterDataEx {
 
 
 struct spoolss_DeletePrinterKey {
+       struct {
+               struct policy_handle *handle;/* [ref] */
+               const char *key_name;/* [charset(UTF16)] */
+       } in;
+
        struct {
                WERROR result;
        } out;
@@ -2061,6 +2113,14 @@ struct spoolss_53 {
 
 
 struct spoolss_DeletePrinterDriverEx {
+       struct {
+               const char *server;/* [unique,charset(UTF16)] */
+               const char *architecture;/* [charset(UTF16)] */
+               const char *driver;/* [charset(UTF16)] */
+               uint32_t delete_flags;
+               uint32_t version;
+       } in;
+
        struct {
                WERROR result;
        } out;
@@ -2098,14 +2158,14 @@ struct spoolss_XcvData {
                const char *function_name;/* [charset(UTF16)] */
                DATA_BLOB in_data;
                uint32_t _in_data_length;/* [value(r->in.in_data.length)] */
-               uint32_t offered;
-               uint32_t unknown1;
+               uint32_t out_data_size;
+               uint32_t *status_code;/* [ref] */
        } in;
 
        struct {
-               DATA_BLOB out_data;
-               uint32_t needed;
-               uint32_t unknown2;
+               uint8_t *out_data;/* [ref,size_is(out_data_size)] */
+               uint32_t *needed;/* [ref] */
+               uint32_t *status_code;/* [ref] */
                WERROR result;
        } out;
 
index abf49766a4659711a2c604d9781351c547928848..64af1c4a1678ff1cb279345f22e67e2b9170ebb1 100644 (file)
@@ -57,12 +57,6 @@ static bool api_spoolss_EnumPrinters(pipes_struct *p)
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_EnumPrinters(p, r);
 
        if (p->rng_fault_state) {
@@ -388,12 +382,6 @@ static bool api_spoolss_EnumJobs(pipes_struct *p)
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_EnumJobs(p, r);
 
        if (p->rng_fault_state) {
@@ -858,12 +846,6 @@ static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p)
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_EnumPrinterDrivers(p, r);
 
        if (p->rng_fault_state) {
@@ -1255,12 +1237,6 @@ static bool api_spoolss_EnumPrintProcessors(pipes_struct *p)
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_EnumPrintProcessors(p, r);
 
        if (p->rng_fault_state) {
@@ -1787,7 +1763,7 @@ static bool api_spoolss_ReadPrinter(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.data = talloc_zero(r, DATA_BLOB);
+       r->out.data = talloc_zero_array(r, uint8_t, r->in.data_size);
        if (r->out.data == NULL) {
                talloc_free(r);
                return false;
@@ -2098,12 +2074,6 @@ static bool api_spoolss_GetPrinterData(pipes_struct *p)
                return false;
        }
 
-       r->out.data = talloc_zero(r, union spoolss_PrinterData);
-       if (r->out.data == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.needed = talloc_zero(r, uint32_t);
        if (r->out.needed == NULL) {
                talloc_free(r);
@@ -2722,12 +2692,6 @@ static bool api_spoolss_EnumForms(pipes_struct *p)
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_EnumForms(p, r);
 
        if (p->rng_fault_state) {
@@ -2814,12 +2778,6 @@ static bool api_spoolss_EnumPorts(pipes_struct *p)
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_EnumPorts(p, r);
 
        if (p->rng_fault_state) {
@@ -2906,12 +2864,6 @@ static bool api_spoolss_EnumMonitors(pipes_struct *p)
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_EnumMonitors(p, r);
 
        if (p->rng_fault_state) {
@@ -6064,7 +6016,7 @@ static bool api_spoolss_GetPrinterDataEx(pipes_struct *p)
                return false;
        }
 
-       r->out.buffer = talloc_zero(r, DATA_BLOB);
+       r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
        if (r->out.buffer == NULL) {
                talloc_free(r);
                return false;
@@ -6150,7 +6102,7 @@ static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.buffer = talloc_zero(r, DATA_BLOB);
+       r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
        if (r->out.buffer == NULL) {
                talloc_free(r);
                return false;
@@ -6242,15 +6194,14 @@ static bool api_spoolss_EnumPrinterKey(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.needed = r->in.needed;
-       r->out.key_buffer_size = talloc_zero(r, uint32_t);
-       if (r->out.key_buffer_size == NULL) {
+       r->out.key_buffer = talloc_zero_array(r, uint16_t, r->in.key_buffer_size / 2);
+       if (r->out.key_buffer == NULL) {
                talloc_free(r);
                return false;
        }
 
-       r->out.key_buffer = talloc_zero_array(r, uint16_t, r->out.key_buffer_size);
-       if (r->out.key_buffer == NULL) {
+       r->out.needed = talloc_zero(r, uint32_t);
+       if (r->out.needed == NULL) {
                talloc_free(r);
                return false;
        }
@@ -6840,7 +6791,8 @@ static bool api_spoolss_XcvData(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.out_data = talloc_zero(r, DATA_BLOB);
+       r->out.status_code = r->in.status_code;
+       r->out.out_data = talloc_zero_array(r, uint8_t, r->in.out_data_size);
        if (r->out.out_data == NULL) {
                talloc_free(r);
                return false;
@@ -6852,12 +6804,6 @@ static bool api_spoolss_XcvData(pipes_struct *p)
                return false;
        }
 
-       r->out.unknown2 = talloc_zero(r, uint32_t);
-       if (r->out.unknown2 == NULL) {
-               talloc_free(r);
-               return false;
-       }
-
        r->out.result = _spoolss_XcvData(p, r);
 
        if (p->rng_fault_state) {
@@ -7533,11 +7479,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_EnumPrinters(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7590,11 +7531,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_EnumJobs(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7653,11 +7589,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_EnumPrinterDrivers(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7710,11 +7641,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_EnumPrintProcessors(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7770,7 +7696,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_READPRINTER: {
                        struct spoolss_ReadPrinter *r = (struct spoolss_ReadPrinter *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.data = talloc_zero(mem_ctx, DATA_BLOB);
+                       r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_size);
                        if (r->out.data == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7810,11 +7736,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.data = talloc_zero(mem_ctx, union spoolss_PrinterData);
-                       if (r->out.data == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
                        return NT_STATUS_NO_MEMORY;
@@ -7892,11 +7813,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_EnumForms(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7914,11 +7830,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_EnumPorts(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7936,11 +7847,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_EnumMonitors(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -8266,7 +8172,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB);
+                       r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
                        if (r->out.buffer == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -8283,7 +8189,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPRINTERDATAEX: {
                        struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB);
+                       r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
                        if (r->out.buffer == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -8305,14 +8211,13 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPRINTERKEY: {
                        struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.needed = r->in.needed;
-                       r->out.key_buffer_size = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.key_buffer_size == NULL) {
+                       r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->in.key_buffer_size / 2);
+                       if (r->out.key_buffer == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->out.key_buffer_size);
-                       if (r->out.key_buffer == NULL) {
+                       r->out.needed = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.needed == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
@@ -8365,7 +8270,8 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_XCVDATA: {
                        struct spoolss_XcvData *r = (struct spoolss_XcvData *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.out_data = talloc_zero(mem_ctx, DATA_BLOB);
+                       r->out.status_code = r->in.status_code;
+                       r->out.out_data = talloc_zero_array(mem_ctx, uint8_t, r->in.out_data_size);
                        if (r->out.out_data == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -8375,11 +8281,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.unknown2 = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.unknown2 == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-                       }
-
                        r->out.result = _spoolss_XcvData(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
index 1ef0d913b9c429deb9e3163163010427332126ca..c4d8c62ca391c7f79868be392891493c3d3fb64a 100644 (file)
@@ -35,4 +35,10 @@ interface misc
                SEC_CHAN_DOMAIN      = 4,
                SEC_CHAN_BDC         = 6
        } netr_SchannelType;
+
+       typedef [public] struct {
+               NTSTATUS ntstatus;
+               uint32 unknown1;
+               uint32 unknown2; /* 0x00000001 */
+       } KRB5_EDATA_NTSTATUS;
 }
index fbe12ad64e8836c6b3ec944f8603f71df3cf8fbb..09646c9d67e0823cec92ccd3e2baf11fe97ec665 100644 (file)
@@ -117,6 +117,15 @@ import "misc.idl", "security.idl", "winreg.idl";
                PRINTER_ENUM_HIDE        = 0x01000000
        } spoolss_EnumPrinterFlags;
 
+       const int PRINTER_ENUM_ICONMASK = (PRINTER_ENUM_ICON1 |
+                                          PRINTER_ENUM_ICON2 |
+                                          PRINTER_ENUM_ICON3 |
+                                          PRINTER_ENUM_ICON4 |
+                                          PRINTER_ENUM_ICON5 |
+                                          PRINTER_ENUM_ICON6 |
+                                          PRINTER_ENUM_ICON7 |
+                                          PRINTER_ENUM_ICON8); /* 0x00ff0000 */
+
        typedef struct {
                spoolss_EnumPrinterFlags flags;
                [relative] nstring *name;
@@ -258,7 +267,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique] DATA_BLOB *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
        [public,noopnum,noprint] void __spoolss_EnumPrinters(
@@ -276,7 +285,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                 * and the array has no size in front
                 */
                [out,unique,switch_is(level),size_is(count)] spoolss_PrinterInfo *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
 
@@ -351,7 +360,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in]     uint32 offered,
                [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
-               [out]    uint32 needed
+               [out,ref] uint32 *needed
        );
 
        /******************/
@@ -364,7 +373,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in]     uint32 offered,
                [out,unique] DATA_BLOB *info,
-               [out]    uint32 needed,
+               [out,ref] uint32 *needed,
                [out]    uint32 count
        );
        [public,noopnum,noprint] void __spoolss_EnumJobs(
@@ -380,7 +389,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in]     uint32 offered,
                [out,unique,switch_is(level),size_is(count)] spoolss_JobInfo *info,
-               [out]    uint32 needed,
+               [out,ref] uint32 *needed,
                [out]    uint32 count
        );
 
@@ -438,7 +447,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in]     uint32 offered,
                [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
-               [out]    uint32 needed
+               [out,ref] uint32 *needed
        );
 
        /******************/
@@ -544,7 +553,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique] DATA_BLOB *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
        [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
@@ -559,7 +568,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique,switch_is(level),size_is(count)] spoolss_DriverInfo *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
 
@@ -589,13 +598,12 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
-               [out] uint32 needed
+               [out,ref] uint32 *needed
        );
 
        /******************/
        /* Function: 0x0d */
        WERROR spoolss_DeletePrinterDriver(
-               [in,ref] policy_handle *handle,
                [in,unique] [string,charset(UTF16)] uint16 *server,
                [in] [string,charset(UTF16)] uint16 architecture[],
                [in] [string,charset(UTF16)] uint16 driver[]
@@ -603,7 +611,11 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x0e */
-       [todo] WERROR spoolss_AddPrintProcessor(
+       WERROR spoolss_AddPrintProcessor(
+               [in,unique] [string,charset(UTF16)] uint16 *server,
+               [in] [string,charset(UTF16)] uint16 architecture[],
+               [in] [string,charset(UTF16)] uint16 path_name[],
+               [in] [string,charset(UTF16)] uint16 print_processor_name[]
        );
 
        /******************/
@@ -624,7 +636,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique] DATA_BLOB *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
        [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
@@ -639,7 +651,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique,switch_is(level),size_is(count)] spoolss_PrintProcessorInfo *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
 
@@ -667,7 +679,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,ref] policy_handle *handle,
                [in] uint32 level,
                [in,switch_is(level)] spoolss_DocumentInfo info,
-               [out] uint32 job_id
+               [out,ref] uint32 *job_id
        );
 
        /******************/
@@ -682,7 +694,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,ref] policy_handle *handle,
                [in] DATA_BLOB data,
                [in,value(r->in.data.length)] uint32 _data_size,
-               [out] uint32 num_written
+               [out,ref] uint32 *num_written
        );
 
        /******************/
@@ -701,9 +713,9 @@ import "misc.idl", "security.idl", "winreg.idl";
        /* Function: 0x16 */
        WERROR spoolss_ReadPrinter(
                [in,ref] policy_handle *handle,
+               [out,ref] [size_is(data_size)] uint8 *data,
                [in] uint32 data_size,
-               [out] DATA_BLOB data,
-               [out,value(r->out.data.length)] uint32 _data_size
+               [out,ref] uint32 *_data_size
        );
 
        /******************/
@@ -767,9 +779,9 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 value_name[],
                [in]     uint32 offered,
-               [out]    spoolss_PrinterDataType type,
+               [out,ref] spoolss_PrinterDataType *type,
                [out]    DATA_BLOB data,
-               [out]    uint32 needed
+               [out,ref] uint32 *needed
        );
        [noopnum,noprint,public] void __spoolss_GetPrinterData(
                [in] spoolss_PrinterDataType type,
@@ -779,9 +791,9 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 value_name[],
                [in]     uint32 offered,
-               [out]    spoolss_PrinterDataType type,
-               [out,subcontext(4),subcontext_size(offered),switch_is(type)] spoolss_PrinterData data,
-               [out]    uint32 needed
+               [out,ref] spoolss_PrinterDataType *type,
+               [out,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData data,
+               [out,ref] uint32 *needed
        );
 
        /******************/
@@ -881,7 +893,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
-               [out] uint32 needed
+               [out,ref] uint32 *needed
        );
 
        /******************/
@@ -901,7 +913,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in]     uint32 offered,
                [out,unique] DATA_BLOB *info,
-               [out]    uint32 needed,
+               [out,ref] uint32 *needed,
                [out]    uint32 count
        );
        [public,noopnum,noprint] void __spoolss_EnumForms(
@@ -915,7 +927,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in]     uint32 offered,
                [out,unique,switch_is(level),size_is(count)] spoolss_FormInfo *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
 
@@ -953,7 +965,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique] DATA_BLOB *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
        [public,noopnum,noprint] void __spoolss_EnumPorts(
@@ -967,7 +979,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique,switch_is(level),size_is(count)] spoolss_PortInfo *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
 
@@ -995,7 +1007,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique] DATA_BLOB *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
        [public,noopnum,noprint] void __spoolss_EnumMonitors(
@@ -1009,7 +1021,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,unique] DATA_BLOB *buffer,
                [in] uint32 offered,
                [out,unique,switch_is(level),size_is(count)] spoolss_MonitorInfo *info,
-               [out] uint32 needed,
+               [out,ref] uint32 *needed,
                [out] uint32 count
        );
 
@@ -1109,9 +1121,9 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in]     uint32 client_major_version,
                [in]     uint32 client_minor_version,
                [out,unique] DATA_BLOB *info,
-               [out]    uint32 needed,
-               [out]    uint32 server_major_version,
-               [out]    uint32 server_minor_version
+               [out,ref] uint32 *needed,
+               [out,ref] uint32 *server_major_version,
+               [out,ref] uint32 *server_minor_version
        );
 
        /******************/
@@ -1148,7 +1160,65 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x3b */
-       [todo] WERROR spoolss_RouterReplyPrinter(
+
+       typedef [bitmap32bit] bitmap {
+               PRINTER_CHANGE_ADD_PRINTER                      = 0x00000001,
+               PRINTER_CHANGE_SET_PRINTER                      = 0x00000002,
+               PRINTER_CHANGE_DELETE_PRINTER                   = 0x00000004,
+               PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        = 0x00000008,
+               PRINTER_CHANGE_ADD_JOB                          = 0x00000100,
+               PRINTER_CHANGE_SET_JOB                          = 0x00000200,
+               PRINTER_CHANGE_DELETE_JOB                       = 0x00000400,
+               PRINTER_CHANGE_WRITE_JOB                        = 0x00000800,
+               PRINTER_CHANGE_ADD_FORM                         = 0x00010000,
+               PRINTER_CHANGE_SET_FORM                         = 0x00020000,
+               PRINTER_CHANGE_DELETE_FORM                      = 0x00040000,
+               PRINTER_CHANGE_ADD_PORT                         = 0x00100000,
+               PRINTER_CHANGE_CONFIGURE_PORT                   = 0x00200000,
+               PRINTER_CHANGE_DELETE_PORT                      = 0x00400000,
+               PRINTER_CHANGE_ADD_PRINT_PROCESSOR              = 0x01000000,
+               PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           = 0x04000000,
+               PRINTER_CHANGE_ADD_PRINTER_DRIVER               = 0x10000000,
+               PRINTER_CHANGE_SET_PRINTER_DRIVER               = 0x20000000,
+               PRINTER_CHANGE_DELETE_PRINTER_DRIVER            = 0x40000000,
+               PRINTER_CHANGE_TIMEOUT                          = 0x80000000
+       } spoolss_PrinterChangeFlags;
+
+       const int PRINTER_CHANGE_PRINTER                        = (PRINTER_CHANGE_ADD_PRINTER |
+                                                                  PRINTER_CHANGE_SET_PRINTER |
+                                                                  PRINTER_CHANGE_DELETE_PRINTER |
+                                                                  PRINTER_CHANGE_FAILED_CONNECTION_PRINTER); /* 0x000000FF */
+
+       const int PRINTER_CHANGE_JOB                            = (PRINTER_CHANGE_ADD_JOB |
+                                                                  PRINTER_CHANGE_SET_JOB |
+                                                                  PRINTER_CHANGE_DELETE_JOB |
+                                                                  PRINTER_CHANGE_WRITE_JOB); /* 0x0000FF00 */
+
+       const int PRINTER_CHANGE_FORM                           = (PRINTER_CHANGE_ADD_FORM |
+                                                                  PRINTER_CHANGE_SET_FORM |
+                                                                  PRINTER_CHANGE_DELETE_FORM); /* 0x00070000 */
+
+       const int PRINTER_CHANGE_PORT                           = (PRINTER_CHANGE_ADD_PORT |
+                                                                  PRINTER_CHANGE_CONFIGURE_PORT |
+                                                                  PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */
+
+       const int PRINTER_CHANGE_PRINT_PROCESSOR                = (PRINTER_CHANGE_ADD_PRINT_PROCESSOR |
+                                                                  PRINTER_CHANGE_DELETE_PRINT_PROCESSOR); /* 0x07000000 */
+
+       const int PRINTER_CHANGE_PRINTER_DRIVER                 = (PRINTER_CHANGE_ADD_PRINTER_DRIVER |
+                                                                  PRINTER_CHANGE_SET_PRINTER_DRIVER |
+                                                                  PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */
+
+       const int PRINTER_CHANGE_ALL                            = (PRINTER_CHANGE_JOB |
+                                                                  PRINTER_CHANGE_FORM |
+                                                                  PRINTER_CHANGE_PORT |
+                                                                  PRINTER_CHANGE_PRINT_PROCESSOR |
+                                                                  PRINTER_CHANGE_PRINTER_DRIVER); /* 0x7777FFFF */
+       WERROR spoolss_RouterReplyPrinter(
+               [in,ref] policy_handle *handle,
+               [in] spoolss_PrinterChangeFlags flags,
+               [in,range(0,512)] uint32 bufsize,
+               [in,unique,size_is(bufsize)] uint8 *buffer
        );
 
        /******************/
@@ -1456,10 +1526,10 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 key_name[],
                [in]     [string,charset(UTF16)] uint16 value_name[],
+               [out,ref] uint32 *type,
+               [out,ref] [size_is(offered)] uint8 *buffer,
                [in]     uint32 offered,
-               [out]    uint32 type,
-               [out]    DATA_BLOB buffer,
-               [out]    uint32 needed
+               [out,ref] uint32 *needed
        );
 
        /******************/
@@ -1467,10 +1537,10 @@ import "misc.idl", "security.idl", "winreg.idl";
        [public] WERROR spoolss_EnumPrinterDataEx(
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 key_name[],
+               [out,ref] [size_is(offered)] uint8 *buffer,
                [in]     uint32 offered,
-               [out]    DATA_BLOB buffer,
-               [out]    uint32 needed,
-               [out]    uint32 count
+               [out,ref] uint32 *needed,
+               [out,ref] uint32 *count
        );
 
        /******************/
@@ -1478,9 +1548,9 @@ import "misc.idl", "security.idl", "winreg.idl";
        [public] WERROR spoolss_EnumPrinterKey(
                [in, ref] policy_handle *handle,
                [in] [string,charset(UTF16)] uint16 key_name[],
-               [out] uint32 key_buffer_size,
-               [out] uint16 key_buffer[key_buffer_size],
-               [in,out] uint32 needed
+               [out,ref] [size_is(key_buffer_size/2)] uint16 *key_buffer,
+               [in] uint32 key_buffer_size,
+               [out,ref] uint32 *needed
        );
 
        /******************/
@@ -1493,7 +1563,9 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x52 */
-       [todo] WERROR spoolss_DeletePrinterKey(
+       WERROR spoolss_DeletePrinterKey(
+               [in,ref] policy_handle *handle,
+               [in] [string,charset(UTF16)] uint16 key_name[]
        );
 
        /******************/
@@ -1503,7 +1575,18 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x54 */
-       [todo] WERROR spoolss_DeletePrinterDriverEx(
+       typedef [public,bitmap32bit] bitmap {
+               DPD_DELETE_UNUSED_FILES         = 0x00000001,
+               DPD_DELETE_SPECIFIC_VERSION     = 0x00000002,
+               DPD_DELETE_ALL_FILES            = 0x00000004
+       } spoolss_DeleteDriverFlags;
+
+       WERROR spoolss_DeletePrinterDriverEx(
+               [in,unique] [string,charset(UTF16)] uint16 *server,
+               [in] [string,charset(UTF16)] uint16 architecture[],
+               [in] [string,charset(UTF16)] uint16 driver[],
+               [in] spoolss_DeleteDriverFlags delete_flags,
+               [in] uint32 version
        );
 
        /******************/
@@ -1528,11 +1611,10 @@ import "misc.idl", "security.idl", "winreg.idl";
                [in] [string,charset(UTF16)] uint16 function_name[],
                [in] DATA_BLOB in_data,
                [in,value(r->in.in_data.length)] uint32 _in_data_length,
-               [in] uint32 offered,
-               [in] uint32 unknown1,
-               [out] DATA_BLOB out_data,
-               [out] uint32 needed,
-               [out] uint32 unknown2
+               [out,ref] [size_is(out_data_size)] uint8 *out_data,
+               [in] uint32 out_data_size,
+               [out,ref] uint32 *needed,
+               [in,out,ref] uint32 *status_code
        );
 
        /******************/
index 1cb1df3fd50334359490c0ea135e1c9c5c550e2a..0ab017e0842de11993bca9d855c0a73011ded095 100644 (file)
                                "SPOOLSS Buffer: offered[%u] doesn't match length of buffer[%u]",\
                                (unsigned)r->in.offered, (unsigned)_ndr_info->data_size);\
                }\
-               if (r->out.needed <= _ndr_info->data_size) {\
+               if (*r->out.needed <= _ndr_info->data_size) {\
                        struct __##fn __r;\
                        __r.in.level    = r->in.level;\
                        __r.in.count    = r->out.count;\
@@ -421,7 +421,7 @@ enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flag
                        _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
                        NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
                        _ndr_info->flags= ndr->flags;
-                       __r.in.type     = r->out.type;
+                       __r.in.type     = *r->out.type;
                        __r.out.data    = r->out.data;
                        NDR_CHECK(ndr_push___spoolss_GetPrinterData(_ndr_info, flags, &__r));
                        if (r->in.offered > _ndr_info->offset) {
@@ -471,17 +471,17 @@ enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flag
                                "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]",
                                (unsigned)r->in.offered, (unsigned)_r.out.data.length);
                }
-               if (_r.out.data.length > 0 && r->out.needed <= _r.out.data.length) {
+               if (_r.out.data.length > 0 && *r->out.needed <= _r.out.data.length) {
                        struct __spoolss_GetPrinterData __r;
                        struct ndr_pull *_ndr_data = ndr_pull_init_blob(&_r.out.data, ndr, ndr->iconv_convenience);
                        NDR_ERR_HAVE_NO_MEMORY(_ndr_data);
                        _ndr_data->flags= ndr->flags;
-                       __r.in.type     = r->out.type;
+                       __r.in.type     = *r->out.type;
                        __r.out.data    = r->out.data;
                        NDR_CHECK(ndr_pull___spoolss_GetPrinterData(_ndr_data, flags, &__r));
                        r->out.data     = __r.out.data;
                } else {
-                       r->out.type     = SPOOLSS_PRINTER_DATA_TYPE_NULL;
+                       *r->out.type    = SPOOLSS_PRINTER_DATA_TYPE_NULL;
                }
        }
        return NDR_ERR_SUCCESS;
index 1a0eb51438e373b1aeca05e1783cbd4741bc40f3..ed1b71a236f7767405900d99099af5ecf573ef13 100644 (file)
@@ -97,7 +97,11 @@ sub ParseOutputArgument($$$)
                # to allocate a structure of the right size.
                my $env = GenerateFunctionInEnv($fn, "r.");
                my $size_is = ParseExpr($e->{LEVELS}[$level]->{SIZE_IS}, $env, $e->{ORIGINAL});
-               $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+               if (has_property($e, "charset")) {
+                   $self->pidl("memcpy(CONST_DISCARD(char *, $e->{NAME}), r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+               } else {
+                   $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+               }
        } else {
                $self->pidl("*$e->{NAME} = *r.out.$e->{NAME};");
        }
index 33dc68e753f242b9bce9650f0506db5b60016ae0..c9a8eea59fd146f17192da43a68e4b3b9440383d 100644 (file)
@@ -58,14 +58,17 @@ sub AllocOutVar($$$$$)
        if ($l->{TYPE} eq "POINTER") {
                my $nl = GetNextLevel($e, $l);
                $l = $nl if ($nl->{TYPE} eq "ARRAY");
-       }
+       } elsif
 
        # we don't support multi-dimentional arrays yet
-       if ($l->{TYPE} eq "ARRAY") {
+       ($l->{TYPE} eq "ARRAY") {
                my $nl = GetNextLevel($e, $l);
                if ($nl->{TYPE} eq "ARRAY") {
                        fatal($e->{ORIGINAL},"multi-dimentional [out] arrays are not supported!");
                }
+       } else {
+               # neither pointer nor array, no need to alloc something.
+               return;
        }
 
        if ($l->{TYPE} eq "ARRAY") {
index 8e8932bc5f0ad497deb6d6c03d68c1075f5a9544..ee75eb30e6b5b1ffda0a806e6369592d98b2ed48 100644 (file)
@@ -308,7 +308,8 @@ LIBNDR_GEN_OBJ = ../librpc/gen_ndr/ndr_wkssvc.o \
                 ../librpc/gen_ndr/ndr_xattr.o \
                 ../librpc/gen_ndr/ndr_epmapper.o \
                 ../librpc/gen_ndr/ndr_named_pipe_auth.o \
-                ../librpc/gen_ndr/ndr_ntsvcs.o
+                ../librpc/gen_ndr/ndr_ntsvcs.o \
+                $(LIBNDR_GEN_OBJ2)
 
 RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
 
@@ -481,6 +482,7 @@ LIBMSRPC_GEN_OBJ = ../librpc/gen_ndr/cli_lsa.o \
                   ../librpc/gen_ndr/cli_ntsvcs.o \
                   ../librpc/gen_ndr/cli_epmapper.o \
                   ../librpc/gen_ndr/cli_drsuapi.o \
+                  ../librpc/gen_ndr/cli_spoolss.o \
                   $(LIBNDR_GEN_OBJ) \
                   $(RPCCLIENT_NDR_OBJ)
 
@@ -567,7 +569,8 @@ RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs_nt.o \
 
 RPC_DFS_OBJ =  ../librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o
 
-RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o
+RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o \
+                 ../librpc/gen_ndr/srv_spoolss.o
 
 RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog_nt.o \
                   $(LIB_EVENTLOG_OBJ) ../librpc/gen_ndr/srv_eventlog.o
@@ -941,6 +944,7 @@ SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/uta
 SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \
        $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
        lib/wb_reqtrans.o lib/wbclient.o \
+       @LIBWBCLIENT_STATIC@ \
        $(LIBNDR_GEN_OBJ0)
 
 MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
@@ -1464,11 +1468,11 @@ bin/nmblookup@EXEEXT@: $(BINARY_PREREQS) $(NMBLOOKUP_OBJ) @BUILD_POPT@ @LIBTALLO
        @$(CC) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
                $(POPT_LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
-bin/smbtorture@EXEEXT@: $(BINARY_PREREQS) $(SMBTORTURE_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
+bin/smbtorture@EXEEXT@: $(BINARY_PREREQS) $(SMBTORTURE_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) \
                $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) \
-               $(LIBTDB_LIBS) $(ZLIB_LIBS)
+               $(LIBTDB_LIBS) $(ZLIB_LIBS) $(WINBIND_LIBS)
 
 bin/talloctort@EXEEXT@: $(BINARY_PREREQS) $(TALLOCTORT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
@@ -2253,7 +2257,7 @@ bin/librpc_dssetup.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_DSSETUP_OBJ)
        @echo "Linking $@"
        @$(SHLD_MODULE) $(RPC_DSSETUP_OBJ)
 
-bin/librpc_spoolss.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SPOOLSS_OBJ)
+bin/librpc_spoolss2.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SPOOLSS_OBJ)
        @echo "Linking $@"
        @$(SHLD_MODULE) $(RPC_SPOOLSS_OBJ)
 
index 9f4d1d3fd06abc558fed15d959af6cfe4f0334d2..a73660958055f72559c2edcb32a8ff44cd0ca95c 100644 (file)
@@ -85,6 +85,7 @@
 
 const char *thisprogram;
 int verboseflag = 0;
+int fakemnt = 0;
 static int got_password = 0;
 static int got_user = 0;
 static int got_domain = 0;
@@ -1030,7 +1031,7 @@ int main(int argc, char ** argv)
        char * resolved_path = NULL;
        char * temp;
        char * dev_name;
-       int rc;
+       int rc = 0;
        int rsize = 0;
        int wsize = 0;
        int nomtab = 0;
@@ -1103,8 +1104,8 @@ int main(int argc, char ** argv)
                        mount_cifs_usage ();
                        exit(EX_USAGE);
                case 'n':
-                   ++nomtab;
-                   break;
+                       ++nomtab;
+                       break;
                case 'b':
 #ifdef MS_BIND
                        flags |= MS_BIND;
@@ -1209,6 +1210,9 @@ int main(int argc, char ** argv)
                        break;
                case 't':
                        break;
+               case 'f':
+                       ++fakemnt;
+                       break;
                default:
                        printf("unknown mount option %c\n",c);
                        mount_cifs_usage();
@@ -1410,7 +1414,7 @@ mount_retry:
                }
        }
 
-       if (mount(dev_name, mountpoint, "cifs", flags, options)) {
+       if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
                switch (errno) {
                case ECONNREFUSED:
                case EHOSTUNREACH:
@@ -1440,6 +1444,8 @@ mount_retry:
                goto mount_exit;
        }
 
+       if (nomtab)
+               goto mount_exit;
        atexit(unlock_mtab);
        rc = lock_mtab();
        if (rc) {
index aff7cea39746b34f04196a954c0b4fd29a109dad..81925eda27544713ec1e515414b0af75db420cbd 100644 (file)
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <string.h>
 #include <mntent.h>
+#include <limits.h>
 #include "mount.h"
 
 #define UNMOUNT_CIFS_VERSION_MAJOR "0"
@@ -231,6 +232,37 @@ static int remove_from_mtab(char * mountpoint)
        return rc;
 }
 
+/* Make a canonical pathname from PATH.  Returns a freshly malloced string.
+   It is up the *caller* to ensure that the PATH is sensible.  i.e.
+   canonicalize ("/dev/fd0/.") returns "/dev/fd0" even though ``/dev/fd0/.''
+   is not a legal pathname for ``/dev/fd0''  Anything we cannot parse
+   we return unmodified.   */
+static char *
+canonicalize(char *path)
+{
+       char *canonical = malloc (PATH_MAX + 1);
+
+       if (!canonical) {
+               fprintf(stderr, "Error! Not enough memory!\n");
+               return NULL;
+       }
+
+       if (strlen(path) > PATH_MAX) {
+               fprintf(stderr, "Mount point string too long\n");
+               return NULL;
+       }
+
+       if (path == NULL)
+               return NULL;
+
+       if (realpath (path, canonical))
+               return canonical;
+
+       strncpy (canonical, path, PATH_MAX);
+       canonical[PATH_MAX] = '\0';
+       return canonical;
+}
+
 int main(int argc, char ** argv)
 {
        int c;
@@ -304,7 +336,7 @@ int main(int argc, char ** argv)
        argv += optind;
        argc -= optind;
 
-       mountpoint = argv[0];
+       mountpoint = canonicalize(argv[0]);
 
        if((argc < 1) || (argv[0] == NULL)) {
                printf("\nMissing name of unmount directory\n");
index 306566f26e52c4e7f3b3de859f929000906290aa..37ee9a131f92928ff98d3a73ad3ec92e023e9b5d 100644 (file)
@@ -414,7 +414,7 @@ AC_SUBST(DYNEXP)
 
 dnl Add modules that have to be built by default here
 dnl These have to be built static:
-default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
+default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss2 rpc_eventlog auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
 
 dnl These are preferably build shared, and static if dlopen() is not available
 default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy vfs_shadow_copy2 charset_CP850 charset_CP437 auth_script vfs_readahead vfs_xattr_tdb vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb vfs_smb_traffic_analyzer"
@@ -1042,6 +1042,7 @@ AC_CHECK_FUNCS(setenv strcasecmp fcvt fcvtl)
 AC_CHECK_FUNCS(syslog vsyslog timegm)
 AC_CHECK_FUNCS(setlocale nl_langinfo)
 AC_CHECK_FUNCS(nanosleep)
+AC_CHECK_LIB_EXT(rt, LIBS, nanosleep)
 AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
 AC_CHECK_FUNCS(memalign posix_memalign hstrerror)
 AC_CHECK_HEADERS(sys/mman.h)
@@ -6296,7 +6297,7 @@ do
 done
 
 dnl Always build these modules static
-MODULE_rpc_spoolss=STATIC
+MODULE_rpc_spoolss2=STATIC
 MODULE_rpc_srvsvc=STATIC
 MODULE_idmap_tdb=STATIC
 MODULE_idmap_passdb=STATIC
@@ -6339,7 +6340,7 @@ SMB_MODULE(rpc_ntsvcs, \$(RPC_NTSVCS_OBJ), "bin/librpc_ntsvcs.$SHLIBEXT", RPC)
 SMB_MODULE(rpc_netlogon, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
 SMB_MODULE(rpc_netdfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC)
 SMB_MODULE(rpc_srvsvc, \$(RPC_SVC_OBJ), "bin/librpc_svcsvc.$SHLIBEXT", RPC)
-SMB_MODULE(rpc_spoolss, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss.$SHLIBEXT", RPC)
+SMB_MODULE(rpc_spoolss2, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss2.$SHLIBEXT", RPC)
 SMB_MODULE(rpc_eventlog, \$(RPC_EVENTLOG_OBJ), "bin/librpc_eventlog.$SHLIBEXT", RPC)
 SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
 SMB_MODULE(rpc_rpcecho, \$(RPC_ECHO_OBJ), "bin/librpc_rpcecho.$SHLIBEXT", RPC)
index af99b86c4501f06471f062db700943c8557e2658..a162c194d6e353264d1cd53effed393f7442c941 100644 (file)
@@ -217,24 +217,26 @@ static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
        int ret;
        struct ldb_dn *dn;
        struct ldb_result *res=NULL;
-       
-       dn = mapping_dn(ldb, &sid);
-       if (dn == NULL) goto failed;
+       bool result = false;
 
-       ret = ldb_search(ldb, ldb, &res, dn, LDB_SCOPE_BASE, NULL, NULL);
-       talloc_steal(dn, res);
-       if (ret != LDB_SUCCESS || res->count != 1) {
+       dn = mapping_dn(talloc_tos(), &sid);
+       if (dn == NULL) {
                goto failed;
        }
 
-       if (!msg_to_group_map(res->msgs[0], map)) goto failed;
+       ret = ldb_search(ldb, dn, &res, dn, LDB_SCOPE_BASE, NULL, NULL);
+       if (ret != LDB_SUCCESS || res->count != 1) {
+               goto failed;
+       }
 
-       talloc_free(dn);
-       return True;
+       if (!msg_to_group_map(res->msgs[0], map)) {
+               goto failed;
+       }
 
-failed:
+       result = true;
+ failed:
        talloc_free(dn);
-       return False;
+       return result;
 }
 
 /*
@@ -244,16 +246,23 @@ static bool get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
 {
        int ret;
        struct ldb_result *res=NULL;
+       bool result = false;
 
-       ret = ldb_search(ldb, ldb, &res, NULL, LDB_SCOPE_SUBTREE, NULL, "(&(gidNumber=%u)(objectClass=groupMap))", (unsigned)gid);
-       if (ret != LDB_SUCCESS || res->count != 1) goto failed;
-       
-       if (!msg_to_group_map(res->msgs[0], map)) goto failed;
+       ret = ldb_search(ldb, talloc_tos(), &res, NULL, LDB_SCOPE_SUBTREE,
+                        NULL, "(&(gidNumber=%u)(objectClass=groupMap))",
+                        (unsigned)gid);
+       if (ret != LDB_SUCCESS || res->count != 1) {
+               goto failed;
+       }
 
-       return True;
+       if (!msg_to_group_map(res->msgs[0], map)) {
+               goto failed;
+       }
 
+       result = true;
 failed:
-       return False;
+       TALLOC_FREE(res);
+       return result;
 }
 
 /*
@@ -263,16 +272,22 @@ static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map)
 {
        int ret;
        struct ldb_result *res=NULL;
+       bool result = false;
 
-       ret = ldb_search(ldb, ldb, &res, NULL, LDB_SCOPE_SUBTREE, NULL, "(&(ntName=%s)(objectClass=groupMap))", name);
-       if (ret != LDB_SUCCESS || res->count != 1) goto failed;
-       
-       if (!msg_to_group_map(res->msgs[0], map)) goto failed;
+       ret = ldb_search(ldb, talloc_tos(), &res, NULL, LDB_SCOPE_SUBTREE,
+                        NULL, "(&(ntName=%s)(objectClass=groupMap))", name);
+       if (ret != LDB_SUCCESS || res->count != 1) {
+               goto failed;
+       }
 
-       return True;
+       if (!msg_to_group_map(res->msgs[0], map)) {
+               goto failed;
+       }
 
-failed:
-       return False;
+       result = true;
+ failed:
+       TALLOC_FREE(res);
+       return result;
 }
 
 /*
@@ -318,15 +333,14 @@ static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_
        }
 
        if (sid_name_use == SID_NAME_UNKNOWN) {
-               ret = ldb_search(ldb, ldb, &res, basedn, LDB_SCOPE_SUBTREE, NULL, 
-                                                "(&(objectClass=groupMap))");
+               ret = ldb_search(ldb, tmp_ctx, &res, basedn, LDB_SCOPE_SUBTREE,
+                                NULL, "(&(objectClass=groupMap))");
        } else {
-               ret = ldb_search(ldb, ldb, &res, basedn, LDB_SCOPE_SUBTREE, NULL, 
-                                                "(&(sidNameUse=%u)(objectClass=groupMap))",
-                                                sid_name_use);
+               ret = ldb_search(ldb, tmp_ctx, &res, basedn, LDB_SCOPE_SUBTREE,
+                                NULL, "(&(sidNameUse=%u)(objectClass=groupMap))",
+                                sid_name_use);
        }
 
-       talloc_steal(tmp_ctx, res);
        if (ret != LDB_SUCCESS) goto failed;
 
        (*pp_rmap) = NULL;
@@ -367,14 +381,17 @@ static NTSTATUS one_alias_membership(const DOM_SID *member,
        int ret, i;
        struct ldb_result *res=NULL;
        fstring string_sid;
-       NTSTATUS status = NT_STATUS_INTERNAL_DB_CORRUPTION;
+       NTSTATUS status;
 
        if (!sid_to_fstring(string_sid, member)) {
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       ret = ldb_search(ldb, ldb, &res, NULL, LDB_SCOPE_SUBTREE, attrs, "(&(member=%s)(objectClass=groupMap))", string_sid);
+       ret = ldb_search(ldb, talloc_tos(), &res, NULL, LDB_SCOPE_SUBTREE,
+                        attrs, "(&(member=%s)(objectClass=groupMap))",
+                        string_sid);
        if (ret != LDB_SUCCESS) {
+               status = NT_STATUS_INTERNAL_DB_CORRUPTION;
                goto failed;
        }
 
@@ -392,9 +409,9 @@ static NTSTATUS one_alias_membership(const DOM_SID *member,
                }
        }
 
-       return NT_STATUS_OK;
-
-failed:
+       status = NT_STATUS_OK;
+ failed:
+       TALLOC_FREE(res);
        return status;
 }
 
index abff9eaa8c7268a88d4a078ebb46dfa29cc9cfac..0fa19b55a6a628a31ea0792933fcf072ff10e041 100644 (file)
@@ -363,12 +363,6 @@ typedef void **ADS_MODLIST;
 #endif
 
 #ifdef HAVE_KRB5
-typedef struct {
-       NTSTATUS ntstatus;
-       uint32 unknown1;
-       uint32 unknown2; /* 0x00000001 */
-} KRB5_EDATA_NTSTATUS;
-
 typedef struct {
 #if defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) /* MIT */
        krb5_address **addrs;
index 2d6a35839165fc07026763cf62ff194179869ee4..0eff9bdbace72cdf9df955c7d1f2040801f0aa60 100644 (file)
@@ -70,13 +70,10 @@ typedef struct _output_data {
        uint32 data_sent_length;
 
        /*
-        * The current PDU being returned. This inclues
+        * The current fragment being returned. This inclues
         * headers, data and authentication footer.
         */
-       unsigned char current_pdu[RPC_MAX_PDU_FRAG_LEN];
-
-       /* The amount of data in the current_pdu buffer. */
-       uint32 current_pdu_len;
+       prs_struct frag;
 
        /* The amount of data sent from the current PDU. */
        uint32 current_pdu_sent;
@@ -89,7 +86,7 @@ typedef struct _input_data {
         * pdu is seen, then the data is copied into the in_data
         * structure. The maximum size of this is 0x1630 (RPC_MAX_PDU_FRAG_LEN).
         */
-       unsigned char current_in_pdu[RPC_MAX_PDU_FRAG_LEN];
+       uint8_t *current_in_pdu;
 
        /*
         * The amount of data needed to complete the in_pdu.
index 267ee7448251f31d0a76106e30fa3bc209b9b9d9..5009e6dcdb2345cd4c20ee9e2cac9c59cb5a2dde 100644 (file)
@@ -2267,6 +2267,7 @@ ADS_STATUS gp_get_machine_token(ADS_STRUCT *ads,
 #include "librpc/gen_ndr/srv_svcctl.h"
 #include "librpc/gen_ndr/srv_winreg.h"
 #include "librpc/gen_ndr/srv_wkssvc.h"
+#include "librpc/gen_ndr/srv_spoolss.h"
 
 #include "librpc/ndr/libndr.h"
 
@@ -4787,11 +4788,12 @@ uint32 update_c_setprinter(bool initialize);
 uint32 get_c_setprinter(void);
 int get_builtin_ntforms(nt_forms_struct **list);
 bool get_a_builtin_ntform(UNISTR2 *uni_formname,nt_forms_struct *form);
+bool get_a_builtin_ntform_by_string(const char *form_name, nt_forms_struct *form);
 int get_ntforms(nt_forms_struct **list);
 int write_ntforms(nt_forms_struct **list, int number);
-bool add_a_form(nt_forms_struct **list, const FORM *form, int *count);
-bool delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR *ret);
-void update_a_form(nt_forms_struct **list, const FORM *form, int count);
+bool add_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int *count);
+bool delete_a_form(nt_forms_struct **list, const char *del_name, int *count, WERROR *ret);
+void update_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int count);
 int get_ntdrivers(fstring **list, const char *architecture, uint32 version);
 const char *get_short_archi(const char *long_archi);
 WERROR clean_up_driver_struct(struct pipes_struct *rpc_pipe,
@@ -5427,8 +5429,6 @@ NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,