summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-12 00:22:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:20 -0500
commit59cfd5495eb16550303994a0b04503eb2ae96f4a (patch)
treebb6fd6309941079183eb9957992ed7d84c6f797e /source4/torture
parent43ddb0a7ae419d7050cb93e1c8836db7672c7093 (diff)
downloadsamba-59cfd5495eb16550303994a0b04503eb2ae96f4a.tar.gz
samba-59cfd5495eb16550303994a0b04503eb2ae96f4a.tar.bz2
samba-59cfd5495eb16550303994a0b04503eb2ae96f4a.zip
r4157: QueryMultipleValues IDL and torture test
Initialisation data pointer in QueryValue torture test (This used to be commit 72618dfe95c785d3a3a71cc4a70b59696f2d418e)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/winreg.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 183128d371..3ed7af0e29 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -319,6 +319,40 @@ static BOOL test_EnumKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
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 @@ static BOOL test_QueryValue(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct p
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 @@ static BOOL test_EnumValue(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
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++;