ReactOS  0.4.14-dev-49-gfb4591c
startup.c File Reference
#include "rosdraw.h"
Include dependency graph for startup.c:

Go to the source code of this file.

Functions

HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW *pIface, REFIID id, BOOL reenable)
 
HRESULT WINAPI StartDirectDraw (LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
 
HRESULT WINAPI StartDirectDrawHel (LPDIRECTDRAW iface, BOOL reenable)
 
HRESULT WINAPI StartDirectDrawHal (LPDIRECTDRAW iface, BOOL reenable)
 

Variables

DDRAWI_DIRECTDRAW_GBL ddgbl
 
DDRAWI_DDRAWSURFACE_GBL ddSurfGbl
 
WCHAR classname [128]
 
WNDCLASSW wnd_class
 

Function Documentation

◆ Create_DirectDraw()

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

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().

◆ StartDirectDraw()

HRESULT WINAPI StartDirectDraw ( LPDIRECTDRAW  iface,
LPGUID  lpGuid,
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:1158
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

◆ ddgbl

◆ ddSurfGbl

Definition at line 13 of file startup.c.

◆ wnd_class

WNDCLASSW wnd_class

Definition at line 16 of file startup.c.

Referenced by test_IME().