Author: greatlrd Date: Sat Apr 19 15:50:39 2008 New Revision: 33037
URL: http://svn.reactos.org/svn/reactos?rev=33037&view=rev Log: add tempory hack for alloc EDD_DIRECTDRAW_GLOBAL for win32k. this should be done for each drv, not a global for whole win32k it is only gobal for that drv, then we set the pointer to each hdc that is how it should be done.
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] Sat Apr 19 15:50:39 2008 @@ -21,6 +21,7 @@ DRVFN gpDxFuncs[DXG_INDEX_DxDdIoctl]; HANDLE ghDxGraphics = NULL; ULONG gdwDirectDrawContext; +EDD_DIRECTDRAW_GLOBAL eDdirectDraw_Global;
/************************************************************************/ @@ -154,7 +155,8 @@ PGD_DDCREATEDIRECTDRAWOBJECT pfnDdCreateDirectDrawObject; NTSTATUS Status; PEPROCESS Proc = NULL; - + PDC pDC; + if (hdc == NULL) { DPRINT1("Warning : hdc is NULL\n"); @@ -170,12 +172,25 @@ return 0; }
+ /* 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 */ + ((PGDIDEVICE)pDC->pPDev)->pEDDgpl = &eDdirectDraw_Global; + RtlZeroMemory(&eDdirectDraw_Global,sizeof(EDD_DIRECTDRAW_GLOBAL)); + DC_UnlockDc(pDC); + + /* get the pfnDdCreateDirectDrawObject after we load the drv */ pfnDdCreateDirectDrawObject = (PGD_DDCREATEDIRECTDRAWOBJECT)gpDxFuncs[DXG_INDEX_DxDdCreateDirectDrawObject].pfn;
if (pfnDdCreateDirectDrawObject == NULL) { - DPRINT1("Warning: no pfnDdCreateDirectDrawObject\n"); + DPRINT1("Warning: no pfnDdCreateDirectDrawObject\n"); return DDHAL_DRIVER_NOTHANDLED; }