From 5f07c07d64fc40ed9d7f4db4ff8f673dd9df8637 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 20 Feb 2015 07:03:00 +0000 Subject: [PATCH] [KERNEL32] - Make BaseSetLastNTError return the converted Win32 error code. This will determine the upper 24 bits of EAX in functions that return BOOLEAN FALSE right after calling BaseSetLastNTError, e.g. Wow64EnableWow64FsRedirection. Fixes installers using WiX Toolset (e.g. VS2012 redist) on MSVC builds. See http://wixtoolset.org/issues/4681/ for the WiX bug that causes this. CORE-8010 svn path=/trunk/; revision=66365 --- reactos/dll/win32/kernel32/client/except.c | 8 ++++++-- reactos/dll/win32/kernel32/include/kernel32.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/except.c b/reactos/dll/win32/kernel32/client/except.c index e313e990faa..276f5f22031 100644 --- a/reactos/dll/win32/kernel32/client/except.c +++ b/reactos/dll/win32/kernel32/client/except.c @@ -682,12 +682,16 @@ SetLastError(IN DWORD dwErrCode) /* * @implemented */ -VOID +DWORD WINAPI BaseSetLastNTError(IN NTSTATUS Status) { + DWORD dwErrCode; + /* Convert from NT to Win32, then set */ - SetLastError(RtlNtStatusToDosError(Status)); + dwErrCode = RtlNtStatusToDosError(Status); + SetLastError(dwErrCode); + return dwErrCode; } /* diff --git a/reactos/dll/win32/kernel32/include/kernel32.h b/reactos/dll/win32/kernel32/include/kernel32.h index 383a1061222..2cca331c648 100644 --- a/reactos/dll/win32/kernel32/include/kernel32.h +++ b/reactos/dll/win32/kernel32/include/kernel32.h @@ -353,7 +353,7 @@ VOID WINAPI InitCommandLines(VOID); -VOID +DWORD WINAPI BaseSetLastNTError(IN NTSTATUS Status);