Skip to content

Loading…

[win32] fix size of DEVMODE struct. Fixes broken resolution switching #4379

Merged
merged 1 commit into from

1 participant

@jmarshallnz
Team Kodi member

No description provided.

@jmarshallnz
Team Kodi member

jenkins build this please

@jmarshallnz jmarshallnz added this to the Gotham13.0-beta2 milestone
@jmarshallnz jmarshallnz added the Gotham label
@jmarshallnz jmarshallnz merged commit 9025366 into xbmc:master

1 check failed

Details default Merged build #336 failed in 44 min
@jmarshallnz jmarshallnz deleted the jmarshallnz:win32_res_fix branch
@jmarshallnz jmarshallnz removed the Gotham label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 8, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −6 xbmc/windowing/windows/WinSystemWin32.cpp
View
12 xbmc/windowing/windows/WinSystemWin32.cpp
@@ -358,8 +358,8 @@ RECT CWinSystemWin32::ScreenRect(int screen)
const MONITOR_DETAILS &details = GetMonitor(screen);
DEVMODEW sDevMode;
- ZeroMemory(&sDevMode, sizeof(DEVMODE));
- sDevMode.dmSize = sizeof(DEVMODE);
+ ZeroMemory(&sDevMode, sizeof(sDevMode));
+ sDevMode.dmSize = sizeof(sDevMode);
if(!EnumDisplaySettingsW(details.DeviceNameW.c_str(), ENUM_CURRENT_SETTINGS, &sDevMode))
CLog::Log(LOGERROR, "%s : EnumDisplaySettings failed with %d", __FUNCTION__, GetLastError());
@@ -445,8 +445,8 @@ bool CWinSystemWin32::ChangeResolution(RESOLUTION_INFO res)
const MONITOR_DETAILS &details = GetMonitor(res.iScreen);
DEVMODEW sDevMode;
- ZeroMemory(&sDevMode, sizeof(DEVMODE));
- sDevMode.dmSize = sizeof(DEVMODE);
+ ZeroMemory(&sDevMode, sizeof(sDevMode));
+ sDevMode.dmSize = sizeof(sDevMode);
// If we can't read the current resolution or any detail of the resolution is different than res
if (!EnumDisplaySettingsW(details.DeviceNameW.c_str(), ENUM_CURRENT_SETTINGS, &sDevMode) ||
@@ -455,8 +455,8 @@ bool CWinSystemWin32::ChangeResolution(RESOLUTION_INFO res)
((sDevMode.dmDisplayFlags & DM_INTERLACED) && !(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) ||
(!(sDevMode.dmDisplayFlags & DM_INTERLACED) && (res.dwFlags & D3DPRESENTFLAG_INTERLACED)) )
{
- ZeroMemory(&sDevMode, sizeof(DEVMODE));
- sDevMode.dmSize = sizeof(DEVMODE);
+ ZeroMemory(&sDevMode, sizeof(sDevMode));
+ sDevMode.dmSize = sizeof(sDevMode);
sDevMode.dmDriverExtra = 0;
sDevMode.dmPelsWidth = res.iWidth;
sDevMode.dmPelsHeight = res.iHeight;
Something went wrong with that request. Please try again.