mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
BugFix : Main_DirectDraw_EnumDisplayModes and Main_DirectDraw_EnumDisplayModes4
it did never entry the callbacks loops it was wrong logic check in the begin of the function. This change are base on Kamil Hornicek tykef at atlas dot cz (irc nick : Pigglesworth) patch and once again Thank you Kamil Hornicek tykef at atlas dot cz (irc nick : Pigglesworth) to notice it. and provide a partly fix for it. svn path=/trunk/; revision=31100
This commit is contained in:
parent
b22185298e
commit
9626ca08f9
1 changed files with 20 additions and 12 deletions
|
@ -29,15 +29,19 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
_SEH_TRY
|
||||
{
|
||||
|
||||
if
|
||||
((!IsBadReadPtr(pCallback,sizeof(LPDDENUMMODESCALLBACK))) ||
|
||||
(!IsBadWritePtr(pCallback,sizeof(LPDDENUMMODESCALLBACK))) ||
|
||||
(!IsBadReadPtr(pDDSD,sizeof(DDSURFACEDESC))) ||
|
||||
(!IsBadWritePtr(pDDSD,sizeof(DDSURFACEDESC))))
|
||||
if (pDDSD != NULL)
|
||||
{
|
||||
if (pDDSD->dwSize != sizeof(DDSURFACEDESC))
|
||||
{
|
||||
ret = DDERR_INVALIDPARAMS;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsBadCodePtr(pCallback))
|
||||
{
|
||||
ret = DDERR_INVALIDPARAMS;
|
||||
}
|
||||
else
|
||||
else if ( ret == DD_OK)
|
||||
{
|
||||
|
||||
DevMode.dmSize = sizeof(DEVMODE);
|
||||
|
@ -123,15 +127,19 @@ Main_DirectDraw_EnumDisplayModes4(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
_SEH_TRY
|
||||
{
|
||||
|
||||
if
|
||||
((!IsBadReadPtr(pCallback,sizeof(LPDDENUMMODESCALLBACK2))) ||
|
||||
(!IsBadWritePtr(pCallback,sizeof(LPDDENUMMODESCALLBACK2))) ||
|
||||
(!IsBadReadPtr(pDDSD,sizeof(DDSURFACEDESC2))) ||
|
||||
(!IsBadWritePtr(pDDSD,sizeof(DDSURFACEDESC2))))
|
||||
if (pDDSD != NULL)
|
||||
{
|
||||
if (pDDSD->dwSize != sizeof(DDSURFACEDESC2))
|
||||
{
|
||||
ret = DDERR_INVALIDPARAMS;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsBadCodePtr(pCallback))
|
||||
{
|
||||
ret = DDERR_INVALIDPARAMS;
|
||||
}
|
||||
else
|
||||
else if ( ret == DD_OK)
|
||||
{
|
||||
|
||||
DevMode.dmSize = sizeof(DEVMODE);
|
||||
|
|
Loading…
Reference in a new issue