summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-04-12 21:59:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:16 -0500
commit17ddb68b54c6c550bc4614d33f7da69fc5f75633 (patch)
tree197c9d61f5fcd2dc4b578ebf193e542a07922381 /source4/torture
parent00cedc0c0448b3520678c7959ea9269d6e5c10f1 (diff)
downloadsamba-17ddb68b54c6c550bc4614d33f7da69fc5f75633.tar.gz
samba-17ddb68b54c6c550bc4614d33f7da69fc5f75633.tar.bz2
samba-17ddb68b54c6c550bc4614d33f7da69fc5f75633.zip
r190: More RPC updates
(This used to be commit 0a67057e9626c1539f964e978537e24544784263)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/winreg.c54
1 files changed, 28 insertions, 26 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 3864de6503..3323ea5d35 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -262,40 +262,42 @@ static BOOL test_EnumKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
static BOOL test_EnumValue(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle)
+ struct policy_handle *handle, int max_valnamelen, int max_valbufsize)
{
struct winreg_EnumValue r;
- struct winreg_Uint8buf value;
- struct winreg_String name;
- uint32 type, requested_len, returned_len;
+ struct winreg_Uint8buf vb;
+ struct winreg_EnumValueName vn;
+ uint32 type = 0, requested_len = 0, returned_len = 0;
NTSTATUS status;
- r.in.handle = handle;
- r.in.enum_index = 0;
-
- init_winreg_String(&name, NULL);
- r.in.name = r.out.name = &name;
-
- type = 0;
- r.in.type = &type;
-
- value.max_len = 0xffff;
- value.offset = 0;
- value.len = 0;
- value.buffer = NULL;
-
- r.in.value = &value;
-
- requested_len = value.max_len;
- r.in.requested_len = &requested_len;
- returned_len = 0;
- r.in.returned_len = &returned_len;
+ r.in.handle = handle;
+ r.in.enum_index = 0;
+ r.in.type = &type;
+ r.in.requested_len = &requested_len;
+ r.in.returned_len = &returned_len;
+ vn.max_len = max_valnamelen;
+ vn.len = 0;
+ vn.buf = NULL;
+ r.in.name = r.out.name = &vn;
+ vb.max_len = max_valbufsize;
+ vb.offset = 0x0;
+ vb.len = 0x0;
+ vb.buffer = NULL;
+ r.in.value = &vb;
do {
-
status = dcerpc_winreg_EnumValue(p, mem_ctx, &r);
+ if(NT_STATUS_IS_ERR(status)) {
+ printf("EnumValue failed - %s\n", nt_errstr(status));
+ return False;
+ }
r.in.enum_index++;
} while (W_ERROR_IS_OK(r.out.result));
+
+ if(!W_ERROR_EQUAL(r.out.result, WERR_NO_MORE_ITEMS)) {
+ printf("EnumValue failed - %s\n", win_errstr(r.out.result));
+ return False;
+ }
return True;
}
@@ -466,7 +468,7 @@ static BOOL test_key(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
if (!test_EnumKey(p, mem_ctx, handle, depth)) {
}
- if (!test_EnumValue(p, mem_ctx, handle)) {
+ if (!test_EnumValue(p, mem_ctx, handle, 200, 200)) {
}
/* Enumerate values */