From f84cb2913cb755152d98c278f3ed6927167c9b2b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 24 Jan 2016 16:06:47 +0100
Subject: shcore: Add SetProcessDpiAwareness stub.

---
 dlls/shcore/Makefile.in   |  3 +++
 dlls/shcore/main.c        | 49 +++++++++++++++++++++++++++++++++++++++++++++++
 dlls/shcore/shcore.spec   |  2 +-
 include/Makefile.in       |  1 +
 include/shellscalingapi.h | 29 ++++++++++++++++++++++++++++
 5 files changed, 83 insertions(+), 1 deletion(-)
 create mode 100644 dlls/shcore/main.c
 create mode 100644 include/shellscalingapi.h

diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in
index dd5f08f..ec2e95f 100644
--- a/dlls/shcore/Makefile.in
+++ b/dlls/shcore/Makefile.in
@@ -1 +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 0000000..0e59d38
--- /dev/null
+++ b/dlls/shcore/main.c
@@ -0,0 +1,49 @@
+/*
+ * 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 SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value)
+{
+    FIXME("(%u): stub\n", value);
+    return E_NOTIMPL;
+}
diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec
index 12a4ef3..1624319 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
diff --git a/include/Makefile.in b/include/Makefile.in
index 199de7a..c907afe4 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -570,6 +570,7 @@ HEADER_SRCS = \
 	sfc.h \
 	shdispid.h \
 	shellapi.h \
+	shellscalingapi.h \
 	shlguid.h \
 	shlobj.h \
 	shlwapi.h \
diff --git a/include/shellscalingapi.h b/include/shellscalingapi.h
new file mode 100644
index 0000000..6d7a167
--- /dev/null
+++ b/include/shellscalingapi.h
@@ -0,0 +1,29 @@
+/*
+ * 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
+ */
+
+#ifndef __WINE_SHELLSCALINGAPI_H
+#define __WINE_SHELLSCALINGAPI_H
+
+typedef enum PROCESS_DPI_AWARENESS
+{
+    PROCESS_DPI_UNAWARE                 = 0,
+    PROCESS_SYSTEM_DPI_AWARE            = 1,
+    PROCESS_PER_MONITOR_DPI_AWARE       = 2,
+} PROCESS_DPI_AWARENESS;
+
+#endif /* __WINE_SHELLSCALINGAPI_H */
-- 
2.6.4

