From 60074b960facf130e681f5317a96394920f902cc Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 25 Jun 2020 08:13:27 +1000 Subject: [PATCH] Rebase against 1f6423f778f7036a3875613e10b9c8c3b84584f0. --- ...on-to-create-new-tokens-for-elevatio.patch | 12 ++--- ...on-Fake-success-from-IDirectManipula.patch | 26 ----------- ...ation-Fake-success-in-some-functions.patch | 34 -------------- patches/directmanipulation-new-dll/definition | 1 - ...ase-Maintain-FLS-storage-list-in-PEB.patch | 44 +++++++++---------- patches/patchinstall.sh | 23 +--------- staging/upstream-commit | 2 +- 7 files changed, 30 insertions(+), 112 deletions(-) delete mode 100644 patches/directmanipulation-new-dll/0013-directmanipulation-Fake-success-from-IDirectManipula.patch delete mode 100644 patches/directmanipulation-new-dll/0017-directmanipulation-Fake-success-in-some-functions.patch delete mode 100644 patches/directmanipulation-new-dll/definition 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 cd9a4649..f0c849a5 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 44e752d89a76ba4a686f5d6b822d95c427b35bc0 Mon Sep 17 00:00:00 2001 +From d768c632777d80f52327ba0d525a0157b113f45a 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,19 +28,19 @@ 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 e2e4d378085..14cd0bafdc0 100644 +index b5b08fc47ef..8476907e7ec 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -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; +@@ -72,6 +72,9 @@ extern void init_locale( HMODULE module ) DECLSPEC_HIDDEN; + extern void init_user_process_params( SIZE_T data_size ) 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); + /* server support */ - extern const char *build_dir DECLSPEC_HIDDEN; - extern const char *data_dir DECLSPEC_HIDDEN; + extern BOOL is_wow64 DECLSPEC_HIDDEN; + extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index b1cc307d2ae..2e5fee216ef 100644 --- a/dlls/ntdll/process.c diff --git a/patches/directmanipulation-new-dll/0013-directmanipulation-Fake-success-from-IDirectManipula.patch b/patches/directmanipulation-new-dll/0013-directmanipulation-Fake-success-from-IDirectManipula.patch deleted file mode 100644 index 89deefcf..00000000 --- a/patches/directmanipulation-new-dll/0013-directmanipulation-Fake-success-from-IDirectManipula.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5d5892c9403b77bd3f17acebfee1acc7e95003a0 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Tue, 30 Jul 2019 09:30:41 +1000 -Subject: [PATCH 1/4] directmanipulation: Fake success from - IDirectManipulationViewport2 ActivateConfiguration. - ---- - dlls/directmanipulation/directmanipulation.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c -index 4f16963d42..f1e008bc7f 100644 ---- a/dlls/directmanipulation/directmanipulation.c -+++ b/dlls/directmanipulation/directmanipulation.c -@@ -370,7 +370,7 @@ static HRESULT WINAPI viewport_ActivateConfiguration(IDirectManipulationViewport - { - struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); - FIXME("%p, %d\n", This, configuration); -- return E_NOTIMPL; -+ return S_OK; - } - - static HRESULT WINAPI viewport_SetManualGesture(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration) --- -2.17.1 - diff --git a/patches/directmanipulation-new-dll/0017-directmanipulation-Fake-success-in-some-functions.patch b/patches/directmanipulation-new-dll/0017-directmanipulation-Fake-success-in-some-functions.patch deleted file mode 100644 index 95487902..00000000 --- a/patches/directmanipulation-new-dll/0017-directmanipulation-Fake-success-in-some-functions.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 8e284d9f96e2f3c623d6f520c530aaadad943fcd Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Sun, 22 Dec 2019 20:54:43 +1100 -Subject: [PATCH 2/2] directmanipulation: Fake success in some functions - ---- - dlls/directmanipulation/directmanipulation.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c -index 05601abbd45..b42c1f84387 100644 ---- a/dlls/directmanipulation/directmanipulation.c -+++ b/dlls/directmanipulation/directmanipulation.c -@@ -357,7 +357,7 @@ static HRESULT WINAPI content_SetContentRect(IDirectManipulationContent *iface, - { - struct primarycontext *This = impl_from_IDirectManipulationContent(iface); - FIXME("%p, %p\n", This, size); -- return E_NOTIMPL; -+ return S_OK; - } - - static HRESULT WINAPI content_GetViewport(IDirectManipulationContent *iface, REFIID riid, void **object) -@@ -540,7 +540,7 @@ static HRESULT WINAPI viewport_SetViewportRect(IDirectManipulationViewport2 *ifa - { - struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); - FIXME("%p, %p\n", This, viewport); -- return E_NOTIMPL; -+ return S_OK; - } - - static HRESULT WINAPI viewport_ZoomToRect(IDirectManipulationViewport2 *iface, const float left, --- -2.24.0 - diff --git a/patches/directmanipulation-new-dll/definition b/patches/directmanipulation-new-dll/definition deleted file mode 100644 index 125f0fed..00000000 --- a/patches/directmanipulation-new-dll/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [44865] directmanipulation: New DLL. diff --git a/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch b/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch index 40f2a0b8..4761fc87 100644 --- a/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch +++ b/patches/ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch @@ -1,4 +1,4 @@ -From 3fe24d6e3b216c21b6a7b68766414213fdd2ff2d Mon Sep 17 00:00:00 2001 +From 96a5e54b5f72d99a9c3d03ac4c5800fe324e44c0 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 Apr 2020 14:32:23 +0300 Subject: [PATCH] kernelbase: Maintain FLS storage list in PEB. @@ -73,10 +73,10 @@ index 7501165dc87..2bcc3ee60c4 100644 * FlsFree should fail * FlsGetValue and FlsSetValue should succeed diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c -index a9869863b44..b24f9e98bc7 100644 +index b91d279e327..924f19703bf 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c -@@ -2377,7 +2377,6 @@ START_TEST(thread) +@@ -2445,7 +2445,6 @@ START_TEST(thread) } return; } @@ -84,7 +84,7 @@ index a9869863b44..b24f9e98bc7 100644 test_thread_info(); test_reserved_tls(); test_CreateRemoteThread(); -@@ -2405,6 +2404,5 @@ START_TEST(thread) +@@ -2473,6 +2472,5 @@ START_TEST(thread) test_thread_fpu_cw(); test_thread_actctx(); test_thread_description(); @@ -92,7 +92,7 @@ index a9869863b44..b24f9e98bc7 100644 test_threadpool(); } diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c -index f20d460d07d..3c77b6a42f4 100644 +index f44f2ff6538..3423fe8c727 100644 --- a/dlls/kernelbase/thread.c +++ b/dlls/kernelbase/thread.c @@ -38,6 +38,10 @@ @@ -106,7 +106,7 @@ index f20d460d07d..3c77b6a42f4 100644 /*********************************************************************** * Threads -@@ -915,6 +919,19 @@ static void init_fiber_context( struct fiber_data *fiber ) +@@ -928,6 +932,19 @@ static void init_fiber_context( struct fiber_data *fiber ) #endif } @@ -126,7 +126,7 @@ index f20d460d07d..3c77b6a42f4 100644 /*********************************************************************** * CreateFiber (kernelbase.@) -@@ -1022,7 +1039,16 @@ void WINAPI DECLSPEC_HOTPATCH DeleteFiber( LPVOID fiber_ptr ) +@@ -1035,7 +1052,16 @@ void WINAPI DECLSPEC_HOTPATCH DeleteFiber( LPVOID fiber_ptr ) RtlExitUserThread( 1 ); } RtlFreeUserStack( fiber->stack_allocation ); @@ -144,7 +144,7 @@ index f20d460d07d..3c77b6a42f4 100644 HeapFree( GetProcessHeap(), 0, fiber ); } -@@ -1044,6 +1070,19 @@ void WINAPI DECLSPEC_HOTPATCH SwitchToFiber( LPVOID fiber ) +@@ -1057,6 +1083,19 @@ void WINAPI DECLSPEC_HOTPATCH SwitchToFiber( LPVOID fiber ) struct fiber_data *new_fiber = fiber; struct fiber_data *current_fiber = NtCurrentTeb()->Tib.u.FiberData; @@ -164,7 +164,7 @@ index f20d460d07d..3c77b6a42f4 100644 current_fiber->except = NtCurrentTeb()->Tib.ExceptionList; current_fiber->stack_limit = NtCurrentTeb()->Tib.StackLimit; current_fiber->fls_slots = NtCurrentTeb()->FlsSlots; -@@ -1069,9 +1108,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) +@@ -1082,9 +1121,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) PEB * const peb = NtCurrentTeb()->Peb; RtlAcquirePebLock(); @@ -175,7 +175,7 @@ index f20d460d07d..3c77b6a42f4 100644 { SetLastError( ERROR_NOT_ENOUGH_MEMORY ); index = FLS_OUT_OF_INDEXES; -@@ -1081,9 +1118,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) +@@ -1094,9 +1131,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) index = RtlFindClearBitsAndSet( peb->FlsBitmap, 1, 1 ); if (index != ~0U) { @@ -186,7 +186,7 @@ index f20d460d07d..3c77b6a42f4 100644 { RtlClearBits( peb->FlsBitmap, index, 1 ); index = FLS_OUT_OF_INDEXES; -@@ -1091,8 +1126,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) +@@ -1104,8 +1139,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc( PFLS_CALLBACK_FUNCTION callback ) } else { @@ -197,7 +197,7 @@ index f20d460d07d..3c77b6a42f4 100644 } } else SetLastError( ERROR_NO_MORE_ITEMS ); -@@ -1116,7 +1151,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsFree( DWORD index ) +@@ -1129,7 +1164,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsFree( DWORD index ) { /* FIXME: call Fls callback */ /* FIXME: add equivalent of ThreadZeroTlsCell here */ @@ -206,7 +206,7 @@ index f20d460d07d..3c77b6a42f4 100644 } else SetLastError( ERROR_INVALID_PARAMETER ); RtlReleasePebLock(); -@@ -1135,7 +1170,7 @@ PVOID WINAPI DECLSPEC_HOTPATCH FlsGetValue( DWORD index ) +@@ -1148,7 +1183,7 @@ PVOID WINAPI DECLSPEC_HOTPATCH FlsGetValue( DWORD index ) return NULL; } SetLastError( ERROR_SUCCESS ); @@ -215,7 +215,7 @@ index f20d460d07d..3c77b6a42f4 100644 } -@@ -1149,14 +1184,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsSetValue( DWORD index, PVOID data ) +@@ -1162,14 +1197,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlsSetValue( DWORD index, PVOID data ) SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; } @@ -233,10 +233,10 @@ index f20d460d07d..3c77b6a42f4 100644 } diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index ffbc9fabb23..be53d98e5b8 100644 +index b884b43b154..c0a18669590 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -169,6 +169,15 @@ static CRITICAL_SECTION_DEBUG dlldir_critsect_debug = +@@ -153,6 +153,15 @@ static CRITICAL_SECTION_DEBUG dlldir_critsect_debug = }; static CRITICAL_SECTION dlldir_section = { &dlldir_critsect_debug, -1, 0, 0, 0, 0 }; @@ -252,7 +252,7 @@ index ffbc9fabb23..be53d98e5b8 100644 static WINE_MODREF *cached_modref; static WINE_MODREF *current_modref; static WINE_MODREF *last_failed_modref; -@@ -209,6 +218,16 @@ static RTL_UNLOAD_EVENT_TRACE unload_traces[RTL_UNLOAD_EVENT_TRACE_NUMBER]; +@@ -193,6 +202,16 @@ static RTL_UNLOAD_EVENT_TRACE unload_traces[RTL_UNLOAD_EVENT_TRACE_NUMBER]; static RTL_UNLOAD_EVENT_TRACE *unload_trace_ptr; static unsigned int unload_trace_seq; @@ -269,7 +269,7 @@ index ffbc9fabb23..be53d98e5b8 100644 static void module_push_unload_trace( const LDR_DATA_TABLE_ENTRY *ldr ) { RTL_UNLOAD_EVENT_TRACE *ptr = &unload_traces[unload_trace_seq]; -@@ -3610,6 +3629,13 @@ void WINAPI LdrShutdownThread(void) +@@ -3187,6 +3206,13 @@ void WINAPI LdrShutdownThread(void) /* don't do any detach calls if process is exiting */ if (process_detaching) return; @@ -281,9 +281,9 @@ index ffbc9fabb23..be53d98e5b8 100644 + } + RtlEnterCriticalSection( &loader_section ); + wm = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress ); - mark = &NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList; -@@ -3819,6 +3845,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) +@@ -3400,6 +3426,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) */ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknown3, ULONG_PTR unknown4 ) { @@ -291,7 +291,7 @@ index ffbc9fabb23..be53d98e5b8 100644 static int attach_done; int i; NTSTATUS status; -@@ -3856,6 +3883,25 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow +@@ -3435,6 +3462,25 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow InsertHeadList( &tls_links, &NtCurrentTeb()->TlsLinks ); RtlReleasePebLock(); @@ -318,5 +318,5 @@ index ffbc9fabb23..be53d98e5b8 100644 { attach_done = 1; -- -2.26.2 +2.27.0 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 374c6f5c..286f596c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "bc282905d9491b9f9fe4ae4b69a8ccdf99c5aaa8" + echo "1f6423f778f7036a3875613e10b9c8c3b84584f0" } # Show version information @@ -124,7 +124,6 @@ patch_enable_all () enable_dinput_joy_mappings="$1" enable_dinput_reconnect_joystick="$1" enable_dinput_remap_joystick="$1" - enable_directmanipulation_new_dll="$1" enable_dsdmo_new_dll="$1" enable_dsound_EAX="$1" enable_dsound_Fast_Mixer="$1" @@ -464,9 +463,6 @@ patch_enable () dinput-remap-joystick) enable_dinput_remap_joystick="$2" ;; - directmanipulation-new-dll) - enable_directmanipulation_new_dll="$2" - ;; dsdmo-new-dll) enable_dsdmo_new_dll="$2" ;; @@ -2689,23 +2685,6 @@ if test "$enable_dinput_remap_joystick" -eq 1; then ) >> "$patchlist" fi -# Patchset directmanipulation-new-dll -# | -# | This patchset fixes the following Wine bugs: -# | * [#44865] directmanipulation: New DLL. -# | -# | Modified files: -# | * dlls/directmanipulation/directmanipulation.c -# | -if test "$enable_directmanipulation_new_dll" -eq 1; then - patch_apply directmanipulation-new-dll/0013-directmanipulation-Fake-success-from-IDirectManipula.patch - patch_apply directmanipulation-new-dll/0017-directmanipulation-Fake-success-in-some-functions.patch - ( - printf '%s\n' '+ { "Alistair Leslie-Hughes", "directmanipulation: Fake success from IDirectManipulationViewport2 ActivateConfiguration.", 1 },'; - printf '%s\n' '+ { "Alistair Leslie-Hughes", "directmanipulation: Fake success in some functions.", 1 },'; - ) >> "$patchlist" -fi - # Patchset dsdmo-new-dll # | # | This patchset fixes the following Wine bugs: diff --git a/staging/upstream-commit b/staging/upstream-commit index 4515c8af..e9949432 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -bc282905d9491b9f9fe4ae4b69a8ccdf99c5aaa8 +1f6423f778f7036a3875613e10b9c8c3b84584f0