use the dmSize we got from caller and fall back to SIZEOF_DEVMODEA_300 in case we...
authorKamil Hornicek <kamil.hornicek@reactos.org>
Sat, 15 Nov 2008 13:54:17 +0000 (13:54 +0000)
committerKamil Hornicek <kamil.hornicek@reactos.org>
Sat, 15 Nov 2008 13:54:17 +0000 (13:54 +0000)
svn path=/trunk/; revision=37373

reactos/dll/win32/user32/misc/display.c

index ec2e398..23add5a 100644 (file)
@@ -242,18 +242,15 @@ EnumDisplaySettingsExA(
     COPYS(dmDeviceName, CCHDEVICENAME );
     COPYN(dmSpecVersion);
     COPYN(dmDriverVersion);
-    switch (DevModeW.dmSize)
+    switch (lpDevMode->dmSize)
     {
-        case SIZEOF_DEVMODEW_300:
+        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);
     COPYN(dmFields);
@@ -276,7 +273,7 @@ EnumDisplaySettingsExA(
     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 @@ EnumDisplaySettingsExA(
     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);