summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs-xml/manpages-3/mount.cifs.8.xml4
-rw-r--r--docs-xml/smbdotconf/ldap/ldapssl.xml15
-rw-r--r--docs-xml/smbdotconf/ldap/ldapsslads.xml21
-rw-r--r--examples/VFS/Makefile.in12
-rw-r--r--examples/VFS/configure.in8
-rw-r--r--examples/VFS/skel_opaque.c6
-rw-r--r--examples/VFS/skel_transparent.c6
-rw-r--r--lib/async_req/async_sock.c124
-rw-r--r--lib/async_req/async_sock.h9
-rw-r--r--librpc/gen_ndr/cli_spoolss.c172
-rw-r--r--librpc/gen_ndr/cli_spoolss.h85
-rw-r--r--librpc/gen_ndr/misc.h6
-rw-r--r--librpc/gen_ndr/ndr_misc.c36
-rw-r--r--librpc/gen_ndr/ndr_misc.h3
-rw-r--r--librpc/gen_ndr/ndr_spoolss.c1014
-rw-r--r--librpc/gen_ndr/ndr_spoolss.h4
-rw-r--r--librpc/gen_ndr/spoolss.h152
-rw-r--r--librpc/gen_ndr/srv_spoolss.c135
-rw-r--r--librpc/idl/misc.idl6
-rw-r--r--librpc/idl/spoolss.idl180
-rw-r--r--librpc/ndr/ndr_spoolss_buf.c10
-rw-r--r--pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm6
-rw-r--r--pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm7
-rw-r--r--source3/Makefile.in14
-rw-r--r--source3/client/mount.cifs.c14
-rw-r--r--source3/client/umount.cifs.c34
-rw-r--r--source3/configure.in7
-rw-r--r--source3/groupdb/mapping_ldb.c87
-rw-r--r--source3/include/ads.h6
-rw-r--r--source3/include/ntdomain.h9
-rw-r--r--source3/include/proto.h144
-rw-r--r--source3/include/rpc_client.h1
-rw-r--r--source3/include/rpc_spoolss.h297
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/include/wbc_async.h68
-rw-r--r--source3/lib/netapi/examples/server/server_getinfo.c16
-rw-r--r--source3/lib/netapi/netapi.h612
-rw-r--r--source3/lib/netapi/serverinfo.c272
-rw-r--r--source3/lib/netapi/tests/Makefile.in2
-rw-r--r--source3/lib/netapi/tests/common.h2
-rw-r--r--source3/lib/netapi/tests/netapitest.c5
-rw-r--r--source3/lib/netapi/tests/netserver.c61
-rw-r--r--source3/lib/util_sock.c18
-rw-r--r--source3/lib/wb_reqtrans.c181
-rw-r--r--source3/lib/wbclient.c138
-rw-r--r--source3/libads/kerberos.c42
-rw-r--r--source3/libads/ldap_printer.c2
-rw-r--r--source3/librpc/gen_ndr/libnetapi.h613
-rw-r--r--source3/librpc/gen_ndr/ndr_libnetapi.c3621
-rw-r--r--source3/librpc/gen_ndr/ndr_libnetapi.h297
-rw-r--r--source3/librpc/idl/libnetapi.idl613
-rw-r--r--source3/libsmb/libsmb_xattr.c11
-rw-r--r--source3/modules/onefs.h58
-rw-r--r--source3/modules/onefs_streams.c84
-rw-r--r--source3/modules/vfs_onefs.c114
-rw-r--r--source3/passdb/pdb_get_set.c82
-rw-r--r--source3/printing/nt_printing.c716
-rw-r--r--source3/rpc_client/cli_spoolss.c397
-rw-r--r--source3/rpc_parse/parse_prs.c17
-rw-r--r--source3/rpc_parse/parse_spoolss.c1001
-rw-r--r--source3/rpc_server/srv_eventlog_lib.c6
-rw-r--r--source3/rpc_server/srv_pipe.c211
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c54
-rw-r--r--source3/rpc_server/srv_samr_nt.c2
-rw-r--r--source3/rpc_server/srv_spoolss.c423
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c1264
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c2
-rw-r--r--source3/rpcclient/cmd_spoolss.c580
-rw-r--r--source3/smbd/lanman.c112
-rw-r--r--source3/smbd/posix_acls.c12
-rw-r--r--source3/smbd/process.c2
-rw-r--r--source3/torture/torture.c7
-rw-r--r--source3/utils/net_conf.c6
-rw-r--r--source3/utils/net_rpc_printer.c78
-rw-r--r--source3/winbindd/idmap_tdb.c91
-rw-r--r--source3/winbindd/idmap_tdb2.c90
-rw-r--r--source3/winbindd/winbindd_proto.h21
-rw-r--r--source3/winbindd/winbindd_user.c7
-rw-r--r--source4/Makefile2
-rw-r--r--source4/auth/credentials/pycredentials.c49
-rw-r--r--source4/auth/credentials/pycredentials.h2
-rw-r--r--source4/auth/ntlm/auth.c2
-rw-r--r--source4/auth/pyauth.h2
-rw-r--r--source4/lib/ldb/pyldb.c137
-rw-r--r--source4/lib/registry/patchfile_preg.c14
-rw-r--r--source4/lib/registry/pyregistry.c30
-rw-r--r--source4/lib/registry/regf.c2
-rw-r--r--source4/libcli/smb2/request.c2
-rw-r--r--source4/librpc/config.mk4
-rw-r--r--source4/librpc/rpc/pyrpc.c8
-rw-r--r--source4/ntptr/simple_ldb/ntptr_simple_ldb.c26
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c2
-rw-r--r--source4/ntvfs/posix/pvfs_aio.c2
-rw-r--r--source4/ntvfs/posix/pvfs_flush.c3
-rw-r--r--source4/ntvfs/posix/pvfs_fsinfo.c3
-rw-r--r--source4/ntvfs/posix/pvfs_ioctl.c3
-rw-r--r--source4/ntvfs/posix/pvfs_lock.c6
-rw-r--r--source4/ntvfs/posix/pvfs_mkdir.c6
-rw-r--r--source4/ntvfs/posix/pvfs_open.c24
-rw-r--r--source4/ntvfs/posix/pvfs_oplock.c3
-rw-r--r--source4/ntvfs/posix/pvfs_qfileinfo.c6
-rw-r--r--source4/ntvfs/posix/pvfs_read.c3
-rw-r--r--source4/ntvfs/posix/pvfs_rename.c19
-rw-r--r--source4/ntvfs/posix/pvfs_resolve.c4
-rw-r--r--source4/ntvfs/posix/pvfs_search.c52
-rw-r--r--source4/ntvfs/posix/pvfs_seek.c3
-rw-r--r--source4/ntvfs/posix/pvfs_setfileinfo.c9
-rw-r--r--source4/ntvfs/posix/pvfs_unlink.c6
-rw-r--r--source4/ntvfs/posix/pvfs_util.c2
-rw-r--r--source4/ntvfs/posix/pvfs_wait.c6
-rw-r--r--source4/ntvfs/posix/pvfs_write.c3
-rw-r--r--source4/ntvfs/posix/vfs_posix.c3
-rw-r--r--source4/param/pyparam.c30
-rw-r--r--source4/rpc_server/spoolss/dcesrv_spoolss.c23
-rw-r--r--source4/selftest/skip1
-rw-r--r--source4/torture/ldap/uptodatevector.c1
-rw-r--r--source4/torture/rpc/samba3rpc.c12
-rw-r--r--source4/torture/rpc/spoolss.c118
-rw-r--r--source4/torture/rpc/spoolss_win.c47
-rwxr-xr-xtestprogs/win32/npecho/GNUmakefile23
-rwxr-xr-xtestprogs/win32/npecho/NMakefile12
-rwxr-xr-xtestprogs/win32/npecho/npecho_client2.c117
-rwxr-xr-xtestprogs/win32/npecho/npecho_server2.c76
123 files changed, 11161 insertions, 4393 deletions
diff --git a/docs-xml/manpages-3/mount.cifs.8.xml b/docs-xml/manpages-3/mount.cifs.8.xml
index 00711e0de0..c386592f1d 100644
--- a/docs-xml/manpages-3/mount.cifs.8.xml
+++ b/docs-xml/manpages-3/mount.cifs.8.xml
@@ -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>
diff --git a/docs-xml/smbdotconf/ldap/ldapssl.xml b/docs-xml/smbdotconf/ldap/ldapssl.xml
index b2e953736b..fa7fea94d0 100644
--- a/docs-xml/smbdotconf/ldap/ldapssl.xml
+++ b/docs-xml/smbdotconf/ldap/ldapssl.xml
@@ -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
@@ -32,6 +32,17 @@
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
index 0000000000..e6998cbaf2
--- /dev/null
+++ b/docs-xml/smbdotconf/ldap/ldapsslads.xml
@@ -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>
diff --git a/examples/VFS/Makefile.in b/examples/VFS/Makefile.in
index 4de0efd29e..8fe414a9e8 100644
--- a/examples/VFS/Makefile.in
+++ b/examples/VFS/Makefile.in
@@ -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.
diff --git a/examples/VFS/configure.in b/examples/VFS/configure.in
index b8e10d482b..4e9d46544d 100644
--- a/examples/VFS/configure.in
+++ b/examples/VFS/configure.in
@@ -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
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 48b497922a..2eb7a94776 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -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);
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index f5562a5f44..5670965417 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -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);
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index b992320669..46ad29d053 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -95,6 +95,55 @@ struct async_syscall_state {
};
/**
+ * @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
* @param[in] ev The event context to work from
@@ -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;
}
diff --git a/lib/async_req/async_sock.h b/lib/async_req/async_sock.h
index fd41acacbb..c8739e9ed6 100644
--- a/lib/async_req/async_sock.h
+++ b/lib/async_req/async_sock.h
@@ -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
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index 1071f2a3a8..18086843ca 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -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) {
diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h
index ba7de89413..516c2c069d 100644
--- a/librpc/gen_ndr/cli_spoolss.h
+++ b/librpc/gen_ndr/cli_spoolss.h
@@ -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,
diff --git a/librpc/gen_ndr/misc.h b/librpc/gen_ndr/misc.h
index de4abdcae5..e000cb0624 100644
--- a/librpc/gen_ndr/misc.h
+++ b/librpc/gen_ndr/misc.h
@@ -42,4 +42,10 @@ enum netr_SchannelType
#endif
;
+struct KRB5_EDATA_NTSTATUS {
+ NTSTATUS ntstatus;
+ uint32_t unknown1;
+ uint32_t unknown2;
+}/* [public] */;
+
#endif /* _HEADER_misc */
diff --git a/librpc/gen_ndr/ndr_misc.c b/librpc/gen_ndr/ndr_misc.c
index 83c977245a..28c8560819 100644
--- a/librpc/gen_ndr/ndr_misc.c
+++ b/librpc/gen_ndr/ndr_misc.c
@@ -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--;
+}
+
diff --git a/librpc/gen_ndr/ndr_misc.h b/librpc/gen_ndr/ndr_misc.h
index a38b3c9948..938c946b73 100644
--- a/librpc/gen_ndr/ndr_misc.h
+++ b/librpc/gen_ndr/ndr_misc.h
@@ -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 */
diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c
index a677f532db..c7cf5164b8 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -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--;
}
diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h
index d5b8ca9bc0..41ff65278b 100644
--- a/librpc/gen_ndr/ndr_spoolss.h
+++ b/librpc/gen_ndr/ndr_spoolss.h
@@ -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);
diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h
index 49eb799079..36950b0f64 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -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)] */
@@ -1058,6 +1092,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;
@@ -1761,6 +1802,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;
@@ -2046,6 +2093,11 @@ struct spoolss_DeletePrinterDataEx {
struct spoolss_DeletePrinterKey {
struct {
+ struct policy_handle *handle;/* [ref] */
+ const char *key_name;/* [charset(UTF16)] */
+ } in;
+
+ struct {
WERROR result;
} out;
@@ -2062,6 +2114,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;
diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index abf49766a4..64af1c4a16 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -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;
}
diff --git a/librpc/idl/misc.idl b/librpc/idl/misc.idl
index 1ef0d913b9..c4d8c62ca3 100644
--- a/librpc/idl/misc.idl
+++ b/librpc/idl/misc.idl
@@ -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;
}
diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl
index fbe12ad64e..09646c9d67 100644
--- a/librpc/idl/spoolss.idl
+++ b/librpc/idl/spoolss.idl
@@ -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
);
/******************/
diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c
index 1cb1df3fd5..0ab017e084 100644
--- a/librpc/ndr/ndr_spoolss_buf.c
+++ b/librpc/ndr/ndr_spoolss_buf.c
@@ -131,7 +131,7 @@
"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;
diff --git a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
index 1a0eb51438..ed1b71a236 100644
--- a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
+++ b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
@@ -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};");
}
diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
index 33dc68e753..c9a8eea59f 100644
--- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
+++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
@@ -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") {
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 8e8932bc5f..ee75eb30e6 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -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)
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index 9f4d1d3fd0..a736609580 100644
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -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) {
diff --git a/source3/client/umount.cifs.c b/source3/client/umount.cifs.c
index aff7cea397..81925eda27 100644
--- a/source3/client/umount.cifs.c
+++ b/source3/client/umount.cifs.c
@@ -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");
diff --git a/source3/configure.in b/source3/configure.in
index 306566f26e..37ee9a131f 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -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)
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c
index af99b86c45..a162c194d6 100644
--- a/source3/groupdb/mapping_ldb.c
+++ b/source3/groupdb/mapping_ldb.c
@@ -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;
}
diff --git a/source3/include/ads.h b/source3/include/ads.h
index abff9eaa8c..0fa19b55a6 100644
--- a/source3/include/ads.h
+++ b/source3/include/ads.h
@@ -364,12 +364,6 @@ typedef void **ADS_MODLIST;
#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;
#elif defined(HAVE_KRB5_ADDRESSES) /* Heimdal */
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index 2d6a358391..0eff9bdbac 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -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.
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 267ee74482..5009e6dcdb 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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,
WERROR rpccli_spoolss_open_printer_ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
const char *printername, const char *datatype, uint32 access_required,
const char *station, const char *username, POLICY_HND *pol);
-WERROR rpccli_spoolss_close_printer(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *pol);
WERROR rpccli_spoolss_enum_printers(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
char *name, uint32 flags, uint32 level,
uint32 *num_printers, PRINTER_INFO_CTR *ctr);
@@ -5458,26 +5458,10 @@ WERROR rpccli_spoolss_addprinterdriver (struct rpc_pipe_client *cli,
PRINTER_DRIVER_CTR *ctr);
WERROR rpccli_spoolss_addprinterex (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
uint32 level, PRINTER_INFO_CTR*ctr);
-WERROR rpccli_spoolss_deleteprinterdriverex(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, const char *arch,
- const char *driver, int version);
-WERROR rpccli_spoolss_deleteprinterdriver (struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, const char *arch,
- const char *driver);
WERROR rpccli_spoolss_getprintprocessordirectory(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
char *name, char *environment,
fstring procdir);
-WERROR rpccli_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, uint32 level, FORM *form);
-WERROR rpccli_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, uint32 level,
- const char *form_name, FORM *form);
-WERROR rpccli_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, const char *formname,
- uint32 level, FORM_1 *form);
-WERROR rpccli_spoolss_deleteform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, const char *form_name);
WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *handle, int level, uint32 *num_forms,
FORM_1 **forms);
@@ -5490,16 +5474,10 @@ WERROR rpccli_spoolss_setjob(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, uint32 jobid, uint32 level,
JOB_INFO_CTR *ctr);
-WERROR rpccli_spoolss_startpageprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd);
-WERROR rpccli_spoolss_endpageprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd);
WERROR rpccli_spoolss_startdocprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, char *docname,
char *outputfile, char *datatype,
uint32 *jobid);
-WERROR rpccli_spoolss_enddocprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd);
WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, const char *valuename,
REGISTRY_VALUE *value);
@@ -5520,19 +5498,9 @@ WERROR rpccli_spoolss_enumprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *m
WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, const char *keyname,
REGVAL_CTR *ctr);
-WERROR rpccli_spoolss_writeprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, uint32 data_size, char *data,
- uint32 *num_written);
-WERROR rpccli_spoolss_deleteprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, char *valuename);
-WERROR rpccli_spoolss_deleteprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, char *keyname,
- char *valuename);
WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, const char *keyname,
uint16 **keylist, uint32 *len);
-WERROR rpccli_spoolss_deleteprinterkey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, char *keyname);
/* The following definitions come from rpc_client/cli_spoolss_notify.c */
@@ -5854,19 +5822,6 @@ bool spoolss_io_q_open_printer(const char *desc, SPOOL_Q_OPEN_PRINTER *q_u, prs_
bool spoolss_io_r_open_printer(const char *desc, SPOOL_R_OPEN_PRINTER *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_open_printer_ex(const char *desc, SPOOL_Q_OPEN_PRINTER_EX *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_open_printer_ex(const char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_struct *ps, int depth);
-bool make_spoolss_q_deleteprinterdriverex( TALLOC_CTX *mem_ctx,
- SPOOL_Q_DELETEPRINTERDRIVEREX *q_u,
- const char *server,
- const char* arch,
- const char* driver,
- int version);
-bool make_spoolss_q_deleteprinterdriver(
- TALLOC_CTX *mem_ctx,
- SPOOL_Q_DELETEPRINTERDRIVER *q_u,
- const char *server,
- const char* arch,
- const char* driver
-);
bool make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u,
const POLICY_HND *handle,
const char *valuename, uint32 size);
@@ -5875,32 +5830,9 @@ bool make_spoolss_q_getprinterdataex(SPOOL_Q_GETPRINTERDATAEX *q_u,
const char *keyname,
const char *valuename, uint32 size);
bool spoolss_io_q_getprinterdata(const char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth);
-bool spoolss_io_q_deleteprinterdata(const char *desc, SPOOL_Q_DELETEPRINTERDATA *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_deleteprinterdata(const char *desc, SPOOL_R_DELETEPRINTERDATA *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_deleteprinterdataex(const char *desc, SPOOL_Q_DELETEPRINTERDATAEX *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_deleteprinterdataex(const char *desc, SPOOL_R_DELETEPRINTERDATAEX *r_u, prs_struct *ps, int depth);
bool spoolss_io_r_getprinterdata(const char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth);
-bool make_spoolss_q_closeprinter(SPOOL_Q_CLOSEPRINTER *q_u, POLICY_HND *hnd);
-bool spoolss_io_q_abortprinter(const char *desc, SPOOL_Q_ABORTPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_abortprinter(const char *desc, SPOOL_R_ABORTPRINTER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_deleteprinter(const char *desc, SPOOL_Q_DELETEPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_deleteprinter(const char *desc, SPOOL_R_DELETEPRINTER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_deleteprinterdriver(const char *desc, SPOOL_Q_DELETEPRINTERDRIVER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_deleteprinterdriver(const char *desc, SPOOL_R_DELETEPRINTERDRIVER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_deleteprinterdriverex(const char *desc, SPOOL_Q_DELETEPRINTERDRIVEREX *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_deleteprinterdriverex(const char *desc, SPOOL_R_DELETEPRINTERDRIVEREX *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_closeprinter(const char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_closeprinter(const char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_startdocprinter(const char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_startdocprinter(const char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_enddocprinter(const char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_enddocprinter(const char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_startpageprinter(const char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_startpageprinter(const char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_endpageprinter(const char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_endpageprinter(const char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_writeprinter(const char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_writeprinter(const char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_rffpcnex(const char *desc, SPOOL_Q_RFFPCNEX *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_rffpcnex(const char *desc, SPOOL_R_RFFPCNEX *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_rfnpcnex(const char *desc, SPOOL_Q_RFNPCNEX *q_u, prs_struct *ps, int depth);
@@ -5990,8 +5922,6 @@ bool make_spoolss_q_setprinter(TALLOC_CTX *mem_ctx, SPOOL_Q_SETPRINTER *q_u,
uint32 command);
bool spoolss_io_r_setprinter(const char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_setprinter(const char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_fcpn(const char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_fcpn(const char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_addjob(const char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_addjob(const char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_enumjobs(const char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth);
@@ -6015,8 +5945,6 @@ bool make_spoolss_q_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u,
bool spoolss_io_q_enumprinterdrivers(const char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *ps, int depth);
bool spoolss_io_q_enumforms(const char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_enumforms(const char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_getform(const char *desc, SPOOL_Q_GETFORM *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_getform(const char *desc, SPOOL_R_GETFORM *r_u, prs_struct *ps, int depth);
bool spoolss_io_r_enumports(const char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_enumports(const char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth);
bool spool_io_printer_info_level_1(const char *desc, SPOOL_PRINTER_INFO_LEVEL_1 *il, prs_struct *ps, int depth);
@@ -6080,12 +6008,6 @@ bool spoolss_io_q_setprinterdata(const char *desc, SPOOL_Q_SETPRINTERDATA *q_u,
bool spoolss_io_r_setprinterdata(const char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_resetprinter(const char *desc, SPOOL_Q_RESETPRINTER *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_resetprinter(const char *desc, SPOOL_R_RESETPRINTER *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_deleteform(const char *desc, SPOOL_Q_DELETEFORM *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_deleteform(const char *desc, SPOOL_R_DELETEFORM *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_addform(const char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_addform(const char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth);
-bool spoolss_io_q_setform(const char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_setform(const char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth);
bool spoolss_io_r_getjob(const char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_getjob(const char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int depth);
void free_devmode(DEVICEMODE *devmode);
@@ -6122,25 +6044,12 @@ bool make_spoolss_q_enumprinterkey(SPOOL_Q_ENUMPRINTERKEY *q_u,
uint32 size);
bool spoolss_io_q_enumprinterkey(const char *desc, SPOOL_Q_ENUMPRINTERKEY *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_enumprinterkey(const char *desc, SPOOL_R_ENUMPRINTERKEY *r_u, prs_struct *ps, int depth);
-bool make_spoolss_q_deleteprinterkey(SPOOL_Q_DELETEPRINTERKEY *q_u,
- POLICY_HND *hnd, char *keyname);
-bool spoolss_io_q_deleteprinterkey(const char *desc, SPOOL_Q_DELETEPRINTERKEY *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_deleteprinterkey(const char *desc, SPOOL_R_DELETEPRINTERKEY *r_u, prs_struct *ps, int depth);
bool spoolss_io_q_enumprinterdataex(const char *desc, SPOOL_Q_ENUMPRINTERDATAEX *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_enumprinterdataex(const char *desc, SPOOL_R_ENUMPRINTERDATAEX *r_u, prs_struct *ps, int depth);
bool make_spoolss_q_getprintprocessordirectory(SPOOL_Q_GETPRINTPROCESSORDIRECTORY *q_u, const char *name, char *environment, int level, RPC_BUFFER *buffer, uint32 offered);
bool spoolss_io_q_getprintprocessordirectory(const char *desc, SPOOL_Q_GETPRINTPROCESSORDIRECTORY *q_u, prs_struct *ps, int depth);
bool spoolss_io_r_getprintprocessordirectory(const char *desc, SPOOL_R_GETPRINTPROCESSORDIRECTORY *r_u, prs_struct *ps, int depth);
bool smb_io_printprocessordirectory_1(const char *desc, RPC_BUFFER *buffer, PRINTPROCESSOR_DIRECTORY_1 *info, int depth);
-bool make_spoolss_q_addform(SPOOL_Q_ADDFORM *q_u, POLICY_HND *handle,
- int level, FORM *form);
-bool make_spoolss_q_setform(SPOOL_Q_SETFORM *q_u, POLICY_HND *handle,
- int level, const char *form_name, FORM *form);
-bool make_spoolss_q_deleteform(SPOOL_Q_DELETEFORM *q_u, POLICY_HND *handle,
- const char *form);
-bool make_spoolss_q_getform(SPOOL_Q_GETFORM *q_u, POLICY_HND *handle,
- const char *formname, uint32 level,
- RPC_BUFFER *buffer, uint32 offered);
bool make_spoolss_q_enumforms(SPOOL_Q_ENUMFORMS *q_u, POLICY_HND *handle,
uint32 level, RPC_BUFFER *buffer,
uint32 offered);
@@ -6149,24 +6058,10 @@ bool make_spoolss_q_setjob(SPOOL_Q_SETJOB *q_u, POLICY_HND *handle,
bool make_spoolss_q_getjob(SPOOL_Q_GETJOB *q_u, POLICY_HND *handle,
uint32 jobid, uint32 level, RPC_BUFFER *buffer,
uint32 offered);
-bool make_spoolss_q_startpageprinter(SPOOL_Q_STARTPAGEPRINTER *q_u,
- POLICY_HND *handle);
-bool make_spoolss_q_endpageprinter(SPOOL_Q_ENDPAGEPRINTER *q_u,
- POLICY_HND *handle);
bool make_spoolss_q_startdocprinter(SPOOL_Q_STARTDOCPRINTER *q_u,
POLICY_HND *handle, uint32 level,
char *docname, char *outputfile,
char *datatype);
-bool make_spoolss_q_enddocprinter(SPOOL_Q_ENDDOCPRINTER *q_u,
- POLICY_HND *handle);
-bool make_spoolss_q_writeprinter(SPOOL_Q_WRITEPRINTER *q_u,
- POLICY_HND *handle, uint32 data_size,
- char *data);
-bool make_spoolss_q_deleteprinterdata(SPOOL_Q_DELETEPRINTERDATA *q_u,
- POLICY_HND *handle, char *valuename);
-bool make_spoolss_q_deleteprinterdataex(SPOOL_Q_DELETEPRINTERDATAEX *q_u,
- POLICY_HND *handle, char *key,
- char *value);
bool make_spoolss_q_rffpcnex(SPOOL_Q_RFFPCNEX *q_u, POLICY_HND *handle,
uint32 flags, uint32 options, const char *localmachine,
uint32 printerlocal, SPOOL_NOTIFY_OPTION *option);
@@ -6277,8 +6172,8 @@ void copy_id25_to_sam_passwd(struct samu *to,
/* The following definitions come from rpc_server/srv_spoolss.c */
-void spoolss_get_pipe_fns( struct api_struct **fns, int *n_fns );
-NTSTATUS rpc_spoolss_init(void);
+void spoolss2_get_pipe_fns( struct api_struct **fns, int *n_fns );
+NTSTATUS rpc_spoolss2_init(void);
/* The following definitions come from rpc_server/srv_spoolss_nt.c */
@@ -6298,10 +6193,6 @@ WERROR _spoolss_open_printer(pipes_struct *p, SPOOL_Q_OPEN_PRINTER *q_u, SPOOL_R
WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, SPOOL_R_OPEN_PRINTER_EX *r_u);
bool convert_devicemode(const char *printername, const DEVICEMODE *devmode,
NT_DEVICEMODE **pp_nt_devmode);
-WERROR _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u);
-WERROR _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL_R_DELETEPRINTER *r_u);
-WERROR _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER *q_u, SPOOL_R_DELETEPRINTERDRIVER *r_u);
-WERROR _spoolss_deleteprinterdriverex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVEREX *q_u, SPOOL_R_DELETEPRINTERDRIVEREX *r_u);
WERROR set_printer_dataex( NT_PRINTER_INFO_LEVEL *printer, const char *key, const char *value,
uint32 type, uint8 *data, int real_len );
WERROR _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u);
@@ -6377,23 +6268,16 @@ DEVICEMODE *construct_dev_mode(const char *servicename);
WERROR _spoolss_enumprinters( pipes_struct *p, SPOOL_Q_ENUMPRINTERS *q_u, SPOOL_R_ENUMPRINTERS *r_u);
WERROR _spoolss_getprinter(pipes_struct *p, SPOOL_Q_GETPRINTER *q_u, SPOOL_R_GETPRINTER *r_u);
WERROR _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_u, SPOOL_R_GETPRINTERDRIVER2 *r_u);
-WERROR _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, SPOOL_R_STARTPAGEPRINTER *r_u);
-WERROR _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPOOL_R_ENDPAGEPRINTER *r_u);
WERROR _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, SPOOL_R_STARTDOCPRINTER *r_u);
-WERROR _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL_R_ENDDOCPRINTER *r_u);
-WERROR _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u);
-WERROR _spoolss_abortprinter(pipes_struct *p, SPOOL_Q_ABORTPRINTER *q_u, SPOOL_R_ABORTPRINTER *r_u);
WERROR add_port_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *portname, const char *uri );
bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer);
WERROR _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SETPRINTER *r_u);
-WERROR _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u);
WERROR _spoolss_addjob(pipes_struct *p, SPOOL_Q_ADDJOB *q_u, SPOOL_R_ADDJOB *r_u);
WERROR _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJOBS *r_u);
WERROR _spoolss_schedulejob( pipes_struct *p, SPOOL_Q_SCHEDULEJOB *q_u, SPOOL_R_SCHEDULEJOB *r_u);
WERROR _spoolss_setjob(pipes_struct *p, SPOOL_Q_SETJOB *q_u, SPOOL_R_SETJOB *r_u);
WERROR _spoolss_enumprinterdrivers( pipes_struct *p, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, SPOOL_R_ENUMPRINTERDRIVERS *r_u);
WERROR _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMFORMS *r_u);
-WERROR _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *r_u);
WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines );
WERROR _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUMPORTS *r_u);
WERROR _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_R_ADDPRINTEREX *r_u);
@@ -6403,19 +6287,13 @@ WERROR _spoolss_getprinterdriverdirectory(pipes_struct *p, SPOOL_Q_GETPRINTERDRI
WERROR _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, SPOOL_R_ENUMPRINTERDATA *r_u);
WERROR _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SPOOL_R_SETPRINTERDATA *r_u);
WERROR _spoolss_resetprinter(pipes_struct *p, SPOOL_Q_RESETPRINTER *q_u, SPOOL_R_RESETPRINTER *r_u);
-WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_u, SPOOL_R_DELETEPRINTERDATA *r_u);
-WERROR _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM *r_u);
-WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DELETEFORM *r_u);
-WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *r_u);
WERROR _spoolss_enumprintprocessors(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, SPOOL_R_ENUMPRINTPROCESSORS *r_u);
WERROR _spoolss_enumprintprocdatatypes(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u);
WERROR _spoolss_enumprintmonitors(pipes_struct *p, SPOOL_Q_ENUMPRINTMONITORS *q_u, SPOOL_R_ENUMPRINTMONITORS *r_u);
WERROR _spoolss_getjob( pipes_struct *p, SPOOL_Q_GETJOB *q_u, SPOOL_R_GETJOB *r_u);
WERROR _spoolss_getprinterdataex(pipes_struct *p, SPOOL_Q_GETPRINTERDATAEX *q_u, SPOOL_R_GETPRINTERDATAEX *r_u);
WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u, SPOOL_R_SETPRINTERDATAEX *r_u);
-WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX *q_u, SPOOL_R_DELETEPRINTERDATAEX *r_u);
WERROR _spoolss_enumprinterkey(pipes_struct *p, SPOOL_Q_ENUMPRINTERKEY *q_u, SPOOL_R_ENUMPRINTERKEY *r_u);
-WERROR _spoolss_deleteprinterkey(pipes_struct *p, SPOOL_Q_DELETEPRINTERKEY *q_u, SPOOL_R_DELETEPRINTERKEY *r_u);
WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_u, SPOOL_R_ENUMPRINTERDATAEX *r_u);
WERROR _spoolss_getprintprocessordirectory(pipes_struct *p, SPOOL_Q_GETPRINTPROCESSORDIRECTORY *q_u, SPOOL_R_GETPRINTPROCESSORDIRECTORY *r_u);
WERROR _spoolss_xcvdataport(pipes_struct *p, SPOOL_Q_XCVDATAPORT *q_u, SPOOL_R_XCVDATAPORT *r_u);
@@ -7609,12 +7487,4 @@ NTSTATUS nss_info_template_init( void );
/* Misc protos */
-struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- struct wb_context *wb_ctx, bool need_priv,
- const struct winbindd_request *wb_req);
-NTSTATUS wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
- struct winbindd_response **presponse);
-struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx);
-
-
#endif /* _PROTO_H_ */
diff --git a/source3/include/rpc_client.h b/source3/include/rpc_client.h
index 61b861c3b4..afa18899ca 100644
--- a/source3/include/rpc_client.h
+++ b/source3/include/rpc_client.h
@@ -37,6 +37,7 @@
#include "librpc/gen_ndr/cli_ntsvcs.h"
#include "librpc/gen_ndr/cli_epmapper.h"
#include "librpc/gen_ndr/cli_drsuapi.h"
+#include "librpc/gen_ndr/cli_spoolss.h"
#define prs_init_empty( _ps_, _ctx_, _io_ ) (void) prs_init((_ps_), 0, (_ctx_), (_io_))
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index 32909335d6..feabd3fff7 100644
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -217,57 +217,6 @@
#define PRINTER_NOTIFY_OPTIONS_REFRESH 0x01
-#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_PRINTER (PRINTER_CHANGE_ADD_PRINTER | \
- PRINTER_CHANGE_SET_PRINTER | \
- PRINTER_CHANGE_DELETE_PRINTER | \
- PRINTER_CHANGE_FAILED_CONNECTION_PRINTER )
-
-#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_JOB (PRINTER_CHANGE_ADD_JOB | \
- PRINTER_CHANGE_SET_JOB | \
- PRINTER_CHANGE_DELETE_JOB | \
- PRINTER_CHANGE_WRITE_JOB )
-
-#define PRINTER_CHANGE_ADD_FORM 0x00010000
-#define PRINTER_CHANGE_SET_FORM 0x00020000
-#define PRINTER_CHANGE_DELETE_FORM 0x00040000
-#define PRINTER_CHANGE_FORM (PRINTER_CHANGE_ADD_FORM | \
- PRINTER_CHANGE_SET_FORM | \
- PRINTER_CHANGE_DELETE_FORM )
-
-#define PRINTER_CHANGE_ADD_PORT 0x00100000
-#define PRINTER_CHANGE_CONFIGURE_PORT 0x00200000
-#define PRINTER_CHANGE_DELETE_PORT 0x00400000
-#define PRINTER_CHANGE_PORT (PRINTER_CHANGE_ADD_PORT | \
- PRINTER_CHANGE_CONFIGURE_PORT | \
- PRINTER_CHANGE_DELETE_PORT )
-
-#define PRINTER_CHANGE_ADD_PRINT_PROCESSOR 0x01000000
-#define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR 0x04000000
-#define PRINTER_CHANGE_PRINT_PROCESSOR (PRINTER_CHANGE_ADD_PRINT_PROCESSOR | \
- PRINTER_CHANGE_DELETE_PRINT_PROCESSOR )
-
-#define PRINTER_CHANGE_ADD_PRINTER_DRIVER 0x10000000
-#define PRINTER_CHANGE_SET_PRINTER_DRIVER 0x20000000
-#define PRINTER_CHANGE_DELETE_PRINTER_DRIVER 0x40000000
-#define PRINTER_CHANGE_PRINTER_DRIVER (PRINTER_CHANGE_ADD_PRINTER_DRIVER | \
- PRINTER_CHANGE_SET_PRINTER_DRIVER | \
- PRINTER_CHANGE_DELETE_PRINTER_DRIVER )
-
-#define PRINTER_CHANGE_TIMEOUT 0x80000000
-#define PRINTER_CHANGE_ALL (PRINTER_CHANGE_JOB | \
- PRINTER_CHANGE_FORM | \
- PRINTER_CHANGE_PORT | \
- PRINTER_CHANGE_PRINT_PROCESSOR | \
- PRINTER_CHANGE_PRINTER_DRIVER )
-
#define PRINTER_NOTIFY_INFO_DISCARDED 0x1
/*
@@ -317,14 +266,6 @@ PRINTER_MESSAGE_INFO;
#define DEF_PRIORITY 1
/* the flags of each printers */
-#define PRINTER_ENUM_UNKNOWN_8 0x00000008
-#define PRINTER_ENUM_ICONMASK 0x00ff0000
-
-/* FLAGS for SPOOLSS_DELETEPRINTERDRIVEREX */
-
-#define DPD_DELETE_UNUSED_FILES 0x00000001
-#define DPD_DELETE_SPECIFIC_VERSION 0x00000002
-#define DPD_DELETE_ALL_FILES 0x00000004
#define DRIVER_ANY_VERSION 0xffffffff
#define DRIVER_MAX_VERSION 4
@@ -532,90 +473,6 @@ typedef struct spool_r_getprinterdata
}
SPOOL_R_GETPRINTERDATA;
-typedef struct spool_q_deleteprinterdata
-{
- POLICY_HND handle;
- UNISTR2 valuename;
-}
-SPOOL_Q_DELETEPRINTERDATA;
-
-typedef struct spool_r_deleteprinterdata
-{
- WERROR status;
-}
-SPOOL_R_DELETEPRINTERDATA;
-
-typedef struct spool_q_closeprinter
-{
- POLICY_HND handle;
-}
-SPOOL_Q_CLOSEPRINTER;
-
-typedef struct spool_r_closeprinter
-{
- POLICY_HND handle;
- WERROR status;
-}
-SPOOL_R_CLOSEPRINTER;
-
-typedef struct spool_q_startpageprinter
-{
- POLICY_HND handle;
-}
-SPOOL_Q_STARTPAGEPRINTER;
-
-typedef struct spool_r_startpageprinter
-{
- WERROR status;
-}
-SPOOL_R_STARTPAGEPRINTER;
-
-typedef struct spool_q_endpageprinter
-{
- POLICY_HND handle;
-}
-SPOOL_Q_ENDPAGEPRINTER;
-
-typedef struct spool_r_endpageprinter
-{
- WERROR status;
-}
-SPOOL_R_ENDPAGEPRINTER;
-
-
-typedef struct spool_q_deleteprinterdriver
-{
- uint32 server_ptr;
- UNISTR2 server;
- UNISTR2 arch;
- UNISTR2 driver;
-}
-SPOOL_Q_DELETEPRINTERDRIVER;
-
-typedef struct spool_r_deleteprinterdriver
-{
- WERROR status;
-}
-SPOOL_R_DELETEPRINTERDRIVER;
-
-typedef struct spool_q_deleteprinterdriverex
-{
- uint32 server_ptr;
- UNISTR2 server;
- UNISTR2 arch;
- UNISTR2 driver;
- uint32 delete_flags;
- uint32 version;
-}
-SPOOL_Q_DELETEPRINTERDRIVEREX;
-
-typedef struct spool_r_deleteprinterdriverex
-{
- WERROR status;
-}
-SPOOL_R_DELETEPRINTERDRIVEREX;
-
-
typedef struct spool_doc_info_1
{
uint32 p_docname;
@@ -655,34 +512,6 @@ typedef struct spool_r_startdocprinter
}
SPOOL_R_STARTDOCPRINTER;
-typedef struct spool_q_enddocprinter
-{
- POLICY_HND handle;
-}
-SPOOL_Q_ENDDOCPRINTER;
-
-typedef struct spool_r_enddocprinter
-{
- WERROR status;
-}
-SPOOL_R_ENDDOCPRINTER;
-
-typedef struct spool_q_writeprinter
-{
- POLICY_HND handle;
- uint32 buffer_size;
- uint8 *buffer;
- uint32 buffer_size2;
-}
-SPOOL_Q_WRITEPRINTER;
-
-typedef struct spool_r_writeprinter
-{
- uint32 buffer_written;
- WERROR status;
-}
-SPOOL_R_WRITEPRINTER;
-
typedef struct spool_notify_option
{
uint32 version;
@@ -763,20 +592,6 @@ typedef struct spool_r_rfnpcnex
}
SPOOL_R_RFNPCNEX;
-/* Find Close Printer Notify */
-typedef struct spool_q_fcpn
-{
- POLICY_HND handle;
-}
-SPOOL_Q_FCPN;
-
-typedef struct spool_r_fcpn
-{
- WERROR status;
-}
-SPOOL_R_FCPN;
-
-
typedef struct printer_info_0
{
UNISTR printername;
@@ -1329,24 +1144,6 @@ typedef struct spool_r_enumforms
}
SPOOL_R_ENUMFORMS;
-typedef struct spool_q_getform
-{
- POLICY_HND handle;
- UNISTR2 formname;
- uint32 level;
- RPC_BUFFER *buffer;
- uint32 offered;
-}
-SPOOL_Q_GETFORM;
-
-typedef struct spool_r_getform
-{
- RPC_BUFFER *buffer;
- uint32 needed;
- WERROR status;
-}
-SPOOL_R_GETFORM;
-
typedef struct spool_printer_info_level_1
{
uint32 flags;
@@ -1518,28 +1315,6 @@ SPOOL_R_SETPRINTER;
/********************************************/
typedef struct {
- POLICY_HND handle;
-} SPOOL_Q_DELETEPRINTER;
-
-typedef struct {
- POLICY_HND handle;
- WERROR status;
-} SPOOL_R_DELETEPRINTER;
-
-/********************************************/
-
-typedef struct {
- POLICY_HND handle;
-} SPOOL_Q_ABORTPRINTER;
-
-typedef struct {
- WERROR status;
-} SPOOL_R_ABORTPRINTER;
-
-
-/********************************************/
-
-typedef struct {
UNISTR2 *server_name;
uint32 level;
SPOOL_PRINTER_INFO_LEVEL info;
@@ -1796,50 +1571,6 @@ typedef struct _form
}
FORM;
-typedef struct spool_q_addform
-{
- POLICY_HND handle;
- uint32 level;
- uint32 level2; /* This should really be part of the FORM structure */
- FORM form;
-}
-SPOOL_Q_ADDFORM;
-
-typedef struct spool_r_addform
-{
- WERROR status;
-}
-SPOOL_R_ADDFORM;
-
-typedef struct spool_q_setform
-{
- POLICY_HND handle;
- UNISTR2 name;
- uint32 level;
- uint32 level2;
- FORM form;
-}
-SPOOL_Q_SETFORM;
-
-typedef struct spool_r_setform
-{
- WERROR status;
-}
-SPOOL_R_SETFORM;
-
-typedef struct spool_q_deleteform
-{
- POLICY_HND handle;
- UNISTR2 name;
-}
-SPOOL_Q_DELETEFORM;
-
-typedef struct spool_r_deleteform
-{
- WERROR status;
-}
-SPOOL_R_DELETEFORM;
-
typedef struct spool_q_getjob
{
POLICY_HND handle;
@@ -1975,21 +1706,6 @@ typedef struct spool_r_setprinterdataex
SPOOL_R_SETPRINTERDATAEX;
-typedef struct spool_q_deleteprinterdataex
-{
- POLICY_HND handle;
- UNISTR2 keyname;
- UNISTR2 valuename;
-}
-SPOOL_Q_DELETEPRINTERDATAEX;
-
-typedef struct spool_r_deleteprinterdataex
-{
- WERROR status;
-}
-SPOOL_R_DELETEPRINTERDATAEX;
-
-
typedef struct spool_q_enumprinterkey
{
POLICY_HND handle;
@@ -2006,19 +1722,6 @@ typedef struct spool_r_enumprinterkey
}
SPOOL_R_ENUMPRINTERKEY;
-typedef struct spool_q_deleteprinterkey
-{
- POLICY_HND handle;
- UNISTR2 keyname;
-}
-SPOOL_Q_DELETEPRINTERKEY;
-
-typedef struct spool_r_deleteprinterkey
-{
- WERROR status;
-}
-SPOOL_R_DELETEPRINTERKEY;
-
typedef struct printer_enum_values
{
UNISTR valuename;
diff --git a/source3/include/smb.h b/source3/include/smb.h
index b441b3476a..eaf09dd09c 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -257,6 +257,7 @@ struct id_map {
#include "librpc/gen_ndr/nbt.h"
#include "librpc/gen_ndr/drsuapi.h"
#include "librpc/gen_ndr/drsblobs.h"
+#include "librpc/gen_ndr/spoolss.h"
struct lsa_dom_info {
bool valid;
diff --git a/source3/include/wbc_async.h b/source3/include/wbc_async.h
new file mode 100644
index 0000000000..7a8768029a
--- /dev/null
+++ b/source3/include/wbc_async.h
@@ -0,0 +1,68 @@
+/*
+ Unix SMB/CIFS implementation.
+ Headers for the async winbind client library
+ Copyright (C) Kai Blin 2009
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _WBC_ASYNC_H_
+#define _WBC_ASYNC_H_
+
+#include "nsswitch/libwbclient/wbclient.h"
+
+struct wb_context {
+ struct async_req_queue *queue;
+ int fd;
+ bool is_priv;
+};
+
+struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct wb_context *wb_ctx, bool need_priv,
+ const struct winbindd_request *wb_req);
+wbcErr wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+ struct winbindd_response **presponse);
+struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx);
+
+/* Definitions from wb_reqtrans.c */
+bool async_req_is_wbcerr(struct async_req *req, wbcErr *pwbc_err);
+wbcErr map_wbc_err_from_errno(int error);
+wbcErr async_req_simple_recv_wbcerr(struct async_req *req);
+
+struct async_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ int fd, size_t max_extra_data);
+
+wbcErr wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+ struct winbindd_request **preq);
+
+struct async_req *wb_req_write_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev, int fd,
+ struct winbindd_request *wb_req);
+
+wbcErr wb_req_write_recv(struct async_req *req);
+
+struct async_req *wb_resp_read_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev, int fd);
+
+wbcErr wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+ struct winbindd_response **presp);
+
+struct async_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev, int fd,
+ struct winbindd_response *wb_resp);
+
+wbcErr wb_resp_write_recv(struct async_req *req);
+
+#endif /*_WBC_ASYNC_H_*/
diff --git a/source3/lib/netapi/examples/server/server_getinfo.c b/source3/lib/netapi/examples/server/server_getinfo.c
index afd2edd05d..b6a665e4e0 100644
--- a/source3/lib/netapi/examples/server/server_getinfo.c
+++ b/source3/lib/netapi/examples/server/server_getinfo.c
@@ -38,6 +38,10 @@ int main(int argc, const char **argv)
struct SERVER_INFO_100 *i100;
struct SERVER_INFO_101 *i101;
struct SERVER_INFO_102 *i102;
+ struct SERVER_INFO_402 *i402;
+ struct SERVER_INFO_403 *i403;
+ struct SERVER_INFO_502 *i502;
+ struct SERVER_INFO_503 *i503;
struct SERVER_INFO_1005 *i1005;
poptContext pc;
@@ -112,6 +116,18 @@ int main(int argc, const char **argv)
printf("licenses: %d\n", i102->sv102_licenses);
printf("userpath: %s\n", i102->sv102_userpath);
break;
+ case 402:
+ i402 = (struct SERVER_INFO_402 *)buffer;
+ break;
+ case 403:
+ i403 = (struct SERVER_INFO_403 *)buffer;
+ break;
+ case 502:
+ i502 = (struct SERVER_INFO_502 *)buffer;
+ break;
+ case 503:
+ i503 = (struct SERVER_INFO_503 *)buffer;
+ break;
case 1005:
i1005 = (struct SERVER_INFO_1005 *)buffer;
printf("comment: %s\n", i1005->sv1005_comment);
diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h
index 9687461920..e8cd71eec6 100644
--- a/source3/lib/netapi/netapi.h
+++ b/source3/lib/netapi/netapi.h
@@ -134,11 +134,623 @@ struct SERVER_INFO_102 {
const char * sv102_userpath;
};
+struct SERVER_INFO_402 {
+ uint32_t sv402_ulist_mtime;
+ uint32_t sv402_glist_mtime;
+ uint32_t sv402_alist_mtime;
+ const char * sv402_alerts;
+ uint32_t sv402_security;
+ uint32_t sv402_numadmin;
+ uint32_t sv402_lanmask;
+ const char * sv402_guestacct;
+ uint32_t sv402_chdevs;
+ uint32_t sv402_chdevq;
+ uint32_t sv402_chdevjobs;
+ uint32_t sv402_connections;
+ uint32_t sv402_shares;
+ uint32_t sv402_openfiles;
+ uint32_t sv402_sessopens;
+ uint32_t sv402_sessvcs;
+ uint32_t sv402_sessreqs;
+ uint32_t sv402_opensearch;
+ uint32_t sv402_activelocks;
+ uint32_t sv402_numreqbuf;
+ uint32_t sv402_sizreqbuf;
+ uint32_t sv402_numbigbuf;
+ uint32_t sv402_numfiletasks;
+ uint32_t sv402_alertsched;
+ uint32_t sv402_erroralert;
+ uint32_t sv402_logonalert;
+ uint32_t sv402_accessalert;
+ uint32_t sv402_diskalert;
+ uint32_t sv402_netioalert;
+ uint32_t sv402_maxauditsz;
+ const char * sv402_srvheuristics;
+};
+
+struct SERVER_INFO_403 {
+ uint32_t sv403_ulist_mtime;
+ uint32_t sv403_glist_mtime;
+ uint32_t sv403_alist_mtime;
+ const char * sv403_alerts;
+ uint32_t sv403_security;
+ uint32_t sv403_numadmin;
+ uint32_t sv403_lanmask;
+ const char * sv403_guestacct;
+ uint32_t sv403_chdevs;
+ uint32_t sv403_chdevq;
+ uint32_t sv403_chdevjobs;
+ uint32_t sv403_connections;
+ uint32_t sv403_shares;
+ uint32_t sv403_openfiles;
+ uint32_t sv403_sessopens;
+ uint32_t sv403_sessvcs;
+ uint32_t sv403_sessreqs;
+ uint32_t sv403_opensearch;
+ uint32_t sv403_activelocks;
+ uint32_t sv403_numreqbuf;
+ uint32_t sv403_sizreqbuf;
+ uint32_t sv403_numbigbuf;
+ uint32_t sv403_numfiletasks;
+ uint32_t sv403_alertsched;
+ uint32_t sv403_erroralert;
+ uint32_t sv403_logonalert;
+ uint32_t sv403_accessalert;
+ uint32_t sv403_diskalert;
+ uint32_t sv403_netioalert;
+ uint32_t sv403_maxauditsz;
+ const char * sv403_srvheuristics;
+ uint32_t sv403_auditedevents;
+ uint32_t sv403_autoprofile;
+ const char * sv403_autopath;
+};
+
+struct SERVER_INFO_502 {
+ uint32_t sv502_sessopens;
+ uint32_t sv502_sessvcs;
+ uint32_t sv502_opensearch;
+ uint32_t sv502_sizreqbuf;
+ uint32_t sv502_initworkitems;
+ uint32_t sv502_maxworkitems;
+ uint32_t sv502_rawworkitems;
+ uint32_t sv502_irpstacksize;
+ uint32_t sv502_maxrawbuflen;
+ uint32_t sv502_sessusers;
+ uint32_t sv502_sessconns;
+ uint32_t sv502_maxpagedmemoryusage;
+ uint32_t sv502_maxnonpagedmemoryusage;
+ uint8_t sv502_enablesoftcompat;
+ uint8_t sv502_enableforcedlogoff;
+ uint8_t sv502_timesource;
+ uint8_t sv502_acceptdownlevelapis;
+ uint8_t sv502_lmannounce;
+};
+
+struct SERVER_INFO_503 {
+ uint32_t sv503_sessopens;
+ uint32_t sv503_sessvcs;
+ uint32_t sv503_opensearch;
+ uint32_t sv503_sizreqbuf;
+ uint32_t sv503_initworkitems;
+ uint32_t sv503_maxworkitems;
+ uint32_t sv503_rawworkitems;
+ uint32_t sv503_irpstacksize;
+ uint32_t sv503_maxrawbuflen;
+ uint32_t sv503_sessusers;
+ uint32_t sv503_sessconns;
+ uint32_t sv503_maxpagedmemoryusage;
+ uint32_t sv503_maxnonpagedmemoryusage;
+ uint8_t sv503_enablesoftcompat;
+ uint8_t sv503_enableforcedlogoff;
+ uint8_t sv503_timesource;
+ uint8_t sv503_acceptdownlevelapis;
+ uint8_t sv503_lmannounce;
+ const char * sv503_domain;
+ uint32_t sv503_maxcopyreadlen;
+ uint32_t sv503_maxcopywritelen;
+ uint32_t sv503_minkeepsearch;
+ uint32_t sv503_maxkeepsearch;
+ uint32_t sv503_minkeepcomplsearch;
+ uint32_t sv503_maxkeepcomplsearch;
+ uint32_t sv503_threadcountadd;
+ uint32_t sv503_numblockthreads;
+ uint32_t sv503_scavtimeout;
+ uint32_t sv503_minrcvqueue;
+ uint32_t sv503_minfreeworkitems;
+ uint32_t sv503_xactmemsize;
+ uint32_t sv503_threadpriority;
+ uint32_t sv503_maxmpxct;
+ uint32_t sv503_oplockbreakwait;
+ uint32_t sv503_oplockbreakresponsewait;
+ uint8_t sv503_enableoplocks;
+ uint8_t sv503_enableoplockforceclose;
+ uint8_t sv503_enablefcbopens;
+ uint8_t sv503_enableraw;
+ uint8_t sv503_enablesharednetdrives;
+ uint32_t sv503_minfreeconnections;
+ uint32_t sv503_maxfreeconnections;
+};
+
+struct SERVER_INFO_599 {
+ uint32_t sv599_sessopens;
+ uint32_t sv599_sessvcs;
+ uint32_t sv599_opensearch;
+ uint32_t sv599_sizreqbuf;
+ uint32_t sv599_initworkitems;
+ uint32_t sv599_maxworkitems;
+ uint32_t sv599_rawworkitems;
+ uint32_t sv599_irpstacksize;
+ uint32_t sv599_maxrawbuflen;
+ uint32_t sv599_sessusers;
+ uint32_t sv599_sessconns;
+ uint32_t sv599_maxpagedmemoryusage;
+ uint32_t sv599_maxnonpagedmemoryusage;
+ uint8_t sv599_enablesoftcompat;
+ uint8_t sv599_enableforcedlogoff;
+ uint8_t sv599_timesource;
+ uint8_t sv599_acceptdownlevelapis;
+ uint8_t sv599_lmannounce;
+ const char * sv599_domain;
+ uint32_t sv599_maxcopyreadlen;
+ uint32_t sv599_maxcopywritelen;
+ uint32_t sv599_minkeepsearch;
+ uint32_t sv599_maxkeepsearch;
+ uint32_t sv599_minkeepcomplsearch;
+ uint32_t sv599_maxkeepcomplsearch;
+ uint32_t sv599_threadcountadd;
+ uint32_t sv599_numblockthreads;
+ uint32_t sv599_scavtimeout;
+ uint32_t sv599_minrcvqueue;
+ uint32_t sv599_minfreeworkitems;
+ uint32_t sv599_xactmemsize;
+ uint32_t sv599_threadpriority;
+ uint32_t sv599_maxmpxct;
+ uint32_t sv599_oplockbreakwait;
+ uint32_t sv599_oplockbreakresponsewait;
+ uint8_t sv599_enableoplocks;
+ uint8_t sv599_enableoplockforceclose;
+ uint8_t sv599_enablefcbopens;
+ uint8_t sv599_enableraw;
+ uint8_t sv599_enablesharednetdrives;
+ uint32_t sv599_minfreeconnections;
+ uint32_t sv599_maxfreeconnections;
+ uint32_t sv599_initsesstable;
+ uint32_t sv599_initconntable;
+ uint32_t sv599_initfiletable;
+ uint32_t sv599_initsearchtable;
+ uint32_t sv599_alertschedule;
+ uint32_t sv599_errorthreshold;
+ uint32_t sv599_networkerrorthreshold;
+ uint32_t sv599_diskspacethreshold;
+ uint32_t sv599_reserved;
+ uint32_t sv599_maxlinkdelay;
+ uint32_t sv599_minlinkthroughput;
+ uint32_t sv599_linkinfovalidtime;
+ uint32_t sv599_scavqosinfoupdatetime;
+ uint32_t sv599_maxworkitemidletime;
+};
+
+struct SERVER_INFO_598 {
+ uint32_t sv598_maxrawworkitems;
+ uint32_t sv598_maxthreadsperqueue;
+ uint32_t sv598_producttype;
+ uint32_t sv598_serversize;
+ uint32_t sv598_connectionlessautodisc;
+ uint32_t sv598_sharingviolationretries;
+ uint32_t sv598_sharingviolationdelay;
+ uint32_t sv598_maxglobalopensearch;
+ uint32_t sv598_removeduplicatesearches;
+ uint32_t sv598_lockviolationoffset;
+ uint32_t sv598_lockviolationdelay;
+ uint32_t sv598_mdlreadswitchover;
+ uint32_t sv598_cachedopenlimit;
+ uint32_t sv598_otherqueueaffinity;
+ uint8_t sv598_restrictnullsessaccess;
+ uint8_t sv598_enablewfw311directipx;
+ uint32_t sv598_queuesamplesecs;
+ uint32_t sv598_balancecount;
+ uint32_t sv598_preferredaffinity;
+ uint32_t sv598_maxfreerfcbs;
+ uint32_t sv598_maxfreemfcbs;
+ uint32_t sv598_maxfreelfcbs;
+ uint32_t sv598_maxfreepagedpoolchunks;
+ uint32_t sv598_minpagedpoolchunksize;
+ uint32_t sv598_maxpagedpoolchunksize;
+ uint8_t sv598_sendsfrompreferredprocessor;
+ uint32_t sv598_cacheddirectorylimit;
+ uint32_t sv598_maxcopylength;
+ uint8_t sv598_enablecompression;
+ uint8_t sv598_autosharewks;
+ uint8_t sv598_autoshareserver;
+ uint8_t sv598_enablesecuritysignature;
+ uint8_t sv598_requiresecuritysignature;
+ uint32_t sv598_minclientbuffersize;
+ struct GUID sv598_serverguid;
+ uint32_t sv598_ConnectionNoSessionsTimeout;
+ uint32_t sv598_IdleThreadTimeOut;
+ uint8_t sv598_enableW9xsecuritysignature;
+ uint8_t sv598_enforcekerberosreauthentication;
+ uint8_t sv598_disabledos;
+ uint32_t sv598_lowdiskspaceminimum;
+ uint8_t sv598_disablestrictnamechecking;
+};
struct SERVER_INFO_1005 {
const char * sv1005_comment;
};
+struct SERVER_INFO_1107 {
+ uint32_t sv1107_users;
+};
+
+struct SERVER_INFO_1010 {
+ int32_t sv1010_disc;
+};
+
+struct SERVER_INFO_1016 {
+ uint8_t sv1016_hidden;
+};
+
+struct SERVER_INFO_1017 {
+ uint32_t sv1017_announce;
+};
+
+struct SERVER_INFO_1018 {
+ uint32_t sv1018_anndelta;
+};
+
+struct SERVER_INFO_1501 {
+ uint32_t sv1501_sessopens;
+};
+
+struct SERVER_INFO_1502 {
+ uint32_t sv1502_sessvcs;
+};
+
+struct SERVER_INFO_1503 {
+ uint32_t sv1503_opensearch;
+};
+
+struct SERVER_INFO_1506 {
+ uint32_t sv1506_maxworkitems;
+};
+
+struct SERVER_INFO_1509 {
+ uint32_t sv1509_maxrawbuflen;
+};
+
+struct SERVER_INFO_1510 {
+ uint32_t sv1510_sessusers;
+};
+
+struct SERVER_INFO_1511 {
+ uint32_t sv1511_sessconns;
+};
+
+struct SERVER_INFO_1512 {
+ uint32_t sv1512_maxnonpagedmemoryusage;
+};
+
+struct SERVER_INFO_1513 {
+ uint32_t sv1513_maxpagedmemoryusage;
+};
+
+struct SERVER_INFO_1514 {
+ uint8_t sv1514_enablesoftcompat;
+};
+
+struct SERVER_INFO_1515 {
+ uint8_t sv1515_enableforcedlogoff;
+};
+
+struct SERVER_INFO_1516 {
+ uint8_t sv1516_timesource;
+};
+
+struct SERVER_INFO_1518 {
+ uint8_t sv1518_lmannounce;
+};
+
+struct SERVER_INFO_1520 {
+ uint32_t sv1520_maxcopyreadlen;
+};
+
+struct SERVER_INFO_1521 {
+ uint32_t sv1521_maxcopywritelen;
+};
+
+struct SERVER_INFO_1522 {
+ uint32_t sv1522_minkeepsearch;
+};
+
+struct SERVER_INFO_1523 {
+ uint32_t sv1523_maxkeepsearch;
+};
+
+struct SERVER_INFO_1524 {
+ uint32_t sv1524_minkeepcomplsearch;
+};
+
+struct SERVER_INFO_1525 {
+ uint32_t sv1525_maxkeepcomplsearch;
+};
+
+struct SERVER_INFO_1528 {
+ uint32_t sv1528_scavtimeout;
+};
+
+struct SERVER_INFO_1529 {
+ uint32_t sv1529_minrcvqueue;
+};
+
+struct SERVER_INFO_1530 {
+ uint32_t sv1530_minfreeworkitems;
+};
+
+struct SERVER_INFO_1533 {
+ uint32_t sv1533_maxmpxct;
+};
+
+struct SERVER_INFO_1534 {
+ uint32_t sv1534_oplockbreakwait;
+};
+
+struct SERVER_INFO_1535 {
+ uint32_t sv1535_oplockbreakresponsewait;
+};
+
+struct SERVER_INFO_1536 {
+ uint8_t sv1536_enableoplocks;
+};
+
+struct SERVER_INFO_1537 {
+ uint8_t sv1537_enableoplockforceclose;
+};
+
+struct SERVER_INFO_1538 {
+ uint8_t sv1538_enablefcbopens;
+};
+
+struct SERVER_INFO_1539 {
+ uint8_t sv1539_enableraw;
+};
+
+struct SERVER_INFO_1540 {
+ uint8_t sv1540_enablesharednetdrives;
+};
+
+struct SERVER_INFO_1541 {
+ uint8_t sv1541_minfreeconnections;
+};
+
+struct SERVER_INFO_1542 {
+ uint8_t sv1542_maxfreeconnections;
+};
+
+struct SERVER_INFO_1543 {
+ uint32_t sv1543_initsesstable;
+};
+
+struct SERVER_INFO_1544 {
+ uint32_t sv1544_initconntable;
+};
+
+struct SERVER_INFO_1545 {
+ uint32_t sv1545_initfiletable;
+};
+
+struct SERVER_INFO_1546 {
+ uint32_t sv1546_initsearchtable;
+};
+
+struct SERVER_INFO_1547 {
+ uint32_t sv1547_alertschedule;
+};
+
+struct SERVER_INFO_1548 {
+ uint32_t sv1548_errorthreshold;
+};
+
+struct SERVER_INFO_1549 {
+ uint32_t sv1549_networkerrorthreshold;
+};
+
+struct SERVER_INFO_1550 {
+ uint32_t sv1550_diskspacethreshold;
+};
+
+struct SERVER_INFO_1552 {
+ uint32_t sv1552_maxlinkdelay;
+};
+
+struct SERVER_INFO_1553 {
+ uint32_t sv1553_minlinkthroughput;
+};
+
+struct SERVER_INFO_1554 {
+ uint32_t sv1554_linkinfovalidtime;
+};
+
+struct SERVER_INFO_1555 {
+ uint32_t sv1555_scavqosinfoupdatetime;
+};
+
+struct SERVER_INFO_1556 {
+ uint32_t sv1556_maxworkitemidletime;
+};
+
+struct SERVER_INFO_1557 {
+ uint32_t sv1557_maxrawworkitems;
+};
+
+struct SERVER_INFO_1560 {
+ uint32_t sv1560_producttype;
+};
+
+struct SERVER_INFO_1561 {
+ uint32_t sv1561_serversize;
+};
+
+struct SERVER_INFO_1562 {
+ uint32_t sv1562_connectionlessautodisc;
+};
+
+struct SERVER_INFO_1563 {
+ uint32_t sv1563_sharingviolationretries;
+};
+
+struct SERVER_INFO_1564 {
+ uint32_t sv1564_sharingviolationdelay;
+};
+
+struct SERVER_INFO_1565 {
+ uint32_t sv1565_maxglobalopensearch;
+};
+
+struct SERVER_INFO_1566 {
+ uint8_t sv1566_removeduplicatesearches;
+};
+
+struct SERVER_INFO_1567 {
+ uint32_t sv1567_lockviolationretries;
+};
+
+struct SERVER_INFO_1568 {
+ uint32_t sv1568_lockviolationoffset;
+};
+
+struct SERVER_INFO_1569 {
+ uint32_t sv1569_lockviolationdelay;
+};
+
+struct SERVER_INFO_1570 {
+ uint32_t sv1570_mdlreadswitchover;
+};
+
+struct SERVER_INFO_1571 {
+ uint32_t sv1571_cachedopenlimit;
+};
+
+struct SERVER_INFO_1572 {
+ uint32_t sv1572_criticalthreads;
+};
+
+struct SERVER_INFO_1573 {
+ uint32_t sv1573_restrictnullsessaccess;
+};
+
+struct SERVER_INFO_1574 {
+ uint32_t sv1574_enablewfw311directipx;
+};
+
+struct SERVER_INFO_1575 {
+ uint32_t sv1575_otherqueueaffinity;
+};
+
+struct SERVER_INFO_1576 {
+ uint32_t sv1576_queuesamplesecs;
+};
+
+struct SERVER_INFO_1577 {
+ uint32_t sv1577_balancecount;
+};
+
+struct SERVER_INFO_1578 {
+ uint32_t sv1578_preferredaffinity;
+};
+
+struct SERVER_INFO_1579 {
+ uint32_t sv1579_maxfreerfcbs;
+};
+
+struct SERVER_INFO_1580 {
+ uint32_t sv1580_maxfreemfcbs;
+};
+
+struct SERVER_INFO_1581 {
+ uint32_t sv1581_maxfreemlcbs;
+};
+
+struct SERVER_INFO_1582 {
+ uint32_t sv1582_maxfreepagedpoolchunks;
+};
+
+struct SERVER_INFO_1583 {
+ uint32_t sv1583_minpagedpoolchunksize;
+};
+
+struct SERVER_INFO_1584 {
+ uint32_t sv1584_maxpagedpoolchunksize;
+};
+
+struct SERVER_INFO_1585 {
+ uint8_t sv1585_sendsfrompreferredprocessor;
+};
+
+struct SERVER_INFO_1586 {
+ uint32_t sv1586_maxthreadsperqueue;
+};
+
+struct SERVER_INFO_1587 {
+ uint32_t sv1587_cacheddirectorylimit;
+};
+
+struct SERVER_INFO_1588 {
+ uint32_t sv1588_maxcopylength;
+};
+
+struct SERVER_INFO_1590 {
+ uint32_t sv1590_enablecompression;
+};
+
+struct SERVER_INFO_1591 {
+ uint32_t sv1591_autosharewks;
+};
+
+struct SERVER_INFO_1592 {
+ uint32_t sv1592_autosharewks;
+};
+
+struct SERVER_INFO_1593 {
+ uint32_t sv1593_enablesecuritysignature;
+};
+
+struct SERVER_INFO_1594 {
+ uint32_t sv1594_requiresecuritysignature;
+};
+
+struct SERVER_INFO_1595 {
+ uint32_t sv1595_minclientbuffersize;
+};
+
+struct SERVER_INFO_1596 {
+ uint32_t sv1596_ConnectionNoSessionsTimeout;
+};
+
+struct SERVER_INFO_1597 {
+ uint32_t sv1597_IdleThreadTimeOut;
+};
+
+struct SERVER_INFO_1598 {
+ uint32_t sv1598_enableW9xsecuritysignature;
+};
+
+struct SERVER_INFO_1599 {
+ uint8_t sv1598_enforcekerberosreauthentication;
+};
+
+struct SERVER_INFO_1600 {
+ uint8_t sv1598_disabledos;
+};
+
+struct SERVER_INFO_1601 {
+ uint32_t sv1598_lowdiskspaceminimum;
+};
+
+struct SERVER_INFO_1602 {
+ uint8_t sv_1598_disablestrictnamechecking;
+};
+
struct USER_INFO_0 {
const char * usri0_name;
};
diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c
index d77145eef3..02396a7bba 100644
--- a/source3/lib/netapi/serverinfo.c
+++ b/source3/lib/netapi/serverinfo.c
@@ -94,8 +94,108 @@ static NTSTATUS map_server_info_to_SERVER_INFO_buffer(TALLOC_CTX *mem_ctx,
struct SERVER_INFO_100 i100;
struct SERVER_INFO_101 i101;
struct SERVER_INFO_102 i102;
+ struct SERVER_INFO_402 i402;
+ struct SERVER_INFO_403 i403;
+ struct SERVER_INFO_502 i502;
+ struct SERVER_INFO_503 i503;
+ struct SERVER_INFO_598 i598;
+ struct SERVER_INFO_599 i599;
struct SERVER_INFO_1005 i1005;
-
+#if 0
+ struct SERVER_INFO_1010 i1010;
+ struct SERVER_INFO_1016 i1016;
+ struct SERVER_INFO_1017 i1017;
+ struct SERVER_INFO_1018 i1018;
+ struct SERVER_INFO_1107 i1107;
+ struct SERVER_INFO_1501 i1501;
+ struct SERVER_INFO_1502 i1502;
+ struct SERVER_INFO_1503 i1503;
+ struct SERVER_INFO_1506 i1506;
+ struct SERVER_INFO_1509 i1509;
+ struct SERVER_INFO_1510 i1510;
+ struct SERVER_INFO_1511 i1511;
+ struct SERVER_INFO_1512 i1512;
+ struct SERVER_INFO_1513 i1513;
+ struct SERVER_INFO_1514 i1514;
+ struct SERVER_INFO_1515 i1515;
+ struct SERVER_INFO_1516 i1516;
+ struct SERVER_INFO_1518 i1518;
+ struct SERVER_INFO_1520 i1520;
+ struct SERVER_INFO_1521 i1521;
+ struct SERVER_INFO_1522 i1522;
+ struct SERVER_INFO_1523 i1523;
+ struct SERVER_INFO_1524 i1524;
+ struct SERVER_INFO_1525 i1525;
+ struct SERVER_INFO_1528 i1528;
+ struct SERVER_INFO_1529 i1529;
+ struct SERVER_INFO_1530 i1530;
+ struct SERVER_INFO_1533 i1533;
+ struct SERVER_INFO_1534 i1534;
+ struct SERVER_INFO_1535 i1535;
+ struct SERVER_INFO_1536 i1536;
+ struct SERVER_INFO_1537 i1537;
+ struct SERVER_INFO_1538 i1538;
+ struct SERVER_INFO_1539 i1539;
+ struct SERVER_INFO_1540 i1540;
+ struct SERVER_INFO_1541 i1541;
+ struct SERVER_INFO_1542 i1542;
+ struct SERVER_INFO_1543 i1543;
+ struct SERVER_INFO_1544 i1544;
+ struct SERVER_INFO_1545 i1545;
+ struct SERVER_INFO_1546 i1546;
+ struct SERVER_INFO_1547 i1547;
+ struct SERVER_INFO_1548 i1548;
+ struct SERVER_INFO_1549 i1549;
+ struct SERVER_INFO_1550 i1550;
+ struct SERVER_INFO_1552 i1552;
+ struct SERVER_INFO_1553 i1553;
+ struct SERVER_INFO_1554 i1554;
+ struct SERVER_INFO_1555 i1555;
+ struct SERVER_INFO_1556 i1556;
+ struct SERVER_INFO_1557 i1557;
+ struct SERVER_INFO_1560 i1560;
+ struct SERVER_INFO_1561 i1561;
+ struct SERVER_INFO_1562 i1562;
+ struct SERVER_INFO_1563 i1563;
+ struct SERVER_INFO_1564 i1564;
+ struct SERVER_INFO_1565 i1565;
+ struct SERVER_INFO_1566 i1566;
+ struct SERVER_INFO_1567 i1567;
+ struct SERVER_INFO_1568 i1568;
+ struct SERVER_INFO_1569 i1569;
+ struct SERVER_INFO_1570 i1570;
+ struct SERVER_INFO_1571 i1571;
+ struct SERVER_INFO_1572 i1572;
+ struct SERVER_INFO_1573 i1573;
+ struct SERVER_INFO_1574 i1574;
+ struct SERVER_INFO_1575 i1575;
+ struct SERVER_INFO_1576 i1576;
+ struct SERVER_INFO_1577 i1577;
+ struct SERVER_INFO_1578 i1578;
+ struct SERVER_INFO_1579 i1579;
+ struct SERVER_INFO_1580 i1580;
+ struct SERVER_INFO_1581 i1581;
+ struct SERVER_INFO_1582 i1582;
+ struct SERVER_INFO_1583 i1583;
+ struct SERVER_INFO_1584 i1584;
+ struct SERVER_INFO_1585 i1585;
+ struct SERVER_INFO_1586 i1586;
+ struct SERVER_INFO_1587 i1587;
+ struct SERVER_INFO_1588 i1588;
+ struct SERVER_INFO_1590 i1590;
+ struct SERVER_INFO_1591 i1591;
+ struct SERVER_INFO_1592 i1592;
+ struct SERVER_INFO_1593 i1593;
+ struct SERVER_INFO_1594 i1594;
+ struct SERVER_INFO_1595 i1595;
+ struct SERVER_INFO_1596 i1596;
+ struct SERVER_INFO_1597 i1597;
+ struct SERVER_INFO_1598 i1598;
+ struct SERVER_INFO_1599 i1599;
+ struct SERVER_INFO_1600 i1600;
+ struct SERVER_INFO_1601 i1601;
+ struct SERVER_INFO_1602 i1602;
+#endif
uint32_t num_info = 0;
switch (level) {
@@ -141,6 +241,173 @@ static NTSTATUS map_server_info_to_SERVER_INFO_buffer(TALLOC_CTX *mem_ctx,
&num_info);
break;
+ case 402:
+
+ i402.sv402_ulist_mtime = i->info402->ulist_mtime;
+ i402.sv402_glist_mtime = i->info402->glist_mtime;
+ i402.sv402_alist_mtime = i->info402->alist_mtime;
+ i402.sv402_alerts = talloc_strdup(mem_ctx, i->info402->alerts);
+ i402.sv402_security = i->info402->security;
+ i402.sv402_numadmin = i->info402->numadmin;
+ i402.sv402_lanmask = i->info402->lanmask;
+ i402.sv402_guestacct = talloc_strdup(mem_ctx, i->info402->guestaccount);
+ i402.sv402_chdevs = i->info402->chdevs;
+ i402.sv402_chdevq = i->info402->chdevqs;
+ i402.sv402_chdevjobs = i->info402->chdevjobs;
+ i402.sv402_connections = i->info402->connections;
+ i402.sv402_shares = i->info402->shares;
+ i402.sv402_openfiles = i->info402->openfiles;
+ i402.sv402_sessopens = i->info402->sessopen;
+ i402.sv402_sessvcs = i->info402->sesssvc;
+ i402.sv402_sessreqs = i->info402->sessreqs;
+ i402.sv402_opensearch = i->info402->opensearch;
+ i402.sv402_activelocks = i->info402->activelocks;
+ i402.sv402_numreqbuf = i->info402->numreqbufs;
+ i402.sv402_sizreqbuf = i->info402->sizereqbufs;
+ i402.sv402_numbigbuf = i->info402->numbigbufs;
+ i402.sv402_numfiletasks = i->info402->numfiletasks;
+ i402.sv402_alertsched = i->info402->alertsched;
+ i402.sv402_erroralert = i->info402->erroralert;
+ i402.sv402_logonalert = i->info402->logonalert;
+ i402.sv402_accessalert = i->info402->accessalert;
+ i402.sv402_diskalert = i->info402->diskalert;
+ i402.sv402_netioalert = i->info402->netioalert;
+ i402.sv402_maxauditsz = i->info402->maxaudits;
+ i402.sv402_srvheuristics = i->info402->srvheuristics;
+
+ ADD_TO_ARRAY(mem_ctx, struct SERVER_INFO_402, i402,
+ (struct SERVER_INFO_402 **)buffer,
+ &num_info);
+ break;
+
+ case 403:
+
+ i403.sv403_ulist_mtime = i->info403->ulist_mtime;
+ i403.sv403_glist_mtime = i->info403->glist_mtime;
+ i403.sv403_alist_mtime = i->info403->alist_mtime;
+ i403.sv403_alerts = talloc_strdup(mem_ctx, i->info403->alerts);
+ i403.sv403_security = i->info403->security;
+ i403.sv403_numadmin = i->info403->numadmin;
+ i403.sv403_lanmask = i->info403->lanmask;
+ i403.sv403_guestacct = talloc_strdup(mem_ctx, i->info403->guestaccount);
+ i403.sv403_chdevs = i->info403->chdevs;
+ i403.sv403_chdevq = i->info403->chdevqs;
+ i403.sv403_chdevjobs = i->info403->chdevjobs;
+ i403.sv403_connections = i->info403->connections;
+ i403.sv403_shares = i->info403->shares;
+ i403.sv403_openfiles = i->info403->openfiles;
+ i403.sv403_sessopens = i->info403->sessopen;
+ i403.sv403_sessvcs = i->info403->sesssvc;
+ i403.sv403_sessreqs = i->info403->sessreqs;
+ i403.sv403_opensearch = i->info403->opensearch;
+ i403.sv403_activelocks = i->info403->activelocks;
+ i403.sv403_numreqbuf = i->info403->numreqbufs;
+ i403.sv403_sizreqbuf = i->info403->sizereqbufs;
+ i403.sv403_numbigbuf = i->info403->numbigbufs;
+ i403.sv403_numfiletasks = i->info403->numfiletasks;
+ i403.sv403_alertsched = i->info403->alertsched;
+ i403.sv403_erroralert = i->info403->erroralert;
+ i403.sv403_logonalert = i->info403->logonalert;
+ i403.sv403_accessalert = i->info403->accessalert;
+ i403.sv403_diskalert = i->info403->diskalert;
+ i403.sv403_netioalert = i->info403->netioalert;
+ i403.sv403_maxauditsz = i->info403->maxaudits;
+ i403.sv403_srvheuristics = i->info403->srvheuristics;
+ i403.sv403_auditedevents = i->info403->auditedevents;
+ i403.sv403_autoprofile = i->info403->auditprofile;
+ i403.sv403_autopath = talloc_strdup(mem_ctx, i->info403->autopath);
+
+ ADD_TO_ARRAY(mem_ctx, struct SERVER_INFO_403, i403,
+ (struct SERVER_INFO_403 **)buffer,
+ &num_info);
+ break;
+
+ case 502:
+ i502.sv502_sessopens = i->info502->sessopen;
+ i502.sv502_sessvcs = i->info502->sesssvc;
+ i502.sv502_opensearch = i->info502->opensearch;
+ i502.sv502_sizreqbuf = i->info502->sizereqbufs;
+ i502.sv502_initworkitems = i->info502->initworkitems;
+ i502.sv502_maxworkitems = i->info502->maxworkitems;
+ i502.sv502_rawworkitems = i->info502->rawworkitems;
+ i502.sv502_irpstacksize = i->info502->irpstacksize;
+ i502.sv502_maxrawbuflen = i->info502->maxrawbuflen;
+ i502.sv502_sessusers = i->info502->sessusers;
+ i502.sv502_sessconns = i->info502->sessconns;
+ i502.sv502_maxpagedmemoryusage = i->info502->maxpagedmemoryusage;
+ i502.sv502_maxnonpagedmemoryusage = i->info502->maxnonpagedmemoryusage;
+ i502.sv502_enablesoftcompat = i->info502->enablesoftcompat;
+ i502.sv502_enableforcedlogoff = i->info502->enableforcedlogoff;
+ i502.sv502_timesource = i->info502->timesource;
+ i502.sv502_acceptdownlevelapis = i->info502->acceptdownlevelapis;
+ i502.sv502_lmannounce = i->info502->lmannounce;
+
+ ADD_TO_ARRAY(mem_ctx, struct SERVER_INFO_502, i502,
+ (struct SERVER_INFO_502 **)buffer,
+ &num_info);
+ break;
+
+ case 503:
+ i503.sv503_sessopens = i->info503->sessopen;
+ i503.sv503_sessvcs = i->info503->sesssvc;
+ i503.sv503_opensearch = i->info503->opensearch;
+ i503.sv503_sizreqbuf = i->info503->sizereqbufs;
+ i503.sv503_initworkitems = i->info503->initworkitems;
+ i503.sv503_maxworkitems = i->info503->maxworkitems;
+ i503.sv503_rawworkitems = i->info503->rawworkitems;
+ i503.sv503_irpstacksize = i->info503->irpstacksize;
+ i503.sv503_maxrawbuflen = i->info503->maxrawbuflen;
+ i503.sv503_sessusers = i->info503->sessusers;
+ i503.sv503_sessconns = i->info503->sessconns;
+ i503.sv503_maxpagedmemoryusage = i->info503->maxpagedmemoryusage;
+ i503.sv503_maxnonpagedmemoryusage = i->info503->maxnonpagedmemoryusage;
+ i503.sv503_enablesoftcompat = i->info503->enablesoftcompat;
+ i503.sv503_enableforcedlogoff = i->info503->enableforcedlogoff;
+ i503.sv503_timesource = i->info503->timesource;
+ i503.sv503_acceptdownlevelapis = i->info503->acceptdownlevelapis;
+ i503.sv503_lmannounce = i->info503->lmannounce;
+ i503.sv503_domain = talloc_strdup(mem_ctx, i->info503->domain);
+ i503.sv503_maxcopyreadlen = i->info503->maxcopyreadlen;
+ i503.sv503_maxcopywritelen = i->info503->maxcopywritelen;
+ i503.sv503_minkeepsearch = i->info503->minkeepsearch;
+ i503.sv503_maxkeepsearch = i->info503->maxkeepsearch;
+ i503.sv503_minkeepcomplsearch = i->info503->minkeepcomplsearch;
+ i503.sv503_maxkeepcomplsearch = i->info503->maxkeepcomplsearch;
+ i503.sv503_threadcountadd = i->info503->threadcountadd;
+ i503.sv503_numblockthreads = i->info503->numlockthreads;
+ i503.sv503_scavtimeout = i->info503->scavtimeout;
+ i503.sv503_minrcvqueue = i->info503->minrcvqueue;
+ i503.sv503_minfreeworkitems = i->info503->minfreeworkitems;
+ i503.sv503_xactmemsize = i->info503->xactmemsize;
+ i503.sv503_threadpriority = i->info503->threadpriority;
+ i503.sv503_maxmpxct = i->info503->maxmpxct;
+ i503.sv503_oplockbreakwait = i->info503->oplockbreakwait;
+ i503.sv503_oplockbreakresponsewait = i->info503->oplockbreakresponsewait;
+ i503.sv503_enableoplocks = i->info503->enableoplocks;
+ i503.sv503_enableoplockforceclose = i->info503->enableoplockforceclose;
+ i503.sv503_enablefcbopens = i->info503->enablefcbopens;
+ i503.sv503_enableraw = i->info503->enableraw;
+ i503.sv503_enablesharednetdrives = i->info503->enablesharednetdrives;
+ i503.sv503_minfreeconnections = i->info503->minfreeconnections;
+ i503.sv503_maxfreeconnections = i->info503->maxfreeconnections;
+
+ ADD_TO_ARRAY(mem_ctx, struct SERVER_INFO_503, i503,
+ (struct SERVER_INFO_503 **)buffer,
+ &num_info);
+ break;
+
+ case 598:
+ ADD_TO_ARRAY(mem_ctx, struct SERVER_INFO_598, i598,
+ (struct SERVER_INFO_598 **)buffer,
+ &num_info);
+ break;
+
+ case 599:
+ ADD_TO_ARRAY(mem_ctx, struct SERVER_INFO_599, i599,
+ (struct SERVER_INFO_599 **)buffer,
+ &num_info);
+ break;
+
case 1005:
i1005.sv1005_comment = talloc_strdup(mem_ctx, i->info1005->comment);
@@ -174,6 +441,9 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx,
case 100:
case 101:
case 102:
+ case 402:
+ case 502:
+ case 503:
case 1005:
break;
default:
diff --git a/source3/lib/netapi/tests/Makefile.in b/source3/lib/netapi/tests/Makefile.in
index 659f82c9d8..ddf4af5d0c 100644
--- a/source3/lib/netapi/tests/Makefile.in
+++ b/source3/lib/netapi/tests/Makefile.in
@@ -44,7 +44,7 @@ bin/.dummy:
CMDLINE_OBJ = common.o
NETAPIBUFFER_OBJ = netapibuffer.o
-NETAPITEST_OBJ = netapitest.o netlocalgroup.o netuser.o netgroup.o netdisplay.o netshare.o netfile.o $(CMDLINE_OBJ)
+NETAPITEST_OBJ = netapitest.o netlocalgroup.o netuser.o netgroup.o netdisplay.o netshare.o netfile.o netserver.o $(CMDLINE_OBJ)
bin/netapitest@EXEEXT@: $(BINARY_PREREQS) $(NETAPITEST_OBJ)
@echo Linking $@
diff --git a/source3/lib/netapi/tests/common.h b/source3/lib/netapi/tests/common.h
index 9320840909..7e05aaf657 100644
--- a/source3/lib/netapi/tests/common.h
+++ b/source3/lib/netapi/tests/common.h
@@ -43,6 +43,8 @@ NET_API_STATUS netapitest_share(struct libnetapi_ctx *ctx,
const char *hostname);
NET_API_STATUS netapitest_file(struct libnetapi_ctx *ctx,
const char *hostname);
+NET_API_STATUS netapitest_server(struct libnetapi_ctx *ctx,
+ const char *hostname);
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
diff --git a/source3/lib/netapi/tests/netapitest.c b/source3/lib/netapi/tests/netapitest.c
index 4a38f721d8..00e5b2ae40 100644
--- a/source3/lib/netapi/tests/netapitest.c
+++ b/source3/lib/netapi/tests/netapitest.c
@@ -89,6 +89,11 @@ int main(int argc, const char **argv)
goto out;
}
+ status = netapitest_server(ctx, hostname);
+ if (status) {
+ goto out;
+ }
+
out:
if (status != 0) {
printf("testsuite failed with: %s\n",
diff --git a/source3/lib/netapi/tests/netserver.c b/source3/lib/netapi/tests/netserver.c
new file mode 100644
index 0000000000..f7b9286be6
--- /dev/null
+++ b/source3/lib/netapi/tests/netserver.c
@@ -0,0 +1,61 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * NetServer testsuite
+ * Copyright (C) Guenther Deschner 2008
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <sys/types.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <netapi.h>
+
+#include "common.h"
+
+NET_API_STATUS netapitest_server(struct libnetapi_ctx *ctx,
+ const char *hostname)
+{
+ NET_API_STATUS status = 0;
+ uint32_t levels[] = { 100, 101, 102, 402, 403, 502, 503, 1005 };
+ int i;
+
+ printf("NetServer tests\n");
+
+ /* basic queries */
+ for (i=0; i<ARRAY_SIZE(levels); i++) {
+ uint8_t *buffer = NULL;
+ printf("testing NetServerGetInfo level %d\n", levels[i]);
+
+ status = NetServerGetInfo(hostname, levels[i], &buffer);
+ if (status && status != 124) {
+ NETAPI_STATUS(ctx, status, "NetServerGetInfo");
+ goto out;
+ }
+ }
+
+ status = 0;
+
+ printf("NetServer tests succeeded\n");
+ out:
+ if (status != 0) {
+ printf("NetServer testsuite failed with: %s\n",
+ libnetapi_get_error_string(ctx, status));
+ }
+
+ return status;
+}
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 78431d93c8..b9a7f8788d 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1051,17 +1051,17 @@ static void open_socket_out_connected(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct open_socket_out_state *state = talloc_get_type_abort(
req->private_data, struct open_socket_out_state);
- NTSTATUS status;
+ int err;
int sys_errno;
- status = async_connect_recv(subreq, &sys_errno);
+ err = async_connect_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
- if (NT_STATUS_IS_OK(status)) {
+ if (err == 0) {
async_req_done(req);
return;
}
- if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)
+ if ((sys_errno == ETIME)
|| (sys_errno == EINPROGRESS)
|| (sys_errno == EALREADY)
|| (sys_errno == EAGAIN)) {
@@ -1082,7 +1082,7 @@ static void open_socket_out_connected(struct async_req *subreq)
}
if (!async_req_set_timeout(subreq, state->ev,
timeval_set(0, state->wait_nsec))) {
- async_req_nterror(req, NT_STATUS_NO_MEMORY);
+ async_req_error(req, ENOMEM);
return;
}
subreq->async.fn = open_socket_out_connected;
@@ -1098,17 +1098,17 @@ static void open_socket_out_connected(struct async_req *subreq)
#endif
/* real error */
- async_req_nterror(req, map_nt_error_from_unix(sys_errno));
+ async_req_error(req, sys_errno);
}
NTSTATUS open_socket_out_recv(struct async_req *req, int *pfd)
{
struct open_socket_out_state *state = talloc_get_type_abort(
req->private_data, struct open_socket_out_state);
- NTSTATUS status;
+ int err;
- if (async_req_is_nterror(req, &status)) {
- return status;
+ if (async_req_is_errno(req, &err)) {
+ return map_nt_error_from_unix(err);
}
*pfd = state->fd;
state->fd = -1;
diff --git a/source3/lib/wb_reqtrans.c b/source3/lib/wb_reqtrans.c
index b56c0fd4d3..9bf6f29105 100644
--- a/source3/lib/wb_reqtrans.c
+++ b/source3/lib/wb_reqtrans.c
@@ -20,7 +20,7 @@
*/
#include "includes.h"
-#include "winbindd/winbindd.h"
+#include "wbc_async.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
@@ -32,6 +32,57 @@ struct req_read_state {
int fd;
};
+bool async_req_is_wbcerr(struct async_req *req, wbcErr *pwbc_err)
+{
+ enum async_req_state state;
+ uint64_t error;
+ if (!async_req_is_error(req, &state, &error)) {
+ *pwbc_err = WBC_ERR_SUCCESS;
+ return false;
+ }
+
+ switch (state) {
+ case ASYNC_REQ_USER_ERROR:
+ *pwbc_err = error;
+ break;
+ case ASYNC_REQ_TIMED_OUT:
+ *pwbc_err = WBC_ERR_UNKNOWN_FAILURE;
+ break;
+ case ASYNC_REQ_NO_MEMORY:
+ *pwbc_err = WBC_ERR_NO_MEMORY;
+ break;
+ default:
+ *pwbc_err = WBC_ERR_UNKNOWN_FAILURE;
+ break;
+ }
+ return true;
+}
+
+wbcErr map_wbc_err_from_errno(int error)
+{
+ switch(error) {
+ case EPERM:
+ case EACCES:
+ return WBC_ERR_AUTH_ERROR;
+ case ENOMEM:
+ return WBC_ERR_NO_MEMORY;
+ case EIO:
+ default:
+ return WBC_ERR_UNKNOWN_FAILURE;
+ }
+}
+
+wbcErr async_req_simple_recv_wbcerr(struct async_req *req)
+{
+ wbcErr wbc_err;
+
+ if (async_req_is_wbcerr(req, &wbc_err)) {
+ return wbc_err;
+ }
+
+ return WBC_ERR_SUCCESS;
+}
+
static void wb_req_read_len(struct async_req *subreq);
static void wb_req_read_main(struct async_req *subreq);
static void wb_req_read_extra(struct async_req *subreq);
@@ -76,12 +127,13 @@ static void wb_req_read_len(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct req_read_state *state = talloc_get_type_abort(
req->private_data, struct req_read_state);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = recvall_recv(subreq);
+ ret = recvall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
@@ -89,7 +141,7 @@ static void wb_req_read_len(struct async_req *subreq)
DEBUG(0, ("wb_req_read_len: Invalid request size received: "
"%d (expected %d)\n", (int)state->wb_req->length,
(int)sizeof(struct winbindd_request)));
- async_req_nterror(req, NT_STATUS_INVALID_BUFFER_SIZE);
+ async_req_error(req, WBC_ERR_INVALID_RESPONSE);
return;
}
@@ -110,12 +162,13 @@ static void wb_req_read_main(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct req_read_state *state = talloc_get_type_abort(
req->private_data, struct req_read_state);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = recvall_recv(subreq);
+ ret = recvall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
@@ -124,7 +177,7 @@ static void wb_req_read_main(struct async_req *subreq)
DEBUG(3, ("Got request with %d bytes extra data on "
"unprivileged socket\n",
(int)state->wb_req->extra_len));
- async_req_nterror(req, NT_STATUS_INVALID_BUFFER_SIZE);
+ async_req_error(req, WBC_ERR_INVALID_RESPONSE);
return;
}
@@ -156,30 +209,31 @@ static void wb_req_read_extra(struct async_req *subreq)
{
struct async_req *req = talloc_get_type_abort(
subreq->async.priv, struct async_req);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = recvall_recv(subreq);
+ ret = recvall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
async_req_done(req);
}
-NTSTATUS wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
- struct winbindd_request **preq)
+wbcErr wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+ struct winbindd_request **preq)
{
struct req_read_state *state = talloc_get_type_abort(
req->private_data, struct req_read_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- if (async_req_is_nterror(req, &status)) {
- return status;
+ if (async_req_is_wbcerr(req, &wbc_err)) {
+ return wbc_err;
}
*preq = talloc_move(mem_ctx, &state->wb_req);
- return NT_STATUS_OK;
+ return WBC_ERR_SUCCESS;
}
struct req_write_state {
@@ -227,12 +281,13 @@ static void wb_req_write_main(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct req_write_state *state = talloc_get_type_abort(
req->private_data, struct req_write_state);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = sendall_recv(subreq);
+ ret = sendall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
@@ -256,21 +311,22 @@ static void wb_req_write_extra(struct async_req *subreq)
{
struct async_req *req = talloc_get_type_abort(
subreq->async.priv, struct async_req);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = sendall_recv(subreq);
+ ret = sendall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
async_req_done(req);
}
-NTSTATUS wb_req_write_recv(struct async_req *req)
+wbcErr wb_req_write_recv(struct async_req *req)
{
- return async_req_simple_recv_ntstatus(req);
+ return async_req_simple_recv_wbcerr(req);
}
struct resp_read_state {
@@ -322,12 +378,13 @@ static void wb_resp_read_len(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct resp_read_state *state = talloc_get_type_abort(
req->private_data, struct resp_read_state);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = recvall_recv(subreq);
+ ret = recvall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
@@ -336,7 +393,7 @@ static void wb_resp_read_len(struct async_req *subreq)
"%d (expected at least%d)\n",
(int)state->wb_resp->length,
(int)sizeof(struct winbindd_response)));
- async_req_nterror(req, NT_STATUS_INVALID_BUFFER_SIZE);
+ async_req_error(req, WBC_ERR_INVALID_RESPONSE);
return;
}
@@ -357,13 +414,14 @@ static void wb_resp_read_main(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct resp_read_state *state = talloc_get_type_abort(
req->private_data, struct resp_read_state);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
size_t extra_len;
- status = recvall_recv(subreq);
+ ret = recvall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
@@ -395,30 +453,31 @@ static void wb_resp_read_extra(struct async_req *subreq)
{
struct async_req *req = talloc_get_type_abort(
subreq->async.priv, struct async_req);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = recvall_recv(subreq);
+ ret = recvall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
async_req_done(req);
}
-NTSTATUS wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
- struct winbindd_response **presp)
+wbcErr wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+ struct winbindd_response **presp)
{
struct resp_read_state *state = talloc_get_type_abort(
req->private_data, struct resp_read_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- if (async_req_is_nterror(req, &status)) {
- return status;
+ if (async_req_is_wbcerr(req, &wbc_err)) {
+ return wbc_err;
}
*presp = talloc_move(mem_ctx, &state->wb_resp);
- return NT_STATUS_OK;
+ return WBC_ERR_SUCCESS;
}
struct resp_write_state {
@@ -466,12 +525,13 @@ static void wb_resp_write_main(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct resp_write_state *state = talloc_get_type_abort(
req->private_data, struct resp_write_state);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = sendall_recv(subreq);
+ ret = sendall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (ret < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
@@ -496,19 +556,20 @@ static void wb_resp_write_extra(struct async_req *subreq)
{
struct async_req *req = talloc_get_type_abort(
subreq->async.priv, struct async_req);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = sendall_recv(subreq);
+ ret = sendall_recv(subreq, &err);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (err < 0) {
+ async_req_error(req, map_wbc_err_from_errno(err));
return;
}
async_req_done(req);
}
-NTSTATUS wb_resp_write_recv(struct async_req *req)
+wbcErr wb_resp_write_recv(struct async_req *req)
{
- return async_req_simple_recv_ntstatus(req);
+ return async_req_simple_recv_wbcerr(req);
}
diff --git a/source3/lib/wbclient.c b/source3/lib/wbclient.c
index ae9a034cc8..4d3a609530 100644
--- a/source3/lib/wbclient.c
+++ b/source3/lib/wbclient.c
@@ -18,8 +18,7 @@
*/
#include "includes.h"
-#include "winbindd/winbindd.h"
-#include "winbindd/winbindd_proto.h"
+#include "wbc_async.h"
static int make_nonstd_fd(int fd)
{
@@ -131,12 +130,6 @@ static bool winbind_closed_fd(int fd)
return false;
}
-struct wb_context {
- struct async_req_queue *queue;
- int fd;
- bool is_priv;
-};
-
struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx)
{
struct wb_context *result;
@@ -163,7 +156,7 @@ static struct async_req *wb_connect_send(TALLOC_CTX *mem_ctx,
struct sockaddr_un sunaddr;
struct stat st;
char *path = NULL;
- NTSTATUS status;
+ wbcErr wbc_err;
if (wb_ctx->fd != -1) {
close(wb_ctx->fd);
@@ -173,13 +166,13 @@ static struct async_req *wb_connect_send(TALLOC_CTX *mem_ctx,
/* Check permissions on unix socket directory */
if (lstat(dir, &st) == -1) {
- status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
+ wbc_err = WBC_ERR_WINBIND_NOT_AVAILABLE;
goto post_status;
}
if (!S_ISDIR(st.st_mode) ||
(st.st_uid != 0 && st.st_uid != geteuid())) {
- status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
+ wbc_err = WBC_ERR_WINBIND_NOT_AVAILABLE;
goto post_status;
}
@@ -202,13 +195,13 @@ static struct async_req *wb_connect_send(TALLOC_CTX *mem_ctx,
if ((lstat(sunaddr.sun_path, &st) == -1)
|| !S_ISSOCK(st.st_mode)
|| (st.st_uid != 0 && st.st_uid != geteuid())) {
- status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
+ wbc_err = WBC_ERR_WINBIND_NOT_AVAILABLE;
goto post_status;
}
wb_ctx->fd = make_safe_fd(socket(AF_UNIX, SOCK_STREAM, 0));
if (wb_ctx->fd == -1) {
- status = map_nt_error_from_unix(errno);
+ wbc_err = map_wbc_err_from_errno(errno);
goto post_status;
}
@@ -226,24 +219,22 @@ static struct async_req *wb_connect_send(TALLOC_CTX *mem_ctx,
return req;
nomem:
- status = NT_STATUS_NO_MEMORY;
+ wbc_err = WBC_ERR_NO_MEMORY;
post_status:
req = async_req_new(mem_ctx);
if (req == NULL) {
return NULL;
}
- if (async_post_ntstatus(req, ev, status)) {
+ if (async_post_error(req, ev, wbc_err)) {
return req;
}
TALLOC_FREE(req);
return NULL;
}
-static NTSTATUS wb_connect_recv(struct async_req *req)
+static wbcErr wb_connect_recv(struct async_req *req)
{
- int dummy;
-
- return async_connect_recv(req, &dummy);
+ return async_req_simple_recv_wbcerr(req);
}
static struct winbindd_request *winbindd_request_copy(
@@ -295,8 +286,8 @@ static struct async_req *wb_int_trans_send(TALLOC_CTX *mem_ctx,
}
if (winbind_closed_fd(fd)) {
- if (!async_post_ntstatus(result, ev,
- NT_STATUS_PIPE_DISCONNECTED)) {
+ if (!async_post_error(result, ev,
+ WBC_ERR_WINBIND_NOT_AVAILABLE)) {
goto fail;
}
return result;
@@ -329,18 +320,18 @@ static void wb_int_trans_write_done(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct wb_int_trans_state *state = talloc_get_type_abort(
req->private_data, struct wb_int_trans_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_req_write_recv(subreq);
+ wbc_err = wb_req_write_recv(subreq);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (!WBC_ERROR_IS_OK(wbc_err)) {
+ async_req_error(req, wbc_err);
return;
}
subreq = wb_resp_read_send(state, state->ev, state->fd);
if (subreq == NULL) {
- async_req_nterror(req, NT_STATUS_NO_MEMORY);
+ async_req_error(req, WBC_ERR_NO_MEMORY);
}
subreq->async.fn = wb_int_trans_read_done;
subreq->async.priv = req;
@@ -352,32 +343,32 @@ static void wb_int_trans_read_done(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct wb_int_trans_state *state = talloc_get_type_abort(
req->private_data, struct wb_int_trans_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_resp_read_recv(subreq, state, &state->wb_resp);
+ wbc_err = wb_resp_read_recv(subreq, state, &state->wb_resp);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (!WBC_ERROR_IS_OK(wbc_err)) {
+ async_req_error(req, wbc_err);
return;
}
async_req_done(req);
}
-static NTSTATUS wb_int_trans_recv(struct async_req *req,
- TALLOC_CTX *mem_ctx,
- struct winbindd_response **presponse)
+static wbcErr wb_int_trans_recv(struct async_req *req,
+ TALLOC_CTX *mem_ctx,
+ struct winbindd_response **presponse)
{
struct wb_int_trans_state *state = talloc_get_type_abort(
req->private_data, struct wb_int_trans_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- if (async_req_is_nterror(req, &status)) {
- return status;
+ if (async_req_is_wbcerr(req, &wbc_err)) {
+ return wbc_err;
}
*presponse = talloc_move(mem_ctx, &state->wb_resp);
- return NT_STATUS_OK;
+ return WBC_ERR_SUCCESS;
}
static const char *winbindd_socket_dir(void)
@@ -448,13 +439,13 @@ static void wb_open_pipe_connect_nonpriv_done(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct wb_open_pipe_state *state = talloc_get_type_abort(
req->private_data, struct wb_open_pipe_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_connect_recv(subreq);
+ wbc_err = wb_connect_recv(subreq);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!WBC_ERROR_IS_OK(wbc_err)) {
state->wb_ctx->is_priv = true;
- async_req_nterror(req, status);
+ async_req_error(req, wbc_err);
return;
}
@@ -478,12 +469,12 @@ static void wb_open_pipe_ping_done(struct async_req *subreq)
struct wb_open_pipe_state *state = talloc_get_type_abort(
req->private_data, struct wb_open_pipe_state);
struct winbindd_response *wb_resp;
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_int_trans_recv(subreq, state, &wb_resp);
+ wbc_err = wb_int_trans_recv(subreq, state, &wb_resp);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (!WBC_ERROR_IS_OK(wbc_err)) {
+ async_req_error(req, wbc_err);
return;
}
@@ -511,12 +502,12 @@ static void wb_open_pipe_getpriv_done(struct async_req *subreq)
struct wb_open_pipe_state *state = talloc_get_type_abort(
req->private_data, struct wb_open_pipe_state);
struct winbindd_response *wb_resp = NULL;
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_int_trans_recv(subreq, state, &wb_resp);
+ wbc_err = wb_int_trans_recv(subreq, state, &wb_resp);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (!WBC_ERROR_IS_OK(wbc_err)) {
+ async_req_error(req, wbc_err);
return;
}
@@ -540,21 +531,21 @@ static void wb_open_pipe_connect_priv_done(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct wb_open_pipe_state *state = talloc_get_type_abort(
req->private_data, struct wb_open_pipe_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_connect_recv(subreq);
+ wbc_err = wb_connect_recv(subreq);
TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ if (!WBC_ERROR_IS_OK(wbc_err)) {
+ async_req_error(req, wbc_err);
return;
}
state->wb_ctx->is_priv = true;
async_req_done(req);
}
-static NTSTATUS wb_open_pipe_recv(struct async_req *req)
+static wbcErr wb_open_pipe_recv(struct async_req *req)
{
- return async_req_simple_recv_ntstatus(req);
+ return async_req_simple_recv_wbcerr(req);
}
struct wb_trans_state {
@@ -631,27 +622,26 @@ struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
static bool wb_trans_retry(struct async_req *req,
struct wb_trans_state *state,
- NTSTATUS status)
+ wbcErr wbc_err)
{
struct async_req *subreq;
- if (NT_STATUS_IS_OK(status)) {
+ if (WBC_ERROR_IS_OK(wbc_err)) {
return false;
}
- if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)
- || NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
+ if (wbc_err == WBC_ERR_WINBIND_NOT_AVAILABLE) {
/*
* Winbind not around or we can't connect to the pipe. Fail
* immediately.
*/
- async_req_nterror(req, status);
+ async_req_error(req, wbc_err);
return true;
}
state->num_retries -= 1;
if (state->num_retries == 0) {
- async_req_nterror(req, status);
+ async_req_error(req, wbc_err);
return true;
}
@@ -685,7 +675,7 @@ static void wb_trans_retry_wait_done(struct async_req *subreq)
ret = async_wait_recv(subreq);
TALLOC_FREE(subreq);
if (ret) {
- async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+ async_req_error(req, WBC_ERR_UNKNOWN_FAILURE);
return;
}
@@ -704,12 +694,12 @@ static void wb_trans_connect_done(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct wb_trans_state *state = talloc_get_type_abort(
req->private_data, struct wb_trans_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_open_pipe_recv(subreq);
+ wbc_err = wb_open_pipe_recv(subreq);
TALLOC_FREE(subreq);
- if (wb_trans_retry(req, state, status)) {
+ if (wb_trans_retry(req, state, wbc_err)) {
return;
}
@@ -729,29 +719,29 @@ static void wb_trans_done(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct wb_trans_state *state = talloc_get_type_abort(
req->private_data, struct wb_trans_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- status = wb_int_trans_recv(subreq, state, &state->wb_resp);
+ wbc_err = wb_int_trans_recv(subreq, state, &state->wb_resp);
TALLOC_FREE(subreq);
- if (wb_trans_retry(req, state, status)) {
+ if (wb_trans_retry(req, state, wbc_err)) {
return;
}
async_req_done(req);
}
-NTSTATUS wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
- struct winbindd_response **presponse)
+wbcErr wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+ struct winbindd_response **presponse)
{
struct wb_trans_state *state = talloc_get_type_abort(
req->private_data, struct wb_trans_state);
- NTSTATUS status;
+ wbcErr wbc_err;
- if (async_req_is_nterror(req, &status)) {
- return status;
+ if (async_req_is_wbcerr(req, &wbc_err)) {
+ return wbc_err;
}
*presponse = talloc_move(mem_ctx, &state->wb_resp);
- return NT_STATUS_OK;
+ return WBC_ERR_SUCCESS;
}
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index b752fc2124..56d7b061a1 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -56,47 +56,14 @@ kerb_prompter(krb5_context ctx, void *data,
return 0;
}
-static bool smb_krb5_err_io_nstatus(TALLOC_CTX *mem_ctx,
- DATA_BLOB *edata_blob,
- KRB5_EDATA_NTSTATUS *edata)
-{
- bool ret = False;
- prs_struct ps;
-
- if (!mem_ctx || !edata_blob || !edata)
- return False;
-
- if (!prs_init(&ps, edata_blob->length, mem_ctx, UNMARSHALL))
- return False;
-
- if (!prs_copy_data_in(&ps, (char *)edata_blob->data, edata_blob->length))
- goto out;
-
- prs_set_offset(&ps, 0);
-
- if (!prs_ntstatus("ntstatus", &ps, 1, &edata->ntstatus))
- goto out;
-
- if (!prs_uint32("unknown1", &ps, 1, &edata->unknown1))
- goto out;
-
- if (!prs_uint32("unknown2", &ps, 1, &edata->unknown2)) /* only seen 00000001 here */
- goto out;
-
- ret = True;
- out:
- prs_mem_free(&ps);
-
- return ret;
-}
-
static bool smb_krb5_get_ntstatus_from_krb5_error(krb5_error *error,
NTSTATUS *nt_status)
{
DATA_BLOB edata;
DATA_BLOB unwrapped_edata;
TALLOC_CTX *mem_ctx;
- KRB5_EDATA_NTSTATUS parsed_edata;
+ struct KRB5_EDATA_NTSTATUS parsed_edata;
+ enum ndr_err_code ndr_err;
#ifdef HAVE_E_DATA_POINTER_IN_KRB5_ERROR
edata = data_blob(error->e_data->data, error->e_data->length);
@@ -122,7 +89,10 @@ static bool smb_krb5_err_io_nstatus(TALLOC_CTX *mem_ctx,
data_blob_free(&edata);
- if (!smb_krb5_err_io_nstatus(mem_ctx, &unwrapped_edata, &parsed_edata)) {
+ ndr_err = ndr_pull_struct_blob_all(&unwrapped_edata, mem_ctx, NULL,
+ &parsed_edata,
+ (ndr_pull_flags_fn_t)ndr_pull_KRB5_EDATA_NTSTATUS);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
data_blob_free(&unwrapped_edata);
TALLOC_FREE(mem_ctx);
return False;
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index 169c3bba1d..023acaa638 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -369,7 +369,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
TALLOC_FREE( dsdriver_ctr );
TALLOC_FREE( dsspooler_ctr );
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
diff --git a/source3/librpc/gen_ndr/libnetapi.h b/source3/librpc/gen_ndr/libnetapi.h
index ae7acbf572..23a18331fe 100644
--- a/source3/librpc/gen_ndr/libnetapi.h
+++ b/source3/librpc/gen_ndr/libnetapi.h
@@ -107,10 +107,623 @@ struct SERVER_INFO_102 {
const char * sv102_userpath;
};
+struct SERVER_INFO_402 {
+ uint32_t sv402_ulist_mtime;
+ uint32_t sv402_glist_mtime;
+ uint32_t sv402_alist_mtime;
+ const char * sv402_alerts;
+ uint32_t sv402_security;
+ uint32_t sv402_numadmin;
+ uint32_t sv402_lanmask;
+ const char * sv402_guestacct;
+ uint32_t sv402_chdevs;
+ uint32_t sv402_chdevq;
+ uint32_t sv402_chdevjobs;
+ uint32_t sv402_connections;
+ uint32_t sv402_shares;
+ uint32_t sv402_openfiles;
+ uint32_t sv402_sessopens;
+ uint32_t sv402_sessvcs;
+ uint32_t sv402_sessreqs;
+ uint32_t sv402_opensearch;
+ uint32_t sv402_activelocks;
+ uint32_t sv402_numreqbuf;
+ uint32_t sv402_sizreqbuf;
+ uint32_t sv402_numbigbuf;
+ uint32_t sv402_numfiletasks;
+ uint32_t sv402_alertsched;
+ uint32_t sv402_erroralert;
+ uint32_t sv402_logonalert;
+ uint32_t sv402_accessalert;
+ uint32_t sv402_diskalert;
+ uint32_t sv402_netioalert;
+ uint32_t sv402_maxauditsz;
+ const char * sv402_srvheuristics;
+};
+
+struct SERVER_INFO_403 {
+ uint32_t sv403_ulist_mtime;
+ uint32_t sv403_glist_mtime;
+ uint32_t sv403_alist_mtime;
+ const char * sv403_alerts;
+ uint32_t sv403_security;
+ uint32_t sv403_numadmin;
+ uint32_t sv403_lanmask;
+ const char * sv403_guestacct;
+ uint32_t sv403_chdevs;
+ uint32_t sv403_chdevq;
+ uint32_t sv403_chdevjobs;
+ uint32_t sv403_connections;
+ uint32_t sv403_shares;
+ uint32_t sv403_openfiles;
+ uint32_t sv403_sessopens;
+ uint32_t sv403_sessvcs;
+ uint32_t sv403_sessreqs;
+ uint32_t sv403_opensearch;
+ uint32_t sv403_activelocks;
+ uint32_t sv403_numreqbuf;
+ uint32_t sv403_sizreqbuf;
+ uint32_t sv403_numbigbuf;
+ uint32_t sv403_numfiletasks;
+ uint32_t sv403_alertsched;
+ uint32_t sv403_erroralert;
+ uint32_t sv403_logonalert;
+ uint32_t sv403_accessalert;
+ uint32_t sv403_diskalert;
+ uint32_t sv403_netioalert;
+ uint32_t sv403_maxauditsz;
+ const char * sv403_srvheuristics;
+ uint32_t sv403_auditedevents;
+ uint32_t sv403_autoprofile;
+ const char * sv403_autopath;
+};
+
+struct SERVER_INFO_502 {
+ uint32_t sv502_sessopens;
+ uint32_t sv502_sessvcs;
+ uint32_t sv502_opensearch;
+ uint32_t sv502_sizreqbuf;
+ uint32_t sv502_initworkitems;
+ uint32_t sv502_maxworkitems;
+ uint32_t sv502_rawworkitems;
+ uint32_t sv502_irpstacksize;
+ uint32_t sv502_maxrawbuflen;
+ uint32_t sv502_sessusers;
+ uint32_t sv502_sessconns;
+ uint32_t sv502_maxpagedmemoryusage;
+ uint32_t sv502_maxnonpagedmemoryusage;
+ uint8_t sv502_enablesoftcompat;
+ uint8_t sv502_enableforcedlogoff;
+ uint8_t sv502_timesource;
+ uint8_t sv502_acceptdownlevelapis;
+ uint8_t sv502_lmannounce;
+};
+
+struct SERVER_INFO_503 {
+ uint32_t sv503_sessopens;
+ uint32_t sv503_sessvcs;
+ uint32_t sv503_opensearch;
+ uint32_t sv503_sizreqbuf;
+ uint32_t sv503_initworkitems;
+ uint32_t sv503_maxworkitems;
+ uint32_t sv503_rawworkitems;
+ uint32_t sv503_irpstacksize;
+ uint32_t sv503_maxrawbuflen;
+ uint32_t sv503_sessusers;
+ uint32_t sv503_sessconns;
+ uint32_t sv503_maxpagedmemoryusage;
+ uint32_t sv503_maxnonpagedmemoryusage;
+ uint8_t sv503_enablesoftcompat;
+ uint8_t sv503_enableforcedlogoff;
+ uint8_t sv503_timesource;
+ uint8_t sv503_acceptdownlevelapis;
+ uint8_t sv503_lmannounce;
+ const char * sv503_domain;
+ uint32_t sv503_maxcopyreadlen;
+ uint32_t sv503_maxcopywritelen;
+ uint32_t sv503_minkeepsearch;
+ uint32_t sv503_maxkeepsearch;
+ uint32_t sv503_minkeepcomplsearch;
+ uint32_t sv503_maxkeepcomplsearch;
+ uint32_t sv503_threadcountadd;
+ uint32_t sv503_numblockthreads;
+ uint32_t sv503_scavtimeout;
+ uint32_t sv503_minrcvqueue;
+ uint32_t sv503_minfreeworkitems;
+ uint32_t sv503_xactmemsize;
+ uint32_t sv503_threadpriority;
+ uint32_t sv503_maxmpxct;
+ uint32_t sv503_oplockbreakwait;
+ uint32_t sv503_oplockbreakresponsewait;
+ uint8_t sv503_enableoplocks;
+ uint8_t sv503_enableoplockforceclose;
+ uint8_t sv503_enablefcbopens;
+ uint8_t sv503_enableraw;
+ uint8_t sv503_enablesharednetdrives;
+ uint32_t sv503_minfreeconnections;
+ uint32_t sv503_maxfreeconnections;
+};
+
+struct SERVER_INFO_599 {
+ uint32_t sv599_sessopens;
+ uint32_t sv599_sessvcs;
+ uint32_t sv599_opensearch;
+ uint32_t sv599_sizreqbuf;
+ uint32_t sv599_initworkitems;
+ uint32_t sv599_maxworkitems;
+ uint32_t sv599_rawworkitems;
+ uint32_t sv599_irpstacksize;
+ uint32_t sv599_maxrawbuflen;
+ uint32_t sv599_sessusers;
+ uint32_t sv599_sessconns;
+ uint32_t sv599_maxpagedmemoryusage;
+ uint32_t sv599_maxnonpagedmemoryusage;
+ uint8_t sv599_enablesoftcompat;
+ uint8_t sv599_enableforcedlogoff;
+ uint8_t sv599_timesource;
+ uint8_t sv599_acceptdownlevelapis;
+ uint8_t sv599_lmannounce;
+ const char * sv599_domain;
+ uint32_t sv599_maxcopyreadlen;
+ uint32_t sv599_maxcopywritelen;
+ uint32_t sv599_minkeepsearch;
+ uint32_t sv599_maxkeepsearch;
+ uint32_t sv599_minkeepcomplsearch;
+ uint32_t sv599_maxkeepcomplsearch;
+ uint32_t sv599_threadcountadd;
+ uint32_t sv599_numblockthreads;
+ uint32_t sv599_scavtimeout;
+ uint32_t sv599_minrcvqueue;
+ uint32_t sv599_minfreeworkitems;
+ uint32_t sv599_xactmemsize;
+ uint32_t sv599_threadpriority;
+ uint32_t sv599_maxmpxct;
+ uint32_t sv599_oplockbreakwait;
+ uint32_t sv599_oplockbreakresponsewait;
+ uint8_t sv599_enableoplocks;
+ uint8_t sv599_enableoplockforceclose;
+ uint8_t sv599_enablefcbopens;
+ uint8_t sv599_enableraw;
+ uint8_t sv599_enablesharednetdrives;
+ uint32_t sv599_minfreeconnections;
+ uint32_t sv599_maxfreeconnections;
+ uint32_t sv599_initsesstable;
+ uint32_t sv599_initconntable;
+ uint32_t sv599_initfiletable;
+ uint32_t sv599_initsearchtable;
+ uint32_t sv599_alertschedule;
+ uint32_t sv599_errorthreshold;
+ uint32_t sv599_networkerrorthreshold;
+ uint32_t sv599_diskspacethreshold;
+ uint32_t sv599_reserved;
+ uint32_t sv599_maxlinkdelay;
+ uint32_t sv599_minlinkthroughput;
+ uint32_t sv599_linkinfovalidtime;
+ uint32_t sv599_scavqosinfoupdatetime;
+ uint32_t sv599_maxworkitemidletime;
+};
+
+struct SERVER_INFO_598 {
+ uint32_t sv598_maxrawworkitems;
+ uint32_t sv598_maxthreadsperqueue;
+ uint32_t sv598_producttype;
+ uint32_t sv598_serversize;
+ uint32_t sv598_connectionlessautodisc;
+ uint32_t sv598_sharingviolationretries;
+ uint32_t sv598_sharingviolationdelay;
+ uint32_t sv598_maxglobalopensearch;
+ uint32_t sv598_removeduplicatesearches;
+ uint32_t sv598_lockviolationoffset;
+ uint32_t sv598_lockviolationdelay;
+ uint32_t sv598_mdlreadswitchover;
+ uint32_t sv598_cachedopenlimit;
+ uint32_t sv598_otherqueueaffinity;
+ uint8_t sv598_restrictnullsessaccess;
+ uint8_t sv598_enablewfw311directipx;
+ uint32_t sv598_queuesamplesecs;
+ uint32_t sv598_balancecount;
+ uint32_t sv598_preferredaffinity;
+ uint32_t sv598_maxfreerfcbs;
+ uint32_t sv598_maxfreemfcbs;
+ uint32_t sv598_maxfreelfcbs;
+ uint32_t sv598_maxfreepagedpoolchunks;
+ uint32_t sv598_minpagedpoolchunksize;
+ uint32_t sv598_maxpagedpoolchunksize;
+ uint8_t sv598_sendsfrompreferredprocessor;
+ uint32_t sv598_cacheddirectorylimit;
+ uint32_t sv598_maxcopylength;
+ uint8_t sv598_enablecompression;
+ uint8_t sv598_autosharewks;
+ uint8_t sv598_autoshareserver;
+ uint8_t sv598_enablesecuritysignature;
+ uint8_t sv598_requiresecuritysignature;
+ uint32_t sv598_minclientbuffersize;
+ struct GUID sv598_serverguid;
+ uint32_t sv598_ConnectionNoSessionsTimeout;
+ uint32_t sv598_IdleThreadTimeOut;
+ uint8_t sv598_enableW9xsecuritysignature;
+ uint8_t sv598_enforcekerberosreauthentication;
+ uint8_t sv598_disabledos;
+ uint32_t sv598_lowdiskspaceminimum;
+ uint8_t sv598_disablestrictnamechecking;
+};
+
struct SERVER_INFO_1005 {
const char * sv1005_comment;
};
+struct SERVER_INFO_1107 {
+ uint32_t sv1107_users;
+};
+
+struct SERVER_INFO_1010 {
+ int32_t sv1010_disc;
+};
+
+struct SERVER_INFO_1016 {
+ uint8_t sv1016_hidden;
+};
+
+struct SERVER_INFO_1017 {
+ uint32_t sv1017_announce;
+};
+
+struct SERVER_INFO_1018 {
+ uint32_t sv1018_anndelta;
+};
+
+struct SERVER_INFO_1501 {
+ uint32_t sv1501_sessopens;
+};
+
+struct SERVER_INFO_1502 {
+ uint32_t sv1502_sessvcs;
+};
+
+struct SERVER_INFO_1503 {
+ uint32_t sv1503_opensearch;
+};
+
+struct SERVER_INFO_1506 {
+ uint32_t sv1506_maxworkitems;
+};
+
+struct SERVER_INFO_1509 {
+ uint32_t sv1509_maxrawbuflen;
+};
+
+struct SERVER_INFO_1510 {
+ uint32_t sv1510_sessusers;
+};
+
+struct SERVER_INFO_1511 {
+ uint32_t sv1511_sessconns;
+};
+
+struct SERVER_INFO_1512 {
+ uint32_t sv1512_maxnonpagedmemoryusage;
+};
+
+struct SERVER_INFO_1513 {
+ uint32_t sv1513_maxpagedmemoryusage;
+};
+
+struct SERVER_INFO_1514 {
+ uint8_t sv1514_enablesoftcompat;
+};
+
+struct SERVER_INFO_1515 {
+ uint8_t sv1515_enableforcedlogoff;
+};
+
+struct SERVER_INFO_1516 {
+ uint8_t sv1516_timesource;
+};
+
+struct SERVER_INFO_1518 {
+ uint8_t sv1518_lmannounce;
+};
+
+struct SERVER_INFO_1520 {
+ uint32_t sv1520_maxcopyreadlen;
+};
+
+struct SERVER_INFO_1521 {
+ uint32_t sv1521_maxcopywritelen;
+};
+
+struct SERVER_INFO_1522 {
+ uint32_t sv1522_minkeepsearch;
+};
+
+struct SERVER_INFO_1523 {
+ uint32_t sv1523_maxkeepsearch;
+};
+
+struct SERVER_INFO_1524 {
+ uint32_t sv1524_minkeepcomplsearch;
+};
+
+struct SERVER_INFO_1525 {
+ uint32_t sv1525_maxkeepcomplsearch;
+};
+
+struct SERVER_INFO_1528 {
+ uint32_t sv1528_scavtimeout;
+};
+
+struct SERVER_INFO_1529 {
+ uint32_t sv1529_minrcvqueue;
+};
+
+struct SERVER_INFO_1530 {
+ uint32_t sv1530_minfreeworkitems;
+};
+
+struct SERVER_INFO_1533 {
+ uint32_t sv1533_maxmpxct;
+};
+
+struct SERVER_INFO_1534 {
+ uint32_t sv1534_oplockbreakwait;
+};
+
+struct SERVER_INFO_1535 {
+ uint32_t sv1535_oplockbreakresponsewait;
+};
+
+struct SERVER_INFO_1536 {
+ uint8_t sv1536_enableoplocks;
+};
+
+struct SERVER_INFO_1537 {
+ uint8_t sv1537_enableoplockforceclose;
+};
+
+struct SERVER_INFO_1538 {
+ uint8_t sv1538_enablefcbopens;
+};
+
+struct SERVER_INFO_1539 {
+ uint8_t sv1539_enableraw;
+};
+
+struct SERVER_INFO_1540 {
+ uint8_t sv1540_enablesharednetdrives;
+};
+
+struct SERVER_INFO_1541 {
+ uint8_t sv1541_minfreeconnections;
+};
+
+struct SERVER_INFO_1542 {
+ uint8_t sv1542_maxfreeconnections;
+};
+
+struct SERVER_INFO_1543 {
+ uint32_t sv1543_initsesstable;
+};
+
+struct SERVER_INFO_1544 {
+ uint32_t sv1544_initconntable;
+};
+
+struct SERVER_INFO_1545 {
+ uint32_t sv1545_initfiletable;
+};
+
+struct SERVER_INFO_1546 {
+ uint32_t sv1546_initsearchtable;
+};
+
+struct SERVER_INFO_1547 {
+ uint32_t sv1547_alertschedule;
+};
+
+struct SERVER_INFO_1548 {
+ uint32_t sv1548_errorthreshold;
+};
+
+struct SERVER_INFO_1549 {
+ uint32_t sv1549_networkerrorthreshold;
+};
+
+struct SERVER_INFO_1550 {
+ uint32_t sv1550_diskspacethreshold;
+};
+
+struct SERVER_INFO_1552 {
+ uint32_t sv1552_maxlinkdelay;
+};
+
+struct SERVER_INFO_1553 {
+ uint32_t sv1553_minlinkthroughput;
+};
+
+struct SERVER_INFO_1554 {
+ uint32_t sv1554_linkinfovalidtime;
+};
+
+struct SERVER_INFO_1555 {
+ uint32_t sv1555_scavqosinfoupdatetime;
+};
+
+struct SERVER_INFO_1556 {
+ uint32_t sv1556_maxworkitemidletime;
+};
+
+struct SERVER_INFO_1557 {
+ uint32_t sv1557_maxrawworkitems;
+};
+
+struct SERVER_INFO_1560 {
+ uint32_t sv1560_producttype;
+};
+
+struct SERVER_INFO_1561 {
+ uint32_t sv1561_serversize;
+};
+
+struct SERVER_INFO_1562 {
+ uint32_t sv1562_connectionlessautodisc;
+};
+
+struct SERVER_INFO_1563 {
+ uint32_t sv1563_sharingviolationretries;
+};
+
+struct SERVER_INFO_1564 {
+ uint32_t sv1564_sharingviolationdelay;
+};
+
+struct SERVER_INFO_1565 {
+ uint32_t sv1565_maxglobalopensearch;
+};
+
+struct SERVER_INFO_1566 {
+ uint8_t sv1566_removeduplicatesearches;
+};
+
+struct SERVER_INFO_1567 {
+ uint32_t sv1567_lockviolationretries;
+};
+
+struct SERVER_INFO_1568 {
+ uint32_t sv1568_lockviolationoffset;
+};
+
+struct SERVER_INFO_1569 {
+ uint32_t sv1569_lockviolationdelay;
+};
+
+struct SERVER_INFO_1570 {
+ uint32_t sv1570_mdlreadswitchover;
+};
+
+struct SERVER_INFO_1571 {
+ uint32_t sv1571_cachedopenlimit;
+};
+
+struct SERVER_INFO_1572 {
+ uint32_t sv1572_criticalthreads;
+};
+
+struct SERVER_INFO_1573 {
+ uint32_t sv1573_restrictnullsessaccess;
+};
+
+struct SERVER_INFO_1574 {
+ uint32_t sv1574_enablewfw311directipx;
+};
+
+struct SERVER_INFO_1575 {
+ uint32_t sv1575_otherqueueaffinity;
+};
+
+struct SERVER_INFO_1576 {
+ uint32_t sv1576_queuesamplesecs;
+};
+
+struct SERVER_INFO_1577 {
+ uint32_t sv1577_balancecount;
+};
+
+struct SERVER_INFO_1578 {
+ uint32_t sv1578_preferredaffinity;
+};
+
+struct SERVER_INFO_1579 {
+ uint32_t sv1579_maxfreerfcbs;
+};
+
+struct SERVER_INFO_1580 {
+ uint32_t sv1580_maxfreemfcbs;
+};
+
+struct SERVER_INFO_1581 {
+ uint32_t sv1581_maxfreemlcbs;
+};
+
+struct SERVER_INFO_1582 {
+ uint32_t sv1582_maxfreepagedpoolchunks;
+};
+
+struct SERVER_INFO_1583 {
+ uint32_t sv1583_minpagedpoolchunksize;
+};
+
+struct SERVER_INFO_1584 {
+ uint32_t sv1584_maxpagedpoolchunksize;
+};
+
+struct SERVER_INFO_1585 {
+ uint8_t sv1585_sendsfrompreferredprocessor;
+};
+
+struct SERVER_INFO_1586 {
+ uint32_t sv1586_maxthreadsperqueue;
+};
+
+struct SERVER_INFO_1587 {
+ uint32_t sv1587_cacheddirectorylimit;
+};
+
+struct SERVER_INFO_1588 {
+ uint32_t sv1588_maxcopylength;
+};
+
+struct SERVER_INFO_1590 {
+ uint32_t sv1590_enablecompression;
+};
+
+struct SERVER_INFO_1591 {
+ uint32_t sv1591_autosharewks;
+};
+
+struct SERVER_INFO_1592 {
+ uint32_t sv1592_autosharewks;
+};
+
+struct SERVER_INFO_1593 {
+ uint32_t sv1593_enablesecuritysignature;
+};
+
+struct SERVER_INFO_1594 {
+ uint32_t sv1594_requiresecuritysignature;
+};
+
+struct SERVER_INFO_1595 {
+ uint32_t sv1595_minclientbuffersize;
+};
+
+struct SERVER_INFO_1596 {
+ uint32_t sv1596_ConnectionNoSessionsTimeout;
+};
+
+struct SERVER_INFO_1597 {
+ uint32_t sv1597_IdleThreadTimeOut;
+};
+
+struct SERVER_INFO_1598 {
+ uint32_t sv1598_enableW9xsecuritysignature;
+};
+
+struct SERVER_INFO_1599 {
+ uint8_t sv1598_enforcekerberosreauthentication;
+};
+
+struct SERVER_INFO_1600 {
+ uint8_t sv1598_disabledos;
+};
+
+struct SERVER_INFO_1601 {
+ uint32_t sv1598_lowdiskspaceminimum;
+};
+
+struct SERVER_INFO_1602 {
+ uint8_t sv_1598_disablestrictnamechecking;
+};
+
struct DOMAIN_CONTROLLER_INFO {
const char * domain_controller_name;
const char * domain_controller_address;
diff --git a/source3/librpc/gen_ndr/ndr_libnetapi.c b/source3/librpc/gen_ndr/ndr_libnetapi.c
index a11362b1c7..856e8a0c4e 100644
--- a/source3/librpc/gen_ndr/ndr_libnetapi.c
+++ b/source3/librpc/gen_ndr/ndr_libnetapi.c
@@ -264,6 +264,837 @@ _PUBLIC_ void ndr_print_SERVER_INFO_102(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_402(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_402 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_ulist_mtime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_glist_mtime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_alist_mtime));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv402_alerts));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_security));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_numadmin));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_lanmask));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv402_guestacct));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_chdevs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_chdevq));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_chdevjobs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_connections));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_shares));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_openfiles));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_sessopens));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_sessvcs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_sessreqs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_opensearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_activelocks));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_numreqbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_sizreqbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_numbigbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_numfiletasks));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_alertsched));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_erroralert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_logonalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_accessalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_diskalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_netioalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv402_maxauditsz));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv402_srvheuristics));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_402(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_402 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_ulist_mtime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_glist_mtime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_alist_mtime));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv402_alerts));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_security));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_numadmin));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_lanmask));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv402_guestacct));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_chdevs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_chdevq));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_chdevjobs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_connections));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_shares));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_openfiles));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_sessopens));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_sessvcs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_sessreqs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_opensearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_activelocks));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_numreqbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_sizreqbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_numbigbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_numfiletasks));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_alertsched));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_erroralert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_logonalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_accessalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_diskalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_netioalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv402_maxauditsz));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv402_srvheuristics));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_402(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_402 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_402");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv402_ulist_mtime", r->sv402_ulist_mtime);
+ ndr_print_uint32(ndr, "sv402_glist_mtime", r->sv402_glist_mtime);
+ ndr_print_uint32(ndr, "sv402_alist_mtime", r->sv402_alist_mtime);
+ ndr_print_string(ndr, "sv402_alerts", r->sv402_alerts);
+ ndr_print_uint32(ndr, "sv402_security", r->sv402_security);
+ ndr_print_uint32(ndr, "sv402_numadmin", r->sv402_numadmin);
+ ndr_print_uint32(ndr, "sv402_lanmask", r->sv402_lanmask);
+ ndr_print_string(ndr, "sv402_guestacct", r->sv402_guestacct);
+ ndr_print_uint32(ndr, "sv402_chdevs", r->sv402_chdevs);
+ ndr_print_uint32(ndr, "sv402_chdevq", r->sv402_chdevq);
+ ndr_print_uint32(ndr, "sv402_chdevjobs", r->sv402_chdevjobs);
+ ndr_print_uint32(ndr, "sv402_connections", r->sv402_connections);
+ ndr_print_uint32(ndr, "sv402_shares", r->sv402_shares);
+ ndr_print_uint32(ndr, "sv402_openfiles", r->sv402_openfiles);
+ ndr_print_uint32(ndr, "sv402_sessopens", r->sv402_sessopens);
+ ndr_print_uint32(ndr, "sv402_sessvcs", r->sv402_sessvcs);
+ ndr_print_uint32(ndr, "sv402_sessreqs", r->sv402_sessreqs);
+ ndr_print_uint32(ndr, "sv402_opensearch", r->sv402_opensearch);
+ ndr_print_uint32(ndr, "sv402_activelocks", r->sv402_activelocks);
+ ndr_print_uint32(ndr, "sv402_numreqbuf", r->sv402_numreqbuf);
+ ndr_print_uint32(ndr, "sv402_sizreqbuf", r->sv402_sizreqbuf);
+ ndr_print_uint32(ndr, "sv402_numbigbuf", r->sv402_numbigbuf);
+ ndr_print_uint32(ndr, "sv402_numfiletasks", r->sv402_numfiletasks);
+ ndr_print_uint32(ndr, "sv402_alertsched", r->sv402_alertsched);
+ ndr_print_uint32(ndr, "sv402_erroralert", r->sv402_erroralert);
+ ndr_print_uint32(ndr, "sv402_logonalert", r->sv402_logonalert);
+ ndr_print_uint32(ndr, "sv402_accessalert", r->sv402_accessalert);
+ ndr_print_uint32(ndr, "sv402_diskalert", r->sv402_diskalert);
+ ndr_print_uint32(ndr, "sv402_netioalert", r->sv402_netioalert);
+ ndr_print_uint32(ndr, "sv402_maxauditsz", r->sv402_maxauditsz);
+ ndr_print_string(ndr, "sv402_srvheuristics", r->sv402_srvheuristics);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_403(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_403 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_ulist_mtime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_glist_mtime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_alist_mtime));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv403_alerts));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_security));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_numadmin));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_lanmask));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv403_guestacct));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_chdevs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_chdevq));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_chdevjobs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_connections));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_shares));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_openfiles));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_sessopens));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_sessvcs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_sessreqs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_opensearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_activelocks));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_numreqbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_sizreqbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_numbigbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_numfiletasks));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_alertsched));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_erroralert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_logonalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_accessalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_diskalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_netioalert));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_maxauditsz));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv403_srvheuristics));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_auditedevents));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv403_autoprofile));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv403_autopath));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_403(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_403 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_ulist_mtime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_glist_mtime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_alist_mtime));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv403_alerts));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_security));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_numadmin));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_lanmask));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv403_guestacct));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_chdevs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_chdevq));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_chdevjobs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_connections));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_shares));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_openfiles));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_sessopens));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_sessvcs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_sessreqs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_opensearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_activelocks));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_numreqbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_sizreqbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_numbigbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_numfiletasks));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_alertsched));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_erroralert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_logonalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_accessalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_diskalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_netioalert));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_maxauditsz));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv403_srvheuristics));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_auditedevents));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv403_autoprofile));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv403_autopath));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_403(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_403 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_403");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv403_ulist_mtime", r->sv403_ulist_mtime);
+ ndr_print_uint32(ndr, "sv403_glist_mtime", r->sv403_glist_mtime);
+ ndr_print_uint32(ndr, "sv403_alist_mtime", r->sv403_alist_mtime);
+ ndr_print_string(ndr, "sv403_alerts", r->sv403_alerts);
+ ndr_print_uint32(ndr, "sv403_security", r->sv403_security);
+ ndr_print_uint32(ndr, "sv403_numadmin", r->sv403_numadmin);
+ ndr_print_uint32(ndr, "sv403_lanmask", r->sv403_lanmask);
+ ndr_print_string(ndr, "sv403_guestacct", r->sv403_guestacct);
+ ndr_print_uint32(ndr, "sv403_chdevs", r->sv403_chdevs);
+ ndr_print_uint32(ndr, "sv403_chdevq", r->sv403_chdevq);
+ ndr_print_uint32(ndr, "sv403_chdevjobs", r->sv403_chdevjobs);
+ ndr_print_uint32(ndr, "sv403_connections", r->sv403_connections);
+ ndr_print_uint32(ndr, "sv403_shares", r->sv403_shares);
+ ndr_print_uint32(ndr, "sv403_openfiles", r->sv403_openfiles);
+ ndr_print_uint32(ndr, "sv403_sessopens", r->sv403_sessopens);
+ ndr_print_uint32(ndr, "sv403_sessvcs", r->sv403_sessvcs);
+ ndr_print_uint32(ndr, "sv403_sessreqs", r->sv403_sessreqs);
+ ndr_print_uint32(ndr, "sv403_opensearch", r->sv403_opensearch);
+ ndr_print_uint32(ndr, "sv403_activelocks", r->sv403_activelocks);
+ ndr_print_uint32(ndr, "sv403_numreqbuf", r->sv403_numreqbuf);
+ ndr_print_uint32(ndr, "sv403_sizreqbuf", r->sv403_sizreqbuf);
+ ndr_print_uint32(ndr, "sv403_numbigbuf", r->sv403_numbigbuf);
+ ndr_print_uint32(ndr, "sv403_numfiletasks", r->sv403_numfiletasks);
+ ndr_print_uint32(ndr, "sv403_alertsched", r->sv403_alertsched);
+ ndr_print_uint32(ndr, "sv403_erroralert", r->sv403_erroralert);
+ ndr_print_uint32(ndr, "sv403_logonalert", r->sv403_logonalert);
+ ndr_print_uint32(ndr, "sv403_accessalert", r->sv403_accessalert);
+ ndr_print_uint32(ndr, "sv403_diskalert", r->sv403_diskalert);
+ ndr_print_uint32(ndr, "sv403_netioalert", r->sv403_netioalert);
+ ndr_print_uint32(ndr, "sv403_maxauditsz", r->sv403_maxauditsz);
+ ndr_print_string(ndr, "sv403_srvheuristics", r->sv403_srvheuristics);
+ ndr_print_uint32(ndr, "sv403_auditedevents", r->sv403_auditedevents);
+ ndr_print_uint32(ndr, "sv403_autoprofile", r->sv403_autoprofile);
+ ndr_print_string(ndr, "sv403_autopath", r->sv403_autopath);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_502(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_502 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_sessopens));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_sessvcs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_opensearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_sizreqbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_initworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_maxworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_rawworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_irpstacksize));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_maxrawbuflen));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_sessusers));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_sessconns));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_maxpagedmemoryusage));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv502_maxnonpagedmemoryusage));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv502_enablesoftcompat));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv502_enableforcedlogoff));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv502_timesource));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv502_acceptdownlevelapis));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv502_lmannounce));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_502(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_502 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_sessopens));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_sessvcs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_opensearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_sizreqbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_initworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_maxworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_rawworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_irpstacksize));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_maxrawbuflen));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_sessusers));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_sessconns));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_maxpagedmemoryusage));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv502_maxnonpagedmemoryusage));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv502_enablesoftcompat));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv502_enableforcedlogoff));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv502_timesource));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv502_acceptdownlevelapis));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv502_lmannounce));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_502(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_502 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_502");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv502_sessopens", r->sv502_sessopens);
+ ndr_print_uint32(ndr, "sv502_sessvcs", r->sv502_sessvcs);
+ ndr_print_uint32(ndr, "sv502_opensearch", r->sv502_opensearch);
+ ndr_print_uint32(ndr, "sv502_sizreqbuf", r->sv502_sizreqbuf);
+ ndr_print_uint32(ndr, "sv502_initworkitems", r->sv502_initworkitems);
+ ndr_print_uint32(ndr, "sv502_maxworkitems", r->sv502_maxworkitems);
+ ndr_print_uint32(ndr, "sv502_rawworkitems", r->sv502_rawworkitems);
+ ndr_print_uint32(ndr, "sv502_irpstacksize", r->sv502_irpstacksize);
+ ndr_print_uint32(ndr, "sv502_maxrawbuflen", r->sv502_maxrawbuflen);
+ ndr_print_uint32(ndr, "sv502_sessusers", r->sv502_sessusers);
+ ndr_print_uint32(ndr, "sv502_sessconns", r->sv502_sessconns);
+ ndr_print_uint32(ndr, "sv502_maxpagedmemoryusage", r->sv502_maxpagedmemoryusage);
+ ndr_print_uint32(ndr, "sv502_maxnonpagedmemoryusage", r->sv502_maxnonpagedmemoryusage);
+ ndr_print_uint8(ndr, "sv502_enablesoftcompat", r->sv502_enablesoftcompat);
+ ndr_print_uint8(ndr, "sv502_enableforcedlogoff", r->sv502_enableforcedlogoff);
+ ndr_print_uint8(ndr, "sv502_timesource", r->sv502_timesource);
+ ndr_print_uint8(ndr, "sv502_acceptdownlevelapis", r->sv502_acceptdownlevelapis);
+ ndr_print_uint8(ndr, "sv502_lmannounce", r->sv502_lmannounce);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_503(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_503 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_sessopens));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_sessvcs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_opensearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_sizreqbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_initworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_rawworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_irpstacksize));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxrawbuflen));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_sessusers));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_sessconns));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxpagedmemoryusage));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxnonpagedmemoryusage));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_enablesoftcompat));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_enableforcedlogoff));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_timesource));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_acceptdownlevelapis));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_lmannounce));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv503_domain));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxcopyreadlen));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxcopywritelen));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_minkeepsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxkeepsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_minkeepcomplsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxkeepcomplsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_threadcountadd));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_numblockthreads));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_scavtimeout));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_minrcvqueue));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_minfreeworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_xactmemsize));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_threadpriority));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxmpxct));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_oplockbreakwait));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_oplockbreakresponsewait));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_enableoplocks));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_enableoplockforceclose));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_enablefcbopens));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_enableraw));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv503_enablesharednetdrives));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_minfreeconnections));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv503_maxfreeconnections));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_503(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_503 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_sessopens));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_sessvcs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_opensearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_sizreqbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_initworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_rawworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_irpstacksize));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxrawbuflen));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_sessusers));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_sessconns));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxpagedmemoryusage));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxnonpagedmemoryusage));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_enablesoftcompat));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_enableforcedlogoff));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_timesource));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_acceptdownlevelapis));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_lmannounce));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv503_domain));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxcopyreadlen));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxcopywritelen));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_minkeepsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxkeepsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_minkeepcomplsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxkeepcomplsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_threadcountadd));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_numblockthreads));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_scavtimeout));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_minrcvqueue));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_minfreeworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_xactmemsize));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_threadpriority));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxmpxct));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_oplockbreakwait));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_oplockbreakresponsewait));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_enableoplocks));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_enableoplockforceclose));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_enablefcbopens));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_enableraw));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv503_enablesharednetdrives));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_minfreeconnections));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv503_maxfreeconnections));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_503(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_503 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_503");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv503_sessopens", r->sv503_sessopens);
+ ndr_print_uint32(ndr, "sv503_sessvcs", r->sv503_sessvcs);
+ ndr_print_uint32(ndr, "sv503_opensearch", r->sv503_opensearch);
+ ndr_print_uint32(ndr, "sv503_sizreqbuf", r->sv503_sizreqbuf);
+ ndr_print_uint32(ndr, "sv503_initworkitems", r->sv503_initworkitems);
+ ndr_print_uint32(ndr, "sv503_maxworkitems", r->sv503_maxworkitems);
+ ndr_print_uint32(ndr, "sv503_rawworkitems", r->sv503_rawworkitems);
+ ndr_print_uint32(ndr, "sv503_irpstacksize", r->sv503_irpstacksize);
+ ndr_print_uint32(ndr, "sv503_maxrawbuflen", r->sv503_maxrawbuflen);
+ ndr_print_uint32(ndr, "sv503_sessusers", r->sv503_sessusers);
+ ndr_print_uint32(ndr, "sv503_sessconns", r->sv503_sessconns);
+ ndr_print_uint32(ndr, "sv503_maxpagedmemoryusage", r->sv503_maxpagedmemoryusage);
+ ndr_print_uint32(ndr, "sv503_maxnonpagedmemoryusage", r->sv503_maxnonpagedmemoryusage);
+ ndr_print_uint8(ndr, "sv503_enablesoftcompat", r->sv503_enablesoftcompat);
+ ndr_print_uint8(ndr, "sv503_enableforcedlogoff", r->sv503_enableforcedlogoff);
+ ndr_print_uint8(ndr, "sv503_timesource", r->sv503_timesource);
+ ndr_print_uint8(ndr, "sv503_acceptdownlevelapis", r->sv503_acceptdownlevelapis);
+ ndr_print_uint8(ndr, "sv503_lmannounce", r->sv503_lmannounce);
+ ndr_print_string(ndr, "sv503_domain", r->sv503_domain);
+ ndr_print_uint32(ndr, "sv503_maxcopyreadlen", r->sv503_maxcopyreadlen);
+ ndr_print_uint32(ndr, "sv503_maxcopywritelen", r->sv503_maxcopywritelen);
+ ndr_print_uint32(ndr, "sv503_minkeepsearch", r->sv503_minkeepsearch);
+ ndr_print_uint32(ndr, "sv503_maxkeepsearch", r->sv503_maxkeepsearch);
+ ndr_print_uint32(ndr, "sv503_minkeepcomplsearch", r->sv503_minkeepcomplsearch);
+ ndr_print_uint32(ndr, "sv503_maxkeepcomplsearch", r->sv503_maxkeepcomplsearch);
+ ndr_print_uint32(ndr, "sv503_threadcountadd", r->sv503_threadcountadd);
+ ndr_print_uint32(ndr, "sv503_numblockthreads", r->sv503_numblockthreads);
+ ndr_print_uint32(ndr, "sv503_scavtimeout", r->sv503_scavtimeout);
+ ndr_print_uint32(ndr, "sv503_minrcvqueue", r->sv503_minrcvqueue);
+ ndr_print_uint32(ndr, "sv503_minfreeworkitems", r->sv503_minfreeworkitems);
+ ndr_print_uint32(ndr, "sv503_xactmemsize", r->sv503_xactmemsize);
+ ndr_print_uint32(ndr, "sv503_threadpriority", r->sv503_threadpriority);
+ ndr_print_uint32(ndr, "sv503_maxmpxct", r->sv503_maxmpxct);
+ ndr_print_uint32(ndr, "sv503_oplockbreakwait", r->sv503_oplockbreakwait);
+ ndr_print_uint32(ndr, "sv503_oplockbreakresponsewait", r->sv503_oplockbreakresponsewait);
+ ndr_print_uint8(ndr, "sv503_enableoplocks", r->sv503_enableoplocks);
+ ndr_print_uint8(ndr, "sv503_enableoplockforceclose", r->sv503_enableoplockforceclose);
+ ndr_print_uint8(ndr, "sv503_enablefcbopens", r->sv503_enablefcbopens);
+ ndr_print_uint8(ndr, "sv503_enableraw", r->sv503_enableraw);
+ ndr_print_uint8(ndr, "sv503_enablesharednetdrives", r->sv503_enablesharednetdrives);
+ ndr_print_uint32(ndr, "sv503_minfreeconnections", r->sv503_minfreeconnections);
+ ndr_print_uint32(ndr, "sv503_maxfreeconnections", r->sv503_maxfreeconnections);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_599(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_599 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_sessopens));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_sessvcs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_opensearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_sizreqbuf));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_initworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_rawworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_irpstacksize));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxrawbuflen));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_sessusers));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_sessconns));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxpagedmemoryusage));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxnonpagedmemoryusage));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_enablesoftcompat));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_enableforcedlogoff));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_timesource));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_acceptdownlevelapis));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_lmannounce));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->sv599_domain));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxcopyreadlen));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxcopywritelen));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_minkeepsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxkeepsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_minkeepcomplsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxkeepcomplsearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_threadcountadd));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_numblockthreads));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_scavtimeout));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_minrcvqueue));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_minfreeworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_xactmemsize));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_threadpriority));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxmpxct));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_oplockbreakwait));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_oplockbreakresponsewait));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_enableoplocks));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_enableoplockforceclose));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_enablefcbopens));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_enableraw));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv599_enablesharednetdrives));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_minfreeconnections));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxfreeconnections));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_initsesstable));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_initconntable));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_initfiletable));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_initsearchtable));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_alertschedule));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_errorthreshold));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_networkerrorthreshold));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_diskspacethreshold));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_reserved));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxlinkdelay));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_minlinkthroughput));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_linkinfovalidtime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_scavqosinfoupdatetime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv599_maxworkitemidletime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_599(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_599 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_sessopens));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_sessvcs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_opensearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_sizreqbuf));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_initworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_rawworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_irpstacksize));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxrawbuflen));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_sessusers));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_sessconns));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxpagedmemoryusage));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxnonpagedmemoryusage));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_enablesoftcompat));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_enableforcedlogoff));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_timesource));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_acceptdownlevelapis));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_lmannounce));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sv599_domain));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxcopyreadlen));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxcopywritelen));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_minkeepsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxkeepsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_minkeepcomplsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxkeepcomplsearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_threadcountadd));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_numblockthreads));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_scavtimeout));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_minrcvqueue));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_minfreeworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_xactmemsize));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_threadpriority));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxmpxct));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_oplockbreakwait));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_oplockbreakresponsewait));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_enableoplocks));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_enableoplockforceclose));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_enablefcbopens));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_enableraw));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv599_enablesharednetdrives));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_minfreeconnections));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxfreeconnections));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_initsesstable));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_initconntable));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_initfiletable));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_initsearchtable));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_alertschedule));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_errorthreshold));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_networkerrorthreshold));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_diskspacethreshold));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_reserved));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxlinkdelay));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_minlinkthroughput));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_linkinfovalidtime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_scavqosinfoupdatetime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv599_maxworkitemidletime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_599(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_599 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_599");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv599_sessopens", r->sv599_sessopens);
+ ndr_print_uint32(ndr, "sv599_sessvcs", r->sv599_sessvcs);
+ ndr_print_uint32(ndr, "sv599_opensearch", r->sv599_opensearch);
+ ndr_print_uint32(ndr, "sv599_sizreqbuf", r->sv599_sizreqbuf);
+ ndr_print_uint32(ndr, "sv599_initworkitems", r->sv599_initworkitems);
+ ndr_print_uint32(ndr, "sv599_maxworkitems", r->sv599_maxworkitems);
+ ndr_print_uint32(ndr, "sv599_rawworkitems", r->sv599_rawworkitems);
+ ndr_print_uint32(ndr, "sv599_irpstacksize", r->sv599_irpstacksize);
+ ndr_print_uint32(ndr, "sv599_maxrawbuflen", r->sv599_maxrawbuflen);
+ ndr_print_uint32(ndr, "sv599_sessusers", r->sv599_sessusers);
+ ndr_print_uint32(ndr, "sv599_sessconns", r->sv599_sessconns);
+ ndr_print_uint32(ndr, "sv599_maxpagedmemoryusage", r->sv599_maxpagedmemoryusage);
+ ndr_print_uint32(ndr, "sv599_maxnonpagedmemoryusage", r->sv599_maxnonpagedmemoryusage);
+ ndr_print_uint8(ndr, "sv599_enablesoftcompat", r->sv599_enablesoftcompat);
+ ndr_print_uint8(ndr, "sv599_enableforcedlogoff", r->sv599_enableforcedlogoff);
+ ndr_print_uint8(ndr, "sv599_timesource", r->sv599_timesource);
+ ndr_print_uint8(ndr, "sv599_acceptdownlevelapis", r->sv599_acceptdownlevelapis);
+ ndr_print_uint8(ndr, "sv599_lmannounce", r->sv599_lmannounce);
+ ndr_print_string(ndr, "sv599_domain", r->sv599_domain);
+ ndr_print_uint32(ndr, "sv599_maxcopyreadlen", r->sv599_maxcopyreadlen);
+ ndr_print_uint32(ndr, "sv599_maxcopywritelen", r->sv599_maxcopywritelen);
+ ndr_print_uint32(ndr, "sv599_minkeepsearch", r->sv599_minkeepsearch);
+ ndr_print_uint32(ndr, "sv599_maxkeepsearch", r->sv599_maxkeepsearch);
+ ndr_print_uint32(ndr, "sv599_minkeepcomplsearch", r->sv599_minkeepcomplsearch);
+ ndr_print_uint32(ndr, "sv599_maxkeepcomplsearch", r->sv599_maxkeepcomplsearch);
+ ndr_print_uint32(ndr, "sv599_threadcountadd", r->sv599_threadcountadd);
+ ndr_print_uint32(ndr, "sv599_numblockthreads", r->sv599_numblockthreads);
+ ndr_print_uint32(ndr, "sv599_scavtimeout", r->sv599_scavtimeout);
+ ndr_print_uint32(ndr, "sv599_minrcvqueue", r->sv599_minrcvqueue);
+ ndr_print_uint32(ndr, "sv599_minfreeworkitems", r->sv599_minfreeworkitems);
+ ndr_print_uint32(ndr, "sv599_xactmemsize", r->sv599_xactmemsize);
+ ndr_print_uint32(ndr, "sv599_threadpriority", r->sv599_threadpriority);
+ ndr_print_uint32(ndr, "sv599_maxmpxct", r->sv599_maxmpxct);
+ ndr_print_uint32(ndr, "sv599_oplockbreakwait", r->sv599_oplockbreakwait);
+ ndr_print_uint32(ndr, "sv599_oplockbreakresponsewait", r->sv599_oplockbreakresponsewait);
+ ndr_print_uint8(ndr, "sv599_enableoplocks", r->sv599_enableoplocks);
+ ndr_print_uint8(ndr, "sv599_enableoplockforceclose", r->sv599_enableoplockforceclose);
+ ndr_print_uint8(ndr, "sv599_enablefcbopens", r->sv599_enablefcbopens);
+ ndr_print_uint8(ndr, "sv599_enableraw", r->sv599_enableraw);
+ ndr_print_uint8(ndr, "sv599_enablesharednetdrives", r->sv599_enablesharednetdrives);
+ ndr_print_uint32(ndr, "sv599_minfreeconnections", r->sv599_minfreeconnections);
+ ndr_print_uint32(ndr, "sv599_maxfreeconnections", r->sv599_maxfreeconnections);
+ ndr_print_uint32(ndr, "sv599_initsesstable", r->sv599_initsesstable);
+ ndr_print_uint32(ndr, "sv599_initconntable", r->sv599_initconntable);
+ ndr_print_uint32(ndr, "sv599_initfiletable", r->sv599_initfiletable);
+ ndr_print_uint32(ndr, "sv599_initsearchtable", r->sv599_initsearchtable);
+ ndr_print_uint32(ndr, "sv599_alertschedule", r->sv599_alertschedule);
+ ndr_print_uint32(ndr, "sv599_errorthreshold", r->sv599_errorthreshold);
+ ndr_print_uint32(ndr, "sv599_networkerrorthreshold", r->sv599_networkerrorthreshold);
+ ndr_print_uint32(ndr, "sv599_diskspacethreshold", r->sv599_diskspacethreshold);
+ ndr_print_uint32(ndr, "sv599_reserved", r->sv599_reserved);
+ ndr_print_uint32(ndr, "sv599_maxlinkdelay", r->sv599_maxlinkdelay);
+ ndr_print_uint32(ndr, "sv599_minlinkthroughput", r->sv599_minlinkthroughput);
+ ndr_print_uint32(ndr, "sv599_linkinfovalidtime", r->sv599_linkinfovalidtime);
+ ndr_print_uint32(ndr, "sv599_scavqosinfoupdatetime", r->sv599_scavqosinfoupdatetime);
+ ndr_print_uint32(ndr, "sv599_maxworkitemidletime", r->sv599_maxworkitemidletime);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_598(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_598 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxrawworkitems));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxthreadsperqueue));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_producttype));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_serversize));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_connectionlessautodisc));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_sharingviolationretries));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_sharingviolationdelay));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxglobalopensearch));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_removeduplicatesearches));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_lockviolationoffset));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_lockviolationdelay));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_mdlreadswitchover));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_cachedopenlimit));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_otherqueueaffinity));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_restrictnullsessaccess));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_enablewfw311directipx));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_queuesamplesecs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_balancecount));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_preferredaffinity));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxfreerfcbs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxfreemfcbs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxfreelfcbs));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxfreepagedpoolchunks));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_minpagedpoolchunksize));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxpagedpoolchunksize));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_sendsfrompreferredprocessor));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_cacheddirectorylimit));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_maxcopylength));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_enablecompression));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_autosharewks));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_autoshareserver));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_enablesecuritysignature));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_requiresecuritysignature));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_minclientbuffersize));
+ NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->sv598_serverguid));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_ConnectionNoSessionsTimeout));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_IdleThreadTimeOut));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_enableW9xsecuritysignature));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_enforcekerberosreauthentication));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_disabledos));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv598_lowdiskspaceminimum));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv598_disablestrictnamechecking));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_598(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_598 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxrawworkitems));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxthreadsperqueue));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_producttype));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_serversize));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_connectionlessautodisc));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_sharingviolationretries));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_sharingviolationdelay));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxglobalopensearch));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_removeduplicatesearches));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_lockviolationoffset));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_lockviolationdelay));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_mdlreadswitchover));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_cachedopenlimit));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_otherqueueaffinity));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_restrictnullsessaccess));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_enablewfw311directipx));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_queuesamplesecs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_balancecount));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_preferredaffinity));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxfreerfcbs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxfreemfcbs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxfreelfcbs));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxfreepagedpoolchunks));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_minpagedpoolchunksize));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxpagedpoolchunksize));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_sendsfrompreferredprocessor));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_cacheddirectorylimit));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_maxcopylength));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_enablecompression));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_autosharewks));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_autoshareserver));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_enablesecuritysignature));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_requiresecuritysignature));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_minclientbuffersize));
+ NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->sv598_serverguid));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_ConnectionNoSessionsTimeout));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_IdleThreadTimeOut));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_enableW9xsecuritysignature));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_enforcekerberosreauthentication));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_disabledos));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv598_lowdiskspaceminimum));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv598_disablestrictnamechecking));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_598(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_598 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_598");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv598_maxrawworkitems", r->sv598_maxrawworkitems);
+ ndr_print_uint32(ndr, "sv598_maxthreadsperqueue", r->sv598_maxthreadsperqueue);
+ ndr_print_uint32(ndr, "sv598_producttype", r->sv598_producttype);
+ ndr_print_uint32(ndr, "sv598_serversize", r->sv598_serversize);
+ ndr_print_uint32(ndr, "sv598_connectionlessautodisc", r->sv598_connectionlessautodisc);
+ ndr_print_uint32(ndr, "sv598_sharingviolationretries", r->sv598_sharingviolationretries);
+ ndr_print_uint32(ndr, "sv598_sharingviolationdelay", r->sv598_sharingviolationdelay);
+ ndr_print_uint32(ndr, "sv598_maxglobalopensearch", r->sv598_maxglobalopensearch);
+ ndr_print_uint32(ndr, "sv598_removeduplicatesearches", r->sv598_removeduplicatesearches);
+ ndr_print_uint32(ndr, "sv598_lockviolationoffset", r->sv598_lockviolationoffset);
+ ndr_print_uint32(ndr, "sv598_lockviolationdelay", r->sv598_lockviolationdelay);
+ ndr_print_uint32(ndr, "sv598_mdlreadswitchover", r->sv598_mdlreadswitchover);
+ ndr_print_uint32(ndr, "sv598_cachedopenlimit", r->sv598_cachedopenlimit);
+ ndr_print_uint32(ndr, "sv598_otherqueueaffinity", r->sv598_otherqueueaffinity);
+ ndr_print_uint8(ndr, "sv598_restrictnullsessaccess", r->sv598_restrictnullsessaccess);
+ ndr_print_uint8(ndr, "sv598_enablewfw311directipx", r->sv598_enablewfw311directipx);
+ ndr_print_uint32(ndr, "sv598_queuesamplesecs", r->sv598_queuesamplesecs);
+ ndr_print_uint32(ndr, "sv598_balancecount", r->sv598_balancecount);
+ ndr_print_uint32(ndr, "sv598_preferredaffinity", r->sv598_preferredaffinity);
+ ndr_print_uint32(ndr, "sv598_maxfreerfcbs", r->sv598_maxfreerfcbs);
+ ndr_print_uint32(ndr, "sv598_maxfreemfcbs", r->sv598_maxfreemfcbs);
+ ndr_print_uint32(ndr, "sv598_maxfreelfcbs", r->sv598_maxfreelfcbs);
+ ndr_print_uint32(ndr, "sv598_maxfreepagedpoolchunks", r->sv598_maxfreepagedpoolchunks);
+ ndr_print_uint32(ndr, "sv598_minpagedpoolchunksize", r->sv598_minpagedpoolchunksize);
+ ndr_print_uint32(ndr, "sv598_maxpagedpoolchunksize", r->sv598_maxpagedpoolchunksize);
+ ndr_print_uint8(ndr, "sv598_sendsfrompreferredprocessor", r->sv598_sendsfrompreferredprocessor);
+ ndr_print_uint32(ndr, "sv598_cacheddirectorylimit", r->sv598_cacheddirectorylimit);
+ ndr_print_uint32(ndr, "sv598_maxcopylength", r->sv598_maxcopylength);
+ ndr_print_uint8(ndr, "sv598_enablecompression", r->sv598_enablecompression);
+ ndr_print_uint8(ndr, "sv598_autosharewks", r->sv598_autosharewks);
+ ndr_print_uint8(ndr, "sv598_autoshareserver", r->sv598_autoshareserver);
+ ndr_print_uint8(ndr, "sv598_enablesecuritysignature", r->sv598_enablesecuritysignature);
+ ndr_print_uint8(ndr, "sv598_requiresecuritysignature", r->sv598_requiresecuritysignature);
+ ndr_print_uint32(ndr, "sv598_minclientbuffersize", r->sv598_minclientbuffersize);
+ ndr_print_GUID(ndr, "sv598_serverguid", &r->sv598_serverguid);
+ ndr_print_uint32(ndr, "sv598_ConnectionNoSessionsTimeout", r->sv598_ConnectionNoSessionsTimeout);
+ ndr_print_uint32(ndr, "sv598_IdleThreadTimeOut", r->sv598_IdleThreadTimeOut);
+ ndr_print_uint8(ndr, "sv598_enableW9xsecuritysignature", r->sv598_enableW9xsecuritysignature);
+ ndr_print_uint8(ndr, "sv598_enforcekerberosreauthentication", r->sv598_enforcekerberosreauthentication);
+ ndr_print_uint8(ndr, "sv598_disabledos", r->sv598_disabledos);
+ ndr_print_uint32(ndr, "sv598_lowdiskspaceminimum", r->sv598_lowdiskspaceminimum);
+ ndr_print_uint8(ndr, "sv598_disablestrictnamechecking", r->sv598_disablestrictnamechecking);
+ ndr->depth--;
+}
+
_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1005(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1005 *r)
{
if (ndr_flags & NDR_SCALARS) {
@@ -294,6 +1125,2796 @@ _PUBLIC_ void ndr_print_SERVER_INFO_1005(struct ndr_print *ndr, const char *name
ndr->depth--;
}
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1107(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1107 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1107_users));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1107(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1107 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1107_users));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1107(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1107 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1107");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1107_users", r->sv1107_users);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1010(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1010 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->sv1010_disc));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1010(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1010 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->sv1010_disc));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1010(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1010 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1010");
+ ndr->depth++;
+ ndr_print_int32(ndr, "sv1010_disc", r->sv1010_disc);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1016(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1016 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1016_hidden));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1016(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1016 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1016_hidden));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1016(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1016 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1016");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1016_hidden", r->sv1016_hidden);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1017(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1017 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1017_announce));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1017(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1017 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1017_announce));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1017(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1017 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1017");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1017_announce", r->sv1017_announce);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1018(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1018 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1018_anndelta));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1018(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1018 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1018_anndelta));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1018(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1018 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1018");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1018_anndelta", r->sv1018_anndelta);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1501(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1501 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1501_sessopens));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1501(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1501 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1501_sessopens));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1501(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1501 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1501");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1501_sessopens", r->sv1501_sessopens);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1502(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1502 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1502_sessvcs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1502(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1502 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1502_sessvcs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1502(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1502 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1502");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1502_sessvcs", r->sv1502_sessvcs);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1503(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1503 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1503_opensearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1503(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1503 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1503_opensearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1503(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1503 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1503");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1503_opensearch", r->sv1503_opensearch);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1506(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1506 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1506_maxworkitems));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1506(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1506 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1506_maxworkitems));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1506(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1506 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1506");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1506_maxworkitems", r->sv1506_maxworkitems);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1509(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1509 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1509_maxrawbuflen));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1509(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1509 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1509_maxrawbuflen));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1509(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1509 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1509");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1509_maxrawbuflen", r->sv1509_maxrawbuflen);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1510(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1510 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1510_sessusers));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1510(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1510 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1510_sessusers));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1510(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1510 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1510");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1510_sessusers", r->sv1510_sessusers);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1511(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1511 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1511_sessconns));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1511(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1511 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1511_sessconns));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1511(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1511 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1511");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1511_sessconns", r->sv1511_sessconns);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1512(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1512 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1512_maxnonpagedmemoryusage));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1512(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1512 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1512_maxnonpagedmemoryusage));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1512(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1512 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1512");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1512_maxnonpagedmemoryusage", r->sv1512_maxnonpagedmemoryusage);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1513(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1513 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1513_maxpagedmemoryusage));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1513(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1513 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1513_maxpagedmemoryusage));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1513(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1513 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1513");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1513_maxpagedmemoryusage", r->sv1513_maxpagedmemoryusage);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1514(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1514 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1514_enablesoftcompat));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1514(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1514 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1514_enablesoftcompat));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1514(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1514 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1514");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1514_enablesoftcompat", r->sv1514_enablesoftcompat);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1515(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1515 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1515_enableforcedlogoff));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1515(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1515 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1515_enableforcedlogoff));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1515(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1515 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1515");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1515_enableforcedlogoff", r->sv1515_enableforcedlogoff);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1516(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1516 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1516_timesource));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1516(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1516 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1516_timesource));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1516(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1516 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1516");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1516_timesource", r->sv1516_timesource);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1518(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1518 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1518_lmannounce));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1518(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1518 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1518_lmannounce));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1518(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1518 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1518");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1518_lmannounce", r->sv1518_lmannounce);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1520(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1520 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1520_maxcopyreadlen));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1520(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1520 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1520_maxcopyreadlen));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1520(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1520 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1520");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1520_maxcopyreadlen", r->sv1520_maxcopyreadlen);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1521(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1521 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1521_maxcopywritelen));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1521(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1521 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1521_maxcopywritelen));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1521(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1521 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1521");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1521_maxcopywritelen", r->sv1521_maxcopywritelen);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1522(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1522 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1522_minkeepsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1522(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1522 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1522_minkeepsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1522(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1522 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1522");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1522_minkeepsearch", r->sv1522_minkeepsearch);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1523(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1523 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1523_maxkeepsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1523(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1523 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1523_maxkeepsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1523(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1523 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1523");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1523_maxkeepsearch", r->sv1523_maxkeepsearch);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1524(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1524 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1524_minkeepcomplsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1524(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1524 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1524_minkeepcomplsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1524(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1524 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1524");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1524_minkeepcomplsearch", r->sv1524_minkeepcomplsearch);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1525(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1525 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1525_maxkeepcomplsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1525(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1525 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1525_maxkeepcomplsearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1525(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1525 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1525");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1525_maxkeepcomplsearch", r->sv1525_maxkeepcomplsearch);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1528(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1528 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1528_scavtimeout));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1528(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1528 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1528_scavtimeout));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1528(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1528 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1528");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1528_scavtimeout", r->sv1528_scavtimeout);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1529(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1529 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1529_minrcvqueue));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1529(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1529 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1529_minrcvqueue));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1529(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1529 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1529");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1529_minrcvqueue", r->sv1529_minrcvqueue);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1530(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1530 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1530_minfreeworkitems));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1530(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1530 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1530_minfreeworkitems));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1530(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1530 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1530");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1530_minfreeworkitems", r->sv1530_minfreeworkitems);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1533(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1533 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1533_maxmpxct));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1533(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1533 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1533_maxmpxct));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1533(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1533 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1533");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1533_maxmpxct", r->sv1533_maxmpxct);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1534(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1534 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1534_oplockbreakwait));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1534(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1534 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1534_oplockbreakwait));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1534(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1534 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1534");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1534_oplockbreakwait", r->sv1534_oplockbreakwait);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1535(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1535 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1535_oplockbreakresponsewait));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1535(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1535 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1535_oplockbreakresponsewait));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1535(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1535 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1535");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1535_oplockbreakresponsewait", r->sv1535_oplockbreakresponsewait);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1536(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1536 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1536_enableoplocks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1536(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1536 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1536_enableoplocks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1536(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1536 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1536");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1536_enableoplocks", r->sv1536_enableoplocks);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1537(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1537 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1537_enableoplockforceclose));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1537(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1537 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1537_enableoplockforceclose));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1537(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1537 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1537");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1537_enableoplockforceclose", r->sv1537_enableoplockforceclose);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1538(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1538 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1538_enablefcbopens));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1538(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1538 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1538_enablefcbopens));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1538(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1538 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1538");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1538_enablefcbopens", r->sv1538_enablefcbopens);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1539(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1539 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1539_enableraw));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1539(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1539 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1539_enableraw));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1539(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1539 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1539");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1539_enableraw", r->sv1539_enableraw);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1540(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1540 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1540_enablesharednetdrives));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1540(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1540 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1540_enablesharednetdrives));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1540(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1540 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1540");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1540_enablesharednetdrives", r->sv1540_enablesharednetdrives);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1541(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1541 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1541_minfreeconnections));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1541(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1541 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1541_minfreeconnections));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1541(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1541 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1541");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1541_minfreeconnections", r->sv1541_minfreeconnections);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1542(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1542 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1542_maxfreeconnections));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1542(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1542 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1542_maxfreeconnections));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1542(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1542 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1542");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1542_maxfreeconnections", r->sv1542_maxfreeconnections);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1543(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1543 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1543_initsesstable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1543(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1543 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1543_initsesstable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1543(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1543 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1543");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1543_initsesstable", r->sv1543_initsesstable);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1544(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1544 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1544_initconntable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1544(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1544 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1544_initconntable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1544(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1544 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1544");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1544_initconntable", r->sv1544_initconntable);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1545(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1545 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1545_initfiletable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1545(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1545 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1545_initfiletable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1545(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1545 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1545");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1545_initfiletable", r->sv1545_initfiletable);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1546(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1546 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1546_initsearchtable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1546(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1546 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1546_initsearchtable));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1546(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1546 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1546");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1546_initsearchtable", r->sv1546_initsearchtable);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1547(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1547 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1547_alertschedule));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1547(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1547 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1547_alertschedule));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1547(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1547 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1547");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1547_alertschedule", r->sv1547_alertschedule);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1548(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1548 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1548_errorthreshold));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1548(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1548 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1548_errorthreshold));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1548(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1548 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1548");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1548_errorthreshold", r->sv1548_errorthreshold);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1549(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1549 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1549_networkerrorthreshold));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1549(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1549 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1549_networkerrorthreshold));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1549(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1549 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1549");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1549_networkerrorthreshold", r->sv1549_networkerrorthreshold);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1550(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1550 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1550_diskspacethreshold));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1550(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1550 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1550_diskspacethreshold));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1550(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1550 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1550");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1550_diskspacethreshold", r->sv1550_diskspacethreshold);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1552(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1552 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1552_maxlinkdelay));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1552(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1552 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1552_maxlinkdelay));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1552(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1552 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1552");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1552_maxlinkdelay", r->sv1552_maxlinkdelay);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1553(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1553 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1553_minlinkthroughput));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1553(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1553 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1553_minlinkthroughput));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1553(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1553 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1553");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1553_minlinkthroughput", r->sv1553_minlinkthroughput);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1554(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1554 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1554_linkinfovalidtime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1554(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1554 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1554_linkinfovalidtime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1554(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1554 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1554");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1554_linkinfovalidtime", r->sv1554_linkinfovalidtime);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1555(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1555 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1555_scavqosinfoupdatetime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1555(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1555 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1555_scavqosinfoupdatetime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1555(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1555 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1555");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1555_scavqosinfoupdatetime", r->sv1555_scavqosinfoupdatetime);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1556(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1556 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1556_maxworkitemidletime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1556(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1556 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1556_maxworkitemidletime));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1556(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1556 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1556");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1556_maxworkitemidletime", r->sv1556_maxworkitemidletime);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1557(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1557 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1557_maxrawworkitems));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1557(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1557 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1557_maxrawworkitems));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1557(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1557 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1557");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1557_maxrawworkitems", r->sv1557_maxrawworkitems);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1560(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1560 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1560_producttype));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1560(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1560 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1560_producttype));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1560(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1560 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1560");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1560_producttype", r->sv1560_producttype);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1561(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1561 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1561_serversize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1561(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1561 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1561_serversize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1561(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1561 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1561");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1561_serversize", r->sv1561_serversize);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1562(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1562 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1562_connectionlessautodisc));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1562(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1562 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1562_connectionlessautodisc));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1562(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1562 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1562");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1562_connectionlessautodisc", r->sv1562_connectionlessautodisc);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1563(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1563 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1563_sharingviolationretries));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1563(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1563 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1563_sharingviolationretries));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1563(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1563 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1563");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1563_sharingviolationretries", r->sv1563_sharingviolationretries);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1564(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1564 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1564_sharingviolationdelay));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1564(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1564 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1564_sharingviolationdelay));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1564(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1564 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1564");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1564_sharingviolationdelay", r->sv1564_sharingviolationdelay);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1565(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1565 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1565_maxglobalopensearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1565(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1565 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1565_maxglobalopensearch));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1565(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1565 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1565");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1565_maxglobalopensearch", r->sv1565_maxglobalopensearch);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1566(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1566 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1566_removeduplicatesearches));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1566(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1566 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1566_removeduplicatesearches));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1566(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1566 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1566");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1566_removeduplicatesearches", r->sv1566_removeduplicatesearches);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1567(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1567 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1567_lockviolationretries));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1567(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1567 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1567_lockviolationretries));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1567(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1567 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1567");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1567_lockviolationretries", r->sv1567_lockviolationretries);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1568(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1568 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1568_lockviolationoffset));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1568(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1568 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1568_lockviolationoffset));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1568(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1568 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1568");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1568_lockviolationoffset", r->sv1568_lockviolationoffset);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1569(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1569 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1569_lockviolationdelay));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1569(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1569 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1569_lockviolationdelay));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1569(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1569 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1569");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1569_lockviolationdelay", r->sv1569_lockviolationdelay);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1570(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1570 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1570_mdlreadswitchover));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1570(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1570 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1570_mdlreadswitchover));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1570(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1570 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1570");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1570_mdlreadswitchover", r->sv1570_mdlreadswitchover);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1571(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1571 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1571_cachedopenlimit));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1571(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1571 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1571_cachedopenlimit));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1571(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1571 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1571");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1571_cachedopenlimit", r->sv1571_cachedopenlimit);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1572(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1572 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1572_criticalthreads));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1572(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1572 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1572_criticalthreads));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1572(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1572 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1572");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1572_criticalthreads", r->sv1572_criticalthreads);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1573(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1573 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1573_restrictnullsessaccess));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1573(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1573 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1573_restrictnullsessaccess));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1573(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1573 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1573");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1573_restrictnullsessaccess", r->sv1573_restrictnullsessaccess);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1574(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1574 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1574_enablewfw311directipx));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1574(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1574 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1574_enablewfw311directipx));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1574(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1574 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1574");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1574_enablewfw311directipx", r->sv1574_enablewfw311directipx);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1575(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1575 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1575_otherqueueaffinity));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1575(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1575 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1575_otherqueueaffinity));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1575(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1575 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1575");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1575_otherqueueaffinity", r->sv1575_otherqueueaffinity);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1576(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1576 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1576_queuesamplesecs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1576(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1576 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1576_queuesamplesecs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1576(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1576 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1576");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1576_queuesamplesecs", r->sv1576_queuesamplesecs);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1577(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1577 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1577_balancecount));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1577(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1577 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1577_balancecount));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1577(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1577 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1577");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1577_balancecount", r->sv1577_balancecount);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1578(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1578 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1578_preferredaffinity));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1578(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1578 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1578_preferredaffinity));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1578(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1578 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1578");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1578_preferredaffinity", r->sv1578_preferredaffinity);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1579(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1579 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1579_maxfreerfcbs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1579(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1579 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1579_maxfreerfcbs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1579(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1579 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1579");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1579_maxfreerfcbs", r->sv1579_maxfreerfcbs);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1580(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1580 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1580_maxfreemfcbs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1580(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1580 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1580_maxfreemfcbs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1580(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1580 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1580");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1580_maxfreemfcbs", r->sv1580_maxfreemfcbs);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1581(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1581 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1581_maxfreemlcbs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1581(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1581 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1581_maxfreemlcbs));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1581(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1581 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1581");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1581_maxfreemlcbs", r->sv1581_maxfreemlcbs);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1582(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1582 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1582_maxfreepagedpoolchunks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1582(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1582 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1582_maxfreepagedpoolchunks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1582(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1582 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1582");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1582_maxfreepagedpoolchunks", r->sv1582_maxfreepagedpoolchunks);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1583(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1583 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1583_minpagedpoolchunksize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1583(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1583 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1583_minpagedpoolchunksize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1583(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1583 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1583");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1583_minpagedpoolchunksize", r->sv1583_minpagedpoolchunksize);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1584(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1584 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1584_maxpagedpoolchunksize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1584(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1584 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1584_maxpagedpoolchunksize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1584(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1584 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1584");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1584_maxpagedpoolchunksize", r->sv1584_maxpagedpoolchunksize);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1585(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1585 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1585_sendsfrompreferredprocessor));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1585(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1585 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1585_sendsfrompreferredprocessor));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1585(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1585 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1585");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1585_sendsfrompreferredprocessor", r->sv1585_sendsfrompreferredprocessor);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1586(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1586 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1586_maxthreadsperqueue));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1586(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1586 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1586_maxthreadsperqueue));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1586(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1586 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1586");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1586_maxthreadsperqueue", r->sv1586_maxthreadsperqueue);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1587(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1587 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1587_cacheddirectorylimit));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1587(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1587 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1587_cacheddirectorylimit));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1587(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1587 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1587");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1587_cacheddirectorylimit", r->sv1587_cacheddirectorylimit);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1588(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1588 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1588_maxcopylength));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1588(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1588 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1588_maxcopylength));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1588(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1588 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1588");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1588_maxcopylength", r->sv1588_maxcopylength);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1590(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1590 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1590_enablecompression));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1590(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1590 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1590_enablecompression));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1590(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1590 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1590");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1590_enablecompression", r->sv1590_enablecompression);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1591(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1591 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1591_autosharewks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1591(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1591 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1591_autosharewks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1591(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1591 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1591");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1591_autosharewks", r->sv1591_autosharewks);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1592(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1592 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1592_autosharewks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1592(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1592 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1592_autosharewks));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1592(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1592 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1592");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1592_autosharewks", r->sv1592_autosharewks);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1593(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1593 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1593_enablesecuritysignature));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1593(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1593 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1593_enablesecuritysignature));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1593(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1593 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1593");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1593_enablesecuritysignature", r->sv1593_enablesecuritysignature);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1594(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1594 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1594_requiresecuritysignature));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1594(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1594 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1594_requiresecuritysignature));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1594(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1594 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1594");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1594_requiresecuritysignature", r->sv1594_requiresecuritysignature);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1595(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1595 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1595_minclientbuffersize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1595(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1595 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1595_minclientbuffersize));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1595(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1595 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1595");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1595_minclientbuffersize", r->sv1595_minclientbuffersize);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1596(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1596 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1596_ConnectionNoSessionsTimeout));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1596(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1596 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1596_ConnectionNoSessionsTimeout));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1596(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1596 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1596");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1596_ConnectionNoSessionsTimeout", r->sv1596_ConnectionNoSessionsTimeout);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1597(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1597 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1597_IdleThreadTimeOut));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1597(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1597 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1597_IdleThreadTimeOut));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1597(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1597 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1597");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1597_IdleThreadTimeOut", r->sv1597_IdleThreadTimeOut);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1598(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1598 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1598_enableW9xsecuritysignature));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1598(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1598 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1598_enableW9xsecuritysignature));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1598(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1598 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1598");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1598_enableW9xsecuritysignature", r->sv1598_enableW9xsecuritysignature);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1599(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1599 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1598_enforcekerberosreauthentication));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1599(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1599 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1598_enforcekerberosreauthentication));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1599(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1599 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1599");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1598_enforcekerberosreauthentication", r->sv1598_enforcekerberosreauthentication);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1600(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1600 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv1598_disabledos));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1600(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1600 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv1598_disabledos));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1600(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1600 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1600");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv1598_disabledos", r->sv1598_disabledos);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1601(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1601 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sv1598_lowdiskspaceminimum));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1601(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1601 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sv1598_lowdiskspaceminimum));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1601(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1601 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1601");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "sv1598_lowdiskspaceminimum", r->sv1598_lowdiskspaceminimum);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_SERVER_INFO_1602(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1602 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sv_1598_disablestrictnamechecking));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_SERVER_INFO_1602(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1602 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sv_1598_disablestrictnamechecking));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_SERVER_INFO_1602(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1602 *r)
+{
+ ndr_print_struct(ndr, name, "SERVER_INFO_1602");
+ ndr->depth++;
+ ndr_print_uint8(ndr, "sv_1598_disablestrictnamechecking", r->sv_1598_disablestrictnamechecking);
+ ndr->depth--;
+}
+
_PUBLIC_ enum ndr_err_code ndr_push_DOMAIN_CONTROLLER_INFO(struct ndr_push *ndr, int ndr_flags, const struct DOMAIN_CONTROLLER_INFO *r)
{
if (ndr_flags & NDR_SCALARS) {
diff --git a/source3/librpc/gen_ndr/ndr_libnetapi.h b/source3/librpc/gen_ndr/ndr_libnetapi.h
index d8e8e399b2..cae0a70ea6 100644
--- a/source3/librpc/gen_ndr/ndr_libnetapi.h
+++ b/source3/librpc/gen_ndr/ndr_libnetapi.h
@@ -123,9 +123,306 @@ void ndr_print_SERVER_INFO_101(struct ndr_print *ndr, const char *name, const st
enum ndr_err_code ndr_push_SERVER_INFO_102(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_102 *r);
enum ndr_err_code ndr_pull_SERVER_INFO_102(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_102 *r);
void ndr_print_SERVER_INFO_102(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_102 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_402(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_402 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_402(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_402 *r);
+void ndr_print_SERVER_INFO_402(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_402 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_403(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_403 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_403(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_403 *r);
+void ndr_print_SERVER_INFO_403(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_403 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_502(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_502 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_502(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_502 *r);
+void ndr_print_SERVER_INFO_502(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_502 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_503(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_503 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_503(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_503 *r);
+void ndr_print_SERVER_INFO_503(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_503 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_599(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_599 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_599(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_599 *r);
+void ndr_print_SERVER_INFO_599(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_599 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_598(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_598 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_598(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_598 *r);
+void ndr_print_SERVER_INFO_598(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_598 *r);
enum ndr_err_code ndr_push_SERVER_INFO_1005(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1005 *r);
enum ndr_err_code ndr_pull_SERVER_INFO_1005(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1005 *r);
void ndr_print_SERVER_INFO_1005(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1005 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1107(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1107 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1107(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1107 *r);
+void ndr_print_SERVER_INFO_1107(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1107 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1010(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1010 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1010(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1010 *r);
+void ndr_print_SERVER_INFO_1010(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1010 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1016(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1016 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1016(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1016 *r);
+void ndr_print_SERVER_INFO_1016(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1016 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1017(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1017 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1017(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1017 *r);
+void ndr_print_SERVER_INFO_1017(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1017 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1018(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1018 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1018(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1018 *r);
+void ndr_print_SERVER_INFO_1018(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1018 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1501(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1501 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1501(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1501 *r);
+void ndr_print_SERVER_INFO_1501(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1501 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1502(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1502 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1502(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1502 *r);
+void ndr_print_SERVER_INFO_1502(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1502 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1503(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1503 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1503(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1503 *r);
+void ndr_print_SERVER_INFO_1503(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1503 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1506(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1506 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1506(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1506 *r);
+void ndr_print_SERVER_INFO_1506(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1506 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1509(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1509 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1509(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1509 *r);
+void ndr_print_SERVER_INFO_1509(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1509 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1510(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1510 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1510(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1510 *r);
+void ndr_print_SERVER_INFO_1510(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1510 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1511(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1511 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1511(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1511 *r);
+void ndr_print_SERVER_INFO_1511(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1511 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1512(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1512 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1512(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1512 *r);
+void ndr_print_SERVER_INFO_1512(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1512 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1513(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1513 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1513(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1513 *r);
+void ndr_print_SERVER_INFO_1513(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1513 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1514(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1514 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1514(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1514 *r);
+void ndr_print_SERVER_INFO_1514(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1514 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1515(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1515 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1515(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1515 *r);
+void ndr_print_SERVER_INFO_1515(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1515 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1516(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1516 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1516(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1516 *r);
+void ndr_print_SERVER_INFO_1516(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1516 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1518(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1518 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1518(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1518 *r);
+void ndr_print_SERVER_INFO_1518(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1518 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1520(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1520 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1520(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1520 *r);
+void ndr_print_SERVER_INFO_1520(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1520 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1521(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1521 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1521(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1521 *r);
+void ndr_print_SERVER_INFO_1521(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1521 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1522(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1522 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1522(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1522 *r);
+void ndr_print_SERVER_INFO_1522(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1522 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1523(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1523 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1523(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1523 *r);
+void ndr_print_SERVER_INFO_1523(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1523 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1524(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1524 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1524(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1524 *r);
+void ndr_print_SERVER_INFO_1524(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1524 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1525(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1525 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1525(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1525 *r);
+void ndr_print_SERVER_INFO_1525(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1525 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1528(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1528 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1528(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1528 *r);
+void ndr_print_SERVER_INFO_1528(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1528 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1529(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1529 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1529(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1529 *r);
+void ndr_print_SERVER_INFO_1529(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1529 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1530(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1530 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1530(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1530 *r);
+void ndr_print_SERVER_INFO_1530(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1530 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1533(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1533 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1533(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1533 *r);
+void ndr_print_SERVER_INFO_1533(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1533 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1534(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1534 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1534(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1534 *r);
+void ndr_print_SERVER_INFO_1534(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1534 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1535(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1535 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1535(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1535 *r);
+void ndr_print_SERVER_INFO_1535(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1535 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1536(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1536 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1536(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1536 *r);
+void ndr_print_SERVER_INFO_1536(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1536 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1537(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1537 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1537(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1537 *r);
+void ndr_print_SERVER_INFO_1537(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1537 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1538(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1538 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1538(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1538 *r);
+void ndr_print_SERVER_INFO_1538(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1538 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1539(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1539 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1539(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1539 *r);
+void ndr_print_SERVER_INFO_1539(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1539 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1540(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1540 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1540(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1540 *r);
+void ndr_print_SERVER_INFO_1540(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1540 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1541(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1541 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1541(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1541 *r);
+void ndr_print_SERVER_INFO_1541(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1541 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1542(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1542 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1542(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1542 *r);
+void ndr_print_SERVER_INFO_1542(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1542 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1543(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1543 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1543(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1543 *r);
+void ndr_print_SERVER_INFO_1543(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1543 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1544(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1544 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1544(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1544 *r);
+void ndr_print_SERVER_INFO_1544(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1544 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1545(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1545 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1545(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1545 *r);
+void ndr_print_SERVER_INFO_1545(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1545 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1546(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1546 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1546(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1546 *r);
+void ndr_print_SERVER_INFO_1546(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1546 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1547(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1547 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1547(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1547 *r);
+void ndr_print_SERVER_INFO_1547(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1547 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1548(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1548 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1548(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1548 *r);
+void ndr_print_SERVER_INFO_1548(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1548 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1549(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1549 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1549(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1549 *r);
+void ndr_print_SERVER_INFO_1549(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1549 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1550(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1550 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1550(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1550 *r);
+void ndr_print_SERVER_INFO_1550(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1550 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1552(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1552 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1552(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1552 *r);
+void ndr_print_SERVER_INFO_1552(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1552 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1553(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1553 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1553(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1553 *r);
+void ndr_print_SERVER_INFO_1553(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1553 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1554(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1554 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1554(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1554 *r);
+void ndr_print_SERVER_INFO_1554(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1554 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1555(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1555 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1555(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1555 *r);
+void ndr_print_SERVER_INFO_1555(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1555 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1556(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1556 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1556(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1556 *r);
+void ndr_print_SERVER_INFO_1556(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1556 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1557(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1557 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1557(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1557 *r);
+void ndr_print_SERVER_INFO_1557(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1557 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1560(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1560 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1560(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1560 *r);
+void ndr_print_SERVER_INFO_1560(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1560 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1561(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1561 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1561(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1561 *r);
+void ndr_print_SERVER_INFO_1561(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1561 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1562(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1562 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1562(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1562 *r);
+void ndr_print_SERVER_INFO_1562(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1562 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1563(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1563 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1563(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1563 *r);
+void ndr_print_SERVER_INFO_1563(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1563 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1564(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1564 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1564(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1564 *r);
+void ndr_print_SERVER_INFO_1564(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1564 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1565(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1565 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1565(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1565 *r);
+void ndr_print_SERVER_INFO_1565(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1565 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1566(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1566 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1566(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1566 *r);
+void ndr_print_SERVER_INFO_1566(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1566 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1567(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1567 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1567(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1567 *r);
+void ndr_print_SERVER_INFO_1567(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1567 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1568(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1568 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1568(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1568 *r);
+void ndr_print_SERVER_INFO_1568(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1568 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1569(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1569 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1569(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1569 *r);
+void ndr_print_SERVER_INFO_1569(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1569 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1570(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1570 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1570(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1570 *r);
+void ndr_print_SERVER_INFO_1570(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1570 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1571(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1571 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1571(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1571 *r);
+void ndr_print_SERVER_INFO_1571(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1571 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1572(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1572 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1572(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1572 *r);
+void ndr_print_SERVER_INFO_1572(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1572 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1573(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1573 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1573(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1573 *r);
+void ndr_print_SERVER_INFO_1573(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1573 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1574(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1574 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1574(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1574 *r);
+void ndr_print_SERVER_INFO_1574(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1574 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1575(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1575 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1575(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1575 *r);
+void ndr_print_SERVER_INFO_1575(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1575 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1576(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1576 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1576(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1576 *r);
+void ndr_print_SERVER_INFO_1576(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1576 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1577(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1577 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1577(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1577 *r);
+void ndr_print_SERVER_INFO_1577(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1577 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1578(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1578 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1578(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1578 *r);
+void ndr_print_SERVER_INFO_1578(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1578 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1579(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1579 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1579(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1579 *r);
+void ndr_print_SERVER_INFO_1579(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1579 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1580(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1580 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1580(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1580 *r);
+void ndr_print_SERVER_INFO_1580(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1580 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1581(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1581 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1581(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1581 *r);
+void ndr_print_SERVER_INFO_1581(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1581 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1582(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1582 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1582(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1582 *r);
+void ndr_print_SERVER_INFO_1582(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1582 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1583(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1583 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1583(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1583 *r);
+void ndr_print_SERVER_INFO_1583(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1583 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1584(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1584 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1584(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1584 *r);
+void ndr_print_SERVER_INFO_1584(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1584 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1585(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1585 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1585(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1585 *r);
+void ndr_print_SERVER_INFO_1585(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1585 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1586(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1586 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1586(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1586 *r);
+void ndr_print_SERVER_INFO_1586(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1586 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1587(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1587 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1587(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1587 *r);
+void ndr_print_SERVER_INFO_1587(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1587 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1588(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1588 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1588(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1588 *r);
+void ndr_print_SERVER_INFO_1588(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1588 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1590(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1590 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1590(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1590 *r);
+void ndr_print_SERVER_INFO_1590(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1590 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1591(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1591 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1591(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1591 *r);
+void ndr_print_SERVER_INFO_1591(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1591 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1592(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1592 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1592(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1592 *r);
+void ndr_print_SERVER_INFO_1592(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1592 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1593(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1593 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1593(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1593 *r);
+void ndr_print_SERVER_INFO_1593(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1593 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1594(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1594 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1594(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1594 *r);
+void ndr_print_SERVER_INFO_1594(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1594 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1595(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1595 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1595(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1595 *r);
+void ndr_print_SERVER_INFO_1595(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1595 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1596(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1596 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1596(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1596 *r);
+void ndr_print_SERVER_INFO_1596(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1596 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1597(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1597 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1597(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1597 *r);
+void ndr_print_SERVER_INFO_1597(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1597 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1598(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1598 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1598(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1598 *r);
+void ndr_print_SERVER_INFO_1598(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1598 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1599(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1599 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1599(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1599 *r);
+void ndr_print_SERVER_INFO_1599(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1599 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1600(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1600 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1600(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1600 *r);
+void ndr_print_SERVER_INFO_1600(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1600 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1601(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1601 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1601(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1601 *r);
+void ndr_print_SERVER_INFO_1601(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1601 *r);
+enum ndr_err_code ndr_push_SERVER_INFO_1602(struct ndr_push *ndr, int ndr_flags, const struct SERVER_INFO_1602 *r);
+enum ndr_err_code ndr_pull_SERVER_INFO_1602(struct ndr_pull *ndr, int ndr_flags, struct SERVER_INFO_1602 *r);
+void ndr_print_SERVER_INFO_1602(struct ndr_print *ndr, const char *name, const struct SERVER_INFO_1602 *r);
enum ndr_err_code ndr_push_DOMAIN_CONTROLLER_INFO(struct ndr_push *ndr, int ndr_flags, const struct DOMAIN_CONTROLLER_INFO *r);
enum ndr_err_code ndr_pull_DOMAIN_CONTROLLER_INFO(struct ndr_pull *ndr, int ndr_flags, struct DOMAIN_CONTROLLER_INFO *r);
void ndr_print_DOMAIN_CONTROLLER_INFO(struct ndr_print *ndr, const char *name, const struct DOMAIN_CONTROLLER_INFO *r);
diff --git a/source3/librpc/idl/libnetapi.idl b/source3/librpc/idl/libnetapi.idl
index f2f4a16c12..6be2171bee 100644
--- a/source3/librpc/idl/libnetapi.idl
+++ b/source3/librpc/idl/libnetapi.idl
@@ -141,9 +141,622 @@ interface libnetapi
} SERVER_INFO_102;
[public] typedef struct {
+ uint32 sv402_ulist_mtime;
+ uint32 sv402_glist_mtime;
+ uint32 sv402_alist_mtime;
+ string sv402_alerts;
+ uint32 sv402_security;
+ uint32 sv402_numadmin;
+ uint32 sv402_lanmask;
+ string sv402_guestacct;
+ uint32 sv402_chdevs;
+ uint32 sv402_chdevq;
+ uint32 sv402_chdevjobs;
+ uint32 sv402_connections;
+ uint32 sv402_shares;
+ uint32 sv402_openfiles;
+ uint32 sv402_sessopens;
+ uint32 sv402_sessvcs;
+ uint32 sv402_sessreqs;
+ uint32 sv402_opensearch;
+ uint32 sv402_activelocks;
+ uint32 sv402_numreqbuf;
+ uint32 sv402_sizreqbuf;
+ uint32 sv402_numbigbuf;
+ uint32 sv402_numfiletasks;
+ uint32 sv402_alertsched;
+ uint32 sv402_erroralert;
+ uint32 sv402_logonalert;
+ uint32 sv402_accessalert;
+ uint32 sv402_diskalert;
+ uint32 sv402_netioalert;
+ uint32 sv402_maxauditsz;
+ string sv402_srvheuristics;
+ } SERVER_INFO_402;
+
+ [public] typedef struct {
+ uint32 sv403_ulist_mtime;
+ uint32 sv403_glist_mtime;
+ uint32 sv403_alist_mtime;
+ string sv403_alerts;
+ uint32 sv403_security;
+ uint32 sv403_numadmin;
+ uint32 sv403_lanmask;
+ string sv403_guestacct;
+ uint32 sv403_chdevs;
+ uint32 sv403_chdevq;
+ uint32 sv403_chdevjobs;
+ uint32 sv403_connections;
+ uint32 sv403_shares;
+ uint32 sv403_openfiles;
+ uint32 sv403_sessopens;
+ uint32 sv403_sessvcs;
+ uint32 sv403_sessreqs;
+ uint32 sv403_opensearch;
+ uint32 sv403_activelocks;
+ uint32 sv403_numreqbuf;
+ uint32 sv403_sizreqbuf;
+ uint32 sv403_numbigbuf;
+ uint32 sv403_numfiletasks;
+ uint32 sv403_alertsched;
+ uint32 sv403_erroralert;
+ uint32 sv403_logonalert;
+ uint32 sv403_accessalert;
+ uint32 sv403_diskalert;
+ uint32 sv403_netioalert;
+ uint32 sv403_maxauditsz;
+ string sv403_srvheuristics;
+ uint32 sv403_auditedevents;
+ uint32 sv403_autoprofile;
+ string sv403_autopath;
+ } SERVER_INFO_403;
+
+ [public] typedef struct {
+ uint32 sv502_sessopens;
+ uint32 sv502_sessvcs;
+ uint32 sv502_opensearch;
+ uint32 sv502_sizreqbuf;
+ uint32 sv502_initworkitems;
+ uint32 sv502_maxworkitems;
+ uint32 sv502_rawworkitems;
+ uint32 sv502_irpstacksize;
+ uint32 sv502_maxrawbuflen;
+ uint32 sv502_sessusers;
+ uint32 sv502_sessconns;
+ uint32 sv502_maxpagedmemoryusage;
+ uint32 sv502_maxnonpagedmemoryusage;
+ boolean8 sv502_enablesoftcompat;
+ boolean8 sv502_enableforcedlogoff;
+ boolean8 sv502_timesource;
+ boolean8 sv502_acceptdownlevelapis;
+ boolean8 sv502_lmannounce;
+ } SERVER_INFO_502;
+
+ [public] typedef struct {
+ uint32 sv503_sessopens;
+ uint32 sv503_sessvcs;
+ uint32 sv503_opensearch;
+ uint32 sv503_sizreqbuf;
+ uint32 sv503_initworkitems;
+ uint32 sv503_maxworkitems;
+ uint32 sv503_rawworkitems;
+ uint32 sv503_irpstacksize;
+ uint32 sv503_maxrawbuflen;
+ uint32 sv503_sessusers;
+ uint32 sv503_sessconns;
+ uint32 sv503_maxpagedmemoryusage;
+ uint32 sv503_maxnonpagedmemoryusage;
+ boolean8 sv503_enablesoftcompat;
+ boolean8 sv503_enableforcedlogoff;
+ boolean8 sv503_timesource;
+ boolean8 sv503_acceptdownlevelapis;
+ boolean8 sv503_lmannounce;
+ string sv503_domain;
+ uint32 sv503_maxcopyreadlen;
+ uint32 sv503_maxcopywritelen;
+ uint32 sv503_minkeepsearch;
+ uint32 sv503_maxkeepsearch;
+ uint32 sv503_minkeepcomplsearch;
+ uint32 sv503_maxkeepcomplsearch;
+ uint32 sv503_threadcountadd;
+ uint32 sv503_numblockthreads;
+ uint32 sv503_scavtimeout;
+ uint32 sv503_minrcvqueue;
+ uint32 sv503_minfreeworkitems;
+ uint32 sv503_xactmemsize;
+ uint32 sv503_threadpriority;
+ uint32 sv503_maxmpxct;
+ uint32 sv503_oplockbreakwait;
+ uint32 sv503_oplockbreakresponsewait;
+ boolean8 sv503_enableoplocks;
+ boolean8 sv503_enableoplockforceclose;
+ boolean8 sv503_enablefcbopens;
+ boolean8 sv503_enableraw;
+ boolean8 sv503_enablesharednetdrives;
+ uint32 sv503_minfreeconnections;
+ uint32 sv503_maxfreeconnections;
+ } SERVER_INFO_503;
+
+ [public] typedef struct {
+ uint32 sv599_sessopens;
+ uint32 sv599_sessvcs;
+ uint32 sv599_opensearch;
+ uint32 sv599_sizreqbuf;
+ uint32 sv599_initworkitems;
+ uint32 sv599_maxworkitems;
+ uint32 sv599_rawworkitems;
+ uint32 sv599_irpstacksize;
+ uint32 sv599_maxrawbuflen;
+ uint32 sv599_sessusers;
+ uint32 sv599_sessconns;
+ uint32 sv599_maxpagedmemoryusage;
+ uint32 sv599_maxnonpagedmemoryusage;
+ boolean8 sv599_enablesoftcompat;
+ boolean8 sv599_enableforcedlogoff;
+ boolean8 sv599_timesource;
+ boolean8 sv599_acceptdownlevelapis;
+ boolean8 sv599_lmannounce;
+ string sv599_domain;
+ uint32 sv599_maxcopyreadlen;
+ uint32 sv599_maxcopywritelen;
+ uint32 sv599_minkeepsearch;
+ uint32 sv599_maxkeepsearch;
+ uint32 sv599_minkeepcomplsearch;
+ uint32 sv599_maxkeepcomplsearch;
+ uint32 sv599_threadcountadd;
+ uint32 sv599_numblockthreads;
+ uint32 sv599_scavtimeout;
+ uint32 sv599_minrcvqueue;
+ uint32 sv599_minfreeworkitems;
+ uint32 sv599_xactmemsize;
+ uint32 sv599_threadpriority;
+ uint32 sv599_maxmpxct;
+ uint32 sv599_oplockbreakwait;
+ uint32 sv599_oplockbreakresponsewait;
+ boolean8 sv599_enableoplocks;
+ boolean8 sv599_enableoplockforceclose;
+ boolean8 sv599_enablefcbopens;
+ boolean8 sv599_enableraw;
+ boolean8 sv599_enablesharednetdrives;
+ uint32 sv599_minfreeconnections;
+ uint32 sv599_maxfreeconnections;
+ uint32 sv599_initsesstable;
+ uint32 sv599_initconntable;
+ uint32 sv599_initfiletable;
+ uint32 sv599_initsearchtable;
+ uint32 sv599_alertschedule;
+ uint32 sv599_errorthreshold;
+ uint32 sv599_networkerrorthreshold;
+ uint32 sv599_diskspacethreshold;
+ uint32 sv599_reserved;
+ uint32 sv599_maxlinkdelay;
+ uint32 sv599_minlinkthroughput;
+ uint32 sv599_linkinfovalidtime;
+ uint32 sv599_scavqosinfoupdatetime;
+ uint32 sv599_maxworkitemidletime;
+ } SERVER_INFO_599;
+
+ [public] typedef struct {
+ uint32 sv598_maxrawworkitems;
+ uint32 sv598_maxthreadsperqueue;
+ uint32 sv598_producttype;
+ uint32 sv598_serversize;
+ uint32 sv598_connectionlessautodisc;
+ uint32 sv598_sharingviolationretries;
+ uint32 sv598_sharingviolationdelay;
+ uint32 sv598_maxglobalopensearch;
+ uint32 sv598_removeduplicatesearches;
+ uint32 sv598_lockviolationoffset;
+ uint32 sv598_lockviolationdelay;
+ uint32 sv598_mdlreadswitchover;
+ uint32 sv598_cachedopenlimit;
+ uint32 sv598_otherqueueaffinity;
+ boolean8 sv598_restrictnullsessaccess;
+ boolean8 sv598_enablewfw311directipx;
+ uint32 sv598_queuesamplesecs;
+ uint32 sv598_balancecount;
+ uint32 sv598_preferredaffinity;
+ uint32 sv598_maxfreerfcbs;
+ uint32 sv598_maxfreemfcbs;
+ uint32 sv598_maxfreelfcbs;
+ uint32 sv598_maxfreepagedpoolchunks;
+ uint32 sv598_minpagedpoolchunksize;
+ uint32 sv598_maxpagedpoolchunksize;
+ boolean8 sv598_sendsfrompreferredprocessor;
+ uint32 sv598_cacheddirectorylimit;
+ uint32 sv598_maxcopylength;
+ boolean8 sv598_enablecompression;
+ boolean8 sv598_autosharewks;
+ boolean8 sv598_autoshareserver;
+ boolean8 sv598_enablesecuritysignature;
+ boolean8 sv598_requiresecuritysignature;
+ uint32 sv598_minclientbuffersize;
+ GUID sv598_serverguid;
+ uint32 sv598_ConnectionNoSessionsTimeout;
+ uint32 sv598_IdleThreadTimeOut;
+ boolean8 sv598_enableW9xsecuritysignature;
+ boolean8 sv598_enforcekerberosreauthentication;
+ boolean8 sv598_disabledos;
+ uint32 sv598_lowdiskspaceminimum;
+ boolean8 sv598_disablestrictnamechecking;
+ } SERVER_INFO_598;
+
+ [public] typedef struct {
string sv1005_comment;
} SERVER_INFO_1005;
+ [public] typedef struct {
+ uint32 sv1107_users;
+ } SERVER_INFO_1107;
+
+ [public] typedef struct {
+ int32 sv1010_disc;
+ } SERVER_INFO_1010;
+
+ [public] typedef struct {
+ boolean8 sv1016_hidden;
+ } SERVER_INFO_1016;
+
+ [public] typedef struct {
+ uint32 sv1017_announce;
+ } SERVER_INFO_1017;
+
+ [public] typedef struct {
+ uint32 sv1018_anndelta;
+ } SERVER_INFO_1018;
+
+ [public] typedef struct {
+ uint32 sv1501_sessopens;
+ } SERVER_INFO_1501;
+
+ [public] typedef struct {
+ uint32 sv1502_sessvcs;
+ } SERVER_INFO_1502;
+
+ [public] typedef struct {
+ uint32 sv1503_opensearch;
+ } SERVER_INFO_1503;
+
+ [public] typedef struct {
+ uint32 sv1506_maxworkitems;
+ } SERVER_INFO_1506;
+
+ [public] typedef struct {
+ uint32 sv1509_maxrawbuflen;
+ } SERVER_INFO_1509;
+
+ [public] typedef struct {
+ uint32 sv1510_sessusers;
+ } SERVER_INFO_1510;
+
+ [public] typedef struct {
+ uint32 sv1511_sessconns;
+ } SERVER_INFO_1511;
+
+ [public] typedef struct {
+ uint32 sv1512_maxnonpagedmemoryusage;
+ } SERVER_INFO_1512;
+
+ [public] typedef struct {
+ uint32 sv1513_maxpagedmemoryusage;
+ } SERVER_INFO_1513;
+
+ [public] typedef struct {
+ boolean8 sv1514_enablesoftcompat;
+ } SERVER_INFO_1514;
+
+ [public] typedef struct {
+ boolean8 sv1515_enableforcedlogoff;
+ } SERVER_INFO_1515;
+
+ [public] typedef struct {
+ boolean8 sv1516_timesource;
+ } SERVER_INFO_1516;
+
+ [public] typedef struct {
+ boolean8 sv1518_lmannounce;
+ } SERVER_INFO_1518;
+
+ [public] typedef struct {
+ uint32 sv1520_maxcopyreadlen;
+ } SERVER_INFO_1520;
+
+ [public] typedef struct {
+ uint32 sv1521_maxcopywritelen;
+ } SERVER_INFO_1521;
+
+ [public] typedef struct {
+ uint32 sv1522_minkeepsearch;
+ } SERVER_INFO_1522;
+
+ [public] typedef struct {
+ uint32 sv1523_maxkeepsearch;
+ } SERVER_INFO_1523;
+
+ [public] typedef struct {
+ uint32 sv1524_minkeepcomplsearch;
+ } SERVER_INFO_1524;
+
+ [public] typedef struct {
+ uint32 sv1525_maxkeepcomplsearch;
+ } SERVER_INFO_1525;
+
+ [public] typedef struct {
+ uint32 sv1528_scavtimeout;
+ } SERVER_INFO_1528;
+
+ [public] typedef struct {
+ uint32 sv1529_minrcvqueue;
+ } SERVER_INFO_1529;
+
+ [public] typedef struct {
+ uint32 sv1530_minfreeworkitems;
+ } SERVER_INFO_1530;
+
+ [public] typedef struct {
+ uint32 sv1533_maxmpxct;
+ } SERVER_INFO_1533;
+
+ [public] typedef struct {
+ uint32 sv1534_oplockbreakwait;
+ } SERVER_INFO_1534;
+
+ [public] typedef struct {
+ uint32 sv1535_oplockbreakresponsewait;
+ } SERVER_INFO_1535;
+
+ [public] typedef struct {
+ boolean8 sv1536_enableoplocks;
+ } SERVER_INFO_1536;
+
+ [public] typedef struct {
+ boolean8 sv1537_enableoplockforceclose;
+ } SERVER_INFO_1537;
+
+ [public] typedef struct {
+ boolean8 sv1538_enablefcbopens;
+ } SERVER_INFO_1538;
+
+ [public] typedef struct {
+ boolean8 sv1539_enableraw;
+ } SERVER_INFO_1539;
+
+ [public] typedef struct {
+ boolean8 sv1540_enablesharednetdrives;
+ } SERVER_INFO_1540;
+
+ [public] typedef struct {
+ boolean8 sv1541_minfreeconnections;
+ } SERVER_INFO_1541;
+
+ [public] typedef struct {
+ boolean8 sv1542_maxfreeconnections;
+ } SERVER_INFO_1542;
+
+ [public] typedef struct {
+ uint32 sv1543_initsesstable;
+ } SERVER_INFO_1543;
+
+ [public] typedef struct {
+ uint32 sv1544_initconntable;
+ } SERVER_INFO_1544;
+
+ [public] typedef struct {
+ uint32 sv1545_initfiletable;
+ } SERVER_INFO_1545;
+
+ [public] typedef struct {
+ uint32 sv1546_initsearchtable;
+ } SERVER_INFO_1546;
+
+ [public] typedef struct {
+ uint32 sv1547_alertschedule;
+ } SERVER_INFO_1547;
+
+ [public] typedef struct {
+ uint32 sv1548_errorthreshold;
+ } SERVER_INFO_1548;
+
+ [public] typedef struct {
+ uint32 sv1549_networkerrorthreshold;
+ } SERVER_INFO_1549;
+
+ [public] typedef struct {
+ uint32 sv1550_diskspacethreshold;
+ } SERVER_INFO_1550;
+
+ [public] typedef struct {
+ uint32 sv1552_maxlinkdelay;
+ } SERVER_INFO_1552;
+
+ [public] typedef struct {
+ uint32 sv1553_minlinkthroughput;
+ } SERVER_INFO_1553;
+
+ [public] typedef struct {
+ uint32 sv1554_linkinfovalidtime;
+ } SERVER_INFO_1554;
+
+ [public] typedef struct {
+ uint32 sv1555_scavqosinfoupdatetime;
+ } SERVER_INFO_1555;
+
+ [public] typedef struct {
+ uint32 sv1556_maxworkitemidletime;
+ } SERVER_INFO_1556;
+
+ [public] typedef struct {
+ uint32 sv1557_maxrawworkitems;
+ } SERVER_INFO_1557;
+
+ [public] typedef struct {
+ uint32 sv1560_producttype;
+ } SERVER_INFO_1560;
+
+ [public] typedef struct {
+ uint32 sv1561_serversize;
+ } SERVER_INFO_1561;
+
+ [public] typedef struct {
+ uint32 sv1562_connectionlessautodisc;
+ } SERVER_INFO_1562;
+
+ [public] typedef struct {
+ uint32 sv1563_sharingviolationretries;
+ } SERVER_INFO_1563;
+
+ [public] typedef struct {
+ uint32 sv1564_sharingviolationdelay;
+ } SERVER_INFO_1564;
+
+ [public] typedef struct {
+ uint32 sv1565_maxglobalopensearch;
+ } SERVER_INFO_1565;
+
+ [public] typedef struct {
+ boolean8 sv1566_removeduplicatesearches;
+ } SERVER_INFO_1566;
+
+ [public] typedef struct {
+ uint32 sv1567_lockviolationretries;
+ } SERVER_INFO_1567;
+
+ [public] typedef struct {
+ uint32 sv1568_lockviolationoffset;
+ } SERVER_INFO_1568;
+
+ [public] typedef struct {
+ uint32 sv1569_lockviolationdelay;
+ } SERVER_INFO_1569;
+
+ [public] typedef struct {
+ uint32 sv1570_mdlreadswitchover;
+ } SERVER_INFO_1570;
+
+ [public] typedef struct {
+ uint32 sv1571_cachedopenlimit;
+ } SERVER_INFO_1571;
+
+ [public] typedef struct {
+ uint32 sv1572_criticalthreads;
+ } SERVER_INFO_1572;
+
+ [public] typedef struct {
+ uint32 sv1573_restrictnullsessaccess;
+ } SERVER_INFO_1573;
+
+ [public] typedef struct {
+ uint32 sv1574_enablewfw311directipx;
+ } SERVER_INFO_1574;
+
+ [public] typedef struct {
+ uint32 sv1575_otherqueueaffinity;
+ } SERVER_INFO_1575;
+
+ [public] typedef struct {
+ uint32 sv1576_queuesamplesecs;
+ } SERVER_INFO_1576;
+
+ [public] typedef struct {
+ uint32 sv1577_balancecount;
+ } SERVER_INFO_1577;
+
+ [public] typedef struct {
+ uint32 sv1578_preferredaffinity;
+ } SERVER_INFO_1578;
+
+ [public] typedef struct {
+ uint32 sv1579_maxfreerfcbs;
+ } SERVER_INFO_1579;
+
+ [public] typedef struct {
+ uint32 sv1580_maxfreemfcbs;
+ } SERVER_INFO_1580;
+
+ [public] typedef struct {
+ uint32 sv1581_maxfreemlcbs;
+ } SERVER_INFO_1581;
+
+ [public] typedef struct {
+ uint32 sv1582_maxfreepagedpoolchunks;
+ } SERVER_INFO_1582;
+
+ [public] typedef struct {
+ uint32 sv1583_minpagedpoolchunksize;
+ } SERVER_INFO_1583;
+
+ [public] typedef struct {
+ uint32 sv1584_maxpagedpoolchunksize;
+ } SERVER_INFO_1584;
+
+ [public] typedef struct {
+ boolean8 sv1585_sendsfrompreferredprocessor;
+ } SERVER_INFO_1585;
+
+ [public] typedef struct {
+ uint32 sv1586_maxthreadsperqueue;
+ } SERVER_INFO_1586;
+
+ [public] typedef struct {
+ uint32 sv1587_cacheddirectorylimit;
+ } SERVER_INFO_1587;
+
+ [public] typedef struct {
+ uint32 sv1588_maxcopylength;
+ } SERVER_INFO_1588;
+
+ [public] typedef struct {
+ uint32 sv1590_enablecompression;
+ } SERVER_INFO_1590;
+
+ [public] typedef struct {
+ uint32 sv1591_autosharewks;
+ } SERVER_INFO_1591;
+
+ [public] typedef struct {
+ uint32 sv1592_autosharewks;
+ } SERVER_INFO_1592;
+
+ [public] typedef struct {
+ uint32 sv1593_enablesecuritysignature;
+ } SERVER_INFO_1593;
+
+ [public] typedef struct {
+ uint32 sv1594_requiresecuritysignature;
+ } SERVER_INFO_1594;
+
+ [public] typedef struct {
+ uint32 sv1595_minclientbuffersize;
+ } SERVER_INFO_1595;
+
+ [public] typedef struct {
+ uint32 sv1596_ConnectionNoSessionsTimeout;
+ } SERVER_INFO_1596;
+
+ [public] typedef struct {
+ uint32 sv1597_IdleThreadTimeOut;
+ } SERVER_INFO_1597;
+
+ [public] typedef struct {
+ uint32 sv1598_enableW9xsecuritysignature;
+ } SERVER_INFO_1598;
+
+ [public] typedef struct {
+ boolean8 sv1598_enforcekerberosreauthentication;
+ } SERVER_INFO_1599;
+
+ [public] typedef struct {
+ boolean8 sv1598_disabledos;
+ } SERVER_INFO_1600;
+
+ [public] typedef struct {
+ uint32 sv1598_lowdiskspaceminimum;
+ } SERVER_INFO_1601;
+
+ [public] typedef struct {
+ boolean8 sv_1598_disablestrictnamechecking;
+ } SERVER_INFO_1602;
+
[nopush,nopull] NET_API_STATUS NetServerGetInfo(
[in,unique] string *server_name,
[in] uint32 level,
diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c
index d71a318a1f..4c5a758aab 100644
--- a/source3/libsmb/libsmb_xattr.c
+++ b/source3/libsmb/libsmb_xattr.c
@@ -1501,7 +1501,7 @@ cacl_set(TALLOC_CTX *ctx,
struct cli_state *ipc_cli,
POLICY_HND *pol,
const char *filename,
- const char *the_acl,
+ char *the_acl,
int mode,
int flags)
{
@@ -2113,11 +2113,13 @@ SMBC_getxattr_ctx(SMBCCTX *context,
StrCaseCmp(name, "system.dos_attr.inode") == 0) {
/* Yup. */
+ char *filename = (char *) name;
ret = cacl_get(context, talloc_tos(), srv,
ipc_srv == NULL ? NULL : ipc_srv->cli,
&ipc_srv->pol, path,
- CONST_DISCARD(char *, name),
- CONST_DISCARD(char *, value), size);
+ filename,
+ CONST_DISCARD(char *, value),
+ size);
if (ret < 0 && errno == 0) {
errno = SMBC_errno(context, srv->cli);
}
@@ -2236,7 +2238,8 @@ SMBC_removexattr_ctx(SMBCCTX *context,
/* Yup. */
ret = cacl_set(talloc_tos(), srv->cli,
ipc_srv->cli, &ipc_srv->pol, path,
- name + 19, SMBC_XATTR_MODE_REMOVE, 0);
+ CONST_DISCARD(char *, name) + 19,
+ SMBC_XATTR_MODE_REMOVE, 0);
TALLOC_FREE(frame);
return ret;
}
diff --git a/source3/modules/onefs.h b/source3/modules/onefs.h
index 9c1c1647ba..2044ebec48 100644
--- a/source3/modules/onefs.h
+++ b/source3/modules/onefs.h
@@ -53,6 +53,62 @@ enum onefs_acl_wire_format
#define PARM_UNMAPPABLE_SIDS_IGNORE_LIST_DEFAULT NULL
#define PARM_IGNORE_SACL "ignore sacl"
#define PARM_IGNORE_SACL_DEFAULT false
+#define PARM_ATIME_NOW "atime now files"
+#define PARM_ATIME_SLOP "atime now slop"
+#define PARM_CTIME_NOW "ctime now files"
+#define PARM_CTIME_SLOP "ctime now slop"
+#define PARM_MTIME_NOW "mtime now files"
+#define PARM_MTIME_SLOP "mtime now slop"
+#define PARM_MTIME_STATIC "mtime static files"
+#define PARM_ATIME_STATIC "atime static files"
+
+#define IS_CTIME_NOW_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
+ (cfg)->ctime_now_list,(conn)->case_sensitive))
+#define IS_MTIME_NOW_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
+ (cfg)->mtime_now_list,(conn)->case_sensitive))
+#define IS_ATIME_NOW_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
+ (cfg)->atime_now_list,(conn)->case_sensitive))
+#define IS_MTIME_STATIC_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
+ (cfg)->mtime_static_list,(conn)->case_sensitive))
+#define IS_ATIME_STATIC_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
+ (cfg)->atime_static_list,(conn)->case_sensitive))
+
+/*
+ * Store some commonly evaluated parameters to avoid loadparm pain.
+ */
+
+#define ONEFS_VFS_CONFIG_INITIALIZED 0x00010000
+
+#define ONEFS_VFS_CONFIG_FAKETIMESTAMPS 0x00000001
+
+
+struct onefs_vfs_config
+{
+ int32 init_flags;
+
+ /* data for fake timestamps */
+ int atime_slop;
+ int ctime_slop;
+ int mtime_slop;
+
+ /* Per-share list of files to fake the create time for. */
+ name_compare_entry *ctime_now_list;
+
+ /* Per-share list of files to fake the modification time for. */
+ name_compare_entry *mtime_now_list;
+
+ /* Per-share list of files to fake the access time for. */
+ name_compare_entry *atime_now_list;
+
+ /* Per-share list of files to fake the modification time for. */
+ name_compare_entry *mtime_static_list;
+
+ /* The access time will equal the create time. */
+ /* The modification time will equal the create time.*/
+
+ /* Per-share list of files to fake the access time for. */
+ name_compare_entry *atime_static_list;
+};
/*
* vfs interface handlers
@@ -121,6 +177,8 @@ NTSTATUS onefs_samba_sd_to_sd(uint32 security_info_sent, SEC_DESC *psd,
NTSTATUS onefs_split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
char **pbase, char **pstream);
+bool onefs_get_config(int snum, int config_type,
+ struct onefs_vfs_config *cfg);
/*
* System Interfaces
*/
diff --git a/source3/modules/onefs_streams.c b/source3/modules/onefs_streams.c
index 78b0fd61bf..615edf379d 100644
--- a/source3/modules/onefs_streams.c
+++ b/source3/modules/onefs_streams.c
@@ -216,6 +216,58 @@ static void merge_stat(SMB_STRUCT_STAT *stream_sbuf,
stream_sbuf->st_flags |= base_sbuf->st_flags & dos_flags;
}
+/* fake timestamps */
+static void onefs_adjust_stat_time(vfs_handle_struct *handle, const char *fname,
+ SMB_STRUCT_STAT *sbuf)
+{
+ struct onefs_vfs_config cfg;
+ struct timeval tv_now = {0, 0};
+ bool static_mtime = False;
+ bool static_atime = False;
+
+ if (!onefs_get_config(SNUM(handle->conn),
+ ONEFS_VFS_CONFIG_FAKETIMESTAMPS, &cfg)) {
+ return;
+ }
+
+ if (IS_MTIME_STATIC_PATH(handle->conn, &cfg, fname)) {
+ sbuf->st_mtime = sbuf->st_birthtime;
+ static_mtime = True;
+ }
+ if (IS_ATIME_STATIC_PATH(handle->conn, &cfg, fname)) {
+ sbuf->st_atime = sbuf->st_birthtime;
+ static_atime = True;
+ }
+
+ if (IS_CTIME_NOW_PATH(handle->conn, &cfg, fname)) {
+ if (cfg.ctime_slop < 0) {
+ sbuf->st_birthtime = INT_MAX - 1;
+ } else {
+ GetTimeOfDay(&tv_now);
+ sbuf->st_birthtime = tv_now.tv_sec + cfg.ctime_slop;
+ }
+ }
+
+ if (!static_mtime && IS_MTIME_NOW_PATH(handle->conn,&cfg,fname)) {
+ if (cfg.mtime_slop < 0) {
+ sbuf->st_mtime = INT_MAX - 1;
+ } else {
+ if (tv_now.tv_sec == 0)
+ GetTimeOfDay(&tv_now);
+ sbuf->st_mtime = tv_now.tv_sec + cfg.mtime_slop;
+ }
+ }
+ if (!static_atime && IS_ATIME_NOW_PATH(handle->conn,&cfg,fname)) {
+ if (cfg.atime_slop < 0) {
+ sbuf->st_atime = INT_MAX - 1;
+ } else {
+ if (tv_now.tv_sec == 0)
+ GetTimeOfDay(&tv_now);
+ sbuf->st_atime = tv_now.tv_sec + cfg.atime_slop;
+ }
+ }
+}
+
static int stat_stream(vfs_handle_struct *handle, const char *base,
const char *stream, SMB_STRUCT_STAT *sbuf, int flags)
{
@@ -257,15 +309,16 @@ int onefs_stat(vfs_handle_struct *handle, const char *path,
return ret;
if (!is_stream) {
- return SMB_VFS_NEXT_STAT(handle, path, sbuf);
- }
-
- /* If it's the ::$DATA stream just stat the base file name. */
- if (!stream) {
- return SMB_VFS_NEXT_STAT(handle, base, sbuf);
+ ret = SMB_VFS_NEXT_STAT(handle, path, sbuf);
+ } else if (!stream) {
+ /* If it's the ::$DATA stream just stat the base file name. */
+ ret = SMB_VFS_NEXT_STAT(handle, base, sbuf);
+ } else {
+ ret = stat_stream(handle, base, stream, sbuf, 0);
}
- return stat_stream(handle, base, stream, sbuf, 0);
+ onefs_adjust_stat_time(handle, path, sbuf);
+ return ret;
}
int onefs_fstat(vfs_handle_struct *handle, struct files_struct *fsp,
@@ -288,6 +341,7 @@ int onefs_fstat(vfs_handle_struct *handle, struct files_struct *fsp,
}
}
+ onefs_adjust_stat_time(handle, fsp->fsp_name, sbuf);
return ret;
}
@@ -304,15 +358,17 @@ int onefs_lstat(vfs_handle_struct *handle, const char *path,
return ret;
if (!is_stream) {
- return SMB_VFS_NEXT_LSTAT(handle, path, sbuf);
- }
-
- /* If it's the ::$DATA stream just stat the base file name. */
- if (!stream) {
- return SMB_VFS_NEXT_LSTAT(handle, base, sbuf);
+ ret = SMB_VFS_NEXT_LSTAT(handle, path, sbuf);
+ } else if (!stream) {
+ /* If it's the ::$DATA stream just stat the base file name. */
+ ret = SMB_VFS_NEXT_LSTAT(handle, base, sbuf);
+ } else {
+ ret = stat_stream(handle, base, stream, sbuf,
+ AT_SYMLINK_NOFOLLOW);
}
- return stat_stream(handle, base, stream, sbuf, AT_SYMLINK_NOFOLLOW);
+ onefs_adjust_stat_time(handle, path, sbuf);
+ return ret;
}
int onefs_unlink(vfs_handle_struct *handle, const char *path)
diff --git a/source3/modules/vfs_onefs.c b/source3/modules/vfs_onefs.c
index e2f272aa11..1f11f691a4 100644
--- a/source3/modules/vfs_onefs.c
+++ b/source3/modules/vfs_onefs.c
@@ -24,6 +24,118 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
+#define ONEFS_DATA_FASTBUF 10
+
+struct onefs_vfs_config share_config[ONEFS_DATA_FASTBUF];
+struct onefs_vfs_config *pshare_config;
+
+static void onefs_load_faketimestamp_config(struct vfs_handle_struct *handle,
+ struct onefs_vfs_config *cfg)
+{
+ const char **parm;
+ int snum = SNUM(handle->conn);
+
+ parm = lp_parm_string_list(snum, PARM_ONEFS_TYPE, PARM_ATIME_NOW,
+ NULL);
+
+ if (parm) {
+ cfg->init_flags |= ONEFS_VFS_CONFIG_FAKETIMESTAMPS;
+ set_namearray(&cfg->atime_now_list,*parm);
+ }
+
+ parm = lp_parm_string_list(snum, PARM_ONEFS_TYPE, PARM_CTIME_NOW,
+ NULL);
+
+ if (parm) {
+ cfg->init_flags |= ONEFS_VFS_CONFIG_FAKETIMESTAMPS;
+ set_namearray(&cfg->ctime_now_list,*parm);
+ }
+
+ parm = lp_parm_string_list(snum, PARM_ONEFS_TYPE, PARM_MTIME_NOW,
+ NULL);
+
+ if (parm) {
+ cfg->init_flags |= ONEFS_VFS_CONFIG_FAKETIMESTAMPS;
+ set_namearray(&cfg->mtime_now_list,*parm);
+ }
+
+ parm = lp_parm_string_list(snum, PARM_ONEFS_TYPE, PARM_ATIME_STATIC,
+ NULL);
+
+ if (parm) {
+ cfg->init_flags |= ONEFS_VFS_CONFIG_FAKETIMESTAMPS;
+ set_namearray(&cfg->atime_static_list,*parm);
+ }
+
+ parm = lp_parm_string_list(snum, PARM_ONEFS_TYPE, PARM_MTIME_STATIC,
+ NULL);
+
+ if (parm) {
+ cfg->init_flags |= ONEFS_VFS_CONFIG_FAKETIMESTAMPS;
+ set_namearray(&cfg->mtime_static_list,*parm);
+ }
+
+ cfg->atime_slop = lp_parm_int(snum, PARM_ONEFS_TYPE, PARM_ATIME_SLOP,0);
+ cfg->ctime_slop = lp_parm_int(snum, PARM_ONEFS_TYPE, PARM_CTIME_SLOP,0);
+ cfg->mtime_slop = lp_parm_int(snum, PARM_ONEFS_TYPE, PARM_MTIME_SLOP,0);
+}
+
+
+static int onefs_load_config(struct vfs_handle_struct *handle)
+{
+ int snum = SNUM(handle->conn);
+ int share_count = lp_numservices();
+
+ if (!pshare_config) {
+
+ if (share_count <= ONEFS_DATA_FASTBUF)
+ pshare_config = share_config;
+ else {
+ pshare_config = SMB_MALLOC_ARRAY(struct onefs_vfs_config,
+ share_count);
+ if (!pshare_config) {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ memset(pshare_config, 0,
+ (sizeof(struct onefs_vfs_config) * share_count));
+ }
+ }
+
+ if ((pshare_config[snum].init_flags &
+ ONEFS_VFS_CONFIG_INITIALIZED) == 0) {
+ pshare_config[snum].init_flags =
+ ONEFS_VFS_CONFIG_INITIALIZED;
+ onefs_load_faketimestamp_config(handle,
+ &pshare_config[snum]);
+ }
+
+ return 0;
+}
+
+bool onefs_get_config(int snum, int config_type,
+ struct onefs_vfs_config *cfg)
+{
+ if (share_config[snum].init_flags & config_type)
+ *cfg = share_config[snum];
+ else
+ return false;
+
+ return true;
+}
+
+static int onefs_connect(struct vfs_handle_struct *handle, const char *service,
+ const char *user)
+{
+ int ret = onefs_load_config(handle);
+
+ if (ret)
+ return ret;
+
+ return SMB_VFS_NEXT_CONNECT(handle, service, user);
+}
+
static int onefs_mkdir(vfs_handle_struct *handle, const char *path,
mode_t mode)
{
@@ -130,6 +242,8 @@ static uint32_t onefs_fs_capabilities(struct vfs_handle_struct *handle)
}
static vfs_op_tuple onefs_ops[] = {
+ {SMB_VFS_OP(onefs_connect), SMB_VFS_OP_CONNECT,
+ SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(onefs_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(onefs_mkdir), SMB_VFS_OP_MKDIR,
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index 7a8086c63e..c79caf2d36 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -6,17 +6,17 @@
Copyright (C) Gerald (Jerry) Carter 2000-2006
Copyright (C) Andrew Bartlett 2001-2002
Copyright (C) Stefan (metze) Metzmacher 2002
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -78,7 +78,7 @@ time_t pdb_get_pass_can_change_time(const struct samu *sampass)
*/
if (sampass->pass_last_set_time == 0)
return (time_t) 0;
-
+
/* if the time is max, and the field has been changed,
we're trying to update this real value from the sampass
to indicate that the user cannot change their password. jmcd
@@ -165,7 +165,7 @@ const uint8 *pdb_get_pw_history(const struct samu *sampass, uint32 *current_hist
/* Return the plaintext password if known. Most of the time
it isn't, so don't assume anything magic about this function.
-
+
Used to pass the plaintext to passdb backends that might
want to store more than just the NTLM hashes.
*/
@@ -183,18 +183,18 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass)
{
DOM_SID *gsid;
struct passwd *pwd;
-
+
/* Return the cached group SID if we have that */
if ( sampass->group_sid ) {
return sampass->group_sid;
}
-
+
/* generate the group SID from the user's primary Unix group */
-
+
if ( !(gsid = TALLOC_P( sampass, DOM_SID )) ) {
return NULL;
}
-
+
/* No algorithmic mapping, meaning that we have to figure out the
primary group SID according to group mapping and the user SID must
be a newly allocated one. We rely on the user's Unix primary gid.
@@ -210,12 +210,12 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass)
DEBUG(0,("pdb_get_group_sid: Failed to find Unix account for %s\n", pdb_get_username(sampass) ));
return NULL;
}
-
+
if ( pdb_gid_to_sid(pwd->pw_gid, gsid) ) {
enum lsa_SidType type = SID_NAME_UNKNOWN;
TALLOC_CTX *mem_ctx = talloc_init("pdb_get_group_sid");
bool lookup_ret;
-
+
if (!mem_ctx) {
return NULL;
}
@@ -237,12 +237,12 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass)
/* Just set it to the 'Domain Users' RID of 512 which will
always resolve to a name */
-
+
sid_copy( gsid, get_global_sam_sid() );
sid_append_rid( gsid, DOMAIN_GROUP_RID_USERS );
-
+
sampass->group_sid = gsid;
-
+
return sampass->group_sid;
}
@@ -251,19 +251,19 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass)
* @param sampass the struct samu in question
* @return the flags indicating the members initialised in the struct.
**/
-
+
enum pdb_value_state pdb_get_init_flags(const struct samu *sampass, enum pdb_elements element)
{
enum pdb_value_state ret = PDB_DEFAULT;
-
+
if (!sampass->change_flags || !sampass->set_flags)
return ret;
-
+
if (bitmap_query(sampass->set_flags, element)) {
DEBUG(11, ("element %d: SET\n", element));
ret = PDB_SET;
}
-
+
if (bitmap_query(sampass->change_flags, element)) {
DEBUG(11, ("element %d: CHANGED\n", element));
ret = PDB_CHANGED;
@@ -430,7 +430,7 @@ bool pdb_set_logon_divs(struct samu *sampass, uint16 hours, enum pdb_value_state
* @param flag The *new* flag to be set. Old flags preserved
* this flag is only added.
**/
-
+
bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag)
{
if (!sampass->set_flags) {
@@ -449,7 +449,7 @@ bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pd
return False;
}
}
-
+
switch(value_flag) {
case PDB_CHANGED:
if (!bitmap_set(sampass->change_flags, element)) {
@@ -494,7 +494,7 @@ bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value
{
if (!u_sid)
return False;
-
+
sid_copy(&sampass->user_sid, u_sid);
DEBUG(10, ("pdb_set_user_sid: setting user sid %s\n",
@@ -506,7 +506,7 @@ bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value
bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_value_state flag)
{
DOM_SID new_sid;
-
+
if (!u_sid)
return False;
@@ -517,7 +517,7 @@ bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_
DEBUG(1, ("pdb_set_user_sid_from_string: %s isn't a valid SID!\n", u_sid));
return False;
}
-
+
if (!pdb_set_user_sid(sampass, &new_sid, flag)) {
DEBUG(1, ("pdb_set_user_sid_from_string: could not set sid %s on struct samu!\n", u_sid));
return False;
@@ -580,7 +580,7 @@ bool pdb_set_username(struct samu *sampass, const char *username, enum pdb_value
} else {
sampass->username = PDB_NOT_QUITE_NULL;
}
-
+
return pdb_set_init_flags(sampass, PDB_USERNAME, flag);
}
@@ -618,7 +618,7 @@ bool pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb
(sampass->nt_username)?(sampass->nt_username):"NULL"));
sampass->nt_username = talloc_strdup(sampass, nt_username);
-
+
if (!sampass->nt_username) {
DEBUG(0, ("pdb_set_nt_username: talloc_strdup() failed!\n"));
return False;
@@ -639,7 +639,7 @@ bool pdb_set_fullname(struct samu *sampass, const char *full_name, enum pdb_valu
if (full_name) {
DEBUG(10, ("pdb_set_full_name: setting full name %s, was %s\n", full_name,
(sampass->full_name)?(sampass->full_name):"NULL"));
-
+
sampass->full_name = talloc_strdup(sampass, full_name);
if (!sampass->full_name) {
@@ -662,7 +662,7 @@ bool pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum p
if (logon_script) {
DEBUG(10, ("pdb_set_logon_script: setting logon script %s, was %s\n", logon_script,
(sampass->logon_script)?(sampass->logon_script):"NULL"));
-
+
sampass->logon_script = talloc_strdup(sampass, logon_script);
if (!sampass->logon_script) {
@@ -672,7 +672,7 @@ bool pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum p
} else {
sampass->logon_script = PDB_NOT_QUITE_NULL;
}
-
+
return pdb_set_init_flags(sampass, PDB_LOGONSCRIPT, flag);
}
@@ -685,9 +685,9 @@ bool pdb_set_profile_path(struct samu *sampass, const char *profile_path, enum p
if (profile_path) {
DEBUG(10, ("pdb_set_profile_path: setting profile path %s, was %s\n", profile_path,
(sampass->profile_path)?(sampass->profile_path):"NULL"));
-
+
sampass->profile_path = talloc_strdup(sampass, profile_path);
-
+
if (!sampass->profile_path) {
DEBUG(0, ("pdb_set_profile_path: talloc_strdup() failed!\n"));
return False;
@@ -708,9 +708,9 @@ bool pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_val
if (dir_drive) {
DEBUG(10, ("pdb_set_dir_drive: setting dir drive %s, was %s\n", dir_drive,
(sampass->dir_drive)?(sampass->dir_drive):"NULL"));
-
+
sampass->dir_drive = talloc_strdup(sampass, dir_drive);
-
+
if (!sampass->dir_drive) {
DEBUG(0, ("pdb_set_dir_drive: talloc_strdup() failed!\n"));
return False;
@@ -719,7 +719,7 @@ bool pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_val
} else {
sampass->dir_drive = PDB_NOT_QUITE_NULL;
}
-
+
return pdb_set_init_flags(sampass, PDB_DRIVE, flag);
}
@@ -732,9 +732,9 @@ bool pdb_set_homedir(struct samu *sampass, const char *home_dir, enum pdb_value_
if (home_dir) {
DEBUG(10, ("pdb_set_homedir: setting home dir %s, was %s\n", home_dir,
(sampass->home_dir)?(sampass->home_dir):"NULL"));
-
+
sampass->home_dir = talloc_strdup(sampass, home_dir);
-
+
if (!sampass->home_dir) {
DEBUG(0, ("pdb_set_home_dir: talloc_strdup() failed!\n"));
return False;
@@ -775,7 +775,7 @@ bool pdb_set_workstations(struct samu *sampass, const char *workstations, enum p
if (workstations) {
DEBUG(10, ("pdb_set_workstations: setting workstations %s, was %s\n", workstations,
(sampass->workstations)?(sampass->workstations):"NULL"));
-
+
sampass->workstations = talloc_strdup(sampass, workstations);
if (!sampass->workstations) {
@@ -796,7 +796,7 @@ bool pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_s
{
if (comment) {
sampass->comment = talloc_strdup(sampass, comment);
-
+
if (!sampass->comment) {
DEBUG(0, ("pdb_set_comment: talloc_strdup() failed!\n"));
return False;
@@ -816,7 +816,7 @@ bool pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb
{
if (munged_dial) {
sampass->munged_dial = talloc_strdup(sampass, munged_dial);
-
+
if (!sampass->munged_dial) {
DEBUG(0, ("pdb_set_munged_dial: talloc_strdup() failed!\n"));
return False;
@@ -835,7 +835,7 @@ bool pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb
bool pdb_set_nt_passwd(struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum pdb_value_state flag)
{
data_blob_clear_free(&sampass->nt_pw);
-
+
if (pwd) {
sampass->nt_pw =
data_blob_talloc(sampass, pwd, NT_HASH_LEN);
@@ -853,7 +853,7 @@ bool pdb_set_nt_passwd(struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum
bool pdb_set_lanman_passwd(struct samu *sampass, const uint8 pwd[LM_HASH_LEN], enum pdb_value_state flag)
{
data_blob_clear_free(&sampass->lm_pw);
-
+
/* on keep the password if we are allowing LANMAN authentication */
if (pwd && lp_lanman_auth() ) {
@@ -900,7 +900,7 @@ bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum
memset(sampass->plaintext_pw,'\0',strlen(sampass->plaintext_pw)+1);
sampass->plaintext_pw = talloc_strdup(sampass, password);
-
+
if (!sampass->plaintext_pw) {
DEBUG(0, ("pdb_set_unknown_str: talloc_strdup() failed!\n"));
return False;
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index bfbc35f3d3..ad3a95826a 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -31,7 +31,7 @@ static TDB_CONTEXT *tdb_printers; /* used for printers files */
#define PRINTERS_PREFIX "PRINTERS/"
#define SECDESC_PREFIX "SECDESC/"
#define GLOBAL_C_SETPRINTER "GLOBALS/c_setprinter"
-
+
#define NTDRIVERS_DATABASE_VERSION_1 1
#define NTDRIVERS_DATABASE_VERSION_2 2
#define NTDRIVERS_DATABASE_VERSION_3 3 /* little endian version of v2 */
@@ -209,7 +209,7 @@ struct table_node {
const char *short_archi;
int version;
};
-
+
#define SPL_ARCH_WIN40 "WIN40"
#define SPL_ARCH_W32X86 "W32X86"
#define SPL_ARCH_W32MIPS "W32MIPS"
@@ -276,9 +276,9 @@ static TDB_DATA make_printers_secdesc_tdbkey(TALLOC_CTX *ctx,
static bool upgrade_to_version_3(void)
{
TDB_DATA kbuf, newkey, dbuf;
-
+
DEBUG(0,("upgrade_to_version_3: upgrading print tdb's to version 3\n"));
-
+
for (kbuf = tdb_firstkey(tdb_drivers); kbuf.dptr;
newkey = tdb_nextkey(tdb_drivers, kbuf), free(kbuf.dptr), kbuf=newkey) {
@@ -297,7 +297,7 @@ static bool upgrade_to_version_3(void)
return False;
}
}
-
+
if (strncmp((const char *)kbuf.dptr, PRINTERS_PREFIX, strlen(PRINTERS_PREFIX)) == 0) {
DEBUG(0,("upgrade_to_version_3:moving printer\n"));
if (tdb_store(tdb_printers, kbuf, dbuf, TDB_REPLACE) != 0) {
@@ -311,7 +311,7 @@ static bool upgrade_to_version_3(void)
return False;
}
}
-
+
if (strncmp((const char *)kbuf.dptr, SECDESC_PREFIX, strlen(SECDESC_PREFIX)) == 0) {
DEBUG(0,("upgrade_to_version_3:moving secdesc\n"));
if (tdb_store(tdb_printers, kbuf, dbuf, TDB_REPLACE) != 0) {
@@ -325,7 +325,7 @@ static bool upgrade_to_version_3(void)
return False;
}
}
-
+
SAFE_FREE(dbuf.dptr);
}
@@ -333,10 +333,10 @@ static bool upgrade_to_version_3(void)
}
/*******************************************************************
- Fix an issue with security descriptors. Printer sec_desc must
- use more than the generic bits that were previously used
+ Fix an issue with security descriptors. Printer sec_desc must
+ use more than the generic bits that were previously used
in <= 3.0.14a. They must also have a owner and group SID assigned.
- Otherwise, any printers than have been migrated to a Windows
+ Otherwise, any printers than have been migrated to a Windows
host using printmig.exe will not be accessible.
*******************************************************************/
@@ -381,29 +381,29 @@ static int sec_desc_upg_fn( TDB_CONTEXT *the_tdb, TDB_DATA key,
return 0;
}
sec = sd_orig->sd;
-
+
/* is this even valid? */
-
+
if ( !sec->dacl ) {
prs_mem_free( &ps );
return 0;
}
-
+
/* update access masks */
-
+
for ( i=0; i<sec->dacl->num_aces; i++ ) {
switch ( sec->dacl->aces[i].access_mask ) {
case (GENERIC_READ_ACCESS | GENERIC_WRITE_ACCESS | GENERIC_EXECUTE_ACCESS):
sec->dacl->aces[i].access_mask = PRINTER_ACE_PRINT;
break;
-
+
case GENERIC_ALL_ACCESS:
sec->dacl->aces[i].access_mask = PRINTER_ACE_FULL_CONTROL;
break;
-
+
case READ_CONTROL_ACCESS:
sec->dacl->aces[i].access_mask = PRINTER_ACE_MANAGE_DOCUMENTS;
-
+
default: /* no change */
break;
}
@@ -430,11 +430,11 @@ static int sec_desc_upg_fn( TDB_CONTEXT *the_tdb, TDB_DATA key,
prs_mem_free( &ps );
return 0;
}
-
+
prs_mem_free( &ps );
/* store it back */
-
+
sd_size = ndr_size_security_descriptor(sd_store->sd, NULL, 0)
+ sizeof(SEC_DESC_BUF);
if ( !prs_init(&ps, sd_size, ctx, MARSHALL) ) {
@@ -450,11 +450,11 @@ static int sec_desc_upg_fn( TDB_CONTEXT *the_tdb, TDB_DATA key,
data.dptr = (uint8 *)prs_data_p( &ps );
data.dsize = sd_size;
-
+
result = tdb_store( tdb_printers, key, data, TDB_REPLACE );
prs_mem_free( &ps );
-
+
/* 0 to continue and non-zero to stop traversal */
return (result == -1);
@@ -470,7 +470,7 @@ static bool upgrade_to_version_4(void)
DEBUG(0,("upgrade_to_version_4: upgrading printer security descriptors\n"));
- if ( !(ctx = talloc_init( "upgrade_to_version_4" )) )
+ if ( !(ctx = talloc_init( "upgrade_to_version_4" )) )
return False;
result = tdb_traverse( tdb_printers, sec_desc_upg_fn, ctx );
@@ -481,10 +481,10 @@ static bool upgrade_to_version_4(void)
}
/*******************************************************************
- Fix an issue with security descriptors. Printer sec_desc must
- use more than the generic bits that were previously used
+ Fix an issue with security descriptors. Printer sec_desc must
+ use more than the generic bits that were previously used
in <= 3.0.14a. They must also have a owner and group SID assigned.
- Otherwise, any printers than have been migrated to a Windows
+ Otherwise, any printers than have been migrated to a Windows
host using printmig.exe will not be accessible.
*******************************************************************/
@@ -513,7 +513,7 @@ static int normalize_printers_fn( TDB_CONTEXT *the_tdb, TDB_DATA key,
/* delete the original record and store under the normalized key */
if ( tdb_delete( the_tdb, key ) != 0 ) {
- DEBUG(0,("normalize_printers_fn: tdb_delete for [%s] failed!\n",
+ DEBUG(0,("normalize_printers_fn: tdb_delete for [%s] failed!\n",
key.dptr));
return 1;
}
@@ -537,7 +537,7 @@ static bool upgrade_to_version_5(void)
DEBUG(0,("upgrade_to_version_5: normalizing printer keys\n"));
- if ( !(ctx = talloc_init( "upgrade_to_version_5" )) )
+ if ( !(ctx = talloc_init( "upgrade_to_version_5" )) )
return False;
result = tdb_traverse( tdb_printers, normalize_printers_fn, NULL );
@@ -559,7 +559,7 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
if ( tdb_drivers && tdb_printers && tdb_forms )
return True;
-
+
if (tdb_drivers)
tdb_close(tdb_drivers);
tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
@@ -568,7 +568,7 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
state_path("ntdrivers.tdb"), strerror(errno) ));
return False;
}
-
+
if (tdb_printers)
tdb_close(tdb_printers);
tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
@@ -577,7 +577,7 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
state_path("ntprinters.tdb"), strerror(errno) ));
return False;
}
-
+
if (tdb_forms)
tdb_close(tdb_forms);
tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
@@ -586,9 +586,9 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
state_path("ntforms.tdb"), strerror(errno) ));
return False;
}
-
+
/* handle a Samba upgrade */
-
+
vers_id = tdb_fetch_int32(tdb_drivers, vstring);
if (vers_id == -1) {
DEBUG(10, ("Fresh database\n"));
@@ -598,13 +598,13 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
if ( vers_id != NTDRIVERS_DATABASE_VERSION_5 ) {
- if ((vers_id == NTDRIVERS_DATABASE_VERSION_1) || (IREV(vers_id) == NTDRIVERS_DATABASE_VERSION_1)) {
+ if ((vers_id == NTDRIVERS_DATABASE_VERSION_1) || (IREV(vers_id) == NTDRIVERS_DATABASE_VERSION_1)) {
if (!upgrade_to_version_3())
return False;
tdb_store_int32(tdb_drivers, vstring, NTDRIVERS_DATABASE_VERSION_3);
vers_id = NTDRIVERS_DATABASE_VERSION_3;
- }
-
+ }
+
if ((vers_id == NTDRIVERS_DATABASE_VERSION_2) || (IREV(vers_id) == NTDRIVERS_DATABASE_VERSION_2)) {
/* Written on a bigendian machine with old fetch_int code. Save as le. */
/* The only upgrade between V2 and V3 is to save the version in little-endian. */
@@ -632,7 +632,7 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
return False;
}
}
-
+
update_c_setprinter(True);
/*
@@ -652,7 +652,7 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
reset_all_printerdata);
/* of course, none of the message callbacks matter if you don't
- tell messages.c that you interested in receiving PRINT_GENERAL
+ tell messages.c that you interested in receiving PRINT_GENERAL
msgs. This is done in claim_connection() */
@@ -698,15 +698,15 @@ static int traverse_counting_printers(TDB_CONTEXT *t, TDB_DATA key,
TDB_DATA data, void *context)
{
int *printer_count = (int*)context;
-
+
if (memcmp(PRINTERS_PREFIX, key.dptr, sizeof(PRINTERS_PREFIX)-1) == 0) {
(*printer_count)++;
DEBUG(10,("traverse_counting_printers: printer = [%s] printer_count = %d\n", key.dptr, *printer_count));
}
-
+
return 0;
}
-
+
/*******************************************************************
Update the spooler global c_setprinter. This variable is initialized
when the parent smbd starts with the number of existing printers. It
@@ -718,12 +718,12 @@ uint32 update_c_setprinter(bool initialize)
{
int32 c_setprinter;
int32 printer_count = 0;
-
+
tdb_lock_bystring(tdb_printers, GLOBAL_C_SETPRINTER);
-
+
/* Traverse the tdb, counting the printers */
tdb_traverse(tdb_printers, traverse_counting_printers, (void *)&printer_count);
-
+
/* If initializing, set c_setprinter to current printers count
* otherwise, bump it by the current printer count
*/
@@ -731,12 +731,12 @@ uint32 update_c_setprinter(bool initialize)
c_setprinter = tdb_fetch_int32(tdb_printers, GLOBAL_C_SETPRINTER) + printer_count;
else
c_setprinter = printer_count;
-
+
DEBUG(10,("update_c_setprinter: c_setprinter = %u\n", (unsigned int)c_setprinter));
tdb_store_int32(tdb_printers, GLOBAL_C_SETPRINTER, c_setprinter);
-
+
tdb_unlock_bystring(tdb_printers, GLOBAL_C_SETPRINTER);
-
+
return (uint32)c_setprinter;
}
@@ -747,12 +747,12 @@ uint32 update_c_setprinter(bool initialize)
uint32 get_c_setprinter(void)
{
int32 c_setprinter = tdb_fetch_int32(tdb_printers, GLOBAL_C_SETPRINTER);
-
+
if (c_setprinter == (int32)-1)
c_setprinter = update_c_setprinter(True);
-
+
DEBUG(10,("get_c_setprinter: c_setprinter = %d\n", c_setprinter));
-
+
return (uint32)c_setprinter;
}
@@ -773,11 +773,9 @@ int get_builtin_ntforms(nt_forms_struct **list)
get a builtin form struct
****************************************************************************/
-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 i,count;
- fstring form_name;
- unistr2_to_ascii(form_name, uni_formname, sizeof(form_name));
DEBUGADD(6,("Looking for builtin form %s \n", form_name));
count = sizeof(default_forms) / sizeof(default_forms[0]);
for (i=0;i<count;i++) {
@@ -791,6 +789,13 @@ bool get_a_builtin_ntform(UNISTR2 *uni_formname,nt_forms_struct *form)
return (i !=count);
}
+bool get_a_builtin_ntform(UNISTR2 *uni_formname,nt_forms_struct *form)
+{
+ fstring form_name;
+ unistr2_to_ascii(form_name, uni_formname, sizeof(form_name));
+ return get_a_builtin_ntform_by_string(form_name, form);
+}
+
/****************************************************************************
get a form struct list.
****************************************************************************/
@@ -807,13 +812,13 @@ int get_ntforms(nt_forms_struct **list)
for (kbuf = tdb_firstkey(tdb_forms);
kbuf.dptr;
- newkey = tdb_nextkey(tdb_forms, kbuf), free(kbuf.dptr), kbuf=newkey)
+ newkey = tdb_nextkey(tdb_forms, kbuf), free(kbuf.dptr), kbuf=newkey)
{
- if (strncmp((const char *)kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) != 0)
+ if (strncmp((const char *)kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) != 0)
continue;
-
+
dbuf = tdb_fetch(tdb_forms, kbuf);
- if (!dbuf.dptr)
+ if (!dbuf.dptr)
continue;
fstrcpy(form.name, (const char *)kbuf.dptr+strlen(FORMS_PREFIX));
@@ -821,7 +826,7 @@ int get_ntforms(nt_forms_struct **list)
&i, &form.flag, &form.width, &form.length, &form.left,
&form.top, &form.right, &form.bottom);
SAFE_FREE(dbuf.dptr);
- if (ret != dbuf.dsize)
+ if (ret != dbuf.dsize)
continue;
*list = SMB_REALLOC_ARRAY(*list, nt_forms_struct, n+1);
@@ -832,7 +837,7 @@ int get_ntforms(nt_forms_struct **list)
(*list)[n] = form;
n++;
}
-
+
return n;
}
@@ -888,11 +893,10 @@ int write_ntforms(nt_forms_struct **list, int number)
/****************************************************************************
add a form struct at the end of the list
****************************************************************************/
-bool add_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)
{
int n=0;
bool update;
- fstring form_name;
/*
* NT tries to add forms even when
@@ -901,10 +905,9 @@ bool add_a_form(nt_forms_struct **list, const FORM *form, int *count)
*/
update=False;
-
- unistr2_to_ascii(form_name, &form->name, sizeof(form_name));
+
for (n=0; n<*count; n++) {
- if ( strequal((*list)[n].name, form_name) ) {
+ if ( strequal((*list)[n].name, form->form_name) ) {
update=True;
break;
}
@@ -915,20 +918,20 @@ bool add_a_form(nt_forms_struct **list, const FORM *form, int *count)
DEBUG(0,("add_a_form: failed to enlarge forms list!\n"));
return False;
}
- unistr2_to_ascii((*list)[n].name, &form->name, sizeof((*list)[n].name));
+ fstrcpy((*list)[n].name, form->form_name);
(*count)++;
}
-
- (*list)[n].flag=form->flags;
- (*list)[n].width=form->size_x;
- (*list)[n].length=form->size_y;
- (*list)[n].left=form->left;
- (*list)[n].top=form->top;
- (*list)[n].right=form->right;
- (*list)[n].bottom=form->bottom;
- DEBUG(6,("add_a_form: Successfully %s form [%s]\n",
- update ? "updated" : "added", form_name));
+ (*list)[n].flag = form->flags;
+ (*list)[n].width = form->size.width;
+ (*list)[n].length = form->size.height;
+ (*list)[n].left = form->area.left;
+ (*list)[n].top = form->area.top;
+ (*list)[n].right = form->area.right;
+ (*list)[n].bottom = form->area.bottom;
+
+ DEBUG(6,("add_a_form: Successfully %s form [%s]\n",
+ update ? "updated" : "added", form->form_name));
return True;
}
@@ -937,25 +940,22 @@ bool add_a_form(nt_forms_struct **list, const FORM *form, int *count)
Delete a named form struct.
****************************************************************************/
-bool delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR *ret)
+bool delete_a_form(nt_forms_struct **list, const char *del_name, int *count, WERROR *ret)
{
char *key = NULL;
int n=0;
- fstring form_name;
*ret = WERR_OK;
- unistr2_to_ascii(form_name, del_name, sizeof(form_name));
-
for (n=0; n<*count; n++) {
- if (!strncmp((*list)[n].name, form_name, strlen(form_name))) {
- DEBUG(103, ("delete_a_form, [%s] in list\n", form_name));
+ if (!strncmp((*list)[n].name, del_name, strlen(del_name))) {
+ DEBUG(103, ("delete_a_form, [%s] in list\n", del_name));
break;
}
}
if (n == *count) {
- DEBUG(10,("delete_a_form, [%s] not found\n", form_name));
+ DEBUG(10,("delete_a_form, [%s] not found\n", del_name));
*ret = WERR_INVALID_PARAM;
return False;
}
@@ -977,28 +977,26 @@ bool delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR
Update a form struct.
****************************************************************************/
-void update_a_form(nt_forms_struct **list, const FORM *form, int count)
+void update_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int count)
{
int n=0;
- fstring form_name;
- unistr2_to_ascii(form_name, &(form->name), sizeof(form_name));
- DEBUG(106, ("[%s]\n", form_name));
+ DEBUG(106, ("[%s]\n", form->form_name));
for (n=0; n<count; n++) {
DEBUGADD(106, ("n [%d]:[%s]\n", n, (*list)[n].name));
- if (!strncmp((*list)[n].name, form_name, strlen(form_name)))
+ if (!strncmp((*list)[n].name, form->form_name, strlen(form->form_name)))
break;
}
if (n==count) return;
- (*list)[n].flag=form->flags;
- (*list)[n].width=form->size_x;
- (*list)[n].length=form->size_y;
- (*list)[n].left=form->left;
- (*list)[n].top=form->top;
- (*list)[n].right=form->right;
- (*list)[n].bottom=form->bottom;
+ (*list)[n].flag = form->flags;
+ (*list)[n].width = form->size.width;
+ (*list)[n].length = form->size.height;
+ (*list)[n].left = form->area.left;
+ (*list)[n].top = form->area.top;
+ (*list)[n].right = form->area.right;
+ (*list)[n].bottom = form->area.bottom;
}
/****************************************************************************
@@ -1585,9 +1583,9 @@ static uint32 get_correct_cversion(struct pipes_struct *p,
/*
* This is a Microsoft'ism. See references in MSDN to VER_FILEVERSION
- * for more details. Version in this case is not just the version of the
+ * for more details. Version in this case is not just the version of the
* file, but the version in the sense of kernal mode (2) vs. user mode
- * (3) drivers. Other bits of the version fields are the version info.
+ * (3) drivers. Other bits of the version fields are the version info.
* JRR 010716
*/
cversion = major & 0x0000ffff;
@@ -1595,9 +1593,9 @@ static uint32 get_correct_cversion(struct pipes_struct *p,
case 2: /* WinNT drivers */
case 3: /* Win2K drivers */
break;
-
+
default:
- DEBUG(6,("get_correct_cversion: cversion invalid [%s] cversion = %d\n",
+ DEBUG(6,("get_correct_cversion: cversion invalid [%s] cversion = %d\n",
driverpath, cversion));
goto error_exit;
}
@@ -1676,7 +1674,7 @@ static WERROR clean_up_driver_struct_level_3(struct pipes_struct *rpc_pipe,
if (!architecture) {
return WERR_UNKNOWN_PRINTER_DRIVER;
}
-
+
/* jfm:7/16/2000 the client always sends the cversion=0.
* The server should check which version the driver is by reading
* the PE header of driver->driverpath.
@@ -1695,7 +1693,7 @@ static WERROR clean_up_driver_struct_level_3(struct pipes_struct *rpc_pipe,
return WERR_OK;
}
-
+
/****************************************************************************
****************************************************************************/
static WERROR clean_up_driver_struct_level_6(struct pipes_struct *rpc_pipe,
@@ -2160,10 +2158,10 @@ static uint32 add_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 *driver)
return (uint32)-1;
}
- /* .inf files do not always list a file for each of the four standard files.
+ /* .inf files do not always list a file for each of the four standard files.
* Don't prepend a path to a null filename, or client claims:
- * "The server on which the printer resides does not have a suitable
- * <printer driver name> printer driver installed. Click OK if you
+ * "The server on which the printer resides does not have a suitable
+ * <printer driver name> printer driver installed. Click OK if you
* wish to install the driver on your local machine."
*/
if (strlen(driver->driverpath)) {
@@ -2280,7 +2278,7 @@ static WERROR get_a_printer_driver_3_default(NT_PRINTER_DRIVER_INFO_LEVEL_3 **in
fstrcpy(info.name, driver);
fstrcpy(info.defaultdatatype, "RAW");
-
+
fstrcpy(info.driverpath, "");
fstrcpy(info.datafile, "");
fstrcpy(info.configfile, "");
@@ -2297,7 +2295,7 @@ static WERROR get_a_printer_driver_3_default(NT_PRINTER_DRIVER_INFO_LEVEL_3 **in
SAFE_FREE(info.dependentfiles);
return WERR_NOMEM;
}
-
+
return WERR_OK;
}
@@ -2391,9 +2389,9 @@ static uint32 dump_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32
uint32 result;
NT_PRINTER_DRIVER_INFO_LEVEL_3 *info3;
int i;
-
+
DEBUG(20,("Dumping printer driver at level [%d]\n", level));
-
+
switch (level)
{
case 3:
@@ -2402,7 +2400,7 @@ static uint32 dump_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32
result=5;
else {
info3=driver.info_3;
-
+
DEBUGADD(20,("version:[%d]\n", info3->cversion));
DEBUGADD(20,("name:[%s]\n", info3->name));
DEBUGADD(20,("environment:[%s]\n", info3->environment));
@@ -2412,7 +2410,7 @@ static uint32 dump_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32
DEBUGADD(20,("helpfile:[%s]\n", info3->helpfile));
DEBUGADD(20,("monitorname:[%s]\n", info3->monitorname));
DEBUGADD(20,("defaultdatatype:[%s]\n", info3->defaultdatatype));
-
+
for (i=0; info3->dependentfiles &&
*info3->dependentfiles[i]; i++) {
DEBUGADD(20,("dependentfile:[%s]\n",
@@ -2427,7 +2425,7 @@ static uint32 dump_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32
result=1;
break;
}
-
+
return result;
}
@@ -2464,7 +2462,7 @@ int pack_devicemode(NT_DEVICEMODE *nt_devmode, uint8 *buf, int buflen)
nt_devmode->ttoption,
nt_devmode->collate,
nt_devmode->logpixels,
-
+
nt_devmode->fields,
nt_devmode->bitsperpel,
nt_devmode->pelswidth,
@@ -2597,7 +2595,7 @@ static WERROR update_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info)
int retlen;
WERROR ret;
TDB_DATA kbuf, dbuf;
-
+
/*
* in addprinter: no servername and the printer is the name
* in setprinter: servername is \\server
@@ -2712,8 +2710,8 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
ZERO_STRUCTP(nt_devmode);
slprintf(adevice, sizeof(adevice), "%s", default_devicename);
- fstrcpy(nt_devmode->devicename, adevice);
-
+ fstrcpy(nt_devmode->devicename, adevice);
+
fstrcpy(nt_devmode->formname, "Letter");
nt_devmode->specversion = 0x0401;
@@ -2752,7 +2750,7 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
nt_devmode->reserved2 = 0;
nt_devmode->panningwidth = 0;
nt_devmode->panningheight = 0;
-
+
nt_devmode->nt_dev_private = NULL;
return nt_devmode;
}
@@ -2826,7 +2824,7 @@ int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen)
int len = 0;
int extra_len = 0;
NT_DEVICEMODE devmode;
-
+
ZERO_STRUCT(devmode);
len += tdb_unpack(buf+len, buflen-len, "p", nt_devmode);
@@ -2855,7 +2853,7 @@ int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen)
&devmode.ttoption,
&devmode.collate,
&devmode.logpixels,
-
+
&devmode.fields,
&devmode.bitsperpel,
&devmode.pelswidth,
@@ -2871,14 +2869,14 @@ int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen)
&devmode.panningwidth,
&devmode.panningheight,
&devmode.nt_dev_private);
-
+
if (devmode.nt_dev_private) {
/* the len in tdb_unpack is an int value and
* devmode.driverextra is only a short
*/
len += tdb_unpack(buf+len, buflen-len, "B", &extra_len, &devmode.nt_dev_private);
devmode.driverextra=(uint16)extra_len;
-
+
/* check to catch an invalid TDB entry so we don't segfault */
if (devmode.driverextra == 0) {
devmode.nt_dev_private = NULL;
@@ -2901,37 +2899,37 @@ int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen)
/****************************************************************************
Allocate and initialize a new slot.
***************************************************************************/
-
+
int add_new_printer_key( NT_PRINTER_DATA *data, const char *name )
{
NT_PRINTER_KEY *d;
int key_index;
-
+
if ( !name || !data )
return -1;
/* allocate another slot in the NT_PRINTER_KEY array */
-
+
if ( !(d = TALLOC_REALLOC_ARRAY( data, data->keys, NT_PRINTER_KEY, data->num_keys+1)) ) {
DEBUG(0,("add_new_printer_key: Realloc() failed!\n"));
return -1;
}
data->keys = d;
-
+
key_index = data->num_keys;
-
+
/* initialze new key */
-
+
data->keys[key_index].name = talloc_strdup( data, name );
-
- if ( !(data->keys[key_index].values = TALLOC_ZERO_P( data, REGVAL_CTR )) )
+
+ if ( !(data->keys[key_index].values = TALLOC_ZERO_P( data, REGVAL_CTR )) )
return -1;
-
+
data->num_keys++;
DEBUG(10,("add_new_printer_key: Inserted new data key [%s]\n", name ));
-
+
return key_index;
}
@@ -2942,25 +2940,25 @@ int add_new_printer_key( NT_PRINTER_DATA *data, const char *name )
int delete_printer_key( NT_PRINTER_DATA *data, const char *name )
{
int i;
-
+
for ( i=0; i<data->num_keys; i++ ) {
if ( strequal( data->keys[i].name, name ) ) {
-
+
/* cleanup memory */
-
+
TALLOC_FREE( data->keys[i].name );
TALLOC_FREE( data->keys[i].values );
-
+
/* if not the end of the array, move remaining elements down one slot */
-
+
data->num_keys--;
if ( data->num_keys && (i < data->num_keys) )
memmove( &data->keys[i], &data->keys[i+1], sizeof(NT_PRINTER_KEY)*(data->num_keys-i) );
-
+
break;
}
}
-
+
return data->num_keys;
}
@@ -2968,28 +2966,28 @@ int delete_printer_key( NT_PRINTER_DATA *data, const char *name )
/****************************************************************************
search for a registry key name in the existing printer data
***************************************************************************/
-
+
int lookup_printerkey( NT_PRINTER_DATA *data, const char *name )
{
int key_index = -1;
int i;
-
+
if ( !data || !name )
return -1;
DEBUG(12,("lookup_printerkey: Looking for [%s]\n", name));
/* loop over all existing keys */
-
+
for ( i=0; i<data->num_keys; i++ ) {
if ( strequal(data->keys[i].name, name) ) {
DEBUG(12,("lookup_printerkey: Found [%s]!\n", name));
key_index = i;
break;
-
+
}
}
-
+
return key_index;
}
@@ -3004,7 +3002,7 @@ int get_printer_subkeys( NT_PRINTER_DATA *data, const char* key, fstring **subke
char *p;
fstring *subkeys_ptr = NULL;
fstring subkeyname;
-
+
*subkeys = NULL;
if ( !data )
@@ -3017,33 +3015,33 @@ int get_printer_subkeys( NT_PRINTER_DATA *data, const char* key, fstring **subke
if ( strlen(key) == 0 ) {
for ( i=0; i<data->num_keys; i++ ) {
-
+
/* found a match, so allocate space and copy the name */
-
+
if ( !(subkeys_ptr = SMB_REALLOC_ARRAY( subkeys_ptr, fstring, num_subkeys+2)) ) {
- DEBUG(0,("get_printer_subkeys: Realloc failed for [%d] entries!\n",
+ DEBUG(0,("get_printer_subkeys: Realloc failed for [%d] entries!\n",
num_subkeys+1));
return -1;
}
-
+
fstrcpy( subkeys_ptr[num_subkeys], data->keys[i].name );
num_subkeys++;
}
goto done;
}
-
+
/* asking for the subkeys of some key */
/* subkey paths are stored in the key name using '\' as the delimiter */
for ( i=0; i<data->num_keys; i++ ) {
if ( StrnCaseCmp(data->keys[i].name, key, strlen(key)) == 0 ) {
-
+
/* if we found the exact key, then break */
key_len = strlen( key );
if ( strlen(data->keys[i].name) == key_len )
break;
-
+
/* get subkey path */
p = data->keys[i].name + key_len;
@@ -3052,51 +3050,51 @@ int get_printer_subkeys( NT_PRINTER_DATA *data, const char* key, fstring **subke
fstrcpy( subkeyname, p );
if ( (p = strchr( subkeyname, '\\' )) )
*p = '\0';
-
+
/* don't add a key more than once */
-
+
for ( j=0; j<num_subkeys; j++ ) {
if ( strequal( subkeys_ptr[j], subkeyname ) )
break;
}
-
+
if ( j != num_subkeys )
continue;
/* found a match, so allocate space and copy the name */
-
+
if ( !(subkeys_ptr = SMB_REALLOC_ARRAY( subkeys_ptr, fstring, num_subkeys+2)) ) {
- DEBUG(0,("get_printer_subkeys: Realloc failed for [%d] entries!\n",
+ DEBUG(0,("get_printer_subkeys: Realloc failed for [%d] entries!\n",
num_subkeys+1));
return 0;
}
-
+
fstrcpy( subkeys_ptr[num_subkeys], subkeyname );
num_subkeys++;
}
-
+
}
-
+
/* return error if the key was not found */
-
+
if ( i == data->num_keys ) {
SAFE_FREE(subkeys_ptr);
return -1;
}
-
+
done:
/* tag off the end */
-
+
if (num_subkeys)
fstrcpy(subkeys_ptr[num_subkeys], "" );
-
+
*subkeys = subkeys_ptr;
return num_subkeys;
}
#ifdef HAVE_ADS
-static void map_sz_into_ctr(REGVAL_CTR *ctr, const char *val_name,
+static void map_sz_into_ctr(REGVAL_CTR *ctr, const char *val_name,
const char *sz)
{
smb_ucs2_t conv_str[1024];
@@ -3105,11 +3103,11 @@ static void map_sz_into_ctr(REGVAL_CTR *ctr, const char *val_name,
regval_ctr_delvalue(ctr, val_name);
str_size = push_ucs2(NULL, conv_str, sz, sizeof(conv_str),
STR_TERMINATE | STR_NOALIGN);
- regval_ctr_addvalue(ctr, val_name, REG_SZ,
+ regval_ctr_addvalue(ctr, val_name, REG_SZ,
(char *) conv_str, str_size);
}
-static void map_dword_into_ctr(REGVAL_CTR *ctr, const char *val_name,
+static void map_dword_into_ctr(REGVAL_CTR *ctr, const char *val_name,
uint32 dword)
{
regval_ctr_delvalue(ctr, val_name);
@@ -3122,7 +3120,7 @@ static void map_bool_into_ctr(REGVAL_CTR *ctr, const char *val_name,
{
uint8 bin_bool = (b ? 1 : 0);
regval_ctr_delvalue(ctr, val_name);
- regval_ctr_addvalue(ctr, val_name, REG_BINARY,
+ regval_ctr_addvalue(ctr, val_name, REG_BINARY,
(char *) &bin_bool, sizeof(bin_bool));
}
@@ -3142,12 +3140,12 @@ static void map_single_multi_sz_into_ctr(REGVAL_CTR *ctr, const char *val_name,
/* Change to byte units. */
str_size *= sizeof(smb_ucs2_t);
- push_ucs2(NULL, conv_strs, multi_sz, str_size,
+ push_ucs2(NULL, conv_strs, multi_sz, str_size,
STR_TERMINATE | STR_NOALIGN);
regval_ctr_delvalue(ctr, val_name);
- regval_ctr_addvalue(ctr, val_name, REG_MULTI_SZ,
- (char *) conv_strs, str_size);
+ regval_ctr_addvalue(ctr, val_name, REG_MULTI_SZ,
+ (char *) conv_strs, str_size);
SAFE_FREE(conv_strs);
}
@@ -3204,7 +3202,7 @@ static bool map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
map_dword_into_ctr(ctr, SPOOL_REG_PRIORITY, info2->priority);
map_bool_into_ctr(ctr, SPOOL_REG_PRINTKEEPPRINTEDJOBS,
- (info2->attributes &
+ (info2->attributes &
PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS));
switch (info2->attributes & 0x3) {
@@ -3228,7 +3226,7 @@ static bool map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
/*****************************************************************
****************************************************************/
-static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
+static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
struct GUID guid)
{
int i;
@@ -3245,15 +3243,15 @@ static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
/* We used to store this as a REG_BINARY but that causes
Vista to whine */
- ZERO_STRUCT( unistr_guid );
-
+ ZERO_STRUCT( unistr_guid );
+
init_unistr2( &unistr_guid, GUID_string(talloc_tos(), &guid),
UNI_STR_TERMINATE );
- regval_ctr_addvalue(ctr, "objectGUID", REG_SZ,
- (char *)unistr_guid.buffer,
+ regval_ctr_addvalue(ctr, "objectGUID", REG_SZ,
+ (char *)unistr_guid.buffer,
unistr_guid.uni_max_len*2);
-
+
}
static WERROR nt_printer_publish_ads(ADS_STRUCT *ads,
@@ -3346,7 +3344,7 @@ static WERROR nt_printer_publish_ads(ADS_STRUCT *ads,
}
get_local_printer_publishing_data(ctx, &mods, printer->info_2->data);
- ads_mod_str(ctx, &mods, SPOOL_REG_PRINTERNAME,
+ ads_mod_str(ctx, &mods, SPOOL_REG_PRINTERNAME,
printer->info_2->sharename);
/* publish it */
@@ -3361,7 +3359,7 @@ static WERROR nt_printer_publish_ads(ADS_STRUCT *ads,
if (!ADS_ERR_OK(ads_rc))
DEBUG(3, ("error publishing %s: %s\n", printer->info_2->sharename, ads_errstr(ads_rc)));
-
+
talloc_destroy(ctx);
/* retreive the guid and store it locally */
@@ -3371,7 +3369,7 @@ static WERROR nt_printer_publish_ads(ADS_STRUCT *ads,
ads_msgfree(ads, res);
store_printer_guid(printer->info_2, guid);
win_rc = mod_a_printer(printer, 2);
- }
+ }
SAFE_FREE(prt_dn);
return win_rc;
@@ -3387,7 +3385,7 @@ static WERROR nt_printer_unpublish_ads(ADS_STRUCT *ads,
DEBUG(5, ("unpublishing printer %s\n", printer->info_2->printername));
/* remove the printer from the directory */
- ads_rc = ads_find_printer_on_server(ads, &res,
+ ads_rc = ads_find_printer_on_server(ads, &res,
printer->info_2->sharename, global_myname());
if (ADS_ERR_OK(ads_rc) && res && ads_count_replies(ads, res)) {
@@ -3460,7 +3458,7 @@ WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action)
ads->auth.password = secrets_fetch_machine_password(lp_workgroup(),
NULL, NULL);
- /* ads_connect() will find the DC for us */
+ /* ads_connect() will find the DC for us */
ads_rc = ads_connect(ads);
if (!ADS_ERR_OK(ads_rc)) {
DEBUG(3, ("ads_connect failed: %s\n", ads_errstr(ads_rc)));
@@ -3502,7 +3500,7 @@ WERROR check_published_printers(void)
ads->auth.password = secrets_fetch_machine_password(lp_workgroup(),
NULL, NULL);
- /* ads_connect() will find the DC for us */
+ /* ads_connect() will find the DC for us */
ads_rc = ads_connect(ads);
if (!ADS_ERR_OK(ads_rc)) {
DEBUG(3, ("ads_connect failed: %s\n", ads_errstr(ads_rc)));
@@ -3528,7 +3526,7 @@ WERROR check_published_printers(void)
return WERR_OK;
}
-bool is_printer_published(Printer_entry *print_hnd, int snum,
+bool is_printer_published(Printer_entry *print_hnd, int snum,
struct GUID *guid)
{
NT_PRINTER_INFO_LEVEL *printer = NULL;
@@ -3544,7 +3542,7 @@ bool is_printer_published(Printer_entry *print_hnd, int snum,
!(printer->info_2->attributes & PRINTER_ATTRIBUTE_PUBLISHED) ||
((i = lookup_printerkey(printer->info_2->data, SPOOL_DSSPOOLER_KEY)) < 0) ||
!(ctr = printer->info_2->data->keys[i].values) ||
- !(guid_val = regval_ctr_getvalue(ctr, "objectGUID")))
+ !(guid_val = regval_ctr_getvalue(ctr, "objectGUID")))
{
free_a_printer(&printer, 2);
return False;
@@ -3552,18 +3550,18 @@ bool is_printer_published(Printer_entry *print_hnd, int snum,
/* fetching printer guids really ought to be a separate function. */
- if ( guid ) {
+ if ( guid ) {
fstring guid_str;
-
- /* We used to store the guid as REG_BINARY, then swapped
+
+ /* We used to store the guid as REG_BINARY, then swapped
to REG_SZ for Vista compatibility so check for both */
switch ( regval_type(guid_val) ){
- case REG_SZ:
- rpcstr_pull( guid_str, regval_data_p(guid_val),
+ case REG_SZ:
+ rpcstr_pull( guid_str, regval_data_p(guid_val),
sizeof(guid_str)-1, -1, STR_TERMINATE );
ret = NT_STATUS_IS_OK(GUID_from_string( guid_str, guid ));
- break;
+ break;
case REG_BINARY:
if ( regval_size(guid_val) != sizeof(struct GUID) ) {
ret = False;
@@ -3573,7 +3571,7 @@ bool is_printer_published(Printer_entry *print_hnd, int snum,
break;
default:
DEBUG(0,("is_printer_published: GUID value stored as "
- "invaluid type (%d)\n", regval_type(guid_val) ));
+ "invaluid type (%d)\n", regval_type(guid_val) ));
break;
}
}
@@ -3592,7 +3590,7 @@ WERROR check_published_printers(void)
return WERR_OK;
}
-bool is_printer_published(Printer_entry *print_hnd, int snum,
+bool is_printer_published(Printer_entry *print_hnd, int snum,
struct GUID *guid)
{
return False;
@@ -3601,41 +3599,41 @@ bool is_printer_published(Printer_entry *print_hnd, int snum,
/****************************************************************************
***************************************************************************/
-
+
WERROR delete_all_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key )
{
NT_PRINTER_DATA *data;
int i;
int removed_keys = 0;
int empty_slot;
-
+
data = p2->data;
empty_slot = data->num_keys;
if ( !key )
return WERR_INVALID_PARAM;
-
+
/* remove all keys */
if ( !strlen(key) ) {
-
+
TALLOC_FREE( data );
p2->data = NULL;
DEBUG(8,("delete_all_printer_data: Removed all Printer Data from printer [%s]\n",
p2->printername ));
-
+
return WERR_OK;
}
/* remove a specific key (and all subkeys) */
-
+
for ( i=0; i<data->num_keys; i++ ) {
if ( StrnCaseCmp( data->keys[i].name, key, strlen(key)) == 0 ) {
DEBUG(8,("delete_all_printer_data: Removed all Printer Data from key [%s]\n",
data->keys[i].name));
-
+
TALLOC_FREE( data->keys[i].name );
TALLOC_FREE( data->keys[i].values );
@@ -3660,10 +3658,10 @@ WERROR delete_all_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key )
return WERR_INVALID_PARAM;
/* move everything down */
-
+
for ( i=empty_slot+1; i<data->num_keys; i++ ) {
if ( data->keys[i].name ) {
- memcpy( &data->keys[empty_slot], &data->keys[i], sizeof(NT_PRINTER_KEY) );
+ memcpy( &data->keys[empty_slot], &data->keys[i], sizeof(NT_PRINTER_KEY) );
ZERO_STRUCTP( &data->keys[i] );
empty_slot++;
removed_keys++;
@@ -3671,7 +3669,7 @@ WERROR delete_all_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key )
}
/* update count */
-
+
data->num_keys -= removed_keys;
/* sanity check to see if anything is left */
@@ -3688,62 +3686,62 @@ WERROR delete_all_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key )
/****************************************************************************
***************************************************************************/
-
+
WERROR delete_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value )
{
WERROR result = WERR_OK;
int key_index;
-
+
/* we must have names on non-zero length */
-
+
if ( !key || !*key|| !value || !*value )
return WERR_INVALID_NAME;
-
+
/* find the printer key first */
key_index = lookup_printerkey( p2->data, key );
if ( key_index == -1 )
return WERR_OK;
-
+
/* make sure the value exists so we can return the correct error code */
-
+
if ( !regval_ctr_getvalue( p2->data->keys[key_index].values, value ) )
return WERR_BADFILE;
-
+
regval_ctr_delvalue( p2->data->keys[key_index].values, value );
-
+
DEBUG(8,("delete_printer_data: Removed key => [%s], value => [%s]\n",
key, value ));
-
+
return result;
}
/****************************************************************************
***************************************************************************/
-
-WERROR add_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value,
+
+WERROR add_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const char *value,
uint32 type, uint8 *data, int real_len )
{
WERROR result = WERR_OK;
int key_index;
/* we must have names on non-zero length */
-
+
if ( !key || !*key|| !value || !*value )
return WERR_INVALID_NAME;
-
+
/* find the printer key first */
-
+
key_index = lookup_printerkey( p2->data, key );
if ( key_index == -1 )
key_index = add_new_printer_key( p2->data, key );
-
+
if ( key_index == -1 )
return WERR_NOMEM;
-
+
regval_ctr_addvalue( p2->data->keys[key_index].values, value,
type, (const char *)data, real_len );
-
+
DEBUG(8,("add_printer_data: Added key => [%s], value => [%s], type=> [%d], size => [%d]\n",
key, value, type, real_len ));
@@ -3867,10 +3865,10 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu
memcpy( &guid, data_p, sizeof(struct GUID) );
init_unistr2( &unistr_guid,
- GUID_string(talloc_tos(), &guid),
+ GUID_string(talloc_tos(), &guid),
UNI_STR_TERMINATE );
- regval_ctr_addvalue( printer_data->keys[key_index].values,
+ regval_ctr_addvalue( printer_data->keys[key_index].values,
valuename, REG_SZ,
(const char *)unistr_guid.buffer,
unistr_guid.uni_str_len*2 );
@@ -3878,8 +3876,8 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu
} else {
/* add the value */
- regval_ctr_addvalue( printer_data->keys[key_index].values,
- valuename, type, (const char *)data_p,
+ regval_ctr_addvalue( printer_data->keys[key_index].values,
+ valuename, type, (const char *)data_p,
size );
}
@@ -4018,14 +4016,14 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info,
int snum = lp_servicenumber(sharename);
slprintf(info->servername, sizeof(info->servername)-1, "\\\\%s", servername);
- slprintf(info->printername, sizeof(info->printername)-1, "\\\\%s\\%s",
+ slprintf(info->printername, sizeof(info->printername)-1, "\\\\%s\\%s",
servername, sharename);
fstrcpy(info->sharename, sharename);
fstrcpy(info->portname, SAMBA_PRINTER_PORT_NAME);
/* by setting the driver name to an empty string, a local NT admin
can now run the **local** APW to install a local printer driver
- for a Samba shared printer in 2.2. Without this, drivers **must** be
+ for a Samba shared printer in 2.2. Without this, drivers **must** be
installed on the Samba server for NT clients --jerry */
#if 0 /* JERRY --do not uncomment-- */
if (!*info->drivername)
@@ -4040,7 +4038,7 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info,
fstrcpy(info->datatype, "RAW");
#ifdef HAVE_CUPS
- if (get_loc_com && (enum printing_types)lp_printing(snum) == PRINT_CUPS ) {
+ if (get_loc_com && (enum printing_types)lp_printing(snum) == PRINT_CUPS ) {
/* Pull the location and comment strings from cups if we don't
already have one */
if ( !strlen(info->location) || !strlen(info->comment) )
@@ -4167,7 +4165,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info,
/*
* Some client drivers freak out if there is a NULL devmode
- * (probably the driver is not checking before accessing
+ * (probably the driver is not checking before accessing
* the devmode pointer) --jerry
*
* See comments in get_a_printer_2_default()
@@ -4181,7 +4179,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info,
slprintf( adevice, sizeof(adevice), "%s", info->printername );
if (info->devmode) {
- fstrcpy(info->devmode->devicename, adevice);
+ fstrcpy(info->devmode->devicename, adevice);
}
if ( !(info->data = TALLOC_ZERO_P( info, NT_PRINTER_DATA )) ) {
@@ -4210,7 +4208,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info,
DEBUG(9,("Unpacked printer [%s] name [%s] running driver [%s]\n",
sharename, info->printername, info->drivername));
- return WERR_OK;
+ return WERR_OK;
}
/****************************************************************************
@@ -4220,9 +4218,9 @@ static uint32 dump_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
{
uint32 result;
NT_PRINTER_INFO_LEVEL_2 *info2;
-
+
DEBUG(106,("Dumping printer at level [%d]\n", level));
-
+
switch (level) {
case 2:
{
@@ -4231,7 +4229,7 @@ static uint32 dump_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
else
{
info2=printer->info_2;
-
+
DEBUGADD(106,("attributes:[%d]\n", info2->attributes));
DEBUGADD(106,("priority:[%d]\n", info2->priority));
DEBUGADD(106,("default_priority:[%d]\n", info2->default_priority));
@@ -4264,7 +4262,7 @@ static uint32 dump_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
result=1;
break;
}
-
+
return result;
}
@@ -4309,15 +4307,15 @@ static uint32 rev_changeid(void)
WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
{
WERROR result;
-
- dump_a_printer(printer, level);
-
+
+ dump_a_printer(printer, level);
+
switch (level) {
case 2:
{
/*
* Update the changestamp. Emperical tests show that the
- * ChangeID is always updated,but c_setprinter is
+ * ChangeID is always updated,but c_setprinter is
* global spooler variable (not per printer).
*/
@@ -4332,7 +4330,7 @@ WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
* NT->NT An admin connection to a remote
* printer show changes imeediately in
* the properities dialog
- *
+ *
* A non-admin connection will only show the
* changes after viewing the properites page
* 2 times. Seems to be related to a
@@ -4499,7 +4497,7 @@ bool del_driver_init(char *drivername)
}
/****************************************************************************
- Pack up the DEVMODE and values for a printer into a 'driver init' entry
+ Pack up the DEVMODE and values for a printer into a 'driver init' entry
in the tdb. Note: this is different from the driver entry and the printer
entry. There should be a single driver init entry for each driver regardless
of whether it was installed from NT or 2K. Technically, they should be
@@ -4569,9 +4567,9 @@ done:
static uint32 update_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
{
uint32 result;
-
- dump_a_printer(printer, level);
-
+
+ dump_a_printer(printer, level);
+
switch (level) {
case 2:
result = update_driver_init_2(printer->info_2);
@@ -4580,12 +4578,12 @@ static uint32 update_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level)
result = 1;
break;
}
-
+
return result;
}
/****************************************************************************
- Convert the printer data value, a REG_BINARY array, into an initialization
+ Convert the printer data value, a REG_BINARY array, into an initialization
DEVMODE. Note: the array must be parsed as if it was a DEVMODE in an rpc...
got to keep the endians happy :).
****************************************************************************/
@@ -4626,7 +4624,7 @@ static bool convert_driver_init( TALLOC_CTX *ctx, NT_DEVICEMODE *nt_devmode, uin
The Win32 client side code requirement sucks! But until we can run arbitrary
Win32 printer driver code on any Unix that Samba runs on, we are stuck with it.
-
+
It would have been easier to use SetPrinter because all the UNMARSHALLING of
the DEVMODE is done there, but 2K/XP clients do not set the DEVMODE... think
about it and you will realize why. JRR 010720
@@ -4638,12 +4636,12 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, uint8 *data, ui
TALLOC_CTX *ctx = NULL;
NT_DEVICEMODE *nt_devmode = NULL;
NT_DEVICEMODE *tmp_devmode = printer->info_2->devmode;
-
+
/*
* When the DEVMODE is already set on the printer, don't try to unpack it.
*/
DEBUG(8,("save_driver_init_2: Enter...\n"));
-
+
if ( !printer->info_2->devmode && data_len ) {
/*
* Set devmode on printer info, so entire printer initialization can be
@@ -4657,7 +4655,7 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, uint8 *data, ui
status = WERR_NOMEM;
goto done;
}
-
+
ZERO_STRUCTP(nt_devmode);
/*
@@ -4676,7 +4674,7 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, uint8 *data, ui
/*
* Pack up and add (or update) the DEVMODE and any current printer data to
* a 'driver init' element in the tdb
- *
+ *
*/
if ( update_driver_init(printer, 2) != 0 ) {
@@ -4684,10 +4682,10 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, uint8 *data, ui
status = WERR_NOMEM;
goto done;
}
-
+
/*
- * If driver initialization info was successfully saved, set the current
- * printer to match it. This allows initialization of the current printer
+ * If driver initialization info was successfully saved, set the current
+ * printer to match it. This allows initialization of the current printer
* as well as the driver.
*/
status = mod_a_printer(printer, 2);
@@ -4695,11 +4693,11 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, uint8 *data, ui
DEBUG(10,("save_driver_init_2: error setting DEVMODE on printer [%s]\n",
printer->info_2->printername));
}
-
+
done:
talloc_destroy(ctx);
free_nt_devicemode( &nt_devmode );
-
+
printer->info_2->devmode = tmp_devmode;
return status;
@@ -4712,7 +4710,7 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, uint8 *data, ui
WERROR save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, uint8 *data, uint32 data_len)
{
WERROR status = WERR_OK;
-
+
switch (level) {
case 2:
status = save_driver_init_2( printer, data, data_len );
@@ -4721,7 +4719,7 @@ WERROR save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, uint8 *dat
status = WERR_UNKNOWN_LEVEL;
break;
}
-
+
return status;
}
@@ -4729,22 +4727,22 @@ WERROR save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, uint8 *dat
Get a NT_PRINTER_INFO_LEVEL struct. It returns malloced memory.
Previously the code had a memory allocation problem because it always
- used the TALLOC_CTX from the Printer_entry*. This context lasts
- as a long as the original handle is open. So if the client made a lot
+ used the TALLOC_CTX from the Printer_entry*. This context lasts
+ as a long as the original handle is open. So if the client made a lot
of getprinter[data]() calls, the memory usage would climb. Now we use
- a short lived TALLOC_CTX for printer_info_2 objects returned. We
+ a short lived TALLOC_CTX for printer_info_2 objects returned. We
still use the Printer_entry->ctx for maintaining the cache copy though
- since that object must live as long as the handle by definition.
+ since that object must live as long as the handle by definition.
--jerry
****************************************************************************/
-static WERROR get_a_printer_internal( Printer_entry *print_hnd, NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level,
+static WERROR get_a_printer_internal( Printer_entry *print_hnd, NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level,
const char *sharename, bool get_loc_com)
{
WERROR result;
fstring servername;
-
+
DEBUG(10,("get_a_printer: [%s] level %u\n", sharename, (unsigned int)level));
if ( !(*pp_printer = TALLOC_ZERO_P(NULL, NT_PRINTER_INFO_LEVEL)) ) {
@@ -4760,7 +4758,7 @@ static WERROR get_a_printer_internal( Printer_entry *print_hnd, NT_PRINTER_INFO_
return WERR_NOMEM;
}
- if ( print_hnd )
+ if ( print_hnd )
fstrcpy( servername, print_hnd->servername );
else {
fstrcpy( servername, "%L" );
@@ -4775,20 +4773,20 @@ static WERROR get_a_printer_internal( Printer_entry *print_hnd, NT_PRINTER_INFO_
if ( !W_ERROR_IS_OK(result) ) {
TALLOC_FREE( *pp_printer );
- DEBUG(10,("get_a_printer: [%s] level %u returning %s\n",
+ DEBUG(10,("get_a_printer: [%s] level %u returning %s\n",
sharename, (unsigned int)level, win_errstr(result)));
return result;
}
dump_a_printer( *pp_printer, level);
-
+
break;
-
+
default:
TALLOC_FREE( *pp_printer );
return WERR_UNKNOWN_LEVEL;
}
-
+
return WERR_OK;
}
@@ -4820,10 +4818,10 @@ uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level)
if ( !printer )
return 0;
-
+
switch (level) {
case 2:
- if ( printer->info_2 )
+ if ( printer->info_2 )
free_nt_printer_info_level_2(&printer->info_2);
break;
@@ -4844,7 +4842,7 @@ uint32 add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level)
uint32 result;
DEBUG(104,("adding a printer at level [%d]\n", level));
dump_a_printer_driver(driver, level);
-
+
switch (level) {
case 3:
result=add_a_printer_driver_3(driver.info_3);
@@ -4858,7 +4856,7 @@ uint32 add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level)
result=1;
break;
}
-
+
return result;
}
/****************************************************************************
@@ -4868,34 +4866,34 @@ WERROR get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32 level,
fstring drivername, const char *architecture, uint32 version)
{
WERROR result;
-
+
switch (level) {
case 3:
/* Sometime we just want any version of the driver */
-
+
if ( version == DRIVER_ANY_VERSION ) {
/* look for Win2k first and then for NT4 */
- result = get_a_printer_driver_3(&driver->info_3, drivername,
+ result = get_a_printer_driver_3(&driver->info_3, drivername,
architecture, 3);
-
+
if ( !W_ERROR_IS_OK(result) ) {
- result = get_a_printer_driver_3( &driver->info_3,
+ result = get_a_printer_driver_3( &driver->info_3,
drivername, architecture, 2 );
}
} else {
- result = get_a_printer_driver_3(&driver->info_3, drivername,
- architecture, version);
+ result = get_a_printer_driver_3(&driver->info_3, drivername,
+ architecture, version);
}
break;
-
+
default:
result=W_ERROR(1);
break;
}
-
+
if (W_ERROR_IS_OK(result))
dump_a_printer_driver(*driver, level);
-
+
return result;
}
@@ -4904,7 +4902,7 @@ WERROR get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32 level,
uint32 free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level)
{
uint32 result;
-
+
switch (level) {
case 3:
{
@@ -4956,50 +4954,50 @@ bool printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3 )
NT_PRINTER_INFO_LEVEL *printer = NULL;
bool in_use = False;
- if ( !info_3 )
+ if ( !info_3 )
return False;
DEBUG(10,("printer_driver_in_use: Beginning search through ntprinters.tdb...\n"));
-
+
/* loop through the printers.tdb and check for the drivername */
-
+
for (snum=0; snum<n_services && !in_use; snum++) {
if ( !(lp_snum_ok(snum) && lp_print_ok(snum) ) )
continue;
-
+
if ( !W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, lp_servicename(snum))) )
continue;
-
- if ( strequal(info_3->name, printer->info_2->drivername) )
+
+ if ( strequal(info_3->name, printer->info_2->drivername) )
in_use = True;
-
+
free_a_printer( &printer, 2 );
}
-
+
DEBUG(10,("printer_driver_in_use: Completed search through ntprinters.tdb...\n"));
-
+
if ( in_use ) {
NT_PRINTER_DRIVER_INFO_LEVEL d;
WERROR werr;
-
+
DEBUG(5,("printer_driver_in_use: driver \"%s\" is currently in use\n", info_3->name));
-
- /* we can still remove the driver if there is one of
+
+ /* we can still remove the driver if there is one of
"Windows NT x86" version 2 or 3 left */
-
+
if ( !strequal( "Windows NT x86", info_3->environment ) ) {
- werr = get_a_printer_driver( &d, 3, info_3->name, "Windows NT x86", DRIVER_ANY_VERSION );
+ werr = get_a_printer_driver( &d, 3, info_3->name, "Windows NT x86", DRIVER_ANY_VERSION );
}
else {
switch ( info_3->cversion ) {
case 2:
werr = get_a_printer_driver( &d, 3, info_3->name, "Windows NT x86", 3 );
break;
- case 3:
+ case 3:
werr = get_a_printer_driver( &d, 3, info_3->name, "Windows NT x86", 2 );
break;
default:
- DEBUG(0,("printer_driver_in_use: ERROR! unknown driver version (%d)\n",
+ DEBUG(0,("printer_driver_in_use: ERROR! unknown driver version (%d)\n",
info_3->cversion));
werr = WERR_UNKNOWN_PRINTER_DRIVER;
break;
@@ -5007,16 +5005,16 @@ bool printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3 )
}
/* now check the error code */
-
+
if ( W_ERROR_IS_OK(werr) ) {
/* it's ok to remove the driver, we have other architctures left */
in_use = False;
free_a_printer_driver( d, 3 );
}
}
-
+
/* report that the driver is not in use by default */
-
+
return in_use;
}
@@ -5024,7 +5022,7 @@ bool printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3 )
/**********************************************************************
Check to see if a ogiven file is in use by *info
*********************************************************************/
-
+
static bool drv_file_in_use( char* file, NT_PRINTER_DRIVER_INFO_LEVEL_3 *info )
{
int i = 0;
@@ -5048,86 +5046,86 @@ static bool drv_file_in_use( char* file, NT_PRINTER_DRIVER_INFO_LEVEL_3 *info )
if ( strequal(file, info->helpfile) )
return True;
-
+
/* see of there are any dependent files to examine */
-
+
if ( !info->dependentfiles )
return False;
-
+
while ( *info->dependentfiles[i] ) {
if ( strequal(file, info->dependentfiles[i]) )
return True;
i++;
}
-
+
return False;
}
/**********************************************************************
- Utility function to remove the dependent file pointed to by the
- input parameter from the list
+ Utility function to remove the dependent file pointed to by the
+ input parameter from the list
*********************************************************************/
static void trim_dependent_file( fstring files[], int idx )
{
-
+
/* bump everything down a slot */
while( *files[idx+1] ) {
fstrcpy( files[idx], files[idx+1] );
idx++;
}
-
+
*files[idx] = '\0';
- return;
+ return;
}
/**********************************************************************
- Check if any of the files used by src are also used by drv
+ Check if any of the files used by src are also used by drv
*********************************************************************/
-static bool trim_overlap_drv_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *src,
+static bool trim_overlap_drv_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *src,
NT_PRINTER_DRIVER_INFO_LEVEL_3 *drv )
{
bool in_use = False;
int i = 0;
-
+
if ( !src || !drv )
return False;
-
+
/* check each file. Remove it from the src structure if it overlaps */
-
+
if ( drv_file_in_use(src->driverpath, drv) ) {
in_use = True;
DEBUG(10,("Removing driverfile [%s] from list\n", src->driverpath));
fstrcpy( src->driverpath, "" );
}
-
+
if ( drv_file_in_use(src->datafile, drv) ) {
in_use = True;
DEBUG(10,("Removing datafile [%s] from list\n", src->datafile));
fstrcpy( src->datafile, "" );
}
-
+
if ( drv_file_in_use(src->configfile, drv) ) {
in_use = True;
DEBUG(10,("Removing configfile [%s] from list\n", src->configfile));
fstrcpy( src->configfile, "" );
}
-
+
if ( drv_file_in_use(src->helpfile, drv) ) {
in_use = True;
DEBUG(10,("Removing helpfile [%s] from list\n", src->helpfile));
fstrcpy( src->helpfile, "" );
}
-
+
/* are there any dependentfiles to examine? */
-
+
if ( !src->dependentfiles )
return in_use;
-
+
while ( *src->dependentfiles[i] ) {
if ( drv_file_in_use(src->dependentfiles[i], drv) ) {
in_use = True;
@@ -5135,18 +5133,18 @@ static bool trim_overlap_drv_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *src,
trim_dependent_file( src->dependentfiles, i );
} else
i++;
- }
-
+ }
+
return in_use;
}
/****************************************************************************
- Determine whether or not a particular driver files are currently being
- used by any other driver.
-
+ Determine whether or not a particular driver files are currently being
+ used by any other driver.
+
Return value is True if any files were in use by other drivers
and False otherwise.
-
+
Upon return, *info has been modified to only contain the driver files
which are not in use
@@ -5168,36 +5166,36 @@ bool printer_driver_files_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info )
if ( !info )
return False;
-
+
version = info->cversion;
-
+
/* loop over all driver versions */
-
+
DEBUG(5,("printer_driver_files_in_use: Beginning search through ntdrivers.tdb...\n"));
-
+
/* get the list of drivers */
-
+
list = NULL;
ndrivers = get_ntdrivers(&list, info->environment, version);
-
- DEBUGADD(4,("we have:[%d] drivers in environment [%s] and version [%d]\n",
+
+ DEBUGADD(4,("we have:[%d] drivers in environment [%s] and version [%d]\n",
ndrivers, info->environment, version));
/* check each driver for overlap in files */
-
+
for (i=0; i<ndrivers; i++) {
DEBUGADD(5,("\tdriver: [%s]\n", list[i]));
-
+
ZERO_STRUCT(driver);
-
+
if ( !W_ERROR_IS_OK(get_a_printer_driver(&driver, 3, list[i], info->environment, version)) ) {
SAFE_FREE(list);
return True;
}
-
+
/* check if d2 uses any files from d1 */
/* only if this is a different driver than the one being deleted */
-
+
if ( !strequal(info->name, driver.info_3->name) ) {
if ( trim_overlap_drv_files(info, driver.info_3) ) {
/* mz: Do not instantly return -
@@ -5477,7 +5475,7 @@ WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr)
/* Store the security descriptor in a tdb */
if (!prs_init(&ps,
- (uint32_t)ndr_size_security_descriptor(new_secdesc_ctr->sd,
+ (uint32_t)ndr_size_security_descriptor(new_secdesc_ctr->sd,
NULL, 0)
+ sizeof(SEC_DESC_BUF), mem_ctx, MARSHALL) ) {
status = WERR_NOMEM;
@@ -5536,16 +5534,16 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx)
sa, SEC_ACE_FLAG_CONTAINER_INHERIT);
/* Add the domain admins group if we are a DC */
-
+
if ( IS_DC ) {
DOM_SID domadmins_sid;
-
+
sid_copy(&domadmins_sid, get_global_sam_sid());
sid_append_rid(&domadmins_sid, DOMAIN_GROUP_RID_ADMINS);
-
+
sa = PRINTER_ACE_FULL_CONTROL;
- init_sec_ace(&ace[i++], &domadmins_sid,
- SEC_ACE_TYPE_ACCESS_ALLOWED, sa,
+ init_sec_ace(&ace[i++], &domadmins_sid,
+ SEC_ACE_TYPE_ACCESS_ALLOWED, sa,
SEC_ACE_FLAG_OBJECT_INHERIT | SEC_ACE_FLAG_INHERIT_ONLY);
init_sec_ace(&ace[i++], &domadmins_sid, SEC_ACE_TYPE_ACCESS_ALLOWED,
sa, SEC_ACE_FLAG_CONTAINER_INHERIT);
@@ -5554,8 +5552,8 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx)
sid_append_rid(&adm_sid, DOMAIN_USER_RID_ADMIN);
sa = PRINTER_ACE_FULL_CONTROL;
- init_sec_ace(&ace[i++], &adm_sid,
- SEC_ACE_TYPE_ACCESS_ALLOWED, sa,
+ init_sec_ace(&ace[i++], &adm_sid,
+ SEC_ACE_TYPE_ACCESS_ALLOWED, sa,
SEC_ACE_FLAG_OBJECT_INHERIT | SEC_ACE_FLAG_INHERIT_ONLY);
init_sec_ace(&ace[i++], &adm_sid, SEC_ACE_TYPE_ACCESS_ALLOWED,
sa, SEC_ACE_FLAG_CONTAINER_INHERIT);
@@ -5564,10 +5562,10 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx)
/* add BUILTIN\Administrators as FULL CONTROL */
sa = PRINTER_ACE_FULL_CONTROL;
- init_sec_ace(&ace[i++], &global_sid_Builtin_Administrators,
- SEC_ACE_TYPE_ACCESS_ALLOWED, sa,
+ init_sec_ace(&ace[i++], &global_sid_Builtin_Administrators,
+ SEC_ACE_TYPE_ACCESS_ALLOWED, sa,
SEC_ACE_FLAG_OBJECT_INHERIT | SEC_ACE_FLAG_INHERIT_ONLY);
- init_sec_ace(&ace[i++], &global_sid_Builtin_Administrators,
+ init_sec_ace(&ace[i++], &global_sid_Builtin_Administrators,
SEC_ACE_TYPE_ACCESS_ALLOWED,
sa, SEC_ACE_FLAG_CONTAINER_INHERIT);
@@ -5580,7 +5578,7 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx)
if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) != NULL) {
psd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE,
- &global_sid_Builtin_Administrators,
+ &global_sid_Builtin_Administrators,
&global_sid_Builtin_Administrators,
NULL, psa, &sd_size);
}
@@ -5694,14 +5692,14 @@ bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **s
SEC_ACL *the_acl = (*secdesc_ctr)->sd->dacl;
int i;
- DEBUG(10, ("secdesc_ctr for %s has %d aces:\n",
+ DEBUG(10, ("secdesc_ctr for %s has %d aces:\n",
sharename, the_acl->num_aces));
for (i = 0; i < the_acl->num_aces; i++) {
DEBUG(10, ("%s %d %d 0x%08x\n",
sid_string_dbg(&the_acl->aces[i].trustee),
- the_acl->aces[i].type, the_acl->aces[i].flags,
- the_acl->aces[i].access_mask));
+ the_acl->aces[i].type, the_acl->aces[i].flags,
+ the_acl->aces[i].access_mask));
}
}
@@ -5721,15 +5719,15 @@ bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **s
A printer and a printer driver are 2 different things.
NT manages them separatelly, Samba does the same.
Why ? Simply because it's easier and it makes sense !
-
+
Now explanation: You have 3 printers behind your samba server,
2 of them are the same make and model (laser A and B). But laser B
has an 3000 sheet feeder and laser A doesn't such an option.
Your third printer is an old dot-matrix model for the accounting :-).
-
+
If the /usr/local/samba/lib directory (default dir), you will have
5 files to describe all of this.
-
+
3 files for the printers (1 by printer):
NTprinter_laser A
NTprinter_laser B
@@ -5787,7 +5785,7 @@ void map_job_permissions(SEC_DESC *sd)
print_queue_purge
Try access control in the following order (for performance reasons):
- 1) root ans SE_PRINT_OPERATOR can do anything (easy check)
+ 1) root ans SE_PRINT_OPERATOR can do anything (easy check)
2) check security descriptor (bit comparisons in memory)
3) "printer admins" (may result in numerous calls to winbind)
@@ -5801,7 +5799,7 @@ bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
const char *pname;
TALLOC_CTX *mem_ctx = NULL;
SE_PRIV se_printop = SE_PRINT_OPERATOR;
-
+
/* If user is NULL then use the current_user structure */
/* Always allow root or SE_PRINT_OPERATROR to do anything */
@@ -5870,7 +5868,7 @@ bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
}
talloc_destroy(mem_ctx);
-
+
if (!NT_STATUS_IS_OK(status)) {
errno = EACCES;
}
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 30a707f943..1ad8b5dd61 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -482,31 +482,6 @@ WERROR rpccli_spoolss_open_printer_ex(struct rpc_pipe_client *cli, TALLOC_CTX *m
/**********************************************************************
**********************************************************************/
-WERROR rpccli_spoolss_close_printer(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *pol)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_CLOSEPRINTER in;
- SPOOL_R_CLOSEPRINTER out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_closeprinter( &in, pol );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_CLOSEPRINTER,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_closeprinter,
- spoolss_io_r_closeprinter,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
WERROR rpccli_spoolss_enum_printers(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
char *name, uint32 flags, uint32 level,
uint32 *num_printers, PRINTER_INFO_CTR *ctr)
@@ -1061,66 +1036,6 @@ WERROR rpccli_spoolss_addprinterex (struct rpc_pipe_client *cli, TALLOC_CTX *mem
/**********************************************************************
**********************************************************************/
-WERROR rpccli_spoolss_deleteprinterdriverex(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, const char *arch,
- const char *driver, int version)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_DELETEPRINTERDRIVEREX in;
- SPOOL_R_DELETEPRINTERDRIVEREX out;
- fstring server;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
- strupper_m(server);
-
- make_spoolss_q_deleteprinterdriverex( mem_ctx, &in, server, arch, driver, version );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_DELETEPRINTERDRIVEREX,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_deleteprinterdriverex,
- spoolss_io_r_deleteprinterdriverex,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_deleteprinterdriver (struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, const char *arch,
- const char *driver)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_DELETEPRINTERDRIVER in;
- SPOOL_R_DELETEPRINTERDRIVER out;
- fstring server;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
- strupper_m(server);
-
- make_spoolss_q_deleteprinterdriver( mem_ctx, &in, server, arch, driver );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_DELETEPRINTERDRIVER,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_deleteprinterdriver,
- spoolss_io_r_deleteprinterdriver,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
WERROR rpccli_spoolss_getprintprocessordirectory(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
char *name, char *environment,
@@ -1179,138 +1094,6 @@ WERROR rpccli_spoolss_getprintprocessordirectory(struct rpc_pipe_client *cli,
/**********************************************************************
**********************************************************************/
-WERROR rpccli_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, uint32 level, FORM *form)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_ADDFORM in;
- SPOOL_R_ADDFORM out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_addform( &in, handle, level, form );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_ADDFORM,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_addform,
- spoolss_io_r_addform,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, uint32 level,
- const char *form_name, FORM *form)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_SETFORM in;
- SPOOL_R_SETFORM out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_setform( &in, handle, level, form_name, form );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_SETFORM,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_setform,
- spoolss_io_r_setform,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, const char *formname,
- uint32 level, FORM_1 *form)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_GETFORM in;
- SPOOL_R_GETFORM out;
- RPC_BUFFER buffer;
- uint32 offered;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- offered = 0;
- if (!rpcbuf_init(&buffer, offered, mem_ctx))
- return WERR_NOMEM;
- make_spoolss_q_getform( &in, handle, formname, level, &buffer, offered );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_GETFORM,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_getform,
- spoolss_io_r_getform,
- WERR_GENERAL_FAILURE );
-
- if ( W_ERROR_EQUAL( out.status, WERR_INSUFFICIENT_BUFFER ) ) {
- offered = out.needed;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- if (!rpcbuf_init(&buffer, offered, mem_ctx))
- return WERR_NOMEM;
- make_spoolss_q_getform( &in, handle, formname, level, &buffer, offered );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_GETFORM,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_getform,
- spoolss_io_r_getform,
- WERR_GENERAL_FAILURE );
- }
-
- if (!W_ERROR_IS_OK(out.status))
- return out.status;
-
- if (!smb_io_form_1("", out.buffer, form, 0)) {
- return WERR_GENERAL_FAILURE;
- }
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_deleteform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *handle, const char *form_name)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_DELETEFORM in;
- SPOOL_R_DELETEFORM out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_deleteform( &in, handle, form_name );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_DELETEFORM,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_deleteform,
- spoolss_io_r_deleteform,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *handle, int level, uint32 *num_forms,
FORM_1 **forms)
@@ -1534,56 +1317,6 @@ WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
/**********************************************************************
**********************************************************************/
-WERROR rpccli_spoolss_startpageprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_STARTPAGEPRINTER in;
- SPOOL_R_STARTPAGEPRINTER out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_startpageprinter( &in, hnd );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_STARTPAGEPRINTER,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_startpageprinter,
- spoolss_io_r_startpageprinter,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_endpageprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_ENDPAGEPRINTER in;
- SPOOL_R_ENDPAGEPRINTER out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_endpageprinter( &in, hnd );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_ENDPAGEPRINTER,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_endpageprinter,
- spoolss_io_r_endpageprinter,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
WERROR rpccli_spoolss_startdocprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, char *docname,
char *outputfile, char *datatype,
@@ -1615,31 +1348,6 @@ WERROR rpccli_spoolss_startdocprinter(struct rpc_pipe_client *cli, TALLOC_CTX *m
/**********************************************************************
**********************************************************************/
-WERROR rpccli_spoolss_enddocprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_ENDDOCPRINTER in;
- SPOOL_R_ENDDOCPRINTER out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_enddocprinter( &in, hnd );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_ENDDOCPRINTER,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_enddocprinter,
- spoolss_io_r_enddocprinter,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, const char *valuename,
REGISTRY_VALUE *value)
@@ -1913,86 +1621,6 @@ WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX
/**********************************************************************
**********************************************************************/
-WERROR rpccli_spoolss_writeprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, uint32 data_size, char *data,
- uint32 *num_written)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_WRITEPRINTER in;
- SPOOL_R_WRITEPRINTER out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_writeprinter( &in, hnd, data_size, data );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_WRITEPRINTER,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_writeprinter,
- spoolss_io_r_writeprinter,
- WERR_GENERAL_FAILURE );
-
- if (num_written)
- *num_written = out.buffer_written;
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_deleteprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, char *valuename)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_DELETEPRINTERDATA in;
- SPOOL_R_DELETEPRINTERDATA out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_deleteprinterdata( &in, hnd, valuename );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_DELETEPRINTERDATA,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_deleteprinterdata,
- spoolss_io_r_deleteprinterdata,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_deleteprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, char *keyname,
- char *valuename)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_DELETEPRINTERDATAEX in;
- SPOOL_R_DELETEPRINTERDATAEX out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_deleteprinterdataex( &in, hnd, keyname, valuename );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_DELETEPRINTERDATAEX,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_deleteprinterdataex,
- spoolss_io_r_deleteprinterdataex,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hnd, const char *keyname,
uint16 **keylist, uint32 *len)
@@ -2046,29 +1674,4 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, TALLOC_CTX *me
return out.status;
}
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_deleteprinterkey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hnd, char *keyname)
-{
- prs_struct qbuf, rbuf;
- SPOOL_Q_DELETEPRINTERKEY in;
- SPOOL_R_DELETEPRINTERKEY out;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- make_spoolss_q_deleteprinterkey( &in, hnd, keyname );
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_DELETEPRINTERKEY,
- in, out,
- qbuf, rbuf,
- spoolss_io_q_deleteprinterkey,
- spoolss_io_r_deleteprinterkey,
- WERR_GENERAL_FAILURE );
-
- return out.status;
-}
-
/** @} **/
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index e8103ad866..bc9202cccc 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -267,12 +267,12 @@ bool prs_grow(prs_struct *ps, uint32 extra_space)
extra_space -= (ps->buffer_size - ps->data_offset);
if(ps->buffer_size == 0) {
+
/*
- * Ensure we have at least a PDU's length, or extra_space, whichever
- * is greater.
+ * Start with 128 bytes (arbitrary value), enough for small rpc
+ * requests
*/
-
- new_size = MAX(RPC_MAX_PDU_FRAG_LEN,extra_space);
+ new_size = MAX(128, extra_space);
if((ps->data_p = (char *)SMB_MALLOC(new_size)) == NULL) {
DEBUG(0,("prs_grow: Malloc failure for size %u.\n", (unsigned int)new_size));
@@ -281,10 +281,13 @@ bool prs_grow(prs_struct *ps, uint32 extra_space)
memset(ps->data_p, '\0', (size_t)new_size );
} else {
/*
- * If the current buffer size is bigger than the space needed, just
- * double it, else add extra_space.
+ * If the current buffer size is bigger than the space needed,
+ * just double it, else add extra_space. Always keep 64 bytes
+ * more, so that after we added a large blob we don't have to
+ * realloc immediately again.
*/
- new_size = MAX(ps->buffer_size*2, ps->buffer_size + extra_space);
+ new_size = MAX(ps->buffer_size*2,
+ ps->buffer_size + extra_space + 64);
if ((ps->data_p = (char *)SMB_REALLOC(ps->data_p, new_size)) == NULL) {
DEBUG(0,("prs_grow: Realloc failure for size %u.\n",
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 3fe0c3a416..84b764eeab 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -1232,60 +1232,6 @@ bool spoolss_io_r_open_printer_ex(const char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u
}
/*******************************************************************
- * init a structure.
- ********************************************************************/
-bool make_spoolss_q_deleteprinterdriverex( TALLOC_CTX *mem_ctx,
- SPOOL_Q_DELETEPRINTERDRIVEREX *q_u,
- const char *server,
- const char* arch,
- const char* driver,
- int version)
-{
- DEBUG(5,("make_spoolss_q_deleteprinterdriverex\n"));
-
- q_u->server_ptr = (server!=NULL)?1:0;
- q_u->delete_flags = DPD_DELETE_UNUSED_FILES;
-
- /* these must be NULL terminated or else NT4 will
- complain about invalid parameters --jerry */
- init_unistr2(&q_u->server, server, UNI_STR_TERMINATE);
- init_unistr2(&q_u->arch, arch, UNI_STR_TERMINATE);
- init_unistr2(&q_u->driver, driver, UNI_STR_TERMINATE);
-
- if (version >= 0) {
- q_u->delete_flags |= DPD_DELETE_SPECIFIC_VERSION;
- q_u->version = version;
- }
-
- return True;
-}
-
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-bool make_spoolss_q_deleteprinterdriver(
- TALLOC_CTX *mem_ctx,
- SPOOL_Q_DELETEPRINTERDRIVER *q_u,
- const char *server,
- const char* arch,
- const char* driver
-)
-{
- DEBUG(5,("make_spoolss_q_deleteprinterdriver\n"));
-
- q_u->server_ptr = (server!=NULL)?1:0;
-
- /* these must be NULL terminated or else NT4 will
- complain about invalid parameters --jerry */
- init_unistr2(&q_u->server, server, UNI_STR_TERMINATE);
- init_unistr2(&q_u->arch, arch, UNI_STR_TERMINATE);
- init_unistr2(&q_u->driver, driver, UNI_STR_TERMINATE);
-
- return True;
-}
-
-/*******************************************************************
* make a structure.
********************************************************************/
@@ -1355,88 +1301,6 @@ bool spoolss_io_q_getprinterdata(const char *desc, SPOOL_Q_GETPRINTERDATA *q_u,
}
/*******************************************************************
- * read a structure.
- * called from spoolss_q_deleteprinterdata (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_deleteprinterdata(const char *desc, SPOOL_Q_DELETEPRINTERDATA *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdata");
- depth++;
-
- if (!prs_align(ps))
- return False;
- if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
- if (!prs_align(ps))
- return False;
- if (!smb_io_unistr2("valuename", &q_u->valuename,True,ps,depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from spoolss_r_deleteprinterdata (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_deleteprinterdata(const char *desc, SPOOL_R_DELETEPRINTERDATA *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdata");
- depth++;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- * called from spoolss_q_deleteprinterdataex (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_deleteprinterdataex(const char *desc, SPOOL_Q_DELETEPRINTERDATAEX *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdataex");
- depth++;
-
- if (!prs_align(ps))
- return False;
- if (!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth))
- return False;
-
- if (!smb_io_unistr2("keyname ", &q_u->keyname, True, ps, depth))
- return False;
- if (!smb_io_unistr2("valuename", &q_u->valuename, True, ps, depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from spoolss_r_deleteprinterdataex (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_deleteprinterdataex(const char *desc, SPOOL_R_DELETEPRINTERDATAEX *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdataex");
- depth++;
-
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
* write a structure.
* called from spoolss_r_getprinterdata (srv_spoolss.c)
********************************************************************/
@@ -1477,256 +1341,6 @@ bool spoolss_io_r_getprinterdata(const char *desc, SPOOL_R_GETPRINTERDATA *r_u,
}
/*******************************************************************
- * make a structure.
- ********************************************************************/
-
-bool make_spoolss_q_closeprinter(SPOOL_Q_CLOSEPRINTER *q_u, POLICY_HND *hnd)
-{
- if (q_u == NULL) return False;
-
- DEBUG(5,("make_spoolss_q_closeprinter\n"));
-
- memcpy(&q_u->handle, hnd, sizeof(q_u->handle));
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- * called from static spoolss_q_abortprinter (srv_spoolss.c)
- * called from spoolss_abortprinter (cli_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_abortprinter(const char *desc, SPOOL_Q_ABORTPRINTER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_abortprinter");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from spoolss_r_abortprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_abortprinter(const char *desc, SPOOL_R_ABORTPRINTER *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_abortprinter");
- depth++;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- * called from static spoolss_q_deleteprinter (srv_spoolss.c)
- * called from spoolss_deleteprinter (cli_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_deleteprinter(const char *desc, SPOOL_Q_DELETEPRINTER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinter");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from static spoolss_r_deleteprinter (srv_spoolss.c)
- * called from spoolss_deleteprinter (cli_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_deleteprinter(const char *desc, SPOOL_R_DELETEPRINTER *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinter");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth))
- return False;
- if (!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-
-/*******************************************************************
- * read a structure.
- * called from api_spoolss_deleteprinterdriver (srv_spoolss.c)
- * called from spoolss_deleteprinterdriver (cli_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_deleteprinterdriver(const char *desc, SPOOL_Q_DELETEPRINTERDRIVER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdriver");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if(!prs_uint32("server_ptr", ps, depth, &q_u->server_ptr))
- return False;
- if(!smb_io_unistr2("server", &q_u->server, q_u->server_ptr, ps, depth))
- return False;
- if(!smb_io_unistr2("arch", &q_u->arch, True, ps, depth))
- return False;
- if(!smb_io_unistr2("driver", &q_u->driver, True, ps, depth))
- return False;
-
-
- return True;
-}
-
-
-/*******************************************************************
- * write a structure.
- ********************************************************************/
-bool spoolss_io_r_deleteprinterdriver(const char *desc, SPOOL_R_DELETEPRINTERDRIVER *r_u, prs_struct *ps, int depth)
-{
- if (r_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdriver");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-
-/*******************************************************************
- * read a structure.
- * called from api_spoolss_deleteprinterdriver (srv_spoolss.c)
- * called from spoolss_deleteprinterdriver (cli_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_deleteprinterdriverex(const char *desc, SPOOL_Q_DELETEPRINTERDRIVEREX *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdriverex");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if(!prs_uint32("server_ptr", ps, depth, &q_u->server_ptr))
- return False;
- if(!smb_io_unistr2("server", &q_u->server, q_u->server_ptr, ps, depth))
- return False;
- if(!smb_io_unistr2("arch", &q_u->arch, True, ps, depth))
- return False;
- if(!smb_io_unistr2("driver", &q_u->driver, True, ps, depth))
- return False;
-
- if (!prs_align(ps))
- return False;
-
- if(!prs_uint32("delete_flags ", ps, depth, &q_u->delete_flags))
- return False;
- if(!prs_uint32("version ", ps, depth, &q_u->version))
- return False;
-
-
- return True;
-}
-
-
-/*******************************************************************
- * write a structure.
- ********************************************************************/
-bool spoolss_io_r_deleteprinterdriverex(const char *desc, SPOOL_R_DELETEPRINTERDRIVEREX *r_u, prs_struct *ps, int depth)
-{
- if (r_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdriverex");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-
-
-/*******************************************************************
- * read a structure.
- * called from static spoolss_q_closeprinter (srv_spoolss.c)
- * called from spoolss_closeprinter (cli_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_closeprinter(const char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_closeprinter");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from static spoolss_r_closeprinter (srv_spoolss.c)
- * called from spoolss_closeprinter (cli_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_closeprinter(const char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_closeprinter");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth))
- return False;
- if (!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
* read a structure.
* called from spoolss_q_startdocprinter (srv_spoolss.c)
********************************************************************/
@@ -1769,168 +1383,6 @@ bool spoolss_io_r_startdocprinter(const char *desc, SPOOL_R_STARTDOCPRINTER *r_u
/*******************************************************************
* read a structure.
- * called from spoolss_q_enddocprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_enddocprinter(const char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_enddocprinter");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from spoolss_r_enddocprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_enddocprinter(const char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_enddocprinter");
- depth++;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- * called from spoolss_q_startpageprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_startpageprinter(const char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_startpageprinter");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from spoolss_r_startpageprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_startpageprinter(const char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_startpageprinter");
- depth++;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- * called from spoolss_q_endpageprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_endpageprinter(const char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_endpageprinter");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from spoolss_r_endpageprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_endpageprinter(const char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_endpageprinter");
- depth++;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- * called from spoolss_q_writeprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_q_writeprinter(const char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL) return False;
-
- prs_debug(ps, depth, desc, "spoolss_io_q_writeprinter");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
- if(!prs_uint32("buffer_size", ps, depth, &q_u->buffer_size))
- return False;
-
- if (q_u->buffer_size!=0)
- {
- if (UNMARSHALLING(ps))
- q_u->buffer=PRS_ALLOC_MEM(ps, uint8, q_u->buffer_size);
- if(q_u->buffer == NULL)
- return False;
- if(!prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size))
- return False;
- }
- if(!prs_align(ps))
- return False;
- if(!prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- * called from spoolss_r_writeprinter (srv_spoolss.c)
- ********************************************************************/
-
-bool spoolss_io_r_writeprinter(const char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_writeprinter");
- depth++;
- if(!prs_uint32("buffer_written", ps, depth, &r_u->buffer_written))
- return False;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
* called from spoolss_q_rffpcnex (srv_spoolss.c)
********************************************************************/
@@ -3997,42 +3449,6 @@ bool spoolss_io_q_setprinter(const char *desc, SPOOL_Q_SETPRINTER *q_u, prs_stru
/*******************************************************************
********************************************************************/
-bool spoolss_io_r_fcpn(const char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_fcpn");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_q_fcpn(const char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth)
-{
-
- prs_debug(ps, depth, desc, "spoolss_io_q_fcpn");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
-
- return True;
-}
-
-
-/*******************************************************************
-********************************************************************/
-
bool spoolss_io_r_addjob(const char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "");
@@ -4398,65 +3814,6 @@ bool spoolss_io_r_enumforms(const char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct
}
/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_q_getform(const char *desc, SPOOL_Q_GETFORM *q_u, prs_struct *ps, int depth)
-{
-
- prs_debug(ps, depth, desc, "spoolss_io_q_getform");
- depth++;
-
- if (!prs_align(ps))
- return False;
- if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))
- return False;
- if (!smb_io_unistr2("", &q_u->formname,True,ps,depth))
- return False;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_uint32("level", ps, depth, &q_u->level))
- return False;
-
- if (!prs_rpcbuffer_p("", ps, depth, &q_u->buffer))
- return False;
-
- if (!prs_align(ps))
- return False;
- if (!prs_uint32("offered", ps, depth, &q_u->offered))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_r_getform(const char *desc, SPOOL_R_GETFORM *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_getform");
- depth++;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_rpcbuffer_p("", ps, depth, &r_u->buffer))
- return False;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_uint32("size of buffer needed", ps, depth, &r_u->needed))
- return False;
-
- if (!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
Parse a SPOOL_R_ENUMPORTS structure.
********************************************************************/
@@ -6087,172 +5444,6 @@ bool spoolss_io_r_resetprinter(const char *desc, SPOOL_R_RESETPRINTER *r_u, prs_
}
/*******************************************************************
-********************************************************************/
-
-static bool spoolss_io_addform(const char *desc, FORM *f, uint32 ptr, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_addform");
- depth++;
- if(!prs_align(ps))
- return False;
-
- if (ptr!=0)
- {
- if(!prs_uint32("flags", ps, depth, &f->flags))
- return False;
- if(!prs_uint32("name_ptr", ps, depth, &f->name_ptr))
- return False;
- if(!prs_uint32("size_x", ps, depth, &f->size_x))
- return False;
- if(!prs_uint32("size_y", ps, depth, &f->size_y))
- return False;
- if(!prs_uint32("left", ps, depth, &f->left))
- return False;
- if(!prs_uint32("top", ps, depth, &f->top))
- return False;
- if(!prs_uint32("right", ps, depth, &f->right))
- return False;
- if(!prs_uint32("bottom", ps, depth, &f->bottom))
- return False;
-
- if(!smb_io_unistr2("", &f->name, f->name_ptr, ps, depth))
- return False;
- }
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_q_deleteform(const char *desc, SPOOL_Q_DELETEFORM *q_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_q_deleteform");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth))
- return False;
- if(!smb_io_unistr2("form name", &q_u->name, True, ps, depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_r_deleteform(const char *desc, SPOOL_R_DELETEFORM *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_deleteform");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_q_addform(const char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth)
-{
- uint32 useless_ptr=1;
- prs_debug(ps, depth, desc, "spoolss_io_q_addform");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth))
- return False;
- if(!prs_uint32("level", ps, depth, &q_u->level))
- return False;
- if(!prs_uint32("level2", ps, depth, &q_u->level2))
- return False;
-
- if (q_u->level==1)
- {
- if(!prs_uint32("useless_ptr", ps, depth, &useless_ptr))
- return False;
- if(!spoolss_io_addform("", &q_u->form, useless_ptr, ps, depth))
- return False;
- }
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_r_addform(const char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_addform");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_q_setform(const char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth)
-{
- uint32 useless_ptr=1;
- prs_debug(ps, depth, desc, "spoolss_io_q_setform");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth))
- return False;
- if(!smb_io_unistr2("", &q_u->name, True, ps, depth))
- return False;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("level", ps, depth, &q_u->level))
- return False;
- if(!prs_uint32("level2", ps, depth, &q_u->level2))
- return False;
-
- if (q_u->level==1)
- {
- if(!prs_uint32("useless_ptr", ps, depth, &useless_ptr))
- return False;
- if(!spoolss_io_addform("", &q_u->form, useless_ptr, ps, depth))
- return False;
- }
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool spoolss_io_r_setform(const char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_setform");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
Parse a SPOOL_R_GETJOB structure.
********************************************************************/
@@ -6939,60 +6130,6 @@ bool spoolss_io_r_enumprinterkey(const char *desc, SPOOL_R_ENUMPRINTERKEY *r_u,
* read a structure.
********************************************************************/
-bool make_spoolss_q_deleteprinterkey(SPOOL_Q_DELETEPRINTERKEY *q_u,
- POLICY_HND *hnd, char *keyname)
-{
- DEBUG(5,("make_spoolss_q_deleteprinterkey\n"));
-
- memcpy(&q_u->handle, hnd, sizeof(q_u->handle));
- init_unistr2(&q_u->keyname, keyname, UNI_STR_TERMINATE);
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- ********************************************************************/
-
-bool spoolss_io_q_deleteprinterkey(const char *desc, SPOOL_Q_DELETEPRINTERKEY *q_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterkey");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth))
- return False;
-
- if(!smb_io_unistr2("", &q_u->keyname, True, ps, depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- * write a structure.
- ********************************************************************/
-
-bool spoolss_io_r_deleteprinterkey(const char *desc, SPOOL_R_DELETEPRINTERKEY *r_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterkey");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-
-/*******************************************************************
- * read a structure.
- ********************************************************************/
-
bool spoolss_io_q_enumprinterdataex(const char *desc, SPOOL_Q_ENUMPRINTERDATAEX *q_u, prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "spoolss_io_q_enumprinterdataex");
@@ -7302,66 +6439,6 @@ bool smb_io_printprocessordirectory_1(const char *desc, RPC_BUFFER *buffer, PRIN
* init a structure.
********************************************************************/
-bool make_spoolss_q_addform(SPOOL_Q_ADDFORM *q_u, POLICY_HND *handle,
- int level, FORM *form)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
- q_u->level = level;
- q_u->level2 = level;
- memcpy(&q_u->form, form, sizeof(FORM));
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_setform(SPOOL_Q_SETFORM *q_u, POLICY_HND *handle,
- int level, const char *form_name, FORM *form)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
- q_u->level = level;
- q_u->level2 = level;
- memcpy(&q_u->form, form, sizeof(FORM));
- init_unistr2(&q_u->name, form_name, UNI_STR_TERMINATE);
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_deleteform(SPOOL_Q_DELETEFORM *q_u, POLICY_HND *handle,
- const char *form)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
- init_unistr2(&q_u->name, form, UNI_STR_TERMINATE);
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_getform(SPOOL_Q_GETFORM *q_u, POLICY_HND *handle,
- const char *formname, uint32 level,
- RPC_BUFFER *buffer, uint32 offered)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
- q_u->level = level;
- init_unistr2(&q_u->formname, formname, UNI_STR_TERMINATE);
- q_u->buffer=buffer;
- q_u->offered=offered;
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
bool make_spoolss_q_enumforms(SPOOL_Q_ENUMFORMS *q_u, POLICY_HND *handle,
uint32 level, RPC_BUFFER *buffer,
uint32 offered)
@@ -7414,30 +6491,6 @@ bool make_spoolss_q_getjob(SPOOL_Q_GETJOB *q_u, POLICY_HND *handle,
* init a structure.
********************************************************************/
-bool make_spoolss_q_startpageprinter(SPOOL_Q_STARTPAGEPRINTER *q_u,
- POLICY_HND *handle)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_endpageprinter(SPOOL_Q_ENDPAGEPRINTER *q_u,
- POLICY_HND *handle)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
bool make_spoolss_q_startdocprinter(SPOOL_Q_STARTDOCPRINTER *q_u,
POLICY_HND *handle, uint32 level,
char *docname, char *outputfile,
@@ -7478,60 +6531,6 @@ bool make_spoolss_q_startdocprinter(SPOOL_Q_STARTDOCPRINTER *q_u,
* init a structure.
********************************************************************/
-bool make_spoolss_q_enddocprinter(SPOOL_Q_ENDDOCPRINTER *q_u,
- POLICY_HND *handle)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_writeprinter(SPOOL_Q_WRITEPRINTER *q_u,
- POLICY_HND *handle, uint32 data_size,
- char *data)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
- q_u->buffer_size = q_u->buffer_size2 = data_size;
- q_u->buffer = (unsigned char *)data;
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_deleteprinterdata(SPOOL_Q_DELETEPRINTERDATA *q_u,
- POLICY_HND *handle, char *valuename)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
- init_unistr2(&q_u->valuename, valuename, UNI_STR_TERMINATE);
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_deleteprinterdataex(SPOOL_Q_DELETEPRINTERDATAEX *q_u,
- POLICY_HND *handle, char *key,
- char *value)
-{
- memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
- init_unistr2(&q_u->valuename, value, UNI_STR_TERMINATE);
- init_unistr2(&q_u->keyname, key, UNI_STR_TERMINATE);
-
- return True;
-}
-
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
bool make_spoolss_q_rffpcnex(SPOOL_Q_RFFPCNEX *q_u, POLICY_HND *handle,
uint32 flags, uint32 options, const char *localmachine,
uint32 printerlocal, SPOOL_NOTIFY_OPTION *option)
diff --git a/source3/rpc_server/srv_eventlog_lib.c b/source3/rpc_server/srv_eventlog_lib.c
index 57b3be43ad..d8c5c3d453 100644
--- a/source3/rpc_server/srv_eventlog_lib.c
+++ b/source3/rpc_server/srv_eventlog_lib.c
@@ -551,9 +551,11 @@ bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb
entry->sid_length = rpcstr_push_talloc(mem_ctx,
&dummy,
stop);
+ if (entry->sid_length == (uint32_t)-1) {
+ return false;
+ }
entry->sid = data_blob_talloc(mem_ctx, dummy, entry->sid_length);
- if (entry->sid_length == (uint32_t)-1 ||
- entry->sid.data == NULL) {
+ if (entry->sid.data == NULL) {
return false;
}
} else if ( 0 == strncmp( start, "STR", stop - start ) ) {
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 924226bc4f..09b1f66440 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -61,7 +61,6 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
uint32 data_space_available;
uint32 data_len_left;
uint32 data_len;
- prs_struct outgoing_pdu;
NTSTATUS status;
DATA_BLOB auth_blob;
RPC_HDR_AUTH auth_info;
@@ -105,8 +104,8 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
return False;
}
- data_space_available = sizeof(p->out_data.current_pdu) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN -
- RPC_HDR_AUTH_LEN - NTLMSSP_SIG_SIZE;
+ data_space_available = RPC_MAX_PDU_FRAG_LEN - RPC_HEADER_LEN
+ - RPC_HDR_RESP_LEN - RPC_HDR_AUTH_LEN - NTLMSSP_SIG_SIZE;
/*
* The amount we send is the minimum of the available
@@ -150,27 +149,27 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
* data.
*/
- prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
- prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
+ prs_init_empty(&p->out_data.frag, p->mem_ctx, MARSHALL);
/* Store the header in the data stream. */
- if(!smb_io_rpc_hdr("hdr", &p->hdr, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr("hdr", &p->hdr, &p->out_data.frag, 0)) {
DEBUG(0,("create_next_pdu_ntlmssp: failed to marshall RPC_HDR.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
- if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &p->out_data.frag, 0)) {
DEBUG(0,("create_next_pdu_ntlmssp: failed to marshall RPC_HDR_RESP.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
/* Copy the data into the PDU. */
- if(!prs_append_some_prs_data(&outgoing_pdu, &p->out_data.rdata, p->out_data.data_sent_length, data_len)) {
+ if(!prs_append_some_prs_data(&p->out_data.frag, &p->out_data.rdata,
+ p->out_data.data_sent_length, data_len)) {
DEBUG(0,("create_next_pdu_ntlmssp: failed to copy %u bytes of data.\n", (unsigned int)data_len));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
@@ -179,10 +178,11 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
char pad[8];
memset(pad, '\0', 8);
- if (!prs_copy_data_in(&outgoing_pdu, pad, ss_padding_len)) {
+ if (!prs_copy_data_in(&p->out_data.frag, pad,
+ ss_padding_len)) {
DEBUG(0,("create_next_pdu_ntlmssp: failed to add %u bytes of pad data.\n",
(unsigned int)ss_padding_len));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
}
@@ -201,9 +201,10 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
}
init_rpc_hdr_auth(&auth_info, auth_type, auth_level, ss_padding_len, 1 /* context id. */);
- if(!smb_io_rpc_hdr_auth("hdr_auth", &auth_info, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr_auth("hdr_auth", &auth_info, &p->out_data.frag,
+ 0)) {
DEBUG(0,("create_next_pdu_ntlmssp: failed to marshall RPC_HDR_AUTH.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
@@ -212,43 +213,48 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
switch (p->auth.auth_level) {
case PIPE_AUTH_LEVEL_PRIVACY:
/* Data portion is encrypted. */
- status = ntlmssp_seal_packet(a->ntlmssp_state,
- (unsigned char *)prs_data_p(&outgoing_pdu) + RPC_HEADER_LEN + RPC_HDR_RESP_LEN,
- data_len + ss_padding_len,
- (unsigned char *)prs_data_p(&outgoing_pdu),
- (size_t)prs_offset(&outgoing_pdu),
- &auth_blob);
+ status = ntlmssp_seal_packet(
+ a->ntlmssp_state,
+ (uint8_t *)prs_data_p(&p->out_data.frag)
+ + RPC_HEADER_LEN + RPC_HDR_RESP_LEN,
+ data_len + ss_padding_len,
+ (unsigned char *)prs_data_p(&p->out_data.frag),
+ (size_t)prs_offset(&p->out_data.frag),
+ &auth_blob);
if (!NT_STATUS_IS_OK(status)) {
data_blob_free(&auth_blob);
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
break;
case PIPE_AUTH_LEVEL_INTEGRITY:
/* Data is signed. */
- status = ntlmssp_sign_packet(a->ntlmssp_state,
- (unsigned char *)prs_data_p(&outgoing_pdu) + RPC_HEADER_LEN + RPC_HDR_RESP_LEN,
- data_len + ss_padding_len,
- (unsigned char *)prs_data_p(&outgoing_pdu),
- (size_t)prs_offset(&outgoing_pdu),
- &auth_blob);
+ status = ntlmssp_sign_packet(
+ a->ntlmssp_state,
+ (unsigned char *)prs_data_p(&p->out_data.frag)
+ + RPC_HEADER_LEN + RPC_HDR_RESP_LEN,
+ data_len + ss_padding_len,
+ (unsigned char *)prs_data_p(&p->out_data.frag),
+ (size_t)prs_offset(&p->out_data.frag),
+ &auth_blob);
if (!NT_STATUS_IS_OK(status)) {
data_blob_free(&auth_blob);
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
break;
default:
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
/* Append the auth blob. */
- if (!prs_copy_data_in(&outgoing_pdu, (char *)auth_blob.data, NTLMSSP_SIG_SIZE)) {
+ if (!prs_copy_data_in(&p->out_data.frag, (char *)auth_blob.data,
+ NTLMSSP_SIG_SIZE)) {
DEBUG(0,("create_next_pdu_ntlmssp: failed to add %u bytes auth blob.\n",
(unsigned int)NTLMSSP_SIG_SIZE));
data_blob_free(&auth_blob);
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
@@ -259,10 +265,8 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
*/
p->out_data.data_sent_length += data_len;
- p->out_data.current_pdu_len = p->hdr.frag_len;
p->out_data.current_pdu_sent = 0;
- prs_mem_free(&outgoing_pdu);
return True;
}
@@ -278,7 +282,6 @@ static bool create_next_pdu_schannel(pipes_struct *p)
uint32 data_len;
uint32 data_space_available;
uint32 data_len_left;
- prs_struct outgoing_pdu;
uint32 data_pos;
/*
@@ -318,8 +321,9 @@ static bool create_next_pdu_schannel(pipes_struct *p)
return False;
}
- data_space_available = sizeof(p->out_data.current_pdu) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN -
- RPC_HDR_AUTH_LEN - RPC_AUTH_SCHANNEL_SIGN_OR_SEAL_CHK_LEN;
+ data_space_available = RPC_MAX_PDU_FRAG_LEN - RPC_HEADER_LEN
+ - RPC_HDR_RESP_LEN - RPC_HDR_AUTH_LEN
+ - RPC_AUTH_SCHANNEL_SIGN_OR_SEAL_CHK_LEN;
/*
* The amount we send is the minimum of the available
@@ -357,30 +361,30 @@ static bool create_next_pdu_schannel(pipes_struct *p)
* data.
*/
- prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
- prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
+ prs_init_empty(&p->out_data.frag, p->mem_ctx, MARSHALL);
/* Store the header in the data stream. */
- if(!smb_io_rpc_hdr("hdr", &p->hdr, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr("hdr", &p->hdr, &p->out_data.frag, 0)) {
DEBUG(0,("create_next_pdu_schannel: failed to marshall RPC_HDR.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
- if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &p->out_data.frag, 0)) {
DEBUG(0,("create_next_pdu_schannel: failed to marshall RPC_HDR_RESP.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
/* Store the current offset. */
- data_pos = prs_offset(&outgoing_pdu);
+ data_pos = prs_offset(&p->out_data.frag);
/* Copy the data into the PDU. */
- if(!prs_append_some_prs_data(&outgoing_pdu, &p->out_data.rdata, p->out_data.data_sent_length, data_len)) {
+ if(!prs_append_some_prs_data(&p->out_data.frag, &p->out_data.rdata,
+ p->out_data.data_sent_length, data_len)) {
DEBUG(0,("create_next_pdu_schannel: failed to copy %u bytes of data.\n", (unsigned int)data_len));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
@@ -388,9 +392,10 @@ static bool create_next_pdu_schannel(pipes_struct *p)
if (ss_padding_len) {
char pad[8];
memset(pad, '\0', 8);
- if (!prs_copy_data_in(&outgoing_pdu, pad, ss_padding_len)) {
+ if (!prs_copy_data_in(&p->out_data.frag, pad,
+ ss_padding_len)) {
DEBUG(0,("create_next_pdu_schannel: failed to add %u bytes of pad data.\n", (unsigned int)ss_padding_len));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
}
@@ -399,11 +404,9 @@ static bool create_next_pdu_schannel(pipes_struct *p)
/*
* Schannel processing.
*/
- char *data;
RPC_HDR_AUTH auth_info;
RPC_AUTH_SCHANNEL_CHK verf;
- data = prs_data_p(&outgoing_pdu) + data_pos;
/* Check it's the type of reply we were expecting to decode */
init_rpc_hdr_auth(&auth_info,
@@ -412,20 +415,21 @@ static bool create_next_pdu_schannel(pipes_struct *p)
RPC_AUTH_LEVEL_PRIVACY : RPC_AUTH_LEVEL_INTEGRITY,
ss_padding_len, 1);
- if(!smb_io_rpc_hdr_auth("hdr_auth", &auth_info, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr_auth("hdr_auth", &auth_info,
+ &p->out_data.frag, 0)) {
DEBUG(0,("create_next_pdu_schannel: failed to marshall RPC_HDR_AUTH.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
schannel_encode(p->auth.a_u.schannel_auth,
- p->auth.auth_level,
- SENDER_IS_ACCEPTOR,
- &verf, data, data_len + ss_padding_len);
+ p->auth.auth_level, SENDER_IS_ACCEPTOR, &verf,
+ prs_data_p(&p->out_data.frag) + data_pos,
+ data_len + ss_padding_len);
if (!smb_io_rpc_auth_schannel_chk("", RPC_AUTH_SCHANNEL_SIGN_OR_SEAL_CHK_LEN,
- &verf, &outgoing_pdu, 0)) {
- prs_mem_free(&outgoing_pdu);
+ &verf, &p->out_data.frag, 0)) {
+ prs_mem_free(&p->out_data.frag);
return False;
}
@@ -437,10 +441,8 @@ static bool create_next_pdu_schannel(pipes_struct *p)
*/
p->out_data.data_sent_length += data_len;
- p->out_data.current_pdu_len = p->hdr.frag_len;
p->out_data.current_pdu_sent = 0;
- prs_mem_free(&outgoing_pdu);
return True;
}
@@ -455,7 +457,6 @@ static bool create_next_pdu_noauth(pipes_struct *p)
uint32 data_len;
uint32 data_space_available;
uint32 data_len_left;
- prs_struct outgoing_pdu;
/*
* If we're in the fault state, keep returning fault PDU's until
@@ -494,7 +495,8 @@ static bool create_next_pdu_noauth(pipes_struct *p)
return False;
}
- data_space_available = sizeof(p->out_data.current_pdu) - RPC_HEADER_LEN - RPC_HDR_RESP_LEN;
+ data_space_available = RPC_MAX_PDU_FRAG_LEN - RPC_HEADER_LEN
+ - RPC_HDR_RESP_LEN;
/*
* The amount we send is the minimum of the available
@@ -530,27 +532,27 @@ static bool create_next_pdu_noauth(pipes_struct *p)
* data.
*/
- prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
- prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
+ prs_init_empty(&p->out_data.frag, p->mem_ctx, MARSHALL);
/* Store the header in the data stream. */
- if(!smb_io_rpc_hdr("hdr", &p->hdr, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr("hdr", &p->hdr, &p->out_data.frag, 0)) {
DEBUG(0,("create_next_pdu_noath: failed to marshall RPC_HDR.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
- if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &p->out_data.frag, 0)) {
DEBUG(0,("create_next_pdu_noath: failed to marshall RPC_HDR_RESP.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
/* Copy the data into the PDU. */
- if(!prs_append_some_prs_data(&outgoing_pdu, &p->out_data.rdata, p->out_data.data_sent_length, data_len)) {
+ if(!prs_append_some_prs_data(&p->out_data.frag, &p->out_data.rdata,
+ p->out_data.data_sent_length, data_len)) {
DEBUG(0,("create_next_pdu_noauth: failed to copy %u bytes of data.\n", (unsigned int)data_len));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
@@ -559,10 +561,8 @@ static bool create_next_pdu_noauth(pipes_struct *p)
*/
p->out_data.data_sent_length += data_len;
- p->out_data.current_pdu_len = p->hdr.frag_len;
p->out_data.current_pdu_sent = 0;
- prs_mem_free(&outgoing_pdu);
return True;
}
@@ -778,7 +778,6 @@ bool api_pipe_bind_auth3(pipes_struct *p, prs_struct *rpc_in_p)
static bool setup_bind_nak(pipes_struct *p)
{
- prs_struct outgoing_rpc;
RPC_HDR nak_hdr;
uint16 zero = 0;
@@ -791,8 +790,7 @@ static bool setup_bind_nak(pipes_struct *p)
* header and are never sending more than one PDU here.
*/
- prs_init_empty( &outgoing_rpc, p->mem_ctx, MARSHALL);
- prs_give_memory( &outgoing_rpc, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
+ prs_init_empty(&p->out_data.frag, p->mem_ctx, MARSHALL);
/*
* Initialize a bind_nak header.
@@ -805,9 +803,9 @@ static bool setup_bind_nak(pipes_struct *p)
* Marshall the header into the outgoing PDU.
*/
- if(!smb_io_rpc_hdr("", &nak_hdr, &outgoing_rpc, 0)) {
+ if(!smb_io_rpc_hdr("", &nak_hdr, &p->out_data.frag, 0)) {
DEBUG(0,("setup_bind_nak: marshalling of RPC_HDR failed.\n"));
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
return False;
}
@@ -815,13 +813,12 @@ static bool setup_bind_nak(pipes_struct *p)
* Now add the reject reason.
*/
- if(!prs_uint16("reject code", &outgoing_rpc, 0, &zero)) {
- prs_mem_free(&outgoing_rpc);
+ if(!prs_uint16("reject code", &p->out_data.frag, 0, &zero)) {
+ prs_mem_free(&p->out_data.frag);
return False;
}
p->out_data.data_sent_length = 0;
- p->out_data.current_pdu_len = prs_offset(&outgoing_rpc);
p->out_data.current_pdu_sent = 0;
if (p->auth.auth_data_free_func) {
@@ -840,7 +837,6 @@ static bool setup_bind_nak(pipes_struct *p)
bool setup_fault_pdu(pipes_struct *p, NTSTATUS status)
{
- prs_struct outgoing_pdu;
RPC_HDR fault_hdr;
RPC_HDR_RESP hdr_resp;
RPC_HDR_FAULT fault_resp;
@@ -854,8 +850,7 @@ bool setup_fault_pdu(pipes_struct *p, NTSTATUS status)
* header and are never sending more than one PDU here.
*/
- prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
- prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
+ prs_init_empty(&p->out_data.frag, p->mem_ctx, MARSHALL);
/*
* Initialize a fault header.
@@ -877,29 +872,27 @@ bool setup_fault_pdu(pipes_struct *p, NTSTATUS status)
* Marshall the header into the outgoing PDU.
*/
- if(!smb_io_rpc_hdr("", &fault_hdr, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr("", &fault_hdr, &p->out_data.frag, 0)) {
DEBUG(0,("setup_fault_pdu: marshalling of RPC_HDR failed.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
- if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr_resp("resp", &hdr_resp, &p->out_data.frag, 0)) {
DEBUG(0,("setup_fault_pdu: failed to marshall RPC_HDR_RESP.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
- if(!smb_io_rpc_hdr_fault("fault", &fault_resp, &outgoing_pdu, 0)) {
+ if(!smb_io_rpc_hdr_fault("fault", &fault_resp, &p->out_data.frag, 0)) {
DEBUG(0,("setup_fault_pdu: failed to marshall RPC_HDR_FAULT.\n"));
- prs_mem_free(&outgoing_pdu);
+ prs_mem_free(&p->out_data.frag);
return False;
}
p->out_data.data_sent_length = 0;
- p->out_data.current_pdu_len = prs_offset(&outgoing_pdu);
p->out_data.current_pdu_sent = 0;
- prs_mem_free(&outgoing_pdu);
return True;
}
@@ -1525,7 +1518,6 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
fstring ack_pipe_name;
prs_struct out_hdr_ba;
prs_struct out_auth;
- prs_struct outgoing_rpc;
int i = 0;
int auth_len = 0;
unsigned int auth_type = RPC_ANONYMOUS_AUTH_TYPE;
@@ -1537,7 +1529,7 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
return setup_bind_nak(p);
}
- prs_init_empty( &outgoing_rpc, p->mem_ctx, MARSHALL);
+ prs_init_empty(&p->out_data.frag, p->mem_ctx, MARSHALL);
/*
* Marshall directly into the outgoing PDU space. We
@@ -1545,8 +1537,6 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
* header and are never sending more than one PDU here.
*/
- prs_give_memory( &outgoing_rpc, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
-
/*
* Setup the memory to marshall the ba header, and the
* auth footers.
@@ -1554,13 +1544,13 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
if(!prs_init(&out_hdr_ba, 1024, p->mem_ctx, MARSHALL)) {
DEBUG(0,("api_pipe_bind_req: malloc out_hdr_ba failed.\n"));
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
return False;
}
if(!prs_init(&out_auth, 1024, p->mem_ctx, MARSHALL)) {
DEBUG(0,("api_pipe_bind_req: malloc out_auth failed.\n"));
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
prs_mem_free(&out_hdr_ba);
return False;
}
@@ -1606,7 +1596,7 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
if (NT_STATUS_IS_ERR(status)) {
DEBUG(3,("api_pipe_bind_req: Unknown pipe name %s in bind request.\n",
get_pipe_name_from_iface(&hdr_rb.rpc_context[0].abstract)));
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
prs_mem_free(&out_hdr_ba);
prs_mem_free(&out_auth);
@@ -1764,7 +1754,7 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
* Marshall the header into the outgoing PDU.
*/
- if(!smb_io_rpc_hdr("", &p->hdr, &outgoing_rpc, 0)) {
+ if(!smb_io_rpc_hdr("", &p->hdr, &p->out_data.frag, 0)) {
DEBUG(0,("api_pipe_bind_req: marshalling of RPC_HDR failed.\n"));
goto err_exit;
}
@@ -1773,12 +1763,12 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
* Now add the RPC_HDR_BA and any auth needed.
*/
- if(!prs_append_prs_data( &outgoing_rpc, &out_hdr_ba)) {
+ if(!prs_append_prs_data(&p->out_data.frag, &out_hdr_ba)) {
DEBUG(0,("api_pipe_bind_req: append of RPC_HDR_BA failed.\n"));
goto err_exit;
}
- if (auth_len && !prs_append_prs_data( &outgoing_rpc, &out_auth)) {
+ if (auth_len && !prs_append_prs_data( &p->out_data.frag, &out_auth)) {
DEBUG(0,("api_pipe_bind_req: append of auth info failed.\n"));
goto err_exit;
}
@@ -1788,7 +1778,6 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
*/
p->out_data.data_sent_length = 0;
- p->out_data.current_pdu_len = prs_offset(&outgoing_rpc);
p->out_data.current_pdu_sent = 0;
prs_mem_free(&out_hdr_ba);
@@ -1798,7 +1787,7 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
err_exit:
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
prs_mem_free(&out_hdr_ba);
prs_mem_free(&out_auth);
return setup_bind_nak(p);
@@ -1818,10 +1807,9 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
fstring ack_pipe_name;
prs_struct out_hdr_ba;
prs_struct out_auth;
- prs_struct outgoing_rpc;
int auth_len = 0;
- prs_init_empty( &outgoing_rpc, p->mem_ctx, MARSHALL);
+ prs_init_empty(&p->out_data.frag, p->mem_ctx, MARSHALL);
/*
* Marshall directly into the outgoing PDU space. We
@@ -1829,8 +1817,6 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
* header and are never sending more than one PDU here.
*/
- prs_give_memory( &outgoing_rpc, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
-
/*
* Setup the memory to marshall the ba header, and the
* auth footers.
@@ -1838,13 +1824,13 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
if(!prs_init(&out_hdr_ba, 1024, p->mem_ctx, MARSHALL)) {
DEBUG(0,("api_pipe_alter_context: malloc out_hdr_ba failed.\n"));
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
return False;
}
if(!prs_init(&out_auth, 1024, p->mem_ctx, MARSHALL)) {
DEBUG(0,("api_pipe_alter_context: malloc out_auth failed.\n"));
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
prs_mem_free(&out_hdr_ba);
return False;
}
@@ -1958,7 +1944,7 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
* Marshall the header into the outgoing PDU.
*/
- if(!smb_io_rpc_hdr("", &p->hdr, &outgoing_rpc, 0)) {
+ if(!smb_io_rpc_hdr("", &p->hdr, &p->out_data.frag, 0)) {
DEBUG(0,("api_pipe_alter_context: marshalling of RPC_HDR failed.\n"));
goto err_exit;
}
@@ -1967,12 +1953,12 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
* Now add the RPC_HDR_BA and any auth needed.
*/
- if(!prs_append_prs_data( &outgoing_rpc, &out_hdr_ba)) {
+ if(!prs_append_prs_data(&p->out_data.frag, &out_hdr_ba)) {
DEBUG(0,("api_pipe_alter_context: append of RPC_HDR_BA failed.\n"));
goto err_exit;
}
- if (auth_len && !prs_append_prs_data( &outgoing_rpc, &out_auth)) {
+ if (auth_len && !prs_append_prs_data(&p->out_data.frag, &out_auth)) {
DEBUG(0,("api_pipe_alter_context: append of auth info failed.\n"));
goto err_exit;
}
@@ -1982,7 +1968,6 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
*/
p->out_data.data_sent_length = 0;
- p->out_data.current_pdu_len = prs_offset(&outgoing_rpc);
p->out_data.current_pdu_sent = 0;
prs_mem_free(&out_hdr_ba);
@@ -1992,7 +1977,7 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
err_exit:
- prs_mem_free(&outgoing_rpc);
+ prs_mem_free(&p->out_data.frag);
prs_mem_free(&out_hdr_ba);
prs_mem_free(&out_auth);
return setup_bind_nak(p);
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 4cbe8d67a3..6dfe7a0911 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -65,10 +65,9 @@ static bool pipe_init_outgoing_data(pipes_struct *p)
/* Reset the offset counters. */
o_data->data_sent_length = 0;
- o_data->current_pdu_len = 0;
o_data->current_pdu_sent = 0;
- memset(o_data->current_pdu, '\0', sizeof(o_data->current_pdu));
+ prs_mem_free(&o_data->frag);
/* Free any memory in the current return data buffer. */
prs_mem_free(&o_data->rdata);
@@ -77,7 +76,7 @@ static bool pipe_init_outgoing_data(pipes_struct *p)
* Initialize the outgoing RPC data buffer.
* we will use this as the raw data area for replying to rpc requests.
*/
- if(!prs_init(&o_data->rdata, RPC_MAX_PDU_FRAG_LEN, p->mem_ctx, MARSHALL)) {
+ if(!prs_init(&o_data->rdata, 128, p->mem_ctx, MARSHALL)) {
DEBUG(0,("pipe_init_outgoing_data: malloc fail.\n"));
return False;
}
@@ -128,7 +127,7 @@ static struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
* change the type to UNMARSALLING before processing the stream.
*/
- if(!prs_init(&p->in_data.data, RPC_MAX_PDU_FRAG_LEN, p->mem_ctx, MARSHALL)) {
+ if(!prs_init(&p->in_data.data, 128, p->mem_ctx, MARSHALL)) {
DEBUG(0,("open_rpc_pipe_p: malloc fail for in_data struct.\n"));
talloc_destroy(p->mem_ctx);
close_policy_by_pipe(p);
@@ -192,6 +191,15 @@ static ssize_t fill_rpc_header(pipes_struct *p, char *data, size_t data_to_copy)
(unsigned int)data_to_copy, (unsigned int)len_needed_to_complete_hdr,
(unsigned int)p->in_data.pdu_received_len ));
+ if (p->in_data.current_in_pdu == NULL) {
+ p->in_data.current_in_pdu = talloc_array(p, uint8_t,
+ RPC_HEADER_LEN);
+ }
+ if (p->in_data.current_in_pdu == NULL) {
+ DEBUG(0, ("talloc failed\n"));
+ return -1;
+ }
+
memcpy((char *)&p->in_data.current_in_pdu[p->in_data.pdu_received_len], data, len_needed_to_complete_hdr);
p->in_data.pdu_received_len += len_needed_to_complete_hdr;
@@ -312,6 +320,14 @@ static ssize_t unmarshall_rpc_header(pipes_struct *p)
prs_mem_free(&rpc_in);
+ p->in_data.current_in_pdu = TALLOC_REALLOC_ARRAY(
+ p, p->in_data.current_in_pdu, uint8_t, p->hdr.frag_len);
+ if (p->in_data.current_in_pdu == NULL) {
+ DEBUG(0, ("talloc failed\n"));
+ set_incoming_fault(p);
+ return -1;
+ }
+
return 0; /* No extra data processed. */
}
@@ -635,6 +651,7 @@ static void process_complete_pdu(pipes_struct *p)
/*
* Reset the lengths. We're ready for a new pdu.
*/
+ TALLOC_FREE(p->in_data.current_in_pdu);
p->in_data.pdu_needed_len = 0;
p->in_data.pdu_received_len = 0;
}
@@ -811,17 +828,24 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_
* PDU.
*/
- if((pdu_remaining = p->out_data.current_pdu_len - p->out_data.current_pdu_sent) > 0) {
+ pdu_remaining = prs_offset(&p->out_data.frag)
+ - p->out_data.current_pdu_sent;
+
+ if (pdu_remaining > 0) {
data_returned = (ssize_t)MIN(n, pdu_remaining);
DEBUG(10,("read_from_pipe: %s: current_pdu_len = %u, "
"current_pdu_sent = %u returning %d bytes.\n",
get_pipe_name_from_iface(&p->syntax),
- (unsigned int)p->out_data.current_pdu_len,
+ (unsigned int)prs_offset(&p->out_data.frag),
(unsigned int)p->out_data.current_pdu_sent,
(int)data_returned));
- memcpy( data, &p->out_data.current_pdu[p->out_data.current_pdu_sent], (size_t)data_returned);
+ memcpy(data,
+ prs_data_p(&p->out_data.frag)
+ + p->out_data.current_pdu_sent,
+ data_returned);
+
p->out_data.current_pdu_sent += (uint32)data_returned;
goto out;
}
@@ -858,14 +882,14 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_
return -1;
}
- data_returned = MIN(n, p->out_data.current_pdu_len);
+ data_returned = MIN(n, prs_offset(&p->out_data.frag));
- memcpy( data, p->out_data.current_pdu, (size_t)data_returned);
+ memcpy( data, prs_data_p(&p->out_data.frag), (size_t)data_returned);
p->out_data.current_pdu_sent += (uint32)data_returned;
out:
+ (*is_data_outstanding) = prs_offset(&p->out_data.frag) > n;
- (*is_data_outstanding) = p->out_data.current_pdu_len > n;
return data_returned;
}
@@ -880,6 +904,7 @@ static int close_internal_rpc_pipe_hnd(struct pipes_struct *p)
return False;
}
+ prs_mem_free(&p->out_data.frag);
prs_mem_free(&p->out_data.rdata);
prs_mem_free(&p->in_data.data);
@@ -1195,11 +1220,12 @@ static void np_write_done(struct async_req *subreq)
{
struct async_req *req = talloc_get_type_abort(
subreq->async.priv, struct async_req);
- NTSTATUS status;
+ int err;
+ ssize_t ret;
- status = sendall_recv(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ ret = sendall_recv(subreq, &err);
+ if (ret < 0) {
+ async_req_nterror(req, map_nt_error_from_unix(err));
return;
}
async_req_done(req);
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 5f616ecd19..0b8cb35a84 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1173,9 +1173,7 @@ NTSTATUS _samr_EnumDomainGroups(pipes_struct *p,
*r->out.sam = samr_array;
*r->out.num_entries = num_groups;
- /* this was missing, IMHO:
*r->out.resume_handle = num_groups + *r->in.resume_handle;
- */
DEBUG(5,("_samr_EnumDomainGroups: %d\n", __LINE__));
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index d3045028bf..bf11bc6914 100644
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -27,6 +27,27 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
+/*******************************************************************
+ ********************************************************************/
+
+static bool proxy_spoolss_call(pipes_struct *p, uint8_t opnum)
+{
+ struct api_struct *fns;
+ int n_fns;
+
+ spoolss_get_pipe_fns(&fns, &n_fns);
+
+ if (opnum >= n_fns) {
+ return false;
+ }
+
+ if (fns[opnum].opnum != opnum) {
+ smb_panic("SPOOLSS function table not sorted");
+ }
+
+ return fns[opnum].fn(p);
+}
+
/********************************************************************
* api_spoolss_open_printer_ex (rarely seen - older call)
********************************************************************/
@@ -126,28 +147,7 @@ static bool api_spoolss_getprinterdata(pipes_struct *p)
static bool api_spoolss_deleteprinterdata(pipes_struct *p)
{
- SPOOL_Q_DELETEPRINTERDATA q_u;
- SPOOL_R_DELETEPRINTERDATA r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* read the stream and fill the struct */
- if (!spoolss_io_q_deleteprinterdata("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteprinterdata: unable to unmarshall SPOOL_Q_DELETEPRINTERDATA.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteprinterdata( p, &q_u, &r_u );
-
- if (!spoolss_io_r_deleteprinterdata("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_deleteprinterdata: unable to marshall SPOOL_R_DELETEPRINTERDATA.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDATA);
}
/********************************************************************
@@ -158,27 +158,7 @@ static bool api_spoolss_deleteprinterdata(pipes_struct *p)
static bool api_spoolss_closeprinter(pipes_struct *p)
{
- SPOOL_Q_CLOSEPRINTER q_u;
- SPOOL_R_CLOSEPRINTER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if (!spoolss_io_q_closeprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_closeprinter: unable to unmarshall SPOOL_Q_CLOSEPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_closeprinter(p, &q_u, &r_u);
-
- if (!spoolss_io_r_closeprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_closeprinter: unable to marshall SPOOL_R_CLOSEPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_CLOSEPRINTER);
}
/********************************************************************
@@ -189,27 +169,7 @@ static bool api_spoolss_closeprinter(pipes_struct *p)
static bool api_spoolss_abortprinter(pipes_struct *p)
{
- SPOOL_Q_ABORTPRINTER q_u;
- SPOOL_R_ABORTPRINTER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if (!spoolss_io_q_abortprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_abortprinter: unable to unmarshall SPOOL_Q_ABORTPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_abortprinter(p, &q_u, &r_u);
-
- if (!spoolss_io_r_abortprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_abortprinter: unable to marshall SPOOL_R_ABORTPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_ABORTPRINTER);
}
/********************************************************************
@@ -220,30 +180,9 @@ static bool api_spoolss_abortprinter(pipes_struct *p)
static bool api_spoolss_deleteprinter(pipes_struct *p)
{
- SPOOL_Q_DELETEPRINTER q_u;
- SPOOL_R_DELETEPRINTER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if (!spoolss_io_q_deleteprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteprinter: unable to unmarshall SPOOL_Q_DELETEPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteprinter(p, &q_u, &r_u);
-
- if (!spoolss_io_r_deleteprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_deleteprinter: unable to marshall SPOOL_R_DELETEPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTER);
}
-
/********************************************************************
* api_spoolss_deleteprinterdriver
*
@@ -252,27 +191,7 @@ static bool api_spoolss_deleteprinter(pipes_struct *p)
static bool api_spoolss_deleteprinterdriver(pipes_struct *p)
{
- SPOOL_Q_DELETEPRINTERDRIVER q_u;
- SPOOL_R_DELETEPRINTERDRIVER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if (!spoolss_io_q_deleteprinterdriver("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteprinterdriver: unable to unmarshall SPOOL_Q_DELETEPRINTERDRIVER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteprinterdriver(p, &q_u, &r_u);
-
- if (!spoolss_io_r_deleteprinterdriver("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_deleteprinter: unable to marshall SPOOL_R_DELETEPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDRIVER);
}
@@ -448,27 +367,7 @@ static bool api_spoolss_getprinterdriver2(pipes_struct *p)
static bool api_spoolss_startpageprinter(pipes_struct *p)
{
- SPOOL_Q_STARTPAGEPRINTER q_u;
- SPOOL_R_STARTPAGEPRINTER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_startpageprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_startpageprinter: unable to unmarshall SPOOL_Q_STARTPAGEPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_startpageprinter(p, &q_u, &r_u);
-
- if(!spoolss_io_r_startpageprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_startpageprinter: unable to marshall SPOOL_R_STARTPAGEPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_STARTPAGEPRINTER);
}
/********************************************************************
@@ -479,27 +378,7 @@ static bool api_spoolss_startpageprinter(pipes_struct *p)
static bool api_spoolss_endpageprinter(pipes_struct *p)
{
- SPOOL_Q_ENDPAGEPRINTER q_u;
- SPOOL_R_ENDPAGEPRINTER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_endpageprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_endpageprinter: unable to unmarshall SPOOL_Q_ENDPAGEPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_endpageprinter(p, &q_u, &r_u);
-
- if(!spoolss_io_r_endpageprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_endpageprinter: unable to marshall SPOOL_R_ENDPAGEPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_ENDPAGEPRINTER);
}
/********************************************************************
@@ -535,27 +414,7 @@ static bool api_spoolss_startdocprinter(pipes_struct *p)
static bool api_spoolss_enddocprinter(pipes_struct *p)
{
- SPOOL_Q_ENDDOCPRINTER q_u;
- SPOOL_R_ENDDOCPRINTER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_enddocprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_enddocprinter: unable to unmarshall SPOOL_Q_ENDDOCPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_enddocprinter(p, &q_u, &r_u);
-
- if(!spoolss_io_r_enddocprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_enddocprinter: unable to marshall SPOOL_R_ENDDOCPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_ENDDOCPRINTER);
}
/********************************************************************
@@ -563,27 +422,7 @@ static bool api_spoolss_enddocprinter(pipes_struct *p)
static bool api_spoolss_writeprinter(pipes_struct *p)
{
- SPOOL_Q_WRITEPRINTER q_u;
- SPOOL_R_WRITEPRINTER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_writeprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_writeprinter: unable to unmarshall SPOOL_Q_WRITEPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_writeprinter(p, &q_u, &r_u);
-
- if(!spoolss_io_r_writeprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_writeprinter: unable to marshall SPOOL_R_WRITEPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_WRITEPRINTER);
}
/****************************************************************************
@@ -620,27 +459,7 @@ static bool api_spoolss_setprinter(pipes_struct *p)
static bool api_spoolss_fcpn(pipes_struct *p)
{
- SPOOL_Q_FCPN q_u;
- SPOOL_R_FCPN r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_fcpn("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_fcpn: unable to unmarshall SPOOL_Q_FCPN.\n"));
- return False;
- }
-
- r_u.status = _spoolss_fcpn(p, &q_u, &r_u);
-
- if(!spoolss_io_r_fcpn("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_fcpn: unable to marshall SPOOL_R_FCPN.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY);
}
/****************************************************************************
@@ -788,27 +607,7 @@ static bool api_spoolss_enumprinterdrivers(pipes_struct *p)
static bool api_spoolss_getform(pipes_struct *p)
{
- SPOOL_Q_GETFORM q_u;
- SPOOL_R_GETFORM r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if (!spoolss_io_q_getform("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_getform: unable to unmarshall SPOOL_Q_GETFORM.\n"));
- return False;
- }
-
- r_u.status = _spoolss_getform(p, &q_u, &r_u);
-
- if (!spoolss_io_r_getform("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_getform: unable to marshall SPOOL_R_GETFORM.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_GETFORM);
}
/****************************************************************************
@@ -1047,27 +846,7 @@ static bool api_spoolss_reset_printer(pipes_struct *p)
****************************************************************************/
static bool api_spoolss_addform(pipes_struct *p)
{
- SPOOL_Q_ADDFORM q_u;
- SPOOL_R_ADDFORM r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_addform("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_addform: unable to unmarshall SPOOL_Q_ADDFORM.\n"));
- return False;
- }
-
- r_u.status = _spoolss_addform(p, &q_u, &r_u);
-
- if(!spoolss_io_r_addform("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_addform: unable to marshall SPOOL_R_ADDFORM.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_ADDFORM);
}
/****************************************************************************
@@ -1075,27 +854,7 @@ static bool api_spoolss_addform(pipes_struct *p)
static bool api_spoolss_deleteform(pipes_struct *p)
{
- SPOOL_Q_DELETEFORM q_u;
- SPOOL_R_DELETEFORM r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_deleteform("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteform: unable to unmarshall SPOOL_Q_DELETEFORM.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteform(p, &q_u, &r_u);
-
- if(!spoolss_io_r_deleteform("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_deleteform: unable to marshall SPOOL_R_DELETEFORM.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEFORM);
}
/****************************************************************************
@@ -1103,27 +862,7 @@ static bool api_spoolss_deleteform(pipes_struct *p)
static bool api_spoolss_setform(pipes_struct *p)
{
- SPOOL_Q_SETFORM q_u;
- SPOOL_R_SETFORM r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_setform("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_setform: unable to unmarshall SPOOL_Q_SETFORM.\n"));
- return False;
- }
-
- r_u.status = _spoolss_setform(p, &q_u, &r_u);
-
- if(!spoolss_io_r_setform("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_setform: unable to marshall SPOOL_R_SETFORM.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_SETFORM);
}
/****************************************************************************
@@ -1420,27 +1159,7 @@ static bool api_spoolss_getprintprocessordirectory(pipes_struct *p)
static bool api_spoolss_deleteprinterdataex(pipes_struct *p)
{
- SPOOL_Q_DELETEPRINTERDATAEX q_u;
- SPOOL_R_DELETEPRINTERDATAEX r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_deleteprinterdataex("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteprinterdataex: unable to unmarshall SPOOL_Q_DELETEPRINTERDATAEX.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteprinterdataex(p, &q_u, &r_u);
-
- if(!spoolss_io_r_deleteprinterdataex("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_deleteprinterdataex: unable to marshall SPOOL_R_DELETEPRINTERDATAEX.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDATAEX);
}
/****************************************************************************
@@ -1448,27 +1167,7 @@ static bool api_spoolss_deleteprinterdataex(pipes_struct *p)
static bool api_spoolss_deleteprinterkey(pipes_struct *p)
{
- SPOOL_Q_DELETEPRINTERKEY q_u;
- SPOOL_R_DELETEPRINTERKEY r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_deleteprinterkey("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteprinterkey: unable to unmarshall SPOOL_Q_DELETEPRINTERKEY.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteprinterkey(p, &q_u, &r_u);
-
- if(!spoolss_io_r_deleteprinterkey("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_deleteprinterkey: unable to marshall SPOOL_R_DELETEPRINTERKEY.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERKEY);
}
/****************************************************************************
@@ -1513,27 +1212,7 @@ static bool api_spoolss_addprinterdriverex(pipes_struct *p)
static bool api_spoolss_deleteprinterdriverex(pipes_struct *p)
{
- SPOOL_Q_DELETEPRINTERDRIVEREX q_u;
- SPOOL_R_DELETEPRINTERDRIVEREX r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!spoolss_io_q_deleteprinterdriverex("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteprinterdriverex: unable to unmarshall SPOOL_Q_DELETEPRINTERDRIVEREX.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteprinterdriverex(p, &q_u, &r_u);
-
- if(!spoolss_io_r_deleteprinterdriverex("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_deleteprinterdriverex: unable to marshall SPOOL_R_DELETEPRINTERDRIVEREX.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDRIVEREX);
}
/****************************************************************************
@@ -1624,35 +1303,13 @@ static bool api_spoolss_xcvdataport(pipes_struct *p)
{"SPOOLSS_XCVDATAPORT", SPOOLSS_XCVDATAPORT, api_spoolss_xcvdataport },
};
-void spoolss_get_pipe_fns( struct api_struct **fns, int *n_fns )
+void spoolss2_get_pipe_fns( struct api_struct **fns, int *n_fns )
{
*fns = api_spoolss_cmds;
*n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
}
-static const char * const spoolss_endpoint_strings[] = {
- "ncacn_np:[\\pipe\\spoolss]",
-};
-
-static const struct ndr_interface_string_array spoolss_endpoints = {
- .count = 1,
- .names = spoolss_endpoint_strings
-};
-
-const struct ndr_interface_table ndr_table_spoolss = {
- .name = "spoolss",
- .syntax_id = {
- { 0x12345678, 0x1234, 0xabcd, { 0xef, 0x00 },
- { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab } }, 0x01
- },
- .helpstring = "Spooler SubSystem",
- .num_calls = 0x60,
- .calls = NULL, /* unused in s3 so far */
- .endpoints = &spoolss_endpoints,
- .authservices = NULL /* unused in s3 so far */
-};
-
-NTSTATUS rpc_spoolss_init(void)
+NTSTATUS rpc_spoolss2_init(void)
{
return rpc_srv_register(
SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss",
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index e61d343731..31ab2ca43d 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1913,13 +1913,14 @@ static WERROR _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handl
return WERR_OK;
}
-/********************************************************************
- * api_spoolss_closeprinter
- ********************************************************************/
+/****************************************************************
+ _spoolss_ClosePrinter
+****************************************************************/
-WERROR _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u)
+WERROR _spoolss_ClosePrinter(pipes_struct *p,
+ struct spoolss_ClosePrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
+ POLICY_HND *handle = r->in.handle;
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
@@ -1934,27 +1935,25 @@ WERROR _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R
Previous code just copied the value of the closed
handle. --jerry */
- memset(&r_u->handle, '\0', sizeof(r_u->handle));
+ ZERO_STRUCTP(r->out.handle);
return WERR_OK;
}
-/********************************************************************
- * api_spoolss_deleteprinter
+/****************************************************************
+ _spoolss_DeletePrinter
+****************************************************************/
- ********************************************************************/
-
-WERROR _spoolss_deleteprinter(pipes_struct *p, SPOOL_Q_DELETEPRINTER *q_u, SPOOL_R_DELETEPRINTER *r_u)
+WERROR _spoolss_DeletePrinter(pipes_struct *p,
+ struct spoolss_DeletePrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
+ POLICY_HND *handle = r->in.handle;
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
WERROR result;
if (Printer && Printer->document_started)
_spoolss_enddocprinter_internal(p, handle); /* print job was not closed */
- memcpy(&r_u->handle, &q_u->handle, sizeof(r_u->handle));
-
result = delete_printer_handle(p, handle);
update_c_setprinter(False);
@@ -1991,14 +1990,15 @@ static int get_version_id (char * arch)
return -1;
}
-/********************************************************************
- * _spoolss_deleteprinterdriver
- ********************************************************************/
+/****************************************************************
+ _spoolss_DeletePrinterDriver
+****************************************************************/
-WERROR _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER *q_u, SPOOL_R_DELETEPRINTERDRIVER *r_u)
+WERROR _spoolss_DeletePrinterDriver(pipes_struct *p,
+ struct spoolss_DeletePrinterDriver *r)
{
- fstring driver;
- fstring arch;
+ char *driver;
+ char *arch;
NT_PRINTER_DRIVER_INFO_LEVEL info;
NT_PRINTER_DRIVER_INFO_LEVEL info_win2k;
int version;
@@ -2019,9 +2019,6 @@ WERROR _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER
return WERR_ACCESS_DENIED;
}
- unistr2_to_ascii(driver, &q_u->driver, sizeof(driver));
- unistr2_to_ascii(arch, &q_u->arch, sizeof(arch));
-
/* check that we have a valid driver name first */
if ((version=get_version_id(arch)) == -1)
@@ -2030,6 +2027,9 @@ WERROR _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER
ZERO_STRUCT(info);
ZERO_STRUCT(info_win2k);
+ driver = CONST_DISCARD(char *, r->in.driver);
+ arch = CONST_DISCARD(char *, r->in.architecture);
+
if (!W_ERROR_IS_OK(get_a_printer_driver(&info, 3, driver, arch, version)))
{
/* try for Win2k driver if "Windows NT x86" */
@@ -2087,18 +2087,19 @@ done:
return status;
}
-/********************************************************************
- * spoolss_deleteprinterdriverex
- ********************************************************************/
+/****************************************************************
+ _spoolss_DeletePrinterDriverEx
+****************************************************************/
-WERROR _spoolss_deleteprinterdriverex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVEREX *q_u, SPOOL_R_DELETEPRINTERDRIVEREX *r_u)
+WERROR _spoolss_DeletePrinterDriverEx(pipes_struct *p,
+ struct spoolss_DeletePrinterDriverEx *r)
{
- fstring driver;
- fstring arch;
+ char *driver;
+ char *arch;
NT_PRINTER_DRIVER_INFO_LEVEL info;
NT_PRINTER_DRIVER_INFO_LEVEL info_win2k;
int version;
- uint32 flags = q_u->delete_flags;
+ uint32_t flags = r->in.delete_flags;
bool delete_files;
WERROR status;
WERROR status_win2k = WERR_ACCESS_DENIED;
@@ -2116,8 +2117,8 @@ WERROR _spoolss_deleteprinterdriverex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIV
return WERR_ACCESS_DENIED;
}
- unistr2_to_ascii(driver, &q_u->driver, sizeof(driver));
- unistr2_to_ascii(arch, &q_u->arch, sizeof(arch));
+ driver = CONST_DISCARD(char *, r->in.driver);
+ arch = CONST_DISCARD(char *, r->in.architecture);
/* check that we have a valid driver name first */
if ((version=get_version_id(arch)) == -1) {
@@ -2126,7 +2127,7 @@ WERROR _spoolss_deleteprinterdriverex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIV
}
if ( flags & DPD_DELETE_SPECIFIC_VERSION )
- version = q_u->version;
+ version = r->in.version;
ZERO_STRUCT(info);
ZERO_STRUCT(info_win2k);
@@ -4562,7 +4563,7 @@ static WERROR enum_all_printers_info_1_network(fstring name, RPC_BUFFER *buffer,
if (is_myname_or_ipaddr(s))
return WERR_CAN_NOT_COMPLETE;
- return enum_all_printers_info_1(PRINTER_ENUM_UNKNOWN_8, buffer, offered, needed, returned);
+ return enum_all_printers_info_1(PRINTER_ENUM_NAME, buffer, offered, needed, returned);
}
/********************************************************************
@@ -5780,17 +5781,21 @@ WERROR _spoolss_getprinterdriver2(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVER2 *q_
return WERR_UNKNOWN_LEVEL;
}
-/****************************************************************************
-****************************************************************************/
-WERROR _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u, SPOOL_R_STARTPAGEPRINTER *r_u)
+/****************************************************************
+ _spoolss_StartPagePrinter
+****************************************************************/
+
+WERROR _spoolss_StartPagePrinter(pipes_struct *p,
+ struct spoolss_StartPagePrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
+ POLICY_HND *handle = r->in.handle;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
if (!Printer) {
- DEBUG(3,("Error in startpageprinter printer handle\n"));
+ DEBUG(3,("_spoolss_StartPagePrinter: "
+ "Error in startpageprinter printer handle\n"));
return WERR_BADFID;
}
@@ -5798,18 +5803,21 @@ WERROR _spoolss_startpageprinter(pipes_struct *p, SPOOL_Q_STARTPAGEPRINTER *q_u,
return WERR_OK;
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_EndPagePrinter
+****************************************************************/
-WERROR _spoolss_endpageprinter(pipes_struct *p, SPOOL_Q_ENDPAGEPRINTER *q_u, SPOOL_R_ENDPAGEPRINTER *r_u)
+WERROR _spoolss_EndPagePrinter(pipes_struct *p,
+ struct spoolss_EndPagePrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
+ POLICY_HND *handle = r->in.handle;
int snum;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
if (!Printer) {
- DEBUG(2,("_spoolss_endpageprinter: Invalid handle (%s:%u:%u).\n",OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_EndPagePrinter: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -5884,34 +5892,36 @@ WERROR _spoolss_startdocprinter(pipes_struct *p, SPOOL_Q_STARTDOCPRINTER *q_u, S
return WERR_OK;
}
-/********************************************************************
- * api_spoolss_getprinter
- * called from the spoolss dispatcher
- *
- ********************************************************************/
+/****************************************************************
+ _spoolss_EndDocPrinter
+****************************************************************/
-WERROR _spoolss_enddocprinter(pipes_struct *p, SPOOL_Q_ENDDOCPRINTER *q_u, SPOOL_R_ENDDOCPRINTER *r_u)
+WERROR _spoolss_EndDocPrinter(pipes_struct *p,
+ struct spoolss_EndDocPrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
+ POLICY_HND *handle = r->in.handle;
return _spoolss_enddocprinter_internal(p, handle);
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_WritePrinter
+****************************************************************/
-WERROR _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u)
+WERROR _spoolss_WritePrinter(pipes_struct *p,
+ struct spoolss_WritePrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
- uint32 buffer_size = q_u->buffer_size;
- uint8 *buffer = q_u->buffer;
- uint32 *buffer_written = &q_u->buffer_size2;
+ POLICY_HND *handle = r->in.handle;
+ uint32 buffer_size = r->in._data_size;
+ uint8 *buffer = r->in.data.data;
+ uint32 *buffer_written = &r->in._data_size;
int snum;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
if (!Printer) {
- DEBUG(2,("_spoolss_writeprinter: Invalid handle (%s:%u:%u)\n",OUR_HANDLE(handle)));
- r_u->buffer_written = q_u->buffer_size2;
+ DEBUG(2,("_spoolss_WritePrinter: Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(handle)));
+ *r->out.num_written = r->in._data_size;
return WERR_BADFID;
}
@@ -5921,14 +5931,14 @@ WERROR _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R
(*buffer_written) = (uint32)print_job_write(snum, Printer->jobid, (const char *)buffer,
(SMB_OFF_T)-1, (size_t)buffer_size);
if (*buffer_written == (uint32)-1) {
- r_u->buffer_written = 0;
+ *r->out.num_written = 0;
if (errno == ENOSPC)
return WERR_NO_SPOOL_SPACE;
else
return WERR_ACCESS_DENIED;
}
- r_u->buffer_written = q_u->buffer_size2;
+ *r->out.num_written = r->in._data_size;
return WERR_OK;
}
@@ -5978,21 +5988,24 @@ static WERROR control_printer(POLICY_HND *handle, uint32 command,
return errcode;
}
-/********************************************************************
- * api_spoolss_abortprinter
+
+/****************************************************************
+ _spoolss_AbortPrinter
* From MSDN: "Deletes printer's spool file if printer is configured
* for spooling"
- ********************************************************************/
+****************************************************************/
-WERROR _spoolss_abortprinter(pipes_struct *p, SPOOL_Q_ABORTPRINTER *q_u, SPOOL_R_ABORTPRINTER *r_u)
+WERROR _spoolss_AbortPrinter(pipes_struct *p,
+ struct spoolss_AbortPrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
+ POLICY_HND *handle = r->in.handle;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
int snum;
WERROR errcode = WERR_OK;
if (!Printer) {
- DEBUG(2,("_spoolss_abortprinter: Invalid handle (%s:%u:%u)\n",OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_AbortPrinter: Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -6559,16 +6572,19 @@ WERROR _spoolss_setprinter(pipes_struct *p, SPOOL_Q_SETPRINTER *q_u, SPOOL_R_SET
}
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_FindClosePrinterNotify
+****************************************************************/
-WERROR _spoolss_fcpn(pipes_struct *p, SPOOL_Q_FCPN *q_u, SPOOL_R_FCPN *r_u)
+WERROR _spoolss_FindClosePrinterNotify(pipes_struct *p,
+ struct spoolss_FindClosePrinterNotify *r)
{
- POLICY_HND *handle = &q_u->handle;
+ POLICY_HND *handle = r->in.handle;
Printer_entry *Printer= find_printer_index_by_hnd(p, handle);
if (!Printer) {
- DEBUG(2,("_spoolss_fcpn: Invalid handle (%s:%u:%u)\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_FindClosePrinterNotify: "
+ "Invalid handle (%s:%u:%u)\n", OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -7237,6 +7253,27 @@ static void fill_form_1(FORM_1 *form, nt_forms_struct *list)
/****************************************************************************
****************************************************************************/
+static WERROR fill_form_info_1(TALLOC_CTX *mem_ctx,
+ struct spoolss_FormInfo1 *form,
+ nt_forms_struct *list)
+{
+ form->form_name = talloc_strdup(mem_ctx, list->name);
+ W_ERROR_HAVE_NO_MEMORY(form->form_name);
+
+ form->flags = list->flag;
+ form->size.width = list->width;
+ form->size.height = list->length;
+ form->area.left = list->left;
+ form->area.top = list->top;
+ form->area.right = list->right;
+ form->area.bottom = list->bottom;
+
+ return WERR_OK;
+}
+
+/****************************************************************************
+****************************************************************************/
+
WERROR _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMFORMS *r_u)
{
uint32 level = q_u->level;
@@ -7346,41 +7383,35 @@ WERROR _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMF
}
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_GetForm
+****************************************************************/
-WERROR _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *r_u)
+WERROR _spoolss_GetForm(pipes_struct *p,
+ struct spoolss_GetForm *r)
{
- uint32 level = q_u->level;
- UNISTR2 *uni_formname = &q_u->formname;
- RPC_BUFFER *buffer = NULL;
- uint32 offered = q_u->offered;
- uint32 *needed = &r_u->needed;
+ uint32 level = r->in.level;
+ uint32 offered = r->in.offered;
+ uint32 *needed = r->out.needed;
nt_forms_struct *list=NULL;
nt_forms_struct builtin_form;
bool foundBuiltin;
- FORM_1 form_1;
- fstring form_name;
- int buffer_size=0;
+ union spoolss_FormInfo info;
+ struct spoolss_FormInfo1 form_1;
int numofforms=0, i=0;
/* that's an [in out] buffer */
- if (!q_u->buffer && (offered!=0)) {
+ if (!r->in.buffer && (offered!=0)) {
return WERR_INVALID_PARAM;
}
- rpcbuf_move(q_u->buffer, &r_u->buffer);
- buffer = r_u->buffer;
-
- unistr2_to_ascii(form_name, uni_formname, sizeof(form_name));
-
- DEBUG(4,("_spoolss_getform\n"));
+ DEBUG(4,("_spoolss_GetForm\n"));
DEBUGADD(5,("Offered buffer size [%d]\n", offered));
DEBUGADD(5,("Info level [%d]\n", level));
- foundBuiltin = get_a_builtin_ntform(uni_formname,&builtin_form);
+ foundBuiltin = get_a_builtin_ntform_by_string(r->in.form_name, &builtin_form);
if (!foundBuiltin) {
numofforms = get_ntforms(&list);
DEBUGADD(5,("Number of forms [%d]\n", numofforms));
@@ -7392,17 +7423,19 @@ WERROR _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *
switch (level) {
case 1:
if (foundBuiltin) {
- fill_form_1(&form_1, &builtin_form);
+ fill_form_info_1(p->mem_ctx, &form_1, &builtin_form);
} else {
/* Check if the requested name is in the list of form structures */
for (i=0; i<numofforms; i++) {
- DEBUG(4,("_spoolss_getform: checking form %s (want %s)\n", list[i].name, form_name));
+ DEBUG(4,("_spoolss_GetForm: checking form %s (want %s)\n",
+ list[i].name, r->in.form_name));
- if (strequal(form_name, list[i].name)) {
- DEBUGADD(6,("Found form %s number [%d]\n", form_name, i));
- fill_form_1(&form_1, &list[i]);
+ if (strequal(r->in.form_name, list[i].name)) {
+ DEBUGADD(6,("Found form %s number [%d]\n",
+ r->in.form_name, i));
+ fill_form_info_1(p->mem_ctx, &form_1, &list[i]);
break;
}
}
@@ -7414,17 +7447,20 @@ WERROR _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *
}
/* check the required size. */
- *needed=spoolss_size_form_1(&form_1);
+ info.info1 = form_1;
- if (*needed > offered)
+ *needed = ndr_size_spoolss_FormInfo(&info, 1, NULL, 0);
+
+ if (*needed > offered) {
+ r->out.info = NULL;
return WERR_INSUFFICIENT_BUFFER;
+ }
- if (!rpcbuf_alloc_size(buffer, buffer_size))
- return WERR_NOMEM;
+ r->out.info->info1 = form_1;
/* fill the buffer with the form structures */
- DEBUGADD(6,("adding form %s [%d] to buffer\n", form_name, i));
- smb_io_form_1("", buffer, &form_1, 0);
+ DEBUGADD(6,("adding form %s [%d] to buffer\n",
+ r->in.form_name, i));
return WERR_OK;
@@ -7882,7 +7918,7 @@ WERROR _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u,
* server. Right now, we just need to send ourselves a message
* to update each printer bound to this driver. --jerry
*/
-
+
if (!srv_spoolss_drv_upgrade_printer(driver_name)) {
DEBUG(0,("_spoolss_addprinterdriver: Failed to send message about upgrading driver [%s]!\n",
driver_name));
@@ -8389,26 +8425,24 @@ WERROR _spoolss_resetprinter(pipes_struct *p, SPOOL_Q_RESETPRINTER *q_u, SPOOL_R
return WERR_OK;
}
+/****************************************************************
+ _spoolss_DeletePrinterData
+****************************************************************/
-/****************************************************************************
-****************************************************************************/
-
-WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_u, SPOOL_R_DELETEPRINTERDATA *r_u)
+WERROR _spoolss_DeletePrinterData(pipes_struct *p,
+ struct spoolss_DeletePrinterData *r)
{
- POLICY_HND *handle = &q_u->handle;
- UNISTR2 *value = &q_u->valuename;
-
+ POLICY_HND *handle = r->in.handle;
NT_PRINTER_INFO_LEVEL *printer = NULL;
int snum=0;
WERROR status = WERR_OK;
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
- char *valuename = NULL;
- TALLOC_CTX *ctx = p->mem_ctx;
- DEBUG(5,("spoolss_deleteprinterdata\n"));
+ DEBUG(5,("_spoolss_DeletePrinterData\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_deleteprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_DeletePrinterData: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -8416,7 +8450,8 @@ WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_
return WERR_BADFID;
if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
- DEBUG(3, ("_spoolss_deleteprinterdata: printer properties change denied by handle\n"));
+ DEBUG(3, ("_spoolss_DeletePrinterData: "
+ "printer properties change denied by handle\n"));
return WERR_ACCESS_DENIED;
}
@@ -8424,30 +8459,31 @@ WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_
if (!W_ERROR_IS_OK(status))
return status;
- valuename = unistr2_to_ascii_talloc(ctx, value);
- if (!valuename) {
+ if (!r->in.value_name) {
free_a_printer(&printer, 2);
return WERR_NOMEM;
}
- status = delete_printer_dataex( printer, SPOOL_PRINTERDATA_KEY, valuename );
+ status = delete_printer_dataex( printer, SPOOL_PRINTERDATA_KEY,
+ r->in.value_name );
if ( W_ERROR_IS_OK(status) )
mod_a_printer( printer, 2 );
free_a_printer(&printer, 2);
- TALLOC_FREE(valuename);
return status;
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_AddForm
+****************************************************************/
-WERROR _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM *r_u)
+WERROR _spoolss_AddForm(pipes_struct *p,
+ struct spoolss_AddForm *r)
{
- POLICY_HND *handle = &q_u->handle;
- FORM *form = &q_u->form;
+ POLICY_HND *handle = r->in.handle;
+ struct spoolss_AddFormInfo1 *form = r->in.info.info1;
nt_forms_struct tmpForm;
int snum;
WERROR status = WERR_OK;
@@ -8457,10 +8493,11 @@ WERROR _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM
nt_forms_struct *list=NULL;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
- DEBUG(5,("spoolss_addform\n"));
+ DEBUG(5,("_spoolss_AddForm\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_addform: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_AddForm: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -8485,7 +8522,7 @@ WERROR _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM
/* can't add if builtin */
- if (get_a_builtin_ntform(&form->name,&tmpForm)) {
+ if (get_a_builtin_ntform_by_string(form->form_name, &tmpForm)) {
status = WERR_FILE_EXISTS;
goto done;
}
@@ -8514,13 +8551,15 @@ done:
return status;
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_DeleteForm
+****************************************************************/
-WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DELETEFORM *r_u)
+WERROR _spoolss_DeleteForm(pipes_struct *p,
+ struct spoolss_DeleteForm *r)
{
- POLICY_HND *handle = &q_u->handle;
- UNISTR2 *form_name = &q_u->name;
+ POLICY_HND *handle = r->in.handle;
+ const char *form_name = r->in.form_name;
nt_forms_struct tmpForm;
int count=0;
nt_forms_struct *list=NULL;
@@ -8529,10 +8568,11 @@ WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE
WERROR status = WERR_OK;
NT_PRINTER_INFO_LEVEL *printer = NULL;
- DEBUG(5,("spoolss_deleteform\n"));
+ DEBUG(5,("_spoolss_DeleteForm\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_deleteform: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_DeleteForm: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -8549,14 +8589,14 @@ WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE
}
if ( !(Printer->access_granted & (PRINTER_ACCESS_ADMINISTER|SERVER_ACCESS_ADMINISTER)) ) {
- DEBUG(2,("_spoolss_deleteform: denied by handle permissions.\n"));
+ DEBUG(2,("_spoolss_DeleteForm: denied by handle permissions.\n"));
status = WERR_ACCESS_DENIED;
goto done;
}
/* can't delete if builtin */
- if (get_a_builtin_ntform(form_name,&tmpForm)) {
+ if (get_a_builtin_ntform_by_string(form_name,&tmpForm)) {
status = WERR_INVALID_PARAM;
goto done;
}
@@ -8581,13 +8621,15 @@ done:
return status;
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_SetForm
+****************************************************************/
-WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *r_u)
+WERROR _spoolss_SetForm(pipes_struct *p,
+ struct spoolss_SetForm *r)
{
- POLICY_HND *handle = &q_u->handle;
- FORM *form = &q_u->form;
+ POLICY_HND *handle = r->in.handle;
+ struct spoolss_AddFormInfo1 *form = r->in.info.info1;
nt_forms_struct tmpForm;
int snum;
WERROR status = WERR_OK;
@@ -8597,10 +8639,11 @@ WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *
nt_forms_struct *list=NULL;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
- DEBUG(5,("spoolss_setform\n"));
+ DEBUG(5,("_spoolss_SetForm\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_setform: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_SetForm: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -8617,13 +8660,13 @@ WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *
}
if ( !(Printer->access_granted & (PRINTER_ACCESS_ADMINISTER|SERVER_ACCESS_ADMINISTER)) ) {
- DEBUG(2,("_spoolss_setform: denied by handle permissions\n"));
+ DEBUG(2,("_spoolss_SetForm: denied by handle permissions\n"));
status = WERR_ACCESS_DENIED;
goto done;
}
/* can't set if builtin */
- if (get_a_builtin_ntform(&form->name,&tmpForm)) {
+ if (get_a_builtin_ntform_by_string(form->form_name, &tmpForm)) {
status = WERR_INVALID_PARAM;
goto done;
}
@@ -9325,29 +9368,24 @@ WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u,
return status;
}
+/****************************************************************
+ _spoolss_DeletePrinterDataEx
+****************************************************************/
-/********************************************************************
- * spoolss_deleteprinterdataex
- ********************************************************************/
-
-WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX *q_u, SPOOL_R_DELETEPRINTERDATAEX *r_u)
+WERROR _spoolss_DeletePrinterDataEx(pipes_struct *p,
+ struct spoolss_DeletePrinterDataEx *r)
{
- POLICY_HND *handle = &q_u->handle;
- UNISTR2 *value = &q_u->valuename;
- UNISTR2 *key = &q_u->keyname;
-
+ POLICY_HND *handle = r->in.handle;
NT_PRINTER_INFO_LEVEL *printer = NULL;
int snum=0;
WERROR status = WERR_OK;
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
- char *valuename = NULL;
- char *keyname = NULL;
- TALLOC_CTX *ctx = p->mem_ctx;
- DEBUG(5,("spoolss_deleteprinterdataex\n"));
+ DEBUG(5,("_spoolss_DeletePrinterDataEx\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_deleteprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_DeletePrinterDataEx: "
+ "Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -9355,13 +9393,12 @@ WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX
return WERR_BADFID;
if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
- DEBUG(3, ("_spoolss_deleteprinterdataex: printer properties change denied by handle\n"));
+ DEBUG(3, ("_spoolss_DeletePrinterDataEx: "
+ "printer properties change denied by handle\n"));
return WERR_ACCESS_DENIED;
}
- valuename = unistr2_to_ascii_talloc(ctx, value);
- keyname = unistr2_to_ascii_talloc(ctx, key);
- if (!valuename || !keyname) {
+ if (!r->in.value_name || !r->in.key_name) {
return WERR_NOMEM;
}
@@ -9369,7 +9406,7 @@ WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX
if (!W_ERROR_IS_OK(status))
return status;
- status = delete_printer_dataex( printer, keyname, valuename );
+ status = delete_printer_dataex( printer, r->in.key_name, r->in.value_name );
if ( W_ERROR_IS_OK(status) )
mod_a_printer( printer, 2 );
@@ -9451,36 +9488,38 @@ done:
return status;
}
-/********************************************************************
- * spoolss_deleteprinterkey
- ********************************************************************/
+/****************************************************************
+ _spoolss_DeletePrinterKey
+****************************************************************/
-WERROR _spoolss_deleteprinterkey(pipes_struct *p, SPOOL_Q_DELETEPRINTERKEY *q_u, SPOOL_R_DELETEPRINTERKEY *r_u)
+WERROR _spoolss_DeletePrinterKey(pipes_struct *p,
+ struct spoolss_DeletePrinterKey *r)
{
- POLICY_HND *handle = &q_u->handle;
- Printer_entry *Printer = find_printer_index_by_hnd(p, &q_u->handle);
- fstring key;
+ POLICY_HND *handle = r->in.handle;
+ Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
NT_PRINTER_INFO_LEVEL *printer = NULL;
int snum=0;
WERROR status;
- DEBUG(5,("spoolss_deleteprinterkey\n"));
+ DEBUG(5,("_spoolss_DeletePrinterKey\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_deleteprinterkey: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_DeletePrinterKey: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
/* if keyname == NULL, return error */
- if ( !q_u->keyname.buffer )
+ if ( !r->in.key_name )
return WERR_INVALID_PARAM;
if (!get_printer_snum(p, handle, &snum, NULL))
return WERR_BADFID;
if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
- DEBUG(3, ("_spoolss_deleteprinterkey: printer properties change denied by handle\n"));
+ DEBUG(3, ("_spoolss_DeletePrinterKey: "
+ "printer properties change denied by handle\n"));
return WERR_ACCESS_DENIED;
}
@@ -9490,9 +9529,7 @@ WERROR _spoolss_deleteprinterkey(pipes_struct *p, SPOOL_Q_DELETEPRINTERKEY *q_u,
/* delete the key and all subneys */
- unistr2_to_ascii(key, &q_u->keyname, sizeof(key));
-
- status = delete_all_printer_data( printer->info_2, key );
+ status = delete_all_printer_data( printer->info_2, r->in.key_name );
if ( W_ERROR_IS_OK(status) )
status = mod_a_printer(printer, 2);
@@ -9941,3 +9978,872 @@ WERROR _spoolss_xcvdataport(pipes_struct *p, SPOOL_Q_XCVDATAPORT *q_u, SPOOL_R_X
return WERR_INVALID_PRINT_MONITOR;
}
+/****************************************************************
+ _spoolss_EnumPrinters
+****************************************************************/
+
+WERROR _spoolss_EnumPrinters(pipes_struct *p,
+ struct spoolss_EnumPrinters *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_OpenPrinter
+****************************************************************/
+
+WERROR _spoolss_OpenPrinter(pipes_struct *p,
+ struct spoolss_OpenPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_SetJob
+****************************************************************/
+
+WERROR _spoolss_SetJob(pipes_struct *p,
+ struct spoolss_SetJob *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetJob
+****************************************************************/
+
+WERROR _spoolss_GetJob(pipes_struct *p,
+ struct spoolss_GetJob *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumJobs
+****************************************************************/
+
+WERROR _spoolss_EnumJobs(pipes_struct *p,
+ struct spoolss_EnumJobs *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPrinter
+****************************************************************/
+
+WERROR _spoolss_AddPrinter(pipes_struct *p,
+ struct spoolss_AddPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_SetPrinter
+****************************************************************/
+
+WERROR _spoolss_SetPrinter(pipes_struct *p,
+ struct spoolss_SetPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetPrinter
+****************************************************************/
+
+WERROR _spoolss_GetPrinter(pipes_struct *p,
+ struct spoolss_GetPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPrinterDriver
+****************************************************************/
+
+WERROR _spoolss_AddPrinterDriver(pipes_struct *p,
+ struct spoolss_AddPrinterDriver *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumPrinterDrivers
+****************************************************************/
+
+WERROR _spoolss_EnumPrinterDrivers(pipes_struct *p,
+ struct spoolss_EnumPrinterDrivers *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetPrinterDriver
+****************************************************************/
+
+WERROR _spoolss_GetPrinterDriver(pipes_struct *p,
+ struct spoolss_GetPrinterDriver *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetPrinterDriverDirectory
+****************************************************************/
+
+WERROR _spoolss_GetPrinterDriverDirectory(pipes_struct *p,
+ struct spoolss_GetPrinterDriverDirectory *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPrintProcessor
+****************************************************************/
+
+WERROR _spoolss_AddPrintProcessor(pipes_struct *p,
+ struct spoolss_AddPrintProcessor *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumPrintProcessors
+****************************************************************/
+
+WERROR _spoolss_EnumPrintProcessors(pipes_struct *p,
+ struct spoolss_EnumPrintProcessors *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetPrintProcessorDirectory
+****************************************************************/
+
+WERROR _spoolss_GetPrintProcessorDirectory(pipes_struct *p,
+ struct spoolss_GetPrintProcessorDirectory *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_StartDocPrinter
+****************************************************************/
+
+WERROR _spoolss_StartDocPrinter(pipes_struct *p,
+ struct spoolss_StartDocPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_ReadPrinter
+****************************************************************/
+
+WERROR _spoolss_ReadPrinter(pipes_struct *p,
+ struct spoolss_ReadPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddJob
+****************************************************************/
+
+WERROR _spoolss_AddJob(pipes_struct *p,
+ struct spoolss_AddJob *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_ScheduleJob
+****************************************************************/
+
+WERROR _spoolss_ScheduleJob(pipes_struct *p,
+ struct spoolss_ScheduleJob *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetPrinterData
+****************************************************************/
+
+WERROR _spoolss_GetPrinterData(pipes_struct *p,
+ struct spoolss_GetPrinterData *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_SetPrinterData
+****************************************************************/
+
+WERROR _spoolss_SetPrinterData(pipes_struct *p,
+ struct spoolss_SetPrinterData *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_WaitForPrinterChange
+****************************************************************/
+
+WERROR _spoolss_WaitForPrinterChange(pipes_struct *p,
+ struct spoolss_WaitForPrinterChange *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumForms
+****************************************************************/
+
+WERROR _spoolss_EnumForms(pipes_struct *p,
+ struct spoolss_EnumForms *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumPorts
+****************************************************************/
+
+WERROR _spoolss_EnumPorts(pipes_struct *p,
+ struct spoolss_EnumPorts *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumMonitors
+****************************************************************/
+
+WERROR _spoolss_EnumMonitors(pipes_struct *p,
+ struct spoolss_EnumMonitors *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPort
+****************************************************************/
+
+WERROR _spoolss_AddPort(pipes_struct *p,
+ struct spoolss_AddPort *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_ConfigurePort
+****************************************************************/
+
+WERROR _spoolss_ConfigurePort(pipes_struct *p,
+ struct spoolss_ConfigurePort *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_DeletePort
+****************************************************************/
+
+WERROR _spoolss_DeletePort(pipes_struct *p,
+ struct spoolss_DeletePort *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_CreatePrinterIC
+****************************************************************/
+
+WERROR _spoolss_CreatePrinterIC(pipes_struct *p,
+ struct spoolss_CreatePrinterIC *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_PlayGDIScriptOnPrinterIC
+****************************************************************/
+
+WERROR _spoolss_PlayGDIScriptOnPrinterIC(pipes_struct *p,
+ struct spoolss_PlayGDIScriptOnPrinterIC *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_DeletePrinterIC
+****************************************************************/
+
+WERROR _spoolss_DeletePrinterIC(pipes_struct *p,
+ struct spoolss_DeletePrinterIC *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPrinterConnection
+****************************************************************/
+
+WERROR _spoolss_AddPrinterConnection(pipes_struct *p,
+ struct spoolss_AddPrinterConnection *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_DeletePrinterConnection
+****************************************************************/
+
+WERROR _spoolss_DeletePrinterConnection(pipes_struct *p,
+ struct spoolss_DeletePrinterConnection *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_PrinterMessageBox
+****************************************************************/
+
+WERROR _spoolss_PrinterMessageBox(pipes_struct *p,
+ struct spoolss_PrinterMessageBox *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddMonitor
+****************************************************************/
+
+WERROR _spoolss_AddMonitor(pipes_struct *p,
+ struct spoolss_AddMonitor *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_DeleteMonitor
+****************************************************************/
+
+WERROR _spoolss_DeleteMonitor(pipes_struct *p,
+ struct spoolss_DeleteMonitor *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_DeletePrintProcessor
+****************************************************************/
+
+WERROR _spoolss_DeletePrintProcessor(pipes_struct *p,
+ struct spoolss_DeletePrintProcessor *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPrintProvidor
+****************************************************************/
+
+WERROR _spoolss_AddPrintProvidor(pipes_struct *p,
+ struct spoolss_AddPrintProvidor *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_DeletePrintProvidor
+****************************************************************/
+
+WERROR _spoolss_DeletePrintProvidor(pipes_struct *p,
+ struct spoolss_DeletePrintProvidor *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumPrintProcDataTypes
+****************************************************************/
+
+WERROR _spoolss_EnumPrintProcDataTypes(pipes_struct *p,
+ struct spoolss_EnumPrintProcDataTypes *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_ResetPrinter
+****************************************************************/
+
+WERROR _spoolss_ResetPrinter(pipes_struct *p,
+ struct spoolss_ResetPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetPrinterDriver2
+****************************************************************/
+
+WERROR _spoolss_GetPrinterDriver2(pipes_struct *p,
+ struct spoolss_GetPrinterDriver2 *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_FindFirstPrinterChangeNotification
+****************************************************************/
+
+WERROR _spoolss_FindFirstPrinterChangeNotification(pipes_struct *p,
+ struct spoolss_FindFirstPrinterChangeNotification *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_FindNextPrinterChangeNotification
+****************************************************************/
+
+WERROR _spoolss_FindNextPrinterChangeNotification(pipes_struct *p,
+ struct spoolss_FindNextPrinterChangeNotification *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_RouterFindFirstPrinterChangeNotificationOld
+****************************************************************/
+
+WERROR _spoolss_RouterFindFirstPrinterChangeNotificationOld(pipes_struct *p,
+ struct spoolss_RouterFindFirstPrinterChangeNotificationOld *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_ReplyOpenPrinter
+****************************************************************/
+
+WERROR _spoolss_ReplyOpenPrinter(pipes_struct *p,
+ struct spoolss_ReplyOpenPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_RouterReplyPrinter
+****************************************************************/
+
+WERROR _spoolss_RouterReplyPrinter(pipes_struct *p,
+ struct spoolss_RouterReplyPrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_ReplyClosePrinter
+****************************************************************/
+
+WERROR _spoolss_ReplyClosePrinter(pipes_struct *p,
+ struct spoolss_ReplyClosePrinter *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPortEx
+****************************************************************/
+
+WERROR _spoolss_AddPortEx(pipes_struct *p,
+ struct spoolss_AddPortEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_RouterFindFirstPrinterChangeNotification
+****************************************************************/
+
+WERROR _spoolss_RouterFindFirstPrinterChangeNotification(pipes_struct *p,
+ struct spoolss_RouterFindFirstPrinterChangeNotification *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_SpoolerInit
+****************************************************************/
+
+WERROR _spoolss_SpoolerInit(pipes_struct *p,
+ struct spoolss_SpoolerInit *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_ResetPrinterEx
+****************************************************************/
+
+WERROR _spoolss_ResetPrinterEx(pipes_struct *p,
+ struct spoolss_ResetPrinterEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_RemoteFindFirstPrinterChangeNotifyEx
+****************************************************************/
+
+WERROR _spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p,
+ struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_RouterRefreshPrinterChangeNotification
+****************************************************************/
+
+WERROR _spoolss_RouterRefreshPrinterChangeNotification(pipes_struct *p,
+ struct spoolss_RouterRefreshPrinterChangeNotification *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_RemoteFindNextPrinterChangeNotifyEx
+****************************************************************/
+
+WERROR _spoolss_RemoteFindNextPrinterChangeNotifyEx(pipes_struct *p,
+ struct spoolss_RemoteFindNextPrinterChangeNotifyEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_44
+****************************************************************/
+
+WERROR _spoolss_44(pipes_struct *p,
+ struct spoolss_44 *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_OpenPrinterEx
+****************************************************************/
+
+WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
+ struct spoolss_OpenPrinterEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPrinterEx
+****************************************************************/
+
+WERROR _spoolss_AddPrinterEx(pipes_struct *p,
+ struct spoolss_AddPrinterEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_47
+****************************************************************/
+
+WERROR _spoolss_47(pipes_struct *p,
+ struct spoolss_47 *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumPrinterData
+****************************************************************/
+
+WERROR _spoolss_EnumPrinterData(pipes_struct *p,
+ struct spoolss_EnumPrinterData *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_4a
+****************************************************************/
+
+WERROR _spoolss_4a(pipes_struct *p,
+ struct spoolss_4a *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_4b
+****************************************************************/
+
+WERROR _spoolss_4b(pipes_struct *p,
+ struct spoolss_4b *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_4c
+****************************************************************/
+
+WERROR _spoolss_4c(pipes_struct *p,
+ struct spoolss_4c *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_SetPrinterDataEx
+****************************************************************/
+
+WERROR _spoolss_SetPrinterDataEx(pipes_struct *p,
+ struct spoolss_SetPrinterDataEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_GetPrinterDataEx
+****************************************************************/
+
+WERROR _spoolss_GetPrinterDataEx(pipes_struct *p,
+ struct spoolss_GetPrinterDataEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumPrinterDataEx
+****************************************************************/
+
+WERROR _spoolss_EnumPrinterDataEx(pipes_struct *p,
+ struct spoolss_EnumPrinterDataEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_EnumPrinterKey
+****************************************************************/
+
+WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
+ struct spoolss_EnumPrinterKey *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_53
+****************************************************************/
+
+WERROR _spoolss_53(pipes_struct *p,
+ struct spoolss_53 *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_55
+****************************************************************/
+
+WERROR _spoolss_55(pipes_struct *p,
+ struct spoolss_55 *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_56
+****************************************************************/
+
+WERROR _spoolss_56(pipes_struct *p,
+ struct spoolss_56 *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_57
+****************************************************************/
+
+WERROR _spoolss_57(pipes_struct *p,
+ struct spoolss_57 *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_XcvData
+****************************************************************/
+
+WERROR _spoolss_XcvData(pipes_struct *p,
+ struct spoolss_XcvData *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_AddPrinterDriverEx
+****************************************************************/
+
+WERROR _spoolss_AddPrinterDriverEx(pipes_struct *p,
+ struct spoolss_AddPrinterDriverEx *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_5a
+****************************************************************/
+
+WERROR _spoolss_5a(pipes_struct *p,
+ struct spoolss_5a *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_5b
+****************************************************************/
+
+WERROR _spoolss_5b(pipes_struct *p,
+ struct spoolss_5b *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_5c
+****************************************************************/
+
+WERROR _spoolss_5c(pipes_struct *p,
+ struct spoolss_5c *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_5d
+****************************************************************/
+
+WERROR _spoolss_5d(pipes_struct *p,
+ struct spoolss_5d *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_5e
+****************************************************************/
+
+WERROR _spoolss_5e(pipes_struct *p,
+ struct spoolss_5e *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+ _spoolss_5f
+****************************************************************/
+
+WERROR _spoolss_5f(pipes_struct *p,
+ struct spoolss_5f *r)
+{
+ p->rng_fault_state = true;
+ return WERR_NOT_SUPPORTED;
+}
+
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 073f92d45c..056236f22d 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -2328,6 +2328,8 @@ WERROR _srvsvc_NetDiskEnum(pipes_struct *p,
/*allow one struct srvsvc_NetDiskInfo0 for null terminator*/
+ r->out.info->count = 0;
+
for(i = 0; i < MAX_SERVER_DISK_ENTRIES -1 && (disk_name = next_server_disk_enum(&resume)); i++) {
r->out.info->count++;
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index ecd0f36217..4b35f57900 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -6,17 +6,17 @@
Copyright (C) Tim Potter 2000
Copyright (C) Andrew Tridgell 1992-1999
Copyright (C) Luke Kenneth Casson Leighton 1996-1999
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -29,11 +29,11 @@ struct table_node {
const char *short_archi;
int version;
};
-
+
/* The version int is used by getdrivers. Note that
all architecture strings that support mutliple
versions must be grouped together since enumdrivers
- uses this property to prevent issuing multiple
+ uses this property to prevent issuing multiple
enumdriver calls for the same arch */
@@ -92,7 +92,7 @@ static const char *cmd_spoolss_get_short_archi(const char *long_archi)
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -100,12 +100,12 @@ static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
fstring printername;
fstring servername, user;
POLICY_HND hnd;
-
+
if (argc != 2) {
printf("Usage: %s <printername>\n", argv[0]);
return WERR_OK;
}
-
+
if (!cli)
return WERR_GENERAL_FAILURE;
@@ -116,16 +116,16 @@ static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
/* Open the printer handle */
- werror = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
- "", PRINTER_ALL_ACCESS,
+ werror = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
+ "", PRINTER_ALL_ACCESS,
servername, user, &hnd);
if (W_ERROR_IS_OK(werror)) {
printf("Printer %s opened successfully\n", printername);
- werror = rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, &werror);
if (!W_ERROR_IS_OK(werror)) {
- printf("Error closing printer handle! (%s)\n",
+ printf("Error closing printer handle! (%s)\n",
get_dos_error_msg(werror));
}
}
@@ -148,23 +148,23 @@ static void display_print_info_0(PRINTER_INFO_0 *i0)
rpcstr_pull(name, i0->printername.buffer, sizeof(name), -1, STR_TERMINATE);
rpcstr_pull(servername, i0->servername.buffer, sizeof(servername), -1,STR_TERMINATE);
-
+
printf("\tprintername:[%s]\n", name);
printf("\tservername:[%s]\n", servername);
printf("\tcjobs:[0x%x]\n", i0->cjobs);
printf("\ttotal_jobs:[0x%x]\n", i0->total_jobs);
-
- printf("\t:date: [%d]-[%d]-[%d] (%d)\n", i0->year, i0->month,
+
+ printf("\t:date: [%d]-[%d]-[%d] (%d)\n", i0->year, i0->month,
i0->day, i0->dayofweek);
- printf("\t:time: [%d]-[%d]-[%d]-[%d]\n", i0->hour, i0->minute,
+ printf("\t:time: [%d]-[%d]-[%d]-[%d]\n", i0->hour, i0->minute,
i0->second, i0->milliseconds);
-
+
printf("\tglobal_counter:[0x%x]\n", i0->global_counter);
printf("\ttotal_pages:[0x%x]\n", i0->total_pages);
-
+
printf("\tmajorversion:[0x%x]\n", i0->major_version);
printf("\tbuildversion:[0x%x]\n", i0->build_version);
-
+
printf("\tunknown7:[0x%x]\n", i0->unknown7);
printf("\tunknown8:[0x%x]\n", i0->unknown8);
printf("\tunknown9:[0x%x]\n", i0->unknown9);
@@ -231,7 +231,7 @@ static void display_print_info_2(PRINTER_INFO_2 *i2)
fstring printprocessor = "";
fstring datatype = "";
fstring parameters = "";
-
+
rpcstr_pull(servername, i2->servername.buffer,sizeof(servername), -1, STR_TERMINATE);
rpcstr_pull(printername, i2->printername.buffer,sizeof(printername), -1, STR_TERMINATE);
rpcstr_pull(sharename, i2->sharename.buffer,sizeof(sharename), -1, STR_TERMINATE);
@@ -264,7 +264,7 @@ static void display_print_info_2(PRINTER_INFO_2 *i2)
printf("\tcjobs:[0x%x]\n", i2->cjobs);
printf("\taverageppm:[0x%x]\n", i2->averageppm);
- if (i2->secdesc)
+ if (i2->secdesc)
display_sec_desc(i2->secdesc);
printf("\n");
@@ -295,7 +295,7 @@ static void display_print_info_7(PRINTER_INFO_7 *i7)
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -305,7 +305,7 @@ static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
uint32 i = 0, num_printers;
fstring name;
- if (argc > 3)
+ if (argc > 3)
{
printf("Usage: %s [level] [name]\n", argv[0]);
return WERR_OK;
@@ -323,7 +323,7 @@ static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
ZERO_STRUCT(ctr);
- result = rpccli_spoolss_enum_printers(cli, mem_ctx, name, PRINTER_ENUM_LOCAL,
+ result = rpccli_spoolss_enum_printers(cli, mem_ctx, name, PRINTER_ENUM_LOCAL,
info_level, &num_printers, &ctr);
if (W_ERROR_IS_OK(result)) {
@@ -332,7 +332,7 @@ static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
printf ("No printers returned.\n");
goto done;
}
-
+
for (i = 0; i < num_printers; i++) {
switch(info_level) {
case 0:
@@ -364,7 +364,7 @@ static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
static void display_port_info_1(PORT_INFO_1 *i1)
{
fstring buffer;
-
+
rpcstr_pull(buffer, i1->port_name.buffer, sizeof(buffer), -1, STR_TERMINATE);
printf("\tPort Name:\t[%s]\n", buffer);
}
@@ -375,7 +375,7 @@ static void display_port_info_1(PORT_INFO_1 *i1)
static void display_port_info_2(PORT_INFO_2 *i2)
{
fstring buffer;
-
+
rpcstr_pull(buffer, i2->port_name.buffer, sizeof(buffer), -1, STR_TERMINATE);
printf("\tPort Name:\t[%s]\n", buffer);
rpcstr_pull(buffer, i2->monitor_name.buffer, sizeof(buffer), -1, STR_TERMINATE);
@@ -416,20 +416,20 @@ static void display_port_info_2(PORT_INFO_2 *i2)
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_ports(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_enum_ports(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
WERROR result;
uint32 info_level = 1;
PORT_INFO_CTR ctr;
uint32 returned;
-
+
if (argc > 2) {
printf("Usage: %s [level]\n", argv[0]);
return WERR_OK;
}
-
+
if (argc == 2)
info_level = atoi(argv[1]);
@@ -456,7 +456,7 @@ static WERROR cmd_spoolss_enum_ports(struct rpc_pipe_client *cli,
}
}
}
-
+
return result;
}
@@ -494,10 +494,10 @@ static WERROR cmd_spoolss_setprinter(struct rpc_pipe_client *cli,
fstrcpy(user, cli->auth->user_name);
/* get a printer handle */
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
PRINTER_ALL_ACCESS, servername,
user, &pol);
-
+
if (!W_ERROR_IS_OK(result))
goto done;
@@ -521,7 +521,7 @@ static WERROR cmd_spoolss_setprinter(struct rpc_pipe_client *cli,
done:
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -560,10 +560,10 @@ static WERROR cmd_spoolss_setprintername(struct rpc_pipe_client *cli,
fstrcpy(user, cli->auth->user_name);
/* get a printer handle */
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
PRINTER_ALL_ACCESS, servername,
user, &pol);
-
+
if (!W_ERROR_IS_OK(result))
goto done;
@@ -586,7 +586,7 @@ static WERROR cmd_spoolss_setprintername(struct rpc_pipe_client *cli,
done:
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -621,16 +621,16 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
strupper_m(servername);
slprintf(printername, sizeof(printername)-1, "%s\\%s", servername, argv[1]);
fstrcpy(user, cli->auth->user_name);
-
+
/* get a printer handle */
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
- "", MAXIMUM_ALLOWED_ACCESS,
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
+ "", MAXIMUM_ALLOWED_ACCESS,
servername, user, &pol);
if (!W_ERROR_IS_OK(result))
goto done;
-
+
opened_hnd = True;
/* Get printer info */
@@ -643,7 +643,7 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
/* Display printer info */
switch (info_level) {
- case 0:
+ case 0:
display_print_info_0(ctr.printers_0);
break;
case 1:
@@ -663,9 +663,9 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
break;
}
- done:
- if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ done:
+ if (opened_hnd)
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -728,7 +728,7 @@ static void display_reg_value(REGISTRY_VALUE value)
default:
printf("%s: unknown type %d\n", value.valuename, value.type);
}
-
+
}
/****************************************************************************
@@ -761,19 +761,19 @@ static WERROR cmd_spoolss_getprinterdata(struct rpc_pipe_client *cli,
if (strncmp(argv[1], ".", sizeof(".")) == 0)
fstrcpy(printername, servername);
else
- slprintf(printername, sizeof(servername)-1, "%s\\%s",
+ slprintf(printername, sizeof(servername)-1, "%s\\%s",
servername, argv[1]);
fstrcpy(user, cli->auth->user_name);
-
+
/* get a printer handle */
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
- "", MAXIMUM_ALLOWED_ACCESS,
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
+ "", MAXIMUM_ALLOWED_ACCESS,
servername, user, &pol);
if (!W_ERROR_IS_OK(result))
goto done;
-
+
opened_hnd = True;
/* Get printer info */
@@ -787,11 +787,11 @@ static WERROR cmd_spoolss_getprinterdata(struct rpc_pipe_client *cli,
fstrcpy(value.valuename, valuename);
display_reg_value(value);
-
- done:
- if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+
+ done:
+ if (opened_hnd)
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -813,7 +813,7 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
REGISTRY_VALUE value;
if (argc != 4) {
- printf("Usage: %s <printername> <keyname> <valuename>\n",
+ printf("Usage: %s <printername> <keyname> <valuename>\n",
argv[0]);
printf("<printername> of . queries print server\n");
return WERR_OK;
@@ -828,24 +828,24 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
if (strncmp(argv[1], ".", sizeof(".")) == 0)
fstrcpy(printername, servername);
else
- slprintf(printername, sizeof(printername)-1, "%s\\%s",
+ slprintf(printername, sizeof(printername)-1, "%s\\%s",
servername, argv[1]);
fstrcpy(user, cli->auth->user_name);
-
+
/* get a printer handle */
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
- "", MAXIMUM_ALLOWED_ACCESS,
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
+ "", MAXIMUM_ALLOWED_ACCESS,
servername, user, &pol);
if (!W_ERROR_IS_OK(result))
goto done;
-
+
opened_hnd = True;
/* Get printer info */
- result = rpccli_spoolss_getprinterdataex(cli, mem_ctx, &pol, keyname,
+ result = rpccli_spoolss_getprinterdataex(cli, mem_ctx, &pol, keyname,
valuename, &value);
if (!W_ERROR_IS_OK(result))
@@ -855,11 +855,11 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
fstrcpy(value.valuename, valuename);
display_reg_value(value);
-
- done:
- if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+
+ done:
+ if (opened_hnd)
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -877,7 +877,7 @@ static void display_print_driver_1(DRIVER_INFO_1 *i1)
printf ("Printer Driver Info 1:\n");
printf ("\tDriver Name: [%s]\n\n", name);
-
+
return;
}
@@ -925,10 +925,10 @@ static void display_print_driver_3(DRIVER_INFO_3 *i1)
fstring dependentfiles = "";
fstring monitorname = "";
fstring defaultdatatype = "";
-
+
int length=0;
bool valid = True;
-
+
if (i1 == NULL)
return;
@@ -953,9 +953,9 @@ static void display_print_driver_3(DRIVER_INFO_3 *i1)
while (valid)
{
rpcstr_pull(dependentfiles, i1->dependentfiles+length, sizeof(dependentfiles), -1, STR_TERMINATE);
-
+
length+=strlen(dependentfiles)+1;
-
+
if (strlen(dependentfiles) > 0)
{
printf ("\tDependentfiles: [%s]\n", dependentfiles);
@@ -965,19 +965,19 @@ static void display_print_driver_3(DRIVER_INFO_3 *i1)
valid = False;
}
}
-
+
printf ("\n");
printf ("\tMonitorname: [%s]\n", monitorname);
printf ("\tDefaultdatatype: [%s]\n\n", defaultdatatype);
- return;
+ return;
}
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -986,13 +986,13 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
uint32 info_level = 3;
bool opened_hnd = False;
PRINTER_DRIVER_CTR ctr;
- fstring printername,
- servername,
+ fstring printername,
+ servername,
user;
uint32 i;
bool success = False;
- if ((argc == 1) || (argc > 3))
+ if ((argc == 1) || (argc > 3))
{
printf("Usage: %s <printername> [level]\n", argv[0]);
return WERR_OK;
@@ -1008,7 +1008,7 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
/* Open a printer handle */
- werror = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
+ werror = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
PRINTER_ACCESS_USE,
servername, user, &pol);
@@ -1023,17 +1023,17 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
for (i=0; archi_table[i].long_archi!=NULL; i++) {
- werror = rpccli_spoolss_getprinterdriver( cli, mem_ctx, &pol, info_level,
+ werror = rpccli_spoolss_getprinterdriver( cli, mem_ctx, &pol, info_level,
archi_table[i].long_archi, archi_table[i].version,
&ctr);
if (!W_ERROR_IS_OK(werror))
continue;
-
+
/* need at least one success */
-
+
success = True;
-
+
printf ("\n[%s]\n", archi_table[i].long_archi);
switch (info_level) {
@@ -1051,22 +1051,22 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
break;
}
}
-
+
/* Cleanup */
if (opened_hnd)
- rpccli_spoolss_close_printer (cli, mem_ctx, &pol);
-
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
+
if ( success )
werror = WERR_OK;
-
+
return werror;
}
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_drivers(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_enum_drivers(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1093,11 +1093,11 @@ static WERROR cmd_spoolss_enum_drivers(struct rpc_pipe_client *cli,
continue;
werror = rpccli_spoolss_enumprinterdrivers(
- cli, mem_ctx, info_level,
+ cli, mem_ctx, info_level,
archi_table[i].long_archi, &returned, &ctr);
if (W_ERROR_V(werror) == W_ERROR_V(WERR_INVALID_ENVIRONMENT)) {
- printf ("Server does not support environment [%s]\n",
+ printf ("Server does not support environment [%s]\n",
archi_table[i].long_archi);
werror = WERR_OK;
continue;
@@ -1105,17 +1105,17 @@ static WERROR cmd_spoolss_enum_drivers(struct rpc_pipe_client *cli,
if (returned == 0)
continue;
-
+
if (!W_ERROR_IS_OK(werror)) {
printf ("Error getting driver for environment [%s] - %d\n",
archi_table[i].long_archi, W_ERROR_V(werror));
continue;
}
-
+
printf ("\n[%s]\n", archi_table[i].long_archi);
- switch (info_level)
+ switch (info_level)
{
-
+
case 1:
for (j=0; j < returned; j++) {
display_print_driver_1 (&ctr.info1[j]);
@@ -1136,7 +1136,7 @@ static WERROR cmd_spoolss_enum_drivers(struct rpc_pipe_client *cli,
return WERR_UNKNOWN_LEVEL;
}
}
-
+
return werror;
}
@@ -1148,16 +1148,16 @@ static void display_printdriverdir_1(DRIVER_DIRECTORY_1 *i1)
fstring name;
if (i1 == NULL)
return;
-
+
rpcstr_pull(name, i1->name.buffer, sizeof(name), -1, STR_TERMINATE);
-
+
printf ("\tDirectory Name:[%s]\n", name);
}
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_getdriverdir(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_getdriverdir(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1194,8 +1194,8 @@ void set_drv_info_3_env (DRIVER_INFO_3 *info, const char *arch)
{
int i;
-
- for (i=0; archi_table[i].long_archi != NULL; i++)
+
+ for (i=0; archi_table[i].long_archi != NULL; i++)
{
if (strcmp(arch, archi_table[i].short_archi) == 0)
{
@@ -1204,12 +1204,12 @@ void set_drv_info_3_env (DRIVER_INFO_3 *info, const char *arch)
break;
}
}
-
+
if (archi_table[i].long_archi == NULL)
{
DEBUG(0, ("set_drv_info_3_env: Unknown arch [%s]\n", arch));
}
-
+
return;
}
@@ -1218,7 +1218,7 @@ void set_drv_info_3_env (DRIVER_INFO_3 *info, const char *arch)
wrapper for strtok to get the next parameter from a delimited list.
Needed to handle the empty parameter string denoted by "NULL"
*************************************************************************/
-
+
static char* get_driver_3_param (char* str, const char* delim, UNISTR* dest,
char **saveptr)
{
@@ -1235,19 +1235,19 @@ static char* get_driver_3_param (char* str, const char* delim, UNISTR* dest,
ptr = NULL;
if (dest != NULL)
- init_unistr(dest, ptr);
+ init_unistr(dest, ptr);
return ptr;
}
/********************************************************************************
- fill in the members of a DRIVER_INFO_3 struct using a character
+ fill in the members of a DRIVER_INFO_3 struct using a character
string in the form of
<Long Printer Name>:<Driver File Name>:<Data File Name>:\
<Config File Name>:<Help File Name>:<Language Monitor Name>:\
- <Default Data Type>:<Comma Separated list of Files>
+ <Default Data Type>:<Comma Separated list of Files>
*******************************************************************************/
-static bool init_drv_info_3_members ( TALLOC_CTX *mem_ctx, DRIVER_INFO_3 *info,
+static bool init_drv_info_3_members ( TALLOC_CTX *mem_ctx, DRIVER_INFO_3 *info,
char *args )
{
char *str, *str2;
@@ -1299,7 +1299,7 @@ static bool init_drv_info_3_members ( TALLOC_CTX *mem_ctx, DRIVER_INFO_3 *info,
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_addprinterdriver(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_addprinterdriver(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1322,7 +1322,7 @@ static WERROR cmd_spoolss_addprinterdriver(struct rpc_pipe_client *cli,
return WERR_OK;
}
-
+
/* Fill in the DRIVER_INFO_3 struct */
ZERO_STRUCT(info3);
if (!(arch = cmd_spoolss_get_short_archi(argv[1])))
@@ -1353,7 +1353,7 @@ static WERROR cmd_spoolss_addprinterdriver(struct rpc_pipe_client *cli,
result = rpccli_spoolss_addprinterdriver (cli, mem_ctx, level, &ctr);
if (W_ERROR_IS_OK(result)) {
- rpcstr_pull(driver_name, info3.name.buffer,
+ rpcstr_pull(driver_name, info3.name.buffer,
sizeof(driver_name), -1, STR_TERMINATE);
printf ("Printer Driver %s successfully installed.\n",
driver_name);
@@ -1366,7 +1366,7 @@ static WERROR cmd_spoolss_addprinterdriver(struct rpc_pipe_client *cli,
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_addprinterex(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_addprinterex(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1375,20 +1375,20 @@ static WERROR cmd_spoolss_addprinterex(struct rpc_pipe_client *cli,
PRINTER_INFO_CTR ctr;
PRINTER_INFO_2 info2;
fstring servername;
-
+
/* parse the command arguments */
if (argc != 5)
{
printf ("Usage: %s <name> <shared name> <driver> <port>\n", argv[0]);
return WERR_OK;
}
-
+
slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
/* Fill in the DRIVER_INFO_2 struct */
ZERO_STRUCT(info2);
-
+
init_unistr( &info2.printername, argv[1]);
init_unistr( &info2.sharename, argv[2]);
init_unistr( &info2.drivername, argv[3]);
@@ -1403,9 +1403,9 @@ static WERROR cmd_spoolss_addprinterex(struct rpc_pipe_client *cli,
info2.defaultpriority = 0;
info2.starttime = 0;
info2.untiltime = 0;
-
- /* These three fields must not be used by AddPrinter()
- as defined in the MS Platform SDK documentation..
+
+ /* These three fields must not be used by AddPrinter()
+ as defined in the MS Platform SDK documentation..
--jerry
info2.status = 0;
info2.cjobs = 0;
@@ -1424,7 +1424,7 @@ static WERROR cmd_spoolss_addprinterex(struct rpc_pipe_client *cli,
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_setdriver(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_setdriver(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -1437,7 +1437,7 @@ static WERROR cmd_spoolss_setdriver(struct rpc_pipe_client *cli,
fstring servername,
printername,
user;
-
+
/* parse the command arguments */
if (argc != 3)
{
@@ -1452,7 +1452,7 @@ static WERROR cmd_spoolss_setdriver(struct rpc_pipe_client *cli,
/* Get a printer handle */
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
PRINTER_ALL_ACCESS,
servername, user, &pol);
@@ -1490,7 +1490,7 @@ done:
/* Cleanup */
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -1499,17 +1499,19 @@ done:
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_deletedriverex(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_deletedriverex(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
WERROR result, ret = WERR_UNKNOWN_PRINTER_DRIVER;
-
+ NTSTATUS status;
+
int i;
int vers = -1;
-
+
const char *arch = NULL;
-
+ uint32_t delete_flags = 0;
+
/* parse the command arguments */
if (argc < 2 || argc > 4) {
printf ("Usage: %s <driver> [arch] [version]\n", argv[0]);
@@ -1520,36 +1522,44 @@ static WERROR cmd_spoolss_deletedriverex(struct rpc_pipe_client *cli,
arch = argv[2];
if (argc == 4)
vers = atoi (argv[3]);
-
-
+
+ if (vers >= 0) {
+ delete_flags |= DPD_DELETE_SPECIFIC_VERSION;
+ }
+
/* delete the driver for all architectures */
for (i=0; archi_table[i].long_archi; i++) {
- if (arch && !strequal( archi_table[i].long_archi, arch))
+ if (arch && !strequal( archi_table[i].long_archi, arch))
continue;
if (vers >= 0 && archi_table[i].version != vers)
continue;
/* make the call to remove the driver */
- result = rpccli_spoolss_deleteprinterdriverex(
- cli, mem_ctx, archi_table[i].long_archi, argv[1], archi_table[i].version);
-
- if ( !W_ERROR_IS_OK(result) )
+ status = rpccli_spoolss_DeletePrinterDriverEx(cli, mem_ctx,
+ cli->srv_name_slash,
+ archi_table[i].long_archi,
+ argv[1],
+ delete_flags,
+ archi_table[i].version,
+ &result);
+
+ if ( !W_ERROR_IS_OK(result) )
{
if ( !W_ERROR_EQUAL(result, WERR_UNKNOWN_PRINTER_DRIVER) ) {
- printf ("Failed to remove driver %s for arch [%s] (version: %d): %s\n",
+ printf ("Failed to remove driver %s for arch [%s] (version: %d): %s\n",
argv[1], archi_table[i].long_archi, archi_table[i].version, win_errstr(result));
}
- }
- else
+ }
+ else
{
- printf ("Driver %s and files removed for arch [%s] (version: %d).\n", argv[1],
+ printf ("Driver %s and files removed for arch [%s] (version: %d).\n", argv[1],
archi_table[i].long_archi, archi_table[i].version);
ret = WERR_OK;
}
}
-
+
return ret;
}
@@ -1557,14 +1567,15 @@ static WERROR cmd_spoolss_deletedriverex(struct rpc_pipe_client *cli,
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_deletedriver(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_deletedriver(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
WERROR result = WERR_OK;
+ NTSTATUS status;
fstring servername;
int i;
-
+
/* parse the command arguments */
if (argc != 2) {
printf ("Usage: %s <driver>\n", argv[0]);
@@ -1577,35 +1588,40 @@ static WERROR cmd_spoolss_deletedriver(struct rpc_pipe_client *cli,
/* delete the driver for all architectures */
for (i=0; archi_table[i].long_archi; i++) {
/* make the call to remove the driver */
- result = rpccli_spoolss_deleteprinterdriver(
- cli, mem_ctx, archi_table[i].long_archi, argv[1]);
-
+ status = rpccli_spoolss_DeletePrinterDriver(cli, mem_ctx,
+ servername,
+ archi_table[i].long_archi,
+ argv[1],
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return result;
+ }
if ( !W_ERROR_IS_OK(result) ) {
if ( !W_ERROR_EQUAL(result, WERR_UNKNOWN_PRINTER_DRIVER) ) {
- printf ("Failed to remove driver %s for arch [%s] - error 0x%x!\n",
- argv[1], archi_table[i].long_archi,
+ printf ("Failed to remove driver %s for arch [%s] - error 0x%x!\n",
+ argv[1], archi_table[i].long_archi,
W_ERROR_V(result));
}
} else {
- printf ("Driver %s removed for arch [%s].\n", argv[1],
+ printf ("Driver %s removed for arch [%s].\n", argv[1],
archi_table[i].long_archi);
}
}
-
+
return result;
}
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_getprintprocdir(struct rpc_pipe_client *cli,
+static WERROR cmd_spoolss_getprintprocdir(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
WERROR result;
char *servername = NULL, *environment = NULL;
fstring procdir;
-
+
/* parse the command arguments */
if (argc > 2) {
printf ("Usage: %s [environment]\n", argv[0]);
@@ -1616,7 +1632,7 @@ static WERROR cmd_spoolss_getprintprocdir(struct rpc_pipe_client *cli,
return WERR_NOMEM;
strupper_m(servername);
- if (asprintf(&environment, "%s", (argc == 2) ? argv[1] :
+ if (asprintf(&environment, "%s", (argc == 2) ? argv[1] :
PRINTER_DRIVER_ARCHITECTURE) < 0) {
SAFE_FREE(servername);
return WERR_NOMEM;
@@ -1642,17 +1658,19 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
{
POLICY_HND handle;
WERROR werror;
+ NTSTATUS status;
char *servername = NULL, *printername = NULL;
- FORM form;
bool got_handle = False;
-
+ union spoolss_AddFormInfo info;
+ struct spoolss_AddFormInfo1 info1;
+
/* Parse the command arguments */
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
return WERR_OK;
}
-
+
/* Get a printer handle */
if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
@@ -1664,8 +1682,8 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
return WERR_NOMEM;
}
- werror = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
- PRINTER_ALL_ACCESS,
+ werror = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
+ PRINTER_ALL_ACCESS,
servername, cli->auth->user_name,
&handle);
@@ -1676,23 +1694,29 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Dummy up some values for the form data */
- form.flags = FORM_USER;
- form.size_x = form.size_y = 100;
- form.left = 0;
- form.top = 10;
- form.right = 20;
- form.bottom = 30;
+ info1.flags = FORM_USER;
+ info1.form_name = argv[2];
+ info1.size.width = 100;
+ info1.size.height = 100;
+ info1.area.left = 0;
+ info1.area.top = 10;
+ info1.area.right = 20;
+ info1.area.bottom = 30;
- init_unistr2(&form.name, argv[2], UNI_STR_TERMINATE);
+ info.info1 = &info1;
/* Add the form */
- werror = rpccli_spoolss_addform(cli, mem_ctx, &handle, 1, &form);
+ status = rpccli_spoolss_AddForm(cli, mem_ctx,
+ &handle,
+ 1,
+ info,
+ &werror);
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1708,17 +1732,19 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
{
POLICY_HND handle;
WERROR werror;
+ NTSTATUS status;
char *servername = NULL, *printername = NULL;
- FORM form;
bool got_handle = False;
-
+ union spoolss_AddFormInfo info;
+ struct spoolss_AddFormInfo1 info1;
+
/* Parse the command arguments */
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
return WERR_OK;
}
-
+
/* Get a printer handle */
if (asprintf(&servername, "\\\\%s", cli->desthost)) {
@@ -1731,7 +1757,7 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
}
werror = rpccli_spoolss_open_printer_ex(
- cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
+ cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
servername, cli->auth->user_name, &handle);
if (!W_ERROR_IS_OK(werror))
@@ -1741,22 +1767,29 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Dummy up some values for the form data */
- form.flags = FORM_PRINTER;
- form.size_x = form.size_y = 100;
- form.left = 0;
- form.top = 1000;
- form.right = 2000;
- form.bottom = 3000;
+ info1.flags = FORM_PRINTER;
+ info1.size.width = 100;
+ info1.size.height = 100;
+ info1.area.left = 0;
+ info1.area.top = 1000;
+ info1.area.right = 2000;
+ info1.area.bottom = 3000;
+ info1.form_name = argv[2];
- init_unistr2(&form.name, argv[2], UNI_STR_TERMINATE);
+ info.info1 = &info1;
/* Set the form */
- werror = rpccli_spoolss_setform(cli, mem_ctx, &handle, 1, argv[2], &form);
+ status = rpccli_spoolss_SetForm(cli, mem_ctx,
+ &handle,
+ argv[2],
+ 1,
+ info,
+ &werror);
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1795,45 +1828,64 @@ static void display_form(FORM_1 *form)
printf("%s\n" \
"\tflag: %s (%d)\n" \
"\twidth: %d, length: %d\n" \
- "\tleft: %d, right: %d, top: %d, bottom: %d\n\n",
+ "\tleft: %d, right: %d, top: %d, bottom: %d\n\n",
form_name, get_form_flag(form->flag), form->flag,
- form->width, form->length,
- form->left, form->right,
+ form->width, form->length,
+ form->left, form->right,
form->top, form->bottom);
}
/****************************************************************************
****************************************************************************/
+static void display_form_info1(struct spoolss_FormInfo1 *r)
+{
+ printf("%s\n" \
+ "\tflag: %s (%d)\n" \
+ "\twidth: %d, length: %d\n" \
+ "\tleft: %d, right: %d, top: %d, bottom: %d\n\n",
+ r->form_name, get_form_flag(r->flags), r->flags,
+ r->size.width, r->size.height,
+ r->area.left, r->area.right,
+ r->area.top, r->area.bottom);
+}
+
+/****************************************************************************
+****************************************************************************/
+
static WERROR cmd_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
POLICY_HND handle;
WERROR werror;
+ NTSTATUS status;
char *servername = NULL, *printername = NULL;
- FORM_1 form;
bool got_handle = False;
-
+ DATA_BLOB buffer;
+ uint32_t offered = 0;
+ union spoolss_FormInfo info;
+ uint32_t needed;
+
/* Parse the command arguments */
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
return WERR_OK;
}
-
+
/* Get a printer handle */
if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
return WERR_NOMEM;
}
strupper_m(servername);
- if (asprintf(&printername, "%s\\%s", servername, argv[1])) {
+ if (asprintf(&printername, "%s\\%s", servername, argv[1]) == -1) {
SAFE_FREE(servername);
return WERR_NOMEM;
}
werror = rpccli_spoolss_open_printer_ex(
- cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
+ cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
servername, cli->auth->user_name, &handle);
if (!W_ERROR_IS_OK(werror))
@@ -1843,16 +1895,37 @@ static WERROR cmd_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Get the form */
- werror = rpccli_spoolss_getform(cli, mem_ctx, &handle, argv[2], 1, &form);
-
- if (!W_ERROR_IS_OK(werror))
- goto done;
-
- display_form(&form);
+ status = rpccli_spoolss_GetForm(cli, mem_ctx,
+ &handle,
+ argv[2],
+ 1,
+ NULL,
+ offered,
+ &info,
+ &needed,
+ &werror);
+ if (W_ERROR_EQUAL(werror, WERR_INSUFFICIENT_BUFFER)) {
+ buffer = data_blob_talloc(mem_ctx, NULL, needed);
+ offered = needed;
+ status = rpccli_spoolss_GetForm(cli, mem_ctx,
+ &handle,
+ argv[2],
+ 1,
+ &buffer,
+ offered,
+ &info,
+ &needed,
+ &werror);
+ }
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return werror;
+ }
+ display_form_info1(&info.info1);
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1863,22 +1936,23 @@ static WERROR cmd_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
POLICY_HND handle;
WERROR werror;
+ NTSTATUS status;
char *servername = NULL, *printername = NULL;
bool got_handle = False;
-
+
/* Parse the command arguments */
if (argc != 3) {
printf ("Usage: %s <printer> <formname>\n", argv[0]);
return WERR_OK;
}
-
+
/* Get a printer handle */
if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
@@ -1891,7 +1965,7 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
}
werror = rpccli_spoolss_open_printer_ex(
- cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
+ cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
servername, cli->auth->user_name, &handle);
if (!W_ERROR_IS_OK(werror))
@@ -1901,11 +1975,17 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
/* Delete the form */
- werror = rpccli_spoolss_deleteform(cli, mem_ctx, &handle, argv[2]);
+ status = rpccli_spoolss_DeleteForm(cli, mem_ctx,
+ &handle,
+ argv[2],
+ &werror);
+ if (!NT_STATUS_IS_OK(status)) {
+ return ntstatus_to_werror(status);
+ }
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -1916,8 +1996,8 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
POLICY_HND handle;
@@ -1926,14 +2006,14 @@ static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
bool got_handle = False;
uint32 num_forms, level = 1, i;
FORM_1 *forms;
-
+
/* Parse the command arguments */
if (argc != 2) {
printf ("Usage: %s <printer>\n", argv[0]);
return WERR_OK;
}
-
+
/* Get a printer handle */
if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
@@ -1946,7 +2026,7 @@ static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
}
werror = rpccli_spoolss_open_printer_ex(
- cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
+ cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
servername, cli->auth->user_name, &handle);
if (!W_ERROR_IS_OK(werror))
@@ -1971,7 +2051,7 @@ static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
done:
if (got_handle)
- rpccli_spoolss_close_printer(cli, mem_ctx, &handle);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &handle, NULL);
SAFE_FREE(servername);
SAFE_FREE(printername);
@@ -2035,7 +2115,7 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
/* get a printer handle */
result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
- MAXIMUM_ALLOWED_ACCESS, servername,
+ MAXIMUM_ALLOWED_ACCESS, servername,
user, &pol);
if (!W_ERROR_IS_OK(result))
goto done;
@@ -2048,12 +2128,12 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
if (!W_ERROR_IS_OK(result))
goto done;
-
+
printf("%s\n", current_timestring(tmp_ctx, True));
printf("\tchange_id (before set)\t:[0x%x]\n", info.change_id);
/* Set the printer data */
-
+
fstrcpy(value.valuename, argv[3]);
switch (value.type) {
@@ -2123,18 +2203,18 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
}
result = rpccli_spoolss_setprinterdata(cli, mem_ctx, &pol, &value);
-
+
if (!W_ERROR_IS_OK(result)) {
printf ("Unable to set [%s=%s]!\n", argv[3], argv[4]);
goto done;
}
printf("\tSetPrinterData succeeded [%s: %s]\n", argv[3], argv[4]);
-
+
result = rpccli_spoolss_getprinter(cli, mem_ctx, &pol, 0, &ctr);
if (!W_ERROR_IS_OK(result))
goto done;
-
+
printf("%s\n", current_timestring(tmp_ctx, True));
printf("\tchange_id (after set)\t:[0x%x]\n", info.change_id);
@@ -2142,7 +2222,7 @@ done:
/* cleanup */
TALLOC_FREE(tmp_ctx);
if (opened_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
return result;
}
@@ -2192,8 +2272,8 @@ static void display_job_info_2(JOB_INFO_2 *job)
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_jobs(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_enum_jobs(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
WERROR result;
@@ -2257,10 +2337,10 @@ static WERROR cmd_spoolss_enum_jobs(struct rpc_pipe_client *cli,
break;
}
}
-
+
done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2268,8 +2348,8 @@ done:
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_data( struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_enum_data( struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
WERROR result;
@@ -2305,7 +2385,7 @@ static WERROR cmd_spoolss_enum_data( struct rpc_pipe_client *cli,
if (!W_ERROR_IS_OK(result))
goto done;
-
+
got_hnd = True;
/* Enumerate data */
@@ -2326,7 +2406,7 @@ static WERROR cmd_spoolss_enum_data( struct rpc_pipe_client *cli,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2334,8 +2414,8 @@ done:
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_data_ex( struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_enum_data_ex( struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
WERROR result;
@@ -2370,18 +2450,18 @@ static WERROR cmd_spoolss_enum_data_ex( struct rpc_pipe_client *cli,
return WERR_NOMEM;
}
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
- "", MAXIMUM_ALLOWED_ACCESS,
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
+ "", MAXIMUM_ALLOWED_ACCESS,
servername, user, &hnd);
if (!W_ERROR_IS_OK(result))
goto done;
-
+
got_hnd = True;
/* Enumerate subkeys */
- if ( !(ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) )
+ if ( !(ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) )
return WERR_NOMEM;
result = rpccli_spoolss_enumprinterdataex(cli, mem_ctx, &hnd, keyname, ctr);
@@ -2397,7 +2477,7 @@ static WERROR cmd_spoolss_enum_data_ex( struct rpc_pipe_client *cli,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2405,8 +2485,8 @@ done:
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_enum_printerkey( struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_enum_printerkey( struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
WERROR result;
@@ -2444,13 +2524,13 @@ static WERROR cmd_spoolss_enum_printerkey( struct rpc_pipe_client *cli,
}
- result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
- "", MAXIMUM_ALLOWED_ACCESS,
+ result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername,
+ "", MAXIMUM_ALLOWED_ACCESS,
servername, user, &hnd);
if (!W_ERROR_IS_OK(result))
goto done;
-
+
got_hnd = True;
/* Enumerate subkeys */
@@ -2477,7 +2557,7 @@ done:
SAFE_FREE(keylist);
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2485,8 +2565,8 @@ done:
/****************************************************************************
****************************************************************************/
-static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
fstring servername, printername;
@@ -2511,7 +2591,7 @@ static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
strupper_m(printername);
result = rpccli_spoolss_open_printer_ex(
- cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
+ cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
servername, cli->auth->user_name, &hnd);
if (!W_ERROR_IS_OK(result)) {
@@ -2560,9 +2640,9 @@ static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
goto done;
}
-done:
+done:
if (got_hnd)
- rpccli_spoolss_close_printer(cli, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
}
@@ -2630,7 +2710,7 @@ static bool compare_printer_secdesc( struct rpc_pipe_client *cli1, POLICY_HND *h
goto done;
}
printf("ok\n");
-
+
printf("++ ");
@@ -2639,24 +2719,24 @@ static bool compare_printer_secdesc( struct rpc_pipe_client *cli1, POLICY_HND *h
result = False;
goto done;
}
-
+
sd1 = ctr1.printers_3->secdesc;
sd2 = ctr2.printers_3->secdesc;
-
+
if ( (sd1 != sd2) && ( !sd1 || !sd2 ) ) {
printf("NULL secdesc!\n");
result = False;
goto done;
}
-
+
if (!sec_desc_equal( sd1, sd2 ) ) {
printf("Security Descriptors *not* equal!\n");
result = False;
goto done;
}
-
+
printf("Security descriptors match\n");
-
+
done:
talloc_destroy(mem_ctx);
return result;
@@ -2668,8 +2748,8 @@ done:
extern struct user_auth_info *rpcclient_auth_info;
-static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
fstring printername, servername1, servername2;
@@ -2695,7 +2775,7 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
/* first get the connection to the remote server */
- nt_status = cli_full_connection(&cli_server2, global_myname(), servername2,
+ nt_status = cli_full_connection(&cli_server2, global_myname(), servername2,
NULL, 0,
"IPC$", "IPC",
get_cmdline_auth_info_username(rpcclient_auth_info),
@@ -2725,7 +2805,7 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
return WERR_NOMEM;
}
printf("Opening %s...", printername_path);
- werror = rpccli_spoolss_open_printer_ex( cli, mem_ctx, printername_path,
+ werror = rpccli_spoolss_open_printer_ex( cli, mem_ctx, printername_path,
"", PRINTER_ALL_ACCESS, servername1, cli_server1->user_name, &hPrinter1);
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", win_errstr(werror));
@@ -2741,7 +2821,7 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
return WERR_NOMEM;
}
printf("Opening %s...", printername_path);
- werror = rpccli_spoolss_open_printer_ex( cli2, mem_ctx, printername_path,
+ werror = rpccli_spoolss_open_printer_ex( cli2, mem_ctx, printername_path,
"", PRINTER_ALL_ACCESS, servername2, cli_server2->user_name, &hPrinter2 );
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", win_errstr(werror));
@@ -2760,8 +2840,8 @@ done:
/* cleanup */
printf("Closing printers...");
- rpccli_spoolss_close_printer( cli, mem_ctx, &hPrinter1 );
- rpccli_spoolss_close_printer( cli2, mem_ctx, &hPrinter2 );
+ rpccli_spoolss_ClosePrinter( cli, mem_ctx, &hPrinter1, NULL );
+ rpccli_spoolss_ClosePrinter( cli2, mem_ctx, &hPrinter2, NULL );
printf("ok\n");
/* close the second remote connection */
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 4807e62436..f4df58df92 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -2037,10 +2037,11 @@ static bool api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
char *str2 = skip_string(param,tpscnt,str1);
char *p = skip_string(param,tpscnt,str2);
- struct pdb_search *search;
- struct samr_displayentry *entries;
-
- int num_entries;
+ uint32_t num_groups;
+ uint32_t resume_handle;
+ struct rpc_pipe_client *samr_pipe;
+ struct policy_handle samr_handle, domain_handle;
+ NTSTATUS status;
if (!str1 || !str2 || !p) {
return False;
@@ -2062,14 +2063,31 @@ static bool api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
return False;
}
- /* get list of domain groups SID_DOMAIN_GRP=2 */
- become_root();
- search = pdb_search_groups();
- unbecome_root();
+ status = rpc_pipe_open_internal(
+ talloc_tos(), &ndr_table_samr.syntax_id, rpc_samr_dispatch,
+ conn->server_info, &samr_pipe);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("api_RNetUserEnum: Could not connect to samr: %s\n",
+ nt_errstr(status)));
+ return false;
+ }
- if (search == NULL) {
- DEBUG(3,("api_RNetGroupEnum:failed to get group list"));
- return False;
+ status = rpccli_samr_Connect2(samr_pipe, talloc_tos(), global_myname(),
+ SAMR_ACCESS_OPEN_DOMAIN, &samr_handle);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("api_RNetUserEnum: samr_Connect2 failed: %s\n",
+ nt_errstr(status)));
+ return false;
+ }
+
+ status = rpccli_samr_OpenDomain(samr_pipe, talloc_tos(), &samr_handle,
+ SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS,
+ get_global_sam_sid(), &domain_handle);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("api_RNetUserEnum: samr_OpenDomain failed: %s\n",
+ nt_errstr(status)));
+ rpccli_samr_Close(samr_pipe, talloc_tos(), &samr_handle);
+ return false;
}
resume_context = get_safe_SVAL(param,tpscnt,p,0,-1);
@@ -2077,11 +2095,6 @@ static bool api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
DEBUG(10,("api_RNetGroupEnum:resume context: %d, client buffer size: "
"%d\n", resume_context, cli_buf_size));
- become_root();
- num_entries = pdb_search_entries(search, resume_context, 0xffffffff,
- &entries);
- unbecome_root();
-
*rdata_len = cli_buf_size;
*rdata = smb_realloc_limit(*rdata,*rdata_len);
if (!*rdata) {
@@ -2090,25 +2103,63 @@ static bool api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
p = *rdata;
- for(i=0; i<num_entries; i++) {
- fstring name;
- fstrcpy(name, entries[i].account_name);
- if( ((PTR_DIFF(p,*rdata)+21) <= *rdata_len) ) {
+ errflags = NERR_Success;
+ num_groups = 0;
+ resume_handle = 0;
+
+ while (true) {
+ struct samr_SamArray *sam_entries;
+ uint32_t num_entries;
+
+ status = rpccli_samr_EnumDomainGroups(samr_pipe, talloc_tos(),
+ &domain_handle,
+ &resume_handle,
+ &sam_entries, 1,
+ &num_entries);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(10, ("rpccli_samr_EnumDomainGroups returned "
+ "%s\n", nt_errstr(status)));
+ break;
+ }
+
+ if (num_entries == 0) {
+ DEBUG(10, ("rpccli_samr_EnumDomainGroups returned "
+ "no entries -- done\n"));
+ break;
+ }
+
+ for(i=0; i<num_entries; i++) {
+ const char *name;
+
+ name = sam_entries->entries[i].name.string;
+
+ if( ((PTR_DIFF(p,*rdata)+21) > *rdata_len) ) {
+ /* set overflow error */
+ DEBUG(3,("overflow on entry %d group %s\n", i,
+ name));
+ errflags=234;
+ break;
+ }
+
/* truncate the name at 21 chars. */
- memcpy(p, name, 21);
+ memset(p, 0, 21);
+ strlcpy(p, name, 21);
DEBUG(10,("adding entry %d group %s\n", i, p));
p += 21;
- p += 5; /* Both NT4 and W2k3SP1 do padding here.
- No idea why... */
- } else {
- /* set overflow error */
- DEBUG(3,("overflow on entry %d group %s\n", i, name));
- errflags=234;
+ p += 5; /* Both NT4 and W2k3SP1 do padding here. No
+ * idea why... */
+ num_groups += 1;
+ }
+
+ if (errflags != NERR_Success) {
break;
}
+
+ TALLOC_FREE(sam_entries);
}
- pdb_search_destroy(search);
+ rpccli_samr_Close(samr_pipe, talloc_tos(), &domain_handle);
+ rpccli_samr_Close(samr_pipe, talloc_tos(), &samr_handle);
*rdata_len = PTR_DIFF(p,*rdata);
@@ -2119,8 +2170,8 @@ static bool api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
}
SSVAL(*rparam, 0, errflags);
SSVAL(*rparam, 2, 0); /* converter word */
- SSVAL(*rparam, 4, i); /* is this right?? */
- SSVAL(*rparam, 6, resume_context+num_entries); /* is this right?? */
+ SSVAL(*rparam, 4, num_groups); /* is this right?? */
+ SSVAL(*rparam, 6, resume_context+num_groups); /* is this right?? */
return(True);
}
@@ -2353,6 +2404,7 @@ static bool api_RNetUserEnum(connection_struct *conn, uint16 vuid,
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("api_RNetUserEnum: samr_OpenDomain failed: %s\n",
nt_errstr(status)));
+ rpccli_samr_Close(samr_pipe, talloc_tos(), &samr_handle);
return false;
}
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 7ea6e39fcb..e9b581efe8 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -4209,10 +4209,14 @@ bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, SMB_
{
SMB_ACL_T def_acl = NULL;
- if (num_def_acls && !S_ISDIR(psbuf->st_mode)) {
- DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname ));
- errno = EISDIR;
- return False;
+ if (!S_ISDIR(psbuf->st_mode)) {
+ if (num_def_acls) {
+ DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname ));
+ errno = EISDIR;
+ return False;
+ } else {
+ return True;
+ }
}
if (!num_def_acls) {
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index c9fc1fbb6a..8539e04bd5 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1623,6 +1623,7 @@ void chain_reply(struct smb_request *req)
exit_server_cleanly("chain_reply: srv_send_smb "
"failed.");
}
+ TALLOC_FREE(req);
return;
}
@@ -1737,6 +1738,7 @@ void chain_reply(struct smb_request *req)
IS_CONN_ENCRYPTED(req->conn)||req->encrypted)) {
exit_server_cleanly("construct_reply: srv_send_smb failed.");
}
+ TALLOC_FREE(req);
}
/****************************************************************************
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 1210a36a39..9cf41d88c7 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "wbc_async.h"
extern char *optarg;
extern int optind;
@@ -5497,14 +5498,14 @@ static bool run_local_memcache(int dummy)
static void wbclient_done(struct async_req *req)
{
- NTSTATUS status;
+ wbcErr wbc_err;
struct winbindd_response *wb_resp;
int *i = (int *)req->async.priv;
- status = wb_trans_recv(req, req, &wb_resp);
+ wbc_err = wb_trans_recv(req, req, &wb_resp);
TALLOC_FREE(req);
*i += 1;
- d_printf("wb_trans_recv %d returned %s\n", *i, nt_errstr(status));
+ d_printf("wb_trans_recv %d returned %s\n", *i, wbcErrorString(wbc_err));
}
static bool run_local_wbclient(int dummy)
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 31e87ca804..0c2cd24fb2 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -576,12 +576,6 @@ static int net_conf_addshare(struct net_context *c,
goto done;
}
- if (getpwnam(sharename)) {
- d_fprintf(stderr, "ERROR: share name %s is already a valid "
- "system user name.\n", sharename);
- goto done;
- }
-
if (strequal(sharename, GLOBAL_NAME)) {
d_fprintf(stderr,
"ERROR: 'global' is not a valid share name.\n");
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index c750e46b67..ad9be05798 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -1006,11 +1006,11 @@ static bool get_printer_info(struct rpc_pipe_client *pipe_hnd,
return false;
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, ctr)) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
return false;
}
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
*num_printers = 1;
@@ -1242,7 +1242,7 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_
done:
if (got_hnd)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
return nt_status;
}
@@ -1383,7 +1383,7 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
done:
if (got_hnd)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
return nt_status;
}
@@ -1522,12 +1522,12 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
@@ -1538,11 +1538,11 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
done:
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
}
if (cli_dst) {
@@ -1668,8 +1668,10 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
for (f = 0; f < num_forms; f++) {
- FORM form;
+ union spoolss_AddFormInfo info;
+ struct spoolss_AddFormInfo1 info1;
fstring form_name;
+ NTSTATUS status;
/* only migrate FORM_PRINTER types, according to jerry
FORM_BUILTIN-types are hard-coded in samba */
@@ -1685,20 +1687,24 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
f, form_name, forms[f].flag);
/* is there a more elegant way to do that ? */
- form.flags = FORM_PRINTER;
- form.size_x = forms[f].width;
- form.size_y = forms[f].length;
- form.left = forms[f].left;
- form.top = forms[f].top;
- form.right = forms[f].right;
- form.bottom = forms[f].bottom;
+ info1.flags = FORM_PRINTER;
+ info1.size.width = forms[f].width;
+ info1.size.height = forms[f].length;
+ info1.area.left = forms[f].left;
+ info1.area.top = forms[f].top;
+ info1.area.right = forms[f].right;
+ info1.area.bottom = forms[f].bottom;
+ info1.form_name = form_name;
- init_unistr2(&form.name, form_name, UNI_STR_TERMINATE);
+ info.info1 = &info1;
/* FIXME: there might be something wrong with samba's
builtin-forms */
- result = rpccli_spoolss_addform(pipe_hnd_dst, mem_ctx,
- &hnd_dst, 1, &form);
+ status = rpccli_spoolss_AddForm(pipe_hnd_dst, mem_ctx,
+ &hnd_dst,
+ 1,
+ info,
+ &result);
if (!W_ERROR_IS_OK(result)) {
d_printf("\tAddForm form %d: [%s] refused.\n",
f, form_name);
@@ -1711,12 +1717,12 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
}
@@ -1726,10 +1732,10 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
done:
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);
@@ -1933,13 +1939,13 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
/* close dst */
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
/* close src */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
}
@@ -1949,10 +1955,10 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
done:
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);
@@ -2067,7 +2073,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
DEBUG(1,("printer already exists: %s\n", sharename));
/* close printer handle here - dst only, not got src yet. */
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
continue;
@@ -2103,12 +2109,12 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
}
@@ -2117,10 +2123,10 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
done:
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);
@@ -2486,12 +2492,12 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
/* close printer handles here */
if (got_hnd_src) {
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
got_hnd_src = false;
}
if (got_hnd_dst) {
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
got_hnd_dst = false;
}
@@ -2505,10 +2511,10 @@ done:
SAFE_FREE(unc_name);
if (got_hnd_src)
- rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
+ rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL);
if (got_hnd_dst)
- rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
+ rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL);
if (cli_dst) {
cli_shutdown(cli_dst);
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index 481ac1b9ad..3a64979f33 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -203,29 +203,21 @@ static bool idmap_tdb_upgrade(struct db_context *db)
return True;
}
-static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx,
- bool check_config,
- struct db_context **dbctx)
+static NTSTATUS idmap_tdb_load_ranges(void)
{
- NTSTATUS ret;
- TALLOC_CTX *ctx;
- char *tdbfile = NULL;
- struct db_context *db = NULL;
- int32_t version;
uid_t low_uid = 0;
uid_t high_uid = 0;
gid_t low_gid = 0;
gid_t high_gid = 0;
- bool config_error = false;
- /* load ranges */
- if (!lp_idmap_uid(&low_uid, &high_uid)
- || !lp_idmap_gid(&low_gid, &high_gid)) {
- DEBUG(1, ("idmap uid or idmap gid missing\n"));
- config_error = true;
- if (check_config) {
- return NT_STATUS_UNSUCCESSFUL;
- }
+ if (!lp_idmap_uid(&low_uid, &high_uid)) {
+ DEBUG(1, ("idmap uid missing\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ if (!lp_idmap_gid(&low_gid, &high_gid)) {
+ DEBUG(1, ("idmap gid missing\n"));
+ return NT_STATUS_UNSUCCESSFUL;
}
idmap_tdb_state.low_uid = low_uid;
@@ -235,29 +227,41 @@ static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx,
if (idmap_tdb_state.high_uid <= idmap_tdb_state.low_uid) {
DEBUG(1, ("idmap uid range missing or invalid\n"));
- config_error = true;
- if (check_config) {
- return NT_STATUS_UNSUCCESSFUL;
- }
+ return NT_STATUS_UNSUCCESSFUL;
}
if (idmap_tdb_state.high_gid <= idmap_tdb_state.low_gid) {
DEBUG(1, ("idmap gid range missing or invalid\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx,
+ bool check_config,
+ struct db_context **dbctx)
+{
+ NTSTATUS ret;
+ TALLOC_CTX *ctx;
+ char *tdbfile = NULL;
+ struct db_context *db = NULL;
+ int32_t version;
+ bool config_error = false;
+
+ ret = idmap_tdb_load_ranges();
+ if (!NT_STATUS_IS_OK(ret)) {
config_error = true;
if (check_config) {
- return NT_STATUS_UNSUCCESSFUL;
+ return ret;
}
}
/* use our own context here */
- ctx = talloc_new(memctx);
- if (!ctx) {
- DEBUG(0, ("Out of memory!\n"));
- return NT_STATUS_NO_MEMORY;
- }
+ ctx = talloc_stackframe();
/* use the old database if present */
- tdbfile = talloc_strdup(ctx, state_path("winbindd_idmap.tdb"));
+ tdbfile = state_path("winbindd_idmap.tdb");
if (!tdbfile) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
@@ -402,6 +406,7 @@ static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid)
const char *hwmtype;
uint32_t high_hwm;
uint32_t hwm;
+ int res;
/* Get current high water mark */
switch (xid->type) {
@@ -423,7 +428,14 @@ static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid)
return NT_STATUS_INVALID_PARAMETER;
}
+ res = idmap_alloc_db->transaction_start(idmap_alloc_db);
+ if (res != 0) {
+ DEBUG(1, (__location__ " Failed to start transaction.\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
if ((hwm = dbwrap_fetch_int32(idmap_alloc_db, hwmkey)) == -1) {
+ idmap_alloc_db->transaction_cancel(idmap_alloc_db);
return NT_STATUS_INTERNAL_DB_ERROR;
}
@@ -431,6 +443,7 @@ static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid)
if (hwm > high_hwm) {
DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
hwmtype, (unsigned long)high_hwm));
+ idmap_alloc_db->transaction_cancel(idmap_alloc_db);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -438,6 +451,7 @@ static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid)
ret = dbwrap_change_uint32_atomic(idmap_alloc_db, hwmkey, &hwm, 1);
if (ret != 0) {
DEBUG(0, ("Fatal error while fetching a new %s value\n!", hwmtype));
+ idmap_alloc_db->transaction_cancel(idmap_alloc_db);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -445,9 +459,16 @@ static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid)
if (hwm > high_hwm) {
DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
hwmtype, (unsigned long)high_hwm));
+ idmap_alloc_db->transaction_cancel(idmap_alloc_db);
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ res = idmap_alloc_db->transaction_commit(idmap_alloc_db);
+ if (res != 0) {
+ DEBUG(1, (__location__ " Failed to commit transaction.\n"));
return NT_STATUS_UNSUCCESSFUL;
}
-
+
xid->id = hwm;
DEBUG(10,("New %s = %d\n", hwmtype, hwm));
@@ -694,10 +715,10 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map
TDB_DATA data;
char *keystr;
unsigned long rec_id = 0;
- fstring tmp;
+ TALLOC_CTX *tmp_ctx = talloc_stackframe();
- if ((keystr = talloc_asprintf(
- ctx, "%s", sid_to_fstring(tmp, map->sid))) == NULL) {
+ keystr = sid_string_talloc(tmp_ctx, map->sid);
+ if (keystr == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
@@ -706,7 +727,7 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map
DEBUG(10,("Fetching record %s\n", keystr));
/* Check if sid is present in database */
- data = dbwrap_fetch_bystring(ctx->db, NULL, keystr);
+ data = dbwrap_fetch_bystring(ctx->db, tmp_ctx, keystr);
if (!data.dptr) {
DEBUG(10,("Record %s not found\n", keystr));
ret = NT_STATUS_NONE_MAPPED;
@@ -730,8 +751,6 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map
DEBUG(2, ("Found INVALID record %s -> %s\n", keystr, (const char *)data.dptr));
ret = NT_STATUS_INTERNAL_DB_ERROR;
}
-
- TALLOC_FREE(data.dptr);
/* apply filters before returning result */
if ((ctx->filter_low_id && (map->xid.id < ctx->filter_low_id)) ||
@@ -742,7 +761,7 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map
}
done:
- talloc_free(keystr);
+ talloc_free(tmp_ctx);
return ret;
}
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c
index 8bde963c60..fb90dd097e 100644
--- a/source3/winbindd/idmap_tdb2.c
+++ b/source3/winbindd/idmap_tdb2.c
@@ -54,6 +54,43 @@ static struct db_context *idmap_tdb2;
static NTSTATUS idmap_tdb2_alloc_load(void);
+static NTSTATUS idmap_tdb2_load_ranges(void)
+{
+ uid_t low_uid = 0;
+ uid_t high_uid = 0;
+ gid_t low_gid = 0;
+ gid_t high_gid = 0;
+
+ if (!lp_idmap_uid(&low_uid, &high_uid)) {
+ DEBUG(1, ("idmap uid missing\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ if (!lp_idmap_gid(&low_gid, &high_gid)) {
+ DEBUG(1, ("idmap gid missing\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ idmap_tdb2_state.low_uid = low_uid;
+ idmap_tdb2_state.high_uid = high_uid;
+ idmap_tdb2_state.low_gid = low_gid;
+ idmap_tdb2_state.high_gid = high_gid;
+
+ if (idmap_tdb2_state.high_uid <= idmap_tdb2_state.low_uid) {
+ DEBUG(1, ("idmap uid range missing or invalid\n"));
+ DEBUGADD(1, ("idmap will be unable to map foreign SIDs\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ if (idmap_tdb2_state.high_gid <= idmap_tdb2_state.low_gid) {
+ DEBUG(1, ("idmap gid range missing or invalid\n"));
+ DEBUGADD(1, ("idmap will be unable to map foreign SIDs\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ return NT_STATUS_OK;
+}
+
/*
open the permanent tdb
*/
@@ -94,10 +131,7 @@ static NTSTATUS idmap_tdb2_open_db(void)
*/
static NTSTATUS idmap_tdb2_alloc_load(void)
{
- uid_t low_uid = 0;
- uid_t high_uid = 0;
- gid_t low_gid = 0;
- gid_t high_gid = 0;
+ NTSTATUS status;
uint32 low_id;
/* see if a idmap script is configured */
@@ -111,27 +145,15 @@ static NTSTATUS idmap_tdb2_alloc_load(void)
/* load ranges */
- /* Create high water marks for group and user id */
- if (!lp_idmap_uid(&low_uid, &high_uid)
- || !lp_idmap_gid(&low_gid, &high_gid)) {
- DEBUG(1, ("idmap uid or idmap gid missing\n"));
- return NT_STATUS_UNSUCCESSFUL;
+ status = idmap_tdb2_load_ranges();
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
- idmap_tdb2_state.low_uid = low_uid;
- idmap_tdb2_state.high_uid = high_uid;
- idmap_tdb2_state.low_gid = low_gid;
- idmap_tdb2_state.high_gid = high_gid;
-
- if (idmap_tdb2_state.high_uid <= idmap_tdb2_state.low_uid) {
- DEBUG(1, ("idmap uid range missing or invalid\n"));
- DEBUGADD(1, ("idmap will be unable to map foreign SIDs\n"));
- return NT_STATUS_UNSUCCESSFUL;
- }
+ /* Create high water marks for group and user id */
- if (((low_id = dbwrap_fetch_int32(idmap_tdb2,
- HWM_USER)) == -1) ||
- (low_id < idmap_tdb2_state.low_uid)) {
+ low_id = dbwrap_fetch_int32(idmap_tdb2, HWM_USER);
+ if ((low_id == -1) || (low_id < idmap_tdb2_state.low_uid)) {
if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
idmap_tdb2, HWM_USER,
idmap_tdb2_state.low_uid))) {
@@ -141,15 +163,8 @@ static NTSTATUS idmap_tdb2_alloc_load(void)
}
}
- if (idmap_tdb2_state.high_gid <= idmap_tdb2_state.low_gid) {
- DEBUG(1, ("idmap gid range missing or invalid\n"));
- DEBUGADD(1, ("idmap will be unable to map foreign SIDs\n"));
- return NT_STATUS_UNSUCCESSFUL;
- }
-
- if (((low_id = dbwrap_fetch_int32(idmap_tdb2,
- HWM_GROUP)) == -1) ||
- (low_id < idmap_tdb2_state.low_gid)) {
+ low_id = dbwrap_fetch_int32(idmap_tdb2, HWM_GROUP);
+ if ((low_id == -1) || (low_id < idmap_tdb2_state.low_gid)) {
if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
idmap_tdb2, HWM_GROUP,
idmap_tdb2_state.low_gid))) {
@@ -557,12 +572,13 @@ static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_tdb2_context *ctx, struct id_m
TDB_DATA data;
char *keystr;
unsigned long rec_id = 0;
- NTSTATUS status;
+ TALLOC_CTX *tmp_ctx = talloc_stackframe();
- status = idmap_tdb2_open_db();
- NT_STATUS_NOT_OK_RETURN(status);
+ ret = idmap_tdb2_open_db();
+ NT_STATUS_NOT_OK_RETURN(ret);
- if ((keystr = sid_string_talloc(ctx, map->sid)) == NULL) {
+ keystr = sid_string_talloc(tmp_ctx, map->sid);
+ if (keystr == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
@@ -571,7 +587,7 @@ static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_tdb2_context *ctx, struct id_m
DEBUG(10,("Fetching record %s\n", keystr));
/* Check if sid is present in database */
- data = dbwrap_fetch_bystring(idmap_tdb2, keystr, keystr);
+ data = dbwrap_fetch_bystring(idmap_tdb2, tmp_ctx, keystr);
if (!data.dptr) {
fstring idstr;
@@ -626,7 +642,7 @@ static NTSTATUS idmap_tdb2_sid_to_id(struct idmap_tdb2_context *ctx, struct id_m
}
done:
- talloc_free(keystr);
+ talloc_free(tmp_ctx);
return ret;
}
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 977ee9c6b1..c302dd1d62 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -67,27 +67,6 @@ bool winbindd_setup_sig_term_handler(bool parent);
bool winbindd_setup_sig_hup_handler(const char *lfile);
int main(int argc, char **argv, char **envp);
-/* The following definitions come from winbindd/winbindd_reqtrans.c */
-
-struct async_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
- int fd, size_t max_extra_data);
-NTSTATUS wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
- struct winbindd_request **preq);
-struct async_req *wb_req_write_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev, int fd,
- struct winbindd_request *wb_req);
-NTSTATUS wb_req_write_recv(struct async_req *req);
-
-struct async_req *wb_resp_read_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev, int fd);
-NTSTATUS wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
- struct winbindd_response **presp);
-struct async_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev, int fd,
- struct winbindd_response *wb_resp);
-NTSTATUS wb_resp_write_recv(struct async_req *req);
-
/* The following definitions come from winbindd/winbindd_ads.c */
diff --git a/source3/winbindd/winbindd_user.c b/source3/winbindd/winbindd_user.c
index 62fd4d7f07..8b481f972c 100644
--- a/source3/winbindd/winbindd_user.c
+++ b/source3/winbindd/winbindd_user.c
@@ -80,11 +80,12 @@ static bool winbindd_fill_pwent(TALLOC_CTX *ctx, char *dom_name, char *user_name
if (!pw || !dom_name || !user_name)
return False;
- domain = find_domain_from_name_noinit(dom_name);
+ domain = find_domain_from_name(dom_name);
if (domain == NULL) {
- DEBUG(5,("winbindd_fill_pwent: Failed to find domain for %s. "
- "Disabling name alias support\n", dom_name));
+ DEBUG(5,("winbindd_fill_pwent: Failed to find domain for %s.\n",
+ dom_name));
nt_status = NT_STATUS_NO_SUCH_DOMAIN;
+ return false;
}
/* Resolve the uid number */
diff --git a/source4/Makefile b/source4/Makefile
index 267e302c9f..508836f6da 100644
--- a/source4/Makefile
+++ b/source4/Makefile
@@ -146,7 +146,7 @@ endif
clean::
@find ../lib ../libcli ../librpc ../nsswitch -name '*.o' -o -name '*.ho' | xargs rm -f
-PUBLIC_HEADES += $(srcdir)/version.h
+PUBLIC_HEADERS += $(srcdir)/version.h
libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
modules:: $(PLUGINS)
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c
index 6fcab80ce6..3eacf9ada1 100644
--- a/source4/auth/credentials/pycredentials.c
+++ b/source4/auth/credentials/pycredentials.c
@@ -34,8 +34,7 @@ struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj)
if (py_obj == Py_None) {
return cli_credentials_init_anon(NULL);
}
-
- /* FIXME: Check type? */
+
return PyCredentials_AsCliCredentials(py_obj);
}
@@ -53,7 +52,7 @@ static PyObject *py_creds_new(PyTypeObject *type, PyObject *args, PyObject *kwar
static PyObject *py_creds_get_username(py_talloc_Object *self)
{
- return PyString_FromStringOrNULL(cli_credentials_get_username(self->ptr));
+ return PyString_FromStringOrNULL(cli_credentials_get_username(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_set_username(py_talloc_Object *self, PyObject *args)
@@ -63,12 +62,12 @@ static PyObject *py_creds_set_username(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
return NULL;
- return PyBool_FromLong(cli_credentials_set_username(self->ptr, newval, obt));
+ return PyBool_FromLong(cli_credentials_set_username(PyCredentials_AsCliCredentials(self), newval, obt));
}
static PyObject *py_creds_get_password(py_talloc_Object *self)
{
- return PyString_FromStringOrNULL(cli_credentials_get_password(self->ptr));
+ return PyString_FromStringOrNULL(cli_credentials_get_password(PyCredentials_AsCliCredentials(self)));
}
@@ -79,12 +78,12 @@ static PyObject *py_creds_set_password(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
return NULL;
- return PyBool_FromLong(cli_credentials_set_password(self->ptr, newval, obt));
+ return PyBool_FromLong(cli_credentials_set_password(PyCredentials_AsCliCredentials(self), newval, obt));
}
static PyObject *py_creds_get_domain(py_talloc_Object *self)
{
- return PyString_FromStringOrNULL(cli_credentials_get_domain(self->ptr));
+ return PyString_FromStringOrNULL(cli_credentials_get_domain(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_set_domain(py_talloc_Object *self, PyObject *args)
@@ -94,12 +93,12 @@ static PyObject *py_creds_set_domain(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
return NULL;
- return PyBool_FromLong(cli_credentials_set_domain(self->ptr, newval, obt));
+ return PyBool_FromLong(cli_credentials_set_domain(PyCredentials_AsCliCredentials(self), newval, obt));
}
static PyObject *py_creds_get_realm(py_talloc_Object *self)
{
- return PyString_FromStringOrNULL(cli_credentials_get_realm(self->ptr));
+ return PyString_FromStringOrNULL(cli_credentials_get_realm(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_set_realm(py_talloc_Object *self, PyObject *args)
@@ -109,12 +108,12 @@ static PyObject *py_creds_set_realm(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
return NULL;
- return PyBool_FromLong(cli_credentials_set_realm(self->ptr, newval, obt));
+ return PyBool_FromLong(cli_credentials_set_realm(PyCredentials_AsCliCredentials(self), newval, obt));
}
static PyObject *py_creds_get_bind_dn(py_talloc_Object *self)
{
- return PyString_FromStringOrNULL(cli_credentials_get_bind_dn(self->ptr));
+ return PyString_FromStringOrNULL(cli_credentials_get_bind_dn(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_set_bind_dn(py_talloc_Object *self, PyObject *args)
@@ -123,12 +122,12 @@ static PyObject *py_creds_set_bind_dn(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &newval))
return NULL;
- return PyBool_FromLong(cli_credentials_set_bind_dn(self->ptr, newval));
+ return PyBool_FromLong(cli_credentials_set_bind_dn(PyCredentials_AsCliCredentials(self), newval));
}
static PyObject *py_creds_get_workstation(py_talloc_Object *self)
{
- return PyString_FromStringOrNULL(cli_credentials_get_workstation(self->ptr));
+ return PyString_FromStringOrNULL(cli_credentials_get_workstation(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_set_workstation(py_talloc_Object *self, PyObject *args)
@@ -138,33 +137,33 @@ static PyObject *py_creds_set_workstation(py_talloc_Object *self, PyObject *args
if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
return NULL;
- return PyBool_FromLong(cli_credentials_set_workstation(self->ptr, newval, obt));
+ return PyBool_FromLong(cli_credentials_set_workstation(PyCredentials_AsCliCredentials(self), newval, obt));
}
static PyObject *py_creds_is_anonymous(py_talloc_Object *self)
{
- return PyBool_FromLong(cli_credentials_is_anonymous(self->ptr));
+ return PyBool_FromLong(cli_credentials_is_anonymous(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_set_anonymous(py_talloc_Object *self)
{
- cli_credentials_set_anonymous(self->ptr);
+ cli_credentials_set_anonymous(PyCredentials_AsCliCredentials(self));
Py_RETURN_NONE;
}
static PyObject *py_creds_authentication_requested(py_talloc_Object *self)
{
- return PyBool_FromLong(cli_credentials_authentication_requested(self->ptr));
+ return PyBool_FromLong(cli_credentials_authentication_requested(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_wrong_password(py_talloc_Object *self)
{
- return PyBool_FromLong(cli_credentials_wrong_password(self->ptr));
+ return PyBool_FromLong(cli_credentials_wrong_password(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_set_cmdline_callbacks(py_talloc_Object *self)
{
- return PyBool_FromLong(cli_credentials_set_cmdline_callbacks(self->ptr));
+ return PyBool_FromLong(cli_credentials_set_cmdline_callbacks(PyCredentials_AsCliCredentials(self)));
}
static PyObject *py_creds_parse_string(py_talloc_Object *self, PyObject *args)
@@ -174,15 +173,15 @@ static PyObject *py_creds_parse_string(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
return NULL;
- cli_credentials_parse_string(self->ptr, newval, obt);
+ cli_credentials_parse_string(PyCredentials_AsCliCredentials(self), newval, obt);
Py_RETURN_NONE;
}
static PyObject *py_creds_get_nt_hash(py_talloc_Object *self)
{
- const struct samr_Password *ntpw = cli_credentials_get_nt_hash(self->ptr, self->ptr);
+ const struct samr_Password *ntpw = cli_credentials_get_nt_hash(PyCredentials_AsCliCredentials(self), self->ptr);
- return PyString_FromStringAndSize((char *)ntpw->hash, 16);
+ return PyString_FromStringAndSize(discard_const_p(char, ntpw->hash), 16);
}
static PyObject *py_creds_set_kerberos_state(py_talloc_Object *self, PyObject *args)
@@ -191,7 +190,7 @@ static PyObject *py_creds_set_kerberos_state(py_talloc_Object *self, PyObject *a
if (!PyArg_ParseTuple(args, "i", &state))
return NULL;
- cli_credentials_set_kerberos_state(self->ptr, state);
+ cli_credentials_set_kerberos_state(PyCredentials_AsCliCredentials(self), state);
Py_RETURN_NONE;
}
@@ -206,7 +205,7 @@ static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args)
if (lp_ctx == NULL)
return NULL;
- cli_credentials_guess(self->ptr, lp_ctx);
+ cli_credentials_guess(PyCredentials_AsCliCredentials(self), lp_ctx);
Py_RETURN_NONE;
}
@@ -223,7 +222,7 @@ static PyObject *py_creds_set_machine_account(py_talloc_Object *self, PyObject *
if (lp_ctx == NULL)
return NULL;
- status = cli_credentials_set_machine_account(self->ptr, lp_ctx);
+ status = cli_credentials_set_machine_account(PyCredentials_AsCliCredentials(self), lp_ctx);
PyErr_NTSTATUS_IS_ERR_RAISE(status);
Py_RETURN_NONE;
diff --git a/source4/auth/credentials/pycredentials.h b/source4/auth/credentials/pycredentials.h
index 4424127775..f2e15fad61 100644
--- a/source4/auth/credentials/pycredentials.h
+++ b/source4/auth/credentials/pycredentials.h
@@ -25,6 +25,6 @@
PyAPI_DATA(PyTypeObject) PyCredentials;
struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);
#define PyCredentials_Check(py_obj) PyObject_TypeCheck(py_obj, &PyCredentials)
-#define PyCredentials_AsCliCredentials(py_obj) py_talloc_get_ptr(py_obj)
+#define PyCredentials_AsCliCredentials(py_obj) py_talloc_get_type(py_obj, struct cli_credentials)
#endif /* _PYCREDENTIALS_H_ */
diff --git a/source4/auth/ntlm/auth.c b/source4/auth/ntlm/auth.c
index d00c81206a..20967a6bda 100644
--- a/source4/auth/ntlm/auth.c
+++ b/source4/auth/ntlm/auth.c
@@ -462,7 +462,7 @@ _PUBLIC_ NTSTATUS auth_register(const struct auth_operations *ops)
struct auth_backend, num_backends+1);
NT_STATUS_HAVE_NO_MEMORY(backends);
- new_ops = talloc_memdup(backends, ops, sizeof(*ops));
+ new_ops = (struct auth_operations *)talloc_memdup(backends, ops, sizeof(*ops));
NT_STATUS_HAVE_NO_MEMORY(new_ops);
new_ops->name = talloc_strdup(new_ops, ops->name);
NT_STATUS_HAVE_NO_MEMORY(new_ops->name);
diff --git a/source4/auth/pyauth.h b/source4/auth/pyauth.h
index de1c1c54ea..f5c63392ac 100644
--- a/source4/auth/pyauth.h
+++ b/source4/auth/pyauth.h
@@ -24,7 +24,7 @@
#include "auth/session.h"
PyAPI_DATA(PyTypeObject) PyAuthSession;
-#define PyAuthSession_AsSession(obj) py_talloc_get_ptr(obj)
+#define PyAuthSession_AsSession(obj) py_talloc_get_type(obj, struct auth_session_info)
#define PyAuthSession_Check(obj) PyObject_TypeCheck(obj, &PyAuthSession)
struct auth_session_info *PyObject_AsSession(PyObject *obj);
PyObject *PyAuthSession_FromSession(struct auth_session_info *session);
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index ef2af060f2..81b960979f 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -51,8 +51,10 @@ void PyErr_SetLdbError(int ret, struct ldb_context *ldb_ctx)
{
if (ret == LDB_ERR_PYTHON_EXCEPTION)
return; /* Python exception should already be set, just keep that */
- PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", ret, ldb_ctx == NULL?ldb_strerror(ret):ldb_errstring(ldb_ctx)));
+ PyErr_SetObject(PyExc_LdbError, Py_BuildValue(discard_const_p(char, "(i,s)"),
+ ret, ldb_ctx == NULL?ldb_strerror(ret):ldb_errstring(ldb_ctx)));
}
+
static PyObject *PyObject_FromLdbValue(struct ldb_context *ldb_ctx,
struct ldb_message_element *el,
struct ldb_val *val)
@@ -298,9 +300,11 @@ static PyObject *py_ldb_dn_new(PyTypeObject *type, PyObject *args, PyObject *kwa
PyObject *py_ldb;
struct ldb_context *ldb_ctx;
PyLdbDnObject *py_ret;
- const char *kwnames[] = { "ldb", "dn", NULL };
+ const char * const kwnames[] = { "ldb", "dn", NULL };
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Os", (char **)kwnames, &py_ldb, &str))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Os",
+ discard_const_p(char *, kwnames),
+ &py_ldb, &str))
return NULL;
ldb_ctx = PyLdb_AsLdbContext(py_ldb);
@@ -361,8 +365,8 @@ PyTypeObject PyLdbDn = {
static void py_ldb_debug(void *context, enum ldb_debug_level level, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3, 0);
static void py_ldb_debug(void *context, enum ldb_debug_level level, const char *fmt, va_list ap)
{
- PyObject *fn = context;
- PyObject_CallFunction(fn, (char *)"(i,O)", level, PyString_FromFormatV(fmt, ap));
+ PyObject *fn = (PyObject *)context;
+ PyObject_CallFunction(fn, discard_const_p(char, "(i,O)"), level, PyString_FromFormatV(fmt, ap));
}
static PyObject *py_ldb_set_debug(PyLdbObject *self, PyObject *args)
@@ -488,7 +492,7 @@ static const char **PyList_AsStringList(TALLOC_CTX *mem_ctx, PyObject *list)
static int py_ldb_init(PyLdbObject *self, PyObject *args, PyObject *kwargs)
{
- const char *kwnames[] = { "url", "flags", "options", NULL };
+ const char * const kwnames[] = { "url", "flags", "options", NULL };
char *url = NULL;
PyObject *py_options = Py_None;
const char **options;
@@ -496,8 +500,9 @@ static int py_ldb_init(PyLdbObject *self, PyObject *args, PyObject *kwargs)
int ret;
struct ldb_context *ldb;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ziO:Ldb.__init__", (char **)kwnames,
- &url, &flags, &py_options))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ziO:Ldb.__init__",
+ discard_const_p(char *, kwnames),
+ &url, &flags, &py_options))
return -1;
ldb = PyLdb_AsLdbContext(self);
@@ -548,9 +553,11 @@ static PyObject *py_ldb_connect(PyLdbObject *self, PyObject *args, PyObject *kwa
PyObject *py_options = Py_None;
int ret;
const char **options;
- const char *kwnames[] = { "url", "flags", "options", NULL };
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|iO", (char **)kwnames, &url, &flags,
- &py_options))
+ const char * const kwnames[] = { "url", "flags", "options", NULL };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|iO",
+ discard_const_p(char *, kwnames),
+ &url, &flags, &py_options))
return NULL;
if (py_options == Py_None) {
@@ -721,8 +728,9 @@ static PyObject *ldb_ldif_to_pyobject(struct ldb_ldif *ldif)
} else {
/* We don't want this attached to the 'ldb' any more */
talloc_steal(NULL, ldif);
- return Py_BuildValue((char *)"(iO)", ldif->changetype,
- PyLdbMessage_FromMessage(ldif->msg));
+ return Py_BuildValue(discard_const_p(char, "(iO)"),
+ ldif->changetype,
+ PyLdbMessage_FromMessage(ldif->msg));
}
}
@@ -786,7 +794,7 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
char *expr = NULL;
PyObject *py_attrs = Py_None;
PyObject *py_controls = Py_None;
- const char *kwnames[] = { "base", "scope", "expression", "attrs", "controls", NULL };
+ const char * const kwnames[] = { "base", "scope", "expression", "attrs", "controls", NULL };
int ret;
struct ldb_result *res;
struct ldb_request *req;
@@ -795,8 +803,9 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
struct ldb_control **parsed_controls;
struct ldb_dn *base;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OizOO", (char **)kwnames,
- &py_base, &scope, &expr, &py_attrs, &py_controls))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OizOO",
+ discard_const_p(char *, kwnames),
+ &py_base, &scope, &expr, &py_attrs, &py_controls))
return NULL;
ldb_ctx = PyLdb_AsLdbContext(self);
@@ -1009,7 +1018,7 @@ static PyObject *py_ldb_get_firstmodule(PyLdbObject *self, void *closure)
}
static PyGetSetDef py_ldb_getset[] = {
- { (char *)"firstmodule", (getter)py_ldb_get_firstmodule, NULL, NULL },
+ { discard_const_p(char, "firstmodule"), (getter)py_ldb_get_firstmodule, NULL, NULL },
{ NULL }
};
@@ -1109,10 +1118,12 @@ static PyObject *py_ldb_module_search(PyLdbModuleObject *self, PyObject *args, P
PyObject *py_base, *py_tree, *py_attrs;
int ret, scope;
struct ldb_request *req;
- const char *kwnames[] = { "base", "scope", "tree", "attrs", NULL };
+ const char * const kwnames[] = { "base", "scope", "tree", "attrs", NULL };
struct ldb_module *mod;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiOO", (char **)kwnames,
- &py_base, &scope, &py_tree, &py_attrs))
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiOO",
+ discard_const_p(char *, kwnames),
+ &py_base, &scope, &py_tree, &py_attrs))
return NULL;
mod = self->mod;
@@ -1372,9 +1383,12 @@ static PyObject *py_ldb_msg_element_new(PyTypeObject *type, PyObject *args, PyOb
struct ldb_message_element *el;
int flags = 0;
char *name = NULL;
- const char *kwnames[] = { "elements", "flags", "name", NULL };
+ const char * const kwnames[] = { "elements", "flags", "name", NULL };
PyLdbMessageElementObject *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Ois", (char **)kwnames, &py_elements, &flags, &name))
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Ois",
+ discard_const_p(char *, kwnames),
+ &py_elements, &flags, &name))
return NULL;
el = talloc_zero(NULL, struct ldb_message_element);
@@ -1596,11 +1610,14 @@ static PyMappingMethods py_ldb_msg_mapping = {
static PyObject *py_ldb_msg_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- const char *kwnames[] = { "dn", NULL };
+ const char * const kwnames[] = { "dn", NULL };
struct ldb_message *ret;
PyObject *pydn = NULL;
PyLdbMessageObject *py_ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", (char **)kwnames, &pydn))
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O",
+ discard_const_p(char *, kwnames),
+ &pydn))
return NULL;
ret = ldb_msg_new(NULL);
@@ -1650,7 +1667,7 @@ static int py_ldb_msg_set_dn(PyLdbMessageObject *self, PyObject *value, void *cl
}
static PyGetSetDef py_ldb_msg_getset[] = {
- { (char *)"dn", (getter)py_ldb_msg_get_dn, (setter)py_ldb_msg_set_dn, NULL },
+ { discard_const_p(char, "dn"), (getter)py_ldb_msg_get_dn, (setter)py_ldb_msg_set_dn, NULL },
{ NULL }
};
@@ -1714,7 +1731,7 @@ PyTypeObject PyLdbTree = {
/* Ldb_module */
static int py_module_search(struct ldb_module *mod, struct ldb_request *req)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result, *py_base, *py_attrs, *py_tree;
py_base = PyLdbDn_FromDn(req->op.search.base);
@@ -1737,7 +1754,9 @@ static int py_module_search(struct ldb_module *mod, struct ldb_request *req)
PyList_SetItem(py_attrs, i, PyString_FromString(req->op.search.attrs[i]));
}
- py_result = PyObject_CallMethod(py_ldb, (char *)"search", (char *)"OiOO", py_base, req->op.search.scope, py_tree, py_attrs);
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "search"),
+ discard_const_p(char, "OiOO"),
+ py_base, req->op.search.scope, py_tree, py_attrs);
Py_DECREF(py_attrs);
Py_DECREF(py_tree);
@@ -1759,16 +1778,18 @@ static int py_module_search(struct ldb_module *mod, struct ldb_request *req)
static int py_module_add(struct ldb_module *mod, struct ldb_request *req)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result, *py_msg;
- py_msg = PyLdbMessage_FromMessage((struct ldb_message *)req->op.add.message);
+ py_msg = PyLdbMessage_FromMessage(discard_const_p(struct ldb_message, req->op.add.message));
if (py_msg == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- py_result = PyObject_CallMethod(py_ldb, (char *)"add", (char *)"O", py_msg);
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "add"),
+ discard_const_p(char, "O"),
+ py_msg);
Py_DECREF(py_msg);
@@ -1783,16 +1804,18 @@ static int py_module_add(struct ldb_module *mod, struct ldb_request *req)
static int py_module_modify(struct ldb_module *mod, struct ldb_request *req)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result, *py_msg;
- py_msg = PyLdbMessage_FromMessage((struct ldb_message *)req->op.mod.message);
+ py_msg = PyLdbMessage_FromMessage(discard_const_p(struct ldb_message, req->op.mod.message));
if (py_msg == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- py_result = PyObject_CallMethod(py_ldb, (char *)"modify", (char *)"O", py_msg);
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "modify"),
+ discard_const_p(char, "O"),
+ py_msg);
Py_DECREF(py_msg);
@@ -1807,7 +1830,7 @@ static int py_module_modify(struct ldb_module *mod, struct ldb_request *req)
static int py_module_del(struct ldb_module *mod, struct ldb_request *req)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result, *py_dn;
py_dn = PyLdbDn_FromDn(req->op.del.dn);
@@ -1815,7 +1838,9 @@ static int py_module_del(struct ldb_module *mod, struct ldb_request *req)
if (py_dn == NULL)
return LDB_ERR_OPERATIONS_ERROR;
- py_result = PyObject_CallMethod(py_ldb, (char *)"delete", (char *)"O", py_dn);
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "delete"),
+ discard_const_p(char, "O"),
+ py_dn);
if (py_result == NULL) {
return LDB_ERR_PYTHON_EXCEPTION;
@@ -1828,7 +1853,7 @@ static int py_module_del(struct ldb_module *mod, struct ldb_request *req)
static int py_module_rename(struct ldb_module *mod, struct ldb_request *req)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result, *py_olddn, *py_newdn;
py_olddn = PyLdbDn_FromDn(req->op.rename.olddn);
@@ -1841,7 +1866,9 @@ static int py_module_rename(struct ldb_module *mod, struct ldb_request *req)
if (py_newdn == NULL)
return LDB_ERR_OPERATIONS_ERROR;
- py_result = PyObject_CallMethod(py_ldb, (char *)"rename", (char *)"OO", py_olddn, py_newdn);
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "rename"),
+ discard_const_p(char, "OO"),
+ py_olddn, py_newdn);
Py_DECREF(py_olddn);
Py_DECREF(py_newdn);
@@ -1857,30 +1884,33 @@ static int py_module_rename(struct ldb_module *mod, struct ldb_request *req)
static int py_module_request(struct ldb_module *mod, struct ldb_request *req)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result;
- py_result = PyObject_CallMethod(py_ldb, (char *)"request", (char *)"");
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "request"),
+ discard_const_p(char, ""));
return LDB_ERR_OPERATIONS_ERROR;
}
static int py_module_extended(struct ldb_module *mod, struct ldb_request *req)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result;
- py_result = PyObject_CallMethod(py_ldb, (char *)"extended", (char *)"");
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "extended"),
+ discard_const_p(char, ""));
return LDB_ERR_OPERATIONS_ERROR;
}
static int py_module_start_transaction(struct ldb_module *mod)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result;
- py_result = PyObject_CallMethod(py_ldb, (char *)"start_transaction", (char *)"");
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "start_transaction"),
+ discard_const_p(char, ""));
if (py_result == NULL) {
return LDB_ERR_PYTHON_EXCEPTION;
@@ -1893,10 +1923,11 @@ static int py_module_start_transaction(struct ldb_module *mod)
static int py_module_end_transaction(struct ldb_module *mod)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result;
- py_result = PyObject_CallMethod(py_ldb, (char *)"end_transaction", (char *)"");
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "end_transaction"),
+ discard_const_p(char, ""));
if (py_result == NULL) {
return LDB_ERR_PYTHON_EXCEPTION;
@@ -1909,10 +1940,11 @@ static int py_module_end_transaction(struct ldb_module *mod)
static int py_module_del_transaction(struct ldb_module *mod)
{
- PyObject *py_ldb = mod->private_data;
+ PyObject *py_ldb = (PyObject *)mod->private_data;
PyObject *py_result;
- py_result = PyObject_CallMethod(py_ldb, (char *)"del_transaction", (char *)"");
+ py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "del_transaction"),
+ discard_const_p(char, ""));
if (py_result == NULL) {
return LDB_ERR_PYTHON_EXCEPTION;
@@ -1929,9 +1961,9 @@ static int py_module_destructor(struct ldb_module *mod)
return 0;
}
-static int py_module_init (struct ldb_module *mod)
+static int py_module_init(struct ldb_module *mod)
{
- PyObject *py_class = mod->ops->private_data;
+ PyObject *py_class = (PyObject *)mod->ops->private_data;
PyObject *py_result, *py_next, *py_ldb;
py_ldb = PyLdb_FromLdbContext(mod->ldb);
@@ -1944,7 +1976,8 @@ static int py_module_init (struct ldb_module *mod)
if (py_next == NULL)
return LDB_ERR_OPERATIONS_ERROR;
- py_result = PyObject_CallFunction(py_class, (char *)"OO", py_ldb, py_next);
+ py_result = PyObject_CallFunction(py_class, discard_const_p(char, "OO"),
+ py_ldb, py_next);
if (py_result == NULL) {
return LDB_ERR_PYTHON_EXCEPTION;
@@ -1972,7 +2005,7 @@ static PyObject *py_register_module(PyObject *module, PyObject *args)
return NULL;
}
- ops->name = talloc_strdup(ops, PyString_AsString(PyObject_GetAttrString(input, (char *)"name")));
+ ops->name = talloc_strdup(ops, PyString_AsString(PyObject_GetAttrString(input, discard_const_p(char, "name"))));
Py_INCREF(input);
ops->private_data = input;
@@ -2123,7 +2156,7 @@ void initldb(void)
PyModule_AddObject(m, "__docformat__", PyString_FromString("restructuredText"));
- PyExc_LdbError = PyErr_NewException((char *)"_ldb.LdbError", NULL, NULL);
+ PyExc_LdbError = PyErr_NewException(discard_const_p(char, "_ldb.LdbError"), NULL, NULL);
PyModule_AddObject(m, "LdbError", PyExc_LdbError);
Py_INCREF(&PyLdb);
diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c
index 26b57e4f45..e9801bb425 100644
--- a/source4/lib/registry/patchfile_preg.c
+++ b/source4/lib/registry/patchfile_preg.c
@@ -64,7 +64,7 @@ static WERROR reg_preg_diff_set_value(void *_data, const char *key_name,
const char *value_name,
uint32_t value_type, DATA_BLOB value_data)
{
- struct preg_data *data = _data;
+ struct preg_data *data = (struct preg_data *)_data;
uint32_t buf;
preg_write_utf16(data->ic, data->fd, "[");
@@ -86,12 +86,12 @@ static WERROR reg_preg_diff_set_value(void *_data, const char *key_name,
static WERROR reg_preg_diff_del_key(void *_data, const char *key_name)
{
- struct preg_data *data = _data;
+ struct preg_data *data = (struct preg_data *)_data;
char *parent_name;
DATA_BLOB blob;
parent_name = talloc_strndup(data->ctx, key_name, strrchr(key_name, '\\')-key_name);
- blob.data = (void *)talloc_strndup(data->ctx, key_name+(strrchr(key_name, '\\')-key_name)+1,
+ blob.data = (uint8_t *)talloc_strndup(data->ctx, key_name+(strrchr(key_name, '\\')-key_name)+1,
strlen(key_name)-(strrchr(key_name, '\\')-key_name));
blob.length = strlen((char *)blob.data)+1;
@@ -103,13 +103,13 @@ static WERROR reg_preg_diff_del_key(void *_data, const char *key_name)
static WERROR reg_preg_diff_del_value(void *_data, const char *key_name,
const char *value_name)
{
- struct preg_data *data = _data;
+ struct preg_data *data = (struct preg_data *)_data;
char *val;
DATA_BLOB blob;
val = talloc_asprintf(data->ctx, "**Del.%s", value_name);
- blob.data = (void *)talloc(data->ctx, uint32_t);
+ blob.data = (uint8_t *)talloc(data->ctx, uint32_t);
*(uint32_t *)blob.data = 0;
blob.length = 4;
return reg_preg_diff_set_value(data, key_name, val, REG_DWORD, blob);
@@ -117,10 +117,10 @@ static WERROR reg_preg_diff_del_value(void *_data, const char *key_name,
static WERROR reg_preg_diff_del_all_values(void *_data, const char *key_name)
{
- struct preg_data *data = _data;
+ struct preg_data *data = (struct preg_data *)_data;
DATA_BLOB blob;
- blob.data = (void *)talloc(data->ctx, uint32_t);
+ blob.data = (uint8_t *)talloc(data->ctx, uint32_t);
*(uint32_t *)blob.data = 0;
blob.length = 4;
diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c
index 166543b6fd..30becbb1bb 100644
--- a/source4/lib/registry/pyregistry.c
+++ b/source4/lib/registry/pyregistry.c
@@ -18,29 +18,33 @@
*/
#include "includes.h"
+#include <tevent.h>
#include <Python.h>
#include "libcli/util/pyerrors.h"
#include "lib/registry/registry.h"
#include "scripting/python/modules.h" /* for py_iconv_convenience() */
#include <pytalloc.h>
-#include <tevent.h>
+#include "auth/credentials/pycredentials.h"
#include "param/pyparam.h"
#ifndef Py_RETURN_NONE
#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
#endif
-extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);
-
PyAPI_DATA(PyTypeObject) PyRegistryKey;
PyAPI_DATA(PyTypeObject) PyRegistry;
PyAPI_DATA(PyTypeObject) PyHiveKey;
+/*#define PyRegistryKey_AsRegistryKey(obj) py_talloc_get_type(obj, struct registry_key)*/
+#define PyRegistry_AsRegistryContext(obj) ((struct registry_context *)py_talloc_get_ptr(obj))
+#define PyHiveKey_AsHiveKey(obj) ((struct hive_key*)py_talloc_get_ptr(obj))
+
+
static PyObject *py_get_predefined_key_by_name(PyObject *self, PyObject *args)
{
char *name;
WERROR result;
- struct registry_context *ctx = py_talloc_get_ptr(self);
+ struct registry_context *ctx = PyRegistry_AsRegistryContext(self);
struct registry_key *key;
if (!PyArg_ParseTuple(args, "s", &name))
@@ -56,7 +60,7 @@ static PyObject *py_key_del_abs(PyObject *self, PyObject *args)
{
char *path;
WERROR result;
- struct registry_context *ctx = py_talloc_get_ptr(self);
+ struct registry_context *ctx = PyRegistry_AsRegistryContext(self);
if (!PyArg_ParseTuple(args, "s", &path))
return NULL;
@@ -70,7 +74,7 @@ static PyObject *py_key_del_abs(PyObject *self, PyObject *args)
static PyObject *py_get_predefined_key(PyObject *self, PyObject *args)
{
uint32_t hkey;
- struct registry_context *ctx = py_talloc_get_ptr(self);
+ struct registry_context *ctx = PyRegistry_AsRegistryContext(self);
WERROR result;
struct registry_key *key;
@@ -87,7 +91,7 @@ static PyObject *py_diff_apply(PyObject *self, PyObject *args)
{
char *filename;
WERROR result;
- struct registry_context *ctx = py_talloc_get_ptr(self);
+ struct registry_context *ctx = PyRegistry_AsRegistryContext(self);
if (!PyArg_ParseTuple(args, "s", &filename))
return NULL;
@@ -99,7 +103,7 @@ static PyObject *py_diff_apply(PyObject *self, PyObject *args)
static PyObject *py_mount_hive(PyObject *self, PyObject *args)
{
- struct registry_context *ctx = py_talloc_get_ptr(self);
+ struct registry_context *ctx = PyRegistry_AsRegistryContext(self);
uint32_t hkey;
PyObject *py_hivekey, *py_elements = Py_None;
const char **elements;
@@ -124,7 +128,7 @@ static PyObject *py_mount_hive(PyObject *self, PyObject *args)
SMB_ASSERT(ctx != NULL);
- result = reg_mount_hive(ctx, py_talloc_get_ptr(py_hivekey), hkey, elements);
+ result = reg_mount_hive(ctx, PyHiveKey_AsHiveKey(py_hivekey), hkey, elements);
PyErr_WERROR_IS_ERR_RAISE(result);
Py_RETURN_NONE;
@@ -166,7 +170,7 @@ PyTypeObject PyRegistry = {
static PyObject *py_hive_key_del(PyObject *self, PyObject *args)
{
char *name;
- struct hive_key *key = py_talloc_get_ptr(self);
+ struct hive_key *key = PyHiveKey_AsHiveKey(self);
WERROR result;
if (!PyArg_ParseTuple(args, "s", &name))
@@ -182,7 +186,7 @@ static PyObject *py_hive_key_del(PyObject *self, PyObject *args)
static PyObject *py_hive_key_flush(PyObject *self)
{
WERROR result;
- struct hive_key *key = py_talloc_get_ptr(self);
+ struct hive_key *key = PyHiveKey_AsHiveKey(self);
result = hive_key_flush(key);
PyErr_WERROR_IS_ERR_RAISE(result);
@@ -194,7 +198,7 @@ static PyObject *py_hive_key_del_value(PyObject *self, PyObject *args)
{
char *name;
WERROR result;
- struct hive_key *key = py_talloc_get_ptr(self);
+ struct hive_key *key = PyHiveKey_AsHiveKey(self);
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
@@ -212,7 +216,7 @@ static PyObject *py_hive_key_set_value(PyObject *self, PyObject *args)
uint32_t type;
DATA_BLOB value;
WERROR result;
- struct hive_key *key = py_talloc_get_ptr(self);
+ struct hive_key *key = PyHiveKey_AsHiveKey(self);
if (!PyArg_ParseTuple(args, "siz#", &name, &type, &value.data, &value.length))
return NULL;
diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c
index 4cbcb09a10..fbb9cd9de9 100644
--- a/source4/lib/registry/regf.c
+++ b/source4/lib/registry/regf.c
@@ -543,7 +543,7 @@ static WERROR regf_get_value(TALLOC_CTX *ctx, struct hive_key *key,
if (vk->data_length & 0x80000000) {
vk->data_length &=~0x80000000;
- data->data = talloc_memdup(ctx, (uint8_t *)&vk->data_offset, vk->data_length);
+ data->data = (uint8_t *)talloc_memdup(ctx, (uint8_t *)&vk->data_offset, vk->data_length);
data->length = vk->data_length;
} else {
*data = hbin_get(regf, vk->data_offset);
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index 9dcc415b7c..e1d6b0e7a6 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -701,7 +701,7 @@ NTSTATUS smb2_push_o16s16_string(struct smb2_request_buffer *buf,
}
if (*str == 0) {
- blob.data = discard_const(str);
+ blob.data = discard_const_p(uint8_t, str);
blob.length = 0;
return smb2_push_o16s16_blob(buf, ofs, blob);
}
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 3e6ea313e7..2f1b14dc37 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -753,4 +753,6 @@ idl:: $(pidldir)/lib/Parse/Pidl/IDL.pm $(pidldir)/lib/Parse/Pidl/Expr.pm
@PIDL_OUTPUTDIR="../librpc/gen_ndr" PIDL_ARGS="$(PIDL_ARGS)" CPP="$(CPP)" srcdir="$(srcdir)" PIDL="$(PIDL)" ../librpc/build_idl.sh ../librpc/idl/*.idl
@CPP="$(CPP)" PIDL="$(PIDL)" $(librpcsrcdir)/scripts/build_idl.sh PARTIAL $(librpcsrcdir)/gen_ndr $(librpcsrcdir)/idl/*.idl
-
+clean::
+ @echo "Remove ../librpc/gen_ndr files which are not commited to git"
+ @cat ../.gitignore | grep "^librpc/gen_ndr" | xargs rm -f
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c
index 371e111c67..252883c851 100644
--- a/source4/librpc/rpc/pyrpc.c
+++ b/source4/librpc/rpc/pyrpc.c
@@ -29,7 +29,9 @@
#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
#endif
-static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface, struct PyNdrRpcMethodDef *md, PyObject *args, PyObject *kwargs)
+static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface,
+ const struct PyNdrRpcMethodDef *md,
+ PyObject *args, PyObject *kwargs)
{
TALLOC_CTX *mem_ctx;
NTSTATUS status;
@@ -74,7 +76,7 @@ static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface, struct Py
static PyObject *py_dcerpc_call_wrapper(PyObject *self, PyObject *args, void *wrapped, PyObject *kwargs)
{
dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)self;
- struct PyNdrRpcMethodDef *md = wrapped;
+ const struct PyNdrRpcMethodDef *md = (const struct PyNdrRpcMethodDef *)wrapped;
return py_dcerpc_run_function(iface, md, args, kwargs);
}
@@ -85,7 +87,7 @@ bool PyInterface_AddNdrRpcMethods(PyTypeObject *ifacetype, const struct PyNdrRpc
int i;
for (i = 0; mds[i].name; i++) {
PyObject *ret;
- struct wrapperbase *wb = calloc(sizeof(struct wrapperbase), 1);
+ struct wrapperbase *wb = (struct wrapperbase *)calloc(sizeof(struct wrapperbase), 1);
wb->name = discard_const_p(char, mds[i].name);
wb->flags = PyWrapperFlag_KEYWORDS;
diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
index 134897e906..073fd9992c 100644
--- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
+++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
@@ -127,43 +127,43 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
{
struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, server->ntptr->lp_ctx);
if (strcmp("W3SvcInstalled", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 0;
return WERR_OK;
} else if (strcmp("BeepEnabled", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 0;
return WERR_OK;
} else if (strcmp("EventLog", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 0;
return WERR_OK;
} else if (strcmp("NetPopup", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 0;
return WERR_OK;
} else if (strcmp("NetPopupToComputer", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 0;
return WERR_OK;
} else if (strcmp("MajorVersion", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 3;
return WERR_OK;
} else if (strcmp("MinorVersion", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 0;
return WERR_OK;
} else if (strcmp("DefaultSpoolDirectory", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
r->out.data.string = "C:\\PRINTERS";
return WERR_OK;
} else if (strcmp("Architecture", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
r->out.data.string = SPOOLSS_ARCHITECTURE_NT_X86;
return WERR_OK;
} else if (strcmp("DsPresent", r->in.value_name) == 0) {
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 1;
return WERR_OK;
} else if (strcmp("OSVersion", r->in.value_name) == 0) {
@@ -181,7 +181,7 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
return WERR_GENERAL_FAILURE;
}
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
r->out.data.binary = blob;
return WERR_OK;
} else if (strcmp("OSVersionEx", r->in.value_name) == 0) {
@@ -201,13 +201,13 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
return WERR_GENERAL_FAILURE;
}
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
r->out.data.binary = blob;
return WERR_OK;
} else if (strcmp("DNSMachineName", r->in.value_name) == 0) {
if (!lp_realm(server->ntptr->lp_ctx)) return WERR_INVALID_PARAM;
- r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
+ *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
r->out.data.string = talloc_asprintf(mem_ctx, "%s.%s",
lp_netbios_name(server->ntptr->lp_ctx),
lp_realm(server->ntptr->lp_ctx));
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index d479f1e2ee..1adced44aa 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -51,7 +51,7 @@ NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
backends = talloc_realloc(talloc_autofree_context(), backends, struct pvfs_acl_backend, num_backends+1);
NT_STATUS_HAVE_NO_MEMORY(backends);
- new_ops = talloc_memdup(backends, ops, sizeof(*ops));
+ new_ops = (struct pvfs_acl_ops *)talloc_memdup(backends, ops, sizeof(*ops));
new_ops->name = talloc_strdup(new_ops, ops->name);
backends[num_backends].ops = new_ops;
diff --git a/source4/ntvfs/posix/pvfs_aio.c b/source4/ntvfs/posix/pvfs_aio.c
index 56566e3592..e2028d0017 100644
--- a/source4/ntvfs/posix/pvfs_aio.c
+++ b/source4/ntvfs/posix/pvfs_aio.c
@@ -145,7 +145,7 @@ NTSTATUS pvfs_aio_pwrite(struct ntvfs_request *req, union smb_write *wr,
state = talloc(req, struct pvfs_aio_write_state);
NT_STATUS_HAVE_NO_MEMORY(state);
- io_prep_pwrite(&iocb, f->handle->fd, wr->writex.in.data,
+ io_prep_pwrite(&iocb, f->handle->fd, discard_const(wr->writex.in.data),
wr->writex.in.count, wr->writex.in.offset);
state->ae = tevent_add_aio(req->ctx->event_ctx, req->ctx->event_ctx, &iocb,
pvfs_aio_write_handler, state);
diff --git a/source4/ntvfs/posix/pvfs_flush.c b/source4/ntvfs/posix/pvfs_flush.c
index 6e09c1f34a..f425fccec7 100644
--- a/source4/ntvfs/posix/pvfs_flush.c
+++ b/source4/ntvfs/posix/pvfs_flush.c
@@ -42,7 +42,8 @@ NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_flush *io)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
switch (io->generic.level) {
diff --git a/source4/ntvfs/posix/pvfs_fsinfo.c b/source4/ntvfs/posix/pvfs_fsinfo.c
index 9a836fac32..10fb7cf707 100644
--- a/source4/ntvfs/posix/pvfs_fsinfo.c
+++ b/source4/ntvfs/posix/pvfs_fsinfo.c
@@ -85,7 +85,8 @@ NTSTATUS pvfs_fsinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_fsinfo *fs)
{
NTSTATUS status;
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
uint64_t blocks_free, blocks_total;
uint_t bpunit;
struct stat st;
diff --git a/source4/ntvfs/posix/pvfs_ioctl.c b/source4/ntvfs/posix/pvfs_ioctl.c
index 92d3eae061..f263e9852b 100644
--- a/source4/ntvfs/posix/pvfs_ioctl.c
+++ b/source4/ntvfs/posix/pvfs_ioctl.c
@@ -38,7 +38,8 @@ static NTSTATUS pvfs_ioctl_old(struct ntvfs_module_context *ntvfs,
static NTSTATUS pvfs_ntioctl(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_ioctl *io)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
f = pvfs_find_fd(pvfs, req, io->ntioctl.in.file.ntvfs);
diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c
index 2353baeff4..711c924ae3 100644
--- a/source4/ntvfs/posix/pvfs_lock.c
+++ b/source4/ntvfs/posix/pvfs_lock.c
@@ -90,7 +90,8 @@ static void pvfs_lock_async_failed(struct pvfs_state *pvfs,
*/
static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice reason)
{
- struct pvfs_pending_lock *pending = private_data;
+ struct pvfs_pending_lock *pending = talloc_get_type(private_data,
+ struct pvfs_pending_lock);
struct pvfs_state *pvfs = pending->pvfs;
struct pvfs_file *f = pending->f;
struct ntvfs_request *req = pending->req;
@@ -277,7 +278,8 @@ static NTSTATUS pvfs_lock_cancel(struct pvfs_state *pvfs, struct ntvfs_request *
NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_lock *lck)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
struct smb_lock_entry *locks;
int i;
diff --git a/source4/ntvfs/posix/pvfs_mkdir.c b/source4/ntvfs/posix/pvfs_mkdir.c
index 8cc96173ad..6ec9e60955 100644
--- a/source4/ntvfs/posix/pvfs_mkdir.c
+++ b/source4/ntvfs/posix/pvfs_mkdir.c
@@ -96,7 +96,8 @@ static NTSTATUS pvfs_t2mkdir(struct pvfs_state *pvfs,
NTSTATUS pvfs_mkdir(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_mkdir *md)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
NTSTATUS status;
struct pvfs_filename *name;
mode_t mode;
@@ -153,7 +154,8 @@ NTSTATUS pvfs_mkdir(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_rmdir(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, struct smb_rmdir *rd)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
NTSTATUS status;
struct pvfs_filename *name;
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index fe3c915576..12f50fcc97 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -868,7 +868,8 @@ struct pvfs_odb_retry {
/* destroy a pending request */
static int pvfs_odb_retry_destructor(struct pvfs_odb_retry *r)
{
- struct pvfs_state *pvfs = r->ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(r->ntvfs->private_data,
+ struct pvfs_state);
if (r->odb_locking_key.data) {
struct odb_lock *lck;
lck = odb_lock(r->req, pvfs->odb_context, &r->odb_locking_key);
@@ -913,7 +914,8 @@ NTSTATUS pvfs_odb_retry_setup(struct ntvfs_module_context *ntvfs,
void *private_data,
enum pvfs_wait_notice reason))
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_odb_retry *r;
struct pvfs_wait *wait_handle;
NTSTATUS status;
@@ -1039,7 +1041,8 @@ static NTSTATUS pvfs_open_deny_dos(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_open *io,
struct pvfs_file *f, struct odb_lock *lck)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f2;
struct pvfs_filename *name;
NTSTATUS status;
@@ -1120,7 +1123,8 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs,
struct odb_lock *lck,
NTSTATUS parent_status)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
NTSTATUS status;
struct timeval end_time;
struct timeval *final_timeout = NULL;
@@ -1174,7 +1178,8 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_open *io)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
int flags = 0;
struct pvfs_filename *name;
struct pvfs_file *f;
@@ -1627,7 +1632,8 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_close *io)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
if (io->generic.level == RAW_CLOSE_SPLCLOSE) {
@@ -1684,7 +1690,8 @@ NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f, *next;
for (f=pvfs->files.list;f;f=next) {
@@ -1704,7 +1711,8 @@ NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_exit(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f, *next;
for (f=pvfs->files.list;f;f=next) {
diff --git a/source4/ntvfs/posix/pvfs_oplock.c b/source4/ntvfs/posix/pvfs_oplock.c
index 71add72987..e5a069addc 100644
--- a/source4/ntvfs/posix/pvfs_oplock.c
+++ b/source4/ntvfs/posix/pvfs_oplock.c
@@ -245,7 +245,8 @@ NTSTATUS pvfs_setup_oplock(struct pvfs_file *f, uint32_t oplock_granted)
NTSTATUS pvfs_oplock_release(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_lock *lck)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
uint8_t oplock_break;
NTSTATUS status;
diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c
index 3196cf2f8d..bfc9a8441c 100644
--- a/source4/ntvfs/posix/pvfs_qfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_qfileinfo.c
@@ -338,7 +338,8 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
NTSTATUS pvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_fileinfo *info)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_filename *name;
NTSTATUS status;
@@ -374,7 +375,8 @@ NTSTATUS pvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_fileinfo *info)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
struct pvfs_file_handle *h;
NTSTATUS status;
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c
index 8e1a59473f..d9080d632d 100644
--- a/source4/ntvfs/posix/pvfs_read.c
+++ b/source4/ntvfs/posix/pvfs_read.c
@@ -29,7 +29,8 @@
NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_read *rd)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
ssize_t ret;
struct pvfs_file *f;
NTSTATUS status;
diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c
index ed90bf3d7b..7f8eab5aa0 100644
--- a/source4/ntvfs/posix/pvfs_rename.c
+++ b/source4/ntvfs/posix/pvfs_rename.c
@@ -103,7 +103,7 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx,
char *dest, *d;
/* the length is bounded by the length of the two strings combined */
- dest = talloc_size(mem_ctx, strlen(fname) + strlen(pattern) + 1);
+ dest = talloc_array(mem_ctx, char, strlen(fname) + strlen(pattern) + 1);
if (dest == NULL) {
return NULL;
}
@@ -133,6 +133,8 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx,
*d = 0;
+ talloc_set_name_const(dest, dest);
+
return dest;
}
@@ -247,7 +249,8 @@ static NTSTATUS pvfs_rename_setup_retry(struct ntvfs_module_context *ntvfs,
struct odb_lock *lck,
NTSTATUS status)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct timeval end_time;
if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) {
@@ -393,7 +396,8 @@ static NTSTATUS pvfs_rename_wildcard(struct pvfs_state *pvfs,
static NTSTATUS pvfs_rename_mv(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_rename *ren)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
NTSTATUS status;
struct pvfs_filename *name1, *name2;
struct odb_lock *lck = NULL;
@@ -470,7 +474,8 @@ static NTSTATUS pvfs_rename_stream(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_rename *ren,
struct pvfs_filename *name1)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
NTSTATUS status;
struct odb_lock *lck = NULL;
@@ -522,7 +527,8 @@ static NTSTATUS pvfs_rename_stream(struct ntvfs_module_context *ntvfs,
static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_rename *ren)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
NTSTATUS status;
struct pvfs_filename *name1, *name2;
struct odb_lock *lck = NULL;
@@ -630,7 +636,8 @@ static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_rename(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_rename *ren)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
switch (ren->generic.level) {
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c
index 43547c275b..c33323350e 100644
--- a/source4/ntvfs/posix/pvfs_resolve.c
+++ b/source4/ntvfs/posix/pvfs_resolve.c
@@ -464,7 +464,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx,
}
/* rebuild the name */
- ret = talloc_size(mem_ctx, len+1);
+ ret = talloc_array(mem_ctx, char, len+1);
if (ret == NULL) {
talloc_free(s);
return NT_STATUS_NO_MEMORY;
@@ -478,6 +478,8 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx,
}
ret[len] = 0;
+ talloc_set_name_const(ret, ret);
+
talloc_free(s);
*fname = ret;
diff --git a/source4/ntvfs/posix/pvfs_search.c b/source4/ntvfs/posix/pvfs_search.c
index 22aa297210..dc4f86b4d2 100644
--- a/source4/ntvfs/posix/pvfs_search.c
+++ b/source4/ntvfs/posix/pvfs_search.c
@@ -294,8 +294,12 @@ static void pvfs_search_cleanup(struct pvfs_state *pvfs)
time_t t = time(NULL);
for (i=0;i<MAX_OLD_SEARCHES;i++) {
- struct pvfs_search_state *search = idr_find(pvfs->search.idtree, i);
- if (search == NULL) return;
+ struct pvfs_search_state *search;
+ void *p = idr_find(pvfs->search.idtree, i);
+
+ if (p == NULL) return;
+
+ search = talloc_get_type(p, struct pvfs_search_state);
if (pvfs_list_eos(search->dir, search->current_index) &&
search->last_used != 0 &&
t > search->last_used + 30) {
@@ -316,7 +320,8 @@ static NTSTATUS pvfs_search_first_old(struct ntvfs_module_context *ntvfs,
bool (*callback)(void *, const union smb_search_data *))
{
struct pvfs_dir *dir;
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_search_state *search;
uint_t reply_count;
uint16_t search_attrib;
@@ -405,7 +410,9 @@ static NTSTATUS pvfs_search_next_old(struct ntvfs_module_context *ntvfs,
void *search_private,
bool (*callback)(void *, const union smb_search_data *))
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
+ void *p;
struct pvfs_search_state *search;
struct pvfs_dir *dir;
uint_t reply_count, max_count;
@@ -415,12 +422,14 @@ static NTSTATUS pvfs_search_next_old(struct ntvfs_module_context *ntvfs,
handle = io->search_next.in.id.handle | (io->search_next.in.id.reserved<<8);
max_count = io->search_next.in.max_count;
- search = idr_find(pvfs->search.idtree, handle);
- if (search == NULL) {
+ p = idr_find(pvfs->search.idtree, handle);
+ if (p == NULL) {
/* we didn't find the search handle */
return NT_STATUS_INVALID_HANDLE;
}
+ search = talloc_get_type(p, struct pvfs_search_state);
+
dir = search->dir;
status = pvfs_list_seek_ofs(dir, io->search_next.in.id.server_cookie,
@@ -455,7 +464,8 @@ static NTSTATUS pvfs_search_first_trans2(struct ntvfs_module_context *ntvfs,
bool (*callback)(void *, const union smb_search_data *))
{
struct pvfs_dir *dir;
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_search_state *search;
uint_t reply_count;
uint16_t search_attrib, max_count;
@@ -550,7 +560,9 @@ static NTSTATUS pvfs_search_next_trans2(struct ntvfs_module_context *ntvfs,
void *search_private,
bool (*callback)(void *, const union smb_search_data *))
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
+ void *p;
struct pvfs_search_state *search;
struct pvfs_dir *dir;
uint_t reply_count;
@@ -559,12 +571,14 @@ static NTSTATUS pvfs_search_next_trans2(struct ntvfs_module_context *ntvfs,
handle = io->t2fnext.in.handle;
- search = idr_find(pvfs->search.idtree, handle);
- if (search == NULL) {
+ p = idr_find(pvfs->search.idtree, handle);
+ if (p == NULL) {
/* we didn't find the search handle */
return NT_STATUS_INVALID_HANDLE;
}
-
+
+ search = talloc_get_type(p, struct pvfs_search_state);
+
dir = search->dir;
status = NT_STATUS_OK;
@@ -612,7 +626,8 @@ static NTSTATUS pvfs_search_first_smb2(struct ntvfs_module_context *ntvfs,
bool (*callback)(void *, const union smb_search_data *))
{
struct pvfs_dir *dir;
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_search_state *search;
uint_t reply_count;
uint16_t max_count;
@@ -714,7 +729,8 @@ static NTSTATUS pvfs_search_next_smb2(struct ntvfs_module_context *ntvfs,
void *search_private,
bool (*callback)(void *, const union smb_search_data *))
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_search_state *search;
uint_t reply_count;
uint16_t max_count;
@@ -812,7 +828,9 @@ NTSTATUS pvfs_search_next(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_search_close(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_search_close *io)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
+ void *p;
struct pvfs_search_state *search;
uint16_t handle = INVALID_SEARCH_HANDLE;
@@ -829,12 +847,14 @@ NTSTATUS pvfs_search_close(struct ntvfs_module_context *ntvfs,
break;
}
- search = idr_find(pvfs->search.idtree, handle);
- if (search == NULL) {
+ p = idr_find(pvfs->search.idtree, handle);
+ if (p == NULL) {
/* we didn't find the search handle */
return NT_STATUS_INVALID_HANDLE;
}
+ search = talloc_get_type(p, struct pvfs_search_state);
+
talloc_free(search);
return NT_STATUS_OK;
diff --git a/source4/ntvfs/posix/pvfs_seek.c b/source4/ntvfs/posix/pvfs_seek.c
index a3c4024ed7..2cd3410876 100644
--- a/source4/ntvfs/posix/pvfs_seek.c
+++ b/source4/ntvfs/posix/pvfs_seek.c
@@ -29,7 +29,8 @@ NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_seek *io)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
struct pvfs_file_handle *h;
NTSTATUS status;
diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c
index d2604485d4..9fe02a8e17 100644
--- a/source4/ntvfs/posix/pvfs_setfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_setfileinfo.c
@@ -308,7 +308,8 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_setfileinfo *info)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
struct pvfs_file_handle *h;
struct pvfs_filename newstats;
@@ -609,7 +610,8 @@ static NTSTATUS pvfs_setpathinfo_setup_retry(struct ntvfs_module_context *ntvfs,
struct odb_lock *lck,
NTSTATUS status)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct timeval end_time;
if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) {
@@ -632,7 +634,8 @@ static NTSTATUS pvfs_setpathinfo_setup_retry(struct ntvfs_module_context *ntvfs,
NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_setfileinfo *info)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_filename *name;
struct pvfs_filename newstats;
NTSTATUS status;
diff --git a/source4/ntvfs/posix/pvfs_unlink.c b/source4/ntvfs/posix/pvfs_unlink.c
index 6a57041770..e10b2e3eef 100644
--- a/source4/ntvfs/posix/pvfs_unlink.c
+++ b/source4/ntvfs/posix/pvfs_unlink.c
@@ -84,7 +84,8 @@ static NTSTATUS pvfs_unlink_setup_retry(struct ntvfs_module_context *ntvfs,
struct odb_lock *lck,
NTSTATUS status)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct timeval end_time;
if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) {
@@ -191,7 +192,8 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_unlink *unl)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_dir *dir;
NTSTATUS status;
uint32_t total_deleted=0;
diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c
index 09913bc911..81ff20a608 100644
--- a/source4/ntvfs/posix/pvfs_util.c
+++ b/source4/ntvfs/posix/pvfs_util.c
@@ -93,7 +93,7 @@ NTSTATUS pvfs_copy_file(struct pvfs_state *pvfs,
mode_t mode;
NTSTATUS status;
size_t buf_size = 0x10000;
- char *buf = talloc_size(name2, buf_size);
+ uint8_t *buf = talloc_array(name2, uint8_t, buf_size);
if (buf == NULL) {
return NT_STATUS_NO_MEMORY;
diff --git a/source4/ntvfs/posix/pvfs_wait.c b/source4/ntvfs/posix/pvfs_wait.c
index d396b94da1..5552ab0d1b 100644
--- a/source4/ntvfs/posix/pvfs_wait.c
+++ b/source4/ntvfs/posix/pvfs_wait.c
@@ -78,13 +78,12 @@ static void pvfs_wait_dispatch(struct messaging_context *msg,
}
pwait->reason = PVFS_WAIT_EVENT;
- req = pwait->req;
/* the extra reference here is to ensure that the req
structure is not destroyed when the async request reply is
sent, which would cause problems with the other ntvfs
modules above us */
- talloc_reference(msg, req);
+ req = talloc_reference(msg, pwait->req);
ntvfs_async_setup(pwait->req, pwait);
talloc_unlink(msg, req);
}
@@ -185,7 +184,8 @@ struct pvfs_wait *pvfs_wait_message(struct pvfs_state *pvfs,
*/
NTSTATUS pvfs_cancel(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_wait *pwait;
for (pwait=pvfs->wait_list;pwait;pwait=pwait->next) {
diff --git a/source4/ntvfs/posix/pvfs_write.c b/source4/ntvfs/posix/pvfs_write.c
index ba505e61d7..fb629a87fb 100644
--- a/source4/ntvfs/posix/pvfs_write.c
+++ b/source4/ntvfs/posix/pvfs_write.c
@@ -83,7 +83,8 @@ static void pvfs_trigger_write_time_update(struct pvfs_file_handle *h)
NTSTATUS pvfs_write(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_write *wr)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
ssize_t ret;
struct pvfs_file *f;
NTSTATUS status;
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c
index 6b0f32e65a..29ef701dee 100644
--- a/source4/ntvfs/posix/vfs_posix.c
+++ b/source4/ntvfs/posix/vfs_posix.c
@@ -274,7 +274,8 @@ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_chkpath *cp)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_filename *name;
NTSTATUS status;
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index 07f45d7cf6..efaedf7b41 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -36,7 +36,7 @@ typedef inquiry lenfunc;
#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
#endif
-#define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_ptr(obj)
+#define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_type(obj, struct loadparm_context)
PyAPI_DATA(PyTypeObject) PyLoadparmContext;
PyAPI_DATA(PyTypeObject) PyLoadparmService;
@@ -149,7 +149,7 @@ static PyObject *py_lp_ctx_load(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &filename))
return NULL;
- ret = lp_load((struct loadparm_context *)self->ptr, filename);
+ ret = lp_load(PyLoadparmContext_AsLoadparmContext(self), filename);
if (!ret) {
PyErr_Format(PyExc_RuntimeError, "Unable to load file %s", filename);
@@ -161,7 +161,7 @@ static PyObject *py_lp_ctx_load(py_talloc_Object *self, PyObject *args)
static PyObject *py_lp_ctx_load_default(py_talloc_Object *self)
{
bool ret;
- ret = lp_load_default(self->ptr);
+ ret = lp_load_default(PyLoadparmContext_AsLoadparmContext(self));
if (!ret) {
PyErr_SetString(PyExc_RuntimeError, "Unable to load default file");
@@ -178,7 +178,7 @@ static PyObject *py_lp_ctx_get(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s|s", &param_name, &section_name))
return NULL;
- ret = py_lp_ctx_get_helper(self->ptr, section_name, param_name);
+ ret = py_lp_ctx_get_helper(PyLoadparmContext_AsLoadparmContext(self), section_name, param_name);
if (ret == NULL)
Py_RETURN_NONE;
return ret;
@@ -190,7 +190,7 @@ static PyObject *py_lp_ctx_is_myname(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- return PyBool_FromLong(lp_is_myname(self->ptr, name));
+ return PyBool_FromLong(lp_is_myname(PyLoadparmContext_AsLoadparmContext(self), name));
}
static PyObject *py_lp_ctx_is_mydomain(py_talloc_Object *self, PyObject *args)
@@ -199,7 +199,7 @@ static PyObject *py_lp_ctx_is_mydomain(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- return PyBool_FromLong(lp_is_mydomain(self->ptr, name));
+ return PyBool_FromLong(lp_is_mydomain(PyLoadparmContext_AsLoadparmContext(self), name));
}
static PyObject *py_lp_ctx_set(py_talloc_Object *self, PyObject *args)
@@ -209,7 +209,7 @@ static PyObject *py_lp_ctx_set(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ss", &name, &value))
return NULL;
- ret = lp_set_cmdline(self->ptr, name, value);
+ ret = lp_set_cmdline(PyLoadparmContext_AsLoadparmContext(self), name, value);
if (!ret) {
PyErr_SetString(PyExc_RuntimeError, "Unable to set parameter");
return NULL;
@@ -225,7 +225,7 @@ static PyObject *py_lp_ctx_private_path(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- path = private_path(NULL, self->ptr, name);
+ path = private_path(NULL, PyLoadparmContext_AsLoadparmContext(self), name);
ret = PyString_FromString(path);
talloc_free(path);
@@ -258,12 +258,12 @@ static PyMethodDef py_lp_ctx_methods[] = {
static PyObject *py_lp_ctx_default_service(py_talloc_Object *self, void *closure)
{
- return PyLoadparmService_FromService(lp_default_service((struct loadparm_context *)self->ptr));
+ return PyLoadparmService_FromService(lp_default_service(PyLoadparmContext_AsLoadparmContext(self)));
}
static PyObject *py_lp_ctx_config_file(py_talloc_Object *self, void *closure)
{
- const char *configfile = lp_configfile(self->ptr);
+ const char *configfile = lp_configfile(PyLoadparmContext_AsLoadparmContext(self));
if (configfile == NULL)
Py_RETURN_NONE;
else
@@ -271,9 +271,9 @@ static PyObject *py_lp_ctx_config_file(py_talloc_Object *self, void *closure)
}
static PyGetSetDef py_lp_ctx_getset[] = {
- { (char *)"default_service", (getter)py_lp_ctx_default_service, NULL, NULL },
- { (char *)"configfile", (getter)py_lp_ctx_config_file, NULL,
- (char *)"Name of last config file that was loaded." },
+ { discard_const_p(char, "default_service"), (getter)py_lp_ctx_default_service, NULL, NULL },
+ { discard_const_p(char, "configfile"), (getter)py_lp_ctx_config_file, NULL,
+ discard_const_p(char, "Name of last config file that was loaded.") },
{ NULL }
};
@@ -284,7 +284,7 @@ static PyObject *py_lp_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwa
static Py_ssize_t py_lp_ctx_len(py_talloc_Object *self)
{
- return lp_numservices(self->ptr);
+ return lp_numservices(PyLoadparmContext_AsLoadparmContext(self));
}
static PyObject *py_lp_ctx_getitem(py_talloc_Object *self, PyObject *name)
@@ -294,7 +294,7 @@ static PyObject *py_lp_ctx_getitem(py_talloc_Object *self, PyObject *name)
PyErr_SetString(PyExc_TypeError, "Only string subscripts are supported");
return NULL;
}
- service = lp_service(self->ptr, PyString_AsString(name));
+ service = lp_service(PyLoadparmContext_AsLoadparmContext(self), PyString_AsString(name));
if (service == NULL) {
PyErr_SetString(PyExc_KeyError, "No such section");
return NULL;
diff --git a/source4/rpc_server/spoolss/dcesrv_spoolss.c b/source4/rpc_server/spoolss/dcesrv_spoolss.c
index 1317dba1a4..e13749754f 100644
--- a/source4/rpc_server/spoolss/dcesrv_spoolss.c
+++ b/source4/rpc_server/spoolss/dcesrv_spoolss.c
@@ -41,7 +41,7 @@ enum spoolss_handle {
#define SPOOLSS_BUFFER_UNION_ARRAY(fn,ic,info,level,count) \
((info)?ndr_size_##fn##_info(dce_call, ic, level, count, info):0)
-#define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >= r->out.needed)?val_true:val_false)
+#define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >= *r->out.needed)?val_true:val_false)
static WERROR dcesrv_spoolss_parse_printer_name(TALLOC_CTX *mem_ctx, const char *name,
const char **_server_name,
@@ -243,7 +243,7 @@ static WERROR dcesrv_spoolss_EnumPrinters(struct dcesrv_call_state *dce_call, TA
status = ntptr_EnumPrinters(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinters, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinters, ic, r->out.info, r->in.level, r->out.count);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
r->out.count = SPOOLSS_BUFFER_OK(r->out.count, 0);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
@@ -379,7 +379,7 @@ static WERROR dcesrv_spoolss_EnumPrinterDrivers(struct dcesrv_call_state *dce_ca
status = ntptr_EnumPrinterDrivers(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinterDrivers, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinterDrivers, ic, r->out.info, r->in.level, r->out.count);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
r->out.count = SPOOLSS_BUFFER_OK(r->out.count, 0);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
@@ -412,7 +412,7 @@ static WERROR dcesrv_spoolss_GetPrinterDriverDirectory(struct dcesrv_call_state
status = ntptr_GetPrinterDriverDirectory(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_DriverDirectoryInfo, ic, r->out.info, r->in.level);
+ *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_DriverDirectoryInfo, ic, r->out.info, r->in.level);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
}
@@ -564,6 +564,9 @@ static WERROR dcesrv_spoolss_GetPrinterData(struct dcesrv_call_state *dce_call,
if (!handle)
return WERR_BADFID;
+ r->out.type = talloc_zero(mem_ctx, enum spoolss_PrinterDataType);
+ W_ERROR_HAVE_NO_MEMORY(r->out.type);
+
switch (handle->type) {
case NTPTR_HANDLE_SERVER:
status = ntptr_GetPrintServerData(handle, mem_ctx, r);
@@ -575,8 +578,8 @@ static WERROR dcesrv_spoolss_GetPrinterData(struct dcesrv_call_state *dce_call,
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = ndr_size_spoolss_PrinterData(&r->out.data, r->out.type, ic, 0);
- r->out.type = SPOOLSS_BUFFER_OK(r->out.type, SPOOLSS_PRINTER_DATA_TYPE_NULL);
+ *r->out.needed = ndr_size_spoolss_PrinterData(&r->out.data, *r->out.type, ic, 0);
+ *r->out.type = SPOOLSS_BUFFER_OK(*r->out.type, SPOOLSS_PRINTER_DATA_TYPE_NULL);
r->out.data = SPOOLSS_BUFFER_OK(r->out.data, r->out.data);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_MORE_DATA);
}
@@ -716,7 +719,7 @@ static WERROR dcesrv_spoolss_GetForm(struct dcesrv_call_state *dce_call, TALLOC_
return WERR_FOOBAR;
}
- r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_FormInfo, ic, r->out.info, r->in.level);
+ *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_FormInfo, ic, r->out.info, r->in.level);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
}
@@ -783,7 +786,7 @@ static WERROR dcesrv_spoolss_EnumForms(struct dcesrv_call_state *dce_call, TALLO
return WERR_FOOBAR;
}
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumForms, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumForms, ic, r->out.info, r->in.level, r->out.count);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
r->out.count = SPOOLSS_BUFFER_OK(r->out.count, 0);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
@@ -806,7 +809,7 @@ static WERROR dcesrv_spoolss_EnumPorts(struct dcesrv_call_state *dce_call, TALLO
status = ntptr_EnumPorts(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPorts, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPorts, ic, r->out.info, r->in.level, r->out.count);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
r->out.count = SPOOLSS_BUFFER_OK(r->out.count, 0);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
@@ -829,7 +832,7 @@ static WERROR dcesrv_spoolss_EnumMonitors(struct dcesrv_call_state *dce_call, TA
status = ntptr_EnumMonitors(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumMonitors, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumMonitors, ic, r->out.info, r->in.level, r->out.count);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
r->out.count = SPOOLSS_BUFFER_OK(r->out.count, 0);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
diff --git a/source4/selftest/skip b/source4/selftest/skip
index f1500ff315..291ad8472d 100644
--- a/source4/selftest/skip
+++ b/source4/selftest/skip
@@ -42,7 +42,6 @@ ntvfs.cifs.raw.context
ntvfs.cifs.raw.qfileinfo.ipc
rpc.dssync
rpc.samsync
-ldap.uptodatevector # Segfaults
rpc.remact # Not provided by Samba 4
rpc.oxidresolve # Not provided by Samba 4
rpc.eventlog # Not provided by Samba 4
diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c
index 6200f4c3de..bf32edb065 100644
--- a/source4/torture/ldap/uptodatevector.c
+++ b/source4/torture/ldap/uptodatevector.c
@@ -127,6 +127,7 @@ static bool test_check_uptodatevector(struct torture_context *torture,
no_match = true;
} else if (utdv_val1 && !utdv_val) {
no_match = true;
+ } else if (!utdv_val1 && !utdv_val) {
} else if (utdv_val1->length != utdv_val->length) {
no_match = true;
} else if (utdv_val1->length && memcmp(utdv_val1->data, utdv_val->data, utdv_val->length) != 0) {
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 5b493db813..5f803b07d3 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -2617,12 +2617,14 @@ static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe,
struct spoolss_EnumPrinters r;
NTSTATUS status;
DATA_BLOB blob;
+ uint32_t needed;
r.in.flags = PRINTER_ENUM_LOCAL;
r.in.server = talloc_asprintf(mem_ctx, "\\\\%s", servername);
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -2638,14 +2640,14 @@ static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe,
return false;
}
- blob = data_blob_talloc_zero(mem_ctx, r.out.needed);
+ blob = data_blob_talloc_zero(mem_ctx, needed);
if (blob.data == NULL) {
d_printf("(%s) data_blob_talloc failed\n", __location__);
return false;
}
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
@@ -2668,6 +2670,7 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe,
struct spoolss_GetPrinter r;
DATA_BLOB blob;
NTSTATUS status;
+ uint32_t needed;
mem_ctx = talloc_new(ctx);
if (mem_ctx == NULL) {
@@ -2678,6 +2681,7 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe,
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -2697,14 +2701,14 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe,
r.in.handle = handle;
r.in.level = level;
- blob = data_blob_talloc(mem_ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(mem_ctx, NULL, needed);
if (blob.data == NULL) {
talloc_free(mem_ctx);
return NT_STATUS_NO_MEMORY;
}
memset(blob.data, 0, blob.length);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 4a6ff480c4..7da3209eb3 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -106,11 +106,13 @@ static bool test_EnumPorts(struct torture_context *tctx,
for (i=0;i<ARRAY_SIZE(levels);i++) {
int level = levels[i];
DATA_BLOB blob;
+ uint32_t needed;
r.in.servername = "";
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumPorts level %u\n", r.in.level);
@@ -123,10 +125,10 @@ static bool test_EnumPorts(struct torture_context *tctx,
torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER,
"EnumPorts unexpected return code");
- blob = data_blob_talloc(ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(ctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPorts(p, ctx, &r);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_EnumPorts failed");
@@ -191,6 +193,7 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx,
}
};
int i;
+ uint32_t needed;
for (i=0;i<ARRAY_SIZE(levels);i++) {
int level = levels[i].level;
@@ -201,6 +204,7 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx,
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing GetPrinterDriverDirectory level %u\n", r.in.level);
@@ -210,10 +214,10 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx,
torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER,
"GetPrinterDriverDirectory unexpected return code");
- blob = data_blob_talloc(ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(ctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetPrinterDriverDirectory(p, ctx, &r);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_GetPrinterDriverDirectory failed");
@@ -236,12 +240,14 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
for (i=0;i<ARRAY_SIZE(levels);i++) {
int level = levels[i];
DATA_BLOB blob;
+ uint32_t needed;
r.in.server = "";
r.in.environment = SPOOLSS_ARCHITECTURE_NT_X86;
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumPrinterDrivers level %u\n", r.in.level);
@@ -255,10 +261,10 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER,
"EnumPrinterDrivers failed");
- blob = data_blob_talloc(ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(ctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPrinterDrivers(p, ctx, &r);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_EnumPrinterDrivers failed");
@@ -351,11 +357,13 @@ static bool test_EnumMonitors(struct torture_context *tctx,
for (i=0;i<ARRAY_SIZE(levels);i++) {
int level = levels[i];
DATA_BLOB blob;
+ uint32_t needed;
r.in.servername = "";
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumMonitors level %u\n", r.in.level);
@@ -368,10 +376,10 @@ static bool test_EnumMonitors(struct torture_context *tctx,
torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER,
"EnumMonitors failed");
- blob = data_blob_talloc(ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(ctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumMonitors(p, ctx, &r);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_EnumMonitors failed");
@@ -420,12 +428,14 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx,
for (i=0;i<ARRAY_SIZE(levels);i++) {
int level = levels[i];
DATA_BLOB blob;
+ uint32_t needed;
r.in.servername = "";
r.in.environment = "Windows NT x86";
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumPrintProcessors level %u\n", r.in.level);
@@ -438,10 +448,10 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx,
torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER,
"EnumPrintProcessors unexpected return code");
- blob = data_blob_talloc(ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(ctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPrintProcessors(p, ctx, &r);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_EnumPrintProcessors failed");
@@ -489,12 +499,14 @@ static bool test_EnumPrinters(struct torture_context *tctx,
for (i=0;i<ARRAY_SIZE(levels);i++) {
int level = levels[i];
DATA_BLOB blob;
+ uint32_t needed;
r.in.flags = PRINTER_ENUM_LOCAL;
r.in.server = "";
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumPrinters level %u\n", r.in.level);
@@ -507,10 +519,10 @@ static bool test_EnumPrinters(struct torture_context *tctx,
torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER,
"EnumPrinters unexpected return code");
- blob = data_blob_talloc(ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(ctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPrinters(p, ctx, &r);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_EnumPrinters failed");
@@ -605,12 +617,14 @@ static bool test_GetPrinter(struct torture_context *tctx,
struct spoolss_GetPrinter r;
uint16_t levels[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
int i;
+ uint32_t needed;
for (i=0;i<ARRAY_SIZE(levels);i++) {
r.in.handle = handle;
r.in.level = levels[i];
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing GetPrinter level %u\n", r.in.level);
@@ -618,10 +632,10 @@ static bool test_GetPrinter(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "GetPrinter failed");
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetPrinter(p, tctx, &r);
}
@@ -659,12 +673,14 @@ static bool test_GetForm(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_GetForm r;
+ uint32_t needed;
r.in.handle = handle;
r.in.form_name = form_name;
r.in.level = 1;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing GetForm\n");
@@ -672,10 +688,10 @@ static bool test_GetForm(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "GetForm failed");
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetForm(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "GetForm failed");
@@ -696,11 +712,13 @@ static bool test_EnumForms(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_EnumForms r;
bool ret = true;
+ uint32_t needed;
r.in.handle = handle;
r.in.level = 1;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumForms\n");
@@ -713,10 +731,10 @@ static bool test_EnumForms(struct torture_context *tctx,
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
union spoolss_FormInfo *info;
int j;
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumForms(p, tctx, &r);
@@ -823,12 +841,14 @@ static bool test_EnumPorts_old(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_EnumPorts r;
+ uint32_t needed;
r.in.servername = talloc_asprintf(tctx, "\\\\%s",
dcerpc_server_name(p));
r.in.level = 2;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumPorts\n");
@@ -837,10 +857,10 @@ static bool test_EnumPorts_old(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "EnumPorts failed");
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPorts(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "EnumPorts failed");
@@ -888,12 +908,14 @@ static bool test_GetJob(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_GetJob r;
+ uint32_t needed;
r.in.handle = handle;
r.in.job_id = job_id;
r.in.level = 1;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing GetJob\n");
@@ -901,10 +923,10 @@ static bool test_GetJob(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetJob(p, tctx, &r);
@@ -942,6 +964,7 @@ static bool test_EnumJobs(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_EnumJobs r;
+ uint32_t needed;
r.in.handle = handle;
r.in.firstjob = 0;
@@ -949,6 +972,7 @@ static bool test_EnumJobs(struct torture_context *tctx,
r.in.level = 1;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumJobs\n");
@@ -959,10 +983,10 @@ static bool test_EnumJobs(struct torture_context *tctx,
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
union spoolss_JobInfo *info;
int j;
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumJobs(p, tctx, &r);
@@ -997,12 +1021,14 @@ static bool test_DoPrintTest(struct torture_context *tctx,
struct spoolss_EndDocPrinter e;
int i;
uint32_t job_id;
+ uint32_t num_written;
torture_comment(tctx, "Testing StartDocPrinter\n");
s.in.handle = handle;
s.in.level = 1;
s.in.info.info1 = &info1;
+ s.out.job_id = &job_id;
info1.document_name = "TorturePrintJob";
info1.output_file = NULL;
info1.datatype = "RAW";
@@ -1011,8 +1037,6 @@ static bool test_DoPrintTest(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_StartDocPrinter failed");
torture_assert_werr_ok(tctx, s.out.result, "StartDocPrinter failed");
- job_id = s.out.job_id;
-
for (i=1; i < 4; i++) {
torture_comment(tctx, "Testing StartPagePrinter: Page[%d]\n", i);
@@ -1027,6 +1051,7 @@ static bool test_DoPrintTest(struct torture_context *tctx,
w.in.handle = handle;
w.in.data = data_blob_string_const(talloc_asprintf(tctx,"TortureTestPage: %d\nData\n",i));
+ w.out.num_written = &num_written;
status = dcerpc_spoolss_WritePrinter(p, tctx, &w);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_WritePrinter failed");
@@ -1113,10 +1138,14 @@ static bool test_GetPrinterData(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_GetPrinterData r;
+ uint32_t needed;
+ enum spoolss_PrinterDataType type;
r.in.handle = handle;
r.in.value_name = value_name;
r.in.offered = 0;
+ r.out.needed = &needed;
+ r.out.type = &type;
torture_comment(tctx, "Testing GetPrinterData\n");
@@ -1124,7 +1153,7 @@ static bool test_GetPrinterData(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "GetPrinterData failed");
if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetPrinterData(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "GetPrinterData failed");
@@ -1143,11 +1172,15 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_GetPrinterDataEx r;
+ uint32_t type;
+ uint32_t needed;
r.in.handle = handle;
r.in.key_name = key_name;
r.in.value_name = value_name;
r.in.offered = 0;
+ r.out.type = &type;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing GetPrinterDataEx\n");
@@ -1161,7 +1194,8 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx,
}
if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
+ r.out.buffer = talloc_array(tctx, uint8_t, needed);
status = dcerpc_spoolss_GetPrinterDataEx(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "GetPrinterDataEx failed");
@@ -1228,17 +1262,22 @@ static bool test_EnumPrinterDataEx(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_EnumPrinterDataEx r;
+ uint32_t needed;
+ uint32_t count;
r.in.handle = handle;
r.in.key_name = "PrinterDriverData";
r.in.offered = 0;
+ r.out.needed = &needed;
+ r.out.count = &count;
torture_comment(tctx, "Testing EnumPrinterDataEx\n");
status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "EnumPrinterDataEx failed");
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
+ r.out.buffer = talloc_array(tctx, uint8_t, needed);
status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &r);
@@ -1539,12 +1578,14 @@ static bool test_EnumPrinters_old(struct torture_context *tctx, struct dcerpc_pi
for (i=0;i<ARRAY_SIZE(levels);i++) {
union spoolss_PrinterInfo *info;
int j;
+ uint32_t needed;
r.in.flags = PRINTER_ENUM_LOCAL;
r.in.server = "";
r.in.level = levels[i];
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumPrinters level %u\n", r.in.level);
@@ -1552,10 +1593,10 @@ static bool test_EnumPrinters_old(struct torture_context *tctx, struct dcerpc_pi
torture_assert_ntstatus_ok(tctx, status, "EnumPrinters failed");
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPrinters(p, tctx, &r);
}
@@ -1596,6 +1637,9 @@ static bool test_GetPrinterDriver2(struct dcerpc_pipe *p,
{
NTSTATUS status;
struct spoolss_GetPrinterDriver2 r;
+ uint32_t needed;
+ uint32_t server_major_version;
+ uint32_t server_minor_version;
r.in.handle = handle;
r.in.architecture = "W32X86";
@@ -1604,6 +1648,9 @@ static bool test_GetPrinterDriver2(struct dcerpc_pipe *p,
r.in.offered = 0;
r.in.client_major_version = 0;
r.in.client_minor_version = 0;
+ r.out.needed = &needed;
+ r.out.server_major_version = &server_major_version;
+ r.out.server_minor_version = &server_minor_version;
printf("Testing GetPrinterDriver2\n");
@@ -1614,7 +1661,7 @@ static bool test_GetPrinterDriver2(struct dcerpc_pipe *p,
}
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetPrinterDriver2(p, tctx, &r);
}
@@ -1644,11 +1691,14 @@ static bool test_EnumPrinterDrivers_old(struct torture_context *tctx,
for (i=0;i<ARRAY_SIZE(levels);i++) {
+ uint32_t needed;
+
r.in.server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.environment = "Windows NT x86";
r.in.level = levels[i];
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
torture_comment(tctx, "Testing EnumPrinterDrivers level %u\n", r.in.level);
@@ -1657,10 +1707,10 @@ static bool test_EnumPrinterDrivers_old(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "EnumPrinterDrivers failed");
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed);
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
data_blob_clear(&blob);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPrinterDrivers(p, tctx, &r);
}
diff --git a/source4/torture/rpc/spoolss_win.c b/source4/torture/rpc/spoolss_win.c
index ca61d1dddb..df0ab65f3a 100644
--- a/source4/torture/rpc/spoolss_win.c
+++ b/source4/torture/rpc/spoolss_win.c
@@ -155,11 +155,15 @@ static bool test_GetPrinterData(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_GetPrinterData gpd;
+ uint32_t needed;
+ enum spoolss_PrinterDataType type;
torture_comment(tctx, "Testing GetPrinterData(%s).\n", value_name);
gpd.in.handle = handle;
gpd.in.value_name = value_name;
gpd.in.offered = 4;
+ gpd.out.needed = &needed;
+ gpd.out.type = &type;
status = dcerpc_spoolss_GetPrinterData(p, tctx, &gpd);
torture_assert_ntstatus_ok(tctx, status, "GetPrinterData failed.");
@@ -182,20 +186,22 @@ static bool test_EnumPrinters(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_EnumPrinters ep;
DATA_BLOB blob = data_blob_talloc_zero(ctx, initial_blob_size);
+ uint32_t needed;
ep.in.flags = PRINTER_ENUM_NAME;
ep.in.server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
ep.in.level = 2;
ep.in.buffer = &blob;
ep.in.offered = initial_blob_size;
+ ep.out.needed = &needed;
status = dcerpc_spoolss_EnumPrinters(p, ctx, &ep);
torture_assert_ntstatus_ok(tctx, status, "EnumPrinters failed.");
if (W_ERROR_EQUAL(ep.out.result, WERR_INSUFFICIENT_BUFFER)) {
- blob = data_blob_talloc_zero(ctx, ep.out.needed);
+ blob = data_blob_talloc_zero(ctx, needed);
ep.in.buffer = &blob;
- ep.in.offered = ep.out.needed;
+ ep.in.offered = needed;
status = dcerpc_spoolss_EnumPrinters(p, ctx, &ep);
torture_assert_ntstatus_ok(tctx, status,"EnumPrinters failed.");
}
@@ -220,6 +226,7 @@ static bool test_GetPrinter(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_GetPrinter gp;
DATA_BLOB blob = data_blob_talloc_zero(ctx, initial_blob_size);
+ uint32_t needed;
torture_comment(tctx, "Test GetPrinter level %d\n", level);
@@ -227,14 +234,15 @@ static bool test_GetPrinter(struct torture_context *tctx,
gp.in.level = level;
gp.in.buffer = (initial_blob_size == 0)?NULL:&blob;
gp.in.offered = initial_blob_size;
+ gp.out.needed = &needed;
status = dcerpc_spoolss_GetPrinter(p, tctx, &gp);
torture_assert_ntstatus_ok(tctx, status, "GetPrinter failed");
if (W_ERROR_EQUAL(gp.out.result, WERR_INSUFFICIENT_BUFFER)) {
- blob = data_blob_talloc_zero(ctx, gp.out.needed);
+ blob = data_blob_talloc_zero(ctx, needed);
gp.in.buffer = &blob;
- gp.in.offered = gp.out.needed;
+ gp.in.offered = needed;
status = dcerpc_spoolss_GetPrinter(p, tctx, &gp);
torture_assert_ntstatus_ok(tctx, status, "GetPrinter failed");
}
@@ -252,6 +260,7 @@ static bool test_EnumJobs(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_EnumJobs ej;
DATA_BLOB blob = data_blob_talloc_zero(tctx, 1024);
+ uint32_t needed;
torture_comment(tctx, "Test EnumJobs\n");
@@ -259,6 +268,7 @@ static bool test_EnumJobs(struct torture_context *tctx,
ej.in.level = 2;
ej.in.buffer = &blob;
ej.in.offered = 1024;
+ ej.out.needed = &needed;
status = dcerpc_spoolss_EnumJobs(p, tctx, &ej);
torture_assert_ntstatus_ok(tctx, status, "EnumJobs failed");
@@ -274,6 +284,9 @@ static bool test_GetPrinterDriver2(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_GetPrinterDriver2 gpd2;
DATA_BLOB blob = data_blob_talloc_zero(tctx, 87424);
+ uint32_t needed;
+ uint32_t server_major_version;
+ uint32_t server_minor_version;
torture_comment(tctx, "Testing GetPrinterDriver2\n");
@@ -284,6 +297,9 @@ static bool test_GetPrinterDriver2(struct torture_context *tctx,
gpd2.in.offered = 87424;
gpd2.in.client_major_version = 3;
gpd2.in.client_minor_version = 0;
+ gpd2.out.needed = &needed;
+ gpd2.out.server_major_version = &server_major_version;
+ gpd2.out.server_minor_version = &server_minor_version;
status = dcerpc_spoolss_GetPrinterDriver2(p, tctx, &gpd2);
torture_assert_ntstatus_ok(tctx, status, "GetPrinterDriver2 failed");
@@ -301,6 +317,7 @@ static bool test_EnumForms(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_EnumForms ef;
DATA_BLOB blob = data_blob_talloc_zero(tctx, initial_blob_size);
+ uint32_t needed;
torture_comment(tctx, "Testing EnumForms\n");
@@ -308,14 +325,15 @@ static bool test_EnumForms(struct torture_context *tctx,
ef.in.level = 1;
ef.in.buffer = (initial_blob_size == 0)?NULL:&blob;
ef.in.offered = initial_blob_size;
+ ef.out.needed = &needed;
status = dcerpc_spoolss_EnumForms(p, tctx, &ef);
torture_assert_ntstatus_ok(tctx, status, "EnumForms failed");
if (W_ERROR_EQUAL(ef.out.result, WERR_INSUFFICIENT_BUFFER)) {
- blob = data_blob_talloc_zero(tctx, ef.out.needed);
+ blob = data_blob_talloc_zero(tctx, needed);
ef.in.buffer = &blob;
- ef.in.offered = ef.out.needed;
+ ef.in.offered = needed;
status = dcerpc_spoolss_EnumForms(p, tctx, &ef);
torture_assert_ntstatus_ok(tctx, status, "EnumForms failed");
}
@@ -339,14 +357,17 @@ static bool test_EnumPrinterKey(struct torture_context *tctx,
epk.in.handle = handle;
epk.in.key_name = talloc_strdup(tctx, key);
- epk.in.needed = needed;
+ epk.in.key_buffer_size = 0;
+ epk.out.needed = &needed;
+ epk.out.key_buffer = talloc_array(tctx, uint16_t, 0);
status = dcerpc_spoolss_EnumPrinterKey(p, tctx, &epk);
torture_assert_ntstatus_ok(tctx, status, "EnumPrinterKey failed");
if (W_ERROR_EQUAL(epk.out.result, WERR_MORE_DATA)) {
- epk.in.needed = epk.out.needed;
+ epk.in.key_buffer_size = needed;
+ epk.out.key_buffer = talloc_array(tctx, uint16_t, needed/2);
status = dcerpc_spoolss_EnumPrinterKey(p, tctx, &epk);
torture_assert_ntstatus_ok(tctx, status,
"EnumPrinterKey failed");
@@ -355,7 +376,7 @@ static bool test_EnumPrinterKey(struct torture_context *tctx,
torture_assert_werr_ok(tctx, epk.out.result, "EnumPrinterKey failed");
convert_string_talloc_convenience(ctx, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16,
- CH_UNIX, epk.out.key_buffer, epk.out.needed,
+ CH_UNIX, epk.out.key_buffer, *epk.out.needed,
(void**)&ctx->printer_keys);
return true;
@@ -370,17 +391,23 @@ static bool test_EnumPrinterDataEx(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_EnumPrinterDataEx epde;
+ uint32_t needed;
+ uint32_t count;
torture_comment(tctx, "Testing EnumPrinterDataEx(%s)\n", key);
epde.in.handle = handle;
epde.in.key_name = talloc_strdup(tctx, key);
epde.in.offered = 0;
+ epde.out.needed = &needed;
+ epde.out.count = &count;
+ epde.out.buffer = talloc_array(tctx, uint8_t, 0);
status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &epde);
torture_assert_ntstatus_ok(tctx, status, "EnumPrinterDataEx failed.");
if (W_ERROR_EQUAL(epde.out.result, WERR_MORE_DATA)) {
- epde.in.offered = epde.out.needed;
+ epde.in.offered = needed;
+ epde.out.buffer = talloc_array(tctx, uint8_t, needed);
status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &epde);
torture_assert_ntstatus_ok(tctx, status,
"EnumPrinterDataEx failed.");
diff --git a/testprogs/win32/npecho/GNUmakefile b/testprogs/win32/npecho/GNUmakefile
index 33cf95def1..64fb79f5cc 100755
--- a/testprogs/win32/npecho/GNUmakefile
+++ b/testprogs/win32/npecho/GNUmakefile
@@ -1,20 +1,23 @@
INCLUDES=-I.
-CFLAGS=$(INCLUDES)
+CFLAGS=$(INCLUDES)
-all: npecho_client.exe npecho_server.exe
+NPECHO = npecho_client.exe
+#npecho_server.exe
+
+NPECHO2 = npecho_client2.exe npecho_server2.exe
+
+all: $(NPECHO) $(NPECHO2)
CC = i586-mingw32msvc-gcc
-.SUFFIXES: .c .obj
+.SUFFIXES: .c .obj .exe
-.c.obj:
+.c.obj:
$(CC) $(CFLAGS) -c $< -o $@
-clean:
- del *~ *.obj *.exe
+.obj.exe:
+ $(CC) $(CFLAGS) -o $@ $< $(LIBS)
-npecho_client.exe: npecho_client.obj
-npecho_server.exe: npecho_server.obj
+clean:
+ del *~ *.obj *.exe
-%.exe:
- $(CC) $(CFLAGS) -o $@ $< $(LIBS)
diff --git a/testprogs/win32/npecho/NMakefile b/testprogs/win32/npecho/NMakefile
index b52a9c7ab7..a0951b0f88 100755
--- a/testprogs/win32/npecho/NMakefile
+++ b/testprogs/win32/npecho/NMakefile
@@ -1,7 +1,11 @@
INCLUDES=-I
CFLAGS=$(INCLUDES) -Zi -nologo
-all: npecho_client.exe npecho_server.exe
+NPECHO = npecho_client.exe
+# missing npecho_server.exe
+NPECHO2 = npecho_client2.exe npecho_server2.exe
+
+all: $(NPECHO) $(NPECHO2)
clean:
del *~ *.obj *.exe
@@ -11,3 +15,9 @@ npecho_client.exe: npecho_client.obj
npecho_server.exe: npecho_server.obj
$(CC) $(CFLAGS) -o npecho_server.exe npecho_server.obj $(LIBS)
+
+npecho_client2.exe: npecho_client2.obj
+ $(CC) $(CFLAGS) -o npecho_client2.exe npecho_client2.obj $(LIBS)
+
+npecho_server2.exe: npecho_server2.obj
+ $(CC) $(CFLAGS) -o npecho_server2.exe npecho_server2.obj $(LIBS)
diff --git a/testprogs/win32/npecho/npecho_client2.c b/testprogs/win32/npecho/npecho_client2.c
new file mode 100755
index 0000000000..ebf4f9ad17
--- /dev/null
+++ b/testprogs/win32/npecho/npecho_client2.c
@@ -0,0 +1,117 @@
+/*
+ * Simple Named Pipe Client
+ * (C) 2005 Jelmer Vernooij <jelmer@samba.org>
+ * (C) 2009 Stefan Metzmacher <metze@samba.org>
+ * Published to the public domain
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+#define ECHODATA "Black Dog"
+
+int main(int argc, char *argv[])
+{
+ HANDLE h;
+ DWORD numread = 0;
+ char *outbuffer = malloc(sizeof(ECHODATA)*2);
+ BOOL small_reads = FALSE;
+ DWORD state = 0;
+ DWORD flags = 0;
+
+ if (argc == 1) {
+ goto usage;
+ } else if (argc >= 3) {
+ if (strcmp(argv[2], "large") == 0) {
+ small_reads = FALSE;
+ } else if (strcmp(argv[2], "small") == 0) {
+ small_reads = TRUE;
+ } else {
+ goto usage;
+ }
+ }
+
+ h = CreateFile(argv[1], GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ printf("Error opening: %d\n", GetLastError());
+ return -1;
+ }
+
+ GetNamedPipeHandleState(h, &state, NULL, NULL, NULL, NULL, 0);
+
+ if (state & PIPE_READMODE_MESSAGE) {
+ printf("message read mode\n");
+ } else {
+ printf("byte read mode\n");
+ }
+
+ Sleep(5000);
+
+ if (small_reads) {
+ DWORD ofs, size, nread;
+ const char *more = "";
+ printf("small reads\n");
+ numread = 0;
+ ofs = 0;
+ size = sizeof(ECHODATA)/2;
+ if (ReadFile(h, outbuffer+ofs, size, &nread, NULL)) {
+ if (state & PIPE_READMODE_MESSAGE) {
+ printf("Error message mode small read succeeded\n");
+ return -1;
+ }
+ } else if (GetLastError() == ERROR_MORE_DATA) {
+ if (!(state & PIPE_READMODE_MESSAGE)) {
+ printf("Error byte mode small read returned ERROR_MORE_DATA\n");
+ return -1;
+ }
+ more = " more data";
+ } else {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+ printf("Small Read: %d%s\n", nread, more);
+ numread += nread;
+ ofs = size;
+ size = sizeof(ECHODATA) - ofs;
+ if (!ReadFile(h, outbuffer+ofs, size, &nread, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+ printf("Small Read: %d\n", nread);
+ numread += nread;
+ } else {
+ printf("large read\n");
+ if (!ReadFile(h, outbuffer, sizeof(ECHODATA)*2, &numread, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+ }
+ printf("Read: %s %d\n", outbuffer, numread);
+ if (state & PIPE_READMODE_MESSAGE) {
+ if (numread != sizeof(ECHODATA)) {
+ printf("message mode returned %d bytes should be %s\n",
+ numread, sizeof(ECHODATA));
+ return -1;
+ }
+ } else {
+ if (numread != (sizeof(ECHODATA)*2)) {
+ printf("message mode returned %d bytes should be %s\n",
+ numread, (sizeof(ECHODATA)*2));
+ return -1;
+ }
+ }
+
+ if (!ReadFile(h, outbuffer, sizeof(ECHODATA)*2, &numread, NULL)) {
+ printf("Error reading: %d\n", GetLastError());
+ return -1;
+ }
+
+ printf("Read: %s %d\n", outbuffer, numread);
+
+ return 0;
+usage:
+ printf("Usage: %s pipename [read]\n", argv[0]);
+ printf(" Where pipename is something like \\\\servername\\NPECHO\n");
+ printf(" Where read is something 'large' or 'small'\n");
+ return -1;
+}
diff --git a/testprogs/win32/npecho/npecho_server2.c b/testprogs/win32/npecho/npecho_server2.c
new file mode 100755
index 0000000000..281fc45833
--- /dev/null
+++ b/testprogs/win32/npecho/npecho_server2.c
@@ -0,0 +1,76 @@
+/*
+ * Simple Named Pipe Client
+ * (C) 2005 Jelmer Vernooij <jelmer@samba.org>
+ * (C) 2009 Stefan Metzmacher <metze@samba.org>
+ * Published to the public domain
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+#define ECHODATA "Black Dog"
+
+int main(int argc, char *argv[])
+{
+ HANDLE h;
+ DWORD numread = 0;
+ char *outbuffer = malloc(sizeof(ECHODATA));
+ BOOL msgmode = FALSE;
+ DWORD type = 0;
+
+ if (argc == 1) {
+ goto usage;
+ } else if (argc >= 3) {
+ if (strcmp(argv[2], "byte") == 0) {
+ msgmode = FALSE;
+ } else if (strcmp(argv[2], "message") == 0) {
+ msgmode = TRUE;
+ } else {
+ goto usage;
+ }
+ }
+
+ if (msgmode == TRUE) {
+ printf("using message mode\n");
+ type = PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT;
+ } else {
+ printf("using byte mode\n");
+ type = PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT;
+ }
+
+ h = CreateNamedPipe(argv[1],
+ PIPE_ACCESS_DUPLEX,
+ type,
+ PIPE_UNLIMITED_INSTANCES,
+ 1024,
+ 1024,
+ 0,
+ NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ printf("Error opening: %d\n", GetLastError());
+ return -1;
+ }
+
+ ConnectNamedPipe(h, NULL);
+
+ if (!WriteFile(h, ECHODATA, sizeof(ECHODATA), &numread, NULL)) {
+ printf("Error writing: %d\n", GetLastError());
+ return -1;
+ }
+
+ if (!WriteFile(h, ECHODATA, sizeof(ECHODATA), &numread, NULL)) {
+ printf("Error writing: %d\n", GetLastError());
+ return -1;
+ }
+
+ FlushFileBuffers(h);
+ DisconnectNamedPipe(h);
+ CloseHandle(h);
+
+ return 0;
+usage:
+ printf("Usage: %s pipename [mode]\n", argv[0]);
+ printf(" Where pipename is something like \\\\servername\\PIPE\\NPECHO\n");
+ printf(" Where mode is 'byte' or 'message'\n");
+ return -1;
+}