ReactOS 0.4.15-dev-5672-gf73ac17
ddsurf.c File Reference
#include <dxg_int.h>
Include dependency graph for ddsurf.c:

Go to the source code of this file.

Functions

DWORD NTAPI DxDdLock (HANDLE hSurface, PDD_LOCKDATA puLockData, HDC hdcClip)
 
DWORD NTAPI DxDdUnlock (HANDLE hSurface, PDD_UNLOCKDATA puUnlockData)
 

Function Documentation

◆ DxDdLock()

DWORD NTAPI DxDdLock ( HANDLE  hSurface,
PDD_LOCKDATA  puLockData,
HDC  hdcClip 
)

Definition at line 36 of file ddsurf.c.

39{
43 DD_MAPMEMORYDATA mapMemoryData;
44
46 peDdL = pSurface->peDirectDrawLocal;
47 peDdGl = peDdL->peDirectDrawGlobal2;
48
49 // Map memory if it's not already mapped and driver function is provided
50 if (!peDdL->isMemoryMapped && (peDdGl->ddCallbacks.dwFlags & DDHAL_CB32_MAPMEMORY))
51 {
52 mapMemoryData.bMap = 1;
53 mapMemoryData.hProcess = (HANDLE)-1;
54 mapMemoryData.fpProcess = 0;
55 mapMemoryData.lpDD = (PDD_DIRECTDRAW_GLOBAL)peDdGl;
56
57 peDdGl->ddCallbacks.MapMemory(&mapMemoryData);
58
59 if (!mapMemoryData.ddRVal)
60 {
61 peDdL->isMemoryMapped = 1;
62 peDdL->fpProcess2 = mapMemoryData.fpProcess;
63 }
64 }
65
66 if (pSurface)
67 {
68 InterlockedExchangeAdd((LONG*)&pSurface->pobj.cExclusiveLock, 0xFFFFFFFF);
69 }
70
71 puLockData->ddRVal = DD_OK;
72
74}
PVOID FASTCALL DdHmgLock(HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned)
Definition: ddhmg.c:147
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DDHAL_CB32_MAPMEMORY
Definition: ddrawint.h:519
struct _DD_DIRECTDRAW_GLOBAL * PDD_DIRECTDRAW_GLOBAL
struct _EDD_SURFACE * PEDD_SURFACE
#define TRUE
Definition: types.h:120
#define ObjType_DDSURFACE_TYPE
Definition: dxg_int.h:57
#define InterlockedExchangeAdd
Definition: interlocked.h:181
long LONG
Definition: pedump.c:60
#define DD_OK
Definition: ddraw.h:186
DWORD dwFlags
Definition: ddrawint.h:499
PDD_MAPMEMORY MapMemory
Definition: ddrawint.h:508
HRESULT ddRVal
Definition: ddrawint.h:248
FLATPTR fpProcess
Definition: ddrawint.h:486
PDD_DIRECTDRAW_GLOBAL lpDD
Definition: ddrawint.h:483
HRESULT ddRVal
Definition: ddrawint.h:487
DD_CALLBACKS ddCallbacks
Definition: directxint.h:160
struct _EDD_DIRECTDRAW_GLOBAL * peDirectDrawGlobal2
Definition: directxint.h:22
PVOID HANDLE
Definition: typedefs.h:73
_In_ DD_SURFACE_LOCAL * pSurface
Definition: winddi.h:3481

◆ DxDdUnlock()

DWORD NTAPI DxDdUnlock ( HANDLE  hSurface,
PDD_UNLOCKDATA  puUnlockData 
)

Definition at line 96 of file ddsurf.c.

98{
99 puUnlockData->ddRVal = DD_OK;
100
102}
HRESULT ddRVal
Definition: ddrawint.h:258