Merge branch 'master' of ssh://git.samba.org/data/git/samba
authorJelmer Vernooij <jelmer@samba.org>
Thu, 5 Feb 2009 15:39:28 +0000 (16:39 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 5 Feb 2009 15:39:28 +0000 (16:39 +0100)
Conflicts:
librpc/ndr.pc.in

504 files changed:
.gitignore
docs-xml/manpages-3/eventlogadm.8.xml
docs-xml/manpages-3/mount.cifs.8.xml
lib/async_req/async_req.c
lib/async_req/async_req.h
lib/async_req/async_req_ntstatus.c [new file with mode: 0644]
lib/async_req/async_req_ntstatus.h [new file with mode: 0644]
lib/async_req/async_sock.c [moved from source3/lib/async_sock.c with 82% similarity]
lib/async_req/async_sock.h [moved from source3/include/async_sock.h with 82% similarity]
lib/async_req/config.mk
lib/replace/libreplace_network.m4
lib/replace/repdir.m4
lib/replace/replace.h
lib/replace/system/network.h
lib/talloc/pytalloc.c
lib/tdb/config.mk
lib/tdb/pytdb.c
lib/tdb/python.mk
lib/tevent/build_macros.m4
lib/tevent/pytevent.c
lib/tevent/python.mk
lib/tevent/testsuite.c
lib/tevent/tevent.mk
lib/tevent/tevent_signal.c
lib/util/byteorder.h
lib/util/config.mk
lib/util/debug.c
lib/util/idtree.c
lib/util/util_ldb.c
lib/util/xfile.c
libcli/nbt/nbtsocket.c
libcli/security/config.mk [new file with mode: 0644]
libcli/security/dom_sid.c [moved from source4/libcli/security/dom_sid.c with 92% similarity]
libcli/security/dom_sid.h [new file with mode: 0644]
librpc/gen_ndr/cli_spoolss.c [new file with mode: 0644]
librpc/gen_ndr/cli_spoolss.h [new file with mode: 0644]
librpc/gen_ndr/eventlog.h
librpc/gen_ndr/lsa.h
librpc/gen_ndr/ndr_drsblobs.h
librpc/gen_ndr/ndr_eventlog.c
librpc/gen_ndr/ndr_eventlog.h
librpc/gen_ndr/ndr_spoolss.c [new file with mode: 0644]
librpc/gen_ndr/ndr_spoolss.h [new file with mode: 0644]
librpc/gen_ndr/spoolss.h
librpc/gen_ndr/srv_spoolss.c [new file with mode: 0644]
librpc/gen_ndr/srv_spoolss.h [new file with mode: 0644]
librpc/idl/drsblobs.idl
librpc/idl/eventlog.idl
librpc/idl/lsa.idl
librpc/idl/spoolss.idl
librpc/ndr.pc.in
librpc/ndr/libndr.h
librpc/ndr/ndr_drsblobs.h [new file with mode: 0644]
librpc/ndr/ndr_spoolss_buf.c [moved from source4/librpc/ndr/ndr_spoolss_buf.c with 99% similarity]
librpc/ndr/ndr_spoolss_buf.h [new file with mode: 0644]
nsswitch/tests/test_wbinfo.sh
pidl/tests/samba3-cli.pl
selftest/selftest.pl
selftest/target/Samba3.pm
selftest/target/Samba4.pm
source3/Makefile.in
source3/auth/auth_netlogond.c
source3/client/smbspool.c
source3/configure.in
source3/include/idmap.h
source3/include/includes.h
source3/include/ntdomain.h
source3/include/proto.h
source3/include/rpc_eventlog.h [deleted file]
source3/include/rpc_lsa.h [deleted file]
source3/include/rpc_misc.h
source3/include/smb.h
source3/include/smb_macros.h
source3/include/smbprofile.h
source3/include/util_tdb.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/lib/ctdbd_conn.c
source3/lib/events.c
source3/lib/interface.c
source3/lib/netapi/cm.c
source3/lib/smbconf/testsuite.c
source3/lib/tdb_validate.c [new file with mode: 0644]
source3/lib/tdb_validate.h [new file with mode: 0644]
source3/lib/time.c
source3/lib/util.c
source3/lib/util_seaccess.c
source3/lib/util_sock.c
source3/lib/util_tdb.c
source3/lib/wb_reqtrans.c
source3/lib/wbclient.c
source3/libads/kerberos_verify.c
source3/libads/ldap.c
source3/libnet/libnet_join.c
source3/libnet/libnet_samsync_ldif.c
source3/librpc/ndr/ndr_string.c
source3/libsmb/async_smb.c
source3/libsmb/cliconnect.c
source3/libsmb/clidfs.c
source3/libsmb/clientgen.c
source3/libsmb/clifile.c
source3/libsmb/clireadwrite.c
source3/libsmb/clitrans.c
source3/libsmb/credentials.c
source3/libsmb/libsmb_server.c
source3/libsmb/namecache.c
source3/libsmb/namequery.c
source3/libsmb/passchange.c
source3/m4/check_path.m4
source3/modules/onefs_acl.c
source3/modules/onefs_streams.c
source3/modules/vfs_aio_fork.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_onefs.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/nmbd/asyncdns.c
source3/nmbd/nmbd.c
source3/nmbd/nmbd_become_dmb.c
source3/nmbd/nmbd_packets.c
source3/nmbd/nmbd_subnetdb.c
source3/nmbd/nmbd_synclists.c
source3/param/loadparm.c
source3/passdb/passdb.c
source3/printing/printing.c
source3/registry/reg_init_basic.c
source3/registry/reg_init_full.c
source3/rpc_client/cli_pipe.c
source3/rpc_client/init_netlogon.c
source3/rpc_client/rpc_transport_np.c
source3/rpc_client/rpc_transport_smbd.c [new file with mode: 0644]
source3/rpc_parse/parse_eventlog.c [deleted file]
source3/rpc_parse/parse_misc.c
source3/rpc_parse/parse_prs.c
source3/rpc_server/srv_eventlog.c [deleted file]
source3/rpc_server/srv_eventlog_lib.c
source3/rpc_server/srv_eventlog_nt.c
source3/rpc_server/srv_lsa_hnd.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_pipe_hnd.c
source3/rpc_server/srv_spoolss_nt.c
source3/rpcclient/cmd_eventlog.c
source3/rpcclient/rpcclient.c
source3/samba4-templates.mk
source3/samba4.m4
source3/samba4.mk
source3/script/tests/selftest.sh
source3/script/tests/test_functions.sh
source3/script/tests/test_local_s3.sh
source3/script/tests/test_net_misc.sh
source3/script/tests/test_net_registry.sh
source3/script/tests/test_net_s3.sh
source3/script/tests/test_ntlm_auth_s3.sh
source3/script/tests/test_posix_s3.sh
source3/script/tests/test_smbclient_s3.sh
source3/script/tests/test_smbtorture_s3.sh
source3/script/tests/test_testparm_s3.sh
source3/script/tests/test_wbinfo_s3.sh
source3/script/tests/tests_all.sh
source3/script/tests/tests_smbclient_s3.sh
source3/selftest/tests.sh
source3/services/services_db.c
source3/smbd/aio.c
source3/smbd/blocking.c
source3/smbd/dnsregister.c
source3/smbd/file_access.c
source3/smbd/filename.c
source3/smbd/globals.c
source3/smbd/globals.h
source3/smbd/ipc.c
source3/smbd/lanman.c
source3/smbd/mangle_hash.c
source3/smbd/mangle_hash2.c
source3/smbd/negprot.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/oplock.c
source3/smbd/oplock_irix.c
source3/smbd/oplock_linux.c
source3/smbd/pipes.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/server.c
source3/smbd/sesssetup.c
source3/smbd/trans2.c
source3/torture/locktest.c
source3/torture/masktest.c
source3/torture/torture.c
source3/utils/eventlogadm.c
source3/utils/net.c
source3/utils/net_ads.c
source3/utils/net_eventlog.c [new file with mode: 0644]
source3/utils/net_proto.h
source3/utils/net_rpc.c
source3/utils/net_rpc_join.c
source3/utils/smbcacls.c
source3/winbindd/idmap_tdb.c
source3/winbindd/winbindd.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_dual.c
source3/winbindd/winbindd_group.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_user.c
source4/Makefile
source4/auth/config.mk
source4/auth/credentials/config.mk
source4/auth/gensec/config.mk
source4/auth/gensec/schannel_state.c
source4/auth/gensec/socket.c
source4/auth/kerberos/krb5_init_context.c
source4/auth/ntlmssp/ntlmssp_server.c
source4/build/m4/check_cc.m4
source4/build/m4/check_path.m4
source4/build/m4/public.m4
source4/cldap_server/netlogon.c
source4/cldap_server/rootdse.c
source4/client/tests/test_cifsdd.sh
source4/client/tests/test_smbclient.sh
source4/cluster/cluster_private.h
source4/cluster/local.c
source4/configure.ac
source4/dsdb/repl/drepl_periodic.c
source4/dsdb/repl/drepl_service.c
source4/dsdb/samdb/ldb_modules/anr.c
source4/dsdb/samdb/ldb_modules/config.mk
source4/dsdb/samdb/ldb_modules/extended_dn_out.c
source4/dsdb/samdb/ldb_modules/instancetype.c
source4/dsdb/samdb/ldb_modules/kludge_acl.c
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/local_password.c
source4/dsdb/samdb/ldb_modules/naming_fsmo.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/objectguid.c
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
source4/dsdb/samdb/ldb_modules/proxy.c
source4/dsdb/samdb/ldb_modules/ranged_results.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/samba3sam.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/ldb_modules/schema_fsmo.c
source4/dsdb/samdb/ldb_modules/show_deleted.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/dsdb/samdb/ldb_modules/subtree_delete.c
source4/dsdb/samdb/ldb_modules/subtree_rename.c
source4/dsdb/samdb/ldb_modules/update_keytab.c
source4/dsdb/schema/schema_description.c
source4/dsdb/schema/schema_query.c
source4/dsdb/schema/schema_set.c
source4/headermap.txt
source4/heimdal/lib/hcrypto/camellia-ntt.c
source4/heimdal/lib/hcrypto/camellia.c
source4/heimdal/lib/hdb/hdb.c
source4/heimdal/lib/krb5/error_string.c
source4/heimdal/lib/krb5/get_addrs.c
source4/heimdal/lib/roken/getarg.c
source4/heimdal/lib/roken/vis.hin
source4/heimdal_build/config.h
source4/heimdal_build/internal.m4
source4/heimdal_build/internal.mk
source4/heimdal_build/vis.h
source4/include/includes.h
source4/kdc/hdb-samba4.c
source4/kdc/kdc.c
source4/kdc/pac-glue.c
source4/ldap_server/ldap_bind.c
source4/ldap_server/ldap_extended.c
source4/ldap_server/ldap_server.c
source4/lib/events/config.mk
source4/lib/ldb-samba/ldif_handlers.c
source4/lib/ldb/Makefile.in
source4/lib/ldb/build_macros.m4
source4/lib/ldb/common/attrib_handlers.c
source4/lib/ldb/common/ldb.c
source4/lib/ldb/common/ldb_attributes.c
source4/lib/ldb/common/ldb_controls.c
source4/lib/ldb/common/ldb_debug.c
source4/lib/ldb/common/ldb_dn.c
source4/lib/ldb/common/ldb_ldif.c
source4/lib/ldb/common/ldb_match.c
source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/common/ldb_msg.c
source4/lib/ldb/common/ldb_parse.c
source4/lib/ldb/common/ldb_utf8.c
source4/lib/ldb/common/qsort.c
source4/lib/ldb/configure.ac
source4/lib/ldb/examples/ldbreader.c
source4/lib/ldb/examples/ldifreader.c
source4/lib/ldb/external/libevents.m4
source4/lib/ldb/include/dlinklist.h
source4/lib/ldb/include/ldb.h
source4/lib/ldb/include/ldb_includes.h
source4/lib/ldb/include/ldb_module.h [new file with mode: 0644]
source4/lib/ldb/include/ldb_private.h
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/ldb_ldap/ldb_ldap.c
source4/lib/ldb/ldb_map/ldb_map.c
source4/lib/ldb/ldb_map/ldb_map.h
source4/lib/ldb/ldb_map/ldb_map_inbound.c
source4/lib/ldb/ldb_map/ldb_map_outbound.c
source4/lib/ldb/ldb_map/ldb_map_private.h
source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
source4/lib/ldb/ldb_tdb/ldb_cache.c
source4/lib/ldb/ldb_tdb/ldb_index.c
source4/lib/ldb/ldb_tdb/ldb_pack.c
source4/lib/ldb/ldb_tdb/ldb_search.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/ldb_tdb/ldb_tdb.h
source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
source4/lib/ldb/modules/asq.c
source4/lib/ldb/modules/operational.c
source4/lib/ldb/modules/paged_results.c
source4/lib/ldb/modules/paged_searches.c
source4/lib/ldb/modules/rdn_name.c
source4/lib/ldb/modules/skel.c
source4/lib/ldb/modules/sort.c
source4/lib/ldb/pyldb.c
source4/lib/ldb/python.mk
source4/lib/ldb/tests/sample_module.c
source4/lib/ldb/tests/test-extended.sh
source4/lib/ldb/tests/test-generic.sh
source4/lib/ldb/tests/test-tdb-features.sh
source4/lib/ldb/tests/test-tdb.sh
source4/lib/ldb/tools/cmdline.c
source4/lib/ldb/tools/ldbadd.c
source4/lib/ldb/tools/ldbdel.c
source4/lib/ldb/tools/ldbedit.c
source4/lib/ldb/tools/ldbmodify.c
source4/lib/ldb/tools/ldbrename.c
source4/lib/ldb/tools/ldbsearch.c
source4/lib/ldb/tools/ldbtest.c
source4/lib/messaging/irpc.h
source4/lib/messaging/messaging.c
source4/lib/messaging/pymessaging.c
source4/lib/messaging/tests/irpc.c
source4/lib/messaging/tests/messaging.c
source4/lib/registry/config.mk
source4/lib/registry/tools/regshell.c
source4/lib/socket/config.m4
source4/lib/socket/connect.c
source4/lib/socket/socket_ip.c
source4/lib/stream/packet.c
source4/lib/stream/packet.h
source4/libcli/cldap/cldap.c
source4/libcli/cldap/cldap.h
source4/libcli/clilist.c
source4/libcli/composite/composite.c
source4/libcli/config.mk
source4/libcli/dgram/dgramsocket.c
source4/libcli/dgram/libdgram.h
source4/libcli/dgram/mailslot.c
source4/libcli/finddcs.c
source4/libcli/ldap/config.mk
source4/libcli/ldap/ldap.h
source4/libcli/ldap/ldap_errors.h [new file with mode: 0644]
source4/libcli/raw/clioplock.c
source4/libcli/raw/clitransport.c
source4/libcli/raw/interfaces.h
source4/libcli/raw/libcliraw.h
source4/libcli/raw/rawrequest.c
source4/libcli/raw/rawsearch.c
source4/libcli/resolve/dns_ex.c
source4/libcli/security/config.mk
source4/libcli/security/security.h
source4/libcli/security/security_token.c
source4/libcli/smb2/getinfo.c
source4/libcli/smb2/smb2.h
source4/libcli/smb2/transport.c
source4/libcli/smb_composite/appendacl.c
source4/libcli/smb_composite/connect.c
source4/libcli/smb_composite/fsinfo.c
source4/libcli/smb_composite/loadfile.c
source4/libcli/smb_composite/savefile.c
source4/libcli/smb_composite/sesssetup.c
source4/libcli/util/nterr.c
source4/libcli/wbclient/wbclient.c
source4/libcli/wrepl/winsrepl.c
source4/libcli/wrepl/winsrepl.h
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_samdump.c
source4/libnet/libnet_samdump_keytab.c
source4/libnet/libnet_samsync.h
source4/libnet/libnet_samsync_ldb.c
source4/libnet/libnet_unbecome_dc.c
source4/librpc/config.mk
source4/librpc/ndr/ndr_string.c
source4/librpc/ndr/py_security.c
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc_connect.c
source4/librpc/rpc/dcerpc_smb.c
source4/librpc/rpc/dcerpc_sock.c
source4/librpc/tests/test_ndrdump.sh
source4/main.mk
source4/nbt_server/config.mk
source4/nbt_server/dgram/netlogon.c
source4/nbt_server/dgram/ntlogon.c
source4/nbt_server/irpc.c
source4/nbt_server/wins/wins_ldb.c
source4/nbt_server/wins/winsdb.c
source4/nbt_server/wins/winswack.c
source4/ntp_signd/ntp_signd.c
source4/ntvfs/cifs/vfs_cifs.c
source4/ntvfs/cifs_posix_cli/svfs_util.c
source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c
source4/ntvfs/common/opendb.c
source4/ntvfs/common/opendb.h
source4/ntvfs/common/opendb_tdb.c
source4/ntvfs/ipc/rap_server.c
source4/ntvfs/ipc/vfs_ipc.c
source4/ntvfs/nbench/vfs_nbench.c
source4/ntvfs/ntvfs.h
source4/ntvfs/ntvfs_interface.c
source4/ntvfs/posix/pvfs_aio.c
source4/ntvfs/posix/pvfs_lock.c
source4/ntvfs/posix/pvfs_notify.c
source4/ntvfs/posix/vfs_posix.c
source4/ntvfs/posix/vfs_posix.h
source4/ntvfs/simple/svfs_util.c
source4/ntvfs/simple/vfs_simple.c
source4/ntvfs/smb2/vfs_smb2.c
source4/ntvfs/unixuid/vfs_unixuid.c
source4/param/config.mk
source4/param/loadparm.c
source4/param/loadparm.h
source4/param/pyparam.c
source4/rpc_server/config.mk
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
source4/rpc_server/echo/rpc_echo.c
source4/rpc_server/lsa/dcesrv_lsa.c
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/remote/dcesrv_remote.c
source4/rpc_server/service_rpc.c
source4/rpc_server/spoolss/dcesrv_spoolss.c
source4/rpc_server/unixinfo/dcesrv_unixinfo.c
source4/rpc_server/winreg/rpc_winreg.c
source4/scripting/python/config.mk
source4/selftest/config.mk
source4/selftest/tests.sh
source4/smb_server/management.c
source4/smb_server/smb/receive.c
source4/smb_server/smb/search.c
source4/smb_server/smb/trans2.c
source4/smb_server/smb2/find.c
source4/smb_server/smb2/receive.c
source4/smb_server/smb_samba3.c
source4/smb_server/smb_server.c
source4/smbd/process_prefork.c
source4/smbd/process_single.c
source4/smbd/process_standard.c
source4/smbd/process_thread.c
source4/smbd/server.c
source4/smbd/service_named_pipe.c
source4/smbd/service_stream.c
source4/smbd/service_stream.h
source4/smbd/service_task.c
source4/smbd/service_task.h
source4/torture/basic/misc.c
source4/torture/gentest.c
source4/torture/ldap/cldapbench.c
source4/torture/nbench/nbio.c
source4/torture/nbt/dgram.c
source4/torture/raw/lockbench.c
source4/torture/raw/offline.c
source4/torture/raw/openbench.c
source4/torture/raw/oplock.c
source4/torture/raw/search.c
source4/torture/rpc/eventlog.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/samsync.c
source4/torture/rpc/winreg.c
source4/torture/tests/test_gentest.sh
source4/torture/tests/test_locktest.sh
source4/torture/tests/test_masktest.sh
source4/torture/unix/unix_info2.c
source4/torture/util_smb.c
source4/utils/ad2oLschema.c
source4/utils/net/net_machinepw.c
source4/utils/ntlm_auth.c
source4/utils/oLschema2ldif.c
source4/utils/tests/test_net.sh
source4/utils/tests/test_nmblookup.sh
source4/web_server/web_server.c
source4/web_server/web_server.h
source4/web_server/wsgi.c
source4/winbind/idmap.c
source4/winbind/wb_cmd_getpwnam.c
source4/winbind/wb_irpc.c
source4/winbind/wb_samba3_protocol.c
source4/winbind/wb_server.c
source4/winbind/wb_sid2gid.c
source4/winbind/wb_sid2uid.c
source4/wrepl_server/wrepl_apply_records.c
source4/wrepl_server/wrepl_in_connection.c
source4/wrepl_server/wrepl_out_helpers.c
source4/wrepl_server/wrepl_scavenging.c
source4/wrepl_server/wrepl_server.c
testprogs/blackbox/test_kinit.sh
testprogs/blackbox/test_ldb.sh

index dae5f063c342c7bf8515f6d08e7f1377a18a4cc6..703f7e38ead5dad487faf3f040a16181ea613b42 100644 (file)
@@ -218,7 +218,6 @@ source4/librpc/gen_ndr
 source4/librpc/idl-deps
 source4/librpc/ndr/libndr_proto.h
 source4/librpc/ndr/ndr_compression.h
-source4/librpc/ndr/ndr_spoolss_buf.h
 source4/librpc/ndr/ndr_table.h
 source4/librpc/rpc/dcerpc_proto.h
 source4/librpc/rpc/dcerpc_table.h
@@ -318,7 +317,6 @@ librpc/gen_ndr/*wzcsvc*
 librpc/gen_ndr/*w32time*
 librpc/gen_ndr/*wmi*
 librpc/gen_ndr/*trkwks*
-librpc/gen_ndr/*_spoolss*
 librpc/gen_ndr/*rot*
 librpc/gen_ndr/*remact*
 librpc/gen_ndr/*oxidresolver*
index 04ba02203227365a3c54949f7df43c5a9d1fba21..fa514de026e281e29688cf4a98ddc9f67940eb98 100644 (file)
                </arg>
 
        </cmdsynopsis>
+       <cmdsynopsis>
+               <command>eventlogadm</command>
+               <arg><option>-d</option></arg>
+               <arg><option>-h</option></arg>
+               <arg choice="plain"><option>-o</option>
+               <literal>dump</literal>
+               <replaceable>EVENTLOG</replaceable>
+               <replaceable>RECORD_NUMBER</replaceable>
+               </arg>
+
+       </cmdsynopsis>
+
 </refsynopsisdiv>
 
 <refsect1>
                </term>
                <listitem><para>
                The <command>-o write</command> reads event log
-               records from standard input and writes them to theSamba
+               records from standard input and writes them to the Samba
                event log store named by EVENTLOG.
                </para> </listitem>
                </varlistentry>
 
+               <varlistentry>
+               <term>
+               <option>-o</option>
+               <literal>write</literal>
+               <replaceable>EVENTLOG</replaceable>
+               <replaceable>RECORD_NUMBER</replaceable>
+               </term>
+               <listitem><para>
+               The <command>-o dump</command> reads event log
+               records from a EVENTLOG tdb and dumps them to standard
+               output on screen.
+               </para> </listitem>
+               </varlistentry>
+
                <varlistentry>
                <term><option>-h</option></term>
                <listitem><para>
                </para></listitem>
 
                <listitem><para>
-               <command>SRN</command> - he name of the machine on
+               <command>SRN</command> - The name of the machine on
                which the eventlog was generated. This is typically the
                host name.
                </para></listitem>
index 54fbc139b4c73af086a616608bb6e28b40d44062..00711e0de041231a111f90e3a7f3b3d3bd39d1e3 100644 (file)
@@ -43,10 +43,13 @@ by the popular Open Source server Samba.
        </para>
 
        <para>
-       The mount.cifs utility attaches the UNC name (exported network resource) to
-       the local directory <emphasis>mount-point</emphasis>. It is possible to set the mode for mount.cifs to 
-setuid root to allow non-root users to mount shares to directories for which they
-have write permission.
+       The mount.cifs utility attaches the UNC name (exported network resource)
+       specified as <emphasis>service</emphasis> (using //server/share syntax,
+       where "server" is the server name or IP address and "share" is the name
+       of the share) to the local directory <emphasis>mount-point</emphasis>.
+       It is possible to set the mode for mount.cifs to setuid root to allow
+       non-root users to mount shares to directories for which they
+       have write permission.
        </para>
 
        <para>
index 011948a158cc4e20333573b742c16696ae02a08b..db47bd93ed1c733bf2074371587cc7cc012f1e57 100644 (file)
 */
 
 #include "includes.h"
+#include "lib/tevent/tevent.h"
+#include "lib/talloc/talloc.h"
+#include "lib/util/dlinklist.h"
+#include "lib/async_req/async_req.h"
+
+#ifndef TALLOC_FREE
+#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
+#endif
 
 /**
  * @brief Print an async_req structure
@@ -35,8 +43,8 @@
 
 char *async_req_print(TALLOC_CTX *mem_ctx, struct async_req *req)
 {
-       return talloc_asprintf(mem_ctx, "async_req: state=%d, status=%s, "
-                              "priv=%s", req->state, nt_errstr(req->status),
+       return talloc_asprintf(mem_ctx, "async_req: state=%d, error=%d, "
+                              "priv=%s", req->state, (int)req->error,
                               talloc_get_name(req->private_data));
 }
 
@@ -53,7 +61,7 @@ struct async_req *async_req_new(TALLOC_CTX *mem_ctx)
 {
        struct async_req *result;
 
-       result = TALLOC_ZERO_P(mem_ctx, struct async_req);
+       result = talloc_zero(mem_ctx, struct async_req);
        if (result == NULL) {
                return NULL;
        }
@@ -62,6 +70,14 @@ struct async_req *async_req_new(TALLOC_CTX *mem_ctx)
        return result;
 }
 
+static void async_req_finish(struct async_req *req, enum async_req_state state)
+{
+       req->state = state;
+       if (req->async.fn != NULL) {
+               req->async.fn(req);
+       }
+}
+
 /**
  * @brief An async request has successfully finished
  * @param[in] req      The finished request
@@ -73,30 +89,23 @@ struct async_req *async_req_new(TALLOC_CTX *mem_ctx)
 
 void async_req_done(struct async_req *req)
 {
-       req->status = NT_STATUS_OK;
-       req->state = ASYNC_REQ_DONE;
-       if (req->async.fn != NULL) {
-               req->async.fn(req);
-       }
+       async_req_finish(req, ASYNC_REQ_DONE);
 }
 
 /**
  * @brief An async request has seen an error
  * @param[in] req      The request with an error
- * @param[in] status   The error code
+ * @param[in] error    The error code
  *
  * async_req_done is to be used by implementors of async requests. When a
  * request can not successfully completed, the implementation should call this
  * function with the appropriate status code.
  */
 
-void async_req_error(struct async_req *req, NTSTATUS status)
+void async_req_error(struct async_req *req, uint64_t error)
 {
-       req->status = status;
-       req->state = ASYNC_REQ_ERROR;
-       if (req->async.fn != NULL) {
-               req->async.fn(req);
-       }
+       req->error = error;
+       async_req_finish(req, ASYNC_REQ_USER_ERROR);
 }
 
 /**
@@ -107,43 +116,18 @@ void async_req_error(struct async_req *req, NTSTATUS status)
  * @param[in] priv     The async request to be finished
  */
 
-static void async_trigger(struct event_context *ev, struct timed_event *te,
+static void async_trigger(struct tevent_context *ev, struct tevent_timer *te,
                          struct timeval now, void *priv)
 {
        struct async_req *req = talloc_get_type_abort(priv, struct async_req);
 
        TALLOC_FREE(te);
-       if (NT_STATUS_IS_OK(req->status)) {
+       if (req->error == 0) {
                async_req_done(req);
        }
        else {
-               async_req_error(req, req->status);
-       }
-}
-
-/**
- * @brief Finish a request before it started processing
- * @param[in] req      The finished request
- * @param[in] status   The success code
- *
- * An implementation of an async request might find that it can either finish
- * the request without waiting for an external event, or it can't even start
- * the engine. To present the illusion of a callback to the user of the API,
- * the implementation can call this helper function which triggers an
- * immediate timed event. This way the caller can use the same calling
- * conventions, independent of whether the request was actually deferred.
- */
-
-bool async_post_status(struct async_req *req, struct event_context *ev,
-                      NTSTATUS status)
-{
-       req->status = status;
-
-       if (event_add_timed(ev, req, timeval_zero(),
-                           async_trigger, req) == NULL) {
-               return false;
+               async_req_error(req, req->error);
        }
-       return true;
 }
 
 /**
@@ -157,7 +141,7 @@ bool async_post_status(struct async_req *req, struct event_context *ev,
  * Call pattern would be
  * \code
  * p = talloc(mem_ctx, bla);
- * if (async_req_nomem(p, req)) {
+ * if (async_req_ntnomem(p, req)) {
  *     return;
  * }
  * \endcode
@@ -168,55 +152,69 @@ bool async_req_nomem(const void *p, struct async_req *req)
        if (p != NULL) {
                return false;
        }
-       async_req_error(req, NT_STATUS_NO_MEMORY);
+       async_req_finish(req, ASYNC_REQ_NO_MEMORY);
        return true;
 }
 
-bool async_req_is_error(struct async_req *req, NTSTATUS *status)
+/**
+ * @brief Finish a request before it started processing
+ * @param[in] req      The finished request
+ * @param[in] status   The success code
+ *
+ * An implementation of an async request might find that it can either finish
+ * the request without waiting for an external event, or it can't even start
+ * the engine. To present the illusion of a callback to the user of the API,
+ * the implementation can call this helper function which triggers an
+ * immediate timed event. This way the caller can use the same calling
+ * conventions, independent of whether the request was actually deferred.
+ */
+
+bool async_post_error(struct async_req *req, struct tevent_context *ev,
+                     uint64_t error)
 {
-       if (req->state < ASYNC_REQ_DONE) {
-               *status = NT_STATUS_INTERNAL_ERROR;
-               return true;
-       }
-       if (req->state == ASYNC_REQ_ERROR) {
-               *status = req->status;
-               return true;
+       req->error = error;
+
+       if (tevent_add_timer(ev, req, timeval_zero(),
+                           async_trigger, req) == NULL) {
+               return false;
        }
-       return false;
+       return true;
 }
 
-NTSTATUS async_req_simple_recv(struct async_req *req)
+bool async_req_is_error(struct async_req *req, enum async_req_state *state,
+                       uint64_t *error)
 {
-       NTSTATUS status;
-
-       if (async_req_is_error(req, &status)) {
-               return status;
+       if (req->state == ASYNC_REQ_DONE) {
+               return false;
+       }
+       if (req->state == ASYNC_REQ_USER_ERROR) {
+               *error = req->error;
        }
-       return NT_STATUS_OK;
+       *state = req->state;
+       return true;
 }
 
-static void async_req_timedout(struct event_context *ev,
-                              struct timed_event *te,
+static void async_req_timedout(struct tevent_context *ev,
+                              struct tevent_timer *te,
                               struct timeval now,
                               void *priv)
 {
-       struct async_req *req = talloc_get_type_abort(
-               priv, struct async_req);
+       struct async_req *req = talloc_get_type_abort(priv, struct async_req);
        TALLOC_FREE(te);
-       async_req_error(req, NT_STATUS_IO_TIMEOUT);
+       async_req_finish(req, ASYNC_REQ_TIMED_OUT);
 }
 
-bool async_req_set_timeout(struct async_req *req, struct event_context *ev,
+bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev,
                           struct timeval to)
 {
-       return (event_add_timed(ev, req,
-                               timeval_current_ofs(to.tv_sec, to.tv_usec),
-                               async_req_timedout, req)
+       return (tevent_add_timer(
+                       ev, req, timeval_current_ofs(to.tv_sec, to.tv_usec),
+                       async_req_timedout, req)
                != NULL);
 }
 
 struct async_req *async_wait_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
+                                 struct tevent_context *ev,
                                  struct timeval to)
 {
        struct async_req *result;
@@ -232,9 +230,9 @@ struct async_req *async_wait_send(TALLOC_CTX *mem_ctx,
        return result;
 }
 
-NTSTATUS async_wait_recv(struct async_req *req)
+bool async_wait_recv(struct async_req *req)
 {
-       return NT_STATUS_OK;
+       return true;
 }
 
 struct async_queue_entry {
@@ -250,7 +248,7 @@ struct async_req_queue {
 
 struct async_req_queue *async_req_queue_init(TALLOC_CTX *mem_ctx)
 {
-       return TALLOC_ZERO_P(mem_ctx, struct async_req_queue);
+       return talloc_zero(mem_ctx, struct async_req_queue);
 }
 
 static int async_queue_entry_destructor(struct async_queue_entry *e)
@@ -266,8 +264,8 @@ static int async_queue_entry_destructor(struct async_queue_entry *e)
        return 0;
 }
 
-static void async_req_immediate_trigger(struct event_context *ev,
-                                       struct timed_event *te,
+static void async_req_immediate_trigger(struct tevent_context *ev,
+                                       struct tevent_timer *te,
                                        struct timeval now,
                                        void *priv)
 {
@@ -278,7 +276,7 @@ static void async_req_immediate_trigger(struct event_context *ev,
        e->trigger(e->req);
 }
 
-bool async_req_enqueue(struct async_req_queue *queue, struct event_context *ev,
+bool async_req_enqueue(struct async_req_queue *queue, struct tevent_context *ev,
                       struct async_req *req,
                       void (*trigger)(struct async_req *req))
 {
@@ -300,9 +298,9 @@ bool async_req_enqueue(struct async_req_queue *queue, struct event_context *ev,
        talloc_set_destructor(e, async_queue_entry_destructor);
 
        if (!busy) {
-               struct timed_event *te;
+               struct tevent_timer *te;
 
-               te = event_add_timed(ev, e, timeval_zero(),
+               te = tevent_add_timer(ev, e, timeval_zero(),
                                     async_req_immediate_trigger,
                                     e);
                if (te == NULL) {
@@ -330,7 +328,7 @@ bool _async_req_setup(TALLOC_CTX *mem_ctx, struct async_req **preq,
                TALLOC_FREE(req);
                return false;
        }
-       talloc_set_name(state, typename);
+       talloc_set_name_const(state, typename);
        req->private_data = state;
 
        *preq = req;
index 3907a08f67cffacab42f6c7324834a925c8c1f30..fc849880cd65fa64665bfac7eed8c95ae6c099b6 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __ASYNC_REQ_H__
 #define __ASYNC_REQ_H__
 
-#include "includes.h"
+#include "lib/talloc/talloc.h"
 
 /**
  * An async request moves between the following 4 states:
@@ -40,9 +40,17 @@ enum async_req_state {
         */
        ASYNC_REQ_DONE,
        /**
-        * an error has occured
+        * A user error has occured
         */
-       ASYNC_REQ_ERROR
+       ASYNC_REQ_USER_ERROR,
+       /**
+        * Request timed out
+        */
+       ASYNC_REQ_TIMED_OUT,
+       /**
+        * No memory in between
+        */
+       ASYNC_REQ_NO_MEMORY
 };
 
 /**
@@ -92,9 +100,9 @@ struct async_req {
         * @brief status code when finished
         *
         * This status can be queried in the async completion function. It
-        * will be set to NT_STATUS_OK when everything went fine.
+        * will be set to 0 when everything went fine.
         **/
-       NTSTATUS status;
+       uint64_t error;
 
        /**
         * @brief What to do on completion
@@ -121,32 +129,31 @@ char *async_req_print(TALLOC_CTX *mem_ctx, struct async_req *req);
 
 void async_req_done(struct async_req *req);
 
-void async_req_error(struct async_req *req, NTSTATUS status);
-
-bool async_post_status(struct async_req *req, struct event_context *ev,
-                      NTSTATUS status);
+void async_req_error(struct async_req *req, uint64_t error);
 
 bool async_req_nomem(const void *p, struct async_req *req);
 
-bool async_req_is_error(struct async_req *req, NTSTATUS *status);
+bool async_post_error(struct async_req *req, struct tevent_context *ev,
+                     uint64_t error);
 
-NTSTATUS async_req_simple_recv(struct async_req *req);
+bool async_req_is_error(struct async_req *req, enum async_req_state *state,
+                       uint64_t *error);
 
-bool async_req_set_timeout(struct async_req *req, struct event_context *ev,
+bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev,
                           struct timeval to);
 
 struct async_req *async_wait_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
+                                 struct tevent_context *ev,
                                  struct timeval to);
 
-NTSTATUS async_wait_recv(struct async_req *req);
+bool async_wait_recv(struct async_req *req);
 
 struct async_req_queue;
 
 struct async_req_queue *async_req_queue_init(TALLOC_CTX *mem_ctx);
 
 bool async_req_enqueue(struct async_req_queue *queue,
-                      struct event_context *ev,
+                      struct tevent_context *ev,
                       struct async_req *req,
                       void (*trigger)(struct async_req *req));
 
diff --git a/lib/async_req/async_req_ntstatus.c b/lib/async_req/async_req_ntstatus.c
new file mode 100644 (file)
index 0000000..65bc0f6
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+   Unix SMB/CIFS implementation.
+   NTSTATUS wrappers for async_req.h
+   Copyright (C) Volker Lendecke 2008, 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/>.
+*/
+
+#include "includes.h"
+#include "lib/tevent/tevent.h"
+#include "lib/talloc/talloc.h"
+#include "lib/util/dlinklist.h"
+#include "lib/async_req/async_req_ntstatus.h"
+
+void async_req_nterror(struct async_req *req, NTSTATUS status)
+{
+       async_req_error(req, NT_STATUS_V(status));
+}
+
+bool async_post_ntstatus(struct async_req *req, struct tevent_context *ev,
+                        NTSTATUS status)
+{
+       return async_post_error(req, ev, NT_STATUS_V(status));
+}
+
+bool async_req_is_nterror(struct async_req *req, NTSTATUS *status)
+{
+       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:
+               *status = NT_STATUS(error);
+               break;
+       case ASYNC_REQ_TIMED_OUT:
+               *status = NT_STATUS_IO_TIMEOUT;
+               break;
+       case ASYNC_REQ_NO_MEMORY:
+               *status = NT_STATUS_NO_MEMORY;
+               break;
+       default:
+               *status = NT_STATUS_INTERNAL_ERROR;
+               break;
+       }
+       return true;
+}
+
+NTSTATUS async_req_simple_recv_ntstatus(struct async_req *req)
+{
+       NTSTATUS status;
+
+       if (async_req_is_nterror(req, &status)) {
+               return status;
+       }
+       return NT_STATUS_OK;
+}
diff --git a/lib/async_req/async_req_ntstatus.h b/lib/async_req/async_req_ntstatus.h
new file mode 100644 (file)
index 0000000..7555aac
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+   Unix SMB/CIFS implementation.
+   NTSTATUS wrappers for async_req.h
+   Copyright (C) Volker Lendecke 2008, 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 __ASYNC_REQ_NTSTATUS_H__
+#define __ASYNC_REQ_NTSTATUS_H__
+
+#include "lib/async_req/async_req.h"
+#include "includes.h"
+
+void async_req_nterror(struct async_req *req, NTSTATUS status);
+
+bool async_post_ntstatus(struct async_req *req, struct tevent_context *ev,
+                        NTSTATUS status);
+
+bool async_req_is_nterror(struct async_req *req, NTSTATUS *status);
+
+NTSTATUS async_req_simple_recv_ntstatus(struct async_req *req);
+
+#endif
similarity index 82%
rename from source3/lib/async_sock.c
rename to lib/async_req/async_sock.c
index 73ff6f28709b89a8fa50f2f00815b5b07c655495..b99232066905073e47e3dc8b46c80f4ec706da84 100644 (file)
 */
 
 #include "includes.h"
+#include "lib/talloc/talloc.h"
+#include "lib/tevent/tevent.h"
+#include "lib/async_req/async_req.h"
+#include "lib/async_req/async_sock.h"
+#include <fcntl.h>
+
+#ifndef TALLOC_FREE
+#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
+#endif
 
 /**
  * Discriminator for async_syscall_state
@@ -36,7 +45,7 @@ enum async_syscall_type {
 
 struct async_syscall_state {
        enum async_syscall_type syscall_type;
-       struct fd_event *fde;
+       struct tevent_fd *fde;
 
        union {
                struct param_send {
@@ -99,7 +108,7 @@ struct async_syscall_state {
  */
 
 static struct async_req *async_syscall_new(TALLOC_CTX *mem_ctx,
-                                          struct event_context *ev,
+                                          struct tevent_context *ev,
                                           enum async_syscall_type type,
                                           struct async_syscall_state **pstate)
 {
@@ -125,7 +134,7 @@ static struct async_req *async_syscall_new(TALLOC_CTX *mem_ctx,
  * @param[in] ev       The event context to work from
  * @param[in] type     Which syscall will this be
  * @param[in] fd       The file descriptor we work on
- * @param[in] fde_flags EVENT_FD_READ/WRITE -- what are we interested in?
+ * @param[in] fde_flags TEVENT_FD_READ/WRITE -- what are we interested in?
  * @param[in] fde_cb   The callback function for the file descriptor event
  * @param[in] pstate   Where to put the newly created private_data state
  * @retval The new request
@@ -137,12 +146,12 @@ static struct async_req *async_syscall_new(TALLOC_CTX *mem_ctx,
 
 static struct async_req *async_fde_syscall_new(
        TALLOC_CTX *mem_ctx,
-       struct event_context *ev,
+       struct tevent_context *ev,
        enum async_syscall_type type,
        int fd,
        uint16_t fde_flags,
-       void (*fde_cb)(struct event_context *ev,
-                      struct fd_event *fde, uint16_t flags,
+       void (*fde_cb)(struct tevent_context *ev,
+                      struct tevent_fd *fde, uint16_t flags,
                       void *priv),
        struct async_syscall_state **pstate)
 {
@@ -154,7 +163,7 @@ static struct async_req *async_fde_syscall_new(
                return NULL;
        }
 
-       state->fde = event_add_fd(ev, state, fd, fde_flags, fde_cb, result);
+       state->fde = tevent_add_fd(ev, state, fd, fde_flags, fde_cb, result);
        if (state->fde == NULL) {
                TALLOC_FREE(result);
                return NULL;
@@ -215,12 +224,12 @@ int async_syscall_result_int(struct async_req *req, int *perrno)
  * fde event handler for the "send" syscall
  * @param[in] ev       The event context that sent us here
  * @param[in] fde      The file descriptor event associated with the send
- * @param[in] flags    Can only be EVENT_FD_WRITE here
+ * @param[in] flags    Can only be TEVENT_FD_WRITE here
  * @param[in] priv     private data, "struct async_req *" in this case
  */
 
-static void async_send_callback(struct event_context *ev,
-                               struct fd_event *fde, uint16_t flags,
+static void async_send_callback(struct tevent_context *ev,
+                               struct tevent_fd *fde, uint16_t flags,
                                void *priv)
 {
        struct async_req *req = talloc_get_type_abort(
@@ -230,7 +239,7 @@ static void async_send_callback(struct event_context *ev,
        struct param_send *p = &state->param.param_send;
 
        if (state->syscall_type != ASYNC_SYSCALL_SEND) {
-               async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
                return;
        }
 
@@ -255,7 +264,7 @@ static void async_send_callback(struct event_context *ev,
  * This function is a direct counterpart of send(2)
  */
 
-struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *async_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                             int fd, const void *buffer, size_t length,
                             int flags)
 {
@@ -264,7 +273,7 @@ struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 
        result = async_fde_syscall_new(
                mem_ctx, ev, ASYNC_SYSCALL_SEND,
-               fd, EVENT_FD_WRITE, async_send_callback,
+               fd, TEVENT_FD_WRITE, async_send_callback,
                &state);
        if (result == NULL) {
                return NULL;
@@ -282,12 +291,12 @@ struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
  * fde event handler for the "sendall" syscall group
  * @param[in] ev       The event context that sent us here
  * @param[in] fde      The file descriptor event associated with the send
- * @param[in] flags    Can only be EVENT_FD_WRITE here
+ * @param[in] flags    Can only be TEVENT_FD_WRITE here
  * @param[in] priv     private data, "struct async_req *" in this case
  */
 
-static void async_sendall_callback(struct event_context *ev,
-                                  struct fd_event *fde, uint16_t flags,
+static void async_sendall_callback(struct tevent_context *ev,
+                                  struct tevent_fd *fde, uint16_t flags,
                                   void *priv)
 {
        struct async_req *req = talloc_get_type_abort(
@@ -297,27 +306,28 @@ static void async_sendall_callback(struct event_context *ev,
        struct param_sendall *p = &state->param.param_sendall;
 
        if (state->syscall_type != ASYNC_SYSCALL_SENDALL) {
-               async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
                return;
        }
 
-       state->result.result_ssize_t = send(p->fd, (char *)p->buffer + p->sent,
+       state->result.result_ssize_t = send(p->fd,
+                                           (const char *)p->buffer + p->sent,
                                            p->length - p->sent, p->flags);
        state->sys_errno = errno;
 
        if (state->result.result_ssize_t == -1) {
-               async_req_error(req, map_nt_error_from_unix(state->sys_errno));
+               async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
                return;
        }
 
        if (state->result.result_ssize_t == 0) {
-               async_req_error(req, NT_STATUS_END_OF_FILE);
+               async_req_nterror(req, NT_STATUS_END_OF_FILE);
                return;
        }
 
        p->sent += state->result.result_ssize_t;
        if (p->sent > p->length) {
-               async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
                return;
        }
 
@@ -340,7 +350,7 @@ static void async_sendall_callback(struct event_context *ev,
  * "length" bytes
  */
 
-struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                               int fd, const void *buffer, size_t length,
                               int flags)
 {
@@ -349,7 +359,7 @@ struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 
        result = async_fde_syscall_new(
                mem_ctx, ev, ASYNC_SYSCALL_SENDALL,
-               fd, EVENT_FD_WRITE, async_sendall_callback,
+               fd, TEVENT_FD_WRITE, async_sendall_callback,
                &state);
        if (result == NULL) {
                return NULL;
@@ -366,19 +376,19 @@ struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 
 NTSTATUS sendall_recv(struct async_req *req)
 {
-       return async_req_simple_recv(req);
+       return async_req_simple_recv_ntstatus(req);
 }
 
 /**
  * fde event handler for the "recv" syscall
  * @param[in] ev       The event context that sent us here
  * @param[in] fde      The file descriptor event associated with the recv
- * @param[in] flags    Can only be EVENT_FD_READ here
+ * @param[in] flags    Can only be TEVENT_FD_READ here
  * @param[in] priv     private data, "struct async_req *" in this case
  */
 
-static void async_recv_callback(struct event_context *ev,
-                               struct fd_event *fde, uint16_t flags,
+static void async_recv_callback(struct tevent_context *ev,
+                               struct tevent_fd *fde, uint16_t flags,
                                void *priv)
 {
        struct async_req *req = talloc_get_type_abort(
@@ -388,7 +398,7 @@ static void async_recv_callback(struct event_context *ev,
        struct param_recv *p = &state->param.param_recv;
 
        if (state->syscall_type != ASYNC_SYSCALL_RECV) {
-               async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
                return;
        }
 
@@ -413,7 +423,7 @@ static void async_recv_callback(struct event_context *ev,
  * This function is a direct counterpart of recv(2)
  */
 
-struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                             int fd, void *buffer, size_t length,
                             int flags)
 {
@@ -422,7 +432,7 @@ struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev,
 
        result = async_fde_syscall_new(
                mem_ctx, ev, ASYNC_SYSCALL_RECV,
-               fd, EVENT_FD_READ, async_recv_callback,
+               fd, TEVENT_FD_READ, async_recv_callback,
                &state);
 
        if (result == NULL) {
@@ -441,12 +451,12 @@ struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev,
  * fde event handler for the "recvall" syscall group
  * @param[in] ev       The event context that sent us here
  * @param[in] fde      The file descriptor event associated with the recv
- * @param[in] flags    Can only be EVENT_FD_READ here
+ * @param[in] flags    Can only be TEVENT_FD_READ here
  * @param[in] priv     private data, "struct async_req *" in this case
  */
 
-static void async_recvall_callback(struct event_context *ev,
-                                  struct fd_event *fde, uint16_t flags,
+static void async_recvall_callback(struct tevent_context *ev,
+                                  struct tevent_fd *fde, uint16_t flags,
                                   void *priv)
 {
        struct async_req *req = talloc_get_type_abort(
@@ -456,7 +466,7 @@ static void async_recvall_callback(struct event_context *ev,
        struct param_recvall *p = &state->param.param_recvall;
 
        if (state->syscall_type != ASYNC_SYSCALL_RECVALL) {
-               async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
                return;
        }
 
@@ -466,18 +476,18 @@ static void async_recvall_callback(struct event_context *ev,
        state->sys_errno = errno;
 
        if (state->result.result_ssize_t == -1) {
-               async_req_error(req, map_nt_error_from_unix(state->sys_errno));
+               async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
                return;
        }
 
        if (state->result.result_ssize_t == 0) {
-               async_req_error(req, NT_STATUS_END_OF_FILE);
+               async_req_nterror(req, NT_STATUS_END_OF_FILE);
                return;
        }
 
        p->received += state->result.result_ssize_t;
        if (p->received > p->length) {
-               async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+               async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
                return;
        }
 
@@ -499,7 +509,7 @@ static void async_recvall_callback(struct event_context *ev,
  * async_recvall will call recv(2) until "length" bytes are received
  */
 
-struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                               int fd, void *buffer, size_t length,
                               int flags)
 {
@@ -508,7 +518,7 @@ struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 
        result = async_fde_syscall_new(
                mem_ctx, ev, ASYNC_SYSCALL_RECVALL,
-               fd, EVENT_FD_READ, async_recvall_callback,
+               fd, TEVENT_FD_READ, async_recvall_callback,
                &state);
        if (result == NULL) {
                return NULL;
@@ -525,7 +535,7 @@ struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 
 NTSTATUS recvall_recv(struct async_req *req)
 {
-       return async_req_simple_recv(req);
+       return async_req_simple_recv_ntstatus(req);
 }
 
 struct async_connect_state {
@@ -535,8 +545,8 @@ struct async_connect_state {
        long old_sockflags;
 };
 
-static void async_connect_connected(struct event_context *ev,
-                                   struct fd_event *fde, uint16_t flags,
+static void async_connect_connected(struct tevent_context *ev,
+                                   struct tevent_fd *fde, uint16_t flags,
                                    void *priv);
 
 /**
@@ -553,13 +563,13 @@ static void async_connect_connected(struct event_context *ev,
  */
 
 struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
-                                    struct event_context *ev,
+                                    struct tevent_context *ev,
                                     int fd, const struct sockaddr *address,
                                     socklen_t address_len)
 {
        struct async_req *result;
        struct async_connect_state *state;
-       struct fd_event *fde;
+       struct tevent_fd *fde;
        NTSTATUS status;
 
        if (!async_req_setup(mem_ctx, &result, &state,
@@ -575,7 +585,7 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
        state->fd = fd;
        state->sys_errno = 0;
 
-       state->old_sockflags = sys_fcntl_long(fd, F_GETFL, 0);
+       state->old_sockflags = fcntl(fd, F_GETFL, 0);
        if (state->old_sockflags == -1) {
                goto post_errno;
        }
@@ -604,7 +614,7 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
                goto post_errno;
        }
 
-       fde = event_add_fd(ev, state, fd, EVENT_FD_READ | EVENT_FD_WRITE,
+       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;
@@ -616,8 +626,8 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
        state->sys_errno = errno;
        status = map_nt_error_from_unix(state->sys_errno);
  post_status:
-       sys_fcntl_long(fd, F_SETFL, state->old_sockflags);
-       if (!async_post_status(result, ev, status)) {
+       fcntl(fd, F_SETFL, state->old_sockflags);
+       if (!async_post_ntstatus(result, ev, status)) {
                goto fail;
        }
        return result;
@@ -634,8 +644,8 @@ struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
  * @param[in] priv     private data, "struct async_req *" in this case
  */
 
-static void async_connect_connected(struct event_context *ev,
-                                   struct fd_event *fde, uint16_t flags,
+static void async_connect_connected(struct tevent_context *ev,
+                                   struct tevent_fd *fde, uint16_t flags,
                                    void *priv)
 {
        struct async_req *req = talloc_get_type_abort(
@@ -650,8 +660,8 @@ static void async_connect_connected(struct event_context *ev,
         * successful connect, the socket is only writable. Upon an
         * error, it's both readable and writable.
         */
-       if ((flags & (EVENT_FD_READ|EVENT_FD_WRITE))
-           == (EVENT_FD_READ|EVENT_FD_WRITE)) {
+       if ((flags & (TEVENT_FD_READ|TEVENT_FD_WRITE))
+           == (TEVENT_FD_READ|TEVENT_FD_WRITE)) {
                int sockerr;
                socklen_t err_len = sizeof(sockerr);
 
@@ -664,8 +674,8 @@ static void async_connect_connected(struct event_context *ev,
 
                DEBUG(10, ("connect returned %s\n", strerror(errno)));
 
-               sys_fcntl_long(state->fd, F_SETFL, state->old_sockflags);
-               async_req_error(req, map_nt_error_from_unix(state->sys_errno));
+               fcntl(state->fd, F_SETFL, state->old_sockflags);
+               async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
                return;
        }
 
@@ -679,11 +689,11 @@ NTSTATUS async_connect_recv(struct async_req *req, int *perrno)
                req->private_data, struct async_connect_state);
        NTSTATUS status;
 
-       sys_fcntl_long(state->fd, F_SETFL, state->old_sockflags);
+       fcntl(state->fd, F_SETFL, state->old_sockflags);
 
        *perrno = state->sys_errno;
 
-       if (async_req_is_error(req, &status)) {
+       if (async_req_is_nterror(req, &status)) {
                return status;
        }
        if (state->sys_errno == 0) {
similarity index 82%
rename from source3/include/async_sock.h
rename to lib/async_req/async_sock.h
index c6f95d64d551a201974b8155236a92abc8134bfb..fd41acacbbc7ef942418d1b365ddd5de191adb28 100644 (file)
@@ -26,24 +26,24 @@ 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);
 
-struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *async_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                             int fd, const void *buffer, size_t length,
                             int flags);
-struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                             int fd, void *buffer, size_t length,
                             int flags);
 struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
-                                    struct event_context *ev,
+                                    struct tevent_context *ev,
                                     int fd, const struct sockaddr *address,
                                     socklen_t address_len);
 NTSTATUS async_connect_recv(struct async_req *req, int *perrno);
 
-struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+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);
 
-struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+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);
index 08d5288a488d2e1a104ad3c3c1b1cf0c39ec7d80..820f890fd07b275f00087008241fdf2f36412e5f 100644 (file)
@@ -1,3 +1,3 @@
 [SUBSYSTEM::LIBASYNC_REQ]
 
-LIBASYNC_REQ_OBJ_FILES = $(addprefix ../lib/async_req/, async_req.o)
+LIBASYNC_REQ_OBJ_FILES = $(addprefix ../lib/async_req/, async_req.o async_sock.o async_req_ntstatus.o)
index 4edb55c03a29e057f38b4597a8d443c4d574ab89..30be30f4ab1b8986b1544165c2062b28f12592b3 100644 (file)
@@ -7,7 +7,14 @@ LIBREPLACE_NETWORK_OBJS=""
 LIBREPLACE_NETWORK_LIBS=""
 
 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
-AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
+AC_CHECK_HEADERS(netinet/in_systm.h)
+AC_CHECK_HEADERS([netinet/ip.h], [], [],[#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif])
+AC_CHECK_HEADERS(netinet/tcp.h netinet/in_ip.h)
 AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
 
 dnl we need to check that net/if.h really can be used, to cope with hpux
index f53a4c297455d9cadc0c3df846f91fe1c9c18124..fb3f414c95b57ee0c76369f1b0fdf5c600245594 100644 (file)
@@ -7,6 +7,9 @@ AC_CACHE_CHECK([for broken readdir],libreplace_cv_READDIR_NEEDED,[
        [libreplace_cv_READDIR_NEEDED="assuming not"])
 ])
 
+AC_CHECK_FUNCS(dirfd)
+AC_HAVE_DECL(dirfd, [#include <dirent.h>])
+
 #
 # try to replace with getdirentries() if needed
 #
index 688a7466c3d89babb58d36b5e24306ce3cc8de51..c5b8676acfa6e8baadc9ca9e87547cfba7577e6c 100644 (file)
@@ -503,18 +503,6 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
                              ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
 #define _TYPE_MAXIMUM(t) ((t) (~ (t) 0 - _TYPE_MINIMUM (t)))
 
-#ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX 255
-#endif
-
-/*
- * Some older systems seem not to have MAXHOSTNAMELEN
- * defined.
- */
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN HOST_NAME_MAX
-#endif
-
 #ifndef UINT16_MAX
 #define UINT16_MAX 65535
 #endif
index 473d79b5f2997835e9a6c426d0f63a721ece9feb..40d20db2d4a4ac7fc3504f8e092cf7a80d47c5d9 100644 (file)
@@ -271,7 +271,11 @@ int rep_socketpair(int d, int type, int protocol, int sv[2]);
 #endif
 
 #ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX 256
+#define HOST_NAME_MAX 255
+#endif
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN HOST_NAME_MAX
 #endif
 
 #ifndef HAVE_SA_FAMILY_T
index 51d087b6d36188e9ad4561708e11a28462bfa671..30da9ee5c2b964d5a07f9d1ecb793de0adde4cb5 100644 (file)
@@ -17,6 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "replace.h"
 #include <talloc.h>
 #include <pytalloc.h>
 
index 90c9ba2863bda2e7a419ba406fdabd3e1dd5690a..38b03b93b65dabade9243a88cce72221ac89715e 100644 (file)
@@ -1,7 +1,7 @@
 ################################################
 # Start SUBSYSTEM LIBTDB
 [LIBRARY::LIBTDB]
-OUTPUT_TYPE = STATIC_LIBRARY
+OUTPUT_TYPE = MERGED_OBJ
 CFLAGS = -I$(tdbsrcdir)/include
 #
 # End SUBSYSTEM ldb
index 15a8d8a3e212c0995bf6acc194c4c7e875e23854..159bc4dce5fa367005d07c76dcec98fd0a41d902 100644 (file)
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "replace.h"
+#include "system/filesys.h"
+
 #include <Python.h>
 #ifndef Py_RETURN_NONE
 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
 #endif
 
-#ifdef HAVE_FSTAT
-#undef HAVE_FSTAT
-#endif
-
 /* Include tdb headers */
-#include <stdint.h>
-#include <signal.h>
 #include <tdb.h>
-#include <fcntl.h>
-#include <stdbool.h>
 
 typedef struct {
        PyObject_HEAD
index a4e6037993ab202841d64491d2733128c0a2d7ce..1f2d4ca4a8e504fc2fee6ccb532cfecc73eb1cb7 100644 (file)
@@ -1,8 +1,6 @@
-[PYTHON::swig_tdb]
+[PYTHON::pytdb]
 LIBRARY_REALNAME = tdb.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = LIBTDB DYNCONFIG
 
-swig_tdb_OBJ_FILES = $(tdbsrcdir)/pytdb.o
-
-$(swig_tdb_OBJ_FILES): CFLAGS+=$(CFLAG_NO_CAST_QUAL)
+pytdb_OBJ_FILES = $(tdbsrcdir)/pytdb.o
 
index c036668cd14e8b73063a19a7f8d9ff2e2bb4aa53..bb7fad8f7aadf12feb1c214080c37b46bc9fdda0 100644 (file)
@@ -7,6 +7,7 @@ AC_DEFUN(BUILD_WITH_SHARED_BUILD_DIR,
     if test x"$with_shared_build_dir" != x; then
         sharedbuilddir=$with_shared_build_dir
         CFLAGS="$CFLAGS -I$with_shared_build_dir/include"
+        CPPFLAGS="$CPPFLAGS -I$with_shared_build_dir/include"
         LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib"
     fi
     AC_SUBST(sharedbuilddir)
index 5d10554531ea3f9eba0d627fe1a9fb548c3ae258..5c34064004ff2ce023803974b09729c7b366065a 100644 (file)
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "replace.h"
 #include <Python.h>
 
 #ifndef Py_RETURN_NONE
index abc60fa2ce4d72f784b0d0c9de44e630414f78cf..0c1beca6759ccf9244e613f0038471dbb7564c22 100644 (file)
@@ -1,10 +1,5 @@
-# TODO: Change python stuff to tevent
-[PYTHON::swig_events]
+[PYTHON::pytevent]
 LIBRARY_REALNAME = tevent.$(SHLIBEXT)
 PRIVATE_DEPENDENCIES = LIBTEVENT PYTALLOC LIBSAMBA-UTIL LIBREPLACE
 
-swig_events_OBJ_FILES = $(libteventsrcdir)/pytevent.o
-
-$(swig_events_OBJ_FILES): CFLAGS+=$(CFLAG_NO_CAST_QUAL)
-
-PC_FILES += $(libteventsrcdir)/tevent.pc
+pytevent_OBJ_FILES = $(libteventsrcdir)/pytevent.o
index 1b811f5fa2e899a75b876353e8477fa1b87ab5b5..faa18577a7acb3523520057ebe9176bbb9e00883 100644 (file)
@@ -27,9 +27,9 @@
 static int fde_count;
 
 static void fde_handler(struct tevent_context *ev_ctx, struct tevent_fd *f, 
-                       uint16_t flags, void *private)
+                       uint16_t flags, void *private_data)
 {
-       int *fd = (int *)private;
+       int *fd = (int *)private_data;
        char c;
 #ifdef SA_SIGINFO
        kill(getpid(), SIGUSR1);
@@ -41,16 +41,16 @@ static void fde_handler(struct tevent_context *ev_ctx, struct tevent_fd *f,
 }
 
 static void finished_handler(struct tevent_context *ev_ctx, struct tevent_timer *te,
-                            struct timeval tval, void *private)
+                            struct timeval tval, void *private_data)
 {
-       int *finished = (int *)private;
+       int *finished = (int *)private_data;
        (*finished) = 1;
 }
 
 static void count_handler(struct tevent_context *ev_ctx, struct signal_event *te,
-                         int signum, int count, void *info, void *private)
+                         int signum, int count, void *info, void *private_data)
 {
-       int *countp = (int *)private;
+       int *countp = (int *)private_data;
        (*countp) += count;
 }
 
index be7e2982188516b38370d7b2b262bf3e349c423d..ac5710ff0591d0fdbae98df0548cfbd7e64e6914 100644 (file)
@@ -22,8 +22,6 @@ installdirs::
 
 installheaders:: installdirs
        cp $(srcdir)/tevent.h $(DESTDIR)$(includedir)
-       cp $(srcdir)/tevent_internal.h $(DESTDIR)$(includedir)
-       cp $(srcdir)/tevent_util.h $(DESTDIR)$(includedir)
 
 installlibs:: installdirs
        cp tevent.pc $(DESTDIR)$(libdir)/pkgconfig
index c21ba209af2e70fdcb61f19f11e11b914ac170bb..04ee6975bd5e9cd602bad4a0ebdd35741b2df780 100644 (file)
@@ -29,7 +29,7 @@
 #define NUM_SIGNALS 64
 
 /* maximum number of SA_SIGINFO signals to hold in the queue */
-#define SA_INFO_QUEUE_COUNT 10
+#define SA_INFO_QUEUE_COUNT 100
 
 struct sigcounter {
        uint32_t count;
index 894beccabf941f7df9ac7d16b8820aedd4a03c52..b860dea7919350d1f2e9799df84896afeb5264f1 100644 (file)
@@ -151,7 +151,7 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val)
 
 #if HAVE_ASM_BYTEORDER
 
-#define  _PTRPOS(buf,pos) (((const uint8_t *)buf)+(pos))
+#define  _PTRPOS(buf,pos) (((const uint8_t *)(buf))+(pos))
 #define SVAL(buf,pos) ld_le16((const uint16_t *)_PTRPOS(buf,pos))
 #define IVAL(buf,pos) ld_le32((const uint32_t *)_PTRPOS(buf,pos))
 #define SSVAL(buf,pos,val) st_le16((uint16_t *)_PTRPOS(buf,pos), val)
index 22f22b5771b7a7c755f4e5ff03affc56df4c252c..14bdb2a2776d91756307497ad27236ed182f5ea4 100644 (file)
@@ -30,6 +30,7 @@ LIBSAMBA-UTIL_OBJ_FILES = $(addprefix $(libutilsrcdir)/, \
                params.o)
 
 PUBLIC_HEADERS += $(addprefix $(libutilsrcdir)/, util.h \
+                                dlinklist.h \
                                 attr.h \
                                 byteorder.h \
                                 data_blob.h \
index 98aabc554ba7c3f1029a92b6f64f50bcc3de01ca..578822088fb21055637fbcb507ab1ab9161e8f45 100644 (file)
@@ -102,7 +102,7 @@ _PUBLIC_ void dbghdr(int level, const char *location, const char *func)
 }
 
 
-_PUBLIC_ void dbghdrclass(int level, int class, const char *location, const char *func)
+_PUBLIC_ void dbghdrclass(int level, int dclass, const char *location, const char *func)
 {
        /* Simple wrapper, Samba 4 doesn't do debug classes */
        dbghdr(level, location, func);
index 193922973f1a8f692a7c6cff3ae06e881589f3a5..c8a8b6346ad8414c9e1f3c8cbbd58bef46af182f 100644 (file)
@@ -92,10 +92,10 @@ static void free_layer(struct idr_context *idp, struct idr_layer *p)
 static int idr_pre_get(struct idr_context *idp)
 {
        while (idp->id_free_cnt < IDR_FREE_MAX) {
-               struct idr_layer *new = talloc_zero(idp, struct idr_layer);
-               if(new == NULL)
+               struct idr_layer *pn = talloc_zero(idp, struct idr_layer);
+               if(pn == NULL)
                        return (0);
-               free_layer(idp, new);
+               free_layer(idp, pn);
        }
        return 1;
 }
@@ -103,7 +103,7 @@ static int idr_pre_get(struct idr_context *idp)
 static int sub_alloc(struct idr_context *idp, void *ptr, int *starting_id)
 {
        int n, m, sh;
-       struct idr_layer *p, *new;
+       struct idr_layer *p, *pn;
        struct idr_layer *pa[MAX_LEVEL];
        int l, id, oid;
        uint32_t bm;
@@ -155,9 +155,9 @@ restart:
                 * Create the layer below if it is missing.
                 */
                if (!p->ary[m]) {
-                       if (!(new = alloc_layer(idp)))
+                       if (!(pn = alloc_layer(idp)))
                                return -1;
-                       p->ary[m] = new;
+                       p->ary[m] = pn;
                        p->count++;
                }
                pa[l--] = p;
@@ -188,7 +188,7 @@ restart:
 
 static int idr_get_new_above_int(struct idr_context *idp, void *ptr, int starting_id)
 {
-       struct idr_layer *p, *new;
+       struct idr_layer *p, *pn;
        int layers, v, id;
 
        idr_pre_get(idp);
@@ -210,24 +210,24 @@ build_up:
                layers++;
                if (!p->count)
                        continue;
-               if (!(new = alloc_layer(idp))) {
+               if (!(pn = alloc_layer(idp))) {
                        /*
                         * The allocation failed.  If we built part of
                         * the structure tear it down.
                         */
-                       for (new = p; p && p != idp->top; new = p) {
+                       for (pn = p; p && p != idp->top; pn = p) {
                                p = p->ary[0];
-                               new->ary[0] = NULL;
-                               new->bitmap = new->count = 0;
-                               free_layer(idp, new);
+                               pn->ary[0] = NULL;
+                               pn->bitmap = pn->count = 0;
+                               free_layer(idp, pn);
                        }
                        return -1;
                }
-               new->ary[0] = p;
-               new->count = 1;
+               pn->ary[0] = p;
+               pn->count = 1;
                if (p->bitmap == IDR_FULL)
-                       set_bit(0, new->bitmap);
-               p = new;
+                       set_bit(0, pn->bitmap);
+               p = pn;
        }
        idp->top = p;
        idp->layers = layers;
index 70b18478c65db84f5ddc9d13359c855816189f54..c11b6879d2de0c6e9180a27971f8b82d30f70162 100644 (file)
@@ -21,9 +21,7 @@
 */
 
 #include "includes.h"
-#include "lib/events/events.h"
 #include "lib/ldb/include/ldb.h"
-#include "lib/ldb/include/ldb_errors.h"
 #include "../lib/util/util_ldb.h"
 /*
   search the sam for the specified attributes - va_list variant
index cf195706db0b7514f41a1b5fc0c20eefbb99bb71..16499e17367cc1e89c1973bb6d4337ced0f15d5c 100644 (file)
@@ -112,6 +112,7 @@ XFILE *x_fopen(const char *fname, int flags, mode_t mode)
        if ((flags & O_ACCMODE) == O_RDWR) {
                /* we don't support RDWR in XFILE - use file 
                   descriptors instead */
+               SAFE_FREE(ret);
                errno = EINVAL;
                return NULL;
        }
index dac61efc118bfb0b1825e71feef869e90f59c47f..a3e295d3df0489bdf63a233e759b9a76ef786753 100644 (file)
@@ -115,9 +115,9 @@ failed:
   handle a request timeout
 */
 static void nbt_name_socket_timeout(struct tevent_context *ev, struct tevent_timer *te,
-                                   struct timeval t, void *private)
+                                   struct timeval t, void *private_data)
 {
-       struct nbt_name_request *req = talloc_get_type(private,
+       struct nbt_name_request *req = talloc_get_type(private_data,
                                                       struct nbt_name_request);
 
        if (req->num_retries != 0) {
@@ -314,9 +314,9 @@ done:
   handle fd events on a nbt_name_socket
 */
 static void nbt_name_socket_handler(struct tevent_context *ev, struct tevent_fd *fde,
-                                   uint16_t flags, void *private)
+                                   uint16_t flags, void *private_data)
 {
-       struct nbt_name_socket *nbtsock = talloc_get_type(private,
+       struct nbt_name_socket *nbtsock = talloc_get_type(private_data,
                                                          struct nbt_name_socket);
        if (flags & EVENT_FD_WRITE) {
                nbt_name_socket_send(nbtsock);
@@ -508,10 +508,10 @@ NTSTATUS nbt_name_request_recv(struct nbt_name_request *req)
 _PUBLIC_ NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
                                  void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
                                                  struct socket_address *),
-                                 void *private)
+                                 void *private_data)
 {
        nbtsock->incoming.handler = handler;
-       nbtsock->incoming.private_data = private;
+       nbtsock->incoming.private_data = private_data;
        EVENT_FD_READABLE(nbtsock->fde);
        return NT_STATUS_OK;
 }
diff --git a/libcli/security/config.mk b/libcli/security/config.mk
new file mode 100644 (file)
index 0000000..56d8e13
--- /dev/null
@@ -0,0 +1,5 @@
+[SUBSYSTEM::LIBSECURITY_COMMON]
+PRIVATE_DEPENDENCIES = TALLOC
+
+LIBSECURITY_COMMON_OBJ_FILES = $(addprefix $(libclicommonsrcdir)/security/, \
+                                       dom_sid.o)
similarity index 92%
rename from source4/libcli/security/dom_sid.c
rename to libcli/security/dom_sid.c
index e1a6b8e8ee8dfde7a1c4a542f410c91b7bac64bc..db820209906c88992cbad1ccb1e4f4d6b4bcb789 100644 (file)
@@ -1,34 +1,34 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    Samba utility functions
 
    Copyright (C) Stefan (metze) Metzmacher     2002-2004
    Copyright (C) Andrew Tridgell               1992-2004
    Copyright (C) Jeremy Allison                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/>.
 */
 
 #include "includes.h"
 #include "librpc/gen_ndr/security.h"
-#include "libcli/security/security.h"
 
 /*****************************************************************
  Compare the auth portion of two sids.
-*****************************************************************/  
+*****************************************************************/
 
-static int dom_sid_compare_auth(const struct dom_sid *sid1, const struct dom_sid *sid2)
+static int dom_sid_compare_auth(const struct dom_sid *sid1,
+                               const struct dom_sid *sid2)
 {
        int i;
 
@@ -51,7 +51,7 @@ static int dom_sid_compare_auth(const struct dom_sid *sid1, const struct dom_sid
 
 /*****************************************************************
  Compare two sids.
-*****************************************************************/  
+*****************************************************************/
 
 int dom_sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2)
 {
@@ -77,18 +77,22 @@ int dom_sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2)
 
 /*****************************************************************
  Compare two sids.
-*****************************************************************/  
+*****************************************************************/
 
 bool dom_sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2)
 {
        return dom_sid_compare(sid1, sid2) == 0;
 }
 
+/* Yes, I did think about multibyte issues here, and for all I can see there's
+ * none of those for parsing a SID. */
+#undef strncasecmp
+
 bool dom_sid_parse(const char *sidstr, struct dom_sid *ret)
 {
        uint_t rev, ia, num_sub_auths, i;
        char *p;
-  
+
        if (strncasecmp(sidstr, "S-", 2)) {
                return false;
        }
@@ -176,7 +180,7 @@ struct dom_sid *dom_sid_dup(TALLOC_CTX *mem_ctx, const struct dom_sid *dom_sid)
 {
        struct dom_sid *ret;
        int i;
-       
+
        if (!dom_sid) {
                return NULL;
        }
@@ -206,8 +210,8 @@ struct dom_sid *dom_sid_dup(TALLOC_CTX *mem_ctx, const struct dom_sid *dom_sid)
   add a rid to a domain dom_sid to make a full dom_sid. This function
   returns a new sid in the supplied memory context
 */
-struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx, 
-                               const struct dom_sid *domain_sid, 
+struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx,
+                               const struct dom_sid *domain_sid,
                                uint32_t rid)
 {
        struct dom_sid *sid;
@@ -251,7 +255,7 @@ NTSTATUS dom_sid_split_rid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
 /*
   return true if the 2nd sid is in the domain given by the first sid
 */
-bool dom_sid_in_domain(const struct dom_sid *domain_sid, 
+bool dom_sid_in_domain(const struct dom_sid *domain_sid,
                       const struct dom_sid *sid)
 {
        int i;
@@ -281,7 +285,7 @@ char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
        int i, ofs, maxlen;
        uint32_t ia;
        char *ret;
-       
+
        if (!sid) {
                return talloc_strdup(mem_ctx, "(NULL SID)");
        }
@@ -295,12 +299,13 @@ char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
                (sid->id_auth[3] << 16) +
                (sid->id_auth[2] << 24);
 
-       ofs = snprintf(ret, maxlen, "S-%u-%lu", 
+       ofs = snprintf(ret, maxlen, "S-%u-%lu",
                       (unsigned int)sid->sid_rev_num, (unsigned long)ia);
 
        for (i = 0; i < sid->num_auths; i++) {
-               ofs += snprintf(ret + ofs, maxlen - ofs, "-%lu", (unsigned long)sid->sub_auths[i]);
+               ofs += snprintf(ret + ofs, maxlen - ofs, "-%lu",
+                               (unsigned long)sid->sub_auths[i]);
        }
-       
+
        return ret;
 }
diff --git a/libcli/security/dom_sid.h b/libcli/security/dom_sid.h
new file mode 100644 (file)
index 0000000..9d96392
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+
+   Copyright (C) Stefan (metze) Metzmacher     2002-2004
+   Copyright (C) Andrew Tridgell               1992-2004
+   Copyright (C) Jeremy Allison                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/>.
+*/
+
+#ifndef _DOM_SID_H_
+#define _DOM_SID_H_
+
+int dom_sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2);
+bool dom_sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2);
+bool dom_sid_parse(const char *sidstr, struct dom_sid *ret);
+struct dom_sid *dom_sid_parse_talloc(TALLOC_CTX *mem_ctx, const char *sidstr);
+struct dom_sid *dom_sid_parse_length(TALLOC_CTX *mem_ctx, const DATA_BLOB *sid);
+struct dom_sid *dom_sid_dup(TALLOC_CTX *mem_ctx, const struct dom_sid *dom_sid);
+struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx,
+                               const struct dom_sid *domain_sid,
+                               uint32_t rid);
+NTSTATUS dom_sid_split_rid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
+                          struct dom_sid **domain, uint32_t *rid);
+bool dom_sid_in_domain(const struct dom_sid *domain_sid,
+                      const struct dom_sid *sid);
+char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
+
+#endif /*_DOM_SID_H_*/
+
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
new file mode 100644 (file)
index 0000000..1071f2a
--- /dev/null
@@ -0,0 +1,4433 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * client auto-generated by pidl. DO NOT MODIFY!
+ */
+
+#include "includes.h"
+#include "../librpc/gen_ndr/cli_spoolss.h"
+
+NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    uint32_t flags /* [in]  */,
+                                    const char *server /* [in] [unique,charset(UTF16)] */,
+                                    uint32_t level /* [in]  */,
+                                    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 count /* [out]  */,
+                                    WERROR *werror)
+{
+       struct spoolss_EnumPrinters r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.flags = flags;
+       r.in.server = server;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinters, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPRINTERS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               memcpy(info, r.out.info, count * sizeof(*info));
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   const char *printername /* [in] [unique,charset(UTF16)] */,
+                                   const char *datatype /* [in] [unique,charset(UTF16)] */,
+                                   struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
+                                   uint32_t access_mask /* [in]  */,
+                                   struct policy_handle *handle /* [out] [ref] */,
+                                   WERROR *werror)
+{
+       struct spoolss_OpenPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.printername = printername;
+       r.in.datatype = datatype;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_OpenPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_OPENPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *handle /* [in] [ref] */,
+                              uint32_t job_id /* [in]  */,
+                              struct spoolss_JobInfoContainer *ctr /* [in] [unique] */,
+                              enum spoolss_JobControl command /* [in]  */,
+                              WERROR *werror)
+{
+       struct spoolss_SetJob r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.job_id = job_id;
+       r.in.ctr = ctr;
+       r.in.command = command;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetJob, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SETJOB,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetJob, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *handle /* [in] [ref] */,
+                              uint32_t job_id /* [in]  */,
+                              uint32_t level /* [in]  */,
+                              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]  */,
+                              WERROR *werror)
+{
+       struct spoolss_GetJob r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.job_id = job_id;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetJob, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETJOB,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetJob, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               *info = *r.out.info;
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *handle /* [in] [ref] */,
+                                uint32_t firstjob /* [in]  */,
+                                uint32_t numjobs /* [in]  */,
+                                uint32_t level /* [in]  */,
+                                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 count /* [out]  */,
+                                WERROR *werror)
+{
+       struct spoolss_EnumJobs r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.firstjob = firstjob;
+       r.in.numjobs = numjobs;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumJobs, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMJOBS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               memcpy(info, r.out.info, count * sizeof(*info));
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
+{
+       struct spoolss_AddPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinter(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *handle /* [in] [ref] */,
+                                     WERROR *werror)
+{
+       struct spoolss_DeletePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetPrinter(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *handle /* [in] [ref] */,
+                                  uint32_t level /* [in]  */,
+                                  union spoolss_SetPrinterInfo info /* [in] [switch_is(level)] */,
+                                  struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
+                                  struct sec_desc_buf secdesc_ctr /* [in]  */,
+                                  enum spoolss_PrinterControl command /* [in]  */,
+                                  WERROR *werror)
+{
+       struct spoolss_SetPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.info = info;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.secdesc_ctr = secdesc_ctr;
+       r.in.command = command;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SETPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *handle /* [in] [ref] */,
+                                  uint32_t level /* [in]  */,
+                                  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]  */,
+                                  WERROR *werror)
+{
+       struct spoolss_GetPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               *info = *r.out.info;
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
+{
+       struct spoolss_AddPrinterDriver r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriver, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTERDRIVER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          const char *server /* [in] [unique,charset(UTF16)] */,
+                                          const char *environment /* [in] [unique,charset(UTF16)] */,
+                                          uint32_t level /* [in]  */,
+                                          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 count /* [out]  */,
+                                          WERROR *werror)
+{
+       struct spoolss_EnumPrinterDrivers r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server = server;
+       r.in.environment = environment;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDrivers, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPRINTERDRIVERS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               memcpy(info, r.out.info, count * sizeof(*info));
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
+{
+       struct spoolss_GetPrinterDriver r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTERDRIVER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 const char *server /* [in] [unique,charset(UTF16)] */,
+                                                 const char *environment /* [in] [unique,charset(UTF16)] */,
+                                                 uint32_t level /* [in]  */,
+                                                 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]  */,
+                                                 WERROR *werror)
+{
+       struct spoolss_GetPrinterDriverDirectory r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server = server;
+       r.in.environment = environment;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               *info = *r.out.info;
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+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)
+{
+       struct spoolss_DeletePrinterDriver r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.server = server;
+       r.in.architecture = architecture;
+       r.in.driver = driver;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriver, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPRINTERDRIVER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *werror)
+{
+       struct spoolss_AddPrintProcessor r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTPROCESSOR,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           const char *servername /* [in] [unique,charset(UTF16)] */,
+                                           const char *environment /* [in] [unique,charset(UTF16)] */,
+                                           uint32_t level /* [in]  */,
+                                           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 count /* [out]  */,
+                                           WERROR *werror)
+{
+       struct spoolss_EnumPrintProcessors r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.servername = servername;
+       r.in.environment = environment;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPRINTPROCESSORS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               memcpy(info, r.out.info, count * sizeof(*info));
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *werror)
+{
+       struct spoolss_GetPrintProcessorDirectory r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       uint32_t level /* [in]  */,
+                                       union spoolss_DocumentInfo info /* [in] [switch_is(level)] */,
+                                       uint32_t job_id /* [out]  */,
+                                       WERROR *werror)
+{
+       struct spoolss_StartDocPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_STARTDOCPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        WERROR *werror)
+{
+       struct spoolss_StartPagePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_STARTPAGEPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    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]  */,
+                                    WERROR *werror)
+{
+       struct spoolss_WritePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.data = data;
+       r.in._data_size = _data_size;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_WRITEPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle /* [in] [ref] */,
+                                      WERROR *werror)
+{
+       struct spoolss_EndPagePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENDPAGEPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    WERROR *werror)
+{
+       struct spoolss_AbortPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ABORTPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *handle /* [in] [ref] */,
+                                   uint32_t data_size /* [in]  */,
+                                   DATA_BLOB data /* [out]  */,
+                                   uint32_t _data_size /* [out] [value(r->out.data.length)] */,
+                                   WERROR *werror)
+{
+       struct spoolss_ReadPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.data_size = data_size;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReadPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_READPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *handle /* [in] [ref] */,
+                                     WERROR *werror)
+{
+       struct spoolss_EndDocPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENDDOCPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              WERROR *werror)
+{
+       struct spoolss_AddJob r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddJob, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDJOB,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct spoolss_ScheduleJob r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SCHEDULEJOB,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle /* [in] [ref] */,
+                                      const char *value_name /* [in] [charset(UTF16)] */,
+                                      uint32_t offered /* [in]  */,
+                                      enum spoolss_PrinterDataType type /* [out]  */,
+                                      union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */,
+                                      uint32_t needed /* [out]  */,
+                                      WERROR *werror)
+{
+       struct spoolss_GetPrinterData r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.value_name = value_name;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTERDATA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle /* [in] [ref] */,
+                                      const char *value_name /* [in] [charset(UTF16)] */,
+                                      enum spoolss_PrinterDataType type /* [in]  */,
+                                      union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */,
+                                      uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */,
+                                      WERROR *werror)
+{
+       struct spoolss_SetPrinterData r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.value_name = value_name;
+       r.in.type = type;
+       r.in.data = data;
+       r.in._offered = _offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SETPRINTERDATA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *werror)
+{
+       struct spoolss_WaitForPrinterChange r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_WAITFORPRINTERCHANGE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in,out] [ref] */,
+                                    WERROR *werror)
+{
+       struct spoolss_ClosePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_CLOSEPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               uint32_t level /* [in]  */,
+                               union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
+                               WERROR *werror)
+{
+       struct spoolss_AddForm r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDFORM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeleteForm(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *handle /* [in] [ref] */,
+                                  const char *form_name /* [in] [charset(UTF16)] */,
+                                  WERROR *werror)
+{
+       struct spoolss_DeleteForm r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.form_name = form_name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEFORM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               const char *form_name /* [in] [charset(UTF16)] */,
+                               uint32_t level /* [in]  */,
+                               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]  */,
+                               WERROR *werror)
+{
+       struct spoolss_GetForm r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.form_name = form_name;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetForm, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETFORM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               *info = *r.out.info;
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               const char *form_name /* [in] [charset(UTF16)] */,
+                               uint32_t level /* [in]  */,
+                               union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
+                               WERROR *werror)
+{
+       struct spoolss_SetForm r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.form_name = form_name;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetForm, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SETFORM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *handle /* [in] [ref] */,
+                                 uint32_t level /* [in]  */,
+                                 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 count /* [out]  */,
+                                 WERROR *werror)
+{
+       struct spoolss_EnumForms r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumForms, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMFORMS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               memcpy(info, r.out.info, count * sizeof(*info));
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *servername /* [in] [unique,charset(UTF16)] */,
+                                 uint32_t level /* [in]  */,
+                                 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 count /* [out]  */,
+                                 WERROR *werror)
+{
+       struct spoolss_EnumPorts r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.servername = servername;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPORTS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               memcpy(info, r.out.info, count * sizeof(*info));
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *servername /* [in] [unique,charset(UTF16)] */,
+                                    uint32_t level /* [in]  */,
+                                    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 count /* [out]  */,
+                                    WERROR *werror)
+{
+       struct spoolss_EnumMonitors r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.servername = servername;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMMONITORS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               memcpy(info, r.out.info, count * sizeof(*info));
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               const char *server_name /* [in] [unique,charset(UTF16)] */,
+                               uint32_t unknown /* [in]  */,
+                               const char *monitor_name /* [in] [charset(UTF16)] */,
+                               WERROR *werror)
+{
+       struct spoolss_AddPort r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.unknown = unknown;
+       r.in.monitor_name = monitor_name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPort, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPORT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *werror)
+{
+       struct spoolss_ConfigurePort r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_CONFIGUREPORT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
+{
+       struct spoolss_DeletePort r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPORT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *werror)
+{
+       struct spoolss_CreatePrinterIC r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_CREATEPRINTERIC,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *werror)
+{
+       struct spoolss_PlayGDIScriptOnPrinterIC r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *werror)
+{
+       struct spoolss_DeletePrinterIC r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPRINTERIC,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *werror)
+{
+       struct spoolss_AddPrinterConnection r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTERCONNECTION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *werror)
+{
+       struct spoolss_DeletePrinterConnection r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPRINTERCONNECTION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *werror)
+{
+       struct spoolss_PrinterMessageBox r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_PRINTERMESSAGEBOX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
+{
+       struct spoolss_AddMonitor r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDMONITOR,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *werror)
+{
+       struct spoolss_DeleteMonitor r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEMONITOR,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *werror)
+{
+       struct spoolss_DeletePrintProcessor r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPRINTPROCESSOR,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
+{
+       struct spoolss_AddPrintProvidor r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTPROVIDOR,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *werror)
+{
+       struct spoolss_DeletePrintProvidor r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPRINTPROVIDOR,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *werror)
+{
+       struct spoolss_EnumPrintProcDataTypes r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
+{
+       struct spoolss_ResetPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_RESETPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in] [ref] */,
+                                         const char *architecture /* [in] [unique,charset(UTF16)] */,
+                                         uint32_t level /* [in]  */,
+                                         DATA_BLOB *buffer /* [in] [unique] */,
+                                         uint32_t offered /* [in]  */,
+                                         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]  */,
+                                         WERROR *werror)
+{
+       struct spoolss_GetPrinterDriver2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.architecture = architecture;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+       r.in.client_major_version = client_major_version;
+       r.in.client_minor_version = client_minor_version;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTERDRIVER2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               *info = *r.out.info;
+       }
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+       return NT_STATUS_NOT_SUPPORTED;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
+                                                          TALLOC_CTX *mem_ctx,
+                                                          WERROR *werror)
+{
+       struct spoolss_FindFirstPrinterChangeNotification r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *werror)
+{
+       struct spoolss_FindNextPrinterChangeNotification r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *handle /* [in] [ref] */,
+                                              WERROR *werror)
+{
+       struct spoolss_FindClosePrinterNotify r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
+                                                                   TALLOC_CTX *mem_ctx,
+                                                                   WERROR *werror)
+{
+       struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        const char *server_name /* [in] [charset(UTF16)] */,
+                                        uint32_t printer_local /* [in]  */,
+                                        enum winreg_Type type /* [in]  */,
+                                        uint32_t unknown1 /* [in]  */,
+                                        uint32_t unknown2 /* [in]  */,
+                                        struct policy_handle *handle /* [out] [ref] */,
+                                        WERROR *werror)
+{
+       struct spoolss_ReplyOpenPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.printer_local = printer_local;
+       r.in.type = type;
+       r.in.unknown1 = unknown1;
+       r.in.unknown2 = unknown2;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_REPLYOPENPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *werror)
+{
+       struct spoolss_RouterReplyPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERREPLYPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in,out] [ref] */,
+                                         WERROR *werror)
+{
+       struct spoolss_ReplyClosePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_REPLYCLOSEPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPortEx(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *werror)
+{
+       struct spoolss_AddPortEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPORTEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
+                                                                TALLOC_CTX *mem_ctx,
+                                                                WERROR *werror)
+{
+       struct spoolss_RouterFindFirstPrinterChangeNotification r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct spoolss_SpoolerInit r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SPOOLERINIT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *werror)
+{
+       struct spoolss_ResetPrinterEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_RESETPRINTEREX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
+                                                            TALLOC_CTX *mem_ctx,
+                                                            struct policy_handle *handle /* [in] [ref] */,
+                                                            uint32_t flags /* [in]  */,
+                                                            uint32_t options /* [in]  */,
+                                                            const char *str /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t printer_local /* [in]  */,
+                                                            struct spoolss_NotifyOptionsContainer *t1 /* [in] [unique] */,
+                                                            WERROR *werror)
+{
+       struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.flags = flags;
+       r.in.options = options;
+       r.in.str = str;
+       r.in.printer_local = printer_local;
+       r.in.t1 = t1;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotification(struct rpc_pipe_client *cli,
+                                                              TALLOC_CTX *mem_ctx,
+                                                              WERROR *werror)
+{
+       struct spoolss_RouterRefreshPrinterChangeNotification r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RemoteFindNextPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
+                                                           TALLOC_CTX *mem_ctx,
+                                                           struct policy_handle *handle /* [in] [ref] */,
+                                                           uint32_t change_low /* [in]  */,
+                                                           struct spoolss_NotifyOptionsContainer *container /* [in] [unique] */,
+                                                           struct spoolss_NotifyInfo **info /* [out] [ref] */,
+                                                           WERROR *werror)
+{
+       struct spoolss_RemoteFindNextPrinterChangeNotifyEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.change_low = change_low;
+       r.in.container = container;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_44(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
+{
+       struct spoolss_44 r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_44, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_44,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     const char *printername /* [in] [unique,charset(UTF16)] */,
+                                     const char *datatype /* [in] [unique,charset(UTF16)] */,
+                                     struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
+                                     uint32_t access_mask /* [in]  */,
+                                     uint32_t level /* [in]  */,
+                                     union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
+                                     struct policy_handle *handle /* [out] [ref] */,
+                                     WERROR *werror)
+{
+       struct spoolss_OpenPrinterEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.printername = printername;
+       r.in.datatype = datatype;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.access_mask = access_mask;
+       r.in.level = level;
+       r.in.userlevel = userlevel;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_OPENPRINTEREX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *server /* [in] [unique,charset(UTF16)] */,
+                                    uint32_t level /* [in]  */,
+                                    union spoolss_PrinterInfo *info /* [in] [unique,switch_is(level)] */,
+                                    struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
+                                    struct security_descriptor *secdesc /* [in] [unique] */,
+                                    uint32_t ulevel /* [in]  */,
+                                    union spoolss_UserLevel userlevel /* [in] [switch_is(ulevel)] */,
+                                    WERROR *werror)
+{
+       struct spoolss_AddPrinterEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server = server;
+       r.in.level = level;
+       r.in.info = info;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.secdesc = secdesc;
+       r.in.ulevel = ulevel;
+       r.in.userlevel = userlevel;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTEREX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+   &nb