diff options
| author | Bob Arnson <bob@joyofsetup.com> | 2020-05-17 17:33:00 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@joyofsetup.com> | 2020-05-17 17:33:00 -0400 |
| commit | 0d294d6306004a495317d21a220e1a64f392fdc4 (patch) | |
| tree | abc1143d086488696022ac36744e7ce55b577496 /src | |
| parent | 49b650dcfd513dcda5913cebe32839d0b28fbc2e (diff) | |
| download | wix-0d294d6306004a495317d21a220e1a64f392fdc4.tar.gz wix-0d294d6306004a495317d21a220e1a64f392fdc4.tar.bz2 wix-0d294d6306004a495317d21a220e1a64f392fdc4.zip | |
Port wix3 ARM64 fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dutil/procutil.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/dutil/procutil.cpp b/src/dutil/procutil.cpp index 4b34c773..9833d0ec 100644 --- a/src/dutil/procutil.cpp +++ b/src/dutil/procutil.cpp | |||
| @@ -68,6 +68,24 @@ extern "C" HRESULT DAPI ProcWow64( | |||
| 68 | HRESULT hr = S_OK; | 68 | HRESULT hr = S_OK; |
| 69 | BOOL fIsWow64 = FALSE; | 69 | BOOL fIsWow64 = FALSE; |
| 70 | 70 | ||
| 71 | typedef BOOL(WINAPI* LPFN_ISWOW64PROCESS2)(HANDLE, USHORT *, USHORT *); | ||
| 72 | LPFN_ISWOW64PROCESS2 pfnIsWow64Process2 = (LPFN_ISWOW64PROCESS2)::GetProcAddress(::GetModuleHandleW(L"kernel32"), "IsWow64Process2"); | ||
| 73 | |||
| 74 | if (pfnIsWow64Process2) | ||
| 75 | { | ||
| 76 | USHORT pProcessMachine = IMAGE_FILE_MACHINE_UNKNOWN; | ||
| 77 | if (!pfnIsWow64Process2(hProcess, &pProcessMachine, nullptr)) | ||
| 78 | { | ||
| 79 | ExitWithLastError(hr, "Failed to check WOW64 process - IsWow64Process2."); | ||
| 80 | } | ||
| 81 | |||
| 82 | if (pProcessMachine != IMAGE_FILE_MACHINE_UNKNOWN) | ||
| 83 | { | ||
| 84 | fIsWow64 = TRUE; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | else | ||
| 88 | { | ||
| 71 | typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL); | 89 | typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL); |
| 72 | LPFN_ISWOW64PROCESS pfnIsWow64Process = (LPFN_ISWOW64PROCESS)::GetProcAddress(::GetModuleHandleW(L"kernel32"), "IsWow64Process"); | 90 | LPFN_ISWOW64PROCESS pfnIsWow64Process = (LPFN_ISWOW64PROCESS)::GetProcAddress(::GetModuleHandleW(L"kernel32"), "IsWow64Process"); |
| 73 | 91 | ||
| @@ -75,7 +93,8 @@ extern "C" HRESULT DAPI ProcWow64( | |||
| 75 | { | 93 | { |
| 76 | if (!pfnIsWow64Process(hProcess, &fIsWow64)) | 94 | if (!pfnIsWow64Process(hProcess, &fIsWow64)) |
| 77 | { | 95 | { |
| 78 | ExitWithLastError(hr, "Failed to check WOW64 process."); | 96 | ExitWithLastError(hr, "Failed to check WOW64 process - IsWow64Process."); |
| 97 | } | ||
| 79 | } | 98 | } |
| 80 | } | 99 | } |
| 81 | 100 | ||
