From: Zebediah Figura Subject: Re: [PATCH 1/2] kernelbase: Don't return ERROR_INSUFFICIENT_BUFFER from GetEnvironmentVariableW. Message-Id: <6a5690ce-7b0e-634a-8a91-4ef2eee3e6f7@gmail.com> Date: Mon, 20 Jan 2020 11:46:19 -0600 In-Reply-To: References: <20200116083242.688444-1-git@vladimir.panteleev.md> <8bd11304-59d3-abc3-604f-11e84ceef2dc@codeweavers.com> On 1/16/20 10:26 PM, Vladimir Panteleev wrote: > On Thu, 16 Jan 2020 at 08:43, Zhiyi Zhang wrote: >> Wine already has tests for SetEnvironmentVariableW in dlls/kernel32/tests/environ.c. >> I think you should add new tests there instead of creating a new one in kernelbase. > > Good idea, thanks. > > It looks like there is another problem. Wine's current behavior for > the thing I'm trying to fix is "correct" in that it correctly emulates > Windows versions before 7. However, the affected Windows program > expects the W7+ behavior, and doesn't support older Windows versions > anyway. What can be done about this? if (...GetVersion()...) ...old > behavior... else ...w7+ behavior...? Or should it be changed to just > do what W7 does? > As far as I'm aware it's generally fine to change Wine to (unconditionally) emulate newer Windows behaviour rather than older if a program depends on it, especially if the older behaviour is obviously "broken" in some manner (e.g. contradicts the documentation or is otherwise insane.)