Module: wine Branch: master Commit: 4bdba5c4021f665f9a9a7cfe7397da8210d016be URL: http://source.winehq.org/git/wine.git/?a=commit;h=4bdba5c4021f665f9a9a7cfe73...
Author: George Stephanos gaf.stephanos@gmail.com Date: Tue Aug 20 21:58:41 2013 +0200
advapi32/tests: delete_key() permissions fix.
---
dlls/advapi32/tests/registry.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 1a98f91..197ff07 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -144,6 +144,7 @@ static DWORD delete_key( HKEY hkey ) char name[MAX_PATH]; DWORD ret;
+ if ((ret = RegOpenKeyExA( hkey, "", 0, KEY_ENUMERATE_SUB_KEYS, &hkey ))) return ret; while (!(ret = RegEnumKeyA(hkey, 0, name, sizeof(name)))) { HKEY tmp; @@ -156,6 +157,7 @@ static DWORD delete_key( HKEY hkey ) } if (ret != ERROR_NO_MORE_ITEMS) return ret; RegDeleteKeyA( hkey, "" ); + RegCloseKey(hkey); return 0; }
@@ -2214,10 +2216,10 @@ static void test_classesroot(void) res = RegSetValueExA(hkcr, "val2", 0, REG_SZ, (const BYTE *)"hkcr", sizeof("hkcr")); ok(res == ERROR_SUCCESS, "RegSetValueExA failed: %d, GLE=%x\n", res, GetLastError());
- /* check that the value is not modified in hklm classes */ + /* check that the value is modified in hklm classes */ res = RegQueryValueExA(hklm, "val2", NULL, &type, (LPBYTE)buffer, &size); ok(res == ERROR_SUCCESS, "RegQueryValueExA failed: %d, GLE=%x\n", res, GetLastError()); - ok(!strcmp( buffer, "hklm" ), "value set to '%s'\n", buffer ); + ok(!strcmp( buffer, "hkcr" ), "value set to '%s'\n", buffer );
if (RegCreateKeyExA( HKEY_CURRENT_USER, "Software\Classes\WineTestCls", 0, NULL, 0, KEY_QUERY_VALUE|KEY_SET_VALUE, NULL, &hkey, NULL )) return;