Sebastian Lackner : shcore: Implement semi-stub for GetDpiForMonitor.
Alexandre Julliard
julliard at winehq.org
Wed Jan 24 16:02:32 CST 2018
Module: wine
Branch: master
Commit: 4a4bf34f069f9464a3644c0d83875eecd0d300b9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4a4bf34f069f9464a3644c0d83875eecd0d300b9
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Wed Jan 24 01:19:04 2018 -0700
shcore: Implement semi-stub for GetDpiForMonitor.
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
.../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 acf194a..44c0e93 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
@ stdcall GetProcessDpiAwareness(long ptr) shcore.GetProcessDpiAwareness
@ stub GetScaleFactorForDevice
@ stub GetScaleFactorForMonitor
diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in
index ec2e95f..8497198 100644
--- a/dlls/shcore/Makefile.in
+++ b/dlls/shcore/Makefile.in
@@ -1,4 +1,5 @@
MODULE = shcore.dll
+IMPORTS = user32 gdi32
C_SRCS = \
main.c
diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c
index 9075a38..9073bd1 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 374fafb..958c91f 100644
--- a/dlls/shcore/shcore.spec
+++ b/dlls/shcore/shcore.spec
@@ -7,7 +7,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
More information about the wine-cvs
mailing list