Correct bug do not enum other color deep that 8,16,24,32 it will create
memmory leek other wise.
in the current code.
Modified: trunk/reactos/lib/cpl/desk/settings.c
_____
Modified: trunk/reactos/lib/cpl/desk/settings.c
--- trunk/reactos/lib/cpl/desk/settings.c 2005-05-25 04:16:56 UTC
(rev 15492)
+++ trunk/reactos/lib/cpl/desk/settings.c 2005-05-25 09:14:29 UTC
(rev 15493)
@@ -88,7 +88,7 @@
PSETTINGS_ENTRY Settings = NULL;
HDC hDC;
PSETTINGS_ENTRY Current;
- DWORD bpp, xres, yres;
+ DWORD bpp, xres, yres, checkbpp;
/* Get current settings */
*CurrentSettings = NULL;
@@ -105,13 +105,16 @@
while (EnumDisplaySettingsEx(DeviceName, iMode, &devmode,
dwFlags))
{
+ if (devmode.dmBitsPerPel==8 || devmode.dmBitsPerPel==16
|| devmode.dmBitsPerPel==24 || devmode.dmBitsPerPel==32) checkbpp=1;
+ else checkbpp=0;
+
if (devmode.dmPelsWidth < 640 ||
- devmode.dmPelsHeight < 480)
+ devmode.dmPelsHeight < 480 || checkbpp == 0)
{
iMode++;
continue;
}
-
+
Current = HeapAlloc(GetProcessHeap(), 0,
sizeof(SETTINGS_ENTRY));
if (Current != NULL)
{
Show replies by date