Author: greatlrd Date: Wed Jul 19 04:41:18 2006 New Revision: 23164
URL: http://svn.reactos.org/svn/reactos?rev=23164&view=rev Log: cleanup NtGdiDdCreateSurface we can now create a surface from DdCreateSurface.
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntd... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c Wed Jul 19 04:41:18 2006 @@ -344,42 +344,32 @@ DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; PDD_DIRECTDRAW pDirectDraw; PDD_DIRECTDRAW_GLOBAL lgpl; -#ifdef DX_DEBUG + DPRINT1("NtGdiDdCreateSurface\n"); -#endif
pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); - if (pDirectDraw == NULL) - { -#ifdef DX_DEBUG - DPRINT1("Can not lock the DirectDraw handle\n"); -#endif - return DDHAL_DRIVER_NOTHANDLED; - } - - /* backup the orignal PDev and info */ - lgpl = puCreateSurfaceData->lpDD; - - /* use our cache version instead */ - puCreateSurfaceData->lpDD = &pDirectDraw->Global; - - /* make the call */ - if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE)) - { -#ifdef DX_DEBUG - DPRINT1("DirectDraw HAL does not support Create Surface"); -#endif - ddRVal = DDHAL_DRIVER_NOTHANDLED; - } - else - { - ddRVal = pDirectDraw->DD.CreateSurface(puCreateSurfaceData); - } - - /* But back the orignal PDev */ - puCreateSurfaceData->lpDD = lgpl; - - GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); + + if (pDirectDraw != NULL) + { + + if ((pDirectDraw->DD.dwFlags & DDHAL_CB32_CREATESURFACE)) + { + /* backup the orignal PDev and info */ + lgpl = puCreateSurfaceData->lpDD; + + /* use our cache version instead */ + puCreateSurfaceData->lpDD = &pDirectDraw->Global; + + /* make the call */ + ddRVal = pDirectDraw->DD.CreateSurface(puCreateSurfaceData); + + /* But back the orignal PDev */ + puCreateSurfaceData->lpDD = lgpl; + } + + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); + } + return ddRVal; }