2007-10-24 11:05:44 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* PURPOSE: Native driver for dxg implementation
|
|
|
|
* FILE: drivers/directx/dxg/main.c
|
|
|
|
* PROGRAMER: Magnus olsen (magnus@greatlord.com)
|
|
|
|
* REVISION HISTORY:
|
2007-12-30 22:41:31 +00:00
|
|
|
* 30/12-2007 Magnus Olsen
|
2007-10-24 11:05:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2007-12-30 22:41:31 +00:00
|
|
|
#include <dxg_int.h>
|
2007-10-24 11:05:44 +00:00
|
|
|
|
|
|
|
|
2007-12-30 22:41:31 +00:00
|
|
|
PDD_SURFACE_LOCAL
|
|
|
|
STDCALL
|
|
|
|
DxDdLockDirectDrawSurface(HANDLE hDdSurface)
|
|
|
|
{
|
2007-12-31 03:17:42 +00:00
|
|
|
PEDD_SURFACE pEDDSurface = NULL;
|
2007-12-30 22:41:31 +00:00
|
|
|
PDD_SURFACE_LOCAL pSurfacelcl = NULL;
|
|
|
|
|
2007-12-31 14:31:06 +00:00
|
|
|
pEDDSurface = DdHmgLock(hDdSurface, ObjType_DDSURFACE_TYPE, FALSE);
|
2007-12-31 03:17:42 +00:00
|
|
|
if (pEDDSurface != NULL)
|
2007-12-30 22:41:31 +00:00
|
|
|
{
|
2007-12-31 03:17:42 +00:00
|
|
|
pSurfacelcl = &pEDDSurface->ddsSurfaceLocal;
|
2007-12-30 22:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return pSurfacelcl;
|
|
|
|
}
|
|
|
|
|
2007-12-30 23:12:59 +00:00
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
DxDdUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface)
|
|
|
|
{
|
|
|
|
BOOL retVal = FALSE;
|
2007-12-31 03:17:42 +00:00
|
|
|
PEDD_SURFACE pEDDSurface = NULL;
|
2007-12-30 23:12:59 +00:00
|
|
|
|
|
|
|
if (pSurface)
|
|
|
|
{
|
2007-12-31 03:17:42 +00:00
|
|
|
pEDDSurface = (PEDD_SURFACE)( ((PBYTE)pSurface) - sizeof(DD_BASEOBJECT));
|
2008-04-23 05:23:51 +00:00
|
|
|
// InterlockedDecrement(&pEDDSurface->pobj.cExclusiveLock);
|
2007-12-30 23:12:59 +00:00
|
|
|
retVal = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return retVal;
|
|
|
|
}
|
|
|
|
|
2007-10-24 11:05:44 +00:00
|
|
|
|
2007-12-31 02:54:23 +00:00
|
|
|
|
|
|
|
|
2007-12-31 14:31:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|