From 0effbe0e3eeb84626ec6b64848fe6cfb1279dc02 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 26 Jan 2016 15:39:10 +0100
Subject: shcore: Implement stub for GetDpiForMonitor.

---
 dlls/shcore/Makefile.in   |  1 +
 dlls/shcore/main.c        | 16 ++++++++++++++++
 dlls/shcore/shcore.spec   |  2 +-
 include/shellscalingapi.h |  8 ++++++++
 4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in
index ec2e95f..0b172fc 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 0e59d38..ce0d9ed 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"
 
@@ -47,3 +49,17 @@ 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;
+
+    TRACE("(%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 1624319..4d6e845 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
 @ stub GetProcessDpiAwareness
 @ stub GetProcessReference
diff --git a/include/shellscalingapi.h b/include/shellscalingapi.h
index 6d7a167..56ae94a 100644
--- a/include/shellscalingapi.h
+++ b/include/shellscalingapi.h
@@ -26,4 +26,12 @@ typedef enum PROCESS_DPI_AWARENESS
     PROCESS_PER_MONITOR_DPI_AWARE       = 2,
 } PROCESS_DPI_AWARENESS;
 
+typedef enum MONITOR_DPI_TYPE
+{
+    MDT_EFFECTIVE_DPI   = 0,
+    MDT_ANGULAR_DPI     = 1,
+    MDT_RAW_DPI         = 2,
+    MDT_DEFAULT         = MDT_EFFECTIVE_DPI,
+} MONITOR_DPI_TYPE;
+
 #endif /* __WINE_SHELLSCALINGAPI_H */
-- 
2.6.4

