Author: greatlrd
Date: Sun Dec 9 15:51:50 2007
New Revision: 31100
URL:
http://svn.reactos.org/svn/reactos?rev=31100&view=rev
Log:
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.
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c Sun Dec 9 15:51:50 2007
@@ -29,15 +29,19 @@
_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 @@
_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);