diff --git a/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch b/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch index 41efe2b2..cd9a4649 100644 --- a/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch +++ b/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch @@ -1,4 +1,4 @@ -From ed999d4430c1aca8f90f26670d3615cdaaab300d Mon Sep 17 00:00:00 2001 +From 44e752d89a76ba4a686f5d6b822d95c427b35bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 5 Aug 2017 01:45:29 +0200 Subject: [PATCH] ntdll: Add function to create new tokens for elevation @@ -28,12 +28,12 @@ index 0d19e12768f..e313d5807b3 100644 @ cdecl wine_get_version() NTDLL_wine_get_version @ cdecl wine_get_build_id() NTDLL_wine_get_build_id diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 47800db41b1..12e7b721cb5 100644 +index e2e4d378085..14cd0bafdc0 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -86,6 +86,9 @@ extern int __wine_main_argc; - extern char **__wine_main_argv; - extern WCHAR **__wine_main_wargv; +@@ -73,6 +73,9 @@ extern void init_user_process_params( SIZE_T data_size ) DECLSPEC_HIDDEN; + extern char **build_envp( const WCHAR *envW ) DECLSPEC_HIDDEN; + extern NTSTATUS restart_process( RTL_USER_PROCESS_PARAMETERS *params, NTSTATUS status ) DECLSPEC_HIDDEN; +/* token */ +extern HANDLE CDECL __wine_create_default_token(BOOL admin); diff --git a/patches/directmanipulation-new-dll/0011-directmanipulation-Implement-IDirectManipulationMana.patch b/patches/directmanipulation-new-dll/0011-directmanipulation-Implement-IDirectManipulationMana.patch deleted file mode 100644 index 5f46f795..00000000 --- a/patches/directmanipulation-new-dll/0011-directmanipulation-Implement-IDirectManipulationMana.patch +++ /dev/null @@ -1,373 +0,0 @@ -From 7d82a3f5a5bcdbf2b362c456080e59f882842b85 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Fri, 26 Jul 2019 09:51:05 +1000 -Subject: [PATCH] directmanipulation: Implement IDirectManipulationManager2 - CreateViewport - ---- - dlls/directmanipulation/directmanipulation.c | 341 ++++++++++++++++++- - 1 file changed, 339 insertions(+), 2 deletions(-) - -diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c -index 629a41c845..86e9556e70 100644 ---- a/dlls/directmanipulation/directmanipulation.c -+++ b/dlls/directmanipulation/directmanipulation.c -@@ -177,6 +177,334 @@ static HRESULT create_update_manager(IDirectManipulationUpdateManager **obj) - return S_OK; - } - -+struct directviewport -+{ -+ IDirectManipulationViewport2 IDirectManipulationViewport2_iface; -+ LONG ref; -+}; -+ -+static inline struct directviewport *impl_from_IDirectManipulationViewport2(IDirectManipulationViewport2 *iface) -+{ -+ return CONTAINING_RECORD(iface, struct directviewport, IDirectManipulationViewport2_iface); -+} -+ -+static HRESULT WINAPI viewport_QueryInterface(IDirectManipulationViewport2 *iface, REFIID riid, void **ppv) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv); -+ -+ if (IsEqualGUID(riid, &IID_IUnknown) || -+ IsEqualGUID(riid, &IID_IDirectManipulationViewport) || -+ IsEqualGUID(riid, &IID_IDirectManipulationViewport2)) -+ { -+ IDirectManipulationViewport2_AddRef(&This->IDirectManipulationViewport2_iface); -+ *ppv = &This->IDirectManipulationViewport2_iface; -+ return S_OK; -+ } -+ -+ FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI viewport_AddRef(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ ULONG ref = InterlockedIncrement(&This->ref); -+ -+ TRACE("(%p) ref=%u\n", This, ref); -+ -+ return ref; -+} -+ -+static ULONG WINAPI viewport_Release(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ ULONG ref = InterlockedDecrement(&This->ref); -+ -+ TRACE("(%p) ref=%u\n", This, ref); -+ -+ if (!ref) -+ { -+ heap_free(This); -+ } -+ return ref; -+} -+ -+static HRESULT WINAPI viewport_Enable(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p\n", This); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_Disable(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p\n", This); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetContact(IDirectManipulationViewport2 *iface, UINT32 id) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, id); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_ReleaseContact(IDirectManipulationViewport2 *iface, UINT32 id) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, id); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_ReleaseAllContacts(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p\n", This); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_GetStatus(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_STATUS *status) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p\n", This, status); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_GetTag(IDirectManipulationViewport2 *iface, REFIID riid, void **object, UINT32 *id) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %s, %p, %p\n", This, debugstr_guid(riid), object, id); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetTag(IDirectManipulationViewport2 *iface, IUnknown *object, UINT32 id) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p, %p\n", This, object, id); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_GetViewportRect(IDirectManipulationViewport2 *iface, RECT *viewport) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p\n", This, viewport); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetViewportRect(IDirectManipulationViewport2 *iface, const RECT *viewport) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p\n", This, viewport); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_ZoomToRect(IDirectManipulationViewport2 *iface, const float left, -+ const float top, const float right, const float bottom, BOOL animate) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %f, %f, %f, %f, %d\n", This, left, top, right, bottom, animate); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetViewportTransform(IDirectManipulationViewport2 *iface, -+ const float *matrix, DWORD count) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p, %d\n", This, matrix, count); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SyncDisplayTransform(IDirectManipulationViewport2 *iface, -+ const float *matrix, DWORD count) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p, %d\n", This, matrix, count); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_GetPrimaryContent(IDirectManipulationViewport2 *iface, REFIID riid, void **object) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %s, %p\n", This, debugstr_guid(riid), object); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_AddContent(IDirectManipulationViewport2 *iface, IDirectManipulationContent *content) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p\n", This, content); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_RemoveContent(IDirectManipulationViewport2 *iface, IDirectManipulationContent *content) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p\n", This, content); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetViewportOptions(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_VIEWPORT_OPTIONS options) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, options); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_AddConfiguration(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_CONFIGURATION configuration) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, configuration); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_RemoveConfiguration(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_CONFIGURATION configuration) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, configuration); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_ActivateConfiguration(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_CONFIGURATION configuration) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, configuration); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetManualGesture(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, configuration); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetChaining(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_MOTION_TYPES enabledTypes) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, enabledTypes); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_AddEventHandler(IDirectManipulationViewport2 *iface, HWND window, -+ IDirectManipulationViewportEventHandler *eventHandler, DWORD *cookie) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p, %p, %p\n", This, window, eventHandler, cookie); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_RemoveEventHandler(IDirectManipulationViewport2 *iface, DWORD cookie) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, cookie); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetInputMode(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_INPUT_MODE mode) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, mode); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_SetUpdateMode(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_INPUT_MODE mode) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, mode); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_Stop(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p\n", This); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_Abandon(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p\n", This); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_AddBehavior(IDirectManipulationViewport2 *iface, IUnknown *behavior, DWORD *cookie) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %p, %p\n", This, behavior, cookie); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_RemoveBehavior(IDirectManipulationViewport2 *iface, DWORD cookie) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p, %d\n", This, cookie); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI viewport_RemoveAllBehaviors(IDirectManipulationViewport2 *iface) -+{ -+ struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -+ FIXME("%p\n", This); -+ return E_NOTIMPL; -+} -+ -+static const IDirectManipulationViewport2Vtbl viewportVtbl = -+{ -+ viewport_QueryInterface, -+ viewport_AddRef, -+ viewport_Release, -+ viewport_Enable, -+ viewport_Disable, -+ viewport_SetContact, -+ viewport_ReleaseContact, -+ viewport_ReleaseAllContacts, -+ viewport_GetStatus, -+ viewport_GetTag, -+ viewport_SetTag, -+ viewport_GetViewportRect, -+ viewport_SetViewportRect, -+ viewport_ZoomToRect, -+ viewport_SetViewportTransform, -+ viewport_SyncDisplayTransform, -+ viewport_GetPrimaryContent, -+ viewport_AddContent, -+ viewport_RemoveContent, -+ viewport_SetViewportOptions, -+ viewport_AddConfiguration, -+ viewport_RemoveConfiguration, -+ viewport_ActivateConfiguration, -+ viewport_SetManualGesture, -+ viewport_SetChaining, -+ viewport_AddEventHandler, -+ viewport_RemoveEventHandler, -+ viewport_SetInputMode, -+ viewport_SetUpdateMode, -+ viewport_Stop, -+ viewport_Abandon, -+ viewport_AddBehavior, -+ viewport_RemoveBehavior, -+ viewport_RemoveAllBehaviors -+}; -+ -+static HRESULT create_viewport(IDirectManipulationViewport2 **obj) -+{ -+ struct directviewport *object; -+ -+ object = heap_alloc(sizeof(*object)); -+ if(!object) -+ return E_OUTOFMEMORY; -+ -+ object->IDirectManipulationViewport2_iface.lpVtbl = &viewportVtbl; -+ object->ref = 1; -+ -+ *obj = &object->IDirectManipulationViewport2_iface; -+ -+ return S_OK; -+} -+ - static HRESULT WINAPI direct_manip_QueryInterface(IDirectManipulationManager2 *iface, REFIID riid, void **ppv) - { - if (IsEqualGUID(riid, &IID_IUnknown) || -@@ -278,9 +606,18 @@ static HRESULT WINAPI direct_manip_GetUpdateManager(IDirectManipulationManager2 - static HRESULT WINAPI direct_manip_CreateViewport(IDirectManipulationManager2 *iface, IDirectManipulationFrameInfoProvider *frame, - HWND window, REFIID riid, void **obj) - { -+ HRESULT hr = E_NOTIMPL; - struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface); -- FIXME("%p, %p, %p, %s, %p\n", This, frame, window, debugstr_guid(riid), obj); -- return E_NOTIMPL; -+ TRACE("%p, %p, %p, %s, %p\n", This, frame, window, debugstr_guid(riid), obj); -+ -+ if(IsEqualGUID(riid, &IID_IDirectManipulationViewport) || -+ IsEqualGUID(riid, &IID_IDirectManipulationViewport2) ) -+ { -+ hr = create_viewport( (IDirectManipulationViewport2**)obj); -+ } -+ else -+ FIXME("Unsupported interface %s\n", debugstr_guid(riid)); -+ return hr; - } - - static HRESULT WINAPI direct_manip_CreateContent(IDirectManipulationManager2 *iface, IDirectManipulationFrameInfoProvider *frame, --- -2.17.1 - diff --git a/patches/directmanipulation-new-dll/0015-directmanipulation-Implement-IDirectManipulationView.patch b/patches/directmanipulation-new-dll/0015-directmanipulation-Implement-IDirectManipulationView.patch deleted file mode 100644 index 69abd6a6..00000000 --- a/patches/directmanipulation-new-dll/0015-directmanipulation-Implement-IDirectManipulationView.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 52d03476a908684bb201ae69032f39bf2a745190 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Fri, 23 Aug 2019 11:34:16 +1000 -Subject: [PATCH 3/4] directmanipulation: Implement - IDirectManipulationViewport2 GetPrimaryContent - ---- - dlls/directmanipulation/directmanipulation.c | 155 ++++++++++++++++++- - 1 file changed, 154 insertions(+), 1 deletion(-) - -diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c -index f1e008bc7f..ca60e76db6 100644 ---- a/dlls/directmanipulation/directmanipulation.c -+++ b/dlls/directmanipulation/directmanipulation.c -@@ -177,6 +177,142 @@ static HRESULT create_update_manager(IDirectManipulationUpdateManager **obj) - return S_OK; - } - -+ -+struct primarycontext -+{ -+ IDirectManipulationPrimaryContent IDirectManipulationPrimaryContent_iface; -+ LONG ref; -+}; -+ -+static inline struct primarycontext *impl_from_IDirectManipulationPrimaryContent(IDirectManipulationPrimaryContent *iface) -+{ -+ return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationPrimaryContent_iface); -+} -+ -+static HRESULT WINAPI primary_QueryInterface(IDirectManipulationPrimaryContent *iface, REFIID riid, void **ppv) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv); -+ -+ if (IsEqualGUID(riid, &IID_IUnknown) || -+ IsEqualGUID(riid, &IID_IDirectManipulationPrimaryContent)) -+ { -+ IDirectManipulationPrimaryContent_AddRef(&This->IDirectManipulationPrimaryContent_iface); -+ *ppv = &This->IDirectManipulationPrimaryContent_iface; -+ return S_OK; -+ } -+ -+ FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI primary_AddRef(IDirectManipulationPrimaryContent *iface) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ ULONG ref = InterlockedIncrement(&This->ref); -+ -+ TRACE("(%p) ref=%u\n", This, ref); -+ -+ return ref; -+} -+ -+static ULONG WINAPI primary_Release(IDirectManipulationPrimaryContent *iface) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ ULONG ref = InterlockedDecrement(&This->ref); -+ -+ TRACE("(%p) ref=%u\n", This, ref); -+ -+ if (!ref) -+ { -+ heap_free(This); -+ } -+ return ref; -+} -+ -+static HRESULT WINAPI primary_SetSnapInterval(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, -+ float interval, float offset) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %d, %f, %f\n", This, motion, interval, offset); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_SetSnapPoints(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, -+ const float *points, DWORD count) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %d, %p, %d\n", This, motion, points, count); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_SetSnapType(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, -+ DIRECTMANIPULATION_SNAPPOINT_TYPE type) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %d, %d\n", This, motion, type); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_SetSnapCoordinate(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, -+ DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate, float origin) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %d, %d, %f\n", This, motion, coordinate, origin); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_SetZoomBoundaries(IDirectManipulationPrimaryContent *iface, float minimum, float maximum) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %f, %f\n", This, minimum, maximum); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_SetHorizontalAlignment(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %d\n", This, alignment); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_SetVerticalAlignment(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_VERTICALALIGNMENT alignment) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %d\n", This, alignment); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_GetInertiaEndTransform(IDirectManipulationPrimaryContent *iface, float *matrix, DWORD count) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %p, %d\n", This, matrix, count); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI primary_GetCenterPoint(IDirectManipulationPrimaryContent *iface, float *x, float *y) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -+ FIXME("%p, %p, %p\n", This, x, y); -+ return E_NOTIMPL; -+} -+ -+static const IDirectManipulationPrimaryContentVtbl primaryVtbl = -+{ -+ primary_QueryInterface, -+ primary_AddRef, -+ primary_Release, -+ primary_SetSnapInterval, -+ primary_SetSnapPoints, -+ primary_SetSnapType, -+ primary_SetSnapCoordinate, -+ primary_SetZoomBoundaries, -+ primary_SetHorizontalAlignment, -+ primary_SetVerticalAlignment, -+ primary_GetInertiaEndTransform, -+ primary_GetCenterPoint -+}; -+ - struct directviewport - { - IDirectManipulationViewport2 IDirectManipulationViewport2_iface; -@@ -327,7 +463,24 @@ static HRESULT WINAPI viewport_SyncDisplayTransform(IDirectManipulationViewport2 - static HRESULT WINAPI viewport_GetPrimaryContent(IDirectManipulationViewport2 *iface, REFIID riid, void **object) - { - struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); -- FIXME("%p, %s, %p\n", This, debugstr_guid(riid), object); -+ TRACE("%p, %s, %p\n", This, debugstr_guid(riid), object); -+ if(IsEqualGUID(riid, &IID_IDirectManipulationPrimaryContent)) -+ { -+ struct primarycontext *primary; -+ TRACE("IDirectManipulationPrimaryContent\n"); -+ primary = heap_alloc( sizeof(*primary)); -+ if(!primary) -+ return E_OUTOFMEMORY; -+ -+ primary->IDirectManipulationPrimaryContent_iface.lpVtbl = &primaryVtbl; -+ primary->ref = 1; -+ -+ *object = &primary->IDirectManipulationPrimaryContent_iface; -+ -+ return S_OK; -+ } -+ else -+ FIXME("Unsupported interface %s\n", debugstr_guid(riid)); - return E_NOTIMPL; - } - --- -2.17.1 - diff --git a/patches/directmanipulation-new-dll/0016-directmanipulation-Support-IDirectManipulationConten.patch b/patches/directmanipulation-new-dll/0016-directmanipulation-Support-IDirectManipulationConten.patch deleted file mode 100644 index 86a5c7c3..00000000 --- a/patches/directmanipulation-new-dll/0016-directmanipulation-Support-IDirectManipulationConten.patch +++ /dev/null @@ -1,166 +0,0 @@ -From b86977f6822d286b595c756c814c2cc986968050 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Sun, 22 Dec 2019 19:35:25 +1100 -Subject: [PATCH 1/2] directmanipulation: Support IDirectManipulationContent in - IDirectManipulationPrimaryContent interface - -Based of patch by Gijs Vermeulen. ---- - dlls/directmanipulation/directmanipulation.c | 110 ++++++++++++++++++- - 1 file changed, 109 insertions(+), 1 deletion(-) - -diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c -index ca60e76db6e..05601abbd45 100644 ---- a/dlls/directmanipulation/directmanipulation.c -+++ b/dlls/directmanipulation/directmanipulation.c -@@ -177,10 +177,10 @@ static HRESULT create_update_manager(IDirectManipulationUpdateManager **obj) - return S_OK; - } - -- - struct primarycontext - { - IDirectManipulationPrimaryContent IDirectManipulationPrimaryContent_iface; -+ IDirectManipulationContent IDirectManipulationContent_iface; - LONG ref; - }; - -@@ -189,6 +189,11 @@ static inline struct primarycontext *impl_from_IDirectManipulationPrimaryContent - return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationPrimaryContent_iface); - } - -+static inline struct primarycontext *impl_from_IDirectManipulationContent(IDirectManipulationContent *iface) -+{ -+ return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationContent_iface); -+} -+ - static HRESULT WINAPI primary_QueryInterface(IDirectManipulationPrimaryContent *iface, REFIID riid, void **ppv) - { - struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); -@@ -201,6 +206,12 @@ static HRESULT WINAPI primary_QueryInterface(IDirectManipulationPrimaryContent * - *ppv = &This->IDirectManipulationPrimaryContent_iface; - return S_OK; - } -+ else if(IsEqualGUID(riid, &IID_IDirectManipulationContent)) -+ { -+ IUnknown_AddRef(iface); -+ *ppv = &This->IDirectManipulationContent_iface; -+ return S_OK; -+ } - - FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv); - return E_NOINTERFACE; -@@ -313,6 +324,102 @@ static const IDirectManipulationPrimaryContentVtbl primaryVtbl = - primary_GetCenterPoint - }; - -+ -+static HRESULT WINAPI content_QueryInterface(IDirectManipulationContent *iface, REFIID riid, void **ppv) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv); -+ -+ return IDirectManipulationPrimaryContent_QueryInterface(&This->IDirectManipulationPrimaryContent_iface, -+ riid, ppv); -+} -+ -+static ULONG WINAPI content_AddRef(IDirectManipulationContent *iface) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ return IDirectManipulationPrimaryContent_AddRef(&This->IDirectManipulationPrimaryContent_iface); -+} -+ -+static ULONG WINAPI content_Release(IDirectManipulationContent *iface) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ return IDirectManipulationPrimaryContent_Release(&This->IDirectManipulationPrimaryContent_iface); -+} -+ -+static HRESULT WINAPI content_GetContentRect(IDirectManipulationContent *iface, RECT *size) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p\n", This, size); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI content_SetContentRect(IDirectManipulationContent *iface, const RECT *size) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p\n", This, size); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI content_GetViewport(IDirectManipulationContent *iface, REFIID riid, void **object) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p, %p\n", This, debugstr_guid(riid), object); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI content_GetTag(IDirectManipulationContent *iface, REFIID riid, void **object, UINT32 *id) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p, %p, %p\n", This, debugstr_guid(riid), object, id); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI content_SetTag(IDirectManipulationContent *iface, IUnknown *object, UINT32 id) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p, %d\n", This, object, id); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI content_GetOutputTransform(IDirectManipulationContent *iface, -+ float *matrix, DWORD count) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p, %d\n", This, matrix, count); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI content_GetContentTransform(IDirectManipulationContent *iface, -+ float *matrix, DWORD count) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p, %d\n", This, matrix, count); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI content_SyncContentTransform(IDirectManipulationContent *iface, -+ const float *matrix, DWORD count) -+{ -+ struct primarycontext *This = impl_from_IDirectManipulationContent(iface); -+ FIXME("%p, %p, %d\n", This, matrix, count); -+ return E_NOTIMPL; -+} -+ -+static const IDirectManipulationContentVtbl contentVtbl = -+{ -+ content_QueryInterface, -+ content_AddRef, -+ content_Release, -+ content_GetContentRect, -+ content_SetContentRect, -+ content_GetViewport, -+ content_GetTag, -+ content_SetTag, -+ content_GetOutputTransform, -+ content_GetContentTransform, -+ content_SyncContentTransform -+}; -+ - struct directviewport - { - IDirectManipulationViewport2 IDirectManipulationViewport2_iface; -@@ -473,6 +580,7 @@ static HRESULT WINAPI viewport_GetPrimaryContent(IDirectManipulationViewport2 *i - return E_OUTOFMEMORY; - - primary->IDirectManipulationPrimaryContent_iface.lpVtbl = &primaryVtbl; -+ primary->IDirectManipulationContent_iface.lpVtbl = &contentVtbl; - primary->ref = 1; - - *object = &primary->IDirectManipulationPrimaryContent_iface; --- -2.24.0 - diff --git a/patches/loader-KeyboardLayouts/0002-user32-Improve-GetKeyboardLayoutList.patch b/patches/loader-KeyboardLayouts/0002-user32-Improve-GetKeyboardLayoutList.patch index bf6e6bc1..200cbbe9 100644 --- a/patches/loader-KeyboardLayouts/0002-user32-Improve-GetKeyboardLayoutList.patch +++ b/patches/loader-KeyboardLayouts/0002-user32-Improve-GetKeyboardLayoutList.patch @@ -1,4 +1,4 @@ -From 440f90abdcbe7e9a1d43e06900a4674e6fabd805 Mon Sep 17 00:00:00 2001 +From cd8b9cfdbc4ab1c7120c411b65ac079eddd3a675 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 9 Jul 2019 14:13:28 +1000 Subject: [PATCH] user32: Improve GetKeyboardLayoutList @@ -59,10 +59,10 @@ index 6d916c7d65d..b9e0dc60e7c 100644 if (baselayout != 0) { diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c -index 913fabfbd85..dd84ff5cbb2 100644 +index 9ec829860af..56fbc558de2 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c -@@ -3010,6 +3010,40 @@ static void test_UnregisterDeviceNotification(void) +@@ -3385,6 +3385,40 @@ static void test_UnregisterDeviceNotification(void) ok(ret == FALSE, "Unregistering NULL Device Notification returned: %d\n", ret); } @@ -102,15 +102,15 @@ index 913fabfbd85..dd84ff5cbb2 100644 + START_TEST(input) { - POINT pos; -@@ -3033,6 +3067,7 @@ START_TEST(input) + char **argv; +@@ -3417,6 +3451,7 @@ START_TEST(input) test_GetKeyState(); test_OemKeyScan(); test_GetRawInputData(); + test_GetKeyboardLayoutList(); test_RegisterRawInputDevices(); + test_rawinput(argv[0]); - if(pGetMouseMovePointsEx) -- -2.26.2 +2.27.0 diff --git a/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch b/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch index eea5e9e7..98e7d7ca 100644 --- a/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch +++ b/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch @@ -1,13 +1,13 @@ -From b1af584b5d5b8905bf4dd3ec6be9227e5221a744 Mon Sep 17 00:00:00 2001 +From 250b8699aa64096bb4b38d454c03b57afe91a619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 3 Apr 2017 05:30:27 +0200 Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data. --- dlls/kernel32/tests/loader.c | 76 ++++++++++++++++++++++++++++++++++++ - dlls/ntdll/loader.c | 65 ++++++++++++++++++++++++++++++ + dlls/ntdll/loader.c | 64 ++++++++++++++++++++++++++++++ include/winternl.h | 2 +- - 3 files changed, 142 insertions(+), 1 deletion(-) + 3 files changed, 141 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 59965984a67..95f18fb71e3 100644 @@ -115,10 +115,10 @@ index 59965984a67..95f18fb71e3 100644 test_Loader(); } diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index c90cdcc860b..63e1227cc55 100644 +index 42cdc628021..df8e0c69185 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -128,6 +128,9 @@ struct file_id +@@ -121,6 +121,9 @@ struct file_id BYTE ObjectId[16]; }; @@ -128,7 +128,7 @@ index c90cdcc860b..63e1227cc55 100644 /* internal representation of loaded modules */ typedef struct _wine_modref { -@@ -467,6 +470,52 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module ) +@@ -446,6 +449,52 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module ) } } @@ -181,7 +181,7 @@ index c90cdcc860b..63e1227cc55 100644 /************************************************************************* * get_modref * -@@ -1231,7 +1280,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name +@@ -1188,7 +1237,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name &wm->ldr.InLoadOrderLinks); InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderLinks); @@ -194,15 +194,7 @@ index c90cdcc860b..63e1227cc55 100644 if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) { -@@ -1892,6 +1946,7 @@ static NTSTATUS build_so_dll_module( const WCHAR *load_path, const UNICODE_STRIN - /* the module has only been inserted in the load & memory order lists */ - RemoveEntryList(&wm->ldr.InLoadOrderLinks); - RemoveEntryList(&wm->ldr.InMemoryOrderLinks); -+ RemoveEntryList(&wm->ldr.HashLinks); - /* FIXME: free the modref */ - return status; - } -@@ -2433,6 +2488,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam +@@ -1894,6 +1948,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, /* the module has only be inserted in the load & memory order lists */ RemoveEntryList(&wm->ldr.InLoadOrderLinks); RemoveEntryList(&wm->ldr.InMemoryOrderLinks); @@ -210,7 +202,7 @@ index c90cdcc860b..63e1227cc55 100644 /* FIXME: there are several more dangling references * left. Including dlls loaded by this dll before the -@@ -3652,6 +3708,7 @@ static void free_modref( WINE_MODREF *wm ) +@@ -3226,6 +3281,7 @@ static void free_modref( WINE_MODREF *wm ) { RemoveEntryList(&wm->ldr.InLoadOrderLinks); RemoveEntryList(&wm->ldr.InMemoryOrderLinks); @@ -218,7 +210,7 @@ index c90cdcc860b..63e1227cc55 100644 if (wm->ldr.InInitializationOrderLinks.Flink) RemoveEntryList(&wm->ldr.InInitializationOrderLinks); -@@ -4372,6 +4429,7 @@ void __wine_process_init(void) +@@ -3945,6 +4001,7 @@ void __wine_process_init(void) SIZE_T info_size; TEB *teb; PEB *peb; @@ -226,7 +218,7 @@ index c90cdcc860b..63e1227cc55 100644 if (!unix_funcs) load_ntdll_so( ntdll_module, &__wine_spec_nt_header ); -@@ -4388,6 +4446,10 @@ void __wine_process_init(void) +@@ -3961,6 +4018,10 @@ void __wine_process_init(void) load_global_options(); version_init(); @@ -237,7 +229,7 @@ index c90cdcc860b..63e1227cc55 100644 /* setup the load callback and create ntdll modref */ RtlInitUnicodeString( &nt_name, ntdllW ); status = build_so_dll_module( params->DllPath.Buffer, &nt_name, ntdll_module, 0, &wm ); -@@ -4463,6 +4525,9 @@ void __wine_process_init(void) +@@ -4034,6 +4095,9 @@ void __wine_process_init(void) teb->Tib.StackLimit = stack.StackLimit; teb->DeallocationStack = stack.DeallocationStack; diff --git a/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch b/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch index bd1c9881..a99729dc 100644 --- a/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch +++ b/patches/ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch @@ -1,4 +1,4 @@ -From 4236b5607067148efa76cbe090d9efd58b297e32 Mon Sep 17 00:00:00 2001 +From 6a2146342b48977513f83a59cd16d182850767a9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 30 Dec 2019 13:27:53 +0300 Subject: [PATCH] ntdll: Support x86_64 syscall emulation. @@ -12,14 +12,14 @@ is used for trapping syscalls. configure.ac | 1 + dlls/ntdll/thread.c | 8 ++- dlls/ntdll/unix/signal_x86_64.c | 105 ++++++++++++++++++++++++++++++++ - dlls/ntdll/unix/thread.c | 8 ++- - dlls/ntdll/unix/unix_private.h | 6 +- - dlls/ntdll/unixlib.h | 3 +- + dlls/ntdll/unix/thread.c | 7 ++- + dlls/ntdll/unix/unix_private.h | 5 +- + dlls/ntdll/unixlib.h | 2 +- tools/winebuild/spec32.c | 9 ++- - 7 files changed, 134 insertions(+), 6 deletions(-) + 7 files changed, 131 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac -index 9c5f76669df..f245c2f1507 100644 +index a78610c6490..eabd16b4732 100644 --- a/configure.ac +++ b/configure.ac @@ -464,6 +464,7 @@ AC_CHECK_HEADERS(\ @@ -31,10 +31,10 @@ index 9c5f76669df..f245c2f1507 100644 linux/types.h \ linux/ucdrom.h \ diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 557747062e4..0d65546588f 100644 +index 0eb7d901c4d..c5391fb0512 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -103,6 +103,12 @@ void __wine_syscall_dispatcher( void ) +@@ -105,6 +105,12 @@ void __wine_syscall_dispatcher( void ) } #endif @@ -47,14 +47,14 @@ index 557747062e4..0d65546588f 100644 void *WINAPI __wine_fakedll_dispatcher( const char *module, ULONG ord ) { UNICODE_STRING name; -@@ -146,7 +152,7 @@ void *WINAPI __wine_fakedll_dispatcher( const char *module, ULONG ord ) - TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) +@@ -148,7 +154,7 @@ void *WINAPI __wine_fakedll_dispatcher( const char *module, ULONG ord ) + TEB *thread_init( SIZE_T *info_size ) { - TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, suspend, &server_cpus, -- &is_wow64, &server_start_time, __wine_syscall_dispatcher ); -+ &is_wow64, &server_start_time, __wine_syscall_dispatcher, __wine_nb_syscalls ); - teb->Spare2 = (ULONG_PTR)__wine_fakedll_dispatcher; + ULONG_PTR val; +- TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, __wine_syscall_dispatcher ); ++ TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, __wine_syscall_dispatcher, __wine_nb_syscalls ); + teb->Spare2 = (ULONG_PTR)__wine_fakedll_dispatcher; peb = teb->Peb; diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 12ea74f7f5c..26097702985 100644 @@ -194,7 +194,7 @@ index 12ea74f7f5c..26097702985 100644 error: diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c -index 196dc2d8c4e..dae792bd78b 100644 +index ca5eba4da88..36126a56f45 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -58,6 +58,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(seh); @@ -207,17 +207,16 @@ index 196dc2d8c4e..dae792bd78b 100644 static int *nb_threads; static inline int get_unix_exit_code( NTSTATUS status ) -@@ -85,7 +88,8 @@ static void pthread_exit_wrapper( int status ) +@@ -84,7 +87,7 @@ static void pthread_exit_wrapper( int status ) + /*********************************************************************** * init_threading */ - TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, BOOL *suspend, -- unsigned int *cpus, BOOL *wow64, timeout_t *start_time, void *syscall_handler ) -+ unsigned int *cpus, BOOL *wow64, timeout_t *start_time, void *syscall_handler, -+ unsigned int syscall_count ) +-TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler ) ++TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler, unsigned int syscall_count ) { TEB *teb; - SIZE_T info_size; -@@ -94,6 +98,8 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ + BOOL suspend; +@@ -94,6 +97,8 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ *ldt_copy = &__wine_ldt_copy; #endif nb_threads = nb_threads_ptr; @@ -227,20 +226,19 @@ index 196dc2d8c4e..dae792bd78b 100644 teb = virtual_alloc_first_teb(); teb->WOW32Reserved = syscall_handler; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index df508e569f9..bcb80ddab85 100644 +index 15be5d3715a..516a6cfa1fe 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -113,7 +113,8 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE +@@ -115,7 +115,7 @@ extern NTSTATUS CDECL server_handle_to_fd( HANDLE handle, unsigned int access, i + unsigned int *options ) DECLSPEC_HIDDEN; + extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDEN; extern void CDECL server_init_process_done( void *relay ) DECLSPEC_HIDDEN; - extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, - BOOL *suspend, unsigned int *cpus, BOOL *wow64, -- timeout_t *start_time, void *syscall_handler ) DECLSPEC_HIDDEN; -+ timeout_t *start_time, void *syscall_handler, -+ unsigned int syscall_count ) DECLSPEC_HIDDEN; +-extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler ) DECLSPEC_HIDDEN; ++extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler, unsigned int syscall_count ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_thread( int status ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_process( int status ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status ) DECLSPEC_HIDDEN; -@@ -146,6 +147,9 @@ extern NTSTATUS exec_wineloader( char **argv, int socketfd, int is_child_64bit, +@@ -152,6 +152,9 @@ extern NTSTATUS exec_wineloader( char **argv, int socketfd, int is_child_64bit, extern void start_server( BOOL debug ) DECLSPEC_HIDDEN; extern ULONG_PTR get_image_address(void) DECLSPEC_HIDDEN; @@ -251,16 +249,15 @@ index df508e569f9..bcb80ddab85 100644 extern void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset ) DECLSPEC_HIDDEN; extern void server_leave_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h -index a9803478a37..e3bb8f7ce8e 100644 +index b5b7cb07c80..f61e0ed8525 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h -@@ -302,7 +302,8 @@ struct unix_funcs +@@ -304,7 +304,7 @@ struct unix_funcs + void (CDECL *virtual_set_large_address_space)(void); /* thread/process functions */ - TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, -- BOOL *suspend, unsigned int *cpus, BOOL *wow64, timeout_t *start_time, void *syscall_handler ); -+ BOOL *suspend, unsigned int *cpus, BOOL *wow64, timeout_t *start_time, -+ void *syscall_handler, unsigned int syscall_count ); +- TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler ); ++ TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler, unsigned int syscall_count ); void (CDECL *exit_thread)( int status ); void (CDECL *exit_process)( int status ); NTSTATUS (CDECL *exec_process)( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status ); diff --git a/patches/ntdll-SystemCodeIntegrityInformation/0001-ntdll-NtQuerySystemInformation-support-SystemCodeInt.patch b/patches/ntdll-SystemCodeIntegrityInformation/0001-ntdll-NtQuerySystemInformation-support-SystemCodeInt.patch index 80c42839..229aa915 100644 --- a/patches/ntdll-SystemCodeIntegrityInformation/0001-ntdll-NtQuerySystemInformation-support-SystemCodeInt.patch +++ b/patches/ntdll-SystemCodeIntegrityInformation/0001-ntdll-NtQuerySystemInformation-support-SystemCodeInt.patch @@ -1,4 +1,4 @@ -From 7421907b2ecc21493308aa31478b6828f4341e29 Mon Sep 17 00:00:00 2001 +From ab4c2acb67c445abb2b6db274f6e94bd5f3877ba Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 22 May 2020 16:37:37 +1000 Subject: [PATCH] ntdll: NtQuerySystemInformation support @@ -7,47 +7,48 @@ Subject: [PATCH] ntdll: NtQuerySystemInformation support Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49192 Signed-off-by: Alistair Leslie-Hughes --- - dlls/ntdll/nt.c | 21 +++++++++++++++++++++ - include/winternl.h | 22 ++++++++++++++++++++++ - 2 files changed, 43 insertions(+) + dlls/ntdll/unix/system.c | 22 ++++++++++++++++++++++ + include/winternl.h | 22 ++++++++++++++++++++++ + 2 files changed, 44 insertions(+) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 1d31f80a5f55..99b0d8dc0921 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -3179,6 +3179,27 @@ NTSTATUS WINAPI NtQuerySystemInformation( - memset(SystemInformation, 0, Length); +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index c5b2018bf30..6a0f4778790 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -2151,6 +2151,28 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, ret = STATUS_SUCCESS; break; + + case SystemCodeIntegrityInformation: + { -+ SYSTEM_CODEINTEGRITY_INFORMATION *info = (SYSTEM_CODEINTEGRITY_INFORMATION*)SystemInformation; ++ SYSTEM_CODEINTEGRITY_INFORMATION *scii = info; + -+ FIXME("SystemCodeIntegrityInformation, len %u, buffer %p, stub!\n", Length, info); ++ FIXME("SystemCodeIntegrityInformation, size %u, info %p, stub!\n", size, info); + -+ if (Length < sizeof(SYSTEM_CODEINTEGRITY_INFORMATION)) ++ if (size < sizeof(SYSTEM_CODEINTEGRITY_INFORMATION)) + { + ret = STATUS_INFO_LENGTH_MISMATCH; + break; + } + -+ if (!SystemInformation) ++ if (!info) + { + ret = STATUS_ACCESS_VIOLATION; + break; + } + -+ info->CodeIntegrityOptions = CODEINTEGRITY_OPTION_ENABLED; ++ scii->CodeIntegrityOptions = CODEINTEGRITY_OPTION_ENABLED; + break; + } ++ default: - FIXME("(0x%08x,%p,0x%08x,%p) stub\n", - SystemInformationClass,SystemInformation,Length,ResultLength); + FIXME( "(0x%08x,%p,0x%08x,%p) stub\n", class, info, size, ret_size ); + diff --git a/include/winternl.h b/include/winternl.h -index 640dbe5db354..1ae249c59404 100644 +index 3ff15f28c15..bcc20b2d99e 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -972,10 +972,32 @@ typedef enum _SYSTEM_INFORMATION_CLASS { +@@ -986,10 +986,32 @@ typedef enum _SYSTEM_INFORMATION_CLASS { SystemSuperfetchInformation = 79, SystemMemoryListInformation = 80, SystemFileCacheInformationEx = 81, @@ -81,5 +82,5 @@ index 640dbe5db354..1ae249c59404 100644 ThreadBasicInformation = 0, ThreadTimes, -- -2.26.2 +2.27.0 diff --git a/patches/ntdll-SystemExtendedProcessInformation/0001-ntdll-Add-stub-for-NtQuerySystemInformation-SystemEx.patch b/patches/ntdll-SystemExtendedProcessInformation/0001-ntdll-Add-stub-for-NtQuerySystemInformation-SystemEx.patch index cdf3324b..bdad3ffa 100644 --- a/patches/ntdll-SystemExtendedProcessInformation/0001-ntdll-Add-stub-for-NtQuerySystemInformation-SystemEx.patch +++ b/patches/ntdll-SystemExtendedProcessInformation/0001-ntdll-Add-stub-for-NtQuerySystemInformation-SystemEx.patch @@ -1,29 +1,30 @@ -From 317b8941e2c36fd568799915c8023332b5054331 Mon Sep 17 00:00:00 2001 +From a74718ea86178b8aa580d542bed872a313bdd546 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 6 Apr 2019 21:31:55 -0500 Subject: [PATCH] ntdll: Add stub for NtQuerySystemInformation(SystemExtendedProcessInformation). --- - dlls/ntdll/nt.c | 5 +++++ - 1 file changed, 5 insertions(+) + dlls/ntdll/unix/system.c | 6 ++++++ + 1 file changed, 6 insertions(+) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index f42934969..c019a9c29 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -2768,6 +2768,11 @@ NTSTATUS WINAPI NtQuerySystemInformation( - } - } +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index 68de16b7e5b..c5b2018bf30 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -2145,6 +2145,12 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, break; + } + + case SystemExtendedProcessInformation: -+ FIXME("SystemExtendedProcessInformation, len %u, buffer %p, stub!\n", Length, SystemInformation); -+ memset(SystemInformation, 0, Length); ++ FIXME("SystemExtendedProcessInformation, size %u, info %p, stub!\n", size, info); ++ memset( info, 0, size ); + ret = STATUS_SUCCESS; + break; ++ default: - FIXME("(0x%08x,%p,0x%08x,%p) stub\n", - SystemInformationClass,SystemInformation,Length,ResultLength); + FIXME( "(0x%08x,%p,0x%08x,%p) stub\n", class, info, size, ret_size ); + -- -2.20.1 +2.27.0 diff --git a/patches/ntdll-SystemInterruptInformation/0001-ntdll-Return-buffer-filled-with-random-values-from-S.patch b/patches/ntdll-SystemInterruptInformation/0001-ntdll-Return-buffer-filled-with-random-values-from-S.patch index e49935a6..086f075e 100644 --- a/patches/ntdll-SystemInterruptInformation/0001-ntdll-Return-buffer-filled-with-random-values-from-S.patch +++ b/patches/ntdll-SystemInterruptInformation/0001-ntdll-Return-buffer-filled-with-random-values-from-S.patch @@ -1,39 +1,38 @@ -From e42cdb8305dcebca77afba4a56e59391f2cb4a38 Mon Sep 17 00:00:00 2001 +From 0cb2647baa3ea72babb05e24d2f1fa23cdedb0a1 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 7 Jan 2016 06:01:01 +0100 -Subject: ntdll: Return buffer filled with random values from +Subject: [PATCH] ntdll: Return buffer filled with random values from SystemInterruptInformation. --- - dlls/ntdll/nt.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) + dlls/ntdll/unix/system.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 9ee1923..fe3e8e8 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -2070,10 +2070,21 @@ NTSTATUS WINAPI NtQuerySystemInformation( +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index 68de16b7e5b..5ba9fb41156 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -2003,8 +2003,20 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, case SystemInterruptInformation: - { - SYSTEM_INTERRUPT_INFORMATION sii; -+ int dev_random; + { + SYSTEM_INTERRUPT_INFORMATION sii = {{ 0 }}; ++ int dev_random; - memset(&sii, 0, sizeof(sii)); - len = sizeof(sii); - -+ /* Some applications use the returned buffer for random number -+ * generation. Its unlikely that an app depends on the exact -+ * layout, so just fill with values from /dev/urandom. */ -+ dev_random = open( "/dev/urandom", O_RDONLY ); -+ if (dev_random != -1) -+ { -+ read( dev_random, &sii, sizeof(sii) ); -+ close( dev_random ); -+ } + len = sizeof(sii); + - if ( Length >= len) - { - if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION; ++ /* Some applications use the returned buffer for random number ++ * generation. Its unlikely that an app depends on the exact ++ * layout, so just fill with values from /dev/urandom. */ ++ dev_random = open( "/dev/urandom", O_RDONLY ); ++ if (dev_random != -1) ++ { ++ read( dev_random, &sii, sizeof(sii) ); ++ close( dev_random ); ++ } ++ + if (size >= len) + { + if (!info) ret = STATUS_ACCESS_VIOLATION; -- -2.6.4 +2.27.0 diff --git a/patches/ntdll-SystemModuleInformation/0001-ntdll-Don-t-call-LdrQueryProcessModuleInformation-in.patch b/patches/ntdll-SystemModuleInformation/0001-ntdll-Don-t-call-LdrQueryProcessModuleInformation-in.patch index 9e03568d..d68b212d 100644 --- a/patches/ntdll-SystemModuleInformation/0001-ntdll-Don-t-call-LdrQueryProcessModuleInformation-in.patch +++ b/patches/ntdll-SystemModuleInformation/0001-ntdll-Don-t-call-LdrQueryProcessModuleInformation-in.patch @@ -1,4 +1,4 @@ -From ee3f09c31baedd50ab53179249b482eb51fcb0f3 Mon Sep 17 00:00:00 2001 +From e2f505d4c63dde39dbbcc215a7801020b04e3c25 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Aug 2018 21:32:56 -0500 Subject: [PATCH] ntdll: Don't call LdrQueryProcessModuleInformation in @@ -12,30 +12,30 @@ This makes the anticheat engine in League of Legends 8.15+ happy. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45550 --- - dlls/ntdll/nt.c | 19 ++++++++++++++++--- + dlls/ntdll/unix/system.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index af22e58..80d3ef8 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -2493,9 +2493,22 @@ NTSTATUS WINAPI NtQuerySystemInformation( - } - break; +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index 68de16b7e5b..a57b040c533 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -1930,9 +1930,22 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, + } + case SystemModuleInformation: - /* FIXME: should be system-wide */ -- if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION; -- else ret = LdrQueryProcessModuleInformation( SystemInformation, Length, &len ); -+ if (!SystemInformation) +- if (!info) ret = STATUS_ACCESS_VIOLATION; +- else ret = LdrQueryProcessModuleInformation( info, size, &len ); ++ if (!info) + ret = STATUS_ACCESS_VIOLATION; -+ else if (Length < FIELD_OFFSET( SYSTEM_MODULE_INFORMATION, Modules[1] )) ++ else if (size < FIELD_OFFSET( SYSTEM_MODULE_INFORMATION, Modules[1] )) + { + len = FIELD_OFFSET( SYSTEM_MODULE_INFORMATION, Modules[1] ); + ret = STATUS_INFO_LENGTH_MISMATCH; + } + else + { -+ SYSTEM_MODULE_INFORMATION *smi = SystemInformation; ++ SYSTEM_MODULE_INFORMATION *smi = info; + + FIXME("returning fake driver list\n"); + smi->ModulesCount = 1; @@ -43,8 +43,8 @@ index af22e58..80d3ef8 100644 + ret = STATUS_SUCCESS; + } break; + case SystemHandleInformation: - { -- -2.7.4 +2.27.0 diff --git a/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch b/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch index 1b4f25b0..64b850e3 100644 --- a/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch +++ b/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch @@ -1,19 +1,19 @@ -From 77f0bfa7bbd70231a661397236124088af1ad76f Mon Sep 17 00:00:00 2001 +From b4fb299179bc4c04fd78909a21b24fd7a6667e4c Mon Sep 17 00:00:00 2001 From: Andrew Wesie Date: Fri, 12 Apr 2019 20:04:03 -0500 Subject: [PATCH] ntdll: Return ntdll.dll as the first entry for SystemModuleInformation. --- - dlls/ntdll/nt.c | 29 ++++++++++++++++++++++++++++- - 1 file changed, 28 insertions(+), 1 deletion(-) + dlls/ntdll/unix/system.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 54626307ede..77db670623c 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -2493,6 +2493,33 @@ BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) - return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature]; +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index a57b040c533..f118db8a89f 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -1630,6 +1630,32 @@ static void get_performance_info( SYSTEM_PERFORMANCE_INFORMATION *info ) + info->TotalCommitLimit = (totalram + totalswap) / page_size; } +static void get_ntdll_system_module(SYSTEM_MODULE *sm) @@ -42,11 +42,10 @@ index 54626307ede..77db670623c 100644 + ptr = strrchr(str.Buffer, '\\'); + sm->NameOffset = (ptr != NULL) ? (ptr - str.Buffer + 1) : 0; +} -+ + /****************************************************************************** - * NtQuerySystemInformation [NTDLL.@] - * ZwQuerySystemInformation [NTDLL.@] -@@ -2829,7 +2856,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( + * NtQuerySystemInformation (NTDLL.@) +@@ -1943,7 +1969,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, FIXME("returning fake driver list\n"); smi->ModulesCount = 1; diff --git a/patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch b/patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch index fd52fcfa..5657b038 100644 --- a/patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch +++ b/patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch @@ -1,33 +1,33 @@ -From 120d2e0cf3f75c087be14f65953980f5605f652e Mon Sep 17 00:00:00 2001 +From ab068a620223a6566c2a1d089fb4583992359bd2 Mon Sep 17 00:00:00 2001 From: Andrew Wesie Date: Fri, 12 Apr 2019 20:06:08 -0500 Subject: [PATCH] ntdll: Add stub for NtQuerySystemInformation(SystemModuleInformationEx). --- - dlls/ntdll/nt.c | 21 +++++++++++++++++++++ - include/winternl.h | 9 +++++++++ - 2 files changed, 30 insertions(+) + dlls/ntdll/unix/system.c | 22 ++++++++++++++++++++++ + include/winternl.h | 9 +++++++++ + 2 files changed, 31 insertions(+) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 3ce1b344dbd..935c6abec7f 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -3008,6 +3008,27 @@ NTSTATUS WINAPI NtQuerySystemInformation( - ret = STATUS_SUCCESS; +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index f118db8a89f..eecde7dcf97 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -1974,6 +1974,28 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, } break; + + case SystemModuleInformationEx: -+ if (!SystemInformation) ++ if (!info) + ret = STATUS_ACCESS_VIOLATION; -+ else if (Length < sizeof(SYSTEM_MODULE_INFORMATION_EX)) ++ else if (size < sizeof(SYSTEM_MODULE_INFORMATION_EX)) + { + len = sizeof(SYSTEM_MODULE_INFORMATION_EX); + ret = STATUS_INFO_LENGTH_MISMATCH; + } + else + { -+ SYSTEM_MODULE_INFORMATION_EX *info = SystemInformation; ++ SYSTEM_MODULE_INFORMATION_EX *info = info; + + FIXME("info_class SystemModuleInformationEx stub!\n"); + get_ntdll_system_module(&info->BaseInfo); @@ -38,14 +38,15 @@ index 3ce1b344dbd..935c6abec7f 100644 + ret = STATUS_SUCCESS; + } + break; ++ case SystemHandleInformation: - { - struct handle_info *info; + { + struct handle_info *handle_info; diff --git a/include/winternl.h b/include/winternl.h -index d315d68be8f..d2d1001897d 100644 +index 3ff15f28c15..879b0931fc5 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -2478,6 +2478,15 @@ typedef struct _SYSTEM_MODULE_INFORMATION +@@ -2469,6 +2469,15 @@ typedef struct _SYSTEM_MODULE_INFORMATION #define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200 #define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400 @@ -62,5 +63,5 @@ index d315d68be8f..d2d1001897d 100644 #define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002 #define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004 -- -2.26.2 +2.27.0 diff --git a/patches/ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch b/patches/ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch deleted file mode 100644 index df399d3d..00000000 --- a/patches/ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 263b120ed5f5e9464f240e42800ab63752d16b96 Mon Sep 17 00:00:00 2001 -From: David Torok -Date: Tue, 19 Nov 2019 23:01:46 +0100 -Subject: [PATCH] ntdll: Stub NtQueryInformationThread(ThreadHideFromDebugger). - ---- - dlls/ntdll/unix/thread.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c -index d26e0a98cac..e2a092e30a8 100644 ---- a/dlls/ntdll/unix/thread.c -+++ b/dlls/ntdll/unix/thread.c -@@ -1063,6 +1063,11 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, - #endif - } - -+ case ThreadHideFromDebugger: -+ if (length != sizeof(BOOLEAN)) return STATUS_INFO_LENGTH_MISMATCH; -+ *(BOOLEAN *)data = TRUE; -+ if (ret_len) *ret_len = sizeof(BOOLEAN); -+ return STATUS_SUCCESS; - case ThreadPriority: - case ThreadBasePriority: - case ThreadImpersonationToken: --- -2.27.0 - diff --git a/patches/ntdll-ThreadHideFromDebugger/definition b/patches/ntdll-ThreadHideFromDebugger/definition deleted file mode 100644 index 24a72f4e..00000000 --- a/patches/ntdll-ThreadHideFromDebugger/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [48138] League of Legends 9.23: Crash after champ select diff --git a/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch b/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch index 6cd4783d..1b1f2bb5 100644 --- a/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch +++ b/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch @@ -1,4 +1,4 @@ -From 9cdc9d195760a55263ba0bb7926e6e4d776cbd04 Mon Sep 17 00:00:00 2001 +From 2efee8f30caa027977f7cfb91a84b748a5fd17cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 4 Oct 2014 02:53:22 +0200 Subject: [PATCH] ntdll: Setup a temporary signal handler during process @@ -14,19 +14,19 @@ Subject: [PATCH] ntdll: Setup a temporary signal handler during process 6 files changed, 73 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c -index 4db78fec823..91b98c44b3f 100644 +index 73c24eff549..8881d073684 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c -@@ -1244,6 +1244,7 @@ void __wine_main( int argc, char *argv[], char *envp[] ) +@@ -1761,6 +1761,7 @@ void __wine_main( int argc, char *argv[], char *envp[] ) #endif virtual_init(); + signal_init_early(); - module = load_ntdll(); - fixup_ntdll_imports( &__wine_spec_nt_header, module ); + ntdll_module = load_ntdll(); + fixup_ntdll_imports( &__wine_spec_nt_header ); diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c -index faa2952a483..43e0fb848a3 100644 +index e65b8a93d18..d7a9323a195 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -869,6 +869,12 @@ void signal_init_process(void) @@ -43,7 +43,7 @@ index faa2952a483..43e0fb848a3 100644 /*********************************************************************** * init_thread_context diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c -index e2c52a1a4f6..f3c67e1f5f4 100644 +index 7f8fb708ccd..574633dbd5d 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -791,6 +791,13 @@ void signal_init_process(void) @@ -61,7 +61,7 @@ index e2c52a1a4f6..f3c67e1f5f4 100644 * init_thread_context */ diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c -index adf622ca673..44d0848a1ee 100644 +index 2f5d397ed55..c29a006736a 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1644,6 +1644,30 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st @@ -131,7 +131,7 @@ index adf622ca673..44d0848a1ee 100644 /*********************************************************************** * init_thread_context diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c -index 1bf8f5e8b8e..73c6ba4c34e 100644 +index 88ee18461a2..dedc17bf60e 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1415,6 +1415,12 @@ void signal_init_process(void) @@ -148,10 +148,10 @@ index 1bf8f5e8b8e..73c6ba4c34e 100644 /*********************************************************************** * init_thread_context diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 95d4e2c2441..d88cf97f4b7 100644 +index 7dbfde43b34..fbcd200c420 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -193,6 +193,7 @@ extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN; +@@ -207,6 +207,7 @@ extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN; extern void signal_free_thread( TEB *teb ) DECLSPEC_HIDDEN; extern void signal_init_thread( TEB *teb ) DECLSPEC_HIDDEN; extern void signal_init_process(void) DECLSPEC_HIDDEN; diff --git a/patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch b/patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch index 80c23f58..0f4a4abf 100644 --- a/patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch +++ b/patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch @@ -1,4 +1,4 @@ -From 8fe1b6c64671ab1fc5af0099b23021eae0a046d7 Mon Sep 17 00:00:00 2001 +From d1536aa5b9df87c3764dc2090bdde76f708fda94 Mon Sep 17 00:00:00 2001 From: Qian Hong Date: Wed, 9 Sep 2015 05:31:18 +0800 Subject: [PATCH] ntdll: Initialize mod_name to zero. @@ -8,11 +8,11 @@ Subject: [PATCH] ntdll: Initialize mod_name to zero. 1 file changed, 2 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 0568be63ad8..98472b060e1 100644 +index 42cdc628021..ef1e28af2e7 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -1363,6 +1363,8 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved - if (wm->so_handle && reason == DLL_PROCESS_ATTACH) call_constructors( wm ); +@@ -1299,6 +1299,8 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved + unix_funcs->init_builtin_dll( wm->ldr.DllBase ); if (!entry) return STATUS_SUCCESS; + memset( mod_name, 0, sizeof(mod_name) ); @@ -21,5 +21,5 @@ index 0568be63ad8..98472b060e1 100644 { size_t len = min( wm->ldr.BaseDllName.Length, sizeof(mod_name)-sizeof(WCHAR) ); -- -2.26.0 +2.27.0 diff --git a/patches/ntdll-aarch-TEB/0002-ntdll-Always-restore-TEB-to-x18-on-aarch-64-on-retur.patch b/patches/ntdll-aarch-TEB/0002-ntdll-Always-restore-TEB-to-x18-on-aarch-64-on-retur.patch index 25268c38..28c8daa3 100644 --- a/patches/ntdll-aarch-TEB/0002-ntdll-Always-restore-TEB-to-x18-on-aarch-64-on-retur.patch +++ b/patches/ntdll-aarch-TEB/0002-ntdll-Always-restore-TEB-to-x18-on-aarch-64-on-retur.patch @@ -1,4 +1,4 @@ -From e25066ea9c9e0442d4c18c13818071c104a9c5d2 Mon Sep 17 00:00:00 2001 +From f8c60f99727799ff3d5910e99155db0a356e4d77 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Wed, 16 Aug 2017 23:48:40 +0300 Subject: [PATCH] ntdll: Always restore TEB to x18 on aarch 64 on return from @@ -20,24 +20,24 @@ Signed-off-by: Martin Storsjo 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 0568be63ad8..b7612dcc9a7 100644 +index 42cdc628021..7b92330e874 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -2036,7 +2036,13 @@ static NTSTATUS build_so_dll_module( const WCHAR *load_path, const UNICODE_STRIN - SERVER_END_REQ; +@@ -1924,7 +1924,13 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, - /* setup relay debugging entry points */ -- if (TRACE_ON(relay)) RELAY_SetupDLL( module ); + if (image_info->image_flags & IMAGE_FLAGS_WineBuiltin) + { +- if (TRACE_ON(relay)) RELAY_SetupDLL( *module ); +#ifdef __aarch64__ -+ /* Always enable relay entry points on aarch64, to allow restoring -+ * the TEB to x18. */ ++ /* Always enable relay entry points on aarch64, to allow restoring ++ * the TEB to x18. */ +#else -+ if (TRACE_ON(relay)) ++ if (TRACE_ON(relay)) +#endif -+ RELAY_SetupDLL( module ); - - *pwm = wm; - return STATUS_SUCCESS; ++ RELAY_SetupDLL( *module ); + } + else + { diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index acccf088811..35dd4161d8b 100644 --- a/dlls/ntdll/relay.c @@ -56,5 +56,5 @@ index acccf088811..35dd4161d8b 100644 } -- -2.26.0 +2.27.0 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 00d97d7a..374c6f5c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "449b8c7e9212d0a80e28babff20f2755b7370872" + echo "bc282905d9491b9f9fe4ae4b69a8ccdf99c5aaa8" } # Show version information @@ -196,7 +196,6 @@ patch_enable_all () enable_ntdll_SystemInterruptInformation="$1" enable_ntdll_SystemModuleInformation="$1" enable_ntdll_SystemRoot_Symlink="$1" - enable_ntdll_ThreadHideFromDebugger="$1" enable_ntdll_Threading="$1" enable_ntdll_WRITECOPY="$1" enable_ntdll_Zero_mod_name="$1" @@ -681,9 +680,6 @@ patch_enable () ntdll-SystemRoot_Symlink) enable_ntdll_SystemRoot_Symlink="$2" ;; - ntdll-ThreadHideFromDebugger) - enable_ntdll_ThreadHideFromDebugger="$2" - ;; ntdll-Threading) enable_ntdll_Threading="$2" ;; @@ -1577,6 +1573,13 @@ if test "$enable_shell32_Progress_Dialog" -eq 1; then enable_shell32_SHFileOperation_Move=1 fi +if test "$enable_server_Object_Types" -eq 1; then + if test "$enable_ntdll_SystemModuleInformation" -gt 1; then + abort "Patchset ntdll-SystemModuleInformation disabled, but server-Object_Types depends on that." + fi + enable_ntdll_SystemModuleInformation=1 +fi + if test "$enable_server_Inherited_ACLs" -eq 1; then if test "$enable_server_Stored_ACLs" -gt 1; then abort "Patchset server-Stored_ACLs disabled, but server-Inherited_ACLs depends on that." @@ -1645,12 +1648,16 @@ if test "$enable_ntdll_Syscall_Emulation" -eq 1; then fi if test "$enable_winebuild_Fake_Dlls" -eq 1; then + if test "$enable_ntdll_ApiSetMap" -gt 1; then + abort "Patchset ntdll-ApiSetMap disabled, but winebuild-Fake_Dlls depends on that." + fi if test "$enable_ntdll_WRITECOPY" -gt 1; then abort "Patchset ntdll-WRITECOPY disabled, but winebuild-Fake_Dlls depends on that." fi if test "$enable_ws2_32_WSACleanup" -gt 1; then abort "Patchset ws2_32-WSACleanup disabled, but winebuild-Fake_Dlls depends on that." fi + enable_ntdll_ApiSetMap=1 enable_ntdll_WRITECOPY=1 enable_ws2_32_WSACleanup=1 fi @@ -2691,16 +2698,10 @@ fi # | * dlls/directmanipulation/directmanipulation.c # | if test "$enable_directmanipulation_new_dll" -eq 1; then - patch_apply directmanipulation-new-dll/0011-directmanipulation-Implement-IDirectManipulationMana.patch patch_apply directmanipulation-new-dll/0013-directmanipulation-Fake-success-from-IDirectManipula.patch - patch_apply directmanipulation-new-dll/0015-directmanipulation-Implement-IDirectManipulationView.patch - patch_apply directmanipulation-new-dll/0016-directmanipulation-Support-IDirectManipulationConten.patch patch_apply directmanipulation-new-dll/0017-directmanipulation-Fake-success-in-some-functions.patch ( - printf '%s\n' '+ { "Alistair Leslie-Hughes", "directmanipulation: Implement IDirectManipulationManager2 CreateViewport.", 1 },'; printf '%s\n' '+ { "Alistair Leslie-Hughes", "directmanipulation: Fake success from IDirectManipulationViewport2 ActivateConfiguration.", 1 },'; - printf '%s\n' '+ { "Alistair Leslie-Hughes", "directmanipulation: Implement IDirectManipulationViewport2 GetPrimaryContent.", 1 },'; - printf '%s\n' '+ { "Alistair Leslie-Hughes", "directmanipulation: Support IDirectManipulationContent in IDirectManipulationPrimaryContent interface.", 1 },'; printf '%s\n' '+ { "Alistair Leslie-Hughes", "directmanipulation: Fake success in some functions.", 1 },'; ) >> "$patchlist" fi @@ -3916,7 +3917,7 @@ fi # Patchset winebuild-Fake_Dlls # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-WRITECOPY, ws2_32-WSACleanup +# | * ntdll-ApiSetMap, ntdll-WRITECOPY, ws2_32-WSACleanup # | # | This patchset fixes the following Wine bugs: # | * [#21232] Chromium-based browser engines (Chrome, Opera, Comodo Dragon, SRWare Iron) crash on startup unless '--no- @@ -3968,7 +3969,7 @@ fi # Patchset ntdll-Syscall_Emulation # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-WRITECOPY, ws2_32-WSACleanup, winebuild-Fake_Dlls +# | * ntdll-ApiSetMap, ntdll-WRITECOPY, ws2_32-WSACleanup, winebuild-Fake_Dlls # | # | This patchset fixes the following Wine bugs: # | * [#48291] Detroit: Become Human crashes on launch @@ -3991,7 +3992,7 @@ fi # | SystemExtendedProcessInformation) # | # | Modified files: -# | * dlls/ntdll/nt.c +# | * dlls/ntdll/unix/system.c # | if test "$enable_ntdll_SystemExtendedProcessInformation" -eq 1; then patch_apply ntdll-SystemExtendedProcessInformation/0001-ntdll-Add-stub-for-NtQuerySystemInformation-SystemEx.patch @@ -4009,7 +4010,7 @@ fi # | * [#49192] ntdll: NtQuerySystemInformation support SystemCodeIntegrityInformation # | # | Modified files: -# | * dlls/ntdll/nt.c, include/winternl.h +# | * dlls/ntdll/unix/system.c, include/winternl.h # | if test "$enable_ntdll_SystemCodeIntegrityInformation" -eq 1; then patch_apply ntdll-SystemCodeIntegrityInformation/0001-ntdll-NtQuerySystemInformation-support-SystemCodeInt.patch @@ -4024,7 +4025,7 @@ fi # | * [#39123] Return buffer filled with random values from SystemInterruptInformation # | # | Modified files: -# | * dlls/ntdll/nt.c +# | * dlls/ntdll/unix/system.c # | if test "$enable_ntdll_SystemInterruptInformation" -eq 1; then patch_apply ntdll-SystemInterruptInformation/0001-ntdll-Return-buffer-filled-with-random-values-from-S.patch @@ -4042,7 +4043,7 @@ fi # | NtQuerySystemInformation(SystemModuleInformationEx) in Windows Vista+ mode # | # | Modified files: -# | * dlls/ntdll/nt.c, include/winternl.h +# | * dlls/ntdll/unix/system.c, include/winternl.h # | if test "$enable_ntdll_SystemModuleInformation" -eq 1; then patch_apply ntdll-SystemModuleInformation/0001-ntdll-Don-t-call-LdrQueryProcessModuleInformation-in.patch @@ -4067,21 +4068,6 @@ if test "$enable_ntdll_SystemRoot_Symlink" -eq 1; then ) >> "$patchlist" fi -# Patchset ntdll-ThreadHideFromDebugger -# | -# | This patchset fixes the following Wine bugs: -# | * [#48138] League of Legends 9.23: Crash after champ select -# | -# | Modified files: -# | * dlls/ntdll/unix/thread.c -# | -if test "$enable_ntdll_ThreadHideFromDebugger" -eq 1; then - patch_apply ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch - ( - printf '%s\n' '+ { "David Torok", "ntdll: Stub NtQueryInformationThread(ThreadHideFromDebugger).", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-Threading # | # | Modified files: @@ -4429,21 +4415,19 @@ fi # | * [#46967] GOG Galaxy doesn't run in virtual desktop. # | # | Modified files: -# | * dlls/user32/tests/winstation.c, programs/explorer/desktop.c, server/async.c, server/atom.c, server/change.c, -# | server/clipboard.c, server/completion.c, server/console.c, server/debugger.c, server/device.c, server/directory.c, -# | server/event.c, server/fd.c, server/file.c, server/handle.c, server/handle.h, server/hook.c, server/mailslot.c, -# | server/mapping.c, server/mutex.c, server/named_pipe.c, server/object.c, server/object.h, server/process.c, -# | server/queue.c, server/registry.c, server/request.c, server/semaphore.c, server/serial.c, server/signal.c, -# | server/snapshot.c, server/sock.c, server/symlink.c, server/thread.c, server/timer.c, server/token.c, server/winstation.c +# | * programs/explorer/desktop.c, server/async.c, server/atom.c, server/change.c, server/clipboard.c, server/completion.c, +# | server/console.c, server/debugger.c, server/device.c, server/directory.c, server/event.c, server/fd.c, server/file.c, +# | server/handle.c, server/handle.h, server/hook.c, server/mailslot.c, server/mapping.c, server/mutex.c, +# | server/named_pipe.c, server/object.c, server/object.h, server/process.c, server/queue.c, server/registry.c, +# | server/request.c, server/semaphore.c, server/serial.c, server/signal.c, server/snapshot.c, server/sock.c, +# | server/symlink.c, server/thread.c, server/timer.c, server/token.c, server/winstation.c # | if test "$enable_server_Desktop_Refcount" -eq 1; then patch_apply server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch patch_apply server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch - patch_apply server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch ( printf '%s\n' '+ { "Sebastian Lackner", "server: Introduce a new alloc_handle object callback.", 2 },'; printf '%s\n' '+ { "Sebastian Lackner", "server: Track desktop handle count more correctly.", 1 },'; - printf '%s\n' '+ { "Sebastian Lackner", "server: Assign random name when no name was passed to create_winstation.", 1 },'; ) >> "$patchlist" fi @@ -4559,12 +4543,15 @@ fi # Patchset server-Object_Types # | +# | This patchset has the following (direct or indirect) dependencies: +# | * ntdll-SystemModuleInformation +# | # | This patchset fixes the following Wine bugs: # | * [#44629] Process Hacker can't enumerate handles # | * [#45374] Yet Another Process Monitor (.NET 2.0 app) reports System.AccessViolationException # | # | Modified files: -# | * dlls/ntdll/nt.c, dlls/ntdll/om.c, dlls/ntdll/tests/info.c, dlls/ntdll/tests/om.c, include/winternl.h, +# | * dlls/ntdll/om.c, dlls/ntdll/tests/info.c, dlls/ntdll/tests/om.c, dlls/ntdll/unix/system.c, include/winternl.h, # | server/completion.c, server/directory.c, server/event.c, server/file.c, server/handle.c, server/mailslot.c, # | server/main.c, server/mapping.c, server/mutex.c, server/named_pipe.c, server/object.c, server/object.h, # | server/process.c, server/protocol.def, server/registry.c, server/semaphore.c, server/symlink.c, server/thread.c, @@ -5330,15 +5317,12 @@ fi # | # | Modified files: # | * dlls/dinput/device_private.h, dlls/dinput/dinput_main.c, dlls/dinput/mouse.c, dlls/dinput8/tests/device.c, -# | dlls/user32/input.c, dlls/user32/rawinput.c, dlls/user32/tests/input.c, dlls/user32/user32.spec, -# | dlls/wineandroid.drv/keyboard.c, dlls/wineandroid.drv/window.c, dlls/winemac.drv/ime.c, dlls/winemac.drv/keyboard.c, -# | dlls/winemac.drv/mouse.c, dlls/winex11.drv/event.c, dlls/winex11.drv/keyboard.c, dlls/winex11.drv/mouse.c, -# | dlls/winex11.drv/x11drv.h, dlls/winex11.drv/x11drv_main.c, include/winuser.h, server/protocol.def, server/queue.c +# | dlls/user32/input.c, dlls/user32/rawinput.c, dlls/user32/user32.spec, dlls/wineandroid.drv/keyboard.c, +# | dlls/wineandroid.drv/window.c, dlls/winemac.drv/ime.c, dlls/winemac.drv/keyboard.c, dlls/winemac.drv/mouse.c, +# | dlls/winex11.drv/event.c, dlls/winex11.drv/keyboard.c, dlls/winex11.drv/mouse.c, dlls/winex11.drv/x11drv.h, +# | dlls/winex11.drv/x11drv_main.c, include/winuser.h, server/protocol.def, server/queue.c # | if test "$enable_user32_rawinput_mouse" -eq 1; then - patch_apply user32-rawinput-mouse/0001-user32-tests-Add-rawinput-test-for-ClipCursor-intera.patch - patch_apply user32-rawinput-mouse/0002-user32-tests-Add-rawinput-test-for-cross-thread-inte.patch - patch_apply user32-rawinput-mouse/0003-user32-tests-Add-rawinput-test-for-cross-process-int.patch patch_apply user32-rawinput-mouse/0004-server-Add-send_hardware_message-flags-for-rawinput-.patch patch_apply user32-rawinput-mouse/0005-server-Broadcast-rawinput-message-if-request-flag-is.patch patch_apply user32-rawinput-mouse/0006-user32-Add-__wine_send_input-flags-to-hint-raw-input.patch @@ -5350,9 +5334,6 @@ if test "$enable_user32_rawinput_mouse" -eq 1; then patch_apply user32-rawinput-mouse/0012-dinput8-Use-raw-input-interface-for-dinput8-mouse-de.patch patch_apply user32-rawinput-mouse/0013-dinput-Fix-rawinput-events-sequence-number.patch ( - printf '%s\n' '+ { "Rémi Bernon", "user32/tests: Add rawinput test for ClipCursor interactions.", 1 },'; - printf '%s\n' '+ { "Rémi Bernon", "user32/tests: Add rawinput test for cross-thread interactions.", 1 },'; - printf '%s\n' '+ { "Rémi Bernon", "user32/tests: Add rawinput test for cross-process interactions.", 1 },'; printf '%s\n' '+ { "Rémi Bernon", "server: Add send_hardware_message flags for rawinput translation.", 1 },'; printf '%s\n' '+ { "Rémi Bernon", "server: Broadcast rawinput message if request flag is SEND_HWMSG_RAWINPUT.", 1 },'; printf '%s\n' '+ { "Rémi Bernon", "user32: Add __wine_send_input flags to hint raw input translation.", 1 },'; diff --git a/patches/server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch b/patches/server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch deleted file mode 100644 index 1e42ba5c..00000000 --- a/patches/server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 64f380eeb8ba1de36b47b6035510373fd1edeaac Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Wed, 24 Feb 2016 19:18:52 +0100 -Subject: [PATCH] server: Assign random name when no name was passed to - create_winstation. - ---- - dlls/user32/tests/winstation.c | 4 ++-- - server/winstation.c | 23 ++++++++++++++++++++++- - 2 files changed, 24 insertions(+), 3 deletions(-) - -diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c -index 4aa5565b96c..9eb3b433c11 100644 ---- a/dlls/user32/tests/winstation.c -+++ b/dlls/user32/tests/winstation.c -@@ -225,8 +225,8 @@ static void test_handles(void) - memset( buffer, 0, sizeof(buffer) ); - ret = GetUserObjectInformationA( w2, UOI_NAME, buffer, sizeof(buffer), &size ); - ok( ret, "GetUserObjectInformationA failed with error %u\n", GetLastError() ); -- todo_wine ok( !memcmp(buffer, "Service-0x0-", 12), "unexpected window station name '%s'\n", buffer ); -- todo_wine ok( buffer[strlen(buffer) - 1] == '$', "unexpected window station name '%s'\n", buffer ); -+ ok( !memcmp(buffer, "Service-0x0-", 12), "unexpected window station name '%s'\n", buffer ); -+ ok( buffer[strlen(buffer) - 1] == '$', "unexpected window station name '%s'\n", buffer ); - - SetLastError( 0xdeadbeef ); - w3 = OpenWindowStationA( "", TRUE, WINSTA_ALL_ACCESS ); -diff --git a/server/winstation.c b/server/winstation.c -index b120859b39a..fee8980224c 100644 ---- a/server/winstation.c -+++ b/server/winstation.c -@@ -38,6 +38,7 @@ - #include "user.h" - #include "file.h" - #include "security.h" -+#include "unicode.h" - - - static struct list winstation_list = LIST_INIT(winstation_list); -@@ -114,9 +115,28 @@ static const struct object_ops desktop_ops = - static struct winstation *create_winstation( struct object *root, const struct unicode_str *name, - unsigned int attr, unsigned int flags ) - { -+ static unsigned int id = 0x10000; - struct winstation *winstation; -+ struct unicode_str default_name; -+ char buffer[32]; - -- if ((winstation = create_named_object( root, &winstation_ops, name, attr, NULL ))) -+ if (name->len) -+ { -+ winstation = create_named_object( root, &winstation_ops, name, attr, NULL ); -+ goto done; -+ } -+ -+ do -+ { -+ if (!++id) id = 1; /* avoid an id of 0 */ -+ sprintf( buffer, "Service-0x0-%x$", id); -+ ascii_to_unicode_str( buffer, &default_name ); -+ winstation = create_named_object( root, &winstation_ops, &default_name, attr & ~OBJ_OPENIF, NULL ); -+ } -+ while (!winstation && get_error() == STATUS_OBJECT_NAME_COLLISION); -+ -+done: -+ if (winstation) - { - if (get_error() != STATUS_OBJECT_NAME_EXISTS) - { -@@ -134,6 +154,7 @@ static struct winstation *create_winstation( struct object *root, const struct u - } - else clear_error(); - } -+ - return winstation; - } - --- -2.25.1 - diff --git a/patches/server-Desktop_Refcount/definition b/patches/server-Desktop_Refcount/definition index 413dc31a..03d22d5f 100644 --- a/patches/server-Desktop_Refcount/definition +++ b/patches/server-Desktop_Refcount/definition @@ -1,4 +1,3 @@ Fixes: Fix possible leak of explorer.exe processes and implement proper desktop refcounting -Fixes: Assign random name when trying to create Window Station without name Fixes: [46967] GOG Galaxy doesn't run in virtual desktop. Depends: ws2_32-WSACleanup diff --git a/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch b/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch index 3b9b864c..f88a5491 100644 --- a/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch +++ b/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch @@ -1,82 +1,20 @@ -From 0384d32afa328e76bff7f8e508201ce2535ee763 Mon Sep 17 00:00:00 2001 +From e57cb9c97ea1147595a9c29e236515a2be69f9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 7 Mar 2017 18:30:33 +0100 -Subject: ntdll: Implement SystemExtendedHandleInformation in +Subject: [PATCH] ntdll: Implement SystemExtendedHandleInformation in NtQuerySystemInformation. --- - dlls/ntdll/nt.c | 51 +++++++++++++++++++++++++++++++++++++++++ - dlls/ntdll/tests/info.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ - include/winternl.h | 21 +++++++++++++++++ - 3 files changed, 132 insertions(+) + dlls/ntdll/tests/info.c | 60 ++++++++++++++++++++++++++++++++++++++++ + dlls/ntdll/unix/system.c | 52 ++++++++++++++++++++++++++++++++++ + include/winternl.h | 21 ++++++++++++++ + 3 files changed, 133 insertions(+) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index de8f16f9a0..a939298d19 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -2294,6 +2294,57 @@ NTSTATUS WINAPI NtQuerySystemInformation( - RtlFreeHeap( GetProcessHeap(), 0, info ); - } - break; -+ case SystemExtendedHandleInformation: -+ { -+ struct handle_info *info; -+ DWORD i, num_handles; -+ -+ if (Length < sizeof(SYSTEM_HANDLE_INFORMATION_EX)) -+ { -+ ret = STATUS_INFO_LENGTH_MISMATCH; -+ break; -+ } -+ -+ if (!SystemInformation) -+ { -+ ret = STATUS_ACCESS_VIOLATION; -+ break; -+ } -+ -+ num_handles = (Length - FIELD_OFFSET( SYSTEM_HANDLE_INFORMATION_EX, Handle )); -+ num_handles /= sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX); -+ if (!(info = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*info) * num_handles ))) -+ return STATUS_NO_MEMORY; -+ -+ SERVER_START_REQ( get_system_handles ) -+ { -+ wine_server_set_reply( req, info, sizeof(*info) * num_handles ); -+ if (!(ret = wine_server_call( req ))) -+ { -+ SYSTEM_HANDLE_INFORMATION_EX *shi = SystemInformation; -+ shi->Count = wine_server_reply_size( req ) / sizeof(*info); -+ shi->Reserved = 0; -+ len = FIELD_OFFSET( SYSTEM_HANDLE_INFORMATION_EX, Handle[shi->Count] ); -+ for (i = 0; i < shi->Count; i++) -+ { -+ memset( &shi->Handle[i], 0, sizeof(shi->Handle[i]) ); -+ shi->Handle[i].UniqueProcessId = info[i].owner; -+ shi->Handle[i].HandleValue = info[i].handle; -+ shi->Handle[i].GrantedAccess = info[i].access; -+ /* FIXME: Fill out remaining fields */ -+ } -+ } -+ else if (ret == STATUS_BUFFER_TOO_SMALL) -+ { -+ len = FIELD_OFFSET( SYSTEM_HANDLE_INFORMATION_EX, Handle[reply->count] ); -+ ret = STATUS_INFO_LENGTH_MISMATCH; -+ } -+ } -+ SERVER_END_REQ; -+ -+ RtlFreeHeap( GetProcessHeap(), 0, info ); -+ } -+ break; - case SystemCacheInformation: - { - SYSTEM_CACHE_INFORMATION sci; diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c -index 32cb4f5a5d..c65a74bf5e 100644 +index eaf2f1a45b7..1728ab82225 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c -@@ -561,6 +561,62 @@ done: +@@ -662,6 +662,62 @@ done: HeapFree( GetProcessHeap(), 0, shi); } @@ -139,7 +77,7 @@ index 32cb4f5a5d..c65a74bf5e 100644 static void test_query_cache(void) { NTSTATUS status; -@@ -2147,6 +2203,10 @@ START_TEST(info) +@@ -2715,6 +2771,10 @@ START_TEST(info) trace("Starting test_query_handle()\n"); test_query_handle(); @@ -150,11 +88,74 @@ index 32cb4f5a5d..c65a74bf5e 100644 /* 0x15 SystemCacheInformation */ trace("Starting test_query_cache()\n"); test_query_cache(); +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index 5ba9fb41156..df4e11a0f56 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -1985,6 +1985,58 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, + break; + } + ++ case SystemExtendedHandleInformation: ++ { ++ struct handle_info *handle_info; ++ DWORD i, num_handles; ++ ++ if (size < sizeof(SYSTEM_HANDLE_INFORMATION_EX)) ++ { ++ ret = STATUS_INFO_LENGTH_MISMATCH; ++ break; ++ } ++ ++ if (!info) ++ { ++ ret = STATUS_ACCESS_VIOLATION; ++ break; ++ } ++ ++ num_handles = size - FIELD_OFFSET( SYSTEM_HANDLE_INFORMATION_EX, Handle ); ++ num_handles /= sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX); ++ if (!(handle_info = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*handle_info) * num_handles ))) ++ return STATUS_NO_MEMORY; ++ ++ SERVER_START_REQ( get_system_handles ) ++ { ++ wine_server_set_reply( req, handle_info, sizeof(*handle_info) * num_handles ); ++ if (!(ret = wine_server_call( req ))) ++ { ++ SYSTEM_HANDLE_INFORMATION_EX *shi = info; ++ shi->Count = wine_server_reply_size( req ) / sizeof(*handle_info); ++ shi->Reserved = 0; ++ len = FIELD_OFFSET( SYSTEM_HANDLE_INFORMATION_EX, Handle[shi->Count] ); ++ for (i = 0; i < shi->Count; i++) ++ { ++ memset( &shi->Handle[i], 0, sizeof(shi->Handle[i]) ); ++ shi->Handle[i].UniqueProcessId = handle_info[i].owner; ++ shi->Handle[i].HandleValue = handle_info[i].handle; ++ shi->Handle[i].GrantedAccess = handle_info[i].access; ++ /* FIXME: Fill out remaining fields */ ++ } ++ } ++ else if (ret == STATUS_BUFFER_TOO_SMALL) ++ { ++ len = FIELD_OFFSET( SYSTEM_HANDLE_INFORMATION_EX, Handle[reply->count] ); ++ ret = STATUS_INFO_LENGTH_MISMATCH; ++ } ++ } ++ SERVER_END_REQ; ++ ++ RtlFreeHeap( GetProcessHeap(), 0, handle_info ); ++ break; ++ } ++ + case SystemCacheInformation: + { + SYSTEM_CACHE_INFORMATION sci = { 0 }; diff --git a/include/winternl.h b/include/winternl.h -index 87b2c4d253..7ffe4f6c81 100644 +index 3ff15f28c15..66cd05dac15 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -1442,6 +1442,27 @@ typedef struct _SYSTEM_HANDLE_INFORMATION { +@@ -1531,6 +1531,27 @@ typedef struct _SYSTEM_HANDLE_INFORMATION { SYSTEM_HANDLE_ENTRY Handle[1]; } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; @@ -183,5 +184,5 @@ index 87b2c4d253..7ffe4f6c81 100644 typedef struct _SYSTEM_CACHE_INFORMATION { -- -2.11.0 +2.27.0 diff --git a/patches/server-Object_Types/0009-ntdll-Set-object-type-for-System-Extended-HandleInfo.patch b/patches/server-Object_Types/0009-ntdll-Set-object-type-for-System-Extended-HandleInfo.patch index 72db5626..7eeb98f0 100644 --- a/patches/server-Object_Types/0009-ntdll-Set-object-type-for-System-Extended-HandleInfo.patch +++ b/patches/server-Object_Types/0009-ntdll-Set-object-type-for-System-Extended-HandleInfo.patch @@ -1,44 +1,44 @@ -From ba10e334a375c7dde7cd890554fbbade1be81a9d Mon Sep 17 00:00:00 2001 +From f4c44206896c0fdbcff7c465e631acff98bc920e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 8 Mar 2017 17:44:17 +0100 -Subject: ntdll: Set object type for System(Extended)HandleInformation in - NtQuerySystemInformation. +Subject: [PATCH] ntdll: Set object type for System(Extended)HandleInformation + in NtQuerySystemInformation. --- - dlls/ntdll/nt.c | 4 +++- - server/directory.c | 6 ++++++ - server/handle.c | 10 ++++++++++ - server/object.h | 1 + - server/protocol.def | 1 + + dlls/ntdll/unix/system.c | 4 +++- + server/directory.c | 6 ++++++ + server/handle.c | 10 ++++++++++ + server/object.h | 1 + + server/protocol.def | 1 + 5 files changed, 21 insertions(+), 1 deletion(-) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index a939298d19..211b67f98b 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -2280,7 +2280,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( - shi->Handle[i].OwnerPid = info[i].owner; - shi->Handle[i].HandleValue = info[i].handle; - shi->Handle[i].AccessMask = info[i].access; -- /* FIXME: Fill out ObjectType, HandleFlags, ObjectPointer */ -+ shi->Handle[i].ObjectType = info[i].type; -+ /* FIXME: Fill out HandleFlags, ObjectPointer */ - } +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index 34cea04f852..7ae3f12753b 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -1970,7 +1970,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, + shi->Handle[i].OwnerPid = handle_info[i].owner; + shi->Handle[i].HandleValue = handle_info[i].handle; + shi->Handle[i].AccessMask = handle_info[i].access; +- /* FIXME: Fill out ObjectType, HandleFlags, ObjectPointer */ ++ shi->Handle[i].ObjectType = handle_info[i].type; ++ /* FIXME: Fill out HandleFlags, ObjectPointer */ } - else if (ret == STATUS_BUFFER_TOO_SMALL) -@@ -2331,6 +2332,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( - shi->Handle[i].UniqueProcessId = info[i].owner; - shi->Handle[i].HandleValue = info[i].handle; - shi->Handle[i].GrantedAccess = info[i].access; -+ shi->Handle[i].ObjectTypeIndex = info[i].type; - /* FIXME: Fill out remaining fields */ - } + } + else if (ret == STATUS_BUFFER_TOO_SMALL) +@@ -2022,6 +2023,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, + shi->Handle[i].UniqueProcessId = handle_info[i].owner; + shi->Handle[i].HandleValue = handle_info[i].handle; + shi->Handle[i].GrantedAccess = handle_info[i].access; ++ shi->Handle[i].ObjectTypeIndex = handle_info[i].type; + /* FIXME: Fill out remaining fields */ } + } diff --git a/server/directory.c b/server/directory.c -index 59c8194d09..f61a5cecf1 100644 +index e6c1edc719a..021bc149c4d 100644 --- a/server/directory.c +++ b/server/directory.c -@@ -249,6 +249,12 @@ struct object_type *get_object_type( const struct unicode_str *name ) +@@ -247,6 +247,12 @@ struct object_type *get_object_type( const struct unicode_str *name ) return type; } @@ -52,10 +52,10 @@ index 59c8194d09..f61a5cecf1 100644 static void create_session( unsigned int id ) diff --git a/server/handle.c b/server/handle.c -index 0e909ff27e..e29cead46b 100644 +index a2a8bb5479c..e40e9e95d8f 100644 --- a/server/handle.c +++ b/server/handle.c -@@ -971,6 +971,7 @@ static int enum_handles( struct process *process, void *user ) +@@ -790,6 +790,7 @@ static int enum_handles( struct process *process, void *user ) struct handle_table *table = process->handles; struct handle_entry *entry; struct handle_info *handle; @@ -63,7 +63,7 @@ index 0e909ff27e..e29cead46b 100644 unsigned int i; if (!table) -@@ -989,6 +990,15 @@ static int enum_handles( struct process *process, void *user ) +@@ -808,6 +809,15 @@ static int enum_handles( struct process *process, void *user ) handle->owner = process->id; handle->handle = index_to_handle(i); handle->access = entry->access & ~RESERVED_ALL; @@ -80,10 +80,10 @@ index 0e909ff27e..e29cead46b 100644 } diff --git a/server/object.h b/server/object.h -index 3ba3f4b431..4a5d282a47 100644 +index f3f7617394d..1517e8c98fb 100644 --- a/server/object.h +++ b/server/object.h -@@ -264,6 +264,7 @@ static const WCHAR type_Type[] = {'T','y','p','e'}; +@@ -262,6 +262,7 @@ static const WCHAR type_Type[] = {'T','y','p','e'}; static const WCHAR type_WindowStation[] = {'W','i','n','d','o','w','S','t','a','t','i','o','n'}; extern void init_types(void); @@ -92,10 +92,10 @@ index 3ba3f4b431..4a5d282a47 100644 /* symbolic link functions */ diff --git a/server/protocol.def b/server/protocol.def -index d6847f8d55..35730d60cb 100644 +index 2ec81bb6ad1..72f148b12e7 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -3433,6 +3433,7 @@ struct handle_info +@@ -3493,6 +3493,7 @@ struct handle_info process_id_t owner; obj_handle_t handle; unsigned int access; @@ -104,5 +104,5 @@ index d6847f8d55..35730d60cb 100644 /* Return a list of all opened handles */ -- -2.11.0 +2.27.0 diff --git a/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch b/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch index 18a607c8..f3c4131f 100644 --- a/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch +++ b/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch @@ -1,62 +1,20 @@ -From 963a3aedc5b1539187d9aa5065ff16d6c60b6477 Mon Sep 17 00:00:00 2001 +From aff46ac5cdbb7e202e4b153b2f869c55a17da1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 8 Mar 2017 19:39:29 +0100 Subject: [PATCH] ntdll: Mimic object type behavior for different windows versions. --- - dlls/ntdll/nt.c | 17 +++++++++-- - dlls/ntdll/om.c | 5 +++- - dlls/ntdll/tests/om.c | 65 ++++++++++++++++++++++++++++++++++++++++++- - 3 files changed, 83 insertions(+), 4 deletions(-) + dlls/ntdll/om.c | 5 +++- + dlls/ntdll/tests/om.c | 65 +++++++++++++++++++++++++++++++++++++++- + dlls/ntdll/unix/system.c | 18 +++++++++-- + 3 files changed, 83 insertions(+), 5 deletions(-) -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index d194f863..452fad15 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -126,6 +126,19 @@ struct smbios_chassis { - #define FIRM 0x4649524D - #define RSMB 0x52534D42 - -+static DWORD translate_object_index(DWORD index) -+{ -+ WORD version = MAKEWORD(NtCurrentTeb()->Peb->OSMinorVersion, NtCurrentTeb()->Peb->OSMajorVersion); -+ -+ /* Process Hacker depends on this logic */ -+ if (version >= 0x0602) -+ return index; -+ else if (version == 0x0601) -+ return index + 2; -+ else -+ return index + 1; -+} -+ - /* - * Token - */ -@@ -2617,7 +2630,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( - shi->Handle[i].OwnerPid = info[i].owner; - shi->Handle[i].HandleValue = info[i].handle; - shi->Handle[i].AccessMask = info[i].access; -- shi->Handle[i].ObjectType = info[i].type; -+ shi->Handle[i].ObjectType = translate_object_index(info[i].type); - /* FIXME: Fill out HandleFlags, ObjectPointer */ - } - } -@@ -2669,7 +2682,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( - shi->Handle[i].UniqueProcessId = info[i].owner; - shi->Handle[i].HandleValue = info[i].handle; - shi->Handle[i].GrantedAccess = info[i].access; -- shi->Handle[i].ObjectTypeIndex = info[i].type; -+ shi->Handle[i].ObjectTypeIndex = translate_object_index(info[i].type); - /* FIXME: Fill out remaining fields */ - } - } diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c -index c0479ea6..2156fad5 100644 +index 4fea106cc46..eea095acbf9 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c -@@ -185,7 +185,10 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, +@@ -182,7 +182,10 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, } if (status == STATUS_SUCCESS) { @@ -69,10 +27,10 @@ index c0479ea6..2156fad5 100644 } } diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c -index a94b9866..54ef3955 100644 +index 398ad6bed4e..b538160f6d0 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c -@@ -74,6 +74,7 @@ static NTSTATUS (WINAPI *pNtQuerySystemTime)( LARGE_INTEGER * ); +@@ -76,6 +76,7 @@ static NTSTATUS (WINAPI *pNtQuerySystemTime)( LARGE_INTEGER * ); static NTSTATUS (WINAPI *pRtlWaitOnAddress)( const void *, const void *, SIZE_T, const LARGE_INTEGER * ); static void (WINAPI *pRtlWakeAddressAll)( const void * ); static void (WINAPI *pRtlWakeAddressSingle)( const void * ); @@ -80,7 +38,7 @@ index a94b9866..54ef3955 100644 #define KEYEDEVENT_WAIT 0x0001 #define KEYEDEVENT_WAKE 0x0002 -@@ -1594,13 +1595,31 @@ static void test_query_object(void) +@@ -1598,13 +1599,31 @@ static void test_query_object(void) } @@ -113,7 +71,7 @@ index a94b9866..54ef3955 100644 buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(OBJECT_TYPES_INFORMATION) ); ok( buffer != NULL, "Failed to allocate memory\n" ); -@@ -1628,11 +1647,54 @@ static void test_query_object_types(void) +@@ -1632,11 +1651,54 @@ static void test_query_object_types(void) ok( type->TypeName.Length == sizeof(typeW) && !strncmpW(typeW, type->TypeName.Buffer, 4), "Expected 'Type' as first type, got %s\n", wine_dbgstr_us(&type->TypeName) ); } @@ -168,7 +126,7 @@ index a94b9866..54ef3955 100644 } static void test_type_mismatch(void) -@@ -2226,6 +2288,7 @@ START_TEST(om) +@@ -2263,6 +2325,7 @@ START_TEST(om) pRtlWaitOnAddress = (void *)GetProcAddress(hntdll, "RtlWaitOnAddress"); pRtlWakeAddressAll = (void *)GetProcAddress(hntdll, "RtlWakeAddressAll"); pRtlWakeAddressSingle = (void *)GetProcAddress(hntdll, "RtlWakeAddressSingle"); @@ -176,6 +134,56 @@ index a94b9866..54ef3955 100644 test_case_sensitive(); test_namespace_pipe(); +diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c +index b1b53256905..e317d34755c 100644 +--- a/dlls/ntdll/unix/system.c ++++ b/dlls/ntdll/unix/system.c +@@ -1657,6 +1657,19 @@ static void get_ntdll_system_module(SYSTEM_MODULE *sm) + sm->NameOffset = (ptr != NULL) ? (ptr - str.Buffer + 1) : 0; + } + ++static DWORD translate_object_index(DWORD index) ++{ ++ WORD version = MAKEWORD(NtCurrentTeb()->Peb->OSMinorVersion, NtCurrentTeb()->Peb->OSMajorVersion); ++ ++ /* Process Hacker depends on this logic */ ++ if (version >= 0x0602) ++ return index; ++ else if (version == 0x0601) ++ return index + 2; ++ else ++ return index + 1; ++} ++ + /****************************************************************************** + * NtQuerySystemInformation (NTDLL.@) + */ +@@ -2031,7 +2044,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, + shi->Handle[i].OwnerPid = handle_info[i].owner; + shi->Handle[i].HandleValue = handle_info[i].handle; + shi->Handle[i].AccessMask = handle_info[i].access; +- shi->Handle[i].ObjectType = handle_info[i].type; ++ shi->Handle[i].ObjectType = translate_object_index( handle_info[i].type ); + /* FIXME: Fill out HandleFlags, ObjectPointer */ + } + } +@@ -2084,7 +2097,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, + shi->Handle[i].UniqueProcessId = handle_info[i].owner; + shi->Handle[i].HandleValue = handle_info[i].handle; + shi->Handle[i].GrantedAccess = handle_info[i].access; +- shi->Handle[i].ObjectTypeIndex = handle_info[i].type; ++ shi->Handle[i].ObjectTypeIndex = translate_object_index( handle_info[i].type ); + /* FIXME: Fill out remaining fields */ + } + } +@@ -2314,7 +2327,6 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, + return ret; + } + +- + /****************************************************************************** + * NtQuerySystemInformationEx (NTDLL.@) + */ -- -2.20.1 +2.27.0 diff --git a/patches/server-Object_Types/definition b/patches/server-Object_Types/definition index 724bb014..1da5e3dc 100644 --- a/patches/server-Object_Types/definition +++ b/patches/server-Object_Types/definition @@ -1,3 +1,4 @@ Fixes: [44629] Process Hacker can't enumerate handles Fixes: [45374] Yet Another Process Monitor (.NET 2.0 app) reports System.AccessViolationException +Depends: ntdll-SystemModuleInformation #Depends: server-Shared_Memory diff --git a/patches/shell32-Progress_Dialog/0002-shell32-Pass-FILE_INFORMATION-into-SHNotify-function.patch b/patches/shell32-Progress_Dialog/0002-shell32-Pass-FILE_INFORMATION-into-SHNotify-function.patch index 7fc28d7a..2e016abf 100644 --- a/patches/shell32-Progress_Dialog/0002-shell32-Pass-FILE_INFORMATION-into-SHNotify-function.patch +++ b/patches/shell32-Progress_Dialog/0002-shell32-Pass-FILE_INFORMATION-into-SHNotify-function.patch @@ -1,16 +1,15 @@ -From 8102136961bf8ed57bcde4b74548562e5e3e21a0 Mon Sep 17 00:00:00 2001 +From fdaeb6ba616ef833c275e2aa53fc06abacefc1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 26 Feb 2015 23:21:26 +0100 -Subject: [PATCH] shell32: Pass FILE_INFORMATION into SHNotify* - functions. +Subject: [PATCH] shell32: Pass FILE_INFORMATION into SHNotify* functions. Preparation of the progressbar work. Based on a patch by Huw Campbell. --- - dlls/shell32/shlfileop.c | 201 +++++++++++++++++++++++------------------------ + dlls/shell32/shlfileop.c | 201 +++++++++++++++++++-------------------- 1 file changed, 98 insertions(+), 103 deletions(-) diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c -index 91d5781..71de462 100644 +index e4c7449f05e..028a1d76e4f 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -59,16 +59,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -215,7 +214,7 @@ index 91d5781..71de462 100644 /* Destination file may already exist with read only attribute */ attribs = GetFileAttributesW(dest); if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY)) -@@ -899,30 +922,6 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp) +@@ -904,30 +927,6 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp) return retCode; } @@ -246,7 +245,7 @@ index 91d5781..71de462 100644 static inline void grow_list(FILE_LIST *list) { FILE_ENTRY *new = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, list->feFiles, -@@ -1085,7 +1084,7 @@ static void destroy_file_list(FILE_LIST *flList) +@@ -1093,7 +1092,7 @@ static void destroy_file_list(FILE_LIST *flList) static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWSTR szDestPath) { WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; @@ -255,7 +254,7 @@ index 91d5781..71de462 100644 static const WCHAR wildCardFiles[] = {'*','.','*',0}; -@@ -1113,17 +1112,16 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST +@@ -1121,17 +1120,16 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); szFrom[lstrlenW(szFrom) + 1] = '\0'; @@ -281,7 +280,7 @@ index 91d5781..71de462 100644 } static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR *szTo) -@@ -1134,7 +1132,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH +@@ -1142,7 +1140,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH return FALSE; } @@ -290,7 +289,7 @@ index 91d5781..71de462 100644 } /* copy a file or directory to another directory */ -@@ -1174,7 +1172,7 @@ static void create_dest_dirs(LPCWSTR szDestDir) +@@ -1182,7 +1180,7 @@ static void create_dest_dirs(LPCWSTR szDestDir) } /* the FO_COPY operation */ @@ -299,16 +298,16 @@ index 91d5781..71de462 100644 { DWORD i; const FILE_ENTRY *entryToCopy; -@@ -1197,7 +1195,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl +@@ -1205,7 +1203,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl fileDest = &flTo->feFiles[0]; } -- if (op->req->fFlags & FOF_MULTIDESTFILES) -+ if (multidest) +- if (op->req->fFlags & FOF_MULTIDESTFILES && flTo->dwNumFiles > 1) ++ if (multidest && flTo->dwNumFiles > 1) { if (flFrom->bAnyFromWildcard) return ERROR_CANCELLED; -@@ -1249,8 +1247,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl +@@ -1257,8 +1255,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl { entryToCopy = &flFrom->feFiles[i]; @@ -318,7 +317,7 @@ index 91d5781..71de462 100644 { fileDest = &flTo->feFiles[i]; } -@@ -1322,7 +1319,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE +@@ -1330,7 +1327,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE } /* the FO_DELETE operation */ @@ -327,7 +326,7 @@ index 91d5781..71de462 100644 { const FILE_ENTRY *fileEntry; DWORD i; -@@ -1333,13 +1330,13 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) +@@ -1341,13 +1338,13 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) return ERROR_SUCCESS; /* Windows also checks only the first item */ @@ -345,7 +344,7 @@ index 91d5781..71de462 100644 return 0; } -@@ -1348,7 +1345,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) +@@ -1356,7 +1353,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) fileEntry = &flFrom->feFiles[i]; if (!IsAttribFile(fileEntry->attributes) && @@ -354,7 +353,7 @@ index 91d5781..71de462 100644 continue; if (bTrash) -@@ -1358,14 +1355,14 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) +@@ -1366,14 +1363,14 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) continue; /* Note: Windows silently deletes the file in such a situation, we show a dialog */ @@ -372,7 +371,7 @@ index 91d5781..71de462 100644 break; } } -@@ -1375,7 +1372,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) +@@ -1383,7 +1380,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) ret = DeleteFileW(fileEntry->szFullPath) ? ERROR_SUCCESS : GetLastError(); else @@ -381,7 +380,7 @@ index 91d5781..71de462 100644 if (ret) return ret; -@@ -1385,16 +1382,16 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) +@@ -1393,16 +1390,16 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) } /* moves a file or directory to another directory */ @@ -401,7 +400,7 @@ index 91d5781..71de462 100644 { DWORD i; INT mismatched = 0; -@@ -1407,14 +1404,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const +@@ -1415,14 +1412,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const if (!flTo->dwNumFiles) return ERROR_FILE_NOT_FOUND; @@ -418,7 +417,7 @@ index 91d5781..71de462 100644 flFrom->dwNumFiles > flTo->dwNumFiles) { return ERROR_CANCELLED; -@@ -1427,7 +1422,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const +@@ -1435,7 +1430,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const return ret; } @@ -427,7 +426,7 @@ index 91d5781..71de462 100644 mismatched = flFrom->dwNumFiles - flTo->dwNumFiles; fileDest = &flTo->feFiles[0]; -@@ -1438,7 +1433,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const +@@ -1446,7 +1441,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const if (!PathFileExistsW(fileDest->szDirectory)) return ERROR_CANCELLED; @@ -436,7 +435,7 @@ index 91d5781..71de462 100644 { if (i >= flTo->dwNumFiles) break; -@@ -1452,9 +1447,9 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const +@@ -1460,9 +1455,9 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const } if (fileDest->bExists && IsAttribDir(fileDest->attributes)) @@ -448,7 +447,7 @@ index 91d5781..71de462 100644 } if (mismatched > 0) -@@ -1469,7 +1464,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const +@@ -1477,7 +1472,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const } /* the FO_RENAME files */ @@ -457,7 +456,7 @@ index 91d5781..71de462 100644 { const FILE_ENTRY *feFrom; const FILE_ENTRY *feTo; -@@ -1491,7 +1486,7 @@ static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, con +@@ -1499,7 +1494,7 @@ static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, con if (feTo->bExists) return ERROR_ALREADY_EXISTS; @@ -466,7 +465,7 @@ index 91d5781..71de462 100644 } /* alert the user if an unsupported flag is used */ -@@ -1538,16 +1533,16 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp) +@@ -1546,16 +1541,16 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp) switch (lpFileOp->wFunc) { case FO_COPY: @@ -488,5 +487,5 @@ index 91d5781..71de462 100644 default: ret = ERROR_INVALID_PARAMETER; -- -1.9.1 +2.27.0 diff --git a/patches/user32-rawinput-mouse/0001-user32-tests-Add-rawinput-test-for-ClipCursor-intera.patch b/patches/user32-rawinput-mouse/0001-user32-tests-Add-rawinput-test-for-ClipCursor-intera.patch deleted file mode 100644 index cf1728f3..00000000 --- a/patches/user32-rawinput-mouse/0001-user32-tests-Add-rawinput-test-for-ClipCursor-intera.patch +++ /dev/null @@ -1,262 +0,0 @@ -From fe1ae8a2e1ee05143a9a0b7248420edada9bc09d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?R=C3=A9mi=20Bernon?= -Date: Thu, 14 Nov 2019 16:41:43 +0100 -Subject: [PATCH 01/12] user32/tests: Add rawinput test for ClipCursor - interactions. - -This shows unexpected rawinput messages triggered from cursor clipping. - -The sleeps are required to let native cursor clipping time to activate. -We also repeat the clipping multiple times to be increase the chances -that the counts will be wrong as it doesn't always trigger. ---- - dlls/user32/tests/input.c | 226 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 226 insertions(+) - -diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c -index 478c269017a..bf9d19906a8 100644 ---- a/dlls/user32/tests/input.c -+++ b/dlls/user32/tests/input.c -@@ -1826,6 +1826,231 @@ static void test_RegisterRawInputDevices(void) - DestroyWindow(hwnd); - } - -+static int rawinput_received; -+static int rawinput_received_foreground; -+static int rawinput_motion_x; -+static int rawinput_motion_y; -+static HANDLE rawinput_wndproc_done; -+ -+static LRESULT CALLBACK rawinput_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -+{ -+ UINT ret, raw_size; -+ RAWINPUT raw; -+ -+ if (msg == WM_INPUT) -+ { -+ rawinput_received++; -+ -+ ok(wparam == RIM_INPUT || wparam == RIM_INPUTSINK, "Unexpected wparam: %lu\n", wparam); -+ if (wparam == RIM_INPUT) -+ rawinput_received_foreground++; -+ -+ ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, NULL, &raw_size, sizeof(RAWINPUTHEADER)); -+ ok(ret == 0, "GetRawInputData failed\n"); -+ ok(raw_size <= sizeof(raw), "Unexpected rawinput data size: %u", raw_size); -+ -+ if (raw_size <= sizeof(raw)) -+ { -+ ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &raw, &raw_size, sizeof(RAWINPUTHEADER)); -+ ok(ret > 0 && ret != (UINT)-1, "GetRawInputData failed\n"); -+ ok(raw.header.dwType == RIM_TYPEMOUSE, "Unexpected rawinput type: %u\n", raw.header.dwType); -+ -+ if (raw.header.dwType == RIM_TYPEMOUSE) -+ { -+ ok(!(raw.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE), "Unexpected absolute rawinput motion\n"); -+ ok(!(raw.data.mouse.usFlags & MOUSE_VIRTUAL_DESKTOP), "Unexpected virtual desktop rawinput motion\n"); -+ rawinput_motion_x += raw.data.mouse.lLastX; -+ rawinput_motion_y += raw.data.mouse.lLastY; -+ } -+ } -+ } -+ -+ if (msg == WM_USER) -+ SetEvent(rawinput_wndproc_done); -+ -+ return DefWindowProcA(hwnd, msg, wparam, lparam); -+} -+ -+struct rawinput_mouse_thread_params -+{ -+ int step; -+ HWND window; -+ HANDLE ready; -+ HANDLE start; -+}; -+ -+static DWORD WINAPI rawinput_mouse_thread(void *arg) -+{ -+ struct rawinput_mouse_thread_params *params = arg; -+ RECT rect_105 = { 105, 105, 105, 105 }; -+ RECT rect_110 = { 110, 110, 110, 110 }; -+ int i; -+ -+ while (WaitForSingleObject(params->ready, INFINITE) == 0) -+ { -+ ResetEvent(params->ready); -+ SetEvent(params->start); -+ -+ switch (params->step) -+ { -+ case 0: -+ case 1: -+ case 2: -+ mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0); -+ mouse_event(MOUSEEVENTF_MOVE, 0, -1, 0, 0); -+ break; -+ case 3: -+ for (i = 0; i < 10; ++i) -+ { -+ ClipCursor(&rect_105); -+ Sleep(5); -+ ClipCursor(&rect_110); -+ Sleep(5); -+ ClipCursor(NULL); -+ Sleep(5); -+ } -+ break; -+ case 4: -+ for (i = 0; i < 10; ++i) -+ { -+ ClipCursor(&rect_110); -+ Sleep(5); -+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); -+ ClipCursor(NULL); -+ Sleep(5); -+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); -+ ClipCursor(&rect_110); -+ ClipCursor(NULL); -+ Sleep(5); -+ } -+ break; -+ default: -+ return 0; -+ } -+ -+ PostMessageA(params->window, WM_USER, 0, 0); -+ } -+ -+ return 0; -+} -+ -+struct rawinput_mouse_test -+{ -+ BOOL register_device; -+ BOOL register_window; -+ DWORD register_flags; -+ int expect_received; -+ int expect_received_foreground; -+ int expect_motion_x; -+ int expect_motion_y; -+ BOOL todo; -+}; -+ -+static void test_rawinput_mouse(void) -+{ -+ struct rawinput_mouse_thread_params params; -+ RAWINPUTDEVICE raw_devices[1]; -+ HANDLE thread; -+ DWORD ret; -+ int i; -+ -+ struct rawinput_mouse_test tests[] = -+ { -+ { FALSE, FALSE, 0, 0, 0, 0, 0, FALSE }, -+ { TRUE, FALSE, 0, 2, 2, -1, -1, FALSE }, -+ { TRUE, TRUE, 0, 2, 2, -1, -1, FALSE }, -+ { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE }, -+ { TRUE, TRUE, 0, 20, 20, 20, 20, TRUE }, -+ }; -+ -+ mouse_event(MOUSEEVENTF_ABSOLUTE, 100, 100, 0, 0); -+ SetCursorPos(100, 100); -+ -+ rawinput_wndproc_done = CreateEventA(NULL, FALSE, FALSE, NULL); -+ ok(rawinput_wndproc_done != NULL, "CreateEvent failed\n"); -+ -+ params.window = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, 100, 100, 100, 100, 0, NULL, NULL, NULL); -+ ok(params.window != 0, "CreateWindow failed\n"); -+ -+ ShowWindow(params.window, SW_SHOW); -+ SetWindowPos(params.window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); -+ SetForegroundWindow(params.window); -+ UpdateWindow(params.window); -+ empty_message_queue(); -+ -+ SetWindowLongPtrA(params.window, GWLP_WNDPROC, (LONG_PTR)rawinput_wndproc); -+ -+ params.step = 0; -+ params.ready = CreateEventA(NULL, FALSE, FALSE, NULL); -+ ok(params.ready != NULL, "CreateEvent failed\n"); -+ -+ params.start = CreateEventA(NULL, FALSE, FALSE, NULL); -+ ok(params.start != NULL, "CreateEvent failed\n"); -+ -+ thread = CreateThread(NULL, 0, rawinput_mouse_thread, ¶ms, 0, NULL); -+ ok(thread != NULL, "CreateThread failed\n"); -+ -+ for (i = 0; i < ARRAY_SIZE(tests); ++i) -+ { -+ rawinput_received = 0; -+ rawinput_received_foreground = 0; -+ rawinput_motion_x = 0; -+ rawinput_motion_y = 0; -+ -+ raw_devices[0].usUsagePage = 0x01; -+ raw_devices[0].usUsage = 0x02; -+ raw_devices[0].dwFlags = tests[i].register_flags; -+ raw_devices[0].hwndTarget = tests[i].register_window ? params.window : 0; -+ -+ if (tests[i].register_device) -+ { -+ SetLastError(0xdeadbeef); -+ ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); -+ ok(ret, "%d: RegisterRawInputDevices failed\n", i); -+ ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); -+ } -+ -+ params.step = i; -+ SetEvent(params.ready); -+ -+ WaitForSingleObject(params.start, INFINITE); -+ ResetEvent(params.start); -+ -+ while (MsgWaitForMultipleObjects(1, &rawinput_wndproc_done, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0) -+ empty_message_queue(); -+ ResetEvent(rawinput_wndproc_done); -+ -+ /* Wine is sometimes passing some of the conditions, but not always, let's test -+ * all at once in the todo block, there should be at least one that fails. */ -+ todo_wine_if(tests[i].todo) -+ ok(rawinput_received == tests[i].expect_received && -+ rawinput_received_foreground == tests[i].expect_received_foreground && -+ rawinput_motion_x == tests[i].expect_motion_x && -+ rawinput_motion_y == tests[i].expect_motion_y, -+ "%d: Unexpected rawinput results: received %d, %d in foreground, motion is %dx%d\n", -+ i, rawinput_received, rawinput_received_foreground, rawinput_motion_x, rawinput_motion_y); -+ -+ if (tests[i].register_device) -+ { -+ raw_devices[0].dwFlags = RIDEV_REMOVE; -+ raw_devices[0].hwndTarget = 0; -+ -+ SetLastError(0xdeadbeef); -+ ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); -+ ok(ret, "%d: RegisterRawInputDevices failed\n", i); -+ ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); -+ } -+ } -+ -+ params.step = -1; -+ SetEvent(params.ready); -+ WaitForSingleObject(thread, INFINITE); -+ -+ CloseHandle(params.start); -+ CloseHandle(params.ready); -+ CloseHandle(thread); -+} -+ - static void test_key_map(void) - { - HKL kl = GetKeyboardLayout(0); -@@ -3326,6 +3551,7 @@ START_TEST(input) - test_GetRawInputData(); - test_GetKeyboardLayoutList(); - test_RegisterRawInputDevices(); -+ test_rawinput_mouse(); - - if(pGetMouseMovePointsEx) - test_GetMouseMovePointsEx(); --- -2.24.1 - diff --git a/patches/user32-rawinput-mouse/0002-user32-tests-Add-rawinput-test-for-cross-thread-inte.patch b/patches/user32-rawinput-mouse/0002-user32-tests-Add-rawinput-test-for-cross-thread-inte.patch deleted file mode 100644 index 74cb79c9..00000000 --- a/patches/user32-rawinput-mouse/0002-user32-tests-Add-rawinput-test-for-cross-thread-inte.patch +++ /dev/null @@ -1,70 +0,0 @@ -From d407a40a11f0cbf3e61faded5e6e7e1e2e63ef9c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?R=C3=A9mi=20Bernon?= -Date: Thu, 14 Nov 2019 17:03:38 +0100 -Subject: [PATCH 02/12] user32/tests: Add rawinput test for cross-thread - interactions. - -The rawinput messages are received on the target window if is from the -same process as the foreground window, it doesn't need to be the -foreground window itself. ---- - dlls/user32/tests/input.c | 27 +++++++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - -diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c -index bf9d19906a8..bdcc6834d9d 100644 ---- a/dlls/user32/tests/input.c -+++ b/dlls/user32/tests/input.c -@@ -1884,6 +1884,7 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg) - struct rawinput_mouse_thread_params *params = arg; - RECT rect_105 = { 105, 105, 105, 105 }; - RECT rect_110 = { 110, 110, 110, 110 }; -+ HWND window; - int i; - - while (WaitForSingleObject(params->ready, INFINITE) == 0) -@@ -1924,6 +1925,26 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg) - Sleep(5); - } - break; -+ case 5: -+ case 6: -+ window = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, 100, 100, 100, 100, 0, NULL, NULL, NULL); -+ ok(window != 0, "%d: CreateWindow failed\n", params->step); -+ -+ ShowWindow(window, SW_SHOW); -+ SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); -+ SetForegroundWindow(window); -+ UpdateWindow(window); -+ empty_message_queue(); -+ -+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); -+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0); -+ mouse_event(MOUSEEVENTF_MOVE, -1, -1, 0, 0); -+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0); -+ -+ empty_message_queue(); -+ -+ DestroyWindow(window); -+ break; - default: - return 0; - } -@@ -1959,8 +1980,14 @@ static void test_rawinput_mouse(void) - { FALSE, FALSE, 0, 0, 0, 0, 0, FALSE }, - { TRUE, FALSE, 0, 2, 2, -1, -1, FALSE }, - { TRUE, TRUE, 0, 2, 2, -1, -1, FALSE }, -+ -+ /* clip cursor tests */ - { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE }, - { TRUE, TRUE, 0, 20, 20, 20, 20, TRUE }, -+ -+ /* same-process foreground tests */ -+ { TRUE, TRUE, 0, 2, 2, 0, 0, TRUE }, -+ { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE }, - }; - - mouse_event(MOUSEEVENTF_ABSOLUTE, 100, 100, 0, 0); --- -2.24.1 - diff --git a/patches/user32-rawinput-mouse/0003-user32-tests-Add-rawinput-test-for-cross-process-int.patch b/patches/user32-rawinput-mouse/0003-user32-tests-Add-rawinput-test-for-cross-process-int.patch deleted file mode 100644 index 5587d03e..00000000 --- a/patches/user32-rawinput-mouse/0003-user32-tests-Add-rawinput-test-for-cross-process-int.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 66869bba59b74f8bb77b4c1b7c44ef3c6ca7e4ee Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?R=C3=A9mi=20Bernon?= -Date: Thu, 14 Nov 2019 18:44:28 +0100 -Subject: [PATCH] user32/tests: Add rawinput test for cross-process - interactions. - -Validating the rest of the assumption, rawinput messages are not -received anymore if the foreground window is from another process. ---- - dlls/user32/tests/input.c | 86 ++++++++++++++++++++++++++++++++++++++- - 1 file changed, 84 insertions(+), 2 deletions(-) - -diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c -index 1738706c8a5..79d6a046a8b 100644 ---- a/dlls/user32/tests/input.c -+++ b/dlls/user32/tests/input.c -@@ -46,6 +46,7 @@ - */ - - #include -+#include - #include - - #include "windef.h" -@@ -1874,8 +1875,36 @@ struct rawinput_mouse_thread_params - HWND window; - HANDLE ready; - HANDLE start; -+ const char *argv0; - }; - -+static void rawinput_mouse_process(void) -+{ -+ HWND window; -+ HANDLE start_event, stop_event; -+ -+ start_event = OpenEventA(EVENT_ALL_ACCESS, FALSE, "test_rawinput_mouse_start"); -+ ok(start_event != 0, "OpenEventA failed, error: %u\n", GetLastError()); -+ -+ stop_event = OpenEventA(EVENT_ALL_ACCESS, FALSE, "test_rawinput_mouse_stop"); -+ ok(stop_event != 0, "OpenEventA failed, error: %u\n", GetLastError()); -+ -+ window = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, 200, 100, 100, 100, 0, NULL, NULL, NULL); -+ ok(window != 0, "CreateWindow failed\n"); -+ -+ ShowWindow(window, SW_SHOW); -+ SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); -+ SetForegroundWindow(window); -+ UpdateWindow(window); -+ empty_message_queue(); -+ -+ SetEvent(start_event); -+ while (MsgWaitForMultipleObjects(1, &stop_event, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0) -+ empty_message_queue(); -+ -+ DestroyWindow(window); -+} -+ - static DWORD WINAPI rawinput_mouse_thread(void *arg) - { - struct rawinput_mouse_thread_params *params = arg; -@@ -1883,6 +1912,11 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg) - RECT rect_110 = { 110, 110, 110, 110 }; - HWND window; - int i; -+ char path[MAX_PATH]; -+ PROCESS_INFORMATION process_info; -+ STARTUPINFOA startup_info; -+ HANDLE start_event, stop_event; -+ BOOL ret; - - while (WaitForSingleObject(params->ready, INFINITE) == 0) - { -@@ -1942,6 +1976,39 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg) - - DestroyWindow(window); - break; -+ case 7: -+ case 8: -+ start_event = CreateEventA(NULL, 0, 0, "test_rawinput_mouse_start"); -+ ok(start_event != 0, "%d: CreateEventA failed, error %u\n", params->step, GetLastError()); -+ -+ stop_event = CreateEventA(NULL, 0, 0, "test_rawinput_mouse_stop"); -+ ok(stop_event != 0, "%d: CreateEventA failed, error %u\n", params->step, GetLastError()); -+ -+ memset(&startup_info, 0, sizeof(startup_info)); -+ startup_info.cb = sizeof(startup_info); -+ startup_info.dwFlags = STARTF_USESHOWWINDOW; -+ startup_info.wShowWindow = SW_SHOWNORMAL; -+ -+ sprintf(path, "%s input test_rawinput_mouse", params->argv0); -+ ret = CreateProcessA(NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &startup_info, &process_info ); -+ ok(ret, "%d: CreateProcess '%s' failed err %u.\n", params->step, path, GetLastError()); -+ -+ ret = WaitForSingleObject(start_event, 5000); -+ ok(ret == WAIT_OBJECT_0, "%d: WaitForSingleObject failed\n", params->step); -+ -+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); -+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0); -+ mouse_event(MOUSEEVENTF_MOVE, -1, -1, 0, 0); -+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0); -+ -+ SetEvent(stop_event); -+ -+ winetest_wait_child_process(process_info.hProcess); -+ CloseHandle(process_info.hProcess); -+ CloseHandle(process_info.hThread); -+ CloseHandle(start_event); -+ CloseHandle(stop_event); -+ break; - default: - return 0; - } -@@ -1964,7 +2031,7 @@ struct rawinput_mouse_test - BOOL todo; - }; - --static void test_rawinput_mouse(void) -+static void test_rawinput_mouse(const char *argv0) - { - struct rawinput_mouse_thread_params params; - RAWINPUTDEVICE raw_devices[1]; -@@ -1985,11 +2052,17 @@ static void test_rawinput_mouse(void) - /* same-process foreground tests */ - { TRUE, TRUE, 0, 2, 2, 0, 0, TRUE }, - { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE }, -+ -+ /* cross-process foreground tests */ -+ { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE }, -+ { TRUE, TRUE, RIDEV_INPUTSINK, 2, 0, 0, 0, TRUE }, - }; - - mouse_event(MOUSEEVENTF_ABSOLUTE, 100, 100, 0, 0); - SetCursorPos(100, 100); - -+ params.argv0 = argv0; -+ - rawinput_wndproc_done = CreateEventA(NULL, FALSE, FALSE, NULL); - ok(rawinput_wndproc_done != NULL, "CreateEvent failed\n"); - -@@ -3552,11 +3625,20 @@ static void test_GetKeyboardLayoutList(void) - - START_TEST(input) - { -+ char **argv; -+ int argc; - POINT pos; - - init_function_pointers(); - GetCursorPos( &pos ); - -+ argc = winetest_get_mainargs(&argv); -+ if (argc >= 3 && strcmp(argv[2], "test_rawinput_mouse") == 0) -+ { -+ rawinput_mouse_process(); -+ return; -+ } -+ - test_Input_blackbox(); - test_Input_whitebox(); - test_Input_unicode(); -@@ -3575,7 +3657,7 @@ START_TEST(input) - test_GetRawInputData(); - test_GetKeyboardLayoutList(); - test_RegisterRawInputDevices(); -- test_rawinput_mouse(); -+ test_rawinput_mouse(argv[0]); - - if(pGetMouseMovePointsEx) - test_GetMouseMovePointsEx(); --- -2.25.1 - diff --git a/patches/user32-rawinput-mouse/0005-server-Broadcast-rawinput-message-if-request-flag-is.patch b/patches/user32-rawinput-mouse/0005-server-Broadcast-rawinput-message-if-request-flag-is.patch index 5bbd20c4..ad7245b9 100644 --- a/patches/user32-rawinput-mouse/0005-server-Broadcast-rawinput-message-if-request-flag-is.patch +++ b/patches/user32-rawinput-mouse/0005-server-Broadcast-rawinput-message-if-request-flag-is.patch @@ -1,4 +1,4 @@ -From 323c45f237fc828f32e27448e4c24649b69b49e0 Mon Sep 17 00:00:00 2001 +From 38723990a094b598e988408149d1e04dac9b571e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 12 Nov 2019 12:41:55 +0100 Subject: [PATCH] server: Broadcast rawinput message if request flag is @@ -8,23 +8,9 @@ If the request flag is equal to SEND_HWMSG_RAWINPUT, we broadcast the message to all listening processes -or at least to the foreground process until RIDEV_INPUTSINK is supported. --- - dlls/user32/tests/input.c | 2 +- - server/queue.c | 101 ++++++++++++++++++++++++++++++-------- - 2 files changed, 81 insertions(+), 22 deletions(-) + server/queue.c | 101 +++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 80 insertions(+), 21 deletions(-) -diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c -index d45a6b17ece..87e298ce8ff 100644 ---- a/dlls/user32/tests/input.c -+++ b/dlls/user32/tests/input.c -@@ -2050,7 +2050,7 @@ static void test_rawinput_mouse(const char *argv0) - { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE }, - - /* cross-process foreground tests */ -- { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE }, -+ { TRUE, TRUE, 0, 0, 0, 0, 0, FALSE }, - { TRUE, TRUE, RIDEV_INPUTSINK, 2, 0, 0, 0, TRUE }, - }; - diff --git a/server/queue.c b/server/queue.c index 05d7af0206f..e1a01389fcf 100644 --- a/server/queue.c @@ -181,5 +167,5 @@ index 05d7af0206f..e1a01389fcf 100644 if (!(req_flags & SEND_HWMSG_WINDOW)) -- -2.26.0 +2.27.0 diff --git a/patches/user32-rawinput-mouse/0009-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch b/patches/user32-rawinput-mouse/0009-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch index 45554b38..5bddd117 100644 --- a/patches/user32-rawinput-mouse/0009-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch +++ b/patches/user32-rawinput-mouse/0009-winex11.drv-Listen-to-RawMotion-and-RawButton-events.patch @@ -1,43 +1,21 @@ -From e8b90f221774d70fb9510b6de18378ab3abdcad2 Mon Sep 17 00:00:00 2001 +From d337c8de3de6a0b7ff16cada895d2490d3240b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Sep 2019 10:15:20 +0200 -Subject: [PATCH 09/12] winex11.drv: Listen to RawMotion and RawButton* events - in the desktop thread. +Subject: [PATCH] winex11.drv: Listen to RawMotion and RawButton* events in the + desktop thread. We still need to send "normal" input from the clipping window thread to trigger low-level hooks callbacks when clipping cursor. This is for instance used in our dinput implementation. --- - dlls/user32/tests/input.c | 8 ++-- dlls/winex11.drv/event.c | 10 +++- dlls/winex11.drv/mouse.c | 88 ++++++++++++++++++++++++++++------ dlls/winex11.drv/x11drv.h | 3 ++ dlls/winex11.drv/x11drv_main.c | 4 ++ - 5 files changed, 93 insertions(+), 20 deletions(-) + 4 files changed, 89 insertions(+), 16 deletions(-) -diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c -index d18ccfebcaf..a1f983f1960 100644 ---- a/dlls/user32/tests/input.c -+++ b/dlls/user32/tests/input.c -@@ -2049,12 +2049,12 @@ static void test_rawinput_mouse(const char *argv0) - { TRUE, TRUE, 0, 2, 2, -1, -1, FALSE }, - - /* clip cursor tests */ -- { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE }, -- { TRUE, TRUE, 0, 20, 20, 20, 20, TRUE }, -+ { TRUE, TRUE, 0, 0, 0, 0, 0, FALSE }, -+ { TRUE, TRUE, 0, 20, 20, 20, 20, FALSE }, - - /* same-process foreground tests */ -- { TRUE, TRUE, 0, 2, 2, 0, 0, TRUE }, -- { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE }, -+ { TRUE, TRUE, 0, 2, 2, 0, 0, FALSE }, -+ { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, FALSE }, - - /* cross-process foreground tests */ - { TRUE, TRUE, 0, 0, 0, 0, 0, FALSE }, diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c -index 87ba808956f..b3faf3f7cc5 100644 +index 07f7a1ad502..d722ba9d7cc 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -321,6 +321,10 @@ static enum event_merge_action merge_raw_motion_events( XIRawEvent *prev, XIRawE @@ -76,10 +54,10 @@ index 87ba808956f..b3faf3f7cc5 100644 #endif } diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c -index 19ed2a29287..d331ed5aef8 100644 +index 26e8b4eea92..ded877a140f 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c -@@ -364,9 +364,9 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator +@@ -362,9 +362,9 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator /*********************************************************************** @@ -91,7 +69,7 @@ index 19ed2a29287..d331ed5aef8 100644 { #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H struct x11drv_thread_data *data = x11drv_thread_data(); -@@ -398,9 +398,21 @@ static void enable_xinput2(void) +@@ -396,9 +396,21 @@ static void enable_xinput2(void) mask.mask_len = sizeof(mask_bits); mask.deviceid = XIAllMasterDevices; memset( mask_bits, 0, sizeof(mask_bits) ); @@ -114,7 +92,7 @@ index 19ed2a29287..d331ed5aef8 100644 pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 ); -@@ -413,9 +425,9 @@ static void enable_xinput2(void) +@@ -411,9 +423,9 @@ static void enable_xinput2(void) } /*********************************************************************** @@ -126,7 +104,7 @@ index 19ed2a29287..d331ed5aef8 100644 { #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H struct x11drv_thread_data *data = x11drv_thread_data(); -@@ -475,7 +487,7 @@ static BOOL grab_clipping_window( const RECT *clip ) +@@ -473,7 +485,7 @@ static BOOL grab_clipping_window( const RECT *clip ) } /* enable XInput2 unless we are already clipping */ @@ -135,7 +113,7 @@ index 19ed2a29287..d331ed5aef8 100644 if (data->xi2_state != xi_enabled) { -@@ -505,7 +517,7 @@ static BOOL grab_clipping_window( const RECT *clip ) +@@ -503,7 +515,7 @@ static BOOL grab_clipping_window( const RECT *clip ) if (!clipping_cursor) { @@ -144,7 +122,7 @@ index 19ed2a29287..d331ed5aef8 100644 DestroyWindow( msg_hwnd ); return FALSE; } -@@ -586,7 +598,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd ) +@@ -584,7 +596,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd ) TRACE( "clip hwnd reset from %p\n", hwnd ); data->clip_hwnd = 0; data->clip_reset = GetTickCount(); @@ -153,7 +131,7 @@ index 19ed2a29287..d331ed5aef8 100644 DestroyWindow( hwnd ); } else if (hwnd == GetForegroundWindow()) /* request to clip */ -@@ -725,7 +737,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU +@@ -723,7 +735,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU } input->u.mi.dx += clip_rect.left; input->u.mi.dy += clip_rect.top; @@ -162,7 +140,7 @@ index 19ed2a29287..d331ed5aef8 100644 return; } -@@ -765,7 +777,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU +@@ -763,7 +775,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU SERVER_END_REQ; } @@ -171,7 +149,7 @@ index 19ed2a29287..d331ed5aef8 100644 } #ifdef SONAME_LIBXCURSOR -@@ -1711,7 +1723,7 @@ void move_resize_window( HWND hwnd, int dir ) +@@ -1709,7 +1721,7 @@ void move_resize_window( HWND hwnd, int dir ) input.u.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; input.u.mi.time = GetTickCount(); input.u.mi.dwExtraInfo = 0; @@ -180,7 +158,7 @@ index 19ed2a29287..d331ed5aef8 100644 } while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE )) -@@ -1894,6 +1906,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) +@@ -1892,6 +1904,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) x_rel = &thread_data->x_rel_valuator; y_rel = &thread_data->y_rel_valuator; @@ -188,7 +166,7 @@ index 19ed2a29287..d331ed5aef8 100644 input.u.mi.mouseData = 0; input.u.mi.dwFlags = MOUSEEVENTF_MOVE; input.u.mi.time = EVENT_x11_time_to_win32_time( event->time ); -@@ -1929,10 +1942,53 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) +@@ -1927,10 +1940,53 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) return FALSE; } @@ -245,7 +223,7 @@ index 19ed2a29287..d331ed5aef8 100644 return TRUE; } -@@ -2008,6 +2064,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) +@@ -2006,6 +2062,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) case XI_RawMotion: ret = X11DRV_RawMotion( event ); break; @@ -257,7 +235,7 @@ index 19ed2a29287..d331ed5aef8 100644 default: TRACE( "Unhandled event %#x\n", event->evtype ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h -index 7145fec74e7..4a7cab67ada 100644 +index 73b1e90f12e..6febdc18b0a 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -196,6 +196,8 @@ extern BOOL CDECL X11DRV_UnrealizePalette( HPALETTE hpal ) DECLSPEC_HIDDEN; @@ -269,7 +247,7 @@ index 7145fec74e7..4a7cab67ada 100644 extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image, const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits, -@@ -343,6 +345,7 @@ struct x11drv_thread_data +@@ -342,6 +344,7 @@ struct x11drv_thread_data struct x11drv_valuator_data x_rel_valuator; struct x11drv_valuator_data y_rel_valuator; int xi2_core_pointer; /* XInput2 core pointer id */ @@ -278,10 +256,10 @@ index 7145fec74e7..4a7cab67ada 100644 extern struct x11drv_thread_data *x11drv_init_thread_data(void) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c -index ff9185a523c..f33a79d98bf 100644 +index 20e829ba64f..4eaedd1c556 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c -@@ -640,6 +640,8 @@ void CDECL X11DRV_ThreadDetach(void) +@@ -632,6 +632,8 @@ void CDECL X11DRV_ThreadDetach(void) if (data) { @@ -290,7 +268,7 @@ index ff9185a523c..f33a79d98bf 100644 if (data->xim) XCloseIM( data->xim ); if (data->font_set) XFreeFontSet( data->display, data->font_set ); XCloseDisplay( data->display ); -@@ -712,6 +714,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) +@@ -701,6 +703,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) TlsSetValue( thread_data_tls_index, data ); if (use_xim) X11DRV_SetupXIM(); @@ -300,5 +278,5 @@ index ff9185a523c..f33a79d98bf 100644 return data; } -- -2.24.1 +2.27.0 diff --git a/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch b/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch index c3803c17..23030329 100644 --- a/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch +++ b/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch @@ -1,4 +1,4 @@ -From 488721840b4825a33c7e51aabf473cb81033c682 Mon Sep 17 00:00:00 2001 +From 9cbc0d6d9404dc93016ba7db6a10a2cad873cbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 11 May 2017 05:32:55 +0200 Subject: [PATCH] winebuild: Generate syscall thunks for ntdll exports. @@ -22,10 +22,10 @@ Based on a patch by Erich E. Hoover. 14 files changed, 220 insertions(+), 31 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 87a65e4fc11..05d32ab167e 100644 +index 42cdc628021..339b54a9e67 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -3812,6 +3812,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) +@@ -3387,6 +3387,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) return ret; } @@ -33,7 +33,7 @@ index 87a65e4fc11..05d32ab167e 100644 /****************************************************************** * LdrInitializeThunk (NTDLL.@) -@@ -3828,6 +3829,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow +@@ -3403,6 +3404,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow WINE_MODREF *wm; LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; @@ -43,10 +43,10 @@ index 87a65e4fc11..05d32ab167e 100644 RtlEnterCriticalSection( &loader_section ); diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 21cc1b3ead4..18be5693a7d 100644 +index bda19bf4632..5dccee926b9 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c -@@ -346,6 +346,8 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, +@@ -336,6 +336,8 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, "ret $4" ) @@ -55,7 +55,7 @@ index 21cc1b3ead4..18be5693a7d 100644 /*********************************************************************** * NtGetContextThread (NTDLL.@) * ZwGetContextThread (NTDLL.@) -@@ -370,7 +372,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi, +@@ -360,7 +362,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi, { context->Ebp = ebp; context->Esp = (DWORD)&retaddr; @@ -65,7 +65,7 @@ index 21cc1b3ead4..18be5693a7d 100644 } return unix_funcs->NtGetContextThread( handle, context ); diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c -index a5e6faa461a..51938bf84cc 100644 +index 411439f180f..cd019fd5add 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1643,6 +1643,8 @@ static void test_thread_context(void) @@ -78,7 +78,7 @@ index a5e6faa461a..51938bf84cc 100644 ok( context.SegCs == LOWORD(expect.SegCs), "wrong SegCs %08x/%08x\n", context.SegCs, expect.SegCs ); ok( context.SegDs == LOWORD(expect.SegDs), "wrong SegDs %08x/%08x\n", context.SegDs, expect.SegDs ); diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 7329aa177ba..a878a7a27fa 100644 +index fc57f186544..780b3b153da 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -94,6 +94,14 @@ int __cdecl __wine_dbg_output( const char *str ) @@ -97,27 +97,27 @@ index 7329aa177ba..a878a7a27fa 100644 /*********************************************************************** * thread_init @@ -105,7 +113,7 @@ int __cdecl __wine_dbg_output( const char *str ) - TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) + TEB *thread_init( SIZE_T *info_size ) { - TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, suspend, &server_cpus, -- &is_wow64, &server_start_time ); -+ &is_wow64, &server_start_time, __wine_syscall_dispatcher ); + ULONG_PTR val; +- TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size ); ++ TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, __wine_syscall_dispatcher ); peb = teb->Peb; peb->FastPebLock = &peb_lock; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c -index d26e0a98cac..cb44bbfd5ea 100644 +index f3dddd2b02a..7952497645e 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c -@@ -85,7 +85,7 @@ static void pthread_exit_wrapper( int status ) +@@ -84,7 +84,7 @@ static void pthread_exit_wrapper( int status ) + /*********************************************************************** * init_threading */ - TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, BOOL *suspend, -- unsigned int *cpus, BOOL *wow64, timeout_t *start_time ) -+ unsigned int *cpus, BOOL *wow64, timeout_t *start_time, void *syscall_handler ) +-TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size ) ++TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler ) { TEB *teb; - SIZE_T info_size; + BOOL suspend; @@ -96,6 +96,7 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ nb_threads = nb_threads_ptr; @@ -127,33 +127,33 @@ index d26e0a98cac..cb44bbfd5ea 100644 signal_init_threading(); signal_alloc_thread( teb ); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 8811fd6c21d..166a6542724 100644 +index 707ca819e0e..72987a0041b 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -113,7 +113,7 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE +@@ -115,7 +115,7 @@ extern NTSTATUS CDECL server_handle_to_fd( HANDLE handle, unsigned int access, i + unsigned int *options ) DECLSPEC_HIDDEN; + extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDEN; extern void CDECL server_init_process_done( void *relay ) DECLSPEC_HIDDEN; - extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, - BOOL *suspend, unsigned int *cpus, BOOL *wow64, -- timeout_t *start_time ) DECLSPEC_HIDDEN; -+ timeout_t *start_time, void *syscall_handler ) DECLSPEC_HIDDEN; +-extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size ) DECLSPEC_HIDDEN; ++extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_thread( int status ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_process( int status ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h -index 7dec512cb09..a9803478a37 100644 +index b14adce4a70..b5b7cb07c80 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h -@@ -302,7 +302,7 @@ struct unix_funcs +@@ -304,7 +304,7 @@ struct unix_funcs + void (CDECL *virtual_set_large_address_space)(void); /* thread/process functions */ - TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, -- BOOL *suspend, unsigned int *cpus, BOOL *wow64, timeout_t *start_time ); -+ BOOL *suspend, unsigned int *cpus, BOOL *wow64, timeout_t *start_time, void *syscall_handler ); +- TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size ); ++ TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, void *syscall_handler ); void (CDECL *exit_thread)( int status ); void (CDECL *exit_process)( int status ); NTSTATUS (CDECL *exec_process)( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status ); diff --git a/include/winternl.h b/include/winternl.h -index 4b3202cdc20..5f58366f649 100644 +index 34d2737b705..ef848272f7f 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -359,7 +359,7 @@ typedef struct _TEB @@ -254,7 +254,7 @@ index 04ab433dd65..0c6bafed8e5 100644 } } diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c -index 0f2b9c1e10a..74216f8bb6e 100644 +index 0207b8ac3c3..91f596f1d2d 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -543,6 +543,24 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp ) @@ -335,7 +335,7 @@ index 0f2b9c1e10a..74216f8bb6e 100644 /******************************************************************* * add_16bit_exports * -@@ -916,6 +973,8 @@ int parse_spec_file( FILE *file, DLLSPEC *spec ) +@@ -912,6 +969,8 @@ int parse_spec_file( FILE *file, DLLSPEC *spec ) current_line = 0; /* no longer parsing the input file */ assign_names( spec ); assign_ordinals( spec ); diff --git a/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch b/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch index 15cb684c..ddd580f1 100644 --- a/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch +++ b/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch @@ -1,4 +1,4 @@ -From ce23308632979fdff714da4322e4f56905873374 Mon Sep 17 00:00:00 2001 +From 56e581b1709c2def25db836cc8126c0eabfb11e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 15 May 2017 16:27:56 +0200 Subject: [PATCH] winebuild: Add stub functions in fake dlls. @@ -62,10 +62,10 @@ index 984246681cb..78100205c9d 100644 CloseHandle(map); CloseHandle(file); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 05d32ab167e..5b26a556f0d 100644 +index 339b54a9e67..995dcd48786 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -3813,6 +3813,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) +@@ -3388,6 +3388,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) } extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); @@ -73,7 +73,7 @@ index 05d32ab167e..5b26a556f0d 100644 /****************************************************************** * LdrInitializeThunk (NTDLL.@) -@@ -3830,6 +3831,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow +@@ -3405,6 +3406,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; NtCurrentTeb()->WOW32Reserved = __wine_syscall_dispatcher; @@ -82,7 +82,7 @@ index 05d32ab167e..5b26a556f0d 100644 if (process_detaching) return; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index a878a7a27fa..21ae0e9ebbd 100644 +index 3f84beb8f26..0eb7d901c4d 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -36,6 +36,7 @@ @@ -93,7 +93,7 @@ index a878a7a27fa..21ae0e9ebbd 100644 WINE_DECLARE_DEBUG_CHANNEL(relay); struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000; -@@ -103,6 +104,39 @@ void __wine_syscall_dispatcher( void ) +@@ -104,6 +105,39 @@ void __wine_syscall_dispatcher( void ) } #endif @@ -133,19 +133,19 @@ index a878a7a27fa..21ae0e9ebbd 100644 /*********************************************************************** * thread_init * -@@ -114,6 +148,7 @@ TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) - { - TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, suspend, &server_cpus, - &is_wow64, &server_start_time, __wine_syscall_dispatcher ); -+ teb->Spare2 = (ULONG_PTR)__wine_fakedll_dispatcher; +@@ -116,6 +150,7 @@ TEB *thread_init( SIZE_T *info_size ) + ULONG_PTR val; + TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, __wine_syscall_dispatcher ); ++ teb->Spare2 = (ULONG_PTR)__wine_fakedll_dispatcher; peb = teb->Peb; peb->FastPebLock = &peb_lock; + peb->ApiSetMap = &apiset_map; diff --git a/include/winternl.h b/include/winternl.h -index 5f58366f649..d3b708c3e0d 100644 +index 6de209d6f07..d9c31156025 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -398,7 +398,7 @@ typedef struct _TEB +@@ -399,7 +399,7 @@ typedef struct _TEB PVOID Instrumentation[16]; /* f2c/16b8 */ PVOID WinSockData; /* f6c/1738 */ ULONG GdiBatchCount; /* f70/1740 */ diff --git a/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch b/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch index a8f6ebc4..c3742a62 100644 --- a/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch +++ b/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch @@ -1,4 +1,4 @@ -From 2f3bcc431318c7db08080c6e2c9f9b566f9123ec Mon Sep 17 00:00:00 2001 +From 8650aa0a3229b84a102cca1d9fe40f9dbd5a038d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 7 Sep 2017 00:38:09 +0200 Subject: [PATCH] tools/winebuild: Add syscall thunks for 64 bit. @@ -42,23 +42,23 @@ index d39ebe4a37c..dccd9c1fc68 100644 todo_wine ok(0, "%s: Export is a stub-function, skipping\n", func_name); continue; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c -index cb44bbfd5ea..196dc2d8c4e 100644 +index 7952497645e..ca5eba4da88 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -104,7 +104,7 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ dbg_init(); server_init_process(); - info_size = server_init_thread( teb->Peb, suspend ); + info_size = server_init_thread( teb->Peb, &suspend ); - virtual_map_user_shared_data(); -+ virtual_map_user_shared_data(syscall_handler); ++ virtual_map_user_shared_data( syscall_handler ); + virtual_create_builtin_view( ntdll_module ); + init_cpu_info(); init_files(); - NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 ); - diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 166a6542724..df508e569f9 100644 +index 72987a0041b..15be5d3715a 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -177,7 +177,7 @@ extern TEB *virtual_alloc_first_teb(void) DECLSPEC_HIDDEN; +@@ -187,7 +187,7 @@ extern TEB *virtual_alloc_first_teb(void) DECLSPEC_HIDDEN; extern NTSTATUS virtual_alloc_teb( TEB **ret_teb ) DECLSPEC_HIDDEN; extern void virtual_free_teb( TEB *teb ) DECLSPEC_HIDDEN; extern NTSTATUS virtual_clear_tls_index( ULONG index ) DECLSPEC_HIDDEN; @@ -68,10 +68,10 @@ index 166a6542724..df508e569f9 100644 extern unsigned int virtual_locked_server_call( void *req_ptr ) DECLSPEC_HIDDEN; extern ssize_t virtual_locked_read( int fd, void *addr, size_t size ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index ca25cdd304e..7f7660d0795 100644 +index e759cf686bd..0c8de5f2c24 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -2607,14 +2607,14 @@ TEB *virtual_alloc_first_teb(void) +@@ -2608,14 +2608,14 @@ TEB *virtual_alloc_first_teb(void) TEB *teb; PEB *peb; NTSTATUS status; @@ -88,7 +88,7 @@ index ca25cdd304e..7f7660d0795 100644 if (status) { ERR( "wine: failed to map the shared user data: %08x\n", status ); -@@ -2838,7 +2838,7 @@ void virtual_clear_thread_stack( void *stack_end ) +@@ -2839,7 +2839,7 @@ void virtual_clear_thread_stack( void *stack_end ) /*********************************************************************** * virtual_map_user_shared_data */ @@ -97,7 +97,7 @@ index ca25cdd304e..7f7660d0795 100644 { static const WCHAR wine_usdW[] = {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s', '\\','_','_','w','i','n','e','_','u','s','e','r','_','s','h','a','r','e','d','_','d','a','t','a',0}; -@@ -2861,6 +2861,11 @@ void virtual_map_user_shared_data(void) +@@ -2862,6 +2862,11 @@ void virtual_map_user_shared_data(void) ERR( "failed to remap the process USD: %d\n", res ); exit(1); } @@ -143,7 +143,7 @@ index 0941dd87c05..002f3215af2 100644 } diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c -index 74216f8bb6e..820516329a4 100644 +index 91f596f1d2d..533ec5d2009 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -545,7 +545,7 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp ) diff --git a/patches/winebuild-Fake_Dlls/definition b/patches/winebuild-Fake_Dlls/definition index 99799c33..2f30fce6 100644 --- a/patches/winebuild-Fake_Dlls/definition +++ b/patches/winebuild-Fake_Dlls/definition @@ -4,4 +4,5 @@ Fixes: [45349] Multiple applications and games crash due to missing support for Fixes: [45573] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of syscall return instructions) Fixes: [45650] chromium 32-bit sandbox expects different syscall thunks depending on Windows version Depends: ntdll-WRITECOPY -Depends: ws2_32-WSACleanup \ No newline at end of file +Depends: ws2_32-WSACleanup +Depends: ntdll-ApiSetMap diff --git a/staging/upstream-commit b/staging/upstream-commit index fa451edc..4515c8af 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -449b8c7e9212d0a80e28babff20f2755b7370872 +bc282905d9491b9f9fe4ae4b69a8ccdf99c5aaa8