Re: [AD] windows port crashes due to (wrong?) asserts |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Mon, 2010-04-26 at 18:03 +0200, Milan Mimica wrote:
> Elias Pschernig wrote:
> > I have reports of my windows A5 .exe failing with this:
> >
> > "Assertion failed: dm.dmFields & 0x00100000, file
> > /home/elias/prog/allegro/git/src/win/wgl_disp.c, line 1620"
> >
> > The relevant lines are:
> >
> > 1620 ASSERT(dm.dmFields & DM_PELSHEIGHT);
> > 1621 ASSERT(dm.dmFields & DM_PELSWIDTH);
> > 1622 ASSERT(dm.dmFields & DM_POSITION);
> >
> > Why are those asserts? Seems perfectly valid to me if Windows doesn't
> > like reporting all of them each time...
>
> From MSDN (http://msdn.microsoft.com/en-us/library/dd162611%28VS.85%29.aspx):
> The EnumDisplaySettings function sets values for the following five DEVMODE members:
>
> * dmBitsPerPel
> * dmPelsWidth
> * dmPelsHeight
> * dmDisplayFlags
> * dmDisplayFrequency
>
> We can assume position is (0, 0), if not reported.
> So what we do set the return value to in case EnumDisplaySettings() refuses to
> colaborate? Is that happening in Wine by any chance? Oh, maybe the function
> failed, we don't check the return value.
>
No, Windows 7.
If it fails could always call GetSystemMetrics instead I guess.
--
Elias Pschernig <elias.pschernig@xxxxxxxxxx>