http://bugs.winehq.org/show_bug.cgi?id=10649
--- Comment #12 from Juan Lang juan_lang@yahoo.com 2007-12-12 22:08:02 --- I just tried your test on WinXP, and it succeeds there. Also, size remains at 4 after the call, so you may want to add a test for that as well.
Regarding your comment #4:
the problem is that the early type setting change was presumably to match some undocumented behaviour too and not knowing exactly what that behaviour was, I can't test that.
This is to match win9x when called for a non-existent value, as shown in the tests at line 570: http://source.winehq.org/source/dlls/advapi32/tests/registry.c#L570
It's possible to modify RegQueryValueExA only to set the type to 0 when the value isn't found/can't be read, which might be clearer than your approach.