diff --git a/README.md b/README.md index c575fe6d..d92018af 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ for more details.* * Add stub for D3DXComputeTangentFrameEx ([Wine Bug #31984](https://bugs.winehq.org/show_bug.cgi?id=31984)) * Add stub for D3DXIntersect * Add stub for NtSetLdtEntries/ZwSetLdtEntries ([Wine Bug #26268](https://bugs.winehq.org/show_bug.cgi?id=26268)) -* Add stub for PowerCreateRequest +* ~~Add stub for PowerCreateRequest~~ * Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163)) * Add stub for ntoskrnl.ExAcquireResourceExclusiveLite * Add stub for ntoskrnl.ExDeleteResourceLite @@ -71,7 +71,7 @@ for more details.* * Add stub for setupapi.SetupDiSelectBestCompatDrv ([Wine Bug #32088](https://bugs.winehq.org/show_bug.cgi?id=32088)) * Add stub for wininet.ParseX509EncodedCertificateForListBoxEntry ([Wine Bug #29842](https://bugs.winehq.org/show_bug.cgi?id=29842)) * Add stubs for D3DXCreateAnimationController interface -* Add stubs for Power[Set|Clear]Request +* ~~Add stubs for Power[Set|Clear]Request~~ * Add support for CopyFileEx progress callback ([Wine Bug #22692](https://bugs.winehq.org/show_bug.cgi?id=22692)) * Add support for GetPropValue to PulseAudio backend * Adobe Reader needs ITextSelection_fnGetDuplicate implementation @@ -99,7 +99,7 @@ for more details.* * Do not append duplicate NULL characters when importing keys with regedit ([Wine Bug #37575](https://bugs.winehq.org/show_bug.cgi?id=37575)) * Do not fail when a used context is passed to wglShareLists ([Wine Bug #11436](https://bugs.winehq.org/show_bug.cgi?id=11436)) * ~~Don't return an error in WS_select when EINTR happens during timeout~~ -* EA Origin needs support for job objects ([Wine Bug #33723](https://bugs.winehq.org/show_bug.cgi?id=33723)) +* ~~EA Origin needs support for job objects~~ ([Wine Bug #33723](https://bugs.winehq.org/show_bug.cgi?id=33723)) * Emulate access to KI_USER_SHARED_DATA kernel page on x86_64 ([Wine Bug #33849](https://bugs.winehq.org/show_bug.cgi?id=33849)) * Enforce that surfaces are flushed after ReleaseDC * Ensure NtProtectVirtualMemory and NtCreateSection are on separate pages ([Wine Bug #33162](https://bugs.winehq.org/show_bug.cgi?id=33162)) @@ -153,7 +153,7 @@ for more details.* * Hearthstone fails to start ([Wine Bug #36216](https://bugs.winehq.org/show_bug.cgi?id=36216)) * IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests ([Wine Bug #37767](https://bugs.winehq.org/show_bug.cgi?id=37767)) * Ignore unsupported flags for CoInternetSetFeatureEnabled ([Wine Bug #35197](https://bugs.winehq.org/show_bug.cgi?id=35197)) -* Ignore unsupported job object restrictions ([Wine Bug #38351](https://bugs.winehq.org/show_bug.cgi?id=38351)) +* ~~Ignore unsupported job object restrictions~~ ([Wine Bug #38351](https://bugs.winehq.org/show_bug.cgi?id=38351)) * Implement D3DXGetShaderOutputSemantics * Implement DDENUMSURFACES_CANBECREATED in IDirectDraw7::EnumSurfaces ([Wine Bug #17233](https://bugs.winehq.org/show_bug.cgi?id=17233)) * Implement ID3DXEffect::FindNextValidTechnique ([Wine Bug #34101](https://bugs.winehq.org/show_bug.cgi?id=34101)) @@ -183,7 +183,7 @@ for more details.* * Improve stubs for AEV_{Get,Set}Mute * Improvement for heap allocation performance * Increase wineconsole commandline buffer size ([Wine Bug #34814](https://bugs.winehq.org/show_bug.cgi?id=34814)) -* Invalidate key state cache globally after calling LL hooks ([Wine Bug #29871](https://bugs.winehq.org/show_bug.cgi?id=29871)) +* ~~Invalidate key state cache globally after calling LL hooks~~ ([Wine Bug #29871](https://bugs.winehq.org/show_bug.cgi?id=29871)) * Jedi Knight: Dark Forces II crashes with winmm set to native ([Wine Bug #37983](https://bugs.winehq.org/show_bug.cgi?id=37983)) * Lego Stunt Rally requires DXTn software de/encoding support ([Wine Bug #25486](https://bugs.winehq.org/show_bug.cgi?id=25486)) * Lockfree algorithm for filedescriptor cache (improves file access speed) @@ -199,7 +199,7 @@ for more details.* * Prevent window managers from grouping all wine programs together ([Wine Bug #32699](https://bugs.winehq.org/show_bug.cgi?id=32699)) * Process APC calls before starting process * Process Hacker 2.x needs ntoskrnl.ProbeForRead ([Wine Bug #38103](https://bugs.winehq.org/show_bug.cgi?id=38103)) -* Properly track handle count of wineserver objects +* ~~Properly track handle count of wineserver objects~~ * Python PIP needs better NtQueryInformationJobObject stub * Reduced SetTimer minimum value from 10 ms to 5 ms (improves Silverlight framerates) * Return an error when trying to open a terminated process ([Wine Bug #37087](https://bugs.winehq.org/show_bug.cgi?id=37087)) diff --git a/debian/changelog b/debian/changelog index c6f09084..5d688b03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ wine-staging (1.7.41) UNRELEASED; urgency=low * Removed patches to allow NULL pointer as keystate in ToUnicodeEx (accepted upstream). * Removed patches to avoid returning an error in WS_select when EINTR happens during timeout (accepted upstream). * Partially remove advapi32-Revert_DACL patches. + * Removed additional patches for job object support (accepted upstream). + * Removed patchset to invalidate the key state cache after calling LL hooks (accepted upstream). + * Removed patches for PowerRequest stub functions (accepted upstream). -- Sebastian Lackner Sun, 05 Apr 2015 03:11:58 +0200 wine-staging (1.7.40) unstable; urgency=low diff --git a/patches/kernel32-PowerRequest/0001-kernel32-Add-stub-for-PowerCreateRequest.patch b/patches/kernel32-PowerRequest/0001-kernel32-Add-stub-for-PowerCreateRequest.patch deleted file mode 100644 index 81cc3dc1..00000000 --- a/patches/kernel32-PowerRequest/0001-kernel32-Add-stub-for-PowerCreateRequest.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 79d38918a2d7a45de932c0f9b04a6b5c40d1303b Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 15 Mar 2015 01:44:12 +0100 -Subject: kernel32: Add stub for PowerCreateRequest. - ---- - dlls/kernel32/kernel32.spec | 2 +- - dlls/kernel32/powermgnt.c | 11 +++++++++++ - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index c95c446..df5b505 100644 ---- a/dlls/kernel32/kernel32.spec -+++ b/dlls/kernel32/kernel32.spec -@@ -1135,7 +1135,7 @@ - @ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) - @ stdcall PostQueuedCompletionStatus(long long ptr ptr) - # @ stub PowerClearRequest --# @ stub PowerCreateRequest -+@ stdcall PowerCreateRequest(ptr) - # @ stub PowerSetRequest - @ stdcall PrepareTape(ptr long long) - @ stub PrivCopyFileExW -diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c -index 6d4336d..74ec397 100644 ---- a/dlls/kernel32/powermgnt.c -+++ b/dlls/kernel32/powermgnt.c -@@ -100,3 +100,14 @@ EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags) - current = flags; - return old; - } -+ -+/*********************************************************************** -+ * PowerCreateRequest (KERNEL32.@) -+ */ -+HANDLE WINAPI PowerCreateRequest(REASON_CONTEXT *context) -+{ -+ FIXME("(%p): stub\n", context); -+ -+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -+ return INVALID_HANDLE_VALUE; -+} --- -2.3.2 - diff --git a/patches/kernel32-PowerRequest/0002-kernel32-Add-stubs-for-Power-Set-Clear-Request.patch b/patches/kernel32-PowerRequest/0002-kernel32-Add-stubs-for-Power-Set-Clear-Request.patch deleted file mode 100644 index 67aee251..00000000 --- a/patches/kernel32-PowerRequest/0002-kernel32-Add-stubs-for-Power-Set-Clear-Request.patch +++ /dev/null @@ -1,77 +0,0 @@ -From cebca02c89236793ddfbab05adf8dd557b9c6ae4 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 27 Mar 2015 06:59:11 +0100 -Subject: kernel32: Add stubs for Power{Set,Clear}Request. - ---- - dlls/kernel32/kernel32.spec | 4 ++-- - dlls/kernel32/powermgnt.c | 22 ++++++++++++++++++++++ - include/winbase.h | 6 ++++++ - 3 files changed, 30 insertions(+), 2 deletions(-) - -diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index fd1d625..0b90e3c 100644 ---- a/dlls/kernel32/kernel32.spec -+++ b/dlls/kernel32/kernel32.spec -@@ -1134,9 +1134,9 @@ - @ stdcall PeekConsoleInputW(ptr ptr long ptr) - @ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) - @ stdcall PostQueuedCompletionStatus(long long ptr ptr) --# @ stub PowerClearRequest -+@ stdcall PowerClearRequest(ptr long) - @ stdcall PowerCreateRequest(ptr) --# @ stub PowerSetRequest -+@ stdcall PowerSetRequest(ptr long) - @ stdcall PrepareTape(ptr long long) - @ stub PrivCopyFileExW - @ stub PrivMoveFileIdentityW -diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c -index 74ec397..b5bd0d9 100644 ---- a/dlls/kernel32/powermgnt.c -+++ b/dlls/kernel32/powermgnt.c -@@ -111,3 +111,25 @@ HANDLE WINAPI PowerCreateRequest(REASON_CONTEXT *context) - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return INVALID_HANDLE_VALUE; - } -+ -+/*********************************************************************** -+ * PowerSetRequest (KERNEL32.@) -+ */ -+BOOL WINAPI PowerSetRequest(HANDLE request, POWER_REQUEST_TYPE type) -+{ -+ FIXME("(%p, %u): stub\n", request, type); -+ -+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -+ return FALSE; -+} -+ -+/*********************************************************************** -+ * PowerClearRequest (KERNEL32.@) -+ */ -+BOOL WINAPI PowerClearRequest(HANDLE request, POWER_REQUEST_TYPE type) -+{ -+ FIXME("(%p, %u): stub\n", request, type); -+ -+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -+ return FALSE; -+} -diff --git a/include/winbase.h b/include/winbase.h -index 58ed07c..6683312 100644 ---- a/include/winbase.h -+++ b/include/winbase.h -@@ -865,6 +865,12 @@ typedef struct _SYSTEM_POWER_STATUS - DWORD BatteryFullLifeTime; - } SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS; - -+typedef enum _POWER_REQUEST_TYPE -+{ -+ PowerRequestDisplayRequired, -+ PowerRequestSystemRequired, -+ PowerRequestAwayModeRequired -+} POWER_REQUEST_TYPE, *PPOWER_REQUEST_TYPE; - - typedef struct _SYSTEM_INFO - { --- -2.3.3 - diff --git a/patches/kernel32-PowerRequest/definition b/patches/kernel32-PowerRequest/definition deleted file mode 100644 index 37a0a0dd..00000000 --- a/patches/kernel32-PowerRequest/definition +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: Add stub for PowerCreateRequest -Fixes: Add stubs for Power[Set|Clear]Request diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 82a2afe2..1d4389f6 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -119,7 +119,6 @@ patch_enable_all () enable_kernel32_GetVolumePathName="$1" enable_kernel32_Named_Pipe="$1" enable_kernel32_NeedCurrentDirectoryForExePath="$1" - enable_kernel32_PowerRequest="$1" enable_kernel32_Profile="$1" enable_kernel32_SetFileInformationByHandle="$1" enable_kernel32_VerifyVersionInfo="$1" @@ -203,7 +202,6 @@ patch_enable_all () enable_user32_DrawTextExW="$1" enable_user32_GetRawInputDeviceList="$1" enable_user32_GetSystemMetrics="$1" - enable_user32_Key_State="$1" enable_user32_Mouse_Message_Hwnd="$1" enable_user32_Painting="$1" enable_user32_ScrollWindowEx="$1" @@ -424,9 +422,6 @@ patch_enable () kernel32-NeedCurrentDirectoryForExePath) enable_kernel32_NeedCurrentDirectoryForExePath="$2" ;; - kernel32-PowerRequest) - enable_kernel32_PowerRequest="$2" - ;; kernel32-Profile) enable_kernel32_Profile="$2" ;; @@ -676,9 +671,6 @@ patch_enable () user32-GetSystemMetrics) enable_user32_GetSystemMetrics="$2" ;; - user32-Key_State) - enable_user32_Key_State="$2" - ;; user32-Mouse_Message_Hwnd) enable_user32_Mouse_Message_Hwnd="$2" ;; @@ -1055,15 +1047,11 @@ if test "$enable_server_Shared_Memory" -eq 1; then if test "$enable_server_PeekMessage" -gt 1; then abort "Patchset server-PeekMessage disabled, but server-Shared_Memory depends on that." fi - if test "$enable_user32_Key_State" -gt 1; then - abort "Patchset user32-Key_State disabled, but server-Shared_Memory depends on that." - fi enable_dinput_Events=1 enable_ntdll_Threading=1 enable_server_ClipCursor=1 enable_server_Key_State=1 enable_server_PeekMessage=1 - enable_user32_Key_State=1 fi if test "$enable_server_JobObjects" -eq 1; then @@ -1975,6 +1963,42 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-UnhandledBlendFactor +# | +# | Modified files: +# | * dlls/wined3d/state.c +# | +if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then + patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset wined3d-resource_check_usage +# | +# | Modified files: +# | * dlls/wined3d/resource.c +# | +if test "$enable_wined3d_resource_check_usage" -eq 1; then + patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch + ( + echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; + ) >> "$patchlist" +fi + +# Patchset wined3d-wined3d_swapchain_present +# | +# | Modified files: +# | * dlls/wined3d/swapchain.c +# | +if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then + patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-Multisampling # | # | This patchset fixes the following Wine bugs: @@ -2024,42 +2048,6 @@ if test "$enable_wined3d_Revert_PixelFormat" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-UnhandledBlendFactor -# | -# | Modified files: -# | * dlls/wined3d/state.c -# | -if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then - patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch - ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset wined3d-resource_check_usage -# | -# | Modified files: -# | * dlls/wined3d/resource.c -# | -if test "$enable_wined3d_resource_check_usage" -eq 1; then - patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch - ( - echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; - ) >> "$patchlist" -fi - -# Patchset wined3d-wined3d_swapchain_present -# | -# | Modified files: -# | * dlls/wined3d/swapchain.c -# | -if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then - patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch - ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-CSMT_Main # | # | This patchset fixes the following Wine bugs: @@ -2881,20 +2869,6 @@ if test "$enable_kernel32_NeedCurrentDirectoryForExePath" -eq 1; then ) >> "$patchlist" fi -# Patchset kernel32-PowerRequest -# | -# | Modified files: -# | * dlls/kernel32/kernel32.spec, dlls/kernel32/powermgnt.c, include/winbase.h -# | -if test "$enable_kernel32_PowerRequest" -eq 1; then - patch_apply kernel32-PowerRequest/0001-kernel32-Add-stub-for-PowerCreateRequest.patch - patch_apply kernel32-PowerRequest/0002-kernel32-Add-stubs-for-Power-Set-Clear-Request.patch - ( - echo '+ { "Sebastian Lackner", "kernel32: Add stub for PowerCreateRequest.", 1 },'; - echo '+ { "Sebastian Lackner", "kernel32: Add stubs for Power{Set,Clear}Request.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-Profile # | # | This patchset fixes the following Wine bugs: @@ -3863,21 +3837,6 @@ if test "$enable_server_CreateProcess_ACLs" -eq 1; then ) >> "$patchlist" fi -# Patchset server-OpenProcess -# | -# | This patchset fixes the following Wine bugs: -# | * [#37087] Return an error when trying to open a terminated process -# | -# | Modified files: -# | * server/process.c, server/process.h -# | -if test "$enable_server_OpenProcess" -eq 1; then - patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch - ( - echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },'; - ) >> "$patchlist" -fi - # Patchset server-Misc_ACL # | # | This patchset fixes the following Wine bugs: @@ -3895,26 +3854,31 @@ if test "$enable_server_Misc_ACL" -eq 1; then ) >> "$patchlist" fi -# Patchset server-JobObjects +# Patchset server-OpenProcess # | # | This patchset fixes the following Wine bugs: -# | * [#33723] EA Origin needs support for job objects -# | * [#38351] Ignore unsupported job object restrictions +# | * [#37087] Return an error when trying to open a terminated process # | # | Modified files: -# | * dlls/kernel32/tests/process.c, dlls/ntdll/sync.c, server/process.c, server/process.h, server/protocol.def +# | * server/process.c, server/process.h +# | +if test "$enable_server_OpenProcess" -eq 1; then + patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch + ( + echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },'; + ) >> "$patchlist" +fi + +# Patchset server-JobObjects +# | +# | Modified files: +# | * dlls/kernel32/tests/process.c, dlls/ntdll/sync.c, server/process.c # | if test "$enable_server_JobObjects" -eq 1; then - patch_apply server-JobObjects/0001-server-Implement-remaining-wineserver-calls-for-job-.patch - patch_apply server-JobObjects/0002-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch - patch_apply server-JobObjects/0003-kernel32-tests-Add-tests-for-waiting-on-an-job-objec.patch - patch_apply server-JobObjects/0004-server-Implement-waiting-for-job-objects.patch - patch_apply server-JobObjects/0005-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch + patch_apply server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch + patch_apply server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch ( - echo '+ { "Andrew Cook", "server: Implement remaining wineserver calls for job objects.", 1 },'; echo '+ { "Andrew Cook", "server: Implement JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.", 1 },'; - echo '+ { "Sebastian Lackner", "kernel32/tests: Add tests for waiting on an job object.", 1 },'; - echo '+ { "Sebastian Lackner", "server: Implement waiting for job objects.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: Implement NtQueryInformationJobObject stub function.", 1 },'; ) >> "$patchlist" fi @@ -3965,28 +3929,13 @@ if test "$enable_server_Realtime_Priority" -eq 1; then ) >> "$patchlist" fi -# Patchset user32-Key_State -# | -# | This patchset fixes the following Wine bugs: -# | * [#29871] Invalidate key state cache globally after calling LL hooks -# | -# | Modified files: -# | * dlls/user32/hook.c, dlls/user32/input.c, dlls/user32/message.c, dlls/user32/user_private.h -# | -if test "$enable_user32_Key_State" -eq 1; then - patch_apply user32-Key_State/0001-user32-After-calling-LL-hooks-the-key-state-cache-ha.patch - ( - echo '+ { "Sebastian Lackner", "user32: After calling LL hooks the key state cache has to be invalidated globally.", 1 },'; - ) >> "$patchlist" -fi - # Patchset server-Shared_Memory # | # | Modified files: # | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/server.c, dlls/ntdll/thread.c, dlls/ntdll/virtual.c, dlls/user32/focus.c, -# | dlls/user32/input.c, dlls/user32/message.c, dlls/user32/user_private.h, dlls/user32/winstation.c, include/wine/server.h, -# | include/winternl.h, server/fd.c, server/file.h, server/main.c, server/mapping.c, server/protocol.def, server/queue.c, -# | server/thread.c, server/thread.h +# | dlls/user32/input.c, dlls/user32/message.c, dlls/user32/user_private.h, include/wine/server.h, include/winternl.h, +# | server/fd.c, server/file.h, server/main.c, server/mapping.c, server/protocol.def, server/queue.c, server/thread.c, +# | server/thread.h # | if test "$enable_server_Shared_Memory" -eq 1; then patch_apply server-Shared_Memory/0001-ntdll-Implement-virtual_map_shared_memory.patch @@ -3995,10 +3944,9 @@ if test "$enable_server_Shared_Memory" -eq 1; then patch_apply server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch patch_apply server-Shared_Memory/0005-user32-Get-rid-of-wineserver-call-for-GetLastInputIn.patch patch_apply server-Shared_Memory/0006-ntdll-Only-enable-wineserver-shared-memory-communica.patch - patch_apply server-Shared_Memory/0007-user32-Move-key_state-cache-into-separate-structure.patch - patch_apply server-Shared_Memory/0008-server-Store-a-list-of-associated-queues-for-each-th.patch - patch_apply server-Shared_Memory/0009-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch - patch_apply server-Shared_Memory/0010-user32-Cache-the-result-of-GetForegroundWindow.patch + patch_apply server-Shared_Memory/0007-server-Store-a-list-of-associated-queues-for-each-th.patch + patch_apply server-Shared_Memory/0008-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch + patch_apply server-Shared_Memory/0009-user32-Cache-the-result-of-GetForegroundWindow.patch ( echo '+ { "Sebastian Lackner", "ntdll: Implement virtual_map_shared_memory.", 1 },'; echo '+ { "Michael Müller", "server: Implement support for global and local shared memory blocks based on memfd.", 1 },'; @@ -4006,7 +3954,6 @@ if test "$enable_server_Shared_Memory" -eq 1; then echo '+ { "Sebastian Lackner", "user32: Avoid unnecessary wineserver calls in PeekMessage/GetMessage.", 1 },'; echo '+ { "Michael Müller", "user32: Get rid of wineserver call for GetLastInputInfo.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: Only enable wineserver shared memory communication when a special environment variable is set.", 1 },'; - echo '+ { "Sebastian Lackner", "user32: Move key_state cache into separate structure.", 1 },'; echo '+ { "Sebastian Lackner", "server: Store a list of associated queues for each thread input.", 1 },'; echo '+ { "Sebastian Lackner", "user32: Get rid of wineserver call for GetActiveWindow, GetFocus, GetCapture.", 1 },'; echo '+ { "Sebastian Lackner", "user32: Cache the result of GetForegroundWindow.", 1 },'; diff --git a/patches/server-JobObjects/0002-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch b/patches/server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch similarity index 86% rename from patches/server-JobObjects/0002-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch rename to patches/server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch index c74716fe..bdb7325e 100644 --- a/patches/server-JobObjects/0002-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch +++ b/patches/server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch @@ -1,4 +1,4 @@ -From e70c80c4f78ac6306629d79f86d8c1c5439aaa17 Mon Sep 17 00:00:00 2001 +From 23d528b7e744e69fa5d857be20f188ce5510c088 Mon Sep 17 00:00:00 2001 From: Andrew Cook Date: Thu, 26 Feb 2015 13:10:41 +1100 Subject: server: Implement JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. @@ -9,10 +9,10 @@ Subject: server: Implement JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c -index a86e331..4f51cea 100644 +index c63d6b1..5e04836 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c -@@ -2449,7 +2449,6 @@ static void test_KillOnJobClose(void) +@@ -2435,7 +2435,6 @@ static void test_KillOnJobClose(void) CloseHandle(job); dwret = WaitForSingleObject(pi.hProcess, 1000); @@ -21,10 +21,10 @@ index a86e331..4f51cea 100644 if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0); diff --git a/server/process.c b/server/process.c -index 10193ef..89c029e 100644 +index 569a8fe..38bd977 100644 --- a/server/process.c +++ b/server/process.c -@@ -141,6 +141,7 @@ static void job_dump( struct object *obj, int verbose ); +@@ -140,6 +140,7 @@ static void job_dump( struct object *obj, int verbose ); static struct object_type *job_get_type( struct object *obj ); static int job_signaled( struct object *obj, struct wait_queue_entry *entry ); static unsigned int job_map_access( struct object *obj, unsigned int access ); @@ -41,8 +41,8 @@ index 10193ef..89c029e 100644 job_destroy /* destroy */ }; -@@ -286,6 +287,20 @@ static void terminate_job( struct job *job, int exit_code ) - job->terminating = 0; +@@ -287,6 +288,20 @@ static void terminate_job( struct job *job, int exit_code ) + wake_up( &job->obj, 0 ); } +static int job_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) @@ -63,5 +63,5 @@ index 10193ef..89c029e 100644 { struct job *job = (struct job *)obj; -- -2.3.3 +2.3.5 diff --git a/patches/server-JobObjects/0001-server-Implement-remaining-wineserver-calls-for-job-.patch b/patches/server-JobObjects/0001-server-Implement-remaining-wineserver-calls-for-job-.patch deleted file mode 100644 index be3c5f45..00000000 --- a/patches/server-JobObjects/0001-server-Implement-remaining-wineserver-calls-for-job-.patch +++ /dev/null @@ -1,202 +0,0 @@ -From f478d1b97efc4fe63f8ccc01a2ab214c0bffc579 Mon Sep 17 00:00:00 2001 -From: Andrew Cook -Date: Thu, 26 Feb 2015 12:25:23 +1100 -Subject: server: Implement remaining wineserver calls for job objects. - ---- - dlls/kernel32/tests/process.c | 2 -- - dlls/ntdll/sync.c | 29 +++++++++++++++++++++++++---- - server/process.c | 40 +++++++++++++++++++++++++++++++++++++++- - server/process.h | 1 + - server/protocol.def | 7 +++++++ - 5 files changed, 72 insertions(+), 7 deletions(-) - -diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c -index 44e81ba..a86e331 100644 ---- a/dlls/kernel32/tests/process.c -+++ b/dlls/kernel32/tests/process.c -@@ -2269,13 +2269,11 @@ static void test_TerminateJobObject(void) - ok(ret, "TerminateJobObject error %u\n", GetLastError()); - - dwret = WaitForSingleObject(pi.hProcess, 1000); -- todo_wine - ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); - if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0); - - ret = GetExitCodeProcess(pi.hProcess, &dwret); - ok(ret, "GetExitCodeProcess error %u\n", GetLastError()); -- todo_wine - ok(dwret == 123 || broken(dwret == 0) /* randomly fails on Win 2000 / XP */, - "wrong exitcode %u\n", dwret); - -diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c -index a4df88a..400aa7d 100644 ---- a/dlls/ntdll/sync.c -+++ b/dlls/ntdll/sync.c -@@ -56,6 +56,7 @@ - #include "wine/server.h" - #include "wine/debug.h" - #include "ntdll_misc.h" -+#include "winnt.h" - - WINE_DEFAULT_DEBUG_CHANNEL(ntdll); - -@@ -613,8 +614,19 @@ NTSTATUS WINAPI NtOpenJobObject( PHANDLE handle, ACCESS_MASK access, const OBJEC - */ - NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) - { -- FIXME( "stub: %p %x\n", handle, status ); -- return STATUS_SUCCESS; -+ NTSTATUS ret; -+ -+ TRACE( "(%p, %d)\n", handle, status ); -+ -+ SERVER_START_REQ( terminate_job ) -+ { -+ req->handle = wine_server_obj_handle( handle ); -+ req->status = status; -+ ret = wine_server_call( req ); -+ } -+ SERVER_END_REQ; -+ -+ return ret; - } - - /****************************************************************************** -@@ -624,8 +636,17 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) - NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, - ULONG len, PULONG ret_len ) - { -- FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); -- return STATUS_NOT_IMPLEMENTED; -+ TRACE( "%p %u %p %u %p\n", handle, class, info, len, ret_len ); -+ -+ if (class >= MaxJobObjectInfoClass) -+ return STATUS_INVALID_PARAMETER; -+ -+ switch (class) -+ { -+ default: -+ FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); -+ return STATUS_NOT_IMPLEMENTED; -+ } - } - - /****************************************************************************** -diff --git a/server/process.c b/server/process.c -index 5821435..727a682 100644 ---- a/server/process.c -+++ b/server/process.c -@@ -65,6 +65,7 @@ static unsigned int process_map_access( struct object *obj, unsigned int access - static struct security_descriptor *process_get_sd( struct object *obj ); - static void process_poll_event( struct fd *fd, int event ); - static void process_destroy( struct object *obj ); -+static void terminate_process( struct process *process, struct thread *skip, int exit_code ); - - static const struct object_ops process_ops = - { -@@ -148,6 +149,7 @@ struct job - struct list process_list; /* list of all processes */ - int num_processes; /* count of running processes */ - unsigned int limit_flags; /* limit flags */ -+ int terminating; /* job is terminating */ - struct completion *completion_port; /* associated completion port */ - apc_param_t completion_key; /* key to send with completion messages */ - }; -@@ -189,6 +191,7 @@ static struct job *create_job_object( struct directory *root, const struct unico - list_init( &job->process_list ); - job->num_processes = 0; - job->limit_flags = 0; -+ job->terminating = 0; - job->completion_port = NULL; - job->completion_key = 0; - } -@@ -252,12 +255,36 @@ static void release_job_process( struct process *process ) - assert( job->num_processes ); - job->num_processes--; - -- add_job_completion( job, JOB_OBJECT_MSG_EXIT_PROCESS, get_process_id(process) ); -+ if (!job->terminating) -+ add_job_completion( job, JOB_OBJECT_MSG_EXIT_PROCESS, get_process_id(process) ); - - if (!job->num_processes) - add_job_completion( job, JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO, 0 ); - } - -+static void terminate_job( struct job *job, int exit_code ) -+{ -+ /* Windows doesn't report completion events for processes -+ * terminated by TerminateProcess, we do the same */ -+ job->terminating = 1; -+ -+ for (;;) /* restart from the beginning of the list every time */ -+ { -+ struct process *process; -+ -+ /* find the first process associcated with this job and still running */ -+ LIST_FOR_EACH_ENTRY( process, &job->process_list, struct process, job_entry ) -+ { -+ if (process->running_threads) break; -+ } -+ if (&process->job_entry == &job->process_list) break; /* no process found */ -+ assert( process->job == job ); -+ terminate_process( process, NULL, exit_code ); -+ } -+ -+ job->terminating = 0; -+} -+ - static void job_destroy( struct object *obj ) - { - struct job *job = (struct job *)obj; -@@ -1596,6 +1623,17 @@ DECL_HANDLER(process_in_job) - release_object( process ); - } - -+/* terminate all processes associated with the job */ -+DECL_HANDLER(terminate_job) -+{ -+ struct job *job = get_job_obj( current->process, req->handle, JOB_OBJECT_TERMINATE ); -+ -+ if (!job) return; -+ -+ terminate_job( job, req->status ); -+ release_object( job ); -+} -+ - /* update limits of the job object */ - DECL_HANDLER(set_job_limits) - { -diff --git a/server/process.h b/server/process.h -index 0cf9514..ae83b0e 100644 ---- a/server/process.h -+++ b/server/process.h -@@ -26,6 +26,7 @@ - struct atom_table; - struct handle_table; - struct startup_info; -+struct job; - - /* process startup state */ - enum startup_state { STARTUP_IN_PROGRESS, STARTUP_DONE, STARTUP_ABORTED }; -diff --git a/server/protocol.def b/server/protocol.def -index 9199c7f..5ecc8d5 100644 ---- a/server/protocol.def -+++ b/server/protocol.def -@@ -3530,6 +3530,13 @@ enum coords_relative - @END - - -+/* Terminate all processes associated with the job */ -+@REQ(terminate_job) -+ obj_handle_t handle; /* handle to the job */ -+ int status; /* exitcode of the process */ -+@END -+ -+ - /* Set limit flags on a job */ - @REQ(set_job_limits) - obj_handle_t handle; /* handle to the job */ --- -2.3.3 - diff --git a/patches/server-JobObjects/0005-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch b/patches/server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch similarity index 66% rename from patches/server-JobObjects/0005-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch rename to patches/server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch index e2b2e116..dfba39a4 100644 --- a/patches/server-JobObjects/0005-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch +++ b/patches/server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch @@ -1,32 +1,31 @@ -From 55894316559d36c433e8aa8ae6e6957fa651d09a Mon Sep 17 00:00:00 2001 +From 32940d62072444eb41a918b27aae6e4b48fe555f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 12 Mar 2015 22:19:50 +0100 Subject: ntdll: Implement NtQueryInformationJobObject stub function. --- - dlls/ntdll/sync.c | 24 +++++++++++++++++++++++- - 1 file changed, 23 insertions(+), 1 deletion(-) + dlls/ntdll/sync.c | 31 ++++++++++++++++++++++++++++++- + 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c -index 87ff3e0..9a7a6d0 100644 +index 04c6de30..fb95460 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c -@@ -636,15 +636,37 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) +@@ -635,8 +635,37 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, ULONG len, PULONG ret_len ) { + JOBOBJECT_EXTENDED_LIMIT_INFORMATION *extended_limit; + JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit; + - TRACE( "%p %u %p %u %p\n", handle, class, info, len, ret_len ); - - if (class >= MaxJobObjectInfoClass) - return STATUS_INVALID_PARAMETER; - -+ FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); + FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); +- return STATUS_NOT_IMPLEMENTED; + - switch (class) - { ++ if (class >= MaxJobObjectInfoClass) ++ return STATUS_INVALID_PARAMETER; ++ ++ switch (class) ++ { + case JobObjectExtendedLimitInformation: + if (len < sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)) + return STATUS_INVALID_PARAMETER; @@ -45,11 +44,12 @@ index 87ff3e0..9a7a6d0 100644 + if (ret_len) *ret_len = sizeof(*basic_limit); + return STATUS_SUCCESS; + - default: -- FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); - return STATUS_NOT_IMPLEMENTED; - } ++ default: ++ return STATUS_NOT_IMPLEMENTED; ++ } } + + /****************************************************************************** -- -2.3.3 +2.3.5 diff --git a/patches/server-JobObjects/0003-kernel32-tests-Add-tests-for-waiting-on-an-job-objec.patch b/patches/server-JobObjects/0003-kernel32-tests-Add-tests-for-waiting-on-an-job-objec.patch deleted file mode 100644 index f90ece4a..00000000 --- a/patches/server-JobObjects/0003-kernel32-tests-Add-tests-for-waiting-on-an-job-objec.patch +++ /dev/null @@ -1,115 +0,0 @@ -From c86188e18efaf5ece7b4d85ccee4089208e392fa Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 28 Feb 2015 06:09:16 +0100 -Subject: kernel32/tests: Add tests for waiting on an job object. - ---- - dlls/kernel32/tests/process.c | 85 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 85 insertions(+) - -diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c -index 4f51cea..aaa1a6e 100644 ---- a/dlls/kernel32/tests/process.c -+++ b/dlls/kernel32/tests/process.c -@@ -2456,6 +2456,90 @@ static void test_KillOnJobClose(void) - CloseHandle(pi.hThread); - } - -+static void test_WaitForJobObject(void) -+{ -+ HANDLE job; -+ PROCESS_INFORMATION pi; -+ BOOL ret; -+ DWORD dwret; -+ -+ /* test waiting for a job object when the process is killed */ -+ job = pCreateJobObjectW(NULL, NULL); -+ ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); -+ -+ dwret = WaitForSingleObject(job, 100); -+ ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); -+ -+ create_process("wait", &pi); -+ -+ ret = pAssignProcessToJobObject(job, pi.hProcess); -+ ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); -+ -+ dwret = WaitForSingleObject(job, 100); -+ ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); -+ -+ ret = pTerminateJobObject(job, 123); -+ ok(ret, "TerminateJobObject error %u\n", GetLastError()); -+ -+ dwret = WaitForSingleObject(job, 500); -+ todo_wine -+ ok(dwret == WAIT_OBJECT_0 || broken(dwret == WAIT_TIMEOUT), -+ "WaitForSingleObject returned %u\n", dwret); -+ -+ if (dwret == WAIT_TIMEOUT) /* Win 2000/XP */ -+ { -+ CloseHandle(pi.hProcess); -+ CloseHandle(pi.hThread); -+ CloseHandle(job); -+ todo_wine -+ win_skip("TerminateJobObject doesn't signal job, skipping tests\n"); -+ return; -+ } -+ -+ /* the object is not reset immediately */ -+ dwret = WaitForSingleObject(job, 100); -+ ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); -+ -+ CloseHandle(pi.hProcess); -+ CloseHandle(pi.hThread); -+ -+ /* creating a new process doesn't reset the signalled state */ -+ create_process("wait", &pi); -+ -+ ret = pAssignProcessToJobObject(job, pi.hProcess); -+ ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); -+ -+ dwret = WaitForSingleObject(job, 100); -+ ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); -+ -+ ret = pTerminateJobObject(job, 123); -+ ok(ret, "TerminateJobObject error %u\n", GetLastError()); -+ -+ CloseHandle(pi.hProcess); -+ CloseHandle(pi.hThread); -+ -+ CloseHandle(job); -+ -+ /* repeat the test, but this time the process terminates properly */ -+ job = pCreateJobObjectW(NULL, NULL); -+ ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); -+ -+ dwret = WaitForSingleObject(job, 100); -+ ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); -+ -+ create_process("exit", &pi); -+ -+ ret = pAssignProcessToJobObject(job, pi.hProcess); -+ ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); -+ -+ dwret = WaitForSingleObject(job, 100); -+ ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); -+ -+ CloseHandle(pi.hProcess); -+ CloseHandle(pi.hThread); -+ CloseHandle(job); -+} -+ - static HANDLE test_AddSelfToJob(void) - { - HANDLE job; -@@ -2676,6 +2760,7 @@ START_TEST(process) - test_QueryInformationJobObject(); - test_CompletionPort(); - test_KillOnJobClose(); -+ test_WaitForJobObject(); - job = test_AddSelfToJob(); - test_jobInheritance(job); - test_BreakawayOk(job); --- -2.3.3 - diff --git a/patches/server-JobObjects/0004-server-Implement-waiting-for-job-objects.patch b/patches/server-JobObjects/0004-server-Implement-waiting-for-job-objects.patch deleted file mode 100644 index 80e485de..00000000 --- a/patches/server-JobObjects/0004-server-Implement-waiting-for-job-objects.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6e6cd9108a8f3c0b9d158ac2605e9b0a08b19c71 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 28 Feb 2015 06:58:48 +0100 -Subject: server: Implement waiting for job objects. - ---- - dlls/kernel32/tests/process.c | 2 -- - server/process.c | 7 ++++++- - 2 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c -index aaa1a6e..c325d32 100644 ---- a/dlls/kernel32/tests/process.c -+++ b/dlls/kernel32/tests/process.c -@@ -2482,7 +2482,6 @@ static void test_WaitForJobObject(void) - ok(ret, "TerminateJobObject error %u\n", GetLastError()); - - dwret = WaitForSingleObject(job, 500); -- todo_wine - ok(dwret == WAIT_OBJECT_0 || broken(dwret == WAIT_TIMEOUT), - "WaitForSingleObject returned %u\n", dwret); - -@@ -2491,7 +2490,6 @@ static void test_WaitForJobObject(void) - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - CloseHandle(job); -- todo_wine - win_skip("TerminateJobObject doesn't signal job, skipping tests\n"); - return; - } -diff --git a/server/process.c b/server/process.c -index 3ff0be5..f59fe2b 100644 ---- a/server/process.c -+++ b/server/process.c -@@ -151,6 +151,7 @@ struct job - int num_processes; /* count of running processes */ - unsigned int limit_flags; /* limit flags */ - int terminating; /* job is terminating */ -+ int signaled; /* job is signaled */ - struct completion *completion_port; /* associated completion port */ - apc_param_t completion_key; /* key to send with completion messages */ - }; -@@ -193,6 +194,7 @@ static struct job *create_job_object( struct directory *root, const struct unico - job->num_processes = 0; - job->limit_flags = 0; - job->terminating = 0; -+ job->signaled = 0; - job->completion_port = NULL; - job->completion_key = 0; - } -@@ -284,6 +286,8 @@ static void terminate_job( struct job *job, int exit_code ) - } - - job->terminating = 0; -+ job->signaled = 1; -+ wake_up( &job->obj, 0 ); - } - - static int job_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) -@@ -320,7 +324,8 @@ static void job_dump( struct object *obj, int verbose ) - - static int job_signaled( struct object *obj, struct wait_queue_entry *entry ) - { -- return 0; -+ struct job *job = (struct job *)obj; -+ return job->signaled; - } - - struct ptid_entry --- -2.3.3 - diff --git a/patches/server-JobObjects/definition b/patches/server-JobObjects/definition index c59528aa..14eaa87e 100644 --- a/patches/server-JobObjects/definition +++ b/patches/server-JobObjects/definition @@ -1,7 +1,4 @@ -Fixes: [33723] EA Origin needs support for job objects -Fixes: Properly track handle count of wineserver objects Fixes: Python PIP needs better NtQueryInformationJobObject stub -Fixes: [38351] Ignore unsupported job object restrictions Depends: kernel32-Console_Handles Depends: server-OpenProcess Depends: server-Misc_ACL diff --git a/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch b/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch index 416705bd..ca51cc87 100644 --- a/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch +++ b/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch @@ -1,20 +1,20 @@ -From 977d05dff239899b548e170055e2a38ee16d5fd6 Mon Sep 17 00:00:00 2001 +From f06a13e553d543e7b49c805b9292611ab1c68371 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Wed, 25 Jun 2014 11:49:12 -0600 Subject: server: Add default security descriptor ownership for processes. --- - dlls/advapi32/tests/security.c | 35 +++++++++++++++++++++++++++++++++++ - server/process.c | 26 +++++++++++++++++++++++++- - server/security.h | 1 + - server/token.c | 8 ++++++++ + dlls/advapi32/tests/security.c | 35 +++++++++++++++++++++++++++++++++++ + server/process.c | 26 +++++++++++++++++++++++++- + server/security.h | 1 + + server/token.c | 8 ++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index 05da0ae..2fb57c4 100644 +index 466100d..ca4a8ad 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -3853,11 +3853,15 @@ static void test_acls(void) +@@ -4253,11 +4253,15 @@ static void test_acls(void) static void test_GetSecurityInfo(void) { @@ -30,7 +30,7 @@ index 05da0ae..2fb57c4 100644 ACL_SIZE_INFORMATION acl_size; PSECURITY_DESCRIPTOR pSD; ACCESS_ALLOWED_ACE *ace; -@@ -3982,6 +3986,37 @@ static void test_GetSecurityInfo(void) +@@ -4382,6 +4386,37 @@ static void test_GetSecurityInfo(void) } LocalFree(pSD); CloseHandle(obj); @@ -69,7 +69,7 @@ index 05da0ae..2fb57c4 100644 static void test_GetSidSubAuthority(void) diff --git a/server/process.c b/server/process.c -index 7b9a3b2..01016d2 100644 +index 26f8924..1047c25 100644 --- a/server/process.c +++ b/server/process.c @@ -62,6 +62,7 @@ static int shutdown_stage; /* current stage in the shutdown process */ @@ -79,8 +79,8 @@ index 7b9a3b2..01016d2 100644 +static struct security_descriptor *process_get_sd( struct object *obj ); static void process_poll_event( struct fd *fd, int event ); static void process_destroy( struct object *obj ); - -@@ -77,7 +78,7 @@ static const struct object_ops process_ops = + static void terminate_process( struct process *process, struct thread *skip, int exit_code ); +@@ -78,7 +79,7 @@ static const struct object_ops process_ops = no_signal, /* signal */ no_get_fd, /* get_fd */ process_map_access, /* map_access */ @@ -89,7 +89,7 @@ index 7b9a3b2..01016d2 100644 default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ no_open_file, /* open_file */ -@@ -456,6 +457,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access +@@ -642,6 +643,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); } @@ -120,10 +120,10 @@ index 7b9a3b2..01016d2 100644 { struct process *process = get_fd_user( fd ); diff --git a/server/security.h b/server/security.h -index ab5f027..b9fbe6a 100644 +index 855f2e7..01bf637 100644 --- a/server/security.h +++ b/server/security.h -@@ -44,6 +44,7 @@ extern const PSID security_local_user_sid; +@@ -47,6 +47,7 @@ extern const PSID security_local_user_sid; extern const PSID security_local_system_sid; extern const PSID security_builtin_users_sid; extern const PSID security_builtin_admins_sid; @@ -158,5 +158,5 @@ index cb81eec..914dfba 100644 static luid_t prev_luid_value = { 1000, 0 }; -- -1.7.9.5 +2.3.5 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 395c715b..becfea71 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 31c45fb6cbf00ef56b370569e2079f681bb91cd1 Mon Sep 17 00:00:00 2001 +From 00f5e4db4532c964e1f6ada2d40ac9f21ba30c3e 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. @@ -9,7 +9,7 @@ Subject: user32: Avoid unnecessary wineserver calls in PeekMessage/GetMessage. 2 files changed, 14 insertions(+) diff --git a/dlls/user32/message.c b/dlls/user32/message.c -index c28a2fe..1afef9f 100644 +index e54ed92..dbfd427 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2740,6 +2740,18 @@ static BOOL peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags @@ -40,7 +40,7 @@ index c28a2fe..1afef9f 100644 { req->flags = flags; diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h -index 4380a00..47d0194 100644 +index 445fd40..1c87de4 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -184,6 +184,7 @@ struct user_thread_info @@ -48,9 +48,9 @@ index 4380a00..47d0194 100644 ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ UINT active_hooks; /* Bitmap of active hooks */ + DWORD last_get_msg; /* Last time of Get/PeekMessage call */ - UINT key_state_time; /* Time of last key state refresh */ - INT key_state_epoch; /* Counter to invalidate the key state */ - BYTE *key_state; /* Cache of global key state */ + struct user_key_state_info *key_state; /* Cache of global key state */ + HWND top_window; /* Desktop window */ + HWND msg_window; /* HWND_MESSAGE parent window */ -- -2.3.3 +2.3.5 diff --git a/patches/server-Shared_Memory/0008-server-Store-a-list-of-associated-queues-for-each-th.patch b/patches/server-Shared_Memory/0007-server-Store-a-list-of-associated-queues-for-each-th.patch similarity index 97% rename from patches/server-Shared_Memory/0008-server-Store-a-list-of-associated-queues-for-each-th.patch rename to patches/server-Shared_Memory/0007-server-Store-a-list-of-associated-queues-for-each-th.patch index 5e702097..dd3ecf0a 100644 --- a/patches/server-Shared_Memory/0008-server-Store-a-list-of-associated-queues-for-each-th.patch +++ b/patches/server-Shared_Memory/0007-server-Store-a-list-of-associated-queues-for-each-th.patch @@ -1,4 +1,4 @@ -From 94d2d107e2a3b1b09fdeaa1fdd179d955383f89d Mon Sep 17 00:00:00 2001 +From cb18df88215aa555e89a877ee5ede75706c170f9 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 21 Mar 2015 09:00:17 +0100 Subject: server: Store a list of associated queues for each thread input. @@ -10,7 +10,7 @@ reviewing. 1 file changed, 8 insertions(+) diff --git a/server/queue.c b/server/queue.c -index 4697d15..8f60a7e 100644 +index 418a2b1..1b80348 100644 --- a/server/queue.c +++ b/server/queue.c @@ -99,6 +99,7 @@ struct thread_input @@ -75,5 +75,5 @@ index 4697d15..8f60a7e 100644 if (input->desktop) { -- -2.3.2 +2.3.5 diff --git a/patches/server-Shared_Memory/0007-user32-Move-key_state-cache-into-separate-structure.patch b/patches/server-Shared_Memory/0007-user32-Move-key_state-cache-into-separate-structure.patch deleted file mode 100644 index 9f60487a..00000000 --- a/patches/server-Shared_Memory/0007-user32-Move-key_state-cache-into-separate-structure.patch +++ /dev/null @@ -1,152 +0,0 @@ -From 90da927ddf6f978c437aaa66b9e276dd41746415 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 21 Mar 2015 08:09:03 +0100 -Subject: user32: Move key_state cache into separate structure. - -We're running soon out of TEB space, so just move other key_state related fields -into the allocated memory block. ---- - dlls/user32/input.c | 26 +++++++++++++++++--------- - dlls/user32/message.c | 9 +++++---- - dlls/user32/user_private.h | 11 ++++++++--- - dlls/user32/winstation.c | 3 ++- - 4 files changed, 32 insertions(+), 17 deletions(-) - -diff --git a/dlls/user32/input.c b/dlls/user32/input.c -index 2512887..8608f75 100644 ---- a/dlls/user32/input.c -+++ b/dlls/user32/input.c -@@ -376,6 +376,7 @@ void CDECL __wine_check_for_events( UINT flags ) - SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) - { - struct user_thread_info *thread_info = get_user_thread_info(); -+ struct user_key_state_info *key_state_info = thread_info->key_state; - INT epoch = global_key_state_epoch; - SHORT ret; - -@@ -385,26 +386,33 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) - - if ((ret = USER_Driver->pGetAsyncKeyState( key )) == -1) - { -- if (thread_info->key_state && -- !(thread_info->key_state[key] & 0xc0) && -- GetTickCount() - thread_info->key_state_time < 50 && -- thread_info->key_state_epoch == epoch) -+ if (key_state_info && !(key_state_info->key_state[key] & 0xc0) && -+ GetTickCount() - key_state_info->key_state_time < 50 && -+ key_state_info->key_state_epoch == epoch) -+ { - return 0; -- -- if (!thread_info->key_state) thread_info->key_state = HeapAlloc( GetProcessHeap(), 0, 256 ); -+ } -+ else if (!key_state_info) -+ { -+ key_state_info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*key_state_info) ); -+ if (key_state_info) thread_info->key_state = key_state_info; -+ } - - ret = 0; - SERVER_START_REQ( get_key_state ) - { - req->tid = 0; - req->key = key; -- if (thread_info->key_state) wine_server_set_reply( req, thread_info->key_state, 256 ); -+ if (key_state_info) wine_server_set_reply( req, key_state_info->key_state, sizeof(key_state_info->key_state) ); - if (!wine_server_call( req )) - { - if (reply->state & 0x40) ret |= 0x0001; - if (reply->state & 0x80) ret |= 0x8000; -- thread_info->key_state_time = GetTickCount(); -- thread_info->key_state_epoch = epoch; -+ if (key_state_info) -+ { -+ key_state_info->key_state_time = GetTickCount(); -+ key_state_info->key_state_epoch = epoch; -+ } - } - } - SERVER_END_REQ; -diff --git a/dlls/user32/message.c b/dlls/user32/message.c -index 1afef9f..da83d16 100644 ---- a/dlls/user32/message.c -+++ b/dlls/user32/message.c -@@ -3310,6 +3310,7 @@ static BOOL send_message( struct send_message_info *info, DWORD_PTR *res_ptr, BO - NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) - { - struct user_thread_info *thread_info = get_user_thread_info(); -+ struct user_key_state_info *key_state_info = thread_info->key_state; - struct send_message_info info; - int prev_x, prev_y, new_x, new_y; - NTSTATUS ret; -@@ -3349,7 +3350,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) - req->input.hw.lparam = MAKELONG( input->u.hi.wParamL, input->u.hi.wParamH ); - break; - } -- if (thread_info->key_state) wine_server_set_reply( req, thread_info->key_state, 256 ); -+ if (key_state_info) wine_server_set_reply( req, key_state_info->key_state, sizeof(key_state_info->key_state) ); - ret = wine_server_call( req ); - wait = reply->wait; - prev_x = reply->prev_x; -@@ -3361,10 +3362,10 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) - - if (!ret) - { -- if (thread_info->key_state) -+ if (key_state_info) - { -- thread_info->key_state_time = GetTickCount(); -- thread_info->key_state_epoch = epoch; -+ key_state_info->key_state_time = GetTickCount(); -+ key_state_info->key_state_epoch = epoch; - } - if ((flags & SEND_HWMSG_INJECTED) && (prev_x != new_x || prev_y != new_y)) - USER_Driver->pSetCursorPos( new_x, new_y ); -diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h -index 47d0194..53ebca8 100644 ---- a/dlls/user32/user_private.h -+++ b/dlls/user32/user_private.h -@@ -185,9 +185,7 @@ struct user_thread_info - ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ - UINT active_hooks; /* Bitmap of active hooks */ - DWORD last_get_msg; /* Last time of Get/PeekMessage call */ -- UINT key_state_time; /* Time of last key state refresh */ -- INT key_state_epoch; /* Counter to invalidate the key state */ -- BYTE *key_state; /* Cache of global key state */ -+ struct user_key_state_info *key_state; /* Cache of global key state */ - HWND top_window; /* Desktop window */ - HWND msg_window; /* HWND_MESSAGE parent window */ - RAWINPUT *rawinput; -@@ -195,6 +193,13 @@ struct user_thread_info - - C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); - -+struct user_key_state_info -+{ -+ UINT key_state_time; /* Time of last key state refresh */ -+ INT key_state_epoch; /* Counter to invalidate the key state */ -+ BYTE key_state[256]; /* State for each key */ -+}; -+ - extern INT global_key_state_epoch DECLSPEC_HIDDEN; - - struct hook_extra_info -diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c -index 12b9edc..0e8260a 100644 ---- a/dlls/user32/winstation.c -+++ b/dlls/user32/winstation.c -@@ -399,9 +399,10 @@ BOOL WINAPI SetThreadDesktop( HDESK handle ) - if (ret) /* reset the desktop windows */ - { - struct user_thread_info *thread_info = get_user_thread_info(); -+ struct user_key_state_info *key_state_info = thread_info->key_state; - thread_info->top_window = 0; - thread_info->msg_window = 0; -- thread_info->key_state_time = 0; -+ if (key_state_info) key_state_info->key_state_time = 0; - } - return ret; - } --- -2.3.3 - diff --git a/patches/server-Shared_Memory/0009-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch b/patches/server-Shared_Memory/0008-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch similarity index 88% rename from patches/server-Shared_Memory/0009-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch rename to patches/server-Shared_Memory/0008-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch index a55cb030..67249c42 100644 --- a/patches/server-Shared_Memory/0009-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch +++ b/patches/server-Shared_Memory/0008-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch @@ -1,4 +1,4 @@ -From f984ad3f5502b815480cc135703e0ea843eb84a3 Mon Sep 17 00:00:00 2001 +From 7b779d2ada994d6e7169ce1e589a417a3f17695f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 21 Mar 2015 09:45:54 +0100 Subject: user32: Get rid of wineserver call for GetActiveWindow, GetFocus, @@ -38,7 +38,7 @@ index c47a82d..35fe89b 100644 { req->tid = GetCurrentThreadId(); diff --git a/dlls/user32/input.c b/dlls/user32/input.c -index 8608f75..e534ac1 100644 +index c18ebe0..2308a1e 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -342,8 +342,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReleaseCapture(void) @@ -53,7 +53,7 @@ index 8608f75..e534ac1 100644 { req->tid = GetCurrentThreadId(); diff --git a/server/protocol.def b/server/protocol.def -index cf6d783..7eaa6cd 100644 +index 4636d42..15df669 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -76,7 +76,10 @@ typedef struct @@ -69,10 +69,10 @@ index cf6d783..7eaa6cd 100644 /* debug event data */ diff --git a/server/queue.c b/server/queue.c -index 0ca35d7..54611c2 100644 +index 1b80348..6fa076d 100644 --- a/server/queue.c +++ b/server/queue.c -@@ -269,6 +269,25 @@ static struct thread_input *create_thread_input( struct thread *thread ) +@@ -270,6 +270,25 @@ static struct thread_input *create_thread_input( struct thread *thread ) return input; } @@ -98,7 +98,7 @@ index 0ca35d7..54611c2 100644 /* create a message queue object */ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_input *input ) { -@@ -310,7 +329,11 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ +@@ -312,7 +331,11 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ thread->queue = queue; } @@ -111,7 +111,7 @@ index 0ca35d7..54611c2 100644 return queue; } -@@ -345,6 +368,7 @@ static int assign_thread_input( struct thread *thread, struct thread_input *new_ +@@ -347,6 +370,7 @@ static int assign_thread_input( struct thread *thread, struct thread_input *new_ queue->input = (struct thread_input *)grab_object( new_input ); list_add_tail( &new_input->queues, &queue->input_entry ); new_input->cursor_count += queue->cursor_count; @@ -119,7 +119,7 @@ index 0ca35d7..54611c2 100644 return 1; } -@@ -1045,6 +1069,7 @@ static inline void thread_input_cleanup_window( struct msg_queue *queue, user_ha +@@ -1056,6 +1080,7 @@ static inline void thread_input_cleanup_window( struct msg_queue *queue, user_ha if (window == input->menu_owner) input->menu_owner = 0; if (window == input->move_size) input->move_size = 0; if (window == input->caret) set_caret_window( input, 0 ); @@ -127,7 +127,7 @@ index 0ca35d7..54611c2 100644 } /* check if the specified window can be set in the input data of a given queue */ -@@ -2954,6 +2979,7 @@ DECL_HANDLER(set_focus_window) +@@ -2975,6 +3000,7 @@ DECL_HANDLER(set_focus_window) { reply->previous = queue->input->focus; queue->input->focus = get_user_full_handle( req->handle ); @@ -135,7 +135,7 @@ index 0ca35d7..54611c2 100644 } } -@@ -2970,6 +2996,7 @@ DECL_HANDLER(set_active_window) +@@ -2991,6 +3017,7 @@ DECL_HANDLER(set_active_window) { reply->previous = queue->input->active; queue->input->active = get_user_full_handle( req->handle ); @@ -143,7 +143,7 @@ index 0ca35d7..54611c2 100644 } else set_error( STATUS_INVALID_HANDLE ); } -@@ -2996,6 +3023,7 @@ DECL_HANDLER(set_capture_window) +@@ -3017,6 +3044,7 @@ DECL_HANDLER(set_capture_window) input->capture = get_user_full_handle( req->handle ); input->menu_owner = (req->flags & CAPTURE_MENU) ? input->capture : 0; input->move_size = (req->flags & CAPTURE_MOVESIZE) ? input->capture : 0; @@ -152,5 +152,5 @@ index 0ca35d7..54611c2 100644 } } -- -2.3.2 +2.3.5 diff --git a/patches/server-Shared_Memory/0010-user32-Cache-the-result-of-GetForegroundWindow.patch b/patches/server-Shared_Memory/0009-user32-Cache-the-result-of-GetForegroundWindow.patch similarity index 97% rename from patches/server-Shared_Memory/0010-user32-Cache-the-result-of-GetForegroundWindow.patch rename to patches/server-Shared_Memory/0009-user32-Cache-the-result-of-GetForegroundWindow.patch index bd399c1b..ab6aa18f 100644 --- a/patches/server-Shared_Memory/0010-user32-Cache-the-result-of-GetForegroundWindow.patch +++ b/patches/server-Shared_Memory/0009-user32-Cache-the-result-of-GetForegroundWindow.patch @@ -1,4 +1,4 @@ -From c7950e405445d69a0dd27dd515fda834e31d82c5 Mon Sep 17 00:00:00 2001 +From 508b1263e74afaaaf7586d17a11054f9bd6d9bb9 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 21 Mar 2015 22:35:24 +0100 Subject: user32: Cache the result of GetForegroundWindow. @@ -48,7 +48,7 @@ index 35fe89b..8b17d1f 100644 SERVER_END_REQ; return ret; diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h -index 53ebca8..0398b10 100644 +index 1c87de4..26c771e 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -189,6 +189,8 @@ struct user_thread_info @@ -61,7 +61,7 @@ index 53ebca8..0398b10 100644 C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); diff --git a/server/protocol.def b/server/protocol.def -index 7eaa6cd..c770644 100644 +index 15df669..fb579e1 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -69,11 +69,14 @@ struct request_max_size @@ -116,5 +116,5 @@ index 6fa076d..764ba11 100644 else set_error( STATUS_INVALID_HANDLE ); } -- -2.3.3 +2.3.5 diff --git a/patches/server-Shared_Memory/definition b/patches/server-Shared_Memory/definition index 72cc7a94..be8a36d1 100644 --- a/patches/server-Shared_Memory/definition +++ b/patches/server-Shared_Memory/definition @@ -1,5 +1,4 @@ Depends: ntdll-Threading -Depends: user32-Key_State Depends: dinput-Events Depends: server-Key_State Depends: server-PeekMessage 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 deleted file mode 100644 index 67452dd5..00000000 --- a/patches/user32-Key_State/0001-user32-After-calling-LL-hooks-the-key-state-cache-ha.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 3f119545bac640a7a65b609ddaa0b82f4725a3f0 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 - invalidated globally. - ---- - dlls/user32/hook.c | 2 +- - dlls/user32/input.c | 8 ++++++-- - dlls/user32/message.c | 7 ++++++- - dlls/user32/user_private.h | 3 +++ - 4 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c -index 2f6b42c..0c6a059 100644 ---- a/dlls/user32/hook.c -+++ b/dlls/user32/hook.c -@@ -437,7 +437,7 @@ static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARA - } - - if (info->id == WH_KEYBOARD_LL || info->id == WH_MOUSE_LL) -- get_user_thread_info()->key_state_time = 0; /* force refreshing the key state cache */ -+ interlocked_xchg_add(&global_key_state_epoch, 1); /* force refreshing the key state cache */ - - return ret; - } -diff --git a/dlls/user32/input.c b/dlls/user32/input.c -index 1f05f34..5671285 100644 ---- a/dlls/user32/input.c -+++ b/dlls/user32/input.c -@@ -52,6 +52,7 @@ - WINE_DEFAULT_DEBUG_CHANNEL(win); - WINE_DECLARE_DEBUG_CHANNEL(keyboard); - -+INT global_key_state_epoch = 0; - - /*********************************************************************** - * get_key_state -@@ -369,6 +370,7 @@ static void check_for_events( UINT flags ) - SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) - { - struct user_thread_info *thread_info = get_user_thread_info(); -+ INT epoch = global_key_state_epoch; - SHORT ret; - - if (key < 0 || key >= 256) return 0; -@@ -379,7 +381,8 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) - { - if (thread_info->key_state && - !(thread_info->key_state[key] & 0xc0) && -- GetTickCount() - thread_info->key_state_time < 50) -+ GetTickCount() - thread_info->key_state_time < 50 && -+ thread_info->key_state_epoch == epoch) - return 0; - - if (!thread_info->key_state) thread_info->key_state = HeapAlloc( GetProcessHeap(), 0, 256 ); -@@ -394,7 +397,8 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) - { - if (reply->state & 0x40) ret |= 0x0001; - if (reply->state & 0x80) ret |= 0x8000; -- thread_info->key_state_time = GetTickCount(); -+ thread_info->key_state_time = GetTickCount(); -+ thread_info->key_state_epoch = epoch; - } - } - SERVER_END_REQ; -diff --git a/dlls/user32/message.c b/dlls/user32/message.c -index eac4e4d..d59e342 100644 ---- a/dlls/user32/message.c -+++ b/dlls/user32/message.c -@@ -3294,6 +3294,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) - struct send_message_info info; - int prev_x, prev_y, new_x, new_y; - NTSTATUS ret; -+ INT epoch = global_key_state_epoch; - BOOL wait; - - info.type = MSG_HARDWARE; -@@ -3341,7 +3342,11 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) - - if (!ret) - { -- if (thread_info->key_state) thread_info->key_state_time = GetTickCount(); -+ if (thread_info->key_state) -+ { -+ thread_info->key_state_time = GetTickCount(); -+ thread_info->key_state_epoch = epoch; -+ } - if ((flags & SEND_HWMSG_INJECTED) && (prev_x != new_x || prev_y != new_y)) - USER_Driver->pSetCursorPos( new_x, new_y ); - } -diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h -index 919540d..4380a00 100644 ---- a/dlls/user32/user_private.h -+++ b/dlls/user32/user_private.h -@@ -185,6 +185,7 @@ struct user_thread_info - ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ - UINT active_hooks; /* Bitmap of active hooks */ - UINT key_state_time; /* Time of last key state refresh */ -+ INT key_state_epoch; /* Counter to invalidate the key state */ - BYTE *key_state; /* Cache of global key state */ - HWND top_window; /* Desktop window */ - HWND msg_window; /* HWND_MESSAGE parent window */ -@@ -193,6 +194,8 @@ struct user_thread_info - - C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); - -+extern INT global_key_state_epoch DECLSPEC_HIDDEN; -+ - struct hook_extra_info - { - HHOOK handle; --- -2.3.3 - diff --git a/patches/user32-Key_State/definition b/patches/user32-Key_State/definition deleted file mode 100644 index 84dbc4b2..00000000 --- a/patches/user32-Key_State/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [29871] Invalidate key state cache globally after calling LL hooks diff --git a/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch index d56c6d4c..b38924b7 100644 --- a/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From 3b80eec8bd2af7858157bdd2b821f7946023081f Mon Sep 17 00:00:00 2001 +From 012ceb18e78f44c3bb3ba11d65a5163c93713d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 29 Apr 2013 18:49:53 +0200 Subject: wined3d: Send blits through the command stream. @@ -12,7 +12,7 @@ between surface_blt and surface_blt_ugly isn't particularly nice. 3 files changed, 226 insertions(+), 139 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 949bd6b..dcaedfd 100644 +index 17e6921..86fab74 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -73,6 +73,7 @@ enum wined3d_cs_op @@ -42,7 +42,7 @@ index 949bd6b..dcaedfd 100644 /* FIXME: The list synchronization probably isn't particularly fast. */ static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) { -@@ -1393,6 +1406,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) +@@ -1396,6 +1409,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) struct wined3d_device *device = cs->device; struct wined3d_context *context; @@ -52,7 +52,7 @@ index 949bd6b..dcaedfd 100644 context = context_acquire(device, NULL); context->gl_info->gl_ops.gl.p_glFinish(); context_release(context); -@@ -1604,6 +1620,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1607,6 +1623,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab cs->ops->submit(cs); } @@ -91,7 +91,7 @@ index 949bd6b..dcaedfd 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1643,6 +1691,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1646,6 +1694,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, @@ -99,7 +99,7 @@ index 949bd6b..dcaedfd 100644 }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -@@ -1717,6 +1766,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) +@@ -1720,6 +1769,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) TRACE("Started.\n"); @@ -108,10 +108,10 @@ index 949bd6b..dcaedfd 100644 { struct wined3d_cs_block *block; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 6e8e2f5..8a833d5 100644 +index 3cd4ab1..594562a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -5092,14 +5092,13 @@ const struct blit_shader cpu_blit = { +@@ -4990,14 +4990,13 @@ const struct blit_shader cpu_blit = { cpu_blit_depth_fill, }; @@ -128,7 +128,7 @@ index 6e8e2f5..8a833d5 100644 BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5108,111 +5107,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5006,111 +5005,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -240,7 +240,7 @@ index 6e8e2f5..8a833d5 100644 if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5255,8 +5149,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5153,8 +5047,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC } scale = src_surface @@ -251,7 +251,7 @@ index 6e8e2f5..8a833d5 100644 convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -@@ -5274,22 +5168,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5172,22 +5066,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -279,8 +279,8 @@ index 6e8e2f5..8a833d5 100644 } } else -@@ -5316,8 +5204,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color)) +@@ -5216,8 +5104,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + palette, fx->u5.dwFillColor, &color)) goto fallback; - if (SUCCEEDED(surface_color_fill(dst_surface, &dst_rect, &color))) @@ -290,7 +290,7 @@ index 6e8e2f5..8a833d5 100644 } else { -@@ -5333,9 +5221,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5233,9 +5121,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Not doing upload because of format conversion.\n"); else { @@ -302,7 +302,7 @@ index 6e8e2f5..8a833d5 100644 { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { -@@ -5344,7 +5232,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5244,7 +5132,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC dst_surface->container->resource.draw_binding); context_release(context); } @@ -311,7 +311,7 @@ index 6e8e2f5..8a833d5 100644 } } } -@@ -5369,51 +5257,192 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5269,51 +5157,192 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -518,10 +518,10 @@ index 6e8e2f5..8a833d5 100644 static const struct wined3d_resource_ops surface_resource_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 041feb3..342577c 100644 +index ebbc6e8..584fcf3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2426,6 +2426,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +@@ -2434,6 +2434,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; @@ -531,7 +531,7 @@ index 041feb3..342577c 100644 void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2570,6 +2573,7 @@ struct wined3d_cs +@@ -2583,6 +2586,7 @@ struct wined3d_cs struct wined3d_device *device; struct wined3d_state state; HANDLE thread; @@ -539,7 +539,7 @@ index 041feb3..342577c 100644 DWORD tls_idx; struct wined3d_surface *onscreen_depth_stencil; -@@ -2646,6 +2650,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, +@@ -2659,6 +2663,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; @@ -551,5 +551,5 @@ index 041feb3..342577c 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.2.1 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index b991cf5f..62288c9d 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -1133,7 +1133,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c default: mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f; } -@@ -3620,7 +3639,11 @@ +@@ -3684,7 +3703,11 @@ unsigned int i; DWORD ttff; DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; @@ -1204,7 +1204,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader shader_arb_ps_local_constants(compiled, context, state, rt_height); } -@@ -7770,7 +7778,11 @@ +@@ -7774,7 +7782,11 @@ /* Now load the surface */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -1216,7 +1216,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader == WINED3D_LOCATION_DRAWABLE && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { -@@ -7800,6 +7812,7 @@ +@@ -7804,6 +7816,7 @@ /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); @@ -1224,7 +1224,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader if (wined3d_settings.cs_multithreaded) context->gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -7811,6 +7824,17 @@ +@@ -7815,6 +7828,17 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -6702,7 +6702,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, -@@ -1021,6 +1289,18 @@ +@@ -965,6 +1233,18 @@ return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); } @@ -6721,7 +6721,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static ULONG surface_resource_incref(struct wined3d_resource *resource) { return wined3d_surface_incref(surface_from_resource(resource)); -@@ -1041,6 +1321,7 @@ +@@ -985,6 +1265,7 @@ TRACE("surface %p.\n", surface); @@ -6729,7 +6729,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(device, NULL); gl_info = context->gl_info; -@@ -1052,6 +1333,23 @@ +@@ -996,6 +1277,23 @@ * opengl resources, so we cannot leave early. */ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DISCARDED); @@ -6753,7 +6753,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* We also get here when the ddraw swapchain is destroyed, for example * for a mode switch. In this case this surface won't necessarily be -@@ -1061,10 +1359,24 @@ +@@ -1005,10 +1303,24 @@ } else { @@ -6778,7 +6778,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface -@@ -1095,6 +1407,7 @@ +@@ -1039,6 +1351,7 @@ resource_unload(resource); } @@ -6786,7 +6786,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); -@@ -1110,6 +1423,19 @@ +@@ -1054,6 +1367,19 @@ { surface_private_setup, surface_frontbuffer_updated, @@ -6806,7 +6806,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /***************************************************************************** -@@ -1153,6 +1479,7 @@ +@@ -1097,6 +1423,7 @@ return WINED3D_OK; } @@ -6814,7 +6814,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) { x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); -@@ -1162,6 +1489,23 @@ +@@ -1106,6 +1433,23 @@ { gdi_surface_private_setup, gdi_surface_frontbuffer_updated, @@ -6838,7 +6838,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /* This call just downloads data, the caller is responsible for binding the -@@ -1180,7 +1524,11 @@ +@@ -1124,7 +1468,11 @@ return; } @@ -6850,7 +6850,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format->flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1429,6 +1777,7 @@ +@@ -1373,6 +1721,7 @@ } } @@ -6858,7 +6858,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) { struct wined3d_box box; -@@ -1443,6 +1792,27 @@ +@@ -1387,6 +1736,27 @@ box.bottom = rect->bottom; box.back = 1; return wined3d_resource_check_block_align(&surface->resource, &box); @@ -6886,7 +6886,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, -@@ -1525,11 +1895,17 @@ +@@ -1469,11 +1839,17 @@ return WINED3DERR_INVALIDCALL; } @@ -6904,7 +6904,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(dst_surface->resource.device, NULL); gl_info = context->gl_info; -@@ -1540,10 +1916,17 @@ +@@ -1484,10 +1860,17 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -6922,7 +6922,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1553,8 +1936,13 @@ +@@ -1497,8 +1880,13 @@ context_release(context); @@ -6936,7 +6936,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -1658,8 +2046,12 @@ +@@ -1602,8 +1990,12 @@ return GL_BACK; } @@ -6949,7 +6949,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; -@@ -1668,6 +2060,7 @@ +@@ -1612,6 +2004,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -6957,7 +6957,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & location) { TRACE("surface is already in texture\n"); -@@ -1676,6 +2069,16 @@ +@@ -1620,6 +2013,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -6974,7 +6974,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1758,6 +2161,7 @@ +@@ -1702,6 +2105,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -6982,7 +6982,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct wined3d_device *device = surface->resource.device; TRACE("surface %p.\n", surface); -@@ -1768,6 +2172,17 @@ +@@ -1712,6 +2116,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -7000,7 +7000,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1975,6 +2390,7 @@ +@@ -1919,6 +2334,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7008,7 +7008,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -1983,6 +2399,15 @@ +@@ -1927,6 +2343,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7024,7 +7024,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -2008,7 +2433,11 @@ +@@ -1952,7 +2377,11 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -7036,7 +7036,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; -@@ -2050,11 +2479,19 @@ +@@ -1994,11 +2423,19 @@ if (!valid_location) { @@ -7056,7 +7056,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2413,6 +2850,7 @@ +@@ -2357,6 +2794,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7064,7 +7064,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2421,6 +2859,13 @@ +@@ -2365,6 +2803,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7078,7 +7078,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2444,6 +2889,7 @@ +@@ -2388,6 +2833,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7086,7 +7086,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2484,6 +2930,32 @@ +@@ -2428,6 +2874,32 @@ if (context) context_release(context); return NULL; @@ -7119,7 +7119,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -2551,6 +3023,7 @@ +@@ -2495,6 +2967,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7127,7 +7127,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2568,6 +3041,39 @@ +@@ -2512,6 +2985,39 @@ { struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; @@ -7167,7 +7167,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && rect && !surface_check_block_align(surface, rect)) -@@ -2579,6 +3085,13 @@ +@@ -2523,6 +3029,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7181,7 +7181,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2594,6 +3107,7 @@ +@@ -2538,6 +3051,7 @@ } } @@ -7189,7 +7189,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (rect) { surface->lockedRect = *rect; -@@ -2658,22 +3172,121 @@ +@@ -2602,22 +3116,121 @@ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); return WINED3DERR_INVALIDCALL; } @@ -7324,7 +7324,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -@@ -2699,6 +3312,35 @@ +@@ -2643,6 +3256,35 @@ if (context) context_release(context); } @@ -7360,7 +7360,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2718,6 +3360,7 @@ +@@ -2662,6 +3304,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7368,7 +7368,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); return WINED3D_OK; -@@ -2730,6 +3373,31 @@ +@@ -2674,6 +3317,31 @@ const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *restore_rt; @@ -7400,7 +7400,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BYTE *mem; BYTE *row, *top, *bottom; int i; -@@ -2737,6 +3405,7 @@ +@@ -2681,6 +3349,7 @@ struct wined3d_bo_address data; UINT row_pitch, slice_pitch; @@ -7408,7 +7408,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_memory(&surface->resource, dst_location, &data); /* Context_release does not restore the original context in case of -@@ -2754,6 +3423,11 @@ +@@ -2698,6 +3367,11 @@ context = context_acquire(device, surface); } @@ -7420,7 +7420,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2842,12 +3516,16 @@ +@@ -2786,12 +3460,16 @@ checkGLcall("glBindBuffer"); } @@ -7437,7 +7437,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Read the framebuffer contents into a texture. Note that this function -@@ -2909,6 +3587,85 @@ +@@ -2853,6 +3531,85 @@ } } @@ -7523,7 +7523,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -@@ -3015,8 +3772,13 @@ +@@ -2959,8 +3716,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -7537,7 +7537,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -3084,7 +3846,11 @@ +@@ -3028,7 +3790,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7549,7 +7549,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3281,6 +4047,7 @@ +@@ -3225,6 +3991,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7557,7 +7557,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3292,6 +4059,17 @@ +@@ -3236,6 +4003,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7575,7 +7575,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3322,6 +4100,7 @@ +@@ -3266,6 +4044,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7583,7 +7583,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_context *old_ctx, -@@ -3356,6 +4135,26 @@ +@@ -3300,6 +4079,26 @@ /* Make sure the surface is up-to-date. This should probably use * wined3d_resource_load_location() and worry about the destination * surface too, unless we're overwriting it completely. */ @@ -7610,7 +7610,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3398,6 +4197,7 @@ +@@ -3342,6 +4141,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7618,7 +7618,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3411,6 +4211,14 @@ +@@ -3355,6 +4155,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7633,7 +7633,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3434,9 +4242,15 @@ +@@ -3378,9 +4186,15 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7649,7 +7649,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3561,7 +4375,9 @@ +@@ -3505,7 +4319,9 @@ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->src_blt_color_key; DWORD old_color_key_flags = src_surface->container->color_key_flags; @@ -7659,7 +7659,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -3595,6 +4411,7 @@ +@@ -3539,6 +4355,7 @@ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, NULL); } @@ -7667,7 +7667,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(device, dst_surface); surface_blt_to_drawable(device, context, filter, flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_ALPHATEST), -@@ -3607,6 +4424,18 @@ +@@ -3551,6 +4368,18 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -7686,7 +7686,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -3681,6 +4510,7 @@ +@@ -3625,6 +4454,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7694,7 +7694,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3689,6 +4519,15 @@ +@@ -3633,6 +4463,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7710,7 +7710,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3703,7 +4542,11 @@ +@@ -3647,7 +4486,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7722,7 +7722,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3729,7 +4572,11 @@ +@@ -3673,7 +4516,11 @@ return; } @@ -7734,7 +7734,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3746,6 +4593,7 @@ +@@ -3690,6 +4537,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7742,7 +7742,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3757,6 +4605,19 @@ +@@ -3701,6 +4549,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7762,7 +7762,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3821,9 +4682,13 @@ +@@ -3765,9 +4626,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7776,7 +7776,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3839,9 +4704,13 @@ +@@ -3783,9 +4648,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7790,7 +7790,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -3849,6 +4718,7 @@ +@@ -3793,6 +4662,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7798,7 +7798,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3894,6 +4764,135 @@ +@@ -3838,6 +4708,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -7934,7 +7934,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3903,6 +4902,7 @@ +@@ -3847,6 +4846,7 @@ } surface_get_rect(surface, NULL, &r); @@ -7942,7 +7942,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3971,6 +4971,66 @@ +@@ -3915,6 +4915,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8009,7 +8009,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3980,6 +5040,7 @@ +@@ -3924,6 +4984,7 @@ if (srgb) { @@ -8017,7 +8017,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -4008,6 +5069,39 @@ +@@ -3952,6 +5013,39 @@ wined3d_resource_prepare_system_memory(&surface->resource); wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } @@ -8057,7 +8057,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb); -@@ -4022,7 +5116,11 @@ +@@ -3966,7 +5060,11 @@ /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -8069,7 +8069,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -4031,6 +5129,7 @@ +@@ -3975,6 +5073,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8077,7 +8077,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -4038,6 +5137,14 @@ +@@ -3982,6 +5081,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8092,7 +8092,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -4083,6 +5190,7 @@ +@@ -4027,6 +5134,7 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -8100,7 +8100,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); return WINED3D_OK; -@@ -4106,6 +5214,31 @@ +@@ -4050,6 +5158,31 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); @@ -8132,7 +8132,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4113,6 +5246,7 @@ +@@ -4057,6 +5190,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8140,7 +8140,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -4127,16 +5261,58 @@ +@@ -4071,16 +5205,58 @@ else { FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", @@ -8203,7 +8203,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -4145,6 +5321,7 @@ +@@ -4089,6 +5265,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8211,7 +8211,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_load_sysmem(surface, context, location); break; -@@ -4162,6 +5339,24 @@ +@@ -4106,6 +5283,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8236,7 +8236,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -4169,12 +5364,21 @@ +@@ -4113,12 +5308,21 @@ break; } @@ -8258,7 +8258,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -4268,6 +5472,7 @@ +@@ -4212,6 +5416,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8266,7 +8266,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4288,6 +5493,21 @@ +@@ -4232,6 +5437,21 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); @@ -8288,7 +8288,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4296,6 +5516,7 @@ +@@ -4240,6 +5460,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8296,7 +8296,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4311,6 +5532,20 @@ +@@ -4255,6 +5476,20 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); @@ -8317,7 +8317,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4468,6 +5703,7 @@ +@@ -4412,6 +5647,7 @@ int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; struct wined3d_texture *src_texture = NULL; @@ -8325,7 +8325,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4498,6 +5734,23 @@ +@@ -4442,6 +5678,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8349,7 +8349,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; } -@@ -4506,12 +5759,14 @@ +@@ -4450,12 +5703,14 @@ dst_format = dst_surface->resource.format; if (src_surface) { @@ -8364,7 +8364,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4522,9 +5777,13 @@ +@@ -4466,9 +5721,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8378,7 +8378,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; } else -@@ -4532,8 +5791,12 @@ +@@ -4476,8 +5735,12 @@ src_format = dst_format; } @@ -8391,7 +8391,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4544,12 +5807,24 @@ +@@ -4488,12 +5751,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8416,7 +8416,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4584,7 +5859,11 @@ +@@ -4528,7 +5803,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8428,7 +8428,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4592,7 +5871,11 @@ +@@ -4536,7 +5815,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8440,7 +8440,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4641,6 +5924,7 @@ +@@ -4585,6 +5868,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8448,7 +8448,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4654,6 +5938,21 @@ +@@ -4598,6 +5882,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8470,7 +8470,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4663,8 +5962,13 @@ +@@ -4607,8 +5906,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8484,7 +8484,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4673,9 +5977,15 @@ +@@ -4617,9 +5921,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8500,7 +8500,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4685,6 +5995,7 @@ +@@ -4629,6 +5939,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8508,7 +8508,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4692,6 +6003,15 @@ +@@ -4636,6 +5947,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8524,7 +8524,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4738,6 +6058,7 @@ +@@ -4682,6 +6002,7 @@ } #undef STRETCH_ROW } @@ -8532,7 +8532,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4746,6 +6067,16 @@ +@@ -4690,6 +6011,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8549,7 +8549,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4795,7 +6126,11 @@ +@@ -4739,7 +6070,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8561,7 +8561,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4872,6 +6207,7 @@ +@@ -4816,6 +6151,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8569,7 +8569,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4893,6 +6229,29 @@ +@@ -4837,6 +6173,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8599,7 +8599,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4911,7 +6270,11 @@ +@@ -4855,7 +6214,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8611,7 +8611,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4942,10 +6305,12 @@ +@@ -4886,10 +6249,12 @@ } } @@ -8624,7 +8624,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4953,6 +6318,7 @@ +@@ -4897,6 +6262,7 @@ } release: @@ -8632,7 +8632,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4971,6 +6337,14 @@ +@@ -4915,6 +6281,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8647,7 +8647,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -5005,6 +6379,7 @@ +@@ -4949,6 +6323,7 @@ cpu_blit_depth_fill, }; @@ -8655,7 +8655,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -5012,6 +6387,16 @@ +@@ -4956,6 +6331,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8672,7 +8672,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5020,6 +6405,106 @@ +@@ -4964,6 +6349,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -8779,7 +8779,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5062,8 +6547,13 @@ +@@ -5006,8 +6491,13 @@ } scale = src_surface @@ -8793,7 +8793,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -@@ -5081,6 +6571,7 @@ +@@ -5025,6 +6515,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8801,7 +8801,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5099,6 +6590,32 @@ +@@ -5043,6 +6534,32 @@ * implement those in the CPU blitter at the moment. */ if ((dst_surface->resource.locations & dst_surface->resource.map_binding) && (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding))) @@ -8834,15 +8834,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5117,6 +6634,7 @@ - if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color)) +@@ -5063,6 +6580,7 @@ + palette, fx->u5.dwFillColor, &color)) goto fallback; +#if defined(STAGING_CSMT) if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) return; } -@@ -5127,6 +6645,18 @@ +@@ -5073,6 +6591,18 @@ /* Upload */ if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM) && !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM)) @@ -8861,7 +8861,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing upload because of scaling.\n"); -@@ -5134,6 +6664,7 @@ +@@ -5080,6 +6610,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -8869,7 +8869,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5146,6 +6677,15 @@ +@@ -5092,6 +6623,15 @@ context_release(context); } return; @@ -8885,7 +8885,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5170,6 +6710,7 @@ +@@ -5116,6 +6656,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -8893,7 +8893,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5366,6 +6907,50 @@ +@@ -5312,6 +6853,50 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -8944,7 +8944,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5433,7 +7018,11 @@ +@@ -5379,7 +6964,11 @@ } surface->container = container; @@ -8956,7 +8956,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5465,9 +7054,14 @@ +@@ -5411,9 +7000,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -8971,7 +8971,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5494,7 +7088,11 @@ +@@ -5440,7 +7034,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr);