Author: khornicek
Date: Sat Nov 15 07:54:17 2008
New Revision: 37373
URL:
http://svn.reactos.org/svn/reactos?rev=37373&view=rev
Log:
use the dmSize we got from caller and fall back to SIZEOF_DEVMODEA_300 in case we got some
unexpected value as it's done in Windows
Modified:
trunk/reactos/dll/win32/user32/misc/display.c
Modified: trunk/reactos/dll/win32/user32/misc/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/disp…
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/display.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/misc/display.c [iso-8859-1] Sat Nov 15 07:54:17 2008
@@ -242,17 +242,14 @@
COPYS(dmDeviceName, CCHDEVICENAME );
COPYN(dmSpecVersion);
COPYN(dmDriverVersion);
- switch (DevModeW.dmSize)
- {
- case SIZEOF_DEVMODEW_300:
+ switch (lpDevMode->dmSize)
+ {
+ case SIZEOF_DEVMODEA_300:
+ case SIZEOF_DEVMODEA_400:
+ case SIZEOF_DEVMODEA_500:
+ break;
+ default:
lpDevMode->dmSize = SIZEOF_DEVMODEA_300;
- break;
- case SIZEOF_DEVMODEW_400:
- lpDevMode->dmSize = SIZEOF_DEVMODEA_400;
- break;
- case SIZEOF_DEVMODEW_500:
- default: /* FIXME what to do??? */
- lpDevMode->dmSize = SIZEOF_DEVMODEA_500;
break;
}
COPYN(dmDriverExtra);
@@ -276,7 +273,7 @@
COPYN(dmDisplayFlags); // aka dmNup
COPYN(dmDisplayFrequency);
- if (DevModeW.dmSize <= SIZEOF_DEVMODEW_300)
+ if (lpDevMode->dmSize <= SIZEOF_DEVMODEW_300)
return TRUE; // we're done with 0x300 fields
COPYN(dmICMMethod);
@@ -286,7 +283,7 @@
COPYN(dmReserved1);
COPYN(dmReserved2);
- if (DevModeW.dmSize <= SIZEOF_DEVMODEW_400)
+ if (lpDevMode->dmSize <= SIZEOF_DEVMODEW_400)
return TRUE; // we're done with 0x400 fields
COPYN(dmPanningWidth);