svn commit: samba r4157 - in branches/SAMBA_4_0/source: librpc/idl torture/rpc

jelmer at samba.org jelmer at samba.org
Sun Dec 12 00:22:31 GMT 2004


Author: jelmer
Date: 2004-12-12 00:22:30 +0000 (Sun, 12 Dec 2004)
New Revision: 4157

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

Log:
QueryMultipleValues IDL and torture test
Initialisation data pointer in QueryValue torture test

Modified:
   branches/SAMBA_4_0/source/librpc/idl/winreg.idl
   branches/SAMBA_4_0/source/torture/rpc/winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2004-12-11 23:28:48 UTC (rev 4156)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2004-12-12 00:22:30 UTC (rev 4157)
@@ -174,6 +174,9 @@
 	/******************/
 	/* Function: 0x0d */
 	WERROR winreg_LoadKey(
+		[in,ref] policy_handle *handle,
+		[in] winreg_String *keyname,
+		[in] winreg_String *filename
 	);
 
 	/******************/
@@ -237,8 +240,8 @@
 	/* Function: 0x15 */
 	WERROR winreg_SetKeySecurity(
 		[in,ref] policy_handle *handle,
-		[in] uint32 sec_info,
-		[in] sec_desc_buf *sec_desc
+		[in] uint32 access_mask,
+		[in,out,ref] KeySecurityData *data
 	);
 
 	/******************/
@@ -295,9 +298,21 @@
 		[out,ref] policy_handle *handle
 	);
 
+	typedef struct {
+		winreg_String *name;
+		uint32 type;
+		uint32 offset;
+		uint32 length;
+	} QueryMultipleValue;
+	
 	/******************/
 	/* Function: 0x1d */
 	WERROR winreg_QueryMultipleValues(
+		[in,ref] policy_handle *key_handle, 
+		[in,out,size_is(num_values),length_is(num_values),ref] QueryMultipleValue *values,
+        [in] uint32 num_values,
+        [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer,
+        [in,out,ref] uint32 *buffer_size
 	);
 
 	/******************/

Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c	2004-12-11 23:28:48 UTC (rev 4156)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c	2004-12-12 00:22:30 UTC (rev 4157)
@@ -319,6 +319,40 @@
 	return True;
 }
 
+static BOOL test_QueryMultipleValues(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *valuename)
+{
+	struct winreg_QueryMultipleValues r;
+	NTSTATUS status;
+
+	printf("Testing QueryMultipleValues\n");
+
+	r.in.key_handle = handle;
+	r.in.values = r.out.values = talloc_array_p(mem_ctx, struct QueryMultipleValue, 1);
+	r.in.values[0].name = talloc_p(mem_ctx, struct winreg_String);
+	r.in.values[0].name->name = valuename;
+	r.in.values[0].offset = 0;
+	r.in.values[0].length = 0;
+	r.in.values[0].type = 0;
+
+	r.in.num_values = 1;
+	r.in.buffer_size = r.out.buffer_size = talloc_p(mem_ctx, uint32);
+	*r.in.buffer_size = 0x20;
+	r.in.buffer = r.out.buffer = talloc_zero_array_p(mem_ctx, uint8, *r.in.buffer_size);
+
+	status = dcerpc_winreg_QueryMultipleValues(p, mem_ctx, &r);
+	if(NT_STATUS_IS_ERR(status)) {
+		printf("QueryMultipleValues failed - %s\n", nt_errstr(status));
+		return False;
+	}
+
+	if (!W_ERROR_IS_OK(r.out.result)) {
+		printf("QueryMultipleValues failed - %s\n", win_errstr(r.out.result));
+		return False;
+	}
+
+	return True;
+}
+
 static BOOL test_QueryValue(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *valuename)
 {
 	struct winreg_QueryValue r;
@@ -329,6 +363,7 @@
 	printf("Testing QueryValue\n");
 
 	r.in.handle = handle;
+	r.in.data = NULL;
 	r.in.value_name.name = valuename;
 	r.in.type = &zero;
 	r.in.size = &offered;
@@ -379,6 +414,7 @@
 
 		if (W_ERROR_IS_OK(r.out.result)) {
 			ret &= test_QueryValue(p, mem_ctx, handle, r.out.name_out.name);
+			ret &= test_QueryMultipleValues(p, mem_ctx, handle, r.out.name_out.name);
 		}
 
 		r.in.enum_index++;



More information about the samba-cvs mailing list