diff options
author | Bob Arnson <bob@firegiant.com> | 2020-05-17 17:35:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-17 17:35:33 -0400 |
commit | 0d185698044254d5b03b56761bffc5108b55b7cb (patch) | |
tree | 9d70648a2650326633bc03b5a76d86108efb2ce2 | |
parent | 0f88b23cab65e0bf3dc020d27bf9694d0c35b2f5 (diff) | |
parent | 0d294d6306004a495317d21a220e1a64f392fdc4 (diff) | |
download | wix-0d185698044254d5b03b56761bffc5108b55b7cb.tar.gz wix-0d185698044254d5b03b56761bffc5108b55b7cb.tar.bz2 wix-0d185698044254d5b03b56761bffc5108b55b7cb.zip |
Merge pull request #8 from wixtoolset/bob/arm64b
Port wix3 ARM64 fix.
-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 | ||