From: "Olivier F. R. Dierick" Subject: shell32: Check IsWoW64Process before calling Wow64 functions (try 2) Message-Id: <1448688333.3588.8.camel@piezo3.piezo-forte.be> Date: Sat, 28 Nov 2015 06:25:33 +0100 Replace patch entry 116937. Fix one of the error leak source that prevents the installer to succeed (bug 36838). On 32 bit Wine, the original code did set last error to ERROR_CALL_NOT_IMPLEMENTED when calling wow64 functions. The game installer chokes at some point when the last error is anything but zero and fails to complete the installation. Checking if wow64 is available before calling wow64 functions avoids that. The affected wow64 function calls themselves are not required for proper operation on 32 bit systems. Signed-off-by: Olivier F. R. Dierick --- dlls/shell32/shfldr_unixfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- Olivier F. R. Dierick o.dierick@piezo-forte.be From a08c07f6cfa149774814c5a645ecb14ae6bf204b Mon Sep 17 00:00:00 2001 From: "Olivier F. R. Dierick" Date: Sat, 28 Nov 2015 06:10:46 +0100 Subject: Check IsWoW64Process before calling Wow64 functions Signed-off-by: Olivier F. R. Dierick --- dlls/shell32/shfldr_unixfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index b3b0214..da3c5bb 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -392,6 +392,7 @@ static BOOL UNIXFS_get_unix_path(LPCWSTR pszDosPath, char *pszCanonicalPath) BOOL has_failed = FALSE; WCHAR wszDrive[] = { '?', ':', '\\', 0 }, dospath[MAX_PATH], *dospath_end; int cDriveSymlinkLen; + BOOL is_wow64; void *redir; TRACE("(pszDosPath=%s, pszCanonicalPath=%p)\n", debugstr_w(pszDosPath), pszCanonicalPath); @@ -409,12 +410,15 @@ static BOOL UNIXFS_get_unix_path(LPCWSTR pszDosPath, char *pszCanonicalPath) if (!pElement) return FALSE; if (szPath[strlen(szPath)-1] != '/') strcat(szPath, "/"); + if (!IsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; + /* Append the part relative to the drive symbolic link target. */ lstrcpyW(dospath, pszDosPath); dospath_end = dospath + lstrlenW(dospath); /* search for the most valid UNIX path possible, then append missing * path parts */ - Wow64DisableWow64FsRedirection(&redir); + if(is_wow64) + Wow64DisableWow64FsRedirection(&redir); while(!(pszUnixPath = wine_get_unix_file_name(dospath))){ if(has_failed){ *dospath_end = '/'; @@ -428,7 +432,8 @@ static BOOL UNIXFS_get_unix_path(LPCWSTR pszDosPath, char *pszCanonicalPath) } *dospath_end = '\0'; } - Wow64RevertWow64FsRedirection(redir); + if(is_wow64) + Wow64RevertWow64FsRedirection(redir); if(dospath_end < dospath) return FALSE; strcat(szPath, pszUnixPath + cDriveSymlinkLen); -- 1.7.10.4