From 2a15f7008c5b49cfa91c8001ad2541c5a6c80f73 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 5 Aug 2010 15:35:52 +0200 Subject: s3-torture: Correctly cleanup the winreg volatile key test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Günther please check! --- source4/torture/rpc/winreg.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 3fe141c714..f5e92954c3 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -2583,7 +2583,7 @@ static bool test_volatile_keys(struct torture_context *tctx, struct policy_handle *handle, int hkey) { - struct policy_handle new_handle; + struct policy_handle new_handle, hive_handle; enum winreg_CreateAction action_taken; torture_comment(tctx, "Testing VOLATILE key\n"); @@ -2657,15 +2657,11 @@ static bool test_volatile_keys(struct torture_context *tctx, "failed to close"); torture_assert(tctx, - test_CloseKey(b, tctx, handle), - "failed to close"); - - torture_assert(tctx, - test_OpenHive(tctx, b, handle, hkey), + test_OpenHive(tctx, b, &hive_handle, hkey), "failed top open hive"); torture_assert(tctx, - test_OpenKey_opts(tctx, b, handle, TEST_KEY_VOLATILE, + test_OpenKey_opts(tctx, b, &hive_handle, TEST_KEY_VOLATILE, REG_OPTION_VOLATILE, SEC_FLAG_MAXIMUM_ALLOWED, &new_handle, @@ -2673,13 +2669,22 @@ static bool test_volatile_keys(struct torture_context *tctx, "failed to open volatile key"); torture_assert(tctx, - test_OpenKey_opts(tctx, b, handle, TEST_KEY_VOLATILE, + test_OpenKey_opts(tctx, b, &hive_handle, TEST_KEY_VOLATILE, REG_OPTION_NON_VOLATILE, SEC_FLAG_MAXIMUM_ALLOWED, &new_handle, WERR_BADFILE), "failed to open volatile key"); + torture_assert(tctx, + test_CloseKey(b, tctx, &hive_handle), + "failed to close"); + + torture_assert(tctx, + test_DeleteKey(b, tctx, handle, TEST_KEY_VOLATILE), + "failed to delete key"); + + torture_comment(tctx, "Testing VOLATILE key succeeded\n"); return true; -- cgit