Author: mjansen
Date: Fri Dec 16 21:54:06 2016
New Revision: 73462
URL:
http://svn.reactos.org/svn/reactos?rev=73462&view=rev
Log:
[ACLAYERS] Implement Force8BitColor and Force640x480 shims. CORE-11927
Added:
trunk/reactos/dll/appcompat/shims/layer/dispmode.c (with props)
Modified:
trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt
Modified: trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/…
==============================================================================
--- trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt [iso-8859-1] Fri Dec 16
21:54:06 2016
@@ -4,6 +4,7 @@
spec2def(aclayers.dll layer.spec)
list(APPEND SOURCE
+ dispmode.c
versionlie.c
main.c
layer.spec)
@@ -14,5 +15,5 @@
set_module_type(aclayers win32dll)
target_link_libraries(aclayers shimlib)
-add_importlibs(aclayers msvcrt kernel32 ntdll)
+add_importlibs(aclayers user32 msvcrt kernel32 ntdll)
add_cd_file(TARGET aclayers DESTINATION reactos/AppPatch FOR all)
Added: trunk/reactos/dll/appcompat/shims/layer/dispmode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/…
==============================================================================
--- trunk/reactos/dll/appcompat/shims/layer/dispmode.c (added)
+++ trunk/reactos/dll/appcompat/shims/layer/dispmode.c [iso-8859-1] Fri Dec 16 21:54:06
2016
@@ -0,0 +1,67 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Shim library
+ * FILE: dll/appcompat/shims/layer/dispmode.c
+ * PURPOSE: Display settings related shims
+ * PROGRAMMER: Mark Jansen
+ */
+
+#include <windows.h>
+#include <shimlib.h>
+#include <strsafe.h>
+
+
+#define SHIM_NS Force8BitColor
+#include <setup_shim.inl>
+
+#define SHIM_NUM_HOOKS 0
+#define SHIM_NOTIFY_FN SHIM_OBJ_NAME(Notify)
+
+BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason, PVOID ptr)
+{
+ if (fdwReason == SHIM_REASON_INIT)
+ {
+ DEVMODEA dm = { { 0 } };
+ dm.dmSize = sizeof(dm);
+ if (EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dm) &&
+ dm.dmBitsPerPel != 8)
+ {
+ dm.dmBitsPerPel = 8;
+ dm.dmFields |= DM_BITSPERPEL;
+ ChangeDisplaySettingsA(&dm, CDS_FULLSCREEN);
+ }
+ }
+ return TRUE;
+}
+
+#include <implement_shim.inl>
+
+
+
+#define SHIM_NS Force640x480
+#include <setup_shim.inl>
+
+#define SHIM_NUM_HOOKS 0
+#define SHIM_NOTIFY_FN SHIM_OBJ_NAME(Notify)
+
+BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason, PVOID ptr)
+{
+ if (fdwReason == SHIM_REASON_INIT)
+ {
+ DEVMODEA dm = { { 0 } };
+ dm.dmSize = sizeof(dm);
+ if (EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dm) &&
+ (dm.dmPelsWidth != 640 || dm.dmPelsHeight != 480))
+ {
+ dm.dmPelsWidth = 640;
+ dm.dmPelsHeight = 480;
+ dm.dmFields |= (DM_PELSWIDTH | DM_PELSHEIGHT);
+ ChangeDisplaySettingsA(&dm, CDS_FULLSCREEN);
+ }
+ }
+ return TRUE;
+}
+
+#include <implement_shim.inl>
+
+
Propchange: trunk/reactos/dll/appcompat/shims/layer/dispmode.c
------------------------------------------------------------------------------
svn:eol-style = native