svn commit: samba r8050 - in branches/SAMBA_4_0/source: include librpc/idl librpc/ndr torture/rpc

metze at samba.org metze at samba.org
Fri Jul 1 11:04:33 GMT 2005


Author: metze
Date: 2005-07-01 11:04:33 +0000 (Fri, 01 Jul 2005)
New Revision: 8050

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8050

Log:
- make use of more [value()] properties
- the out subcontext's need to have a fixed size of r->in.offered,
  to make windows clients happy

metze
Modified:
   branches/SAMBA_4_0/source/include/structs.h
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
   branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c
   branches/SAMBA_4_0/source/torture/rpc/spoolss.c


Changeset:
Modified: branches/SAMBA_4_0/source/include/structs.h
===================================================================
--- branches/SAMBA_4_0/source/include/structs.h	2005-07-01 10:58:22 UTC (rev 8049)
+++ branches/SAMBA_4_0/source/include/structs.h	2005-07-01 11:04:33 UTC (rev 8050)
@@ -72,6 +72,8 @@
 struct spoolss_WritePrinter;
 struct spoolss_ReadPrinter;
 
+struct spoolss_DeviceMode;
+
 struct ntptr_context;
 struct ntptr_GenericHandle;
 

Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl	2005-07-01 10:58:22 UTC (rev 8049)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl	2005-07-01 11:04:33 UTC (rev 8050)
@@ -56,7 +56,7 @@
 		uint32 unknown29;
 	} spoolss_PrinterInfo0;
 
-	typedef struct {
+	typedef [gensize] struct {
 	        string32 devicename;
 		uint16 specversion;
 		uint16 driverversion;
@@ -282,8 +282,8 @@
 	/******************/
 	/* Function: 0x01 */
 	typedef struct {
-		uint32 size;
-		[subcontext(4),subcontext_size(size)] spoolss_DeviceMode *devmode;
+		[value(_ndr_size_spoolss_DeviceMode(devmode, ndr->flags))] uint32 _ndr_size;
+		[subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
 	} spoolss_DevmodeContainer;
 
 	WERROR spoolss_OpenPrinter(
@@ -349,7 +349,7 @@
 		[in] 	 uint32 level,
 		[in] 	 DATA_BLOB *buffer,
 		[in] 	 uint32 offered,
-		[out,subcontext(4),switch_is(level)] spoolss_JobInfo *info,
+		[out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
 		[out] 	 uint32 needed
 	);
 
@@ -419,17 +419,12 @@
 		[default];
 	} spoolss_SetPrinterInfo;
 
-	typedef struct {
-		uint32 size;
-		[subcontext(4),subcontext_size(size)] security_descriptor *sd;
-	} spoolss_SecDescContainer;
-
 	WERROR spoolss_SetPrinter(
 		[in,ref] policy_handle *handle,
 		[in] uint32 level,
 		[in,switch_is(level)] spoolss_SetPrinterInfo info,
 		[in] spoolss_DevmodeContainer devmode_ctr,
-		[in] spoolss_SecDescContainer secdesc_ctr,
+		[in] sec_desc_buf secdesc_ctr,
 		[in] spoolss_PrinterControl command
 	);
 
@@ -440,7 +435,7 @@
 		[in] 	 uint32 level,
 		[in] 	 DATA_BLOB *buffer,
 		[in] 	 uint32 offered,
-		[out,subcontext(4),switch_is(level)] spoolss_PrinterInfo *info,
+		[out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
 		[out] 	 uint32 needed
 	);
 
@@ -591,7 +586,7 @@
 		[in] uint32 level,
 		[in] DATA_BLOB *buffer,
 		[in] uint32 offered,
-		[out,subcontext(4),switch_is(level)] spoolss_DriverDirectoryInfo *info,
+		[out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
 		[out] uint32 needed
 	);
 
@@ -759,7 +754,7 @@
 		[in] 	 unistr value_name,
 		[in] 	 uint32 offered,
 		[out] 	 spoolss_PrinterDataType type,
-		[out,subcontext(4),switch_is(type)] spoolss_PrinterData data,
+		[out,subcontext(4),subcontext_size(offered),switch_is(type)] spoolss_PrinterData data,
 		[out] 	 uint32 needed
 	);
 
@@ -859,7 +854,7 @@
 		[in] uint32 level,
 		[in] DATA_BLOB *buffer,
 		[in] uint32 offered,
-		[out,subcontext(4),switch_is(level)] spoolss_FormInfo *info,
+		[out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
 		[out] uint32 needed
 	);
 

Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c	2005-07-01 10:58:22 UTC (rev 8049)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c	2005-07-01 11:04:33 UTC (rev 8050)
@@ -523,3 +523,9 @@
 	}
 	return NT_STATUS_OK;
 }
+
+uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, uint32_t flags)
+{
+	if (!devmode) return 0;
+	return ndr_size_spoolss_DeviceMode(devmode,flags);
+}

Modified: branches/SAMBA_4_0/source/torture/rpc/spoolss.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/spoolss.c	2005-07-01 10:58:22 UTC (rev 8049)
+++ branches/SAMBA_4_0/source/torture/rpc/spoolss.c	2005-07-01 11:04:33 UTC (rev 8050)
@@ -100,7 +100,6 @@
 
 	op.in.printername	= talloc_asprintf(ctx, "\\\\%s", dcerpc_server_name(ctx->p));
 	op.in.datatype		= NULL;
-	op.in.devmode_ctr.size	= 0;
 	op.in.devmode_ctr.devmode= NULL;
 	op.in.access_mask	= 0;
 	op.out.handle		= &ctx->server_handle;
@@ -1328,9 +1327,7 @@
 	r.in.handle		= handle;
 	r.in.level		= 0;
 	r.in.info.info1		= NULL;
-	r.in.devmode_ctr.size	= 0;
 	r.in.devmode_ctr.devmode= NULL;
-	r.in.secdesc_ctr.size	= 0;
 	r.in.secdesc_ctr.sd	= NULL;
 	r.in.command		= SPOOLSS_PRINTER_CONTROL_PAUSE;
 
@@ -1360,9 +1357,7 @@
 	r.in.handle		= handle;
 	r.in.level		= 0;
 	r.in.info.info1		= NULL;
-	r.in.devmode_ctr.size	= 0;
 	r.in.devmode_ctr.devmode= NULL;
-	r.in.secdesc_ctr.size	= 0;
 	r.in.secdesc_ctr.sd	= NULL;
 	r.in.command		= SPOOLSS_PRINTER_CONTROL_RESUME;
 
@@ -1663,7 +1658,6 @@
 
 	op.in.printername	= name;
 	op.in.datatype		= NULL;
-	op.in.devmode_ctr.size	= 0;
 	op.in.devmode_ctr.devmode= NULL;
 	op.in.access_mask	= 0;
 	op.out.handle		= &handle;
@@ -1686,7 +1680,6 @@
 
 	opEx.in.printername		= name;
 	opEx.in.datatype		= NULL;
-	opEx.in.devmode_ctr.size	= 0;
 	opEx.in.devmode_ctr.devmode	= NULL;
 	opEx.in.access_mask		= 0;
 	opEx.in.level			= 1;
@@ -1744,7 +1737,6 @@
 
 	r.in.printername	= talloc_asprintf(mem_ctx, "\\\\%s\\%s", dcerpc_server_name(p), name);
 	r.in.datatype		= NULL;
-	r.in.devmode_ctr.size	= 0;
 	r.in.devmode_ctr.devmode= NULL;
 	r.in.access_mask	= SEC_FLAG_MAXIMUM_ALLOWED;
 	r.out.handle		= &handle;
@@ -1794,7 +1786,6 @@
 	}
 
 	r.in.datatype		= NULL;
-	r.in.devmode_ctr.size	= 0;
 	r.in.devmode_ctr.devmode= NULL;
 	r.in.access_mask	= SEC_FLAG_MAXIMUM_ALLOWED;
 	r.in.level		= 1;



More information about the samba-cvs mailing list