mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
Correct bug do not enum other color deep that 8,16,24,32 it will create memmory leek other wise.
in the current code. svn path=/trunk/; revision=15493
This commit is contained in:
parent
b09db8ab65
commit
332a72f9b8
1 changed files with 6 additions and 3 deletions
|
@ -88,7 +88,7 @@ GetPossibleSettings(IN LPTSTR DeviceName, OUT DWORD* pSettingsCount, OUT PSETTIN
|
||||||
PSETTINGS_ENTRY Settings = NULL;
|
PSETTINGS_ENTRY Settings = NULL;
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
PSETTINGS_ENTRY Current;
|
PSETTINGS_ENTRY Current;
|
||||||
DWORD bpp, xres, yres;
|
DWORD bpp, xres, yres, checkbpp;
|
||||||
|
|
||||||
/* Get current settings */
|
/* Get current settings */
|
||||||
*CurrentSettings = NULL;
|
*CurrentSettings = NULL;
|
||||||
|
@ -105,8 +105,11 @@ GetPossibleSettings(IN LPTSTR DeviceName, OUT DWORD* pSettingsCount, OUT PSETTIN
|
||||||
while (EnumDisplaySettingsEx(DeviceName, iMode, &devmode, dwFlags))
|
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 ||
|
if (devmode.dmPelsWidth < 640 ||
|
||||||
devmode.dmPelsHeight < 480)
|
devmode.dmPelsHeight < 480 || checkbpp == 0)
|
||||||
{
|
{
|
||||||
iMode++;
|
iMode++;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue