[PATCH 1/2] advapi32/tests: delete_key() permissions fix
George Stephanos
gaf.stephanos at gmail.com
Tue Aug 20 14:58:41 CDT 2013
---
dlls/advapi32/tests/registry.c | 6 ++++--
1 file 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;
--
1.8.2.3
More information about the wine-patches
mailing list