ReactOS  0.4.14-dev-49-gfb4591c
d3d.c File Reference
#include <string.h>
#include <dxg_int.h>
Include dependency graph for d3d.c:

Go to the source code of this file.

Functions

DWORD NTAPI DxDdCanCreateD3DBuffer (HANDLE DdHandle, PDD_CANCREATESURFACEDATA SurfaceData)
 
DWORD FASTCALL intDdCreateSurfaceOrBuffer (HANDLE hDirectDrawLocal, PEDD_SURFACE pDdSurfList, DDSURFACEDESC2 *a3, DD_SURFACE_GLOBAL *pDdSurfGlob, DD_SURFACE_LOCAL *pDdSurfLoc, DD_SURFACE_MORE *pDdSurfMore, DD_CREATESURFACEDATA *pDdCreateSurfaceData, PVOID Address)
 
DWORD NTAPI DxDdCreateD3DBuffer (HANDLE hDirectDrawLocal, PEDD_SURFACE pDdSurfList, DDSURFACEDESC2 *a3, DD_SURFACE_GLOBAL *pDdSurfGlob, DD_SURFACE_LOCAL *pDdSurfLoc, DD_SURFACE_MORE *pDdSurfMore, DD_CREATESURFACEDATA *pDdCreateSurfaceData, PVOID Address)
 

Function Documentation

◆ DxDdCanCreateD3DBuffer()

DWORD NTAPI DxDdCanCreateD3DBuffer ( HANDLE  DdHandle,
PDD_CANCREATESURFACEDATA  SurfaceData 
)

Definition at line 14 of file d3d.c.

17 {
21 
23  if (!peDdL)
24  return RetVal;
25 
26  peDdGl = peDdL->peDirectDrawGlobal2;
27  gpEngFuncs.DxEngLockHdev(peDdGl->hDev);
28 
29  // assign out DirectDrawGlobal to SurfaceData
30  SurfaceData->lpDD = (PDD_DIRECTDRAW_GLOBAL)peDdGl;
31 
33  RetVal = peDdGl->d3dBufCallbacks.CanCreateD3DBuffer(SurfaceData);
34 
37 
38  return RetVal;
39 }
struct _DD_DIRECTDRAW_GLOBAL * PDD_DIRECTDRAW_GLOBAL
PDD_CANCREATESURFACE CanCreateD3DBuffer
Definition: ddrawint.h:1032
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
USHORT cExclusiveLock
Definition: dxg_int.h:39
DXENG_FUNCTIONS gpEngFuncs
Definition: main.c:20
#define ObjType_DDLOCAL_TYPE
Definition: dxg_int.h:56
PVOID FASTCALL DdHmgLock(HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned)
Definition: ddhmg.c:147
unsigned long DWORD
Definition: ntddk_ex.h:95
DD_BASEOBJECT pobj
Definition: directxint.h:16
#define InterlockedDecrement
Definition: armddk.h:52
PDD_DIRECTDRAW_GLOBAL lpDD
Definition: ddrawint.h:456
struct _EDD_DIRECTDRAW_GLOBAL * peDirectDrawGlobal2
Definition: directxint.h:22
DD_D3DBUFCALLBACKS d3dBufCallbacks
Definition: directxint.h:165
struct _EDD_DIRECTDRAW_LOCAL * PEDD_DIRECTDRAW_LOCAL
PFN_DxEngLockHdev DxEngLockHdev
Definition: dxg_int.h:137
PFN_DxEngUnlockHdev DxEngUnlockHdev
Definition: dxg_int.h:138

◆ DxDdCreateD3DBuffer()

DWORD NTAPI DxDdCreateD3DBuffer ( HANDLE  hDirectDrawLocal,
PEDD_SURFACE  pDdSurfList,
DDSURFACEDESC2 a3,
DD_SURFACE_GLOBAL pDdSurfGlob,
DD_SURFACE_LOCAL pDdSurfLoc,
DD_SURFACE_MORE pDdSurfMore,
DD_CREATESURFACEDATA pDdCreateSurfaceData,
PVOID  Address 
)

Definition at line 114 of file d3d.c.

123 {
124  return intDdCreateSurfaceOrBuffer(hDirectDrawLocal, pDdSurfList, a3, pDdSurfGlob, pDdSurfLoc, pDdSurfMore, pDdCreateSurfaceData, Address);
125 }
static const struct update_accum a3
Definition: msg.c:600
static WCHAR Address[46]
Definition: ping.c:68
DWORD FASTCALL intDdCreateSurfaceOrBuffer(HANDLE hDirectDrawLocal, PEDD_SURFACE pDdSurfList, DDSURFACEDESC2 *a3, DD_SURFACE_GLOBAL *pDdSurfGlob, DD_SURFACE_LOCAL *pDdSurfLoc, DD_SURFACE_MORE *pDdSurfMore, DD_CREATESURFACEDATA *pDdCreateSurfaceData, PVOID Address)
Definition: d3d.c:43

◆ intDdCreateSurfaceOrBuffer()

DWORD FASTCALL intDdCreateSurfaceOrBuffer ( HANDLE  hDirectDrawLocal,
PEDD_SURFACE  pDdSurfList,
DDSURFACEDESC2 a3,
DD_SURFACE_GLOBAL pDdSurfGlob,
DD_SURFACE_LOCAL pDdSurfLoc,
DD_SURFACE_MORE pDdSurfMore,
DD_CREATESURFACEDATA pDdCreateSurfaceData,
PVOID  Address 
)

Definition at line 43 of file d3d.c.

50 {
53  DD_SURFACE_LOCAL *pCurSurfLocal;
54  DD_SURFACE_GLOBAL *pCurSurfGlobal;
55  DD_SURFACE_MORE *pCurSurfMore;
56  PEDD_SURFACE pCurSurf;
57 
58  ULONG CurSurf;
59 
60  if (!pDdCreateSurfaceData)
61  return FALSE;
62 
63  if (!pDdCreateSurfaceData->dwSCnt)
64  {
65  pDdCreateSurfaceData->ddRVal = E_FAIL;
66  return FALSE;
67  }
68 
69  peDdL = (PEDD_DIRECTDRAW_LOCAL)DdHmgLock(hDirectDrawLocal, ObjType_DDLOCAL_TYPE, FALSE);
70  if (!peDdL)
71  return FALSE;
72 
73  peDdGl = peDdL->peDirectDrawGlobal2;
74 
75  if (!(pDdSurfLoc->ddsCaps.dwCaps & DDSCAPS_VISIBLE) && !(peDdGl->ddCallbacks.dwFlags & DDHAL_CB32_CREATESURFACE))
76  {
77  pDdCreateSurfaceData->ddRVal = E_FAIL;
78  return FALSE;
79  }
80 
81  pDdSurfList = (PEDD_SURFACE)EngAllocMem(FL_ZERO_MEMORY, pDdCreateSurfaceData->dwSCnt * sizeof(EDD_SURFACE), TAG_GDDP);
82  pDdSurfGlob = (DD_SURFACE_GLOBAL *)EngAllocMem(FL_ZERO_MEMORY, pDdCreateSurfaceData->dwSCnt * sizeof(DD_SURFACE_GLOBAL), TAG_GDDP);
83  pDdSurfLoc = (DD_SURFACE_LOCAL *)EngAllocMem(FL_ZERO_MEMORY, pDdCreateSurfaceData->dwSCnt * sizeof(DD_SURFACE_LOCAL), TAG_GDDP);
84  pDdSurfMore = (DD_SURFACE_MORE *)EngAllocMem(FL_ZERO_MEMORY, pDdCreateSurfaceData->dwSCnt * sizeof(DD_SURFACE_MORE), TAG_GDDP);
85 
87  gpEngFuncs.DxEngLockHdev(peDdGl->hDev);
88 
89  // create all surface objects
90  for (CurSurf = 0; CurSurf < pDdCreateSurfaceData->dwSCnt; CurSurf++)
91  {
92  pCurSurf = &pDdSurfList[CurSurf];
93  pCurSurfLocal = &pDdSurfLoc[CurSurf];
94  pCurSurfGlobal = &pDdSurfGlob[CurSurf];
95  pCurSurfMore = &pDdSurfMore[CurSurf];
96 
97  pCurSurf = intDdCreateNewSurfaceObject(
98  peDdL,
99  pCurSurf,
100  pCurSurfGlobal,
101  pCurSurfLocal,
102  pCurSurfMore);
103  Address = pCurSurf;
104  }
105 
108 
109  return DDHAL_DRIVER_HANDLED;
110 }
DWORD dwCaps
Definition: ddraw.h:727
DDSCAPS ddsCaps
Definition: ddrawint.h:174
PFN_DxEngUnlockShareSem DxEngUnlockShareSem
Definition: dxg_int.h:135
DXENG_FUNCTIONS gpEngFuncs
Definition: main.c:20
#define E_FAIL
Definition: ddrawi.h:102
PEDD_SURFACE NTAPI intDdCreateNewSurfaceObject(PEDD_DIRECTDRAW_LOCAL peDdL, HANDLE hDirectDrawLocal, PDD_SURFACE_GLOBAL pDdSurfGlob, PDD_SURFACE_LOCAL pDdSurfLoc, PDD_SURFACE_MORE pDdSurfMore)
Definition: ddraw.c:588
#define DDSCAPS_VISIBLE
Definition: ddraw.h:265
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
#define ObjType_DDLOCAL_TYPE
Definition: dxg_int.h:56
PVOID FASTCALL DdHmgLock(HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned)
Definition: ddhmg.c:147
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
#define FL_ZERO_MEMORY
Definition: polytest.cpp:58
struct _EDD_DIRECTDRAW_GLOBAL * peDirectDrawGlobal2
Definition: directxint.h:22
DD_CALLBACKS ddCallbacks
Definition: directxint.h:160
struct _EDD_DIRECTDRAW_LOCAL * PEDD_DIRECTDRAW_LOCAL
DWORD dwFlags
Definition: ddrawint.h:499
#define TAG_GDDP
Definition: tags.h:5
#define DDHAL_CB32_CREATESURFACE
Definition: ddrawi.h:654
unsigned int ULONG
Definition: retypes.h:1
PFN_DxEngLockHdev DxEngLockHdev
Definition: dxg_int.h:137
PFN_DxEngUnlockHdev DxEngUnlockHdev
Definition: dxg_int.h:138
struct _EDD_SURFACE * PEDD_SURFACE
PFN_DxEngLockShareSem DxEngLockShareSem
Definition: dxg_int.h:134

Referenced by DxDdCreateD3DBuffer().