Commit 0e5b847f authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

explorer: Use debugstr_devmodew helper to trace display mode.

parent 8073c6be
......@@ -918,29 +918,45 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid )
return module;
}
static const char *debugstr_devmodew( const DEVMODEW *devmode )
{
char position[32] = {0};
if (devmode->dmFields & DM_POSITION)
{
snprintf( position, sizeof(position), " at (%d,%d)",
(int)devmode->dmPosition.x, (int)devmode->dmPosition.y );
}
return wine_dbg_sprintf( "%ux%u %ubits %uHz rotated %u degrees%s",
(unsigned int)devmode->dmPelsWidth,
(unsigned int)devmode->dmPelsHeight,
(unsigned int)devmode->dmBitsPerPel,
(unsigned int)devmode->dmDisplayFrequency,
(unsigned int)devmode->dmDisplayOrientation * 90,
position );
}
static void initialize_display_settings(void)
{
DISPLAY_DEVICEW ddW;
DEVMODEW dmW;
DWORD i = 0;
/* Store current display mode in the registry */
ddW.cb = sizeof(ddW);
memset(&dmW, 0, sizeof(dmW));
dmW.dmSize = sizeof(dmW);
while (EnumDisplayDevicesW( NULL, i++, &ddW, 0 ))
{
if (!EnumDisplaySettingsExW( ddW.DeviceName, ENUM_CURRENT_SETTINGS, &dmW, 0))
DEVMODEW devmode = {.dmSize = sizeof(DEVMODEW)};
if (!EnumDisplaySettingsExW( ddW.DeviceName, ENUM_CURRENT_SETTINGS, &devmode, 0))
{
ERR( "Failed to query current display settings for %s.\n", debugstr_w(ddW.DeviceName) );
continue;
}
TRACE( "Device %s current display mode %lux%lu %luBits %luHz at %ld,%ld.\n",
debugstr_w( ddW.DeviceName ), dmW.dmPelsWidth, dmW.dmPelsHeight,
dmW.dmBitsPerPel, dmW.dmDisplayFrequency, dmW.dmPosition.x, dmW.dmPosition.y );
TRACE( "Device %s current display mode %s.\n", debugstr_w( ddW.DeviceName ), debugstr_devmodew( &devmode ) );
if (ChangeDisplaySettingsExW( ddW.DeviceName, &dmW, 0,
if (ChangeDisplaySettingsExW( ddW.DeviceName, &devmode, 0,
CDS_GLOBAL | CDS_NORESET | CDS_UPDATEREGISTRY, 0 ))
ERR( "Failed to initialize registry display settings for %s.\n", debugstr_w(ddW.DeviceName) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment