Stefan Leichter wrote:
Am Thursday 19 April 2007 12:14 schrieb Alexandre Julliard:
Stefan Leichter Stefan.Leichter@camline.com writes:
/* Recursively delete all the subkeys */
for (i = 0; i < dwKeyCount && !ret; i++) {
dwSize = dwMaxSubkeyLen;
ret = RegEnumKeyExW(hSubKey, i, lpszName, &dwSize,
NULL, + NULL, NULL, NULL);
This won't work, the index will change as you delete keys.
- } else {
if (!ret)
ret = RegSetValueW(hSubKey, NULL, REG_SZ, emptyW, 0);
The function is supposed to delete the key values, that's not what this does.
You probably need to write some test cases...
Hello Paul,
i'm sorry for bothering you again on this topic, but it looks like your are the onlyone around having a Vista installation.
Can you please verify the attached tests and report the results back.
Thanks for your help Stefan
--- ../wine-git/dlls/advapi32/tests/registry.c 2007-04-18 18:45:08.000000000 +0200 +++ dlls/advapi32/tests/registry.c 2007-04-19 23:45:01.000000000 +0200 @@ -1151,15 +1151,33 @@ ok(!RegQueryValueA(subkey, NULL, buffer, &size), "Default value of subkey not longer present\n");
ret = RegCreateKeyA(subkey, "subkey2", &subkey2);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
ret = RegCloseKey(subkey2);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
ret = RegCreateKeyA(subkey, "subkey3", &subkey2);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
ret = RegCloseKey(subkey2);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
ret = RegSetValueA(subkey2, "value", REG_SZ, "data2", 5);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); ret = pRegDeleteTreeA(subkey, NULL); ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); ok(!RegOpenKeyA(hkey_main, "subkey", &subkey), "subkey was deleted\n");
ok(RegOpenKeyA(subkey, "subkey2", &subkey2),
"subkey2 was not deleted\n");
ok(RegOpenKeyA(subkey, "subkey3", &subkey2),
"subkey3 was not deleted\n");
size = MAX_PATH; ret = RegQueryValueA(subkey, NULL, buffer, &size); ok(ret == ERROR_SUCCESS, "Default value of subkey is not present\n"); ok(!lstrlenA(buffer), "Expected length 0 got length %u(%s)\n", lstrlenA(buffer), buffer);
size = MAX_PATH;
ok(RegQueryValueA(subkey, "value", buffer, &size),
"Value is still present\n");
ret = pRegDeleteTreeA(hkey_main, "not-here"); ok(ret == ERROR_FILE_NOT_FOUND,
Hi Stefan
the results:
registry.c:576:test_query_value_ex: type set to: 0x0022fe78 registry.c:1163: Test failed: Expected ERROR_SUCCESS, got 6 registry: 293 tests executed (0 marked as todo, 1 failure), 0 skipped.
That's because you're doing a RegSetValueA on a just-closed handle.
Cheers,
Paul.