@@ -18,14 +18,18 @@ Architecture parseArchitecture(const fs::path& path)
18
18
IMAGE_DOS_HEADER dosHeader;
19
19
IMAGE_NT_HEADERS32 ntHeader32;
20
20
21
+ #ifndef _WIN64
21
22
PVOID oldRedirection{ NULL };
22
23
if (!Wow64DisableWow64FsRedirection (&oldRedirection))
23
24
throw std::system_error (std::error_code (GetLastError (), std::system_category ()), " Failed to disable Wow64Fs redirection" );
25
+ #endif
24
26
25
27
std::ifstream file (path, std::ios::binary);
26
28
29
+ #ifndef _WIN64
27
30
if (!Wow64RevertWow64FsRedirection (oldRedirection))
28
31
throw std::system_error (std::error_code (GetLastError (), std::system_category ()), " Failed to revert Wow64Fs redirection" );
32
+ #endif
29
33
30
34
file.exceptions (std::ifstream::failbit | std::ifstream::badbit);
31
35
@@ -47,15 +51,19 @@ std::vector<Export> parseExports(const fs::path& path)
47
51
{
48
52
_LOADED_IMAGE LoadedImage;
49
53
54
+ #ifndef _WIN64
50
55
PVOID oldRedirection{ NULL };
51
56
if (!Wow64DisableWow64FsRedirection (&oldRedirection))
52
57
throw std::system_error (std::error_code (GetLastError (), std::system_category ()), " Failed to disable Wow64Fs redirection" );
58
+ #endif
53
59
54
60
if (!MapAndLoad (path.u8string ().c_str (), nullptr , &LoadedImage, TRUE , TRUE ))
55
61
throw std::system_error (std::error_code (GetLastError (), std::system_category ()), " MapAndLoad failed to load DLL" );
56
62
63
+ #ifndef _WIN64
57
64
if (!Wow64RevertWow64FsRedirection (oldRedirection))
58
65
throw std::system_error (std::error_code (GetLastError (), std::system_category ()), " Failed to revert Wow64Fs redirection" );
66
+ #endif
59
67
60
68
std::vector<Export> exportVector;
61
69
0 commit comments