From 3d1995983f2c8626d9ac35d2ceeec3e3f3cd39c4 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 2 Jun 2016 22:04:13 +0200 Subject: [PATCH] Rebase against 03fa4cfaffd4c10f56a2f8bfd383f4eaf67d364c. [ntdll-WinSqm] Removed patch to add WinSqm[Start|End]Session implementation (accepted upstream). --- ...EventRegister-from-advapi32-to-ntdll.patch | 16 +- ...for-WinSqmStartSession-WinSqmEndSess.patch | 160 ------------------ patches/ntdll-WinSqm/definition | 2 - patches/patchinstall.sh | 31 +--- .../wined3d-CSMT_Main/9999-IfDefined.patch | 6 +- 5 files changed, 12 insertions(+), 203 deletions(-) delete mode 100644 patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch delete mode 100644 patches/ntdll-WinSqm/definition diff --git a/patches/ntdll-EtwRegisterTraceGuids/0001-ntdll-Move-EventRegister-from-advapi32-to-ntdll.patch b/patches/ntdll-EtwRegisterTraceGuids/0001-ntdll-Move-EventRegister-from-advapi32-to-ntdll.patch index baab091f..b5eb7a6e 100644 --- a/patches/ntdll-EtwRegisterTraceGuids/0001-ntdll-Move-EventRegister-from-advapi32-to-ntdll.patch +++ b/patches/ntdll-EtwRegisterTraceGuids/0001-ntdll-Move-EventRegister-from-advapi32-to-ntdll.patch @@ -1,4 +1,4 @@ -From cd819b58a124eccd6c2322819f799e8870853896 Mon Sep 17 00:00:00 2001 +From 98ab81eabd3554ba3d5d8f95f50530b2a3dd1169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 17 Jan 2016 03:02:57 +0100 Subject: ntdll: Move EventRegister from advapi32 to ntdll. @@ -11,7 +11,7 @@ Subject: ntdll: Move EventRegister from advapi32 to ntdll. 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec -index 88f7fee..6a015e4 100644 +index 3f32aa3..fa1c777 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -272,7 +272,7 @@ @@ -46,10 +46,10 @@ index 93c164d..4beda0f 100644 */ ULONG WINAPI EventUnregister( REGHANDLE handle ) diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c -index 0f6c5df..fadba20 100644 +index f540c4b..6d22b08 100644 --- a/dlls/ntdll/misc.c +++ b/dlls/ntdll/misc.c -@@ -32,6 +32,7 @@ +@@ -34,6 +34,7 @@ #include "ntdll_misc.h" #include "wmistr.h" #include "evntrace.h" @@ -57,8 +57,8 @@ index 0f6c5df..fadba20 100644 WINE_DEFAULT_DEBUG_CHANNEL(ntdll); -@@ -338,6 +339,17 @@ BOOL WINAPI WinSqmIsOptedIn(void) - return FALSE; +@@ -358,6 +359,17 @@ HANDLE WINAPI WinSqmStartSession(GUID *sessionguid, DWORD sessionid, DWORD unkno + return INVALID_HANDLE_VALUE; } +/********************************************************************* @@ -76,7 +76,7 @@ index 0f6c5df..fadba20 100644 * EtwRegisterTraceGuidsW (NTDLL.@) * diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 0ccd79f..57a11b6 100644 +index 4737b06..e528c49 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -41,6 +41,7 @@ @@ -88,5 +88,5 @@ index 0ccd79f..57a11b6 100644 @ stdcall EtwRegisterTraceGuidsW(ptr ptr ptr long ptr wstr wstr ptr) # @ stub KiFastSystemCall -- -2.7.1 +2.8.0 diff --git a/patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch b/patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch deleted file mode 100644 index a1d8557c..00000000 --- a/patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 851ba4dda4a21cbd8f18cf1748e0a8192662fe35 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Thu, 25 Dec 2014 12:36:28 -0700 -Subject: ntdll: Add stubs for WinSqmStartSession / WinSqmEndSession. - -Based on a patch by Detlef Riekenberg. ---- - dlls/ntdll/misc.c | 20 +++++++++++++++++++ - dlls/ntdll/ntdll.spec | 2 ++ - dlls/ntdll/tests/rtl.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 76 insertions(+) - -diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c -index b087319..0d52b67 100644 ---- a/dlls/ntdll/misc.c -+++ b/dlls/ntdll/misc.c -@@ -27,6 +27,8 @@ - #include - #endif - -+#include "ntstatus.h" -+#define WIN32_NO_STATUS - #include "wine/library.h" - #include "wine/debug.h" - #include "ntdll_misc.h" -@@ -331,6 +333,15 @@ void * __cdecl _lfind( const void *key, const void *base, unsigned int *nmemb, - } - - /********************************************************************* -+ * WinSqmEndSession (NTDLL.@) -+ */ -+NTSTATUS WINAPI WinSqmEndSession(PVOID unknown1) -+{ -+ FIXME("(%p) stub!\n", unknown1); -+ return STATUS_NOT_IMPLEMENTED; -+} -+ -+/********************************************************************* - * WinSqmIsOptedIn (NTDLL.@) - */ - BOOL WINAPI WinSqmIsOptedIn(void) -@@ -340,6 +351,15 @@ BOOL WINAPI WinSqmIsOptedIn(void) - } - - /********************************************************************* -+ * WinSqmStartSession (NTDLL.@) -+ */ -+PVOID WINAPI WinSqmStartSession(PVOID unknown1, DWORD unknown2, DWORD unknown3) -+{ -+ FIXME("(%p, 0x%x, 0x%x) stub!\n", unknown1, unknown2, unknown3); -+ return NULL; -+} -+ -+/********************************************************************* - * EtwEventRegister (NTDLL.@) - */ - ULONG WINAPI EtwEventRegister( LPCGUID provider, PENABLECALLBACK callback, PVOID context, PREGHANDLE handle ) -diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 1a3b724..c353acf 100644 ---- a/dlls/ntdll/ntdll.spec -+++ b/dlls/ntdll/ntdll.spec -@@ -1012,7 +1012,9 @@ - @ stdcall TpWaitForWait(ptr long) - @ stdcall TpWaitForWork(ptr long) - @ stdcall -ret64 VerSetConditionMask(int64 long long) -+@ stdcall WinSqmEndSession(ptr) - @ stdcall WinSqmIsOptedIn() -+@ stdcall WinSqmStartSession(ptr long long) - @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort - @ stdcall ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck - @ stdcall ZwAccessCheckAndAuditAlarm(ptr long ptr ptr ptr long ptr long ptr ptr ptr) NtAccessCheckAndAuditAlarm -diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c -index fc0d4b4..8cfb106 100644 ---- a/dlls/ntdll/tests/rtl.c -+++ b/dlls/ntdll/tests/rtl.c -@@ -62,6 +62,9 @@ static inline USHORT __my_ushort_swap(USHORT s) - - /* Function ptrs for ntdll calls */ - static HMODULE hntdll = 0; -+static PVOID (WINAPI *pWinSqmStartSession)(PVOID unknown1, DWORD unknown2, DWORD unknown3); -+static BOOL (WINAPI *pWinSqmIsOptedIn)(void); -+static NTSTATUS (WINAPI *pWinSqmEndSession)(PVOID unknown1); - static SIZE_T (WINAPI *pRtlCompareMemory)(LPCVOID,LPCVOID,SIZE_T); - static SIZE_T (WINAPI *pRtlCompareMemoryUlong)(PULONG, SIZE_T, ULONG); - static NTSTATUS (WINAPI *pRtlDeleteTimer)(HANDLE, HANDLE, HANDLE); -@@ -116,6 +119,9 @@ static void InitFunctionPtrs(void) - hntdll = LoadLibraryA("ntdll.dll"); - ok(hntdll != 0, "LoadLibrary failed\n"); - if (hntdll) { -+ pWinSqmStartSession = (void *)GetProcAddress(hntdll, "WinSqmStartSession"); -+ pWinSqmIsOptedIn = (void *)GetProcAddress(hntdll, "WinSqmIsOptedIn"); -+ pWinSqmEndSession = (void *)GetProcAddress(hntdll, "WinSqmEndSession"); - pRtlCompareMemory = (void *)GetProcAddress(hntdll, "RtlCompareMemory"); - pRtlCompareMemoryUlong = (void *)GetProcAddress(hntdll, "RtlCompareMemoryUlong"); - pRtlDeleteTimer = (void *)GetProcAddress(hntdll, "RtlDeleteTimer"); -@@ -163,6 +169,48 @@ static void InitFunctionPtrs(void) - ok(strlen(src) == 15, "Source must be 16 bytes long!\n"); - } - -+#ifdef __i386__ -+const char stdcall3_thunk[] = -+ "\x56" /* push %esi */ -+ "\x89\xE6" /* mov %esp, %esi */ -+ "\xFF\x74\x24\x14" /* pushl 20(%esp) */ -+ "\xFF\x74\x24\x14" /* pushl 20(%esp) */ -+ "\xFF\x74\x24\x14" /* pushl 20(%esp) */ -+ "\xFF\x54\x24\x14" /* calll 20(%esp) */ -+ "\x89\xF0" /* mov %esi, %eax */ -+ "\x29\xE0" /* sub %esp, %eax */ -+ "\x89\xF4" /* mov %esi, %esp */ -+ "\x5E" /* pop %esi */ -+ "\xC2\x10\x00" /* ret $16 */ -+; -+ -+static INT (WINAPI *call_stdcall_func3)(PVOID func, PVOID arg0, DWORD arg1, DWORD arg2) = NULL; -+ -+static void test_WinSqm(void) -+{ -+ INT args; -+ -+ if (!pWinSqmStartSession) -+ { -+ win_skip("WinSqmStartSession() is not available\n"); -+ return; -+ } -+ -+ call_stdcall_func3 = (void*) VirtualAlloc( NULL, sizeof(stdcall3_thunk) - 1, MEM_COMMIT, -+ PAGE_EXECUTE_READWRITE ); -+ memcpy( call_stdcall_func3, stdcall3_thunk, sizeof(stdcall3_thunk) - 1 ); -+ -+ args = 3 - call_stdcall_func3( pWinSqmStartSession, NULL, 0, 0 ) / 4; -+ ok(args == 3, "WinSqmStartSession expected to take %d arguments instead of 3\n", args); -+ args = 3 - call_stdcall_func3( pWinSqmIsOptedIn, NULL, 0, 0 ) / 4; -+ ok(args == 0, "WinSqmIsOptedIn expected to take %d arguments instead of 0\n", args); -+ args = 3 - call_stdcall_func3( pWinSqmEndSession, NULL, 0, 0 ) / 4; -+ ok(args == 1, "WinSqmEndSession expected to take %d arguments instead of 1\n", args); -+ -+ VirtualFree( call_stdcall_func3, 0, MEM_RELEASE ); -+} -+#endif -+ - #define COMP(str1,str2,cmplen,len) size = pRtlCompareMemory(str1, str2, cmplen); \ - ok(size == len, "Expected %ld, got %ld\n", size, (SIZE_T)len) - -@@ -2096,6 +2144,12 @@ START_TEST(rtl) - { - InitFunctionPtrs(); - -+#ifdef __i386__ -+ test_WinSqm(); -+#else -+ skip("stdcall-style parameter checks are not supported on this platform.\n"); -+#endif -+ - test_RtlCompareMemory(); - test_RtlCompareMemoryUlong(); - test_RtlMoveMemory(); --- -2.7.1 - diff --git a/patches/ntdll-WinSqm/definition b/patches/ntdll-WinSqm/definition deleted file mode 100644 index 654b9a00..00000000 --- a/patches/ntdll-WinSqm/definition +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: [31971] ntdll is missing WinSqm[Start|End]Session implementation -Depends: ntdll-EtwRegisterTraceGuids diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index c99339e6..2598f6aa 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "59ee884bdf4947f5939499456539fca7a5806939" + echo "03fa4cfaffd4c10f56a2f8bfd383f4eaf67d364c" } # Show version information @@ -244,7 +244,6 @@ patch_enable_all () enable_ntdll_User_Shared_Data="$1" enable_ntdll_WRITECOPY="$1" enable_ntdll_Wait_User_APC="$1" - enable_ntdll_WinSqm="$1" enable_ntdll_WriteWatches="$1" enable_ntdll_Zero_mod_name="$1" enable_ntdll_call_thread_func_wrapper="$1" @@ -913,9 +912,6 @@ patch_enable () ntdll-Wait_User_APC) enable_ntdll_Wait_User_APC="$2" ;; - ntdll-WinSqm) - enable_ntdll_WinSqm="$2" - ;; ntdll-WriteWatches) enable_ntdll_WriteWatches="$2" ;; @@ -2156,13 +2152,6 @@ if test "$enable_ntdll_WriteWatches" -eq 1; then enable_ws2_32_WriteWatches=1 fi -if test "$enable_ntdll_WinSqm" -eq 1; then - if test "$enable_ntdll_EtwRegisterTraceGuids" -gt 1; then - abort "Patchset ntdll-EtwRegisterTraceGuids disabled, but ntdll-WinSqm depends on that." - fi - enable_ntdll_EtwRegisterTraceGuids=1 -fi - if test "$enable_ntdll_WRITECOPY" -eq 1; then if test "$enable_ws2_32_WriteWatches" -gt 1; then abort "Patchset ws2_32-WriteWatches disabled, but ntdll-WRITECOPY depends on that." @@ -5383,24 +5372,6 @@ if test "$enable_ntdll_Wait_User_APC" -eq 1; then ) >> "$patchlist" fi -# Patchset ntdll-WinSqm -# | -# | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-EtwRegisterTraceGuids -# | -# | This patchset fixes the following Wine bugs: -# | * [#31971] ntdll is missing WinSqm[Start|End]Session implementation -# | -# | Modified files: -# | * dlls/ntdll/misc.c, dlls/ntdll/ntdll.spec, dlls/ntdll/tests/rtl.c -# | -if test "$enable_ntdll_WinSqm" -eq 1; then - patch_apply ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch - ( - echo '+ { "Erich E. Hoover", "ntdll: Add stubs for WinSqmStartSession / WinSqmEndSession.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-WriteWatches # | # | This patchset has the following (direct or indirect) dependencies: diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 75342e99..40586ef0 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -4477,7 +4477,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c { ERR("Failed to create sampler.\n"); sampler = NULL; -@@ -4572,8 +4607,13 @@ +@@ -4580,8 +4615,13 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -4491,7 +4491,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; unsigned int width, height; -@@ -4759,7 +4799,11 @@ +@@ -4767,7 +4807,11 @@ } else { @@ -4503,7 +4503,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c UINT height; UINT width; -@@ -4827,7 +4871,11 @@ +@@ -4835,7 +4879,11 @@ TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);