zero DEVMODE and setting the correct size before calling ChangeDisplaySettings

svn path=/trunk/; revision=31041
This commit is contained in:
Christoph von Wittich 2007-12-06 14:46:56 +00:00
parent 3e7681fbee
commit c73bd8cb3f

View file

@ -41,7 +41,6 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
{ {
DevMode.dmSize = sizeof(DEVMODE); DevMode.dmSize = sizeof(DEVMODE);
DevMode.dmDriverExtra = 0;
while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE) while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE)
{ {
@ -139,7 +138,8 @@ Main_DirectDraw_SetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, DWORD dwWidth, DWO
LONG retval; LONG retval;
// Here we go // Here we go
DEVMODE DevMode; DEVMODE DevMode;
DevMode.dmFields = 0; ZeroMemory(&DevMode, sizeof(DEVMODE));
DevMode.dmSize = sizeof(DEVMODE);
if (dwHeight) if (dwHeight)
DevMode.dmFields |= DM_PELSHEIGHT; DevMode.dmFields |= DM_PELSHEIGHT;