In the reg.exe tests around line 181:
verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), (sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
What's the reason for this? Is there some platform specific quirk I should be aware of?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-10-17 17:45, schrieb Jonathan Vollebregt:
In the reg.exe tests around line 181:
verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), (sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
What's the reason for this? Is there some platform specific quirk I should be aware of?
Smells like 32 bit vs 64 bit to me.
On 17 October 2014 17:49, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 2014-10-17 17:45, schrieb Jonathan Vollebregt:
In the reg.exe tests around line 181:
verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), (sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
What's the reason for this? Is there some platform specific quirk I should be aware of?
Smells like 32 bit vs 64 bit to me.
But this specific instance is a bit nasty, since on 64-bit Windows compilers sizeof(long) == sizeof(DWORD). I suspect that's unintentional and this really wanted to use e.g. sizeof(void *), even though it shouldn't matter in practice because the TODO_REG_DATA flag should only make a difference on Wine.
On Fri, 17 Oct 2014 17:45:52 +0200, Jonathan Vollebregt wrote:
In the reg.exe tests around line 181:
verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), (sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
What's the reason for this? Is there some platform specific quirk I should be aware of?
The reason is that reg.c REG_DWORD handling code uses strtolW() for string conversion[1]. If the value greater than LONG_MAX, strtolW() returns LONG_MAX, so this test doesn't pass if sizeof(long) == 4.
I'm not sure all wine platform use LP64 architecture then, so I introduce above quirks. In retrospect, 0xdeadbeefU < LONG_MAX is easier to read, I think.
[1] http://source.winehq.org/source/programs/reg/reg.c#0145
Regards, Akihiro Sagawa
I thought there was a long somewhere but I couldn't figure out where. I also had no idea why I had to change it to 0 in my tests but knowing that it's obvious: I use strtoulW.
A new set of reg patches including binary/big_endian/expand/multi tests will be coming as soon as testbot gives me the all clear.
On 10/17/2014 08:01 PM, Akihiro Sagawa wrote:
On Fri, 17 Oct 2014 17:45:52 +0200, Jonathan Vollebregt wrote:
In the reg.exe tests around line 181:
verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), (sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
What's the reason for this? Is there some platform specific quirk I should be aware of?
The reason is that reg.c REG_DWORD handling code uses strtolW() for string conversion[1]. If the value greater than LONG_MAX, strtolW() returns LONG_MAX, so this test doesn't pass if sizeof(long) == 4.
I'm not sure all wine platform use LP64 architecture then, so I introduce above quirks. In retrospect, 0xdeadbeefU < LONG_MAX is easier to read, I think.
[1] http://source.winehq.org/source/programs/reg/reg.c#0145
Regards, Akihiro Sagawa