Added patch to check IsWoW64Process before calling Wow64 functions in UNIXFS_get_unix_path.

This commit is contained in:
Sebastian Lackner 2015-12-27 18:53:48 +01:00
parent b9c5736515
commit 25493b94b1
5 changed files with 84 additions and 1 deletions

View File

@ -34,9 +34,10 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [3]:**
**Bug fixes and features included in the next upcoming release [4]:**
* Avoid corruption of caret when SetCaretPos() is called
* Check IsWoW64Process before calling Wow64 functions in UNIXFS_get_unix_path
* SHMapHandle should not set error when NULL is passed as hShared
* SysAllocStringByteLen should align terminating null WCHAR

View File

@ -274,6 +274,7 @@ patch_enable_all ()
enable_shell32_SHCreateSessionKey="$1"
enable_shell32_SHFileOperation_Move="$1"
enable_shell32_SHFileOperation_Win9x="$1"
enable_shell32_UNIXFS_get_unix_path="$1"
enable_shell32_UnixFS="$1"
enable_shlwapi_AssocGetPerceivedType="$1"
enable_shlwapi_SHMapHandle="$1"
@ -934,6 +935,9 @@ patch_enable ()
shell32-SHFileOperation_Win9x)
enable_shell32_SHFileOperation_Win9x="$2"
;;
shell32-UNIXFS_get_unix_path)
enable_shell32_UNIXFS_get_unix_path="$2"
;;
shell32-UnixFS)
enable_shell32_UnixFS="$2"
;;
@ -5437,6 +5441,18 @@ if test "$enable_shell32_SHFileOperation_Win9x" -eq 1; then
) >> "$patchlist"
fi
# Patchset shell32-UNIXFS_get_unix_path
# |
# | Modified files:
# | * dlls/shell32/shfldr_unixfs.c
# |
if test "$enable_shell32_UNIXFS_get_unix_path" -eq 1; then
patch_apply shell32-UNIXFS_get_unix_path/0001-shell32-Check-IsWoW64Process-before-calling-Wow64-fu.patch
(
echo '+ { "Olivier F. R. Dierick", "shell32: Check IsWoW64Process before calling Wow64 functions.", 2 },';
) >> "$patchlist"
fi
# Patchset shell32-UnixFS
# |
# | Modified files:

View File

@ -0,0 +1,63 @@
From 4ff58d5b7b2bef1db7dc151976e111ddea9b91a3 Mon Sep 17 00:00:00 2001
From: "Olivier F. R. Dierick" <o.dierick@piezo-forte.be>
Date: Sat, 28 Nov 2015 06:25:33 +0100
Subject: shell32: Check IsWoW64Process before calling Wow64 functions (try 2)
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 <o.dierick@piezo-forte.be>
---
dlls/shell32/shfldr_unixfs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c
index 85383e8..7de38ba 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);
@@ -408,13 +409,14 @@ static BOOL UNIXFS_get_unix_path(LPCWSTR pszDosPath, char *pszCanonicalPath)
HeapFree(GetProcessHeap(), 0, pszUnixPath);
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 +430,7 @@ 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);
--
2.6.4

View File

@ -0,0 +1 @@
Fixes: Check IsWoW64Process before calling Wow64 functions in UNIXFS_get_unix_path

View File

@ -2,6 +2,8 @@ wine-staging (1.9.0) UNRELEASED; urgency=low
* Added patch to align terminating null WCHAR in SysAllocStringByteLen.
* Added patch to avoid corruption of caret when SetCaretPos() is called.
* Added patch to avoid setting error when NULL is passed to SHMapHandle.
* Added patch to check IsWoW64Process before calling Wow64 functions in
UNIXFS_get_unix_path.
* Removed patch to add a stub driver for tdi.sys (accepted upstream).
* Removed patch to implement support for ws2_32.dll.WSAPoll (accepted
upstream).