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...
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
I actually have a Vista Home Basic install on a laptop that I can check testcases on, at least for right now. I'm thinking of going out and getting a licensed copy of xp for it (linux isn't viable for it because it isnt my laptop and its being used as the main pc for business transactions, so it couldnt be used to help further wine development either, other than running testcases on windows, unfortunately)
Tom
P.S. Since the laptop can't be used for development, could you send a precompiled binary, and I will test?
On 4/19/07, Stefan Leichter Stefan.Leichter@camline.com 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
Am Friday 20 April 2007 05:54 schrieb Tom Spear:
I actually have a Vista Home Basic install on a laptop that I can check testcases on, at least for right now. I'm thinking of going out and getting a licensed copy of xp for it (linux isn't viable for it because it isnt my laptop and its being used as the main pc for business transactions, so it couldnt be used to help further wine development either, other than running testcases on windows, unfortunately)
Hello Tom,
can you build advapi32_test.exe yourself or do you need an executable?
Thank you for offering your support Stefan
On 4/19/07, Stefan Leichter Stefan.Leichter@camline.com 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
Hi Stefan,
I can't do this before Sunday or so. I'm in the UK and don't have my laptop with me. I'll post the results as soon as I have something.
Cheers,
Paul.
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.
Am Saturday 21 April 2007 20:13 schrieb Paul Vriens:
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.
Hello Paul,
can you retry with the attached patch.
Thank you Stefan
Stefan Leichter wrote:
Am Saturday 21 April 2007 20:13 schrieb Paul Vriens:
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.
Hello Paul,
can you retry with the attached patch.
Thank you Stefan
--- ../wine-git/dlls/advapi32/tests/registry.c 2007-04-18 18:45:08.000000000 +0200 +++ dlls/advapi32/tests/registry.c 2007-04-21 22:19:15.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(subkey, "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,
All fine this time:
registry.c:576:test_query_value_ex: type set to: 0x0022fe78 registry: 293 tests executed (0 marked as todo, 0 failures), 0 skipped.
(Seeing this output (mentioning line 576) and comparing this to the previous one, it seems the type value is not so random as stated in the comments of that test, I'll have a look if time permits).
Cheers,
Paul.