[STORAHCI] Merge Storport Miniport driver by Aman Priyadarshi in GSoC.
[reactos.git] / reactos / dll / appcompat / shims / layer / dispmode.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Shim library
4 * FILE: dll/appcompat/shims/layer/dispmode.c
5 * PURPOSE: Display settings related shims
6 * PROGRAMMER: Mark Jansen
7 */
8
9 #include <windows.h>
10 #include <shimlib.h>
11 #include <strsafe.h>
12
13
14 #define SHIM_NS Force8BitColor
15 #include <setup_shim.inl>
16
17 #define SHIM_NUM_HOOKS 0
18 #define SHIM_NOTIFY_FN SHIM_OBJ_NAME(Notify)
19
20 BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason, PVOID ptr)
21 {
22 if (fdwReason == SHIM_REASON_INIT)
23 {
24 DEVMODEA dm = { { 0 } };
25 dm.dmSize = sizeof(dm);
26 if (EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dm) &&
27 dm.dmBitsPerPel != 8)
28 {
29 dm.dmBitsPerPel = 8;
30 dm.dmFields |= DM_BITSPERPEL;
31 ChangeDisplaySettingsA(&dm, CDS_FULLSCREEN);
32 }
33 }
34 return TRUE;
35 }
36
37 #include <implement_shim.inl>
38
39
40
41 #define SHIM_NS Force640x480
42 #include <setup_shim.inl>
43
44 #define SHIM_NUM_HOOKS 0
45 #define SHIM_NOTIFY_FN SHIM_OBJ_NAME(Notify)
46
47 BOOL WINAPI SHIM_OBJ_NAME(Notify)(DWORD fdwReason, PVOID ptr)
48 {
49 if (fdwReason == SHIM_REASON_INIT)
50 {
51 DEVMODEA dm = { { 0 } };
52 dm.dmSize = sizeof(dm);
53 if (EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dm) &&
54 (dm.dmPelsWidth != 640 || dm.dmPelsHeight != 480))
55 {
56 dm.dmPelsWidth = 640;
57 dm.dmPelsHeight = 480;
58 dm.dmFields |= (DM_PELSWIDTH | DM_PELSHEIGHT);
59 ChangeDisplaySettingsA(&dm, CDS_FULLSCREEN);
60 }
61 }
62 return TRUE;
63 }
64
65 #include <implement_shim.inl>
66
67