From ae79d8ce02921e9a5c82433527909c7f707051e3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 10 Mar 2010 00:43:57 +0100 Subject: s4-smbtorture: on HKLM hive test the well known CurrentVersion value. Guenther --- source4/torture/rpc/winreg.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 9bcd0e414f..e4de39ebb7 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -1929,6 +1929,9 @@ static bool test_Open_Security(struct torture_context *tctx, return ret; } +#define KEY_CURRENT_VERSION "SOFTWARE\\MICROSOFT\\WINDOWS NT\\CURRENTVERSION" +#define VALUE_CURRENT_VERSION "CurrentVersion" + static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p, void *userdata) { @@ -1947,6 +1950,20 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p, torture_assert_ntstatus_ok(tctx, open_fn(p, tctx, &r), "open"); + if (open_fn == (void *)dcerpc_winreg_OpenHKLM) { +#if 0 + torture_assert(tctx, test_OpenKey(p, tctx, &handle, KEY_CURRENT_VERSION, &newhandle), + "failed to open current version key"); +#else + torture_assert(tctx, _test_OpenKey(p, tctx, &handle, KEY_CURRENT_VERSION, KEY_QUERY_VALUE, &newhandle, WERR_OK, NULL), + "failed to open current version key"); +#endif + torture_assert(tctx, test_QueryValue_full(p, tctx, &newhandle, VALUE_CURRENT_VERSION, true), + "failed to query current version"); + torture_assert(tctx, test_CloseKey(p, tctx, &newhandle), + "failed to close current version key"); + } + test_Cleanup(p, tctx, &handle, TEST_KEY_BASE); if (!test_CreateKey(p, tctx, &handle, TEST_KEY_BASE, NULL)) { -- cgit