Added patch to fix error handling in DeferWindowPos when passing an invalid HWND.

This commit is contained in:
Sebastian Lackner 2015-08-30 05:38:07 +02:00
parent 0be8e1fc40
commit a21372e977
5 changed files with 87 additions and 1 deletions

View File

@ -39,9 +39,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 [4]:**
**Bug fixes and features included in the next upcoming release [5]:**
* Fix access violation in MSYS2 git when cloning repository
* Fix error handling in DeferWindowPos when passing an invalid HWND ([Wine Bug #23187](https://bugs.winehq.org/show_bug.cgi?id=23187))
* Fix failure to create anonymous file mapping after failed open_fd server call
* Map EXDEV error code to STATUS_NOT_SAME_DEVICE
* Return a dummy BIOS name in Win32_BIOS record

2
debian/changelog vendored
View File

@ -9,6 +9,8 @@ wine-staging (1.7.51) UNRELEASED; urgency=low
* Added patch to map EXDEV error code to STATUS_NOT_SAME_DEVICE.
* Added patch to fix failure to create anonymous file mapping after failed
open_fd server call (fixes Wine Staging Bug #538).
* Added patch to fix error handling in DeferWindowPos when passing an invalid
HWND.
* Removed patch to fix bug in wineserver debug_children inheritance (accepted
upstream).
* Removed patch to use helper function for NtWaitForMultipleObjects and

View File

@ -253,6 +253,7 @@ patch_enable_all ()
enable_shlwapi_AssocGetPerceivedType="$1"
enable_shlwapi_UrlCombine="$1"
enable_urlmon_CoInternetSetFeatureEnabled="$1"
enable_user32_DeferWindowPos="$1"
enable_user32_Dialog_Paint_Event="$1"
enable_user32_DrawTextExW="$1"
enable_user32_GetSystemMetrics="$1"
@ -839,6 +840,9 @@ patch_enable ()
urlmon-CoInternetSetFeatureEnabled)
enable_urlmon_CoInternetSetFeatureEnabled="$2"
;;
user32-DeferWindowPos)
enable_user32_DeferWindowPos="$2"
;;
user32-Dialog_Paint_Event)
enable_user32_Dialog_Paint_Event="$2"
;;
@ -4946,6 +4950,21 @@ if test "$enable_urlmon_CoInternetSetFeatureEnabled" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-DeferWindowPos
# |
# | This patchset fixes the following Wine bugs:
# | * [#23187] Fix error handling in DeferWindowPos when passing an invalid HWND
# |
# | Modified files:
# | * dlls/user32/winpos.c
# |
if test "$enable_user32_DeferWindowPos" -eq 1; then
patch_apply user32-DeferWindowPos/0001-user32-Fix-error-handling-in-Begin-End-DeferWindowPo.patch
(
echo '+ { "Rodrigo Rivas", "user32: Fix error handling in {Begin,End,}DeferWindowPos() to match Windows behavior.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-Dialog_Paint_Event
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,62 @@
From e205d3ce0d27afe10ecd82657b39790a4cf4e087 Mon Sep 17 00:00:00 2001
From: Rodrigo Rivas <rodrigorivascosta@gmail.com>
Date: Tue, 25 Aug 2015 15:08:43 +0200
Subject: user32: Fix error handling in {Begin,End,}DeferWindowPos() to match
Windows behavior (resend)
---
dlls/user32/winpos.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index f92a3dc..7cb3a4f 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -2349,6 +2349,11 @@ HDWP WINAPI DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter,
hwnd = WIN_GetFullHandle( hwnd );
if (is_desktop_window( hwnd )) return 0;
+ if (!IsWindow( hwnd ))
+ {
+ SetLastError( ERROR_INVALID_WINDOW_HANDLE );
+ return 0;
+ }
if (!(pDWP = get_user_handle_ptr( hdwp, USER_DWP ))) return 0;
if (pDWP == OBJ_OTHER_PROCESS)
@@ -2418,7 +2423,6 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
{
DWP *pDWP;
WINDOWPOS *winpos;
- BOOL res = TRUE;
int i;
TRACE("%p\n", hdwp);
@@ -2430,20 +2434,20 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
return FALSE;
}
- for (i = 0, winpos = pDWP->winPos; res && i < pDWP->actualCount; i++, winpos++)
+ for (i = 0, winpos = pDWP->winPos; i < pDWP->actualCount; i++, winpos++)
{
TRACE("hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
winpos->hwnd, winpos->hwndInsertAfter, winpos->x, winpos->y,
winpos->cx, winpos->cy, winpos->flags);
if (WIN_IsCurrentThread( winpos->hwnd ))
- res = USER_SetWindowPos( winpos );
+ USER_SetWindowPos( winpos );
else
- res = SendMessageW( winpos->hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)winpos );
+ SendMessageW( winpos->hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)winpos );
}
HeapFree( GetProcessHeap(), 0, pDWP->winPos );
HeapFree( GetProcessHeap(), 0, pDWP );
- return res;
+ return TRUE;
}
--
2.5.0

View File

@ -0,0 +1,2 @@
Fixes: [23187] Fix error handling in DeferWindowPos when passing an invalid HWND
# From: http://source.winehq.org/patches/data/113938