Author: greatlrd Date: Mon Apr 28 01:03:29 2008 New Revision: 33173
URL: http://svn.reactos.org/svn/reactos?rev=33173&view=rev Log: update intEnableReactXDriver with more code
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 [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c [iso-8859-1] Mon Apr 28 01:03:29 2008 @@ -35,9 +35,21 @@ PGDIDEVICE pDev = (PGDIDEVICE)pDC->pPDev; BOOLEAN success = FALSE; DD_GETDRIVERINFODATA GetInfo; + PGD_DXDDENABLEDIRECTDRAW pfnDdEnableDirectDraw = (PGD_DXDDENABLEDIRECTDRAW)gpDxFuncs[DXG_INDEX_DxDdEnableDirectDraw].pfn;
/*clean up some of the cache entry */ RtlZeroMemory(pEddgbl,sizeof(EDD_DIRECTDRAW_GLOBAL)); + + if (pfnDdEnableDirectDraw == NULL) + { + DPRINT1("Warning: no pfnDdEnableDirectDraw\n"); + } + else + { + DPRINT1(" call to pfnDdEnableDirectDraw \n "); + success = pfnDdEnableDirectDraw(pDC->PDev, TRUE); + DPRINT1(" end call to pfnDdEnableDirectDraw \n "); + }
/* setup hdev for edd_DdirectDraw_Global xp */ edd_DdirectDraw_Global.hDev = pDC->pPDev; @@ -253,8 +265,12 @@ /* setup missing data in ddHalInfo */ //pEddgbl->ddHalInfo.GetDriverInfo = (PVOID)pDev->DriverFunctions.GetDirectDrawInfo;
+ /* FIXME : hack ? it will let us DxDdQueryDirectDrawObject if the llAssertModeTimeout contain negtive value -1*/ pEddgbl->llAssertModeTimeout.QuadPart = -1; + + +
/* FIXME : remove this when we are done with debuging of dxg */ dump_edd_directdraw_global(pEddgbl); @@ -389,24 +405,7 @@ }
/* FIXME this code should be add where the driver being load */ - pDC = DC_LockDc(hdc); - if (pDC == NULL) - { - DPRINT1("Warning : Failed to lock hdc\n"); - return 0; - } - - /* FIXME This should be alloc for each drv and use it from each drv, not global for whole win32k */ - if (intEnableReactXDriver(&edd_DdirectDraw_Global, pDC) == FALSE) - { - DC_UnlockDc(pDC); - DPRINT1("Warning : Failed to start the directx interface from the graphic driver\n"); - return DDHAL_DRIVER_NOTHANDLED; - } - - DC_UnlockDc(pDC); - - /* FIXME get the process data */ + /* FIXME get the process data */ /* FIXME this code should be add where the driver being load */ Status = DxDdStartupDxGraphics(0,NULL,0,NULL,NULL, Proc); if (!NT_SUCCESS(Status)) @@ -414,6 +413,25 @@ DPRINT1("Warning : Failed to create the directx interface\n"); return 0; } + + pDC = DC_LockDc(hdc); + if (pDC == NULL) + { + DPRINT1("Warning : Failed to lock hdc\n"); + return 0; + } + + /* FIXME This should be alloc for each drv and use it from each drv, not global for whole win32k */ + if (intEnableReactXDriver(&edd_DdirectDraw_Global, pDC) == FALSE) + { + DC_UnlockDc(pDC); + DPRINT1("Warning : Failed to start the directx interface from the graphic driver\n"); + return DDHAL_DRIVER_NOTHANDLED; + } + + DC_UnlockDc(pDC); + +
/* get the pfnDdCreateDirectDrawObject after we load the drv */ pfnDdCreateDirectDrawObject = (PGD_DDCREATEDIRECTDRAWOBJECT)gpDxFuncs[DXG_INDEX_DxDdCreateDirectDrawObject].pfn;