RegSetValueEx problem?
Alexandre Julliard
julliard at winehq.com
Wed Apr 11 12:34:14 CDT 2001
davep <davep at cyw.uklinux.net> writes:
> I have now been able to build and run WineMine under NT4, and it works
> perfectly. On exit each parameter is saved to the registry as 16 bytes including
> the training garbage (not visible in Regedit of course) and when restarted the
> exact same 16 bytes are reloaded from the registry.
>
> It does therefore seem that there is something wrong with Wne's implementation.
No, it depends if data[sizeof(data)] is null or not; the +1 on the
size is done only if the last byte is null, on the assumption that the
programmer forgot to count it (i.e. used strlen(data) instead of
strlen(data)+1). It's the usual Microsoft approach of hiding bugs
instead of fixing them, and it is definitely what NT does (or we
wouldn't be doing such a monstrosity).
Now what can happen is that the Microsoft compiler lays out the stack
in a different way than gcc, and that the variable that is just above
the array on the stack doesn't contain 0 in this case. In fact I
suspect that if you run your Windows binary of WineMine under Wine it
will work fine too.
--
Alexandre Julliard
julliard at winehq.com
More information about the wine-devel
mailing list