ReactOS  0.4.13-dev-241-g63286c6
rosdraw.h File Reference
#include <windows.h>
#include <stdio.h>
#include <ddraw.h>
#include <ddrawi.h>
#include <d3dhal.h>
#include <ddrawgdi.h>
#include <pseh/pseh.h>
#include <pseh/pseh2.h>
#include "Ddraw/ddraw.h"
#include "Surface/surface.h"
#include "Clipper/clipper.h"
#include "resource.h"
Include dependency graph for rosdraw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DDRAWI_DDCOLORCONTROL_INT
 
struct  _DDRAWI_DDGAMMACONTROL_INT
 
struct  _DDRAWI_DDKERNEL_INT
 
struct  _DDRAWI_DDKERNELSURFACE_INT
 

Macros

#define DxHeapMemAlloc(p, m)
 
#define DxHeapMemFree(p)
 
#define HEL_GRAPHIC_MEMORY_MAX   67108864
 
#define DX_STUB
 
#define DX_STUB_DD_OK
 
#define DX_STUB_str(x)
 
#define DX_WINDBG_trace()
 
#define DX_WINDBG_trace_res(width, height, bpp, freq)
 

Typedefs

typedef struct DDRAWI_DDCOLORCONTROL_INT DDRAWI_DDCOLORCONTROL_INT
 
typedef struct DDRAWI_DDCOLORCONTROL_INTLPDDRAWI_DDCOLORCONTROL_INT
 
typedef struct _DDRAWI_DDGAMMACONTROL_INT DDRAWI_DDGAMMACONTROL_INT
 
typedef struct _DDRAWI_DDGAMMACONTROL_INTLPDDRAWI_DDGAMMACONTROL_INT
 
typedef struct _DDRAWI_DDKERNEL_INT DDRAWI_KERNEL_INT
 
typedef struct _DDRAWI_DDKERNEL_INTLPDDRAWI_KERNEL_INT
 
typedef struct _DDRAWI_DDKERNELSURFACE_INT _DDRAWI_DDKERNELSURFACE_INT
 
typedef struct _DDRAWI_DDKERNELSURFACE_INTLPDDRAWI_DDKERNELSURFACE_INT
 

Functions

HRESULT WINAPI StartDirectDraw (LPDIRECTDRAW iface, LPGUID pGUID, BOOL reenable)
 
HRESULT WINAPI StartDirectDrawHal (LPDIRECTDRAW iface, BOOL reenable)
 
HRESULT WINAPI StartDirectDrawHel (LPDIRECTDRAW iface, BOOL reenable)
 
HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW *pIface, REFIID id, BOOL ex)
 
HRESULT WINAPI ReCreateDirectDraw (LPDIRECTDRAW iface)
 
HRESULT Internal_CreateSurface (LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD, LPDDRAWI_DDRAWSURFACE_INT *ppSurf, IUnknown *pUnkOuter)
 
HRESULT Internal_CreatePalette (LPDDRAWI_DIRECTDRAW_INT pDDraw, DWORD dwFlags, LPPALETTEENTRY palent, LPDIRECTDRAWPALETTE *ppPalette, LPUNKNOWN pUnkOuter)
 
void CopyDDSurfDescToDDSurfDesc2 (LPDDSURFACEDESC2 dst_pDesc, LPDDSURFACEDESC src_pDesc)
 
VOID Cleanup (LPDDRAWI_DIRECTDRAW_INT iface)
 
VOID WINAPI AcquireDDThreadLock (VOID)
 
VOID WINAPI ReleaseDDThreadLock (VOID)
 
ULONG WINAPI DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface)
 
HRESULT WINAPI DirectDrawClipper_Initialize (LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags)
 
VOID Hal_DirectDraw_Release (LPDIRECTDRAW7)
 

Variables

DDRAWI_DIRECTDRAW_GBL ddgbl
 
DDRAWI_DDRAWSURFACE_GBL ddSurfGbl
 
WCHAR classname [128]
 
WNDCLASSW wnd_class
 
CRITICAL_SECTION ddcs
 
IDirectDraw7Vtbl DirectDraw7_Vtable
 
IDirectDraw4Vtbl DirectDraw4_Vtable
 
IDirectDraw2Vtbl DirectDraw2_Vtable
 
IDirectDrawVtbl DirectDraw_Vtable
 
IDirectDrawSurface7Vtbl DirectDrawSurface7_Vtable
 
IDirectDrawSurface4Vtbl DirectDrawSurface4_Vtable
 
IDirectDrawSurface3Vtbl DirectDrawSurface3_Vtable
 
IDirectDrawSurface2Vtbl DirectDrawSurface2_Vtable
 
IDirectDrawSurfaceVtbl DirectDrawSurface_Vtable
 
const IDirectDrawPaletteVtbl DirectDrawPalette_Vtable
 
IDirectDrawClipperVtbl DirectDrawClipper_Vtable
 
IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable
 
IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable
 
IDirectDrawKernelVtbl DirectDrawKernel_Vtable
 
IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable
 
IDirect3DVtbl IDirect3D_Vtbl
 
IDirect3D2Vtbl IDirect3D2_Vtbl
 
IDirect3D3Vtbl IDirect3D3_Vtbl
 
IDirect3D7Vtbl IDirect3D7_Vtbl
 

Macro Definition Documentation

◆ DX_STUB

#define DX_STUB
Value:
{ \
static BOOL firstcall = TRUE; \
if (firstcall) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Function %s is not implemented yet (%s:%d)\n", __FUNCTION__,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
firstcall = FALSE; \
} \
} \
#define TRUE
Definition: types.h:120
#define DDERR_UNSUPPORTED
Definition: ddraw.h:127
GLuint buffer
Definition: glext.h:5915
unsigned int BOOL
Definition: ntddk_ex.h:94
#define __FUNCTION__
Definition: types.h:112

Definition at line 224 of file rosdraw.h.

◆ DX_STUB_DD_OK

#define DX_STUB_DD_OK
Value:
{ \
static BOOL firstcall = TRUE; \
if (firstcall) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Function %s is not implemented yet (%s:%d)\n", __FUNCTION__,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
firstcall = FALSE; \
} \
} \
return DD_OK;
#define TRUE
Definition: types.h:120
GLuint buffer
Definition: glext.h:5915
#define DD_OK
Definition: ddraw.h:186
unsigned int BOOL
Definition: ntddk_ex.h:94
#define __FUNCTION__
Definition: types.h:112

Definition at line 239 of file rosdraw.h.

◆ DX_STUB_str

#define DX_STUB_str (   x)
Value:
{ \
char buffer[1024]; \
sprintf ( buffer, "Function %s %s (%s:%d)\n", __FUNCTION__,x,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
}
GLuint buffer
Definition: glext.h:5915
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define __FUNCTION__
Definition: types.h:112

Definition at line 254 of file rosdraw.h.

◆ DX_WINDBG_trace

#define DX_WINDBG_trace ( )
Value:
static BOOL firstcallx = TRUE; \
if (firstcallx) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Enter Function %s (%s:%d)\n", __FUNCTION__,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
firstcallx = TRUE; \
}
#define TRUE
Definition: types.h:120
GLuint buffer
Definition: glext.h:5915
unsigned int BOOL
Definition: ntddk_ex.h:94
#define __FUNCTION__
Definition: types.h:112

Definition at line 262 of file rosdraw.h.

◆ DX_WINDBG_trace_res

#define DX_WINDBG_trace_res (   width,
  height,
  bpp,
  freq 
)
Value:
static BOOL firstcallxx = TRUE; \
if (firstcallxx) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Setmode have been req width=%ld, height=%ld bpp=%ld freq = %ld\n",width,height,bpp, freq); \
OutputDebugStringA(buffer); \
firstcallxx = TRUE; \
}
GLint GLint GLsizei width
Definition: gl.h:1546
#define TRUE
Definition: types.h:120
GLuint buffer
Definition: glext.h:5915
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
DWORD bpp
Definition: surface.c:181

Definition at line 273 of file rosdraw.h.

◆ DxHeapMemAlloc

#define DxHeapMemAlloc (   p,
  m 
)
Value:
{ \
p = malloc(m); \
if (p != NULL) \
{ \
ZeroMemory(p,m); \
} \
}
const GLfloat * m
Definition: glext.h:10848
smooth NULL
Definition: ftsmooth.c:416
#define malloc
Definition: debug_ros.c:4
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 113 of file rosdraw.h.

◆ DxHeapMemFree

#define DxHeapMemFree (   p)
Value:
{ \
free(p); \
p = NULL; \
}
smooth NULL
Definition: ftsmooth.c:416
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 120 of file rosdraw.h.

◆ HEL_GRAPHIC_MEMORY_MAX

#define HEL_GRAPHIC_MEMORY_MAX   67108864

Definition at line 181 of file rosdraw.h.

Typedef Documentation

◆ _DDRAWI_DDKERNELSURFACE_INT

◆ DDRAWI_DDCOLORCONTROL_INT

◆ DDRAWI_DDGAMMACONTROL_INT

◆ DDRAWI_KERNEL_INT

◆ LPDDRAWI_DDCOLORCONTROL_INT

◆ LPDDRAWI_DDGAMMACONTROL_INT

◆ LPDDRAWI_DDKERNELSURFACE_INT

◆ LPDDRAWI_KERNEL_INT

Function Documentation

◆ AcquireDDThreadLock()

VOID WINAPI AcquireDDThreadLock ( VOID  )

◆ Cleanup()

VOID Cleanup ( LPDDRAWI_DIRECTDRAW_INT  iface)

Definition at line 15 of file cleanup.c.

16 {
18 
19  if (ddgbl.lpDDCBtmp != NULL)
20  {
22  }
23 
24  if (ddgbl.lpdwFourCC != NULL)
25  {
27  }
28 
29  if (ddgbl.lpModeInfo != NULL)
30  {
32  }
33 
35 
36  /*
37  anything else to release?
38  */
39 
40  /* release the linked interface */
41  //while (IsBadWritePtr( This->lpVtbl, sizeof( LPDDRAWI_DIRECTDRAW_INT )) )
42  //{
43  // LPDDRAWI_DIRECTDRAW_INT newThis = This->lpVtbl;
44  // if (This->lpLcl != NULL)
45  // {
46  // DeleteDC(This->lpLcl->hDC);
47  // DxHeapMemFree(This->lpLcl);
48  // }
49 
50  // DxHeapMemFree(This);
51  // This = newThis;
52  //}
53 
54  /* release unlinked interface */
55  if (This->lpLcl != NULL)
56  {
57  DxHeapMemFree(This->lpLcl);
58  }
59  //if (This != NULL)
60  //{
61  // DxHeapMemFree(This);
62  //}
63 
64 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
#define DxHeapMemFree(p)
Definition: rosdraw.h:120
DDRAWI_DIRECTDRAW_GBL ddgbl
Definition: startup.c:12
smooth NULL
Definition: ftsmooth.c:416
#define DdDeleteDirectDrawObject
Definition: ddrawgdi.h:26
LPDDHALMODEINFO lpModeInfo
Definition: ddrawi.h:1244
LPDDHAL_CALLBACKS lpDDCBtmp
Definition: ddrawi.h:1224

◆ CopyDDSurfDescToDDSurfDesc2()

void CopyDDSurfDescToDDSurfDesc2 ( LPDDSURFACEDESC2  dst_pDesc,
LPDDSURFACEDESC  src_pDesc 
)

Definition at line 311 of file createsurface.c.

312 {
313  RtlZeroMemory(dst_pDesc,sizeof(DDSURFACEDESC2));
314  RtlCopyMemory(dst_pDesc,src_pDesc,sizeof(DDSURFACEDESC));
315  dst_pDesc->dwSize = sizeof(DDSURFACEDESC2);
316 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
DWORD dwSize
Definition: ddraw.h:1152
struct _DDSURFACEDESC2 DDSURFACEDESC2
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261

Referenced by Main_DirectDraw_CreateSurface().

◆ Create_DirectDraw()

HRESULT WINAPI Create_DirectDraw ( LPGUID  pGUID,
LPDIRECTDRAW pIface,
REFIID  id,
BOOL  ex 
)

Definition at line 20 of file startup.c.

22 {
24 
26  BOOL linking = FALSE;
27 
28  if (pIface == NULL)
29  {
30  return DDERR_INVALIDPARAMS;
31  }
32 
33  This = (LPDDRAWI_DIRECTDRAW_INT)*pIface;
34 
35  DX_STUB_str("Linking?\n")
36 
37  _SEH2_TRY
38  {
39  linking = This->lpLcl ? TRUE:FALSE;
40  }
42  {
43  linking = FALSE;
44  }
45  _SEH2_END;
46 
47  /* fixme linking too second link when we shall not doing it */
48  if (!linking)
49  {
50  /* We do not have a DirectDraw interface, we need alloc it*/
52 
53  DX_STUB_str("1. no linking\n");
54 
55  DxHeapMemAlloc(memThis, sizeof(DDRAWI_DIRECTDRAW_INT));
56  if (memThis == NULL)
57  {
58  return DDERR_OUTOFMEMORY;
59  }
60 
61  This = memThis;
62 
63  /* Fixme release memory alloc if we fail */
64 
65  DxHeapMemAlloc(This->lpLcl, sizeof(DDRAWI_DIRECTDRAW_LCL));
66  if (This->lpLcl == NULL)
67  {
68  return DDERR_OUTOFMEMORY;
69  }
70  }
71  else
72  {
73  /* We got the DirectDraw interface alloc and we need create the link */
75 
76  DX_STUB_str("2.linking\n");
77 
78  /* step 1.Alloc the new DDRAWI_DIRECTDRAW_INT for the link */
79  DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
80  if (newThis == NULL)
81  {
82  return DDERR_OUTOFMEMORY;
83  }
84 
85  /* step 2 check if it not DDCREATE_HARDWAREONLY we got if so we fail */
86  if ((pGUID) && (pGUID != (LPGUID)DDCREATE_HARDWAREONLY))
87  {
88  if (pGUID !=NULL)
89  {
90  This = newThis;
92  }
93  }
94 
95  /* step 3 do the link the old interface are store in the new one */
96  newThis->lpLink = This;
97 
98  /* step 4 we need create new local directdraw struct for the new linked interface */
99  DxHeapMemAlloc(newThis->lpLcl, sizeof(DDRAWI_DIRECTDRAW_LCL));
100  if (newThis->lpLcl == NULL)
101  {
102  This = newThis;
103  return DDERR_OUTOFMEMORY;
104  }
105 
106  This = newThis;
107  }
108 
109  This->lpLcl->lpGbl = &ddgbl;
110 
111  *pIface = (LPDIRECTDRAW)This;
112 
113  /* Get right interface we whant */
114 
115  This->lpVtbl = 0;
116  if (IsEqualGUID(&IID_IDirectDraw7, id))
117  {
118  /* DirectDraw7 Vtable */
119  This->lpVtbl = &DirectDraw7_Vtable;
120  This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags + DDRAWILCL_DIRECTDRAW7;
121  *pIface = (LPDIRECTDRAW)&This->lpVtbl;
123  }
124  else if (IsEqualGUID(&IID_IDirectDraw4, id))
125  {
126  /* DirectDraw4 Vtable */
127  This->lpVtbl = &DirectDraw4_Vtable;
128  *pIface = (LPDIRECTDRAW)&This->lpVtbl;
130  }
131  else if (IsEqualGUID(&IID_IDirectDraw2, id))
132  {
133  /* DirectDraw2 Vtable */
134  This->lpVtbl = &DirectDraw2_Vtable;
135  *pIface = (LPDIRECTDRAW)&This->lpVtbl;
137  }
138  else if (IsEqualGUID(&IID_IDirectDraw, id))
139  {
140  /* DirectDraw Vtable */
141  This->lpVtbl = &DirectDraw_Vtable;
142  *pIface = (LPDIRECTDRAW)&This->lpVtbl;
144  }
145 
146  if ( This->lpVtbl != 0)
147  {
148  DX_STUB_str("Got iface\n");
149 
150  if (StartDirectDraw((LPDIRECTDRAW)This, pGUID, FALSE) == DD_OK)
151  {
152  /*
153  RtlZeroMemory(&wnd_class, sizeof(wnd_class));
154  wnd_class.style = CS_HREDRAW | CS_VREDRAW;
155  wnd_class.lpfnWndProc = DefWindowProcW;
156  wnd_class.cbClsExtra = 0;
157  wnd_class.cbWndExtra = 0;
158  wnd_class.hInstance = GetModuleHandleW(0);
159  wnd_class.hIcon = 0;
160  wnd_class.hCursor = 0;
161  wnd_class.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
162  wnd_class.lpszMenuName = NULL;
163  wnd_class.lpszClassName = classname;
164  if(!RegisterClassW(&wnd_class))
165  {
166  DX_STUB_str("DDERR_GENERIC");
167  return DDERR_GENERIC;
168  }
169  */
170  This->lpLcl->hDD = ddgbl.hDD;
171  return DD_OK;
172  }
173  }
174 
175  return DDERR_INVALIDPARAMS;
176 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
#define TRUE
Definition: types.h:120
IDirectDrawVtbl DirectDraw_Vtable
Definition: ddraw_thunk.c:835
LPDDRAWI_DIRECTDRAW_LCL lpLcl
Definition: ddrawi.h:1148
#define DDCREATE_HARDWAREONLY
Definition: ddraw.h:198
#define DX_STUB_str(x)
Definition: rosdraw.h:254
DDRAWI_DIRECTDRAW_GBL ddgbl
Definition: startup.c:12
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
IDirectDraw2Vtbl DirectDraw2_Vtable
Definition: ddraw_thunk.c:862
_SEH2_TRY
Definition: create.c:4250
IDirectDraw4Vtbl DirectDraw4_Vtable
Definition: ddraw_thunk.c:890
#define DD_OK
Definition: ddraw.h:186
#define DDRAWILCL_DIRECTDRAW7
Definition: ddrawi.h:1211
unsigned int BOOL
Definition: ntddk_ex.h:94
struct IDirectDraw * LPDIRECTDRAW
Definition: ddraw.h:710
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
HRESULT WINAPI StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
Definition: startup.c:180
ULONG WINAPI Main_DirectDraw_AddRef(LPDDRAWI_DIRECTDRAW_INT This)
Definition: ddraw_main.c:145
LPDDRAWI_DIRECTDRAW_INT lpLink
Definition: ddrawi.h:1149
_SEH2_END
Definition: create.c:4424
#define DDERR_INVALIDDIRECTDRAWGUID
Definition: ddraw.h:135
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
struct _DDRAWI_DIRECTDRAW_INT * LPDDRAWI_DIRECTDRAW_INT
Definition: ddrawi.h:124
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
IDirectDraw7Vtbl DirectDraw7_Vtable
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

Referenced by DirectDrawCreate(), and DirectDrawCreateEx().

◆ DirectDrawClipper_AddRef()

ULONG WINAPI DirectDrawClipper_AddRef ( LPDIRECTDRAWCLIPPER  iface)

Definition at line 75 of file clipper_main.c.

76 {
78  if(!This)
79  return DDERR_INVALIDOBJECT;
80 
82 
83  if (iface!=NULL)
84  {
85  This->dwIntRefCnt++;
86  This->lpLcl->dwLocalRefCnt++;
87  if (This->lpLcl->lpGbl)
88  This->lpLcl->lpGbl->dwRefCnt++;
89  }
90  return This->dwIntRefCnt;
91 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:78
smooth NULL
Definition: ftsmooth.c:416
struct _DDRAWI_DDRAWCLIPPER_INT * LPDDRAWI_DDRAWCLIPPER_INT
Definition: ddrawi.h:145

◆ DirectDrawClipper_Initialize()

HRESULT WINAPI DirectDrawClipper_Initialize ( LPDIRECTDRAWCLIPPER  iface,
LPDIRECTDRAW  lpDD,
DWORD  dwFlags 
)

Definition at line 23 of file clipper_main.c.

25 {
28 
30 
31  if(!This)
32  return DDERR_INVALIDOBJECT;
33 
34  if(This->dwIntRefCnt)
36 
38  This->dwIntRefCnt = 1;
39 
41  //This->lpLcl->lpClipMore
42  This->lpLcl->lpDD_int = DDraw;
43  This->lpLcl->lpGbl->dwRefCnt = 1;
44  This->lpLcl->pAddrefedThisOwner = (IUnknown*)DDraw;
45 
46  // FIXME: Implement Linking and share global object
47  DxHeapMemAlloc(This->lpLcl->lpGbl, sizeof(DDRAWI_DDRAWCLIPPER_GBL));
48  This->lpLcl->lpGbl->dwProcessId = GetCurrentProcessId();
49 
50  return DD_OK;
51 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
IDirectDrawClipperVtbl DirectDrawClipper_Vtable
Definition: clipper_main.c:131
#define DD_OK
Definition: ddraw.h:186
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:78
#define DDERR_ALREADYINITIALIZED
Definition: ddraw.h:67
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
#define LPVOID
Definition: nt_native.h:45
struct _DDRAWI_DDRAWCLIPPER_INT * LPDDRAWI_DDRAWCLIPPER_INT
Definition: ddrawi.h:145
struct _DDRAWI_DIRECTDRAW_INT * LPDDRAWI_DIRECTDRAW_INT
Definition: ddrawi.h:124
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188

◆ Hal_DirectDraw_Release()

VOID Hal_DirectDraw_Release ( LPDIRECTDRAW7  )

◆ Internal_CreatePalette()

HRESULT Internal_CreatePalette ( LPDDRAWI_DIRECTDRAW_INT  pDDraw,
DWORD  dwFlags,
LPPALETTEENTRY  palent,
LPDIRECTDRAWPALETTE ppPalette,
LPUNKNOWN  pUnkOuter 
)

Definition at line 33 of file createpalette.c.

35 {
36  DDHAL_CREATEPALETTEDATA mDdCreatePalette = { 0 };
37 
38  LPDDRAWI_DDRAWPALETTE_INT ThisPalInt = NULL;
39  LPDDRAWI_DDRAWPALETTE_LCL ThisPalLcl = NULL;
40  LPDDRAWI_DDRAWPALETTE_GBL ThisPalGbl = NULL;
41 
42  HRESULT ret;
43 
44  if(pUnkOuter)
45  {
46  return CLASS_E_NOAGGREGATION;
47  }
48 
49  if(!(pDDraw->lpLcl->dwLocalFlags & DDRAWILCL_SETCOOPCALLED))
50  {
52  }
53 
54 
55  if (pDDraw->lpLcl->dwProcessId != GetCurrentProcessId() )
56  {
57  return DDERR_INVALIDOBJECT;
58  }
59 
60  /* Allocate the palette interface and needed members */
61  DxHeapMemAlloc(ThisPalInt, sizeof( DDRAWI_DDRAWPALETTE_INT ) );
62  if( ThisPalInt == NULL )
63  {
65  goto cleanup;
66  }
67 
68  DxHeapMemAlloc(ThisPalLcl, sizeof( DDRAWI_DDRAWPALETTE_LCL ) );
69  if( ThisPalLcl == NULL )
70  {
72  goto cleanup;
73  }
74 
75  DxHeapMemAlloc(ThisPalGbl, sizeof( DDRAWI_DDRAWPALETTE_GBL ) );
76  if( ThisPalGbl == NULL )
77  {
79  goto cleanup;
80  }
81 
82  /*Some initial setup*/
83 
84  ThisPalInt->lpLcl = ThisPalLcl;
85  ThisPalLcl->lpGbl = ThisPalGbl;
86 
87  ThisPalLcl->lpDD_lcl = ThisPalGbl->lpDD_lcl = pDDraw->lpLcl;
88  ThisPalGbl->dwFlags = ConvertPCapsFlags(dwFlags);
89 
90  ThisPalInt->lpVtbl = (PVOID)&DirectDrawPalette_Vtable;
91  ThisPalGbl->dwProcessId = GetCurrentProcessId();
92 
93  mDdCreatePalette.lpDD = pDDraw->lpLcl->lpGbl;
94  mDdCreatePalette.lpDDPalette = ThisPalGbl;
95  if(pDDraw->lpLcl->lpGbl->lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CREATEPALETTE) {
96  mDdCreatePalette.CreatePalette = pDDraw->lpLcl->lpGbl->lpDDCBtmp->HALDD.CreatePalette;
97  DX_STUB_str("Using HAL CreatePalette\n");
98  }
99  else {
100  mDdCreatePalette.CreatePalette = pDDraw->lpLcl->lpGbl->lpDDCBtmp->HELDD.CreatePalette;
101  DX_STUB_str("Using HEL CreatePalette\n");
102  }
103  mDdCreatePalette.ddRVal = DDERR_GENERIC;
104  mDdCreatePalette.lpColorTable = palent;
105 
106  if (mDdCreatePalette.CreatePalette(&mDdCreatePalette) == DDHAL_DRIVER_NOTHANDLED)
107  {
108  DX_STUB_str("mDdCreateSurface failed with DDHAL_DRIVER_NOTHANDLED.");
110  goto cleanup;
111  }
112 
113  if (mDdCreatePalette.ddRVal != DD_OK)
114  {
115  DX_STUB_str("mDdCreateSurface failed.");
116  ret = mDdCreatePalette.ddRVal;
117  goto cleanup;
118  }
119 
120  *ppPalette = (LPDIRECTDRAWPALETTE)ThisPalInt;
121  ThisPalInt->lpLink = pDDraw->lpLcl->lpGbl->palList;
122  pDDraw->lpLcl->lpGbl->palList = ThisPalInt;
123  ThisPalInt->lpLcl->dwReserved1 = (ULONG_PTR)pDDraw;
124  IDirectDrawPalette_AddRef(*ppPalette);
125 
126  return DD_OK;
127 
128 cleanup:
129  if(ThisPalInt) DxHeapMemFree(ThisPalInt);
130  if(ThisPalLcl) DxHeapMemFree(ThisPalLcl);
131  if(ThisPalGbl) DxHeapMemFree(ThisPalGbl);
132 
133  return ret;
134 }
LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
Definition: ddrawi.h:1651
LPDDRAWI_DIRECTDRAW_LCL lpLcl
Definition: ddrawi.h:1148
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
#define DX_STUB_str(x)
Definition: rosdraw.h:254
#define DDERR_NOTINITIALIZED
Definition: ddraw.h:185
LPDDRAWI_DDRAWPALETTE_INT lpLink
Definition: ddrawi.h:1541
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define DxHeapMemFree(p)
Definition: rosdraw.h:120
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:89
LPDDRAWI_DDRAWPALETTE_LCL lpLcl
Definition: ddrawi.h:1540
#define DDHAL_CB32_CREATEPALETTE
Definition: ddrawi.h:659
#define DD_OK
Definition: ddraw.h:186
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:78
smooth NULL
Definition: ftsmooth.c:416
DWORD ConvertPCapsFlags(DWORD dwFlags)
Definition: createpalette.c:11
void * PVOID
Definition: retypes.h:9
#define DDERR_GENERIC
Definition: ddraw.h:72
LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette
Definition: ddrawi.h:793
LPPALETTEENTRY lpColorTable
Definition: ddrawi.h:794
LONG HRESULT
Definition: typedefs.h:77
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
Definition: ddrawi.h:1548
LPDDRAWI_DDRAWPALETTE_GBL lpGbl
Definition: ddrawi.h:1643
LPDDHAL_CREATEPALETTE CreatePalette
Definition: ddrawi.h:796
#define ULONG_PTR
Definition: config.h:101
char * cleanup(char *str)
Definition: wpickclick.c:99
const IDirectDrawPaletteVtbl DirectDrawPalette_Vtable
Definition: palette.c:147
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188
struct IDirectDrawPalette * LPDIRECTDRAWPALETTE
Definition: ddraw.h:720
#define DDRAWILCL_SETCOOPCALLED
Definition: ddrawi.h:1196
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:792

Referenced by Main_DirectDraw_CreatePalette().

◆ Internal_CreateSurface()

HRESULT Internal_CreateSurface ( LPDDRAWI_DIRECTDRAW_INT  pDDraw,
LPDDSURFACEDESC2  pDDSD,
LPDDRAWI_DDRAWSURFACE_INT ppSurf,
IUnknown pUnkOuter 
)

Definition at line 18 of file createsurface.c.

20 {
21  DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface = { 0 };
22  DDHAL_CREATESURFACEDATA mDdCreateSurface = { 0 };
23 
24  LPDDRAWI_DDRAWSURFACE_INT ThisSurfInt;
25  LPDDRAWI_DDRAWSURFACE_LCL ThisSurfLcl;
26  LPDDRAWI_DDRAWSURFACE_GBL ThisSurfGbl;
27  LPDDRAWI_DDRAWSURFACE_MORE ThisSurfMore;
28 
29  LPDDRAWI_DDRAWSURFACE_INT * slist_int = NULL;
30  LPDDRAWI_DDRAWSURFACE_LCL * slist_lcl = NULL;
31  LPDDRAWI_DDRAWSURFACE_GBL * slist_gbl = NULL;
32  LPDDRAWI_DDRAWSURFACE_MORE * slist_more = NULL;
33  DWORD num_of_surf=1;
34  DWORD count;
35  HRESULT ret;
36 
37  if((pDDraw->lpLcl->dwLocalFlags & DDRAWILCL_SETCOOPCALLED) != DDRAWILCL_SETCOOPCALLED)
38  {
40  }
41 
42  if(pUnkOuter)
43  {
44  return CLASS_E_NOAGGREGATION;
45  }
46 
47  if(!(pDDSD->dwFlags & DDSD_CAPS))
48  {
49  return DDERR_INVALIDPARAMS;
50  }
51  if (pDDraw->lpLcl->dwProcessId != GetCurrentProcessId() )
52  {
53  return DDERR_INVALIDOBJECT;
54  }
55 
58  {
59  return DDERR_INVALIDCAPS;
60  }
61 
62  if((!(pDDSD->dwFlags & DDSD_HEIGHT) || !(pDDSD->dwFlags & DDSD_WIDTH))
63  && !(pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
64  {
65  return DDERR_INVALIDPARAMS;
66  }
67 
68  else if(((pDDSD->dwFlags & DDSD_HEIGHT) || (pDDSD->dwFlags & DDSD_WIDTH))
70  {
71  return DDERR_INVALIDPARAMS;
72  }
73 
74  /*
75  * program does not need set the DDSD_LPSURFACE,
76  * if they forget set it, the ddraw will automatic
77  * set it for system memory.
78  */
80  ((pDDSD->dwFlags & DDSD_LPSURFACE) != DDSD_LPSURFACE) )
81  {
82  pDDSD->dwFlags = pDDSD->dwFlags | DDSD_LPSURFACE;
83  }
84 
85  /* FIXME count how many surfaces we need */
86 
87  DxHeapMemAlloc(slist_int, num_of_surf * sizeof( LPDDRAWI_DDRAWSURFACE_INT ) );
88  if( slist_int == NULL)
89  {
91  goto cleanup;
92  }
93 
94  DxHeapMemAlloc(slist_lcl, num_of_surf * sizeof( LPDDRAWI_DDRAWSURFACE_LCL ) );
95  if( slist_lcl == NULL )
96  {
98  goto cleanup;
99  }
100 
101  /* keep pointers to all gbl surfs to be able to free them on error */
102  DxHeapMemAlloc(slist_gbl, num_of_surf * sizeof( LPDDRAWI_DDRAWSURFACE_GBL ) );
103  if( slist_gbl == NULL )
104  {
105  DxHeapMemFree(slist_int);
106  return DDERR_OUTOFMEMORY;
107  }
108 
109  /* keep pointers to all more surfs to be able to free them on error */
110  DxHeapMemAlloc(slist_more, num_of_surf * sizeof( LPDDRAWI_DDRAWSURFACE_MORE ) );
111  if( slist_more == NULL )
112  {
113  DxHeapMemFree(slist_int);
114  return DDERR_OUTOFMEMORY;
115  }
116 
117  for( count=0; count < num_of_surf; count++ )
118  {
119  /* Allocate the surface interface and needed members */
120  DxHeapMemAlloc(ThisSurfInt, sizeof( DDRAWI_DDRAWSURFACE_INT ) );
121  if( ThisSurfInt == NULL )
122  {
124  goto cleanup;
125  }
126 
127  DxHeapMemAlloc(ThisSurfLcl, sizeof( DDRAWI_DDRAWSURFACE_LCL ) );
128  if( ThisSurfLcl == NULL )
129  {
131  goto cleanup;
132  }
133 
134  DxHeapMemAlloc(ThisSurfGbl, sizeof( DDRAWI_DDRAWSURFACE_GBL ) );
135  if( ThisSurfGbl == NULL )
136  {
138  goto cleanup;
139  }
140 
141  DxHeapMemAlloc(ThisSurfMore, sizeof( DDRAWI_DDRAWSURFACE_MORE ) );
142  if( ThisSurfMore == NULL )
143  {
145  goto cleanup;
146  }
147 
148  /* setup lists, really needed are slist_lcl, slist_int
149  other slists should be released on return */
150 
151  slist_int[count] = ThisSurfInt;
152  slist_lcl[count] = ThisSurfLcl;
153  slist_gbl[count] = ThisSurfGbl;
154  slist_more[count] = ThisSurfMore;
155 
156  /* Start now fill in the member as they shall look like before call to createsurface */
157 
158  ThisSurfInt->lpLcl = ThisSurfLcl;
159  ThisSurfLcl->lpGbl = ThisSurfGbl;
160 
161  ThisSurfLcl->ddsCaps.dwCaps = pDDSD->ddsCaps.dwCaps;
162 
163  ThisSurfGbl->lpDD = pDDraw->lpLcl->lpGbl;
164  ThisSurfGbl->lpDDHandle = pDDraw->lpLcl->lpGbl;
165 
166  /* FIXME ? */
168 
170  {
171  ThisSurfGbl->wWidth = pDDraw->lpLcl->lpGbl->vmiData.dwDisplayWidth;
172  ThisSurfGbl->wHeight = pDDraw->lpLcl->lpGbl->vmiData.dwDisplayHeight;
173  ThisSurfGbl->lPitch = pDDraw->lpLcl->lpGbl->vmiData.lDisplayPitch;
174  ThisSurfGbl->dwLinearSize = pDDraw->lpLcl->lpGbl->vmiData.lDisplayPitch;
175 
176 
177  ThisSurfMore->dmiDDrawReserved7.wWidth = pDDraw->lpLcl->lpGbl->vmiData.dwDisplayWidth;
178  ThisSurfMore->dmiDDrawReserved7.wHeight = pDDraw->lpLcl->lpGbl->vmiData.dwDisplayHeight;
179  ThisSurfMore->dmiDDrawReserved7.wBPP = pDDraw->lpLcl->lpGbl->dwMonitorFrequency;
180 
181  /* FIXME ThisSurfaceMore->dmiDDrawReserved7.wMonitorsAttachedToDesktop */
183  pDDraw->lpLcl->lpPrimary = ThisSurfInt;
184  }
185  else
186  {
187  ThisSurfGbl->wWidth = (WORD)pDDSD->dwWidth;
188  ThisSurfGbl->wHeight = (WORD)pDDSD->dwHeight;
189  ThisSurfGbl->lPitch = pDDSD->lPitch;
190  ThisSurfGbl->dwLinearSize = pDDSD->lPitch;
191  }
192 
193  if(pDDraw->lpVtbl == &DirectDraw7_Vtable)
194  {
195  ThisSurfInt->lpVtbl = &DirectDrawSurface7_Vtable;
196  }
197  else if(pDDraw->lpVtbl == &DirectDraw4_Vtable)
198  {
199  ThisSurfInt->lpVtbl = &DirectDrawSurface4_Vtable;
200  }
201  else if(pDDraw->lpVtbl == &DirectDraw2_Vtable)
202  {
203  ThisSurfInt->lpVtbl = &DirectDrawSurface2_Vtable;
204  }
205  else if(pDDraw->lpVtbl == &DirectDraw_Vtable)
206  {
207  ThisSurfInt->lpVtbl = &DirectDrawSurface_Vtable;
208  }
209  else
210  {
212  goto cleanup;
213  }
214 
215  ThisSurfLcl->lpSurfMore = ThisSurfMore;
216  ThisSurfMore->dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE);
217  ThisSurfMore->lpDD_int = pDDraw;
218  ThisSurfMore->lpDD_lcl = pDDraw->lpLcl;
219  ThisSurfMore->slist = slist_lcl;
220 
221  ThisSurfLcl->dwProcessId = GetCurrentProcessId();
222 
223  /* FIXME the lpLnk */
224 
225  Main_DDrawSurface_AddRef(ThisSurfInt);
226  }
227 
228  pDDraw->lpLcl->lpGbl->dsList = (LPDDRAWI_DDRAWSURFACE_INT) slist_int;
229 
230  /* Fixme call on DdCanCreate then on DdCreateSurface createsurface data here */
231 
232  /* FIXME bIsDifferentPixelFormat being set to true or false with automatic detections */
233  mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE;
234 
235  mDdCanCreateSurface.lpDD = pDDraw->lpLcl->lpGbl;
236  mDdCanCreateSurface.CanCreateSurface = pDDraw->lpLcl->lpDDCB->HALDD.CanCreateSurface;
237  mDdCanCreateSurface.lpDDSurfaceDesc = (LPDDSURFACEDESC) pDDSD;
238  mDdCanCreateSurface.ddRVal = DDERR_GENERIC;
239 
240  if (mDdCanCreateSurface.CanCreateSurface(&mDdCanCreateSurface) == DDHAL_DRIVER_NOTHANDLED)
241  {
242  DX_STUB_str("mDdCanCreateSurface failed with DDHAL_DRIVER_NOTHANDLED.");
244  goto cleanup;
245  }
246 
247  if (mDdCanCreateSurface.ddRVal != DD_OK)
248  {
249  DX_STUB_str("mDdCanCreateSurface failed.");
250  ret = mDdCanCreateSurface.ddRVal;
251  goto cleanup;
252  }
253 
254  mDdCreateSurface.lpDD = pDDraw->lpLcl->lpGbl;
255  mDdCreateSurface.CreateSurface = pDDraw->lpLcl->lpGbl->lpDDCBtmp->HALDD.CreateSurface;
256  mDdCreateSurface.ddRVal = DDERR_GENERIC;
257  mDdCreateSurface.dwSCnt = num_of_surf;
258  mDdCreateSurface.lpDDSurfaceDesc = (LPDDSURFACEDESC) pDDSD;
259  mDdCreateSurface.lplpSList = slist_lcl;
260 
261  if (mDdCreateSurface.CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED)
262  {
263  DX_STUB_str("mDdCreateSurface failed with DDHAL_DRIVER_NOTHANDLED.");
265  goto cleanup;
266  }
267 
268  if (mDdCreateSurface.ddRVal != DD_OK)
269  {
270  DX_STUB_str("mDdCreateSurface failed.");
271  ret = mDdCreateSurface.ddRVal;
272  goto cleanup;
273  }
274 
275  /* free unneeded slists */
276  if (slist_more != NULL)
277  DxHeapMemFree(slist_more);
278  if (slist_gbl != NULL)
279  DxHeapMemFree(slist_gbl);
280 
281  *ppSurf = (LPDDRAWI_DDRAWSURFACE_INT) &slist_int[0]->lpVtbl;
282 
283  return DD_OK;
284 
285 cleanup:
286  for(count = 0; count < num_of_surf; count++)
287  {
288  if (slist_more[count] != NULL)
289  DxHeapMemFree(slist_more[count]);
290  if (slist_gbl[count] != NULL)
291  DxHeapMemFree(slist_gbl[count]);
292  if (slist_lcl[count] != NULL)
293  DxHeapMemFree(slist_lcl[count]);
294  if (slist_int[count] != NULL)
295  DxHeapMemFree(slist_int[count]);
296  }
297  if (slist_more != NULL)
298  DxHeapMemFree(slist_more);
299  if (slist_gbl != NULL)
300  DxHeapMemFree(slist_gbl);
301  if (slist_lcl != NULL)
302  DxHeapMemFree(slist_lcl);
303  if (slist_int != NULL)
304  DxHeapMemFree(slist_int);
305 
306  return ret;
307 }
LPDDSURFACEDESC lpDDSurfaceDesc
Definition: ddrawi.h:776
DWORD dwFlags
Definition: ddraw.h:1153
IDirectDrawVtbl DirectDraw_Vtable
Definition: ddraw_thunk.c:835
GLuint GLuint GLsizei count
Definition: gl.h:1545
LPDDRAWI_DIRECTDRAW_LCL lpLcl
Definition: ddrawi.h:1148
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
#define DDSD_LPSURFACE
Definition: ddrawex.h:22
LPDDRAWI_DIRECTDRAW_INT lpDD_int
Definition: ddrawi.h:1434
#define DX_STUB_str(x)
Definition: rosdraw.h:254
LPDDRAWI_DDRAWSURFACE_LCL lpLcl
Definition: ddrawi.h:1328
#define DDERR_NOTINITIALIZED
Definition: ddraw.h:185
DISPLAYMODEINFO dmiDDrawReserved7
Definition: ddrawi.h:1454
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:1346
IDirectDrawSurface2Vtbl DirectDrawSurface2_Vtable
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define DxHeapMemFree(p)
Definition: rosdraw.h:120
IDirectDraw2Vtbl DirectDraw2_Vtable
Definition: ddraw_thunk.c:862
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:89
IDirectDraw4Vtbl DirectDraw4_Vtable
Definition: ddraw_thunk.c:890
DWORD dwWidth
Definition: ddraw.h:1155
#define DD_OK
Definition: ddraw.h:186
#define DDSD_CAPS
Definition: ddraw.h:208
LPDDHAL_CANCREATESURFACE CanCreateSurface
Definition: ddrawi.h:788
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:78
struct _DDRAWI_DDRAWSURFACE_MORE DDRAWI_DDRAWSURFACE_MORE
IDirectDrawSurface4Vtbl DirectDrawSurface4_Vtable
#define DDSCAPS_SYSTEMMEMORY
Definition: ddraw.h:261
#define DDRAWISURFGBL_ISGDISURFACE
Definition: ddrawi.h:1363
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
BYTE wMonitorsAttachedToDesktop
Definition: ddrawi.h:1422
DWORD dwCaps
Definition: ddraw.h:732
smooth NULL
Definition: ftsmooth.c:416
LPDDRAWI_DDRAWSURFACE_LCL * slist
Definition: ddrawi.h:1461
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:264
#define DDERR_GENERIC
Definition: ddraw.h:72
#define DDSD_HEIGHT
Definition: ddraw.h:209
struct _DDRAWI_DDRAWSURFACE_INT * LPDDRAWI_DDRAWSURFACE_INT
Definition: ddrawi.h:132
struct _DDRAWI_DDRAWSURFACE_LCL FAR * LPDDRAWI_DDRAWSURFACE_LCL
Definition: d3dhal.h:45
IDirectDrawSurfaceVtbl DirectDrawSurface_Vtable
LPDDRAWI_DDRAWSURFACE_LCL * lplpSList
Definition: ddrawi.h:777
LONG HRESULT
Definition: typedefs.h:77
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
Definition: ddrawi.h:1431
int ret
ULONG WINAPI Main_DDrawSurface_AddRef(LPDDRAWI_DDRAWSURFACE_INT)
Definition: surface_main.c:40
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
DWORD dwHeight
Definition: ddraw.h:1154
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:775
LPDDSURFACEDESC lpDDSurfaceDesc
Definition: ddrawi.h:785
#define DDSD_WIDTH
Definition: ddraw.h:210
IDirectDrawSurface7Vtbl DirectDrawSurface7_Vtable
#define DDSCAPS_PRIMARYSURFACE
Definition: ddraw.h:258
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
char * cleanup(char *str)
Definition: wpickclick.c:99
IDirectDraw7Vtbl DirectDraw7_Vtable
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:784
void * LPDDSURFACEDESC
Definition: ddstream.idl:19
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188
#define DDRAWILCL_SETCOOPCALLED
Definition: ddrawi.h:1196
LPDDHAL_CREATESURFACE CreateSurface
Definition: ddrawi.h:780

Referenced by Main_DirectDraw_CreateSurface(), and Main_DirectDraw_CreateSurface4().

◆ ReCreateDirectDraw()

HRESULT WINAPI ReCreateDirectDraw ( LPDIRECTDRAW  iface)

◆ ReleaseDDThreadLock()

VOID WINAPI ReleaseDDThreadLock ( VOID  )

◆ StartDirectDraw()

HRESULT WINAPI StartDirectDraw ( LPDIRECTDRAW  iface,
LPGUID  pGUID,
BOOL  reenable 
)

Definition at line 180 of file startup.c.

181 {
183  DWORD hal_ret = DD_FALSE;
184  DWORD hel_ret = DD_FALSE;
185  DWORD devicetypes = 0;
186  DWORD dwFlags = 0;
187 
188 
189  DX_WINDBG_trace();
190 
191 
192  /*
193  * ddgbl.dwPDevice is not longer in use in windows 2000 and higher
194  * I am using it for device type
195  * devicetypes = 1 : both hal and hel are enable
196  * devicetypes = 2 : both hal are enable
197  * devicetypes = 3 : both hel are enable
198  * devicetypes = 4 :loading a guid drv from the register
199  */
200 
202  ddgbl.hDDVxd = -1;
203 
204  if (reenable == FALSE)
205  {
206  if ((!IsBadReadPtr(This->lpLink,sizeof(LPDIRECTDRAW))) && (This->lpLink == NULL))
207  {
209  This->lpLcl->lpGbl->dwRefCnt++;
210  if (ddgbl.lpDDCBtmp == NULL)
211  {
212  // LPDDHAL_CALLBACKS
214  if (ddgbl.lpDDCBtmp == NULL)
215  {
216  DX_STUB_str("Out of memory\n");
217  return DD_FALSE;
218  }
219  }
220  }
221 
223  if (!ddgbl.lpModeInfo)
224  {
225  return DDERR_OUTOFMEMORY;
226  }
227 
228  }
229  /* Windows handler are by set of SetCooperLevel
230  * so do not set it
231  */
232 
233  if (reenable == FALSE)
234  {
235  if (lpGuid == NULL)
236  {
237  devicetypes= 1;
238 
239  /* Create HDC for default, hal and hel driver */
240  // This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow();
241  This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL);
242 
243  /* cObsolete is undoc in msdn it being use in CreateDCA */
244  RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7);
245  RtlCopyMemory(&ddgbl.cDriverName,&"DISPLAY",7);
247  }
248  else if (lpGuid == (LPGUID) DDCREATE_HARDWAREONLY)
249  {
250  devicetypes = 2;
251  /* Create HDC for default, hal driver */
252  // This->lpLcl->hWnd =(ULONG_PTR) GetActiveWindow();
253  This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL);
254 
255  /* cObsolete is undoc in msdn it being use in CreateDCA */
256  RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7);
257  RtlCopyMemory(&ddgbl.cDriverName,&"DISPLAY",7);
259  }
260  else if (lpGuid == (LPGUID) DDCREATE_EMULATIONONLY)
261  {
262  devicetypes = 3;
263 
264  /* Create HDC for default, hal and hel driver */
265  //This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow();
266  This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL);
267 
268  /* cObsolete is undoc in msdn it being use in CreateDCA */
269  RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7);
270  RtlCopyMemory(&ddgbl.cDriverName,&"DISPLAY",7);
271 
273  }
274  else
275  {
276  /* FIXME : need getting driver from the GUID that have been pass in from
277  * the register. we do not support that yet
278  */
279  devicetypes = 4;
280  //This->lpLcl->hDC = (ULONG_PTR) NULL ;
281  //This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL);
282  }
283 
284  /*
285  if ( (HDC)This->lpLcl->hDC == NULL)
286  {
287  DX_STUB_str("DDERR_OUTOFMEMORY\n");
288  return DDERR_OUTOFMEMORY ;
289  }
290  */
291  }
292 
293  This->lpLcl->lpDDCB = ddgbl.lpDDCBtmp;
294 
295  /* Startup HEL and HAL */
296  This->lpLcl->lpDDCB = This->lpLcl->lpGbl->lpDDCBtmp;
297  This->lpLcl->dwProcessId = GetCurrentProcessId();
298  switch (devicetypes)
299  {
300  case 2:
301  hal_ret = StartDirectDrawHal(iface, reenable);
302  This->lpLcl->lpDDCB->HELDD.dwFlags = 0;
303  break;
304 
305  case 3:
306  hel_ret = StartDirectDrawHel(iface, reenable);
307  This->lpLcl->lpDDCB->HALDD.dwFlags = 0;
308  break;
309 
310  default:
311  hal_ret = StartDirectDrawHal(iface, reenable);
312  hel_ret = StartDirectDrawHel(iface, reenable);
313  break;
314  }
315 
316  if (hal_ret!=DD_OK)
317  {
318  if (hel_ret!=DD_OK)
319  {
320  DX_STUB_str("DDERR_NODIRECTDRAWSUPPORT\n");
322  }
324  DX_STUB_str("No hardware support\n");
325  }
326 
327  if (hel_ret!=DD_OK)
328  {
330 
331  }
332  else
333  {
335  }
336 
337  /* Fill some basic info for Surface */
338  This->lpLcl->lpGbl->dwFlags = This->lpLcl->lpGbl->dwFlags | dwFlags | DDRAWI_ATTACHEDTODESKTOP;
339  This->lpLcl->lpDDCB = This->lpLcl->lpGbl->lpDDCBtmp;
340  This->lpLcl->hDD = ddgbl.hDD;
341 
342  ddgbl.rectDevice.top = 0;
343  ddgbl.rectDevice.left = 0;
346 
347  ddgbl.rectDesktop.top = 0;
348  ddgbl.rectDesktop.left = 0;
351 
362 
363  return DD_OK;
364 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
DWORD dwHeight
Definition: ddrawi.h:172
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define DDCREATE_EMULATIONONLY
Definition: ddraw.h:199
HRESULT WINAPI StartDirectDrawHel(LPDIRECTDRAW iface, BOOL reenable)
Definition: startup.c:368
WORD wRefreshRate
Definition: ddrawi.h:176
#define DDCREATE_HARDWAREONLY
Definition: ddraw.h:198
LONG top
Definition: windef.h:292
#define DX_STUB_str(x)
Definition: rosdraw.h:254
DDRAWI_DIRECTDRAW_GBL ddgbl
Definition: startup.c:12
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
LONG left
Definition: windef.h:291
#define DDRAWI_ATTACHEDTODESKTOP
Definition: ddrawi.h:1317
LONG right
Definition: windef.h:293
DWORD dwAlphaBitMask
Definition: ddrawi.h:180
DWORD dwBBitMask
Definition: ddrawi.h:179
DWORD dwDisplayHeight
Definition: ddrawi.h:219
#define DD_OK
Definition: ddraw.h:186
#define VREFRESH
Definition: wingdi.h:740
#define DDERR_NODIRECTDRAWSUPPORT
Definition: ddraw.h:92
struct IDirectDraw * LPDIRECTDRAW
Definition: ddraw.h:710
#define DDRAWI_NOHARDWARE
Definition: ddrawi.h:1301
DWORD dwGBitMask
Definition: ddraw.h:1094
smooth NULL
Definition: ftsmooth.c:416
DWORD dwWidth
Definition: ddrawi.h:171
DWORD dwRGBBitCount
Definition: ddraw.h:1075
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
DWORD dwBPP
Definition: ddrawi.h:174
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwRBitMask
Definition: ddraw.h:1085
#define DDRAWI_EMULATIONINITIALIZED
Definition: ddrawi.h:1307
DWORD dwDisplayWidth
Definition: ddrawi.h:218
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
VIDMEMINFO vmiData
Definition: ddrawi.h:1236
#define DD_FALSE
Definition: ddraw.h:187
LPDDHALMODEINFO lpModeInfo
Definition: ddrawi.h:1244
HRESULT WINAPI StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
Definition: startup.c:458
DWORD dwRBitMask
Definition: ddrawi.h:177
DWORD dwBBitMask
Definition: ddraw.h:1106
DWORD dwGBitMask
Definition: ddrawi.h:178
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:807
HDC WINAPI GetWindowDC(_In_opt_ HWND)
LONG lPitch
Definition: ddrawi.h:173
LONG bottom
Definition: windef.h:294
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
struct _DDRAWI_DIRECTDRAW_INT * LPDDRAWI_DIRECTDRAW_INT
Definition: ddrawi.h:124
LPDDHAL_CALLBACKS lpDDCBtmp
Definition: ddrawi.h:1224
LONG lDisplayPitch
Definition: ddrawi.h:220
char cDriverName[MAX_DRIVER_NAME]
Definition: ddrawi.h:1284
#define DDRAWI_DISPLAYDRV
Definition: ddrawi.h:1298
#define DDRAWI_NOEMULATION
Definition: ddrawi.h:1303
DDPIXELFORMAT ddpfDisplay
Definition: ddrawi.h:221
HDC WINAPI CreateDCA(_In_opt_ LPCSTR pszDriver, _In_opt_ LPCSTR pszDevice, _In_opt_ LPCSTR pszOutput, _In_opt_ const DEVMODEA *pdmInit)
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188
DWORD dwRGBAlphaBitMask
Definition: ddraw.h:1113
#define DDRAWI_GDIDRV
Definition: ddrawi.h:1316

Referenced by Create_DirectDraw(), Main_DirectDraw_RestoreDisplayMode(), and Main_DirectDraw_SetDisplayMode2().

◆ StartDirectDrawHal()

HRESULT WINAPI StartDirectDrawHal ( LPDIRECTDRAW  iface,
BOOL  reenable 
)

Definition at line 458 of file startup.c.

459 {
462  BOOL newmode = FALSE;
469 
470  DX_WINDBG_trace();
471 
472  RtlZeroMemory(&mHALInfo, sizeof(DDHALINFO));
476 
477  if (reenable == FALSE)
478  {
479  if (ddgbl.lpDDCBtmp == NULL)
480  {
482  if ( ddgbl.lpDDCBtmp == NULL)
483  {
484  return DD_FALSE;
485  }
486  }
487  }
488  else
489  {
491  }
492 
493  /*
494  * Startup DX HAL step one of three
495  */
496  if (!DdCreateDirectDrawObject(This->lpLcl->lpGbl, (HDC)This->lpLcl->hDC))
497  {
499  return DD_FALSE;
500  }
501 
502  /* Some card disable the dx after it have been created so
503  * we are force reenabling it
504  */
505  if (!DdReenableDirectDrawObject(This->lpLcl->lpGbl, &newmode))
506  {
508  return DD_FALSE;
509  }
510 
511  if (!DdQueryDirectDrawObject(This->lpLcl->lpGbl,
512  &mHALInfo,
516  &mD3dCallbacks,
519  NULL,
520  mpFourCC,
521  NULL))
522  {
523  DxHeapMemFree(This->lpLcl->lpGbl->lpModeInfo);
525  // FIXME Close DX first and second call
526  return DD_FALSE;
527  }
528 
529  /* Alloc mpFourCC */
530  if (This->lpLcl->lpGbl->lpdwFourCC != NULL)
531  {
532  DxHeapMemFree(This->lpLcl->lpGbl->lpdwFourCC);
533  }
534 
536  {
537 
539 
540  if (mpFourCC == NULL)
541  {
543  // FIXME Close DX first and second call
544  return DD_FALSE;
545  }
546  }
547 
548  /* Alloc mpTextures */
549 #if 0
550  DX_STUB_str("1 Here\n");
551 
552  if (This->lpLcl->lpGbl->texture != NULL)
553  {
554  DxHeapMemFree(This->lpLcl->lpGbl->texture;
555  }
556 
557  mpTextures = NULL;
559  {
560  mpTextures = (DDSURFACEDESC*) DxHeapMemAlloc(sizeof(DDSURFACEDESC) * mD3dDriverData.dwNumTextureFormats);
561  if (mpTextures == NULL)
562  {
563  DxHeapMemFree(mpFourCC);
564  DxHeapMemFree(ddgbl.lpDDCBtmp);
565  // FIXME Close DX first and second call
566  }
567  }
568 
569  DX_STUB_str("2 Here\n");
570 
571 #else
572  mpTextures = NULL;
573 #endif
574 
575 
576  /* Get all basic data from the driver */
578  This->lpLcl->lpGbl,
579  &mHALInfo,
583  &mD3dCallbacks,
587  mpFourCC,
588  NULL))
589  {
593  // FIXME Close DX first and second call
594  return DD_FALSE;
595  }
596 
598 
599 
601 
602  This->lpLcl->lpGbl->dwNumFourCC = mHALInfo.ddCaps.dwNumFourCCCodes;
603  This->lpLcl->lpGbl->lpdwFourCC = mpFourCC;
604  // This->lpLcl->lpGbl->dwMonitorFrequency = mHALInfo.dwMonitorFrequency; // 0
605  This->lpLcl->lpGbl->dwModeIndex = mHALInfo.dwModeIndex;
606  // This->lpLcl->lpGbl->dwNumModes = mHALInfo.dwNumModes;
607  // This->lpLcl->lpGbl->lpModeInfo = mHALInfo.lpModeInfo;
608 
609  /* FIXME convert mpTextures to DDHALMODEINFO */
610  // DxHeapMemFree( mpTextures);
611 
612  /* FIXME D3D setup mD3dCallbacks and mD3dDriverData */
613 
614 
615 
616 
618  {
619  DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
620  DdGetDriverInfo.guidInfo = GUID_MiscellaneousCallbacks;
623 
625  {
629  // FIXME Close DX fristcall and second call
630  return DD_FALSE;
631  }
632 
634  DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
635  DdGetDriverInfo.guidInfo = GUID_Miscellaneous2Callbacks;
636 
637  /* FIXME
638  DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->HALDDMiscellaneous;
639  DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUS2CALLBACKS);
640 
641  if(mHALInfo.GetDriverInfo (&DdGetDriverInfo) == DDHAL_DRIVER_NOTHANDLED || DdGetDriverInfo.ddRVal != DD_OK)
642  {
643  DxHeapMemFree(mpFourCC);
644  DxHeapMemFree(mpTextures);
645  DxHeapMemFree(ddgbl.lpDDCBtmp);
646  // FIXME Close DX fristcall and second call
647  return DD_FALSE;
648  }
649  DD_MISCELLANEOUS2CALLBACKS
650  {
651  DWORD dwSize;
652  DWORD dwFlags;
653  PDD_ALPHABLT AlphaBlt; // unsuse according to msdn and always set to NULL
654  PDD_CREATESURFACEEX CreateSurfaceEx;
655  PDD_GETDRIVERSTATE GetDriverState;
656  PDD_DESTROYDDLOCAL DestroyDDLocal;
657  }
658  DDHAL_MISC2CB32_CREATESURFACEEX
659  DDHAL_MISC2CB32_GETDRIVERSTATE
660  DDHAL_MISC2CB32_DESTROYDDLOCAL
661  */
662  }
663 
665  {
666  This->lpLcl->lpGbl->dwFlags = This->lpLcl->lpGbl->dwFlags | DDRAWI_DRIVERINFO2;
667  }
668 
669 
670  return DD_OK;
671 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
DDHAL_DDMISCELLANEOUSCALLBACKS HALDDMiscellaneous
Definition: ddrawi.h:749
DWORD dwNumFourCCCodes
Definition: ddrawi.h:270
DDSURFACEDESC * mpTextures
Definition: main.c:29
D3DHAL_GLOBALDRIVERDATA mD3dDriverData
Definition: main.c:17
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define DDHALINFO_GETDRIVERINFO2
Definition: ddrawi.h:668
VIDMEMINFO vmiData
Definition: ddrawi.h:611
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
static HDC
Definition: imagelist.c:92
#define DX_STUB_str(x)
Definition: rosdraw.h:254
DDRAWI_DIRECTDRAW_GBL ddgbl
Definition: startup.c:12
#define DxHeapMemFree(p)
Definition: rosdraw.h:120
#define DDRAWI_DRIVERINFO2
Definition: ddrawi.h:1322
#define DD_OK
Definition: ddraw.h:186
DDHAL_DDPALETTECALLBACKS HALDDPalette
Definition: ddrawi.h:737
#define DdReenableDirectDrawObject
Definition: ddrawgdi.h:33
DDCORECAPS ddCaps
Definition: ddrawi.h:1221
unsigned int BOOL
Definition: ntddk_ex.h:94
DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks
Definition: main.c:15
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
DDHALINFO mHALInfo
Definition: main.c:12
#define DdQueryDirectDrawObject
Definition: ddrawgdi.h:25
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DDHALINFO_GETDRIVERINFOSET
Definition: ddrawi.h:667
DWORD dwFlags
Definition: ddrawi.h:619
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
VIDMEMINFO vmiData
Definition: ddrawi.h:1236
#define DdCreateDirectDrawObject
Definition: ddrawgdi.h:24
#define DD_FALSE
Definition: ddraw.h:187
DDHAL_DDSURFACECALLBACKS HALDDSurface
Definition: ddrawi.h:736
DDHAL_DDCALLBACKS HALDD
Definition: ddrawi.h:735
DWORD WINAPI DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA pData)
Definition: gdientry.c:898
DWORD * mpFourCC
Definition: main.c:26
DWORD dwModeIndex
Definition: ddrawi.h:615
DDHAL_DDEXEBUFCALLBACKS HALDDExeBuf
Definition: ddrawi.h:742
uint32_t * LPDWORD
Definition: typedefs.h:57
D3DHAL_CALLBACKS mD3dCallbacks
Definition: main.c:16
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
struct _DDRAWI_DIRECTDRAW_INT * LPDDRAWI_DIRECTDRAW_INT
Definition: ddrawi.h:124
LPDDHAL_CALLBACKS lpDDCBtmp
Definition: ddrawi.h:1224
LPDDHAL_GETDRIVERINFO GetDriverInfo
Definition: ddrawi.h:614
struct _DDHAL_GETDRIVERINFODATA DDHAL_GETDRIVERINFODATA
DDCORECAPS ddCaps
Definition: ddrawi.h:612

Referenced by StartDirectDraw().

◆ StartDirectDrawHel()

HRESULT WINAPI StartDirectDrawHel ( LPDIRECTDRAW  iface,
BOOL  reenable 
)

Definition at line 368 of file startup.c.

369 {
371 
372  if (reenable == FALSE)
373  {
374  if (ddgbl.lpDDCBtmp == NULL)
375  {
377  if ( ddgbl.lpDDCBtmp == NULL)
378  {
379  return DD_FALSE;
380  }
381  }
382  }
383 
394 
405 
406  ddgbl.lpDDCBtmp->HELDD.dwSize = sizeof(This->lpLcl->lpDDCB->HELDD);
407 
436 
437  ddgbl.lpDDCBtmp->HELDDSurface.dwSize = sizeof(This->lpLcl->lpDDCB->HELDDSurface);
438 
439  /*
440  This->lpLcl->lpDDCB->HELDDPalette.DestroyPalette = HelDdPalDestroyPalette;
441  This->lpLcl->lpDDCB->HELDDPalette.SetEntries = HelDdPalSetEntries;
442  This->lpLcl->lpDDCB->HELDDPalette.dwSize = sizeof(This->lpLcl->lpDDCB->HELDDPalette);
443  */
444 
445  /*
446  This->lpLcl->lpDDCB->HELDDExeBuf.CanCreateExecuteBuffer = HelDdExeCanCreateExecuteBuffer;
447  This->lpLcl->lpDDCB->HELDDExeBuf.CreateExecuteBuffer = HelDdExeCreateExecuteBuffer;
448  This->lpLcl->lpDDCB->HELDDExeBuf.DestroyExecuteBuffer = HelDdExeDestroyExecuteBuffer;
449  This->lpLcl->lpDDCB->HELDDExeBuf.LockExecuteBuffer = HelDdExeLockExecuteBuffer;
450  This->lpLcl->lpDDCB->HELDDExeBuf.UnlockExecuteBuffer = HelDdExeUnlockExecuteBuffer;
451  */
452 
453  return DD_OK;
454 }
LPDDHALSURFCB_GETBLTSTATUS GetBltStatus
Definition: ddrawi.h:401
DWORD CALLBACK HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine)
LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition
Definition: ddrawi.h:404
DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface)
LPDDHAL_DESTROYDRIVER DestroyDriver
Definition: ddrawi.h:349
#define DDHAL_SURFCB32_SETCLIPLIST
Definition: ddrawi.h:676
LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus
Definition: ddrawi.h:402
LPDDHALSURFCB_SETPALETTE SetPalette
Definition: ddrawi.h:406
DDHAL_DDSURFACECALLBACKS HELDDSurface
Definition: ddrawi.h:739
DWORD CALLBACK HelDdSurfGetFlipStatus(LPDDHAL_GETFLIPSTATUSDATA lpGetFlipStatusData)
#define DDHAL_CB32_SETCOLORKEY
Definition: ddrawi.h:655
DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface)
#define DDHAL_SURFCB32_UPDATEOVERLAY
Definition: ddrawi.h:684
DDRAWI_DIRECTDRAW_GBL ddgbl
Definition: startup.c:12
DWORD CALLBACK HelDdSurfLock(LPDDHAL_LOCKDATA lpLockData)
#define DDHAL_CB32_CANCREATESURFACE
Definition: ddrawi.h:658
LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode
Definition: ddrawi.h:358
#define DDHAL_SURFCB32_FLIP
Definition: ddrawi.h:675
LPDDHAL_SETMODE SetMode
Definition: ddrawi.h:352
DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOverLayData)
DWORD CALLBACK HelDdSurfreserved4(DWORD *lpPtr)
DWORD CALLBACK HelDdSurfUnlock(LPDDHAL_UNLOCKDATA lpUnLockData)
#define DDHAL_CB32_CREATEPALETTE
Definition: ddrawi.h:659
LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank
Definition: ddrawi.h:353
#define DDHAL_SURFCB32_SETCOLORKEY
Definition: ddrawi.h:680
#define DD_OK
Definition: ddraw.h:186
#define DDHAL_SURFCB32_GETFLIPSTATUS
Definition: ddrawi.h:683
#define DDHAL_SURFCB32_DESTROYSURFACE
Definition: ddrawi.h:674
#define DDHAL_SURFCB32_BLT
Definition: ddrawi.h:679
DWORD CALLBACK HelDdSurfSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKeyData)
#define DDHAL_SURFCB32_LOCK
Definition: ddrawi.h:677
smooth NULL
Definition: ftsmooth.c:416
DWORD CALLBACK HelDdSurfGetBltStatus(LPDDHAL_GETBLTSTATUSDATA lpGetBltStatusData)
LPDDHALSURFCB_SETCLIPLIST SetClipList
Definition: ddrawi.h:395
DWORD CALLBACK HelDdSurfFlip(LPDDHAL_FLIPDATA lpFlipData)
DWORD CALLBACK HelDdSurfSetClipList(LPDDHAL_SETCLIPLISTDATA lpSetClipListData)
LPDDHALSURFCB_UNLOCK Unlock
Definition: ddrawi.h:397
#define DDHAL_CB32_GETSCANLINE
Definition: ddrawi.h:660
DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
DWORD CALLBACK HelDdSurfDestroySurface(LPDDHAL_DESTROYSURFACEDATA lpDestroySurfaceData)
LPDDHALSURFCB_LOCK Lock
Definition: ddrawi.h:396
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
LPDDHAL_CREATESURFACE CreateSurface
Definition: ddrawi.h:350
LPDDHAL_GETSCANLINE GetScanLine
Definition: ddrawi.h:356
DWORD CALLBACK HelDdSurfSetOverlayPosition(LPDDHAL_SETOVERLAYPOSITIONDATA lpSetOverlayPositionData)
LPDDHALSURFCB_SETCOLORKEY SetColorKey
Definition: ddrawi.h:399
DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode)
#define DDHAL_SURFCB32_SETPALETTE
Definition: ddrawi.h:687
#define DDHAL_SURFCB32_SETOVERLAYPOSITION
Definition: ddrawi.h:685
LPDDHAL_CANCREATESURFACE CanCreateSurface
Definition: ddrawi.h:354
#define DDHAL_SURFCB32_GETBLTSTATUS
Definition: ddrawi.h:682
DWORD CALLBACK HelDdSurfAddAttachedSurface(LPDDHAL_ADDATTACHEDSURFACEDATA lpDestroySurface)
#define DDHAL_CB32_SETEXCLUSIVEMODE
Definition: ddrawi.h:661
#define DD_FALSE
Definition: ddraw.h:187
DWORD CALLBACK HelDdSurfBlt(LPDDHAL_BLTDATA lpBltData)
LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface
Definition: ddrawi.h:400
LPDDHAL_CREATEPALETTE CreatePalette
Definition: ddrawi.h:355
DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode)
DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver)
#define DDHAL_CB32_SETMODE
Definition: ddrawi.h:656
#define DDHAL_CB32_WAITFORVERTICALBLANK
Definition: ddrawi.h:657
LPDDHALSURFCB_DESTROYSURFACE DestroySurface
Definition: ddrawi.h:393
LPDDHAL_SETCOLORKEY SetColorKey
Definition: ddrawi.h:351
DWORD CALLBACK HelDdSetColorKey(LPDDHAL_DRVSETCOLORKEYDATA lpDrvSetColorKey)
DWORD CALLBACK HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette)
#define DDHAL_SURFCB32_RESERVED4
Definition: ddrawi.h:686
LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface
Definition: ddrawi.h:359
#define DDHAL_SURFCB32_ADDATTACHEDSURFACE
Definition: ddrawi.h:681
#define DDHAL_CB32_CREATESURFACE
Definition: ddrawi.h:654
DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface)
struct _DDRAWI_DIRECTDRAW_INT * LPDDRAWI_DIRECTDRAW_INT
Definition: ddrawi.h:124
LPDDHALSURFCB_BLT Blt
Definition: ddrawi.h:398
LPDDHAL_CALLBACKS lpDDCBtmp
Definition: ddrawi.h:1224
LPDDHALSURFCB_FLIP Flip
Definition: ddrawi.h:394
#define DDHAL_SURFCB32_UNLOCK
Definition: ddrawi.h:678
#define DDHAL_CB32_DESTROYDRIVER
Definition: ddrawi.h:653
DDHAL_DDCALLBACKS HELDD
Definition: ddrawi.h:738
DWORD CALLBACK HelDdSurfSetPalette(LPDDHAL_SETPALETTEDATA lpSetPaletteData)
LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay
Definition: ddrawi.h:403
#define DDHAL_CB32_FLIPTOGDISURFACE
Definition: ddrawi.h:662

Referenced by StartDirectDraw().

Variable Documentation

◆ classname

◆ ddcs

◆ ddgbl

◆ ddSurfGbl

Definition at line 13 of file startup.c.

◆ DirectDraw2_Vtable

IDirectDraw2Vtbl DirectDraw2_Vtable

◆ DirectDraw4_Vtable

◆ DirectDraw7_Vtable

◆ DirectDraw_Vtable

IDirectDrawVtbl DirectDraw_Vtable

◆ DirectDrawClipper_Vtable

IDirectDrawClipperVtbl DirectDrawClipper_Vtable

Definition at line 131 of file clipper_main.c.

Referenced by DirectDrawClipper_Initialize().

◆ DirectDrawColorControl_Vtable

IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable

Definition at line 58 of file color_stubs.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ DirectDrawGammaControl_Vtable

IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable

Definition at line 60 of file gamma_stubs.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ DirectDrawKernel_Vtable

IDirectDrawKernelVtbl DirectDrawKernel_Vtable

Definition at line 114 of file kernel_stubs.c.

◆ DirectDrawPalette_Vtable

const IDirectDrawPaletteVtbl DirectDrawPalette_Vtable

Definition at line 147 of file palette.c.

Referenced by Internal_CreatePalette().

◆ DirectDrawSurface2_Vtable

IDirectDrawSurface2Vtbl DirectDrawSurface2_Vtable

◆ DirectDrawSurface3_Vtable

IDirectDrawSurface3Vtbl DirectDrawSurface3_Vtable

Definition at line 62 of file DirectDrawSurface3_Vtable.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ DirectDrawSurface4_Vtable

IDirectDrawSurface4Vtbl DirectDrawSurface4_Vtable

◆ DirectDrawSurface7_Vtable

IDirectDrawSurface7Vtbl DirectDrawSurface7_Vtable

◆ DirectDrawSurface_Vtable

IDirectDrawSurfaceVtbl DirectDrawSurface_Vtable

◆ DirectDrawSurfaceKernel_Vtable

IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable

Definition at line 123 of file kernel_stubs.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ IDirect3D2_Vtbl

IDirect3D2Vtbl IDirect3D2_Vtbl

Definition at line 28 of file DirectD3D2_Vtable.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ IDirect3D3_Vtbl

IDirect3D3Vtbl IDirect3D3_Vtbl

Definition at line 31 of file DirectD3D3_Vtable.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ IDirect3D7_Vtbl

IDirect3D7Vtbl IDirect3D7_Vtbl

Definition at line 27 of file DirectD3D7_Vtable.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ IDirect3D_Vtbl

IDirect3DVtbl IDirect3D_Vtbl

Definition at line 28 of file DirectD3D_Vtable.c.

Referenced by Main_DDrawSurface_QueryInterface().

◆ wnd_class

WNDCLASSW wnd_class

Definition at line 16 of file startup.c.

Referenced by test_IME().