Author: greatlrd Date: Mon Dec 31 05:54:23 2007 New Revision: 31510
URL: http://svn.reactos.org/svn/reactos?rev=31510&view=rev Log: Add new struct call EDD_SURFACE_LOCAL it is base on DD_SURFACE_LOCAL Change DxLocksurface using this new struct
Modified: trunk/reactos/drivers/directx/dxg/dxg_int.h trunk/reactos/drivers/directx/dxg/eng.c
Modified: trunk/reactos/drivers/directx/dxg/dxg_int.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/directx/dxg/dxg_int... ============================================================================== --- trunk/reactos/drivers/directx/dxg/dxg_int.h (original) +++ trunk/reactos/drivers/directx/dxg/dxg_int.h Mon Dec 31 05:54:23 2007 @@ -62,6 +62,12 @@ PVOID pUser; } DD_ENTRY, *PDD_ENTRY;
+typedef struct _EDD_SURFACE_LOCAL +{ + DD_BASEOBJECT Object; + DD_SURFACE_LOCAL Surfacelcl; +} EDD_SURFACE_LOCAL, *PEDD_SURFACE_LOCAL; +
Modified: trunk/reactos/drivers/directx/dxg/eng.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/directx/dxg/eng.c?r... ============================================================================== --- trunk/reactos/drivers/directx/dxg/eng.c (original) +++ trunk/reactos/drivers/directx/dxg/eng.c Mon Dec 31 05:54:23 2007 @@ -16,12 +16,13 @@ STDCALL DxDdLockDirectDrawSurface(HANDLE hDdSurface) { + PEDD_SURFACE_LOCAL pEDDSurfacelcl = NULL; PDD_SURFACE_LOCAL pSurfacelcl = NULL;
pSurfacelcl = DdHmgLock(hDdSurface, 2, FALSE); if (pSurfacelcl != NULL) { - pSurfacelcl = (PDD_SURFACE_LOCAL)(((PBYTE)&pSurfacelcl) + sizeof(DD_BASEOBJECT)); + pSurfacelcl = &pEDDSurfacelcl->Surfacelcl; }
return pSurfacelcl; @@ -32,12 +33,12 @@ DxDdUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface) { BOOL retVal = FALSE; - PDD_BASEOBJECT pObject = NULL; + PEDD_SURFACE_LOCAL pEDDSurfacelcl = NULL;
if (pSurface) { - pObject = (PDD_BASEOBJECT)( ((PBYTE)&pSurface) - sizeof(DD_BASEOBJECT)); - InterlockedDecrement(&pObject->cExclusiveLock); + pEDDSurfacelcl = (PEDD_SURFACE_LOCAL)( ((PBYTE)pSurface) - sizeof(DD_BASEOBJECT)); + InterlockedDecrement(&pEDDSurfacelcl->Object.cExclusiveLock); retVal = TRUE; }
@@ -45,3 +46,5 @@ }
+ +