From: Sebastian Lackner sebastian@fds-team.de
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- Patch adapted from Wine Staging.
I couldn't figure out why you're getting test failures on your machine (`make test` works as well as can be expected here), but hopefully adding a stub for GetProcessDpiAwareness at the same time (also copied from Wine Staging) will fix the problem.
configure.ac | 1 + dlls/shcore/Makefile.in | 4 +++ dlls/shcore/main.c | 50 +++++++++++++++++++++++++++++ dlls/shcore/shcore.spec | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/make_specfiles | 7 ++++- 5 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 dlls/shcore/Makefile.in create mode 100644 dlls/shcore/main.c create mode 100644 dlls/shcore/shcore.spec
diff --git a/configure.ac b/configure.ac index 3942e15e9a..b09a0babf7 100644 --- a/configure.ac +++ b/configure.ac @@ -3530,6 +3530,7 @@ WINE_CONFIG_TEST(dlls/setupapi/tests) WINE_CONFIG_DLL(setupx.dll16,enable_win16) WINE_CONFIG_DLL(sfc,,[implib]) WINE_CONFIG_DLL(sfc_os,,[implib]) +WINE_CONFIG_DLL(shcore) WINE_CONFIG_DLL(shdoclc,,[clean]) WINE_CONFIG_DLL(shdocvw,,[clean,implib]) WINE_CONFIG_TEST(dlls/shdocvw/tests) diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in new file mode 100644 index 0000000000..ec2e95f526 --- /dev/null +++ b/dlls/shcore/Makefile.in @@ -0,0 +1,4 @@ +MODULE = shcore.dll + +C_SRCS = \ + main.c diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c new file mode 100644 index 0000000000..9075a38e1b --- /dev/null +++ b/dlls/shcore/main.c @@ -0,0 +1,50 @@ +/* + * Copyright 2016 Sebastian Lackner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "shellscalingapi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shcore); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("(%p, %u, %p)\n", instance, reason, reserved); + + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} + +HRESULT WINAPI GetProcessDpiAwareness(HANDLE process, PROCESS_DPI_AWARENESS *value) +{ + FIXME("(%p, %p): stub\n", process, value); + if (value) *value = PROCESS_DPI_UNAWARE; + return S_OK; +} diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec new file mode 100644 index 0000000000..ae647a5598 --- /dev/null +++ b/dlls/shcore/shcore.spec @@ -0,0 +1,83 @@ +@ stdcall CommandLineToArgvW(wstr ptr) shell32.CommandLineToArgvW +@ stub CreateRandomAccessStreamOnFile +@ stub CreateRandomAccessStreamOverStream +@ stub CreateStreamOverRandomAccessStream +@ stdcall -private DllCanUnloadNow() shell32.DllCanUnloadNow +@ stub DllGetActivationFactory +@ stdcall -private DllGetClassObject(ptr ptr ptr) shell32.DllGetClassObject +@ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID +@ stub GetDpiForMonitor +@ stub GetDpiForShellUIComponent +@ stdcall GetProcessDpiAwareness(long ptr) +@ stub GetProcessReference +@ stub GetScaleFactorForDevice +@ stub GetScaleFactorForMonitor +@ stub IStream_Copy +@ stdcall IStream_Read(ptr ptr long) shlwapi.IStream_Read +@ stub IStream_ReadStr +@ stdcall IStream_Reset(ptr) shlwapi.IStream_Reset +@ stdcall IStream_Size(ptr ptr) shlwapi.IStream_Size +@ stdcall IStream_Write(ptr ptr long) shlwapi.IStream_Write +@ stub IStream_WriteStr +@ stdcall IUnknown_AtomicRelease(long) shlwapi.IUnknown_AtomicRelease +@ stdcall IUnknown_GetSite(ptr ptr ptr) shlwapi.IUnknown_GetSite +@ stdcall IUnknown_QueryService(ptr ptr ptr ptr) shlwapi.IUnknown_QueryService +@ stdcall IUnknown_Set(ptr ptr) shlwapi.IUnknown_Set +@ stdcall IUnknown_SetSite(ptr ptr) shlwapi.IUnknown_SetSite +@ stdcall IsOS(long) shlwapi.IsOS +@ stub RegisterScaleChangeEvent +@ stub RegisterScaleChangeNotifications +@ stub RevokeScaleChangeNotifications +@ stdcall SHAnsiToAnsi(str ptr long) shlwapi.SHAnsiToAnsi +@ stdcall SHAnsiToUnicode(str ptr long) shlwapi.SHAnsiToUnicode +@ stdcall SHCopyKeyA(long str long long) shlwapi.SHCopyKeyA +@ stdcall SHCopyKeyW(long wstr long long) shlwapi.SHCopyKeyW +@ stdcall SHCreateMemStream(ptr long) shlwapi.SHCreateMemStream +@ stdcall SHCreateStreamOnFileA(str long ptr) shlwapi.SHCreateStreamOnFileA +@ stdcall SHCreateStreamOnFileEx(wstr long long long ptr ptr) shlwapi.SHCreateStreamOnFileEx +@ stdcall SHCreateStreamOnFileW(wstr long ptr) shlwapi.SHCreateStreamOnFileW +@ stdcall SHCreateThread(ptr ptr long ptr) shlwapi.SHCreateThread +@ stdcall SHCreateThreadRef(ptr ptr) shlwapi.SHCreateThreadRef +@ stub SHCreateThreadWithHandle +@ stdcall SHDeleteEmptyKeyA(long ptr) shlwapi.SHDeleteEmptyKeyA +@ stdcall SHDeleteEmptyKeyW(long ptr) shlwapi.SHDeleteEmptyKeyW +@ stdcall SHDeleteKeyA(long str) shlwapi.SHDeleteKeyA +@ stdcall SHDeleteKeyW(long wstr) shlwapi.SHDeleteKeyW +@ stdcall SHDeleteValueA(long str str) shlwapi.SHDeleteValueA +@ stdcall SHDeleteValueW(long wstr wstr) shlwapi.SHDeleteValueW +@ stdcall SHEnumKeyExA(long long str ptr) shlwapi.SHEnumKeyExA +@ stdcall SHEnumKeyExW(long long wstr ptr) shlwapi.SHEnumKeyExW +@ stdcall SHEnumValueA(long long str ptr ptr ptr ptr) shlwapi.SHEnumValueA +@ stdcall SHEnumValueW(long long wstr ptr ptr ptr ptr) shlwapi.SHEnumValueW +@ stdcall SHGetThreadRef(ptr) shlwapi.SHGetThreadRef +@ stdcall SHGetValueA( long str str ptr ptr ptr ) shlwapi.SHGetValueA +@ stdcall SHGetValueW( long wstr wstr ptr ptr ptr ) shlwapi.SHGetValueW +@ stdcall SHOpenRegStream2A(long str str long) shlwapi.SHOpenRegStream2A +@ stdcall SHOpenRegStream2W(long wstr wstr long) shlwapi.SHOpenRegStream2W +@ stdcall SHOpenRegStreamA(long str str long) shlwapi.SHOpenRegStreamA +@ stdcall SHOpenRegStreamW(long wstr wstr long) shlwapi.SHOpenRegStreamW +@ stdcall SHQueryInfoKeyA(long ptr ptr ptr ptr) shlwapi.SHQueryInfoKeyA +@ stdcall SHQueryInfoKeyW(long ptr ptr ptr ptr) shlwapi.SHQueryInfoKeyW +@ stdcall SHQueryValueExA(long str ptr ptr ptr ptr) shlwapi.SHQueryValueExA +@ stdcall SHQueryValueExW(long wstr ptr ptr ptr ptr) shlwapi.SHQueryValueExW +@ stdcall SHRegDuplicateHKey(long) shlwapi.SHRegDuplicateHKey +@ stdcall SHRegGetIntW(ptr wstr long) shlwapi.SHRegGetIntW +@ stdcall SHRegGetPathA(long str str ptr long) shlwapi.SHRegGetPathA +@ stdcall SHRegGetPathW(long wstr wstr ptr long) shlwapi.SHRegGetPathW +@ stdcall SHRegGetValueA( long str str long ptr ptr ptr ) shlwapi.SHRegGetValueA +@ stub SHRegGetValueFromHKCUHKLM +@ stdcall SHRegGetValueW( long wstr wstr long ptr ptr ptr ) shlwapi.SHRegGetValueW +@ stdcall SHRegSetPathA(long str str str long) shlwapi.SHRegSetPathA +@ stdcall SHRegSetPathW(long wstr wstr wstr long) shlwapi.SHRegSetPathW +@ stdcall SHReleaseThreadRef() shlwapi.SHReleaseThreadRef +@ stdcall SHSetThreadRef(ptr) shlwapi.SHSetThreadRef +@ stdcall SHSetValueA(long str str long ptr long) shlwapi.SHSetValueA +@ stdcall SHSetValueW(long wstr wstr long ptr long) shlwapi.SHSetValueW +@ stdcall SHStrDupA(str ptr) shlwapi.SHStrDupA +@ stdcall SHStrDupW(wstr ptr) shlwapi.SHStrDupW +@ stdcall SHUnicodeToAnsi(wstr ptr ptr) shlwapi.SHUnicodeToAnsi +@ stdcall SHUnicodeToUnicode(wstr ptr long) shlwapi.SHUnicodeToUnicode +@ stdcall SetCurrentProcessExplicitAppUserModelID(wstr) shell32.SetCurrentProcessExplicitAppUserModelID +@ stub SetProcessDpiAwareness +@ stub SetProcessReference +@ stub UnregisterScaleChangeEvent diff --git a/tools/make_specfiles b/tools/make_specfiles index 1833cb6d1b..417cf50ac3 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles @@ -322,9 +322,14 @@ my @dll_groups = "api-ms-win-core-shlwapi-legacy-l1-1-0", "api-ms-win-core-shlwapi-obsolete-l1-1-0", "api-ms-win-core-shlwapi-obsolete-l1-2-0", - "api-ms-win-shcore-scaling-l1-1-1", "api-ms-win-core-url-l1-1-0", ], + [ + "shell32", + "shlwapi", + "shcore", + "api-ms-win-shcore-scaling-l1-1-1", + ], [ "user32", "api-ms-win-core-stringansi-l1-1-0",
From: Sebastian Lackner sebastian@fds-team.de
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- Patch adapted from Wine Staging.
Fixes https://bugs.winehq.org/show_bug.cgi?id=44035
.../api-ms-win-shcore-scaling-l1-1-1.spec | 2 +- dlls/shcore/Makefile.in | 1 + dlls/shcore/main.c | 16 ++++++++++++++++ dlls/shcore/shcore.spec | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec b/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec index 2c4ab9e27c..81b76eb45d 100644 --- a/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec +++ b/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec @@ -1,4 +1,4 @@ -@ stub GetDpiForMonitor +@ stdcall GetDpiForMonitor(long long ptr ptr) shcore.GetDpiForMonitor @ stub GetProcessDpiAwareness @ stub GetScaleFactorForDevice @ stub GetScaleFactorForMonitor diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in index ec2e95f526..0b172fc9a1 100644 --- a/dlls/shcore/Makefile.in +++ b/dlls/shcore/Makefile.in @@ -1,4 +1,5 @@ MODULE = shcore.dll +IMPORTS = gdi32 user32
C_SRCS = \ main.c diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c index 9075a38e1b..9073bd1238 100644 --- a/dlls/shcore/main.c +++ b/dlls/shcore/main.c @@ -21,6 +21,8 @@
#include "windef.h" #include "winbase.h" +#include "wingdi.h" +#include "winuser.h" #include "shellscalingapi.h" #include "wine/debug.h"
@@ -48,3 +50,17 @@ HRESULT WINAPI GetProcessDpiAwareness(HANDLE process, PROCESS_DPI_AWARENESS *val if (value) *value = PROCESS_DPI_UNAWARE; return S_OK; } + +HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y) +{ + HDC hDC; + + FIXME("(%p, %u, %p, %p): semi-stub\n", monitor, type, x, y); + + hDC = GetDC(0); + if (x) *x = GetDeviceCaps(hDC, LOGPIXELSX); + if (y) *y = GetDeviceCaps(hDC, LOGPIXELSY); + ReleaseDC(0, hDC); + + return S_OK; +} diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec index ae647a5598..2970fc00c5 100644 --- a/dlls/shcore/shcore.spec +++ b/dlls/shcore/shcore.spec @@ -6,7 +6,7 @@ @ stub DllGetActivationFactory @ stdcall -private DllGetClassObject(ptr ptr ptr) shell32.DllGetClassObject @ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID -@ stub GetDpiForMonitor +@ stdcall GetDpiForMonitor(long long ptr ptr) @ stub GetDpiForShellUIComponent @ stdcall GetProcessDpiAwareness(long ptr) @ stub GetProcessReference
From: Sebastian Lackner sebastian@fds-team.de
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- Patch adapted from Wine Staging. Fixes the next Xenia crash.
.../api-ms-win-shcore-scaling-l1-1-1.spec | 2 +- dlls/shcore/main.c | 6 ++++++ dlls/shcore/shcore.spec | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec b/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec index 81b76eb45d..93e0586f5e 100644 --- a/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec +++ b/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec @@ -5,5 +5,5 @@ @ stub RegisterScaleChangeEvent @ stub RegisterScaleChangeNotifications @ stub RevokeScaleChangeNotifications -@ stub SetProcessDpiAwareness +@ stdcall SetProcessDpiAwareness(long) shcore.SetProcessDpiAwareness @ stub UnregisterScaleChangeEvent diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c index 9073bd1238..739e3ff119 100644 --- a/dlls/shcore/main.c +++ b/dlls/shcore/main.c @@ -51,6 +51,12 @@ HRESULT WINAPI GetProcessDpiAwareness(HANDLE process, PROCESS_DPI_AWARENESS *val return S_OK; }
+HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value) +{ + FIXME("(%u): stub\n", value); + return E_NOTIMPL; +} + HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y) { HDC hDC; diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec index 2970fc00c5..34f989f951 100644 --- a/dlls/shcore/shcore.spec +++ b/dlls/shcore/shcore.spec @@ -78,6 +78,6 @@ @ stdcall SHUnicodeToAnsi(wstr ptr ptr) shlwapi.SHUnicodeToAnsi @ stdcall SHUnicodeToUnicode(wstr ptr long) shlwapi.SHUnicodeToUnicode @ stdcall SetCurrentProcessExplicitAppUserModelID(wstr) shell32.SetCurrentProcessExplicitAppUserModelID -@ stub SetProcessDpiAwareness +@ stdcall SetProcessDpiAwareness(long) @ stub SetProcessReference @ stub UnregisterScaleChangeEvent
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- Fixes https://bugs.winehq.org/show_bug.cgi?id=42255
dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/rtl.c | 11 +++++++++++ include/winnt.h | 14 +++++++------- 3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 035fad2058..e385490284 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -425,6 +425,7 @@ @ stdcall RtlAddAuditAccessAceEx(ptr long long long ptr long long) @ stdcall RtlAddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long) # @ stub RtlAddCompoundAce +@ stdcall RtlAddGrowableFunctionTable(ptr ptr long long ptr ptr) @ stdcall RtlAddMandatoryAce(ptr long long long long ptr) # @ stub RtlAddRange @ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 09a9c921bb..3fe7c705a3 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -1672,3 +1672,14 @@ RTL_UNLOAD_EVENT_TRACE * WINAPI RtlGetUnloadEventTrace(void) FIXME("stub!\n"); return NULL; } + +/********************************************************************* + * RtlAddGrowableFunctionTable [NTDLL.@] + */ +NTSTATUS WINAPI RtlAddGrowableFunctionTable(void *dynamic_table, RUNTIME_FUNCTION *function_table, DWORD entry_count, + DWORD max_entry_count, ULONG *range_base, ULONG *range_end) +{ + FIXME("(%p %p %u %u %p %p): stub\n", + dynamic_table, function_table, entry_count, max_entry_count, range_base, range_end); + return STATUS_NOT_IMPLEMENTED; +} diff --git a/include/winnt.h b/include/winnt.h index a9d718a773..eac496c836 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -997,6 +997,13 @@ typedef struct _LDT_ENTRY { } HighWord; } LDT_ENTRY, *PLDT_ENTRY;
+typedef struct _RUNTIME_FUNCTION +{ + DWORD BeginAddress; + DWORD EndAddress; + DWORD UnwindData; +} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; + /* x86-64 context definitions */ #if defined(__x86_64__)
@@ -1125,13 +1132,6 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { DWORD64 LastExceptionFromRip; /* 4c8 */ } CONTEXT;
-typedef struct _RUNTIME_FUNCTION -{ - DWORD BeginAddress; - DWORD EndAddress; - DWORD UnwindData; -} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; - #define UNWIND_HISTORY_TABLE_SIZE 12
typedef struct _UNWIND_HISTORY_TABLE_ENTRY
Alex Henrie alexhenrie24@gmail.com writes:
diff --git a/include/winnt.h b/include/winnt.h index a9d718a773..eac496c836 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -997,6 +997,13 @@ typedef struct _LDT_ENTRY { } HighWord; } LDT_ENTRY, *PLDT_ENTRY;
+typedef struct _RUNTIME_FUNCTION +{
- DWORD BeginAddress;
- DWORD EndAddress;
- DWORD UnwindData;
+} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
/* x86-64 context definitions */ #if defined(__x86_64__)
@@ -1125,13 +1132,6 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { DWORD64 LastExceptionFromRip; /* 4c8 */ } CONTEXT;
-typedef struct _RUNTIME_FUNCTION -{
- DWORD BeginAddress;
- DWORD EndAddress;
- DWORD UnwindData;
-} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
This is wrong and will most likely break the build on ARM platforms. Function tables are not used on i386.