svn commit: samba r3401 - in branches/SAMBA_4_0/source: librpc/idl scripting/swig/torture

tpot at samba.org tpot at samba.org
Sun Oct 31 03:54:20 GMT 2004


Author: tpot
Date: 2004-10-31 03:54:20 +0000 (Sun, 31 Oct 2004)
New Revision: 3401

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

Log:
Fix IDL for SetForm RPC.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
   branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/spoolss.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/spoolss.idl	2004-10-31 03:26:30 UTC (rev 3400)
+++ branches/SAMBA_4_0/source/librpc/idl/spoolss.idl	2004-10-31 03:54:20 UTC (rev 3401)
@@ -483,13 +483,28 @@
 		[in,out,ref] uint32 *buf_size
 	);
 
+	typedef struct {
+		uint32 flags;
+		unistr *formname;
+		uint32 width;
+		uint32 length;
+		uint32 left;
+		uint32 top;
+		uint32 right;
+		uint32 bottom;
+	} spoolss_SetFormInfo1;
+
+	typedef union {
+		[case(1)] spoolss_AddFormInfo1 *info1;
+	} spoolss_SetFormInfo;
+
 	/******************/
 	/* Function: 0x21 */
 	WERROR spoolss_SetForm(
 		[in,ref] policy_handle *handle,
 		[in] unistr formname,
 		[in] uint32 level,
-		[in,switch_is(level)] spoolss_AddFormInfo info
+		[in,switch_is(level)] spoolss_SetFormInfo info
 	);
 
 	typedef [nodiscriminant,public] union {

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py	2004-10-31 03:26:30 UTC (rev 3400)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/spoolss.py	2004-10-31 03:54:20 UTC (rev 3401)
@@ -129,6 +129,26 @@
     return result['info']['info1']
     
 
+def test_SetForm(pipe, handle, form):
+
+    print 'testing spoolss_SetForm'
+
+    r = {}
+    r['handle'] = handle
+    r['level'] = 1
+    r['formname'] = form['info1']['formname']
+    r['info'] = form
+
+    dcerpc.spoolss_SetForm(pipe, r)
+
+    newform = test_GetForm(pipe, handle, r['formname'])
+
+    if form['info1'] != newform:
+        print 'SetForm: mismatch: %s != %s' % \
+              (r['info']['info1'], f)
+        sys.exit(1)
+
+
 def test_AddForm(pipe, handle):
 
     print 'testing spoolss_AddForm'
@@ -141,13 +161,13 @@
     r['info'] = {}
     r['info']['info1'] = {}
     r['info']['info1']['formname'] = formname
-    r['info']['info1']['flags'] = 0
-    r['info']['info1']['width'] = 1
-    r['info']['info1']['length'] = 2
-    r['info']['info1']['left'] = 3
-    r['info']['info1']['top'] = 4
-    r['info']['info1']['right'] = 5
-    r['info']['info1']['bottom'] = 6
+    r['info']['info1']['flags'] = 0x0002
+    r['info']['info1']['width'] = 100
+    r['info']['info1']['length'] = 100
+    r['info']['info1']['left'] = 0
+    r['info']['info1']['top'] = 1000
+    r['info']['info1']['right'] = 2000
+    r['info']['info1']['bottom'] = 3000
 
     try:
         result = dcerpc.spoolss_AddForm(pipe, r)
@@ -159,14 +179,13 @@
     f = test_GetForm(pipe, handle, formname)
 
     if r['info']['info1'] != f:
-        print 'Form type mismatch: %s != %s' % \
+        print 'AddForm: mismatch: %s != %s' % \
               (r['info']['info1'], f)
         sys.exit(1)
 
     r['formname'] = formname
-    r['info']['info1']['unknown'] = 1
 
-    dcerpc.spoolss_SetForm(pipe, r)
+    test_SetForm(pipe, handle, r['info'])
 
     test_DeleteForm(pipe, handle, formname)
 



More information about the samba-cvs mailing list