Module: wine Branch: master Commit: 11f6e89f873e615650fc260ae80796d299cb3ab1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=11f6e89f873e615650fc260ae8...
Author: Paul Vriens paul.vriens.wine@gmail.com Date: Sat Mar 31 12:14:10 2007 +0200
advapi32/tests: Reopen the main handle if needed.
---
dlls/advapi32/tests/registry.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index f67364a..4296fd5 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -631,6 +631,16 @@ static void test_reg_close_key(void) ret = RegCloseKey(NULL); ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 95 returns BADKEY */ "expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n", ret); + + /* Check to see if we didn't potentially close our main handle, which could happen on win98 as + * win98 doesn't give a new handle when the same key is opened. + * Not re-opening will make some next tests fail. + */ + if (hkey_main == hkHandle) + { + trace("The main handle is most likely closed, so re-opening\n"); + RegOpenKeyA( HKEY_CURRENT_USER, "Software\Wine\Test", &hkey_main ); + } }
static void test_reg_delete_key(void)