Author: greatlrd Date: Fri Dec 10 11:08:37 2010 New Revision: 50002
URL: http://svn.reactos.org/svn/reactos?rev=50002&view=rev Log: intEnableReactXDriver Primary surface have been rewriten in win32k ppdev does not alloc edd_directx_global struct any more, that is not a problem we doing it here instead. it alloc it when it is need it. not before
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c URL: http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32/... ============================================================================== --- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c [iso-8859-1] (original) +++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c [iso-8859-1] Fri Dec 10 11:08:37 2010 @@ -39,8 +39,6 @@ PGD_DXDDENABLEDIRECTDRAW pfnDdEnableDirectDraw = NULL; BOOL success = FALSE;
- /* FIXME get the process data */ - /* Do not try load dxg.sys when it have already been load once */ if (gpfnStartupDxGraphics == NULL) { @@ -60,6 +58,20 @@ }
pDev = pDC->ppdev; + + /* This code should be where primary surface is create + but we save some memory use to alloc it when it is need it */ + if (pDev->pEDDgpl == NULL) + { + pDev->pEDDgpl = ExAllocatePoolWithTag(PagedPool, sizeof(EDD_DIRECTDRAW_GLOBAL), TAG_EDDGBL); + if (!pDev->pEDDgpl) + { + DPRINT1("Warning : Failed to allocate memmory for EDD_DIRECTDRAW_GLOBAL\n"); + DC_UnlockDc(pDC); + return FALSE; + } + RtlZeroMemory( pDev->pEDDgpl ,sizeof(EDD_DIRECTDRAW_GLOBAL)); + }
/* test see if drv got a dx interface or not */ if ( ( pDev->DriverFunctions.DisableDirectDraw == NULL) || @@ -69,8 +81,7 @@ } else { - - /* CHeck see if dx have been enable or not */ + /* Check see if dx have been enable or not */ if ( pDev->pEDDgpl->pvmList == NULL) { pDev->pEDDgpl->ddCallbacks.dwSize = sizeof(DD_CALLBACKS); @@ -98,7 +109,6 @@ success = TRUE; } } -
DPRINT1("Return value : 0x%08x\n",success); DC_UnlockDc(pDC);