From 1aa8cf05000cfc7f560835dc01ab3afb2f2a2fed Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 21 Jun 2017 15:53:58 +0200 Subject: [PATCH] wineandroid: Add a stub implementation of EnumDisplaySettingsEx. Signed-off-by: Alexandre Julliard --- dlls/wineandroid.drv/init.c | 39 +++++++++++++++++++++++ dlls/wineandroid.drv/wineandroid.drv.spec | 1 + 2 files changed, 40 insertions(+) diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index 75905a483b8..54be12ad1e3 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -268,6 +268,45 @@ BOOL CDECL ANDROID_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC pr } +/*********************************************************************** + * ANDROID_EnumDisplaySettingsEx + */ +BOOL CDECL ANDROID_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DWORD flags) +{ + static const WCHAR dev_name[CCHDEVICENAME] = + { 'W','i','n','e',' ','A','n','d','r','o','i','d',' ','d','r','i','v','e','r',0 }; + + devmode->dmSize = offsetof( DEVMODEW, dmICMMethod ); + devmode->dmSpecVersion = DM_SPECVERSION; + devmode->dmDriverVersion = DM_SPECVERSION; + memcpy( devmode->dmDeviceName, dev_name, sizeof(dev_name) ); + devmode->dmDriverExtra = 0; + devmode->u2.dmDisplayFlags = 0; + devmode->dmDisplayFrequency = 0; + devmode->u1.s2.dmPosition.x = 0; + devmode->u1.s2.dmPosition.y = 0; + devmode->u1.s2.dmDisplayOrientation = 0; + devmode->u1.s2.dmDisplayFixedOutput = 0; + + if (n == ENUM_CURRENT_SETTINGS || n == ENUM_REGISTRY_SETTINGS) n = 0; + if (n == 0) + { + devmode->dmPelsWidth = screen_width; + devmode->dmPelsHeight = screen_height; + devmode->dmBitsPerPel = screen_bpp; + devmode->dmDisplayFrequency = 60; + devmode->dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY; + TRACE( "mode %d -- %dx%d %d bpp @%d Hz\n", n, + devmode->dmPelsWidth, devmode->dmPelsHeight, + devmode->dmBitsPerPel, devmode->dmDisplayFrequency ); + return TRUE; + } + TRACE( "mode %d -- not present\n", n ); + SetLastError( ERROR_NO_MORE_FILES ); + return FALSE; +} + + static const struct gdi_dc_funcs android_drv_funcs = { NULL, /* pAbortDoc */ diff --git a/dlls/wineandroid.drv/wineandroid.drv.spec b/dlls/wineandroid.drv/wineandroid.drv.spec index 8e98baab605..3439ff6c30d 100644 --- a/dlls/wineandroid.drv/wineandroid.drv.spec +++ b/dlls/wineandroid.drv/wineandroid.drv.spec @@ -11,6 +11,7 @@ @ cdecl VkKeyScanEx(long long) ANDROID_VkKeyScanEx @ cdecl ChangeDisplaySettingsEx(ptr ptr long long long) ANDROID_ChangeDisplaySettingsEx @ cdecl EnumDisplayMonitors(long ptr ptr long) ANDROID_EnumDisplayMonitors +@ cdecl EnumDisplaySettingsEx(ptr long ptr long) ANDROID_EnumDisplaySettingsEx @ cdecl GetMonitorInfo(long ptr) ANDROID_GetMonitorInfo @ cdecl CreateWindow(long) ANDROID_CreateWindow @ cdecl DestroyWindow(long) ANDROID_DestroyWindow