registry: order of insertion of values
truiken at gmail.com
Sun Apr 3 16:33:21 CDT 2005
I've been fixing tests that fail on all of Win9x/XP/2003, and I've
found a difference between the way we insert new values. What happens
in advapi32/tests/registry.c - test_enum_value is that we already have
3 values created under the key Wine\\Test before the test starts.
Then we make four calls to RegSetValueExA with 'Test' as the name of
the value to set. Since this value does not exist, it is created.
After these four calls, here are all the values under the test key:
%LONGSYSTEMVAR% = "bar"
%FOO% = "ImARatherLongButIndeedNeededString"
data_count: 7, strlen("foobar") + 1
data_count: 24, same as above
We then go on to query RegEnumValueA with value index 0. In wine the
key that is queried is Test because we insert new keys in alphabetical
order and Test is before Test1..3. On all versions of windows,
querying value index 0 returns information for Test1. I added another
RegEnumValueA with value index 3 and it turns out that this is the
index for Test, leading me to believe that windows just inserts the
keys in order of creation.
It says on msdn that "because values are not ordered, any new value
will have an arbitrary index", but should we also store new values in
If you remove the initial RegSetValueEx calls creating the 'Test'
value and match the results of wine with those from windows, all the
tests pass of wine and windows. I will be sending a patch to remove
these RegSetValueEx tests, because they really should be in their own
test (as seen by this bug), but it did give me the chance to raise the
question of whether we should store new values in creation order or
not. What's the verdict?
More information about the wine-devel