Index: src/video/win32_v.cpp =================================================================== --- src/video/win32_v.cpp (revision 27031) +++ src/video/win32_v.cpp (working copy) @@ -1095,6 +1095,25 @@ { 1920, 1200 } }; +bool Is_Win8_or_Later () +{ + OSVERSIONINFO osvi; + + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + /* MSDN documentation says GetVersionEx may be altered or unavailable for releases + * after Windows 8.1, but for the new functions we need newer SDK or different + * WINVER settings. */ + + GetVersionEx(&osvi); + + return + ( (osvi.dwMajorVersion > 6) || + ( (osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion >= 2) )); + +} + static void FindResolutions() { uint n = 0; @@ -1104,12 +1123,18 @@ #else uint i; DEVMODEA dm; + bool isWin8; + /* MSDN documentation says EnumDisplaySettings on Windows 8 and later returns only 32 bit modes, + * however the system works with other modes too. We need to detect the system version + * and build the list of resolutions different way if the system is Windows 8 or later */ + isWin8 = Is_Win8_or_Later(); + /* XXX - EnumDisplaySettingsW crashes with unicows.dll on Windows95 * Doesn't really matter since we don't pass a string anyways, but still * a letdown */ for (i = 0; EnumDisplaySettingsA(NULL, i, &dm) != 0; i++) { - if (dm.dmBitsPerPel == BlitterFactory::GetCurrentBlitter()->GetScreenDepth() && + if (dm.dmBitsPerPel == (isWin8 ? 32 : BlitterFactory::GetCurrentBlitter()->GetScreenDepth()) && dm.dmPelsWidth >= 640 && dm.dmPelsHeight >= 480) { uint j;