kernelbase: Preserve last error when GetEnvironmentVariableA succeeds.
commit7ad5e1bc8ac7f83128c2fd7a6c8554d8f2b9c82f
authorVladimir Panteleev <git@vladimir.panteleev.md>
Thu, 14 May 2020 21:12:24 +0000 (14 23:12 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 15 May 2020 12:08:51 +0000 (15 14:08 +0200)
tree8738dd7bd49e66457ce74fb8d48482f2b1f64294
parent3c1edaaae582a77ec6472f634e500748477c27e3
kernelbase: Preserve last error when GetEnvironmentVariableA succeeds.

Avoid clobbering last error with NO_ERROR when GetEnvironmentVariableA
succeeds, matching the behavior of GetEnvironmentVariableW and
Windows.

Instead of naively saving and restoring the last error, call
RtlQueryEnvironmentVariable_U directly to avoid unnecessarily setting
it in the first place.

Signed-off-by: Vladimir Panteleev <git@vladimir.panteleev.md>
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/advapi32/tests/security.c
dlls/kernel32/tests/environ.c
dlls/kernelbase/process.c