[SCM] Samba Shared Repository - branch v3-4-test updated -
release-4-0-0alpha7-517-g2471cb6
Günther Deschner
gd at samba.org
Wed Mar 18 16:18:15 GMT 2009
The branch, v3-4-test has been updated
via 2471cb64f7d2d2e7eb594b1cf904af9d6befd389 (commit)
via 931e48a757d40fb4dd5099560fe31afad201464c (commit)
via 82e78e67e00863437ef26914ff8d85007509b620 (commit)
via 92a9ede4ffc82a66531e716535db34416b387340 (commit)
from 0a20f7df770f2d460ff4034baf3ad29a96be4dd3 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test
- Log -----------------------------------------------------------------
commit 2471cb64f7d2d2e7eb594b1cf904af9d6befd389
Author: Günther Deschner <gd at samba.org>
Date: Wed Mar 18 16:38:36 2009 +0100
s3-spoolss: remove include/rpc_spoolss.h.
Guenther
(cherry picked from commit 7fbdf8aae93f143c879de705936279f42eb8ee6f)
commit 931e48a757d40fb4dd5099560fe31afad201464c
Author: Günther Deschner <gd at samba.org>
Date: Wed Mar 18 00:45:35 2009 +0100
s3-spoolss: remove rpc_server/srv_spoolss.c alltogether.
Guenther
(cherry picked from commit 36d07858069ed8710a0ad822535074bed77ec130)
commit 82e78e67e00863437ef26914ff8d85007509b620
Author: Günther Deschner <gd at samba.org>
Date: Wed Mar 18 00:43:31 2009 +0100
s3-spoolss: remove rpc_parse/parse_spoolss.c alltogether.
Good-Bye, last hand-marshalled rpc functions, rest in peace.
Guenther
(cherry picked from commit a502392541bcb45babbb8ca57e17306aa726ee9b)
commit 92a9ede4ffc82a66531e716535db34416b387340
Author: Günther Deschner <gd at samba.org>
Date: Wed Mar 18 00:41:47 2009 +0100
s3-spoolss: remove old spoolss_EnumPrinterDataEx.
Guenther
(cherry picked from commit a4e999c7e3214de26bdc7a20d5ec25d4ffdf152d)
-----------------------------------------------------------------------
Summary of changes:
source3/Makefile.in | 7 +-
source3/configure.in | 6 +-
source3/include/includes.h | 1 -
source3/include/proto.h | 12 -
source3/include/rpc_spoolss.h | 205 -------------
source3/rpc_parse/parse_spoolss.c | 280 ------------------
source3/rpc_server/srv_spoolss.c | 591 -------------------------------------
7 files changed, 6 insertions(+), 1096 deletions(-)
delete mode 100644 source3/include/rpc_spoolss.h
delete mode 100644 source3/rpc_parse/parse_spoolss.c
delete mode 100644 source3/rpc_server/srv_spoolss.c
Changeset truncated at 500 lines:
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 1e48ce9..e9eeff8 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -578,7 +578,7 @@ RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs_nt.o \
RPC_DFS_OBJ = ../librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o
-RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o \
+RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss_nt.o \
../librpc/gen_ndr/srv_spoolss.o
RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog_nt.o \
@@ -591,8 +591,7 @@ RPC_ECHO_OBJ = rpc_server/srv_echo_nt.o ../librpc/gen_ndr/srv_echo.o
RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ)
-RPC_PARSE_OBJ = $(RPC_PARSE_OBJ2) \
- rpc_parse/parse_spoolss.o
+RPC_PARSE_OBJ = $(RPC_PARSE_OBJ2)
RPC_CLIENT_OBJ = rpc_client/cli_pipe.o rpc_client/rpc_transport_np.o \
rpc_client/rpc_transport_sock.o rpc_client/rpc_transport_smbd.o
@@ -2279,7 +2278,7 @@ bin/librpc_dssetup. at SHLIBEXT@: $(BINARY_PREREQS) $(RPC_DSSETUP_OBJ)
@echo "Linking $@"
@$(SHLD_MODULE) $(RPC_DSSETUP_OBJ)
-bin/librpc_spoolss2. at SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SPOOLSS_OBJ)
+bin/librpc_spoolss. at SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SPOOLSS_OBJ)
@echo "Linking $@"
@$(SHLD_MODULE) $(RPC_SPOOLSS_OBJ)
diff --git a/source3/configure.in b/source3/configure.in
index d81e02d..c7a81d1 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -433,7 +433,7 @@ AC_SUBST(DYNEXP)
dnl Add modules that have to be built by default here
dnl These have to be built static:
-default_static_modules="pdb_smbpasswd pdb_tdbsam pdb_wbc_sam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss2 rpc_eventlog auth_sam auth_unix auth_winbind auth_wbc auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
+default_static_modules="pdb_smbpasswd pdb_tdbsam pdb_wbc_sam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog auth_sam auth_unix auth_winbind auth_wbc auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
dnl These are preferably build shared, and static if dlopen() is not available
default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy vfs_shadow_copy2 charset_CP850 charset_CP437 auth_script vfs_readahead vfs_xattr_tdb vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb vfs_smb_traffic_analyzer vfs_preopen"
@@ -6087,7 +6087,7 @@ do
done
dnl Always build these modules static
-MODULE_rpc_spoolss2=STATIC
+MODULE_rpc_spoolss=STATIC
MODULE_rpc_srvsvc=STATIC
MODULE_idmap_tdb=STATIC
MODULE_idmap_passdb=STATIC
@@ -6131,7 +6131,7 @@ SMB_MODULE(rpc_ntsvcs, \$(RPC_NTSVCS_OBJ), "bin/librpc_ntsvcs.$SHLIBEXT", RPC)
SMB_MODULE(rpc_netlogon, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
SMB_MODULE(rpc_netdfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC)
SMB_MODULE(rpc_srvsvc, \$(RPC_SVC_OBJ), "bin/librpc_svcsvc.$SHLIBEXT", RPC)
-SMB_MODULE(rpc_spoolss2, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss2.$SHLIBEXT", RPC)
+SMB_MODULE(rpc_spoolss, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss.$SHLIBEXT", RPC)
SMB_MODULE(rpc_eventlog, \$(RPC_EVENTLOG_OBJ), "bin/librpc_eventlog.$SHLIBEXT", RPC)
SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
SMB_MODULE(rpc_rpcecho, \$(RPC_ECHO_OBJ), "bin/librpc_rpcecho.$SHLIBEXT", RPC)
diff --git a/source3/include/includes.h b/source3/include/includes.h
index b48a755..4bf4b5c 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -622,7 +622,6 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
#include "ntdomain.h"
#include "reg_objects.h"
#include "reg_db.h"
-#include "rpc_spoolss.h"
#include "rpc_perfcount.h"
#include "rpc_perfcount_defs.h"
#include "librpc/gen_ndr/notify.h"
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 2f4c360..d0b8f22 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5827,13 +5827,6 @@ bool smb_io_rpc_auth_schannel_chk(const char *desc, int auth_len,
bool sec_io_desc(const char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth);
bool sec_io_desc_buf(const char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int depth);
-/* The following definitions come from rpc_parse/parse_spoolss.c */
-
-uint32 spoolss_size_printer_enum_values(PRINTER_ENUM_VALUES *p);
-bool make_spoolss_buffer5(TALLOC_CTX *mem_ctx, BUFFER5 *buf5, uint32 len, uint16 *src);
-bool spoolss_io_q_enumprinterdataex(const char *desc, SPOOL_Q_ENUMPRINTERDATAEX *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_enumprinterdataex(const char *desc, SPOOL_R_ENUMPRINTERDATAEX *r_u, prs_struct *ps, int depth);
-
/* The following definitions come from rpc_server/srv_eventlog_lib.c */
TDB_CONTEXT *elog_init_tdb( char *tdbfilename );
@@ -5934,11 +5927,6 @@ void copy_id23_to_sam_passwd(struct samu *to,
void copy_id25_to_sam_passwd(struct samu *to,
struct samr_UserInfo25 *from);
-/* The following definitions come from rpc_server/srv_spoolss.c */
-
-void spoolss2_get_pipe_fns( struct api_struct **fns, int *n_fns );
-NTSTATUS rpc_spoolss2_init(void);
-
/* The following definitions come from rpc_server/srv_spoolss_nt.c */
WERROR delete_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *sharename );
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
deleted file mode 100644
index 4082903..0000000
--- a/source3/include/rpc_spoolss.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
-
- Copyright (C) Andrew Tridgell 1992-2000,
- Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
- Copyright (C) Jean Francois Micouleau 1998-2000.
- Copyright (C) Gerald Carter 2001-2006.
-
- 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 "librpc/gen_ndr/spoolss.h"
-
-#ifndef _RPC_SPOOLSS_H /* _RPC_SPOOLSS_H */
-#define _RPC_SPOOLSS_H
-
-/* spoolss pipe: this are the calls which are not implemented ...
-#define SPOOLSS_GETPRINTERDRIVER 0x0b
-#define SPOOLSS_READPRINTER 0x16
-#define SPOOLSS_WAITFORPRINTERCHANGE 0x1c
-#define SPOOLSS_ADDPORT 0x25
-#define SPOOLSS_CONFIGUREPORT 0x26
-#define SPOOLSS_DELETEPORT 0x27
-#define SPOOLSS_CREATEPRINTERIC 0x28
-#define SPOOLSS_PLAYGDISCRIPTONPRINTERIC 0x29
-#define SPOOLSS_DELETEPRINTERIC 0x2a
-#define SPOOLSS_ADDPRINTERCONNECTION 0x2b
-#define SPOOLSS_DELETEPRINTERCONNECTION 0x2c
-#define SPOOLSS_PRINTERMESSAGEBOX 0x2d
-#define SPOOLSS_ADDMONITOR 0x2e
-#define SPOOLSS_DELETEMONITOR 0x2f
-#define SPOOLSS_DELETEPRINTPROCESSOR 0x30
-#define SPOOLSS_ADDPRINTPROVIDOR 0x31
-#define SPOOLSS_DELETEPRINTPROVIDOR 0x32
-#define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION 0x36
-#define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION 0x37
-#define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD 0x39
-#define SPOOLSS_ADDPORTEX 0x3d
-#define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
-#define SPOOLSS_SPOOLERINIT 0x3f
-#define SPOOLSS_RESETPRINTEREX 0x40
-*/
-
-/* those are implemented */
-#define SPOOLSS_ENUMPRINTERS 0x00
-#define SPOOLSS_OPENPRINTER 0x01
-#define SPOOLSS_SETJOB 0x02
-#define SPOOLSS_GETJOB 0x03
-#define SPOOLSS_ENUMJOBS 0x04
-#define SPOOLSS_ADDPRINTER 0x05
-#define SPOOLSS_DELETEPRINTER 0x06
-#define SPOOLSS_SETPRINTER 0x07
-#define SPOOLSS_GETPRINTER 0x08
-#define SPOOLSS_ADDPRINTERDRIVER 0x09
-#define SPOOLSS_ENUMPRINTERDRIVERS 0x0a
-#define SPOOLSS_GETPRINTERDRIVERDIRECTORY 0x0c
-#define SPOOLSS_DELETEPRINTERDRIVER 0x0d
-#define SPOOLSS_ADDPRINTPROCESSOR 0x0e
-#define SPOOLSS_ENUMPRINTPROCESSORS 0x0f
-#define SPOOLSS_GETPRINTPROCESSORDIRECTORY 0x10
-#define SPOOLSS_STARTDOCPRINTER 0x11
-#define SPOOLSS_STARTPAGEPRINTER 0x12
-#define SPOOLSS_WRITEPRINTER 0x13
-#define SPOOLSS_ENDPAGEPRINTER 0x14
-#define SPOOLSS_ABORTPRINTER 0x15
-#define SPOOLSS_ENDDOCPRINTER 0x17
-#define SPOOLSS_ADDJOB 0x18
-#define SPOOLSS_SCHEDULEJOB 0x19
-#define SPOOLSS_GETPRINTERDATA 0x1a
-#define SPOOLSS_SETPRINTERDATA 0x1b
-#define SPOOLSS_CLOSEPRINTER 0x1d
-#define SPOOLSS_ADDFORM 0x1e
-#define SPOOLSS_DELETEFORM 0x1f
-#define SPOOLSS_GETFORM 0x20
-#define SPOOLSS_SETFORM 0x21
-#define SPOOLSS_ENUMFORMS 0x22
-#define SPOOLSS_ENUMPORTS 0x23
-#define SPOOLSS_ENUMMONITORS 0x24
-#define SPOOLSS_ENUMPRINTPROCDATATYPES 0x33
-#define SPOOLSS_RESETPRINTER 0x34
-#define SPOOLSS_GETPRINTERDRIVER2 0x35
-#define SPOOLSS_FCPN 0x38 /* FindClosePrinterNotify */
-#define SPOOLSS_REPLYOPENPRINTER 0x3a
-#define SPOOLSS_ROUTERREPLYPRINTER 0x3b
-#define SPOOLSS_REPLYCLOSEPRINTER 0x3c
-#define SPOOLSS_RFFPCNEX 0x41 /* RemoteFindFirstPrinterChangeNotifyEx */
-#define SPOOLSS_RRPCN 0x42 /* RouteRefreshPrinterChangeNotification */
-#define SPOOLSS_RFNPCNEX 0x43 /* RemoteFindNextPrinterChangeNotifyEx */
-#define SPOOLSS_OPENPRINTEREX 0x45
-#define SPOOLSS_ADDPRINTEREX 0x46
-#define SPOOLSS_ENUMPRINTERDATA 0x48
-#define SPOOLSS_DELETEPRINTERDATA 0x49
-#define SPOOLSS_SETPRINTERDATAEX 0x4d
-#define SPOOLSS_GETPRINTERDATAEX 0x4e
-#define SPOOLSS_ENUMPRINTERDATAEX 0x4f
-#define SPOOLSS_ENUMPRINTERKEY 0x50
-#define SPOOLSS_DELETEPRINTERDATAEX 0x51
-#define SPOOLSS_DELETEPRINTERKEY 0x52
-#define SPOOLSS_DELETEPRINTERDRIVEREX 0x54
-#define SPOOLSS_XCVDATAPORT 0x58
-#define SPOOLSS_ADDPRINTERDRIVEREX 0x59
-
-#define PRINTER_NOTIFY_SERVER_NAME 0x00
-#define PRINTER_NOTIFY_PRINTER_NAME 0x01
-#define PRINTER_NOTIFY_SHARE_NAME 0x02
-#define PRINTER_NOTIFY_PORT_NAME 0x03
-#define PRINTER_NOTIFY_DRIVER_NAME 0x04
-#define PRINTER_NOTIFY_COMMENT 0x05
-#define PRINTER_NOTIFY_LOCATION 0x06
-#define PRINTER_NOTIFY_DEVMODE 0x07
-#define PRINTER_NOTIFY_SEPFILE 0x08
-#define PRINTER_NOTIFY_PRINT_PROCESSOR 0x09
-#define PRINTER_NOTIFY_PARAMETERS 0x0A
-#define PRINTER_NOTIFY_DATATYPE 0x0B
-#define PRINTER_NOTIFY_SECURITY_DESCRIPTOR 0x0C
-#define PRINTER_NOTIFY_ATTRIBUTES 0x0D
-#define PRINTER_NOTIFY_PRIORITY 0x0E
-#define PRINTER_NOTIFY_DEFAULT_PRIORITY 0x0F
-#define PRINTER_NOTIFY_START_TIME 0x10
-#define PRINTER_NOTIFY_UNTIL_TIME 0x11
-#define PRINTER_NOTIFY_STATUS 0x12
-#define PRINTER_NOTIFY_STATUS_STRING 0x13
-#define PRINTER_NOTIFY_CJOBS 0x14
-#define PRINTER_NOTIFY_AVERAGE_PPM 0x15
-#define PRINTER_NOTIFY_TOTAL_PAGES 0x16
-#define PRINTER_NOTIFY_PAGES_PRINTED 0x17
-#define PRINTER_NOTIFY_TOTAL_BYTES 0x18
-#define PRINTER_NOTIFY_BYTES_PRINTED 0x19
-
-#define JOB_NOTIFY_PRINTER_NAME 0x00
-#define JOB_NOTIFY_MACHINE_NAME 0x01
-#define JOB_NOTIFY_PORT_NAME 0x02
-#define JOB_NOTIFY_USER_NAME 0x03
-#define JOB_NOTIFY_NOTIFY_NAME 0x04
-#define JOB_NOTIFY_DATATYPE 0x05
-#define JOB_NOTIFY_PRINT_PROCESSOR 0x06
-#define JOB_NOTIFY_PARAMETERS 0x07
-#define JOB_NOTIFY_DRIVER_NAME 0x08
-#define JOB_NOTIFY_DEVMODE 0x09
-#define JOB_NOTIFY_STATUS 0x0A
-#define JOB_NOTIFY_STATUS_STRING 0x0B
-#define JOB_NOTIFY_SECURITY_DESCRIPTOR 0x0C
-#define JOB_NOTIFY_DOCUMENT 0x0D
-#define JOB_NOTIFY_PRIORITY 0x0E
-#define JOB_NOTIFY_POSITION 0x0F
-#define JOB_NOTIFY_SUBMITTED 0x10
-#define JOB_NOTIFY_START_TIME 0x11
-#define JOB_NOTIFY_UNTIL_TIME 0x12
-#define JOB_NOTIFY_TIME 0x13
-#define JOB_NOTIFY_TOTAL_PAGES 0x14
-#define JOB_NOTIFY_PAGES_PRINTED 0x15
-#define JOB_NOTIFY_TOTAL_BYTES 0x16
-#define JOB_NOTIFY_BYTES_PRINTED 0x17
-
-/********************************************/
-
-typedef struct printer_enum_values
-{
- UNISTR valuename;
- uint32 value_len;
- uint32 type;
- uint8 *data;
- uint32 data_len;
-
-}
-PRINTER_ENUM_VALUES;
-
-typedef struct printer_enum_values_ctr
-{
- uint32 size;
- uint32 size_of_array;
- PRINTER_ENUM_VALUES *values;
-}
-PRINTER_ENUM_VALUES_CTR;
-
-typedef struct spool_q_enumprinterdataex
-{
- POLICY_HND handle;
- UNISTR2 key;
- uint32 size;
-}
-SPOOL_Q_ENUMPRINTERDATAEX;
-
-typedef struct spool_r_enumprinterdataex
-{
- PRINTER_ENUM_VALUES_CTR ctr;
- uint32 needed;
- uint32 returned;
- WERROR status;
-}
-SPOOL_R_ENUMPRINTERDATAEX;
-
-#endif /* _RPC_SPOOLSS_H */
-
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
deleted file mode 100644
index ea09337..0000000
--- a/source3/rpc_parse/parse_spoolss.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * RPC Pipe client / server routines
- * Copyright (C) Andrew Tridgell 1992-2000,
- * Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
- * Copyright (C) Jean François Micouleau 1998-2000,
- * Copyright (C) Gerald Carter 2000-2002,
- * Copyright (C) Tim Potter 2001-2002.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "includes.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_PARSE
-
-/*******************************************************************
- * return the length of a uint32 (obvious, but the code is clean)
- ********************************************************************/
-
-static uint32 size_of_uint32(uint32 *value)
-{
- return (sizeof(*value));
-}
-
-/*******************************************************************
-return the size required by a struct in the stream
-********************************************************************/
-uint32 spoolss_size_printer_enum_values(PRINTER_ENUM_VALUES *p)
-{
- uint32 size = 0;
-
- if (!p)
- return 0;
-
- /* uint32(offset) + uint32(length) + length) */
- size += (size_of_uint32(&p->value_len)*2) + p->value_len;
- size += (size_of_uint32(&p->data_len)*2) + p->data_len + (p->data_len%2) ;
-
- size += size_of_uint32(&p->type);
-
- return size;
-}
-
-/*******************************************************************
- make a BUFFER5 struct from a uint16*
- ******************************************************************/
-
-bool make_spoolss_buffer5(TALLOC_CTX *mem_ctx, BUFFER5 *buf5, uint32 len, uint16 *src)
-{
-
- buf5->buf_len = len;
- if (src) {
- if (len) {
- if((buf5->buffer=(uint16*)TALLOC_MEMDUP(mem_ctx, src, sizeof(uint16)*len)) == NULL) {
- DEBUG(0,("make_spoolss_buffer5: Unable to malloc memory for buffer!\n"));
- return False;
- }
- } else {
- buf5->buffer = NULL;
- }
- } else {
- buf5->buffer=NULL;
- }
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool make_spoolss_q_enumprinterdataex(SPOOL_Q_ENUMPRINTERDATAEX *q_u,
- const POLICY_HND *hnd, const char *key,
- uint32 size)
-{
- memcpy(&q_u->handle, hnd, sizeof(q_u->handle));
- init_unistr2(&q_u->key, key, UNI_STR_TERMINATE);
- q_u->size = size;
-
- return True;
-}
-
-/*******************************************************************
- * read a structure.
- ********************************************************************/
-
-bool spoolss_io_q_enumprinterdataex(const char *desc, SPOOL_Q_ENUMPRINTERDATAEX *q_u, prs_struct *ps, int depth)
-{
- prs_debug(ps, depth, desc, "spoolss_io_q_enumprinterdataex");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth))
- return False;
-
- if(!smb_io_unistr2("", &q_u->key, True, ps, depth))
- return False;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("size", ps, depth, &q_u->size))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-static bool spoolss_io_printer_enum_values_ctr(const char *desc, prs_struct *ps,
- PRINTER_ENUM_VALUES_CTR *ctr, int depth)
-{
- int i;
- uint32 valuename_offset,
- data_offset,
- current_offset;
- const uint32 basic_unit = 20; /* size of static portion of enum_values */
-
- prs_debug(ps, depth, desc, "spoolss_io_printer_enum_values_ctr");
- depth++;
-
- /*
- * offset data begins at 20 bytes per structure * size_of_array.
- * Don't forget the uint32 at the beginning
- * */
-
- current_offset = basic_unit * ctr->size_of_array;
-
- /* first loop to write basic enum_value information */
-
- if (UNMARSHALLING(ps) && ctr->size_of_array) {
- ctr->values = PRS_ALLOC_MEM(ps, PRINTER_ENUM_VALUES, ctr->size_of_array);
- if (!ctr->values)
- return False;
- }
-
- for (i=0; i<ctr->size_of_array; i++) {
- uint32 base_offset, return_offset;
-
- base_offset = prs_offset(ps);
-
- valuename_offset = current_offset;
- if (!prs_uint32("valuename_offset", ps, depth, &valuename_offset))
- return False;
-
- /* Read or write the value. */
-
- return_offset = prs_offset(ps);
-
- if (!prs_set_offset(ps, base_offset + valuename_offset)) {
- return False;
- }
-
- if (!prs_unistr("valuename", ps, depth, &ctr->values[i].valuename))
- return False;
-
- /* And go back. */
- if (!prs_set_offset(ps, return_offset))
- return False;
-
- if (!prs_uint32("value_len", ps, depth, &ctr->values[i].value_len))
- return False;
-
- if (!prs_uint32("type", ps, depth, &ctr->values[i].type))
--
Samba Shared Repository
More information about the samba-cvs
mailing list