Rebase against upstream changes.

This commit is contained in:
Sebastian Lackner 2015-04-07 20:01:32 +02:00
parent d28a7ba29e
commit c5bbea55d2
23 changed files with 278 additions and 1113 deletions

View File

@ -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))

3
debian/changelog vendored
View File

@ -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 <sebastian@fds-team.de> Sun, 05 Apr 2015 03:11:58 +0200
wine-staging (1.7.40) unstable; urgency=low

View File

@ -1,45 +0,0 @@
From 79d38918a2d7a45de932c0f9b04a6b5c40d1303b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

View File

@ -1,77 +0,0 @@
From cebca02c89236793ddfbab05adf8dd557b9c6ae4 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

View File

@ -1,2 +0,0 @@
Fixes: Add stub for PowerCreateRequest
Fixes: Add stubs for Power[Set|Clear]Request

View File

@ -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 },';

View File

@ -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 <ariscop@gmail.com>
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

View File

@ -1,202 +0,0 @@
From f478d1b97efc4fe63f8ccc01a2ab214c0bffc579 Mon Sep 17 00:00:00 2001
From: Andrew Cook <ariscop@gmail.com>
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

View File

@ -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 <sebastian@fds-team.de>
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

View File

@ -1,115 +0,0 @@
From c86188e18efaf5ece7b4d85ccee4089208e392fa Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

View File

@ -1,72 +0,0 @@
From 6e6cd9108a8f3c0b9d158ac2605e9b0a08b19c71 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

View File

@ -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

View File

@ -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" <erich.e.hoover@gmail.com>
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

View File

@ -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 <sebastian@fds-team.de>
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

View File

@ -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 <sebastian@fds-team.de>
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

View File

@ -1,152 +0,0 @@
From 90da927ddf6f978c437aaa66b9e276dd41746415 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

View File

@ -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 <sebastian@fds-team.de>
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

View File

@ -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 <sebastian@fds-team.de>
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

View File

@ -1,5 +1,4 @@
Depends: ntdll-Threading
Depends: user32-Key_State
Depends: dinput-Events
Depends: server-Key_State
Depends: server-PeekMessage

View File

@ -1,115 +0,0 @@
From 3f119545bac640a7a65b609ddaa0b82f4725a3f0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

Some files were not shown because too many files have changed in this diff Show More