Do the same thing as Vista and up.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48471
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>
Windows doesn't do this (except XP, and then only for empty variables,
where it returns ERROR_MORE_DATA).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48471
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>
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>
Lack of SetLastError() calls caused tests to compare stale errors,
instead of the effects of the tested (immediately previously called)
functions.
Add SetLastError calls, and fix a broken test (copy check from A to W
tests).
Signed-off-by: Vladimir Panteleev <git@vladimir.panteleev.md>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
There are certain applications which try to traverse the environement
being returned, but this is problematic since they cannot acquire the
PEB Lock (i.e cl.exe on Visual Studio 14.15) .
Signed-off-by: Jon Doron <arilou@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Add tests for the GetComputerName* functions that show this issue.
Fix an off-by-one error in setting the size when there is not enough space.
Remove the exception handlers for GetComputerNameW,
GetComputerNameExA/W, since testing on XP SP2 shows that access
violations are not caught and these are not present on Win9x, which
does have an exception handler.