From 2f3d51e7f42901df9444de42e0d29ddd3daf659d Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 21 Mar 2015 05:32:24 +0100 Subject: [PATCH] Fix 'available for more data' field in user32 user_thread_info structure. --- patches/patchinstall.sh | 91 ++++++++++++------- ...ecessary-wineserver-calls-in-PeekMes.patch | 14 +-- ...ling-LL-hooks-the-key-state-cache-ha.patch | 18 ++-- patches/user32-Key_State/definition | 1 + ...adding-in-user_thread_info-structure.patch | 35 +++++++ 5 files changed, 107 insertions(+), 52 deletions(-) create mode 100644 patches/user32-user_thread_info/0001-user32-Fix-padding-in-user_thread_info-structure.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a7920e55..0b5c5c6c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -204,6 +204,7 @@ patch_enable_all () enable_user32_Painting="$1" enable_user32_ScrollWindowEx="$1" enable_user32_WndProc="$1" + enable_user32_user_thread_info="$1" enable_vcomp_Stub_Functions="$1" enable_version_VerQueryValue="$1" enable_version_VersionInfoEx="$1" @@ -672,6 +673,9 @@ patch_enable () user32-WndProc) enable_user32_WndProc="$2" ;; + user32-user_thread_info) + enable_user32_user_thread_info="$2" + ;; vcomp-Stub_Functions) enable_vcomp_Stub_Functions="$2" ;; @@ -1026,6 +1030,13 @@ if test "$enable_server_Shared_Memory" -eq 1; then enable_user32_Key_State=1 fi +if test "$enable_user32_Key_State" -eq 1; then + if test "$enable_user32_user_thread_info" -gt 1; then + abort "Patchset user32-user_thread_info disabled, but user32-Key_State depends on that." + fi + enable_user32_user_thread_info=1 +fi + if test "$enable_server_JobObjects" -eq 1; then if test "$enable_kernel32_Console_Handles" -gt 1; then abort "Patchset kernel32-Console_Handles disabled, but server-JobObjects depends on that." @@ -1859,6 +1870,40 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-Revert_PixelFormat +# | +# | This patchset fixes the following Wine bugs: +# | * [#35655] Fix wined3d performance drop introduced by pixelformat changes. +# | * [#35718] Fix flickering introduced by pixelformat changes. +# | * [#35950] Fix black screen on startup introduced by pixelformat changes. +# | * [#35975] Fix gray screen on startup introduced by pixelformat changes. +# | * [#36900] Fix missing video introduced by pixelformat changes. +# | +# | Modified files: +# | * dlls/d3d8/tests/device.c, dlls/d3d9/tests/device.c, dlls/ddraw/tests/ddraw1.c, dlls/ddraw/tests/ddraw2.c, +# | dlls/ddraw/tests/ddraw4.c, dlls/ddraw/tests/ddraw7.c, dlls/wined3d/context.c, dlls/wined3d/wined3d_private.h +# | +if test "$enable_wined3d_Revert_PixelFormat" -eq 1; then + patch_apply wined3d-Revert_PixelFormat/0001-Revert-wined3d-Track-if-a-context-s-private-hdc-has-.patch + patch_apply wined3d-Revert_PixelFormat/0002-Revert-wined3d-Track-if-a-context-s-hdc-is-private-s.patch + patch_apply wined3d-Revert_PixelFormat/0003-Revert-wined3d-When-restoring-pixel-format-in-contex.patch + patch_apply wined3d-Revert_PixelFormat/0004-Revert-wined3d-Don-t-call-GetPixelFormat-to-set-a-fl.patch + patch_apply wined3d-Revert_PixelFormat/0005-Revert-wined3d-Restore-the-pixel-format-of-the-windo.patch + patch_apply wined3d-Revert_PixelFormat/0006-d3d8-Mark-tests-which-no-longer-pass-due-to-reverts-.patch + patch_apply wined3d-Revert_PixelFormat/0007-d3d9-Mark-tests-which-no-longer-pass-due-to-reverts-.patch + patch_apply wined3d-Revert_PixelFormat/0008-ddraw-Mark-tests-which-no-longer-pass-due-to-reverts.patch + ( + echo '+ { "Ken Thomases", "Revert \"wined3d: Track if a context'\''s private hdc has had its pixel format set, so we don'\''t need to check it.\".", 1 },'; + echo '+ { "Ken Thomases", "Revert \"wined3d: Track if a context'\''s hdc is private so we never need to restore its pixel format.\".", 1 },'; + echo '+ { "Ken Thomases", "Revert \"wined3d: When restoring pixel format in context_release(), mark the context as needing to be set on the next context_acquire().\".", 1 },'; + echo '+ { "Ken Thomases", "Revert \"wined3d: Don'\''t call GetPixelFormat() to set a flag that'\''s already set.\".", 1 },'; + echo '+ { "Ken Thomases", "Revert \"wined3d: Restore the pixel format of the window whose pixel format was actually changed.\".", 1 },'; + echo '+ { "Ken Thomases", "d3d8: Mark tests which no longer pass due to reverts as todo_wine.", 1 },'; + echo '+ { "Ken Thomases", "d3d9: Mark tests which no longer pass due to reverts as todo_wine.", 1 },'; + echo '+ { "Ken Thomases", "ddraw: Mark tests which no longer pass due to reverts as todo_wine.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-UnhandledBlendFactor # | # | Modified files: @@ -1901,40 +1946,6 @@ if test "$enable_wined3d_NormalMatrix" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-Revert_PixelFormat -# | -# | This patchset fixes the following Wine bugs: -# | * [#35655] Fix wined3d performance drop introduced by pixelformat changes. -# | * [#35718] Fix flickering introduced by pixelformat changes. -# | * [#35950] Fix black screen on startup introduced by pixelformat changes. -# | * [#35975] Fix gray screen on startup introduced by pixelformat changes. -# | * [#36900] Fix missing video introduced by pixelformat changes. -# | -# | Modified files: -# | * dlls/d3d8/tests/device.c, dlls/d3d9/tests/device.c, dlls/ddraw/tests/ddraw1.c, dlls/ddraw/tests/ddraw2.c, -# | dlls/ddraw/tests/ddraw4.c, dlls/ddraw/tests/ddraw7.c, dlls/wined3d/context.c, dlls/wined3d/wined3d_private.h -# | -if test "$enable_wined3d_Revert_PixelFormat" -eq 1; then - patch_apply wined3d-Revert_PixelFormat/0001-Revert-wined3d-Track-if-a-context-s-private-hdc-has-.patch - patch_apply wined3d-Revert_PixelFormat/0002-Revert-wined3d-Track-if-a-context-s-hdc-is-private-s.patch - patch_apply wined3d-Revert_PixelFormat/0003-Revert-wined3d-When-restoring-pixel-format-in-contex.patch - patch_apply wined3d-Revert_PixelFormat/0004-Revert-wined3d-Don-t-call-GetPixelFormat-to-set-a-fl.patch - patch_apply wined3d-Revert_PixelFormat/0005-Revert-wined3d-Restore-the-pixel-format-of-the-windo.patch - patch_apply wined3d-Revert_PixelFormat/0006-d3d8-Mark-tests-which-no-longer-pass-due-to-reverts-.patch - patch_apply wined3d-Revert_PixelFormat/0007-d3d9-Mark-tests-which-no-longer-pass-due-to-reverts-.patch - patch_apply wined3d-Revert_PixelFormat/0008-ddraw-Mark-tests-which-no-longer-pass-due-to-reverts.patch - ( - echo '+ { "Ken Thomases", "Revert \"wined3d: Track if a context'\''s private hdc has had its pixel format set, so we don'\''t need to check it.\".", 1 },'; - echo '+ { "Ken Thomases", "Revert \"wined3d: Track if a context'\''s hdc is private so we never need to restore its pixel format.\".", 1 },'; - echo '+ { "Ken Thomases", "Revert \"wined3d: When restoring pixel format in context_release(), mark the context as needing to be set on the next context_acquire().\".", 1 },'; - echo '+ { "Ken Thomases", "Revert \"wined3d: Don'\''t call GetPixelFormat() to set a flag that'\''s already set.\".", 1 },'; - echo '+ { "Ken Thomases", "Revert \"wined3d: Restore the pixel format of the window whose pixel format was actually changed.\".", 1 },'; - echo '+ { "Ken Thomases", "d3d8: Mark tests which no longer pass due to reverts as todo_wine.", 1 },'; - echo '+ { "Ken Thomases", "d3d9: Mark tests which no longer pass due to reverts as todo_wine.", 1 },'; - echo '+ { "Ken Thomases", "ddraw: Mark tests which no longer pass due to reverts as todo_wine.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-CSMT_Main # | # | This patchset fixes the following Wine bugs: @@ -3812,6 +3823,18 @@ if test "$enable_server_PeekMessage" -eq 1; then ) >> "$patchlist" fi +# Patchset user32-user_thread_info +# | +# | Modified files: +# | * dlls/user32/user_private.h +# | +if test "$enable_user32_user_thread_info" -eq 1; then + patch_apply user32-user_thread_info/0001-user32-Fix-padding-in-user_thread_info-structure.patch + ( + echo '+ { "Sebastian Lackner", "user32: Fix padding in user_thread_info structure.", 1 },'; + ) >> "$patchlist" +fi + # Patchset user32-Key_State # | # | This patchset fixes the following Wine bugs: diff --git a/patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch b/patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch index 09ce3806..b675b124 100644 --- a/patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch +++ b/patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch @@ -1,4 +1,4 @@ -From de18d43e05db389d2d9d8d8e92e68bce609f720b Mon Sep 17 00:00:00 2001 +From 4b29ed2fba176d974a44a242edf0a5038c8da862 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 19 Mar 2015 02:07:24 +0100 Subject: user32: Avoid unnecessary wineserver calls in PeekMessage/GetMessage. @@ -40,20 +40,20 @@ index d59e342..4bc17e9 100644 { req->flags = flags; diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h -index aa43578..7b8c425 100644 +index 01a19bf..adf73ff 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h -@@ -190,8 +190,9 @@ struct user_thread_info - HWND top_window; /* Desktop window */ +@@ -191,8 +191,9 @@ struct user_thread_info HWND msg_window; /* HWND_MESSAGE parent window */ RAWINPUT *rawinput; + INT key_state_epoch; /* Counter to invalidate the key state */ + DWORD last_get_msg; /* Last message time */ -- ULONG pad[5]; /* Available for more data */ -+ ULONG pad[4]; /* Available for more data */ +- ULONG pad[4]; /* Available for more data */ ++ ULONG pad[3]; /* Available for more data */ }; + #include - extern INT global_key_state_epoch DECLSPEC_HIDDEN; -- 2.3.2 diff --git a/patches/user32-Key_State/0001-user32-After-calling-LL-hooks-the-key-state-cache-ha.patch b/patches/user32-Key_State/0001-user32-After-calling-LL-hooks-the-key-state-cache-ha.patch index 59100670..1e67b1f3 100644 --- a/patches/user32-Key_State/0001-user32-After-calling-LL-hooks-the-key-state-cache-ha.patch +++ b/patches/user32-Key_State/0001-user32-After-calling-LL-hooks-the-key-state-cache-ha.patch @@ -1,4 +1,4 @@ -From bd1a61f0fe9aee47535902b65bf3fcf669574b93 Mon Sep 17 00:00:00 2001 +From d24be9691751b300e10783f66f911a55709f9331 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 14 Jul 2014 05:06:40 +0200 Subject: user32: After calling LL hooks the key state cache has to be @@ -90,23 +90,19 @@ index eac4e4d..d59e342 100644 USER_Driver->pSetCursorPos( new_x, new_y ); } diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h -index adf3f7d..aa43578 100644 +index c389414..01a19bf 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h -@@ -184,15 +184,18 @@ struct user_thread_info - DWORD GetMessagePosVal; /* Value for GetMessagePos */ - ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ - UINT active_hooks; /* Bitmap of active hooks */ -+ INT key_state_epoch; /* Counter to invalidate the key state */ - UINT key_state_time; /* Time of last key state refresh */ - BYTE *key_state; /* Cache of global key state */ +@@ -190,11 +190,14 @@ struct user_thread_info HWND top_window; /* Desktop window */ HWND msg_window; /* HWND_MESSAGE parent window */ RAWINPUT *rawinput; ++ INT key_state_epoch; /* Counter to invalidate the key state */ -- ULONG pad[6]; /* Available for more data */ -+ ULONG pad[5]; /* Available for more data */ +- ULONG pad[5]; /* Available for more data */ ++ ULONG pad[4]; /* Available for more data */ }; + #include +extern INT global_key_state_epoch DECLSPEC_HIDDEN; + diff --git a/patches/user32-Key_State/definition b/patches/user32-Key_State/definition index 84dbc4b2..d7d0edcb 100644 --- a/patches/user32-Key_State/definition +++ b/patches/user32-Key_State/definition @@ -1 +1,2 @@ Fixes: [29871] Invalidate key state cache globally after calling LL hooks +Depends: user32-user_thread_info diff --git a/patches/user32-user_thread_info/0001-user32-Fix-padding-in-user_thread_info-structure.patch b/patches/user32-user_thread_info/0001-user32-Fix-padding-in-user_thread_info-structure.patch new file mode 100644 index 00000000..4f5f16db --- /dev/null +++ b/patches/user32-user_thread_info/0001-user32-Fix-padding-in-user_thread_info-structure.patch @@ -0,0 +1,35 @@ +From d9c7dc0ec91492b7e57682ea3ddb10feaffcc18b Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 21 Mar 2015 04:22:10 +0100 +Subject: user32: Fix padding in user_thread_info structure. + +--- + dlls/user32/user_private.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h +index adf3f7d..c389414 100644 +--- a/dlls/user32/user_private.h ++++ b/dlls/user32/user_private.h +@@ -169,6 +169,7 @@ struct wm_char_mapping_data + + /* this is the structure stored in TEB->Win32ClientInfo */ + /* no attempt is made to keep the layout compatible with the Windows one */ ++#include + struct user_thread_info + { + HANDLE server_queue; /* Handle to server-side queue */ +@@ -190,8 +191,9 @@ struct user_thread_info + HWND msg_window; /* HWND_MESSAGE parent window */ + RAWINPUT *rawinput; + +- ULONG pad[6]; /* Available for more data */ ++ ULONG pad[5]; /* Available for more data */ + }; ++#include + + struct hook_extra_info + { +-- +2.3.2 +