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