xref: /reactos/win32ss/reactx/dxg/eng.c (revision c2c66aff)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * COPYRIGHT:        See COPYING in the top level directory
3*c2c66affSColin Finck  * PROJECT:          ReactOS kernel
4*c2c66affSColin Finck  * PURPOSE:          Native driver for dxg implementation
5*c2c66affSColin Finck  * FILE:             win32ss/reactx/dxg/eng.c
6*c2c66affSColin Finck  * PROGRAMER:        Magnus olsen (magnus@greatlord.com)
7*c2c66affSColin Finck  * REVISION HISTORY:
8*c2c66affSColin Finck  *       30/12-2007   Magnus Olsen
9*c2c66affSColin Finck  */
10*c2c66affSColin Finck 
11*c2c66affSColin Finck #include <dxg_int.h>
12*c2c66affSColin Finck 
13*c2c66affSColin Finck PDD_SURFACE_LOCAL
14*c2c66affSColin Finck NTAPI
DxDdLockDirectDrawSurface(HANDLE hDdSurface)15*c2c66affSColin Finck DxDdLockDirectDrawSurface(HANDLE hDdSurface)
16*c2c66affSColin Finck {
17*c2c66affSColin Finck    PEDD_SURFACE pEDDSurface = NULL;
18*c2c66affSColin Finck    PDD_SURFACE_LOCAL pSurfacelcl = NULL;
19*c2c66affSColin Finck 
20*c2c66affSColin Finck    pEDDSurface = DdHmgLock(hDdSurface, ObjType_DDSURFACE_TYPE, FALSE);
21*c2c66affSColin Finck    if (pEDDSurface != NULL)
22*c2c66affSColin Finck    {
23*c2c66affSColin Finck         pSurfacelcl = &pEDDSurface->ddsSurfaceLocal;
24*c2c66affSColin Finck    }
25*c2c66affSColin Finck 
26*c2c66affSColin Finck    return pSurfacelcl;
27*c2c66affSColin Finck }
28*c2c66affSColin Finck 
29*c2c66affSColin Finck BOOL
30*c2c66affSColin Finck NTAPI
DxDdUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface)31*c2c66affSColin Finck DxDdUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface)
32*c2c66affSColin Finck {
33*c2c66affSColin Finck     BOOL retVal = FALSE;
34*c2c66affSColin Finck     //PEDD_SURFACE pEDDSurface  = NULL;
35*c2c66affSColin Finck 
36*c2c66affSColin Finck     if (pSurface)
37*c2c66affSColin Finck     {
38*c2c66affSColin Finck         // pEDDSurface = (PEDD_SURFACE)( ((PBYTE)pSurface) - sizeof(DD_BASEOBJECT));
39*c2c66affSColin Finck         // InterlockedDecrement(&pEDDSurface->pobj.cExclusiveLock);
40*c2c66affSColin Finck         retVal = TRUE;
41*c2c66affSColin Finck     }
42*c2c66affSColin Finck 
43*c2c66affSColin Finck     return retVal;
44*c2c66affSColin Finck }
45