From 7ce7137ad4edb03acf6189568d4c3c4f6d8798fe Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 29 Oct 2004 01:10:40 +0000 Subject: r3348: More registry fixes and additions. The following functions work right now against samba 4, at least with a ldb backend: winreg_Open* winreg_OpenKey winreg_EnumKey winreg_DeleteKey winreg_CreateKey (This used to be commit a71d51dd3b136a1bcde1704fe9830985e06bb01b) --- source4/torture/rpc/winreg.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 1ca5768622..fa08d1a69e 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -167,7 +167,6 @@ static BOOL test_OpenKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } if (!W_ERROR_IS_OK(r.out.result)) { - printf("OpenKey failed - %s\n", win_errstr(r.out.result)); return False; } @@ -258,24 +257,35 @@ static BOOL test_EnumKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(r.out.result)) { struct policy_handle key_handle; + printf("EnumKey: %d: %s\n", r.in.enum_index, r.out.out_name->name); + if (!test_OpenKey( p, mem_ctx, handle, r.out.out_name->name, &key_handle)) { printf("OpenKey(%s) failed - %s\n", r.out.out_name->name, win_errstr(r.out.result)); - goto next_key; + } else { + test_key(p, mem_ctx, &key_handle, depth + 1); } - - test_key(p, mem_ctx, &key_handle, depth + 1); } - next_key: - r.in.enum_index++; } while (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(r.out.result)); + if (!NT_STATUS_IS_OK(status)) { + printf("EnumKey failed - %s\n", nt_errstr(status)); + return False; + } + + if (!W_ERROR_IS_OK(r.out.result) && !W_ERROR_EQUAL(r.out.result, WERR_NO_MORE_ITEMS)) { + printf("EnumKey failed - %s\n", win_errstr(r.out.result)); + return False; + } + + + return True; } -- cgit