From fe77e96629575d6cfc16f8a868f13af89c198d13 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 13 Sep 2021 13:52:09 -0700 Subject: Don't set NativeMachine variables when IsWow64Process2 is unavailable --- src/libs/dutil/WixToolset.DUtil/procutil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libs') diff --git a/src/libs/dutil/WixToolset.DUtil/procutil.cpp b/src/libs/dutil/WixToolset.DUtil/procutil.cpp index 5cd067f0..a3131b7a 100644 --- a/src/libs/dutil/WixToolset.DUtil/procutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/procutil.cpp @@ -124,7 +124,8 @@ extern "C" HRESULT DAPI ProcNativeMachine( __out USHORT* pusNativeMachine ) { - HRESULT hr = S_OK; + // S_FALSE will indicate that the method is not supported. + HRESULT hr = S_FALSE; typedef BOOL(WINAPI* LPFN_ISWOW64PROCESS2)(HANDLE, USHORT *, USHORT *); LPFN_ISWOW64PROCESS2 pfnIsWow64Process2 = (LPFN_ISWOW64PROCESS2)::GetProcAddress(::GetModuleHandleW(L"kernel32"), "IsWow64Process2"); @@ -136,6 +137,7 @@ extern "C" HRESULT DAPI ProcNativeMachine( { ExitWithLastError(hr, "Failed to check WOW64 process - IsWow64Process2."); } + hr = S_OK; } LExit: -- cgit v1.2.3-55-g6feb