svn commit: samba r21350 - in branches/SAMBA_4_0: . source/librpc/idl source/torture/ndr

jelmer at samba.org jelmer at samba.org
Wed Feb 14 21:37:07 GMT 2007


Author: jelmer
Date: 2007-02-14 21:37:06 +0000 (Wed, 14 Feb 2007)
New Revision: 21350

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

Log:
Add more tests for the NDR layer of winreg. I actually discovered a pidl bug, 
so there are still two tests commented out.

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


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
   - jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h

   + jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h
jelmer at samba.org-20070214213108-id4l0x9g95v6i060


Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2007-02-14 20:52:23 UTC (rev 21349)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2007-02-14 21:37:06 UTC (rev 21350)
@@ -65,7 +65,7 @@
 
 	/******************/
 	/* Function: 0x02 */
-	WERROR winreg_OpenHKLM(
+	[public] WERROR winreg_OpenHKLM(
 		[in]      uint16 *system_name,
 		[in]      winreg_AccessMask access_mask,
 		[out,ref] policy_handle *handle
@@ -114,7 +114,7 @@
 		REG_OPENED_EXISTING_KEY = 2
 	} winreg_CreateAction;
 
-	WERROR winreg_CreateKey(
+	[public] WERROR winreg_CreateKey(
 		[in,ref] policy_handle *handle,
 		[in] winreg_String name,
 		[in] winreg_String keyclass,
@@ -159,7 +159,7 @@
 	/******************/
 	/* Function: 0x0a */
 
-	WERROR winreg_EnumValue(
+	[public] WERROR winreg_EnumValue(
 		[in,ref]        policy_handle *handle,
 		[in]            uint32 enum_index,
 		[in,out,ref]    winreg_StringBuf *name,
@@ -230,7 +230,7 @@
 
 	/******************/
 	/* Function: 0x11 */
-	WERROR winreg_QueryValue(
+	[public] WERROR winreg_QueryValue(
 		[in,ref] policy_handle *handle,
 		[in] winreg_String value_name,
 		[in,out] winreg_Type *type,
@@ -325,7 +325,7 @@
 	
 	/******************/
 	/* Function: 0x1d */
-	WERROR winreg_QueryMultipleValues(
+	[public] WERROR winreg_QueryMultipleValues(
 		[in,ref] policy_handle *key_handle, 
 		[in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values,
 		[in] uint32 num_values,

Modified: branches/SAMBA_4_0/source/torture/ndr/winreg.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ndr/winreg.c	2007-02-14 20:52:23 UTC (rev 21349)
+++ branches/SAMBA_4_0/source/torture/ndr/winreg.c	2007-02-14 21:37:06 UTC (rev 21350)
@@ -25,12 +25,12 @@
 #include "librpc/gen_ndr/ndr_security.h"
 #include "libcli/security/security.h"
 
-static const uint8_t winreg_closekey_data[] = { 
+static const uint8_t closekey_in_data[] = { 
         0x00, 0x00, 0x00, 0x00, 0x1d, 0xd8, 0xd7, 0xaa, 0x8d, 0x6c, 0x3f, 0x48, 
         0xa7, 0x1e, 0x02, 0x6a, 0x47, 0xf6, 0x7b, 0xae
 };
 
-static bool winreg_closekey_check(struct torture_context *tctx, 
+static bool closekey_in_check(struct torture_context *tctx, 
 								  struct winreg_CloseKey *ck)
 {
 	torture_assert(tctx, ck->in.handle != NULL, "handle invalid");
@@ -38,11 +38,269 @@
 	return true;
 }
 
+const static uint8_t closekey_out_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool closekey_out_check(struct torture_context *tctx, 
+							   struct winreg_CloseKey *ck)
+{
+	torture_assert_int_equal(tctx, ck->out.handle->handle_type, 0, "handle type");
+	torture_assert_werr_ok(tctx, ck->out.result, "return code");
+	return true;
+}
+
+static const uint8_t OpenHKLM_In[] = {
+  0x01, 0x00, 0x00, 0x00, 0xe0, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02
+};
+
+static bool openhklm_in_check(struct torture_context *tctx, 
+								  struct winreg_OpenHKLM *r)
+{
+	torture_assert(tctx, r->in.system_name != NULL, "system name pointer");
+	torture_assert_int_equal(tctx, *r->in.system_name, 34016, "system name");
+	torture_assert_int_equal(tctx, r->in.access_mask, 0x02000000, "access mask");
+	return true;
+}
+
+static const uint8_t openhklm_out_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0xb2, 0x64, 0xbc, 0xb3, 0x7f, 0x90, 0x29, 0x4a,
+  0xb4, 0xb3, 0x91, 0xe7, 0xe4, 0x4a, 0x58, 0xe3, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool openhklm_out_check(struct torture_context *tctx, 
+								  struct winreg_OpenHKLM *r)
+{
+	torture_assert(tctx, r->out.handle != NULL, "handle pointer");
+	torture_assert_int_equal(tctx, r->out.handle->handle_type, 0, "handle_type");
+	torture_assert_werr_ok(tctx, r->out.result, "return code");
+	return true;
+}
+
+static const uint8_t createkey_in_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0xb2, 0x64, 0xbc, 0xb3, 0x7f, 0x90, 0x29, 0x4a,
+  0xb4, 0xb3, 0x91, 0xe7, 0xe4, 0x4a, 0x58, 0xe3, 0x16, 0x00, 0x16, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x0b, 0x00, 0x00, 0x00, 0x73, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x74, 0x00,
+  0x74, 0x00, 0x79, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00
+};
+
+static bool createkey_in_check(struct torture_context *tctx, 
+								  struct winreg_CreateKey *r)
+{
+	torture_assert_str_equal(tctx, r->in.name.name, "spottyfoot", "name");
+	torture_assert(tctx, r->in.keyclass.name == NULL, "keyclass");
+	torture_assert_int_equal(tctx, r->in.options, 0, "option");
+	torture_assert_int_equal(tctx, r->in.access_mask, 0x2000000, "access mask");
+	torture_assert(tctx, r->in.secdesc == NULL, "secdesc");
+	torture_assert(tctx, r->in.action_taken == NULL, "action_taken");
+
+	return true;
+}
+
+static const uint8_t createkey_out_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x57, 0x00, 0x00, 0x00
+};
+
+static bool createkey_out_check(struct torture_context *tctx, 
+								  struct winreg_CreateKey *r)
+{
+	torture_assert(tctx, GUID_all_zero(&r->out.new_handle->uuid), "new_handle");
+	torture_assert(tctx, r->out.action_taken == NULL, "action_taken pointer");
+	torture_assert_werr_equal(tctx, r->out.result, WERR_INVALID_PARAM, 
+							  "return code");
+
+	return true;
+}
+
+static const uint8_t enumvalue_in_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0xae, 0x1a, 0xbd, 0xbe, 0xbb, 0x94, 0xce, 0x4e,
+  0xba, 0xcf, 0x56, 0xeb, 0xe5, 0xb3, 0x6c, 0xa3, 0x05, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+  0xff, 0xff, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool enumvalue_in_check(struct torture_context *tctx, 
+								  struct winreg_EnumValue *r)
+{
+	torture_assert_int_equal(tctx, r->in.enum_index, 5, "enum index");
+	torture_assert(tctx, r->in.type != NULL, "type pointer");
+	torture_assert_int_equal(tctx, *r->in.type, 0, "type");
+	torture_assert_int_equal(tctx, *r->in.size, 65535, "size");
+	torture_assert_int_equal(tctx, *r->in.length, 0, "length");
+	torture_assert_int_equal(tctx, r->in.name->size, 512, "name size");
+	torture_assert_int_equal(tctx, r->in.name->length, 0, "name length");
+
+	return true;
+}
+
+static const uint8_t enumvalue_out_data[] = {
+  0x12, 0x00, 0x00, 0x02, 0x28, 0x91, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x48, 0x00, 0x4f, 0x00,
+  0x4d, 0x00, 0x45, 0x00, 0x50, 0x00, 0x41, 0x00, 0x54, 0x00, 0x48, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0xd8, 0x8c, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0xe0, 0x00, 0x0c, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x4c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x63, 0x00,
+  0x75, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x73, 0x00,
+  0x20, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x20, 0x00, 0x53, 0x00,
+  0x65, 0x00, 0x74, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00,
+  0x73, 0x00, 0x5c, 0x00, 0x41, 0x00, 0x64, 0x00, 0x6d, 0x00, 0x69, 0x00,
+  0x6e, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x61, 0x00,
+  0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x00, 0x00, 0xf0, 0x8c, 0x07, 0x00,
+  0x4c, 0x00, 0x00, 0x00, 0xf8, 0x8c, 0x07, 0x00, 0x4c, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00
+};
+
+static bool enumvalue_out_check(struct torture_context *tctx, 
+								  struct winreg_EnumValue *r)
+{
+	torture_assert_int_equal(tctx, r->out.name->size, 512, "name size");
+	torture_assert_int_equal(tctx, r->out.name->length, 18, "name length");
+	torture_assert_str_equal(tctx, r->out.name->name, "HOMEPATH", "name");
+	torture_assert_int_equal(tctx, *r->out.type, 1, "type");
+	torture_assert_int_equal(tctx, *r->out.size, 76, "size");
+	torture_assert_int_equal(tctx, *r->out.length, 76, "length");
+	torture_assert_werr_ok(tctx, r->out.result, "return code");
+
+	return true;
+}
+
+static const uint8_t queryvalue_in_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0xae, 0x1a, 0xbd, 0xbe, 0xbb, 0x94, 0xce, 0x4e,
+  0xba, 0xcf, 0x56, 0xeb, 0xe5, 0xb3, 0x6c, 0xa3, 0x12, 0x00, 0x12, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x48, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x45, 0x00,
+  0x50, 0x00, 0x41, 0x00, 0x54, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x03, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00
+};
+
+static bool queryvalue_in_check(struct torture_context *tctx, 
+								  struct winreg_QueryValue *r)
+{
+	torture_assert_str_equal(tctx, r->in.value_name.name, "HOMEPATH", "name");
+	torture_assert_int_equal(tctx, *r->in.type, 0, "type");
+	torture_assert_int_equal(tctx, *r->in.size, 4095, "size");
+	torture_assert_int_equal(tctx, *r->in.length, 0, "length");
+	torture_assert(tctx, r->in.data == NULL, "data pointer");
+
+	return true;
+}
+
+static const uint8_t queryvalue_out_data[] = {
+  0xd8, 0xf5, 0x0b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0xe4, 0xf5, 0x0b, 0x00, 0x4c, 0x00, 0x00, 0x00, 0xec, 0xf5, 0x0b, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool queryvalue_out_check(struct torture_context *tctx, 
+								  struct winreg_QueryValue *r)
+{
+	torture_assert_werr_ok(tctx, r->out.result, "return code");
+	torture_assert_int_equal(tctx, *r->out.type, 1, "type");
+	torture_assert(tctx, r->out.data == NULL, "data pointer");
+	torture_assert_int_equal(tctx, *r->out.size, 76, "size");
+	torture_assert_int_equal(tctx, *r->out.length, 0, "length");
+
+	return true;
+}
+
+static const uint8_t querymultiplevalues_in_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0xae, 0x1a, 0xbd, 0xbe, 0xbb, 0x94, 0xce, 0x4e,
+  0xba, 0xcf, 0x56, 0xeb, 0xe5, 0xb3, 0x6c, 0xa3, 0x01, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x12, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x48, 0x00, 0x4f, 0x00,
+  0x4d, 0x00, 0x45, 0x00, 0x50, 0x00, 0x41, 0x00, 0x54, 0x00, 0x48, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00
+};
+
+static bool querymultiplevalues_in_check(struct torture_context *tctx, 
+										 struct winreg_QueryMultipleValues *r)
+{
+	torture_assert_int_equal(tctx, r->in.num_values, 1, "num values");
+	torture_assert_str_equal(tctx, r->in.values[0].name->name, "HOMEPATH", 
+							 "name");
+
+	torture_assert_int_equal(tctx, r->in.values[0].type, 0, "type");
+	torture_assert_int_equal(tctx, r->in.values[0].offset, 0, "offset");
+	torture_assert_int_equal(tctx, r->in.values[0].length, 0, "length");
+	torture_assert_int_equal(tctx, *r->in.buffer_size, 76, "buffer size");
+
+	return true;
+}
+
+static const uint8_t querymultiplevalues_out_data[] = {
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0xd8, 0x8c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x12, 0x00, 0x38, 0x87, 0x07, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x48, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x45, 0x00, 0x50, 0x00, 0x41, 0x00,
+  0x54, 0x00, 0x48, 0x00, 0xc8, 0x95, 0x08, 0x00, 0x4c, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x4c, 0x4d, 0x45, 0x4d, 0xc8, 0x95, 0x08, 0x00,
+  0x50, 0x87, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x07, 0x00,
+  0x00, 0x01, 0x0c, 0x00, 0x50, 0x95, 0x08, 0x00, 0x48, 0x96, 0x08, 0x00,
+  0xdc, 0x00, 0x00, 0x00, 0xc0, 0x83, 0x00, 0x01, 0x0d, 0xf0, 0xff, 0xff,
+  0x4c, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00
+};
+
+static bool querymultiplevalues_out_check(struct torture_context *tctx, 
+										 struct winreg_QueryMultipleValues *r)
+{
+	torture_assert_str_equal(tctx, r->out.values[0].name->name, "HOMEPATH", 
+							 "name");
+
+	torture_assert_int_equal(tctx, r->out.values[0].type, 0, "type");
+	torture_assert_int_equal(tctx, r->out.values[0].offset, 0, "offset");
+	torture_assert_int_equal(tctx, r->out.values[0].length, 0, "length");
+	/* FIXME: r->out.buffer */
+	torture_assert_int_equal(tctx, *r->out.buffer_size, 76, "buffer size");
+	torture_assert_werr_equal(tctx, r->out.result, WERR_MORE_DATA, 
+								  "return code");
+
+	return true;
+}
+
 struct torture_suite *ndr_winreg_suite(TALLOC_CTX *ctx)
 {
 	struct torture_suite *suite = torture_suite_create(ctx, "winreg");
 
-	torture_suite_add_ndr_pull_fn_test(suite, winreg_CloseKey, winreg_closekey_data, NDR_IN, winreg_closekey_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_CloseKey, closekey_in_data, NDR_IN, closekey_in_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_CloseKey, closekey_out_data, NDR_IN, closekey_out_check );
 
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_OpenHKLM, OpenHKLM_In, NDR_IN, openhklm_in_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_OpenHKLM, openhklm_out_data, NDR_OUT, openhklm_out_check );
+
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_CreateKey, createkey_in_data, NDR_IN, createkey_in_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_CreateKey, createkey_out_data, NDR_OUT, createkey_out_check );
+
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_EnumValue, enumvalue_in_data, NDR_IN, enumvalue_in_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_EnumValue, enumvalue_out_data, NDR_OUT, enumvalue_out_check );
+
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_QueryValue, queryvalue_in_data, NDR_IN, queryvalue_in_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_QueryValue, queryvalue_out_data, NDR_OUT, queryvalue_out_check );
+
+	/*torture_suite_add_ndr_pull_fn_test(suite, winreg_QueryMultipleValues, querymultiplevalues_in_data, NDR_IN, querymultiplevalues_in_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_QueryMultipleValues, querymultiplevalues_out_data, NDR_OUT, querymultiplevalues_out_check );*/
+
 	return suite;
 }
+



More information about the samba-cvs mailing list