Author: greatlrd Date: Sun May 13 16:11:41 2007 New Revision: 26751
URL: http://svn.reactos.org/svn/reactos?rev=26751&view=rev Log: adding smore check for createsurface, (still does not create a surface)
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/ddr... ============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun May 13 16:11:41 2007 @@ -136,6 +136,12 @@ if (pUnkOuter) { /* FIXME send back right return code */ + return DDERR_GENERIC; + } + + if (pDDSD) + { + /* FIXME send back right return code */ return DDERR_GENERIC; }
Modified: trunk/reactos/dll/directx/ddraw/Surface/createsurface.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/c... ============================================================================== --- trunk/reactos/dll/directx/ddraw/Surface/createsurface.c (original) +++ trunk/reactos/dll/directx/ddraw/Surface/createsurface.c Sun May 13 16:11:41 2007 @@ -9,17 +9,27 @@ */ #include "rosdraw.h"
+/* + * all param have been checked if they are vaild before they are call to + * Internal_CreateSurface, if not please fix the code in the functions + * call to Internal_CreateSurface, ppSurf are being vaildate in + * Internal_CreateSurface + */ + HRESULT Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD, LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter) { - if (!pDDraw->lpLcl->dwLocalFlags & DDRAWILCL_DIRECTDRAW7) - { - /* it is directdraw 1-6 so no DirectD3D support */ - } - else - { - /* directdraw 7 support */ + + /* + * pDDSD->dwCaps can not contain both DDSCAPS_SYSTEMMEMORY and DDSCAPS_VIDEOMEMORY + * if both are define ddraw.dll will return error code 0x88760064 + */ + if ( (pDDSD->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY) && + (pDDSD->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + /* translate the error code I got back to a name */ + return 0x88760064; }
return DDERR_GENERIC;