1 /* $Id: main.c 21434 2006-04-01 19:12:56Z greatlrd $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: lib/ddraw/ddraw.c
6 * PURPOSE: DirectDraw Library
7 * PROGRAMMER: Magnus Olsen (greatlrd)
14 DDRAWI_DIRECTDRAW_GBL ddgbl
;
15 DDRAWI_DDRAWSURFACE_GBL ddSurfGbl
;
22 Create_DirectDraw (LPGUID pGUID
, LPDIRECTDRAW
* pIface
,
25 LPDDRAWI_DIRECTDRAW_INT This
;
29 if ((IsBadReadPtr(pIface
,sizeof(LPDIRECTDRAW
))) ||
30 (IsBadWritePtr(pIface
,sizeof(LPDIRECTDRAW
))))
32 return DDERR_INVALIDPARAMS
;
35 This
= (LPDDRAWI_DIRECTDRAW_INT
)*pIface
;
37 /* fixme linking too second link when we shall not doing it */
38 if (IsBadReadPtr(This
,sizeof(LPDIRECTDRAW
)))
40 /* We do not have a DirectDraw interface, we need alloc it*/
41 LPDDRAWI_DIRECTDRAW_INT memThis
;
43 DX_STUB_str("1. no linking\n");
45 DxHeapMemAlloc(memThis
, sizeof(DDRAWI_DIRECTDRAW_INT
));
48 return DDERR_OUTOFMEMORY
;
53 /* Fixme release memory alloc if we fail */
55 DxHeapMemAlloc(This
->lpLcl
, sizeof(DDRAWI_DIRECTDRAW_LCL
));
56 if (This
->lpLcl
== NULL
)
58 return DDERR_OUTOFMEMORY
;
63 /* We got the DirectDraw interface alloc and we need create the link */
64 LPDDRAWI_DIRECTDRAW_INT newThis
;
66 DX_STUB_str("2.linking\n");
68 /* step 1.Alloc the new DDRAWI_DIRECTDRAW_INT for the lnking */
69 DxHeapMemAlloc(newThis
, sizeof(DDRAWI_DIRECTDRAW_INT
));
72 return DDERR_OUTOFMEMORY
;
75 /* step 2 check if it not DDCREATE_HARDWAREONLY we got if so we fail */
76 if ((pGUID
) && (pGUID
!= (LPGUID
)DDCREATE_HARDWAREONLY
))
81 return DDERR_INVALIDDIRECTDRAWGUID
;
85 /* step 3 do the link the old interface are store in the new one */
86 newThis
->lpLink
= This
;
88 /* step 4 we need create new local directdraw struct for the new linked interface */
89 DxHeapMemAlloc(newThis
->lpLcl
, sizeof(DDRAWI_DIRECTDRAW_LCL
));
90 if (newThis
->lpLcl
== NULL
)
93 return DDERR_OUTOFMEMORY
;
99 This
->lpLcl
->lpGbl
= &ddgbl
;
101 *pIface
= (LPDIRECTDRAW
)This
;
103 /* Get right interface we whant */
104 if (Main_DirectDraw_QueryInterface((LPDIRECTDRAW7
)This
, id
, (void**)&pIface
) == DD_OK
)
106 DX_STUB_str("Got iface\n");
108 if (StartDirectDraw((LPDIRECTDRAW
)This
, pGUID
, FALSE
) == DD_OK
);
111 RtlZeroMemory(&wnd_class, sizeof(wnd_class));
112 wnd_class.style = CS_HREDRAW | CS_VREDRAW;
113 wnd_class.lpfnWndProc = DefWindowProcW;
114 wnd_class.cbClsExtra = 0;
115 wnd_class.cbWndExtra = 0;
116 wnd_class.hInstance = GetModuleHandleW(0);
118 wnd_class.hCursor = 0;
119 wnd_class.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
120 wnd_class.lpszMenuName = NULL;
121 wnd_class.lpszClassName = classname;
122 if(!RegisterClassW(&wnd_class))
124 DX_STUB_str("DDERR_GENERIC");
125 return DDERR_GENERIC;
128 This
->lpLcl
->hDD
= ddgbl
.hDD
;
133 return DDERR_INVALIDPARAMS
;
138 StartDirectDraw(LPDIRECTDRAW iface
, LPGUID lpGuid
, BOOL reenable
)
140 LPDDRAWI_DIRECTDRAW_INT This
= (LPDDRAWI_DIRECTDRAW_INT
)iface
;
141 DWORD hal_ret
= DD_FALSE
;
142 DWORD hel_ret
= DD_FALSE
;
143 DWORD devicetypes
= 0;
149 * ddgbl.dwPDevice is not longer in use in windows 2000 and higher
150 * I am using it for device type
151 * devicetypes = 1 : both hal and hel are enable
152 * devicetypes = 2 : both hal are enable
153 * devicetypes = 3 : both hel are enable
154 * devicetypes = 4 :loading a guid drv from the register
157 if (reenable
== FALSE
)
159 if ((!IsBadReadPtr(This
->lpLink
,sizeof(LPDIRECTDRAW
))) && (This
->lpLink
== NULL
))
161 RtlZeroMemory(&ddgbl
, sizeof(DDRAWI_DIRECTDRAW_GBL
));
162 This
->lpLcl
->lpGbl
->dwRefCnt
++;
163 if (ddgbl
.lpDDCBtmp
== NULL
)
166 DxHeapMemAlloc( ddgbl
.lpDDCBtmp
, sizeof(DDHAL_CALLBACKS
));
167 if (ddgbl
.lpDDCBtmp
== NULL
)
169 DX_STUB_str("Out of memmory\n");
175 /* Windows handler are by set of SetCooperLevel
179 if (reenable
== FALSE
)
183 DX_STUB_str("lpGuid == NULL\n");
186 /* Create HDC for default, hal and hel driver */
187 // This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow();
188 This
->lpLcl
->hDC
= (ULONG_PTR
)CreateDCA("DISPLAY",NULL
,NULL
,NULL
);
190 /* cObsolete is undoc in msdn it being use in CreateDCA */
191 RtlCopyMemory(&ddgbl
.cObsolete
,&"DISPLAY",7);
192 RtlCopyMemory(&ddgbl
.cDriverName
,&"DISPLAY",7);
193 dwFlags
|= DDRAWI_DISPLAYDRV
| DDRAWI_GDIDRV
;
197 else if (lpGuid
== (LPGUID
) DDCREATE_HARDWAREONLY
)
200 /* Create HDC for default, hal driver */
201 // This->lpLcl->hWnd =(ULONG_PTR) GetActiveWindow();
202 This
->lpLcl
->hDC
= (ULONG_PTR
)CreateDCA("DISPLAY",NULL
,NULL
,NULL
);
204 /* cObsolete is undoc in msdn it being use in CreateDCA */
205 RtlCopyMemory(&ddgbl
.cObsolete
,&"DISPLAY",7);
206 RtlCopyMemory(&ddgbl
.cDriverName
,&"DISPLAY",7);
207 dwFlags
|= DDRAWI_DISPLAYDRV
| DDRAWI_GDIDRV
;
209 else if (lpGuid
== (LPGUID
) DDCREATE_EMULATIONONLY
)
213 /* Create HDC for default, hal and hel driver */
214 //This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow();
215 This
->lpLcl
->hDC
= (ULONG_PTR
)CreateDCA("DISPLAY",NULL
,NULL
,NULL
);
217 /* cObsolete is undoc in msdn it being use in CreateDCA */
218 RtlCopyMemory(&ddgbl
.cObsolete
,&"DISPLAY",7);
219 RtlCopyMemory(&ddgbl
.cDriverName
,&"DISPLAY",7);
221 dwFlags
|= DDRAWI_DISPLAYDRV
| DDRAWI_GDIDRV
;
225 /* FIXME : need getting driver from the GUID that have been pass in from
226 * the register. we do not support that yet
229 //This->lpLcl->hDC = (ULONG_PTR) NULL ;
230 //This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL);
234 if ( (HDC)This->lpLcl->hDC == NULL)
236 DX_STUB_str("DDERR_OUTOFMEMORY\n");
237 return DDERR_OUTOFMEMORY ;
242 This
->lpLcl
->lpDDCB
= ddgbl
.lpDDCBtmp
;
244 /* Startup HEL and HAL */
245 This
->lpLcl
->lpDDCB
= This
->lpLcl
->lpGbl
->lpDDCBtmp
;
246 This
->lpLcl
->dwProcessId
= GetCurrentProcessId();
251 hal_ret
= StartDirectDrawHal(iface
, reenable
);
252 This
->lpLcl
->lpDDCB
->HELDD
.dwFlags
= 0;
256 hel_ret
= StartDirectDrawHel(iface
, reenable
);
257 This
->lpLcl
->lpDDCB
->HALDD
.dwFlags
= 0;
261 hal_ret
= StartDirectDrawHal(iface
, reenable
);
262 hel_ret
= StartDirectDrawHel(iface
, reenable
);
265 DX_STUB_str("return\n");
271 DX_STUB_str("DDERR_NODIRECTDRAWSUPPORT\n");
272 return DDERR_NODIRECTDRAWSUPPORT
;
274 dwFlags
|= DDRAWI_NOHARDWARE
;
279 dwFlags
|= DDRAWI_NOEMULATION
;
284 dwFlags
|= DDRAWI_EMULATIONINITIALIZED
;
287 /* Fill some basic info for Surface */
288 This
->lpLcl
->lpGbl
->dwFlags
= This
->lpLcl
->lpGbl
->dwFlags
| dwFlags
| DDRAWI_ATTACHEDTODESKTOP
;
289 This
->lpLcl
->lpDDCB
= This
->lpLcl
->lpGbl
->lpDDCBtmp
;
290 This
->lpLcl
->hDD
= ddgbl
.hDD
;
292 DX_STUB_str("DD_OK\n");
297 StartDirectDrawHel(LPDIRECTDRAW iface
, BOOL reenable
)
299 LPDDRAWI_DIRECTDRAW_INT This
= (LPDDRAWI_DIRECTDRAW_INT
)iface
;
301 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.CanCreateSurface
= HelDdCanCreateSurface
;
302 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.CreateSurface
= HelDdCreateSurface
;
303 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.CreatePalette
= HelDdCreatePalette
;
304 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.DestroyDriver
= HelDdDestroyDriver
;
305 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.FlipToGDISurface
= HelDdFlipToGDISurface
;
306 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.GetScanLine
= HelDdGetScanLine
;
307 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.SetColorKey
= HelDdSetColorKey
;
308 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.SetExclusiveMode
= HelDdSetExclusiveMode
;
309 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.SetMode
= HelDdSetMode
;
310 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.WaitForVerticalBlank
= HelDdWaitForVerticalBlank
;
312 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.dwFlags
= DDHAL_CB32_CANCREATESURFACE
|
313 DDHAL_CB32_CREATESURFACE
|
314 DDHAL_CB32_CREATEPALETTE
|
315 DDHAL_CB32_DESTROYDRIVER
|
316 DDHAL_CB32_FLIPTOGDISURFACE
|
317 DDHAL_CB32_GETSCANLINE
|
318 DDHAL_CB32_SETCOLORKEY
|
319 DDHAL_CB32_SETEXCLUSIVEMODE
|
321 DDHAL_CB32_WAITFORVERTICALBLANK
;
323 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDD
.dwSize
= sizeof(This
->lpLcl
->lpDDCB
->HELDD
);
325 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.AddAttachedSurface
= HelDdSurfAddAttachedSurface
;
326 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.Blt
= HelDdSurfBlt
;
327 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.DestroySurface
= HelDdSurfDestroySurface
;
328 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.Flip
= HelDdSurfFlip
;
329 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.GetBltStatus
= HelDdSurfGetBltStatus
;
330 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.GetFlipStatus
= HelDdSurfGetFlipStatus
;
331 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.Lock
= HelDdSurfLock
;
332 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.reserved4
= HelDdSurfreserved4
;
333 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.SetClipList
= HelDdSurfSetClipList
;
334 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.SetColorKey
= HelDdSurfSetColorKey
;
335 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.SetOverlayPosition
= HelDdSurfSetOverlayPosition
;
336 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.SetPalette
= HelDdSurfSetPalette
;
337 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.Unlock
= HelDdSurfUnlock
;
338 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.UpdateOverlay
= HelDdSurfUpdateOverlay
;
339 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.dwFlags
= DDHAL_SURFCB32_ADDATTACHEDSURFACE
|
341 DDHAL_SURFCB32_DESTROYSURFACE
|
342 DDHAL_SURFCB32_FLIP
|
343 DDHAL_SURFCB32_GETBLTSTATUS
|
344 DDHAL_SURFCB32_GETFLIPSTATUS
|
345 DDHAL_SURFCB32_LOCK
|
346 DDHAL_SURFCB32_RESERVED4
|
347 DDHAL_SURFCB32_SETCLIPLIST
|
348 DDHAL_SURFCB32_SETCOLORKEY
|
349 DDHAL_SURFCB32_SETOVERLAYPOSITION
|
350 DDHAL_SURFCB32_SETPALETTE
|
351 DDHAL_SURFCB32_UNLOCK
|
352 DDHAL_SURFCB32_UPDATEOVERLAY
;
354 This
->lpLcl
->lpGbl
->lpDDCBtmp
->HELDDSurface
.dwSize
= sizeof(This
->lpLcl
->lpDDCB
->HELDDSurface
);
357 This->lpLcl->lpDDCB->HELDDPalette.DestroyPalette = HelDdPalDestroyPalette;
358 This->lpLcl->lpDDCB->HELDDPalette.SetEntries = HelDdPalSetEntries;
359 This->lpLcl->lpDDCB->HELDDPalette.dwSize = sizeof(This->lpLcl->lpDDCB->HELDDPalette);
363 This->lpLcl->lpDDCB->HELDDExeBuf.CanCreateExecuteBuffer = HelDdExeCanCreateExecuteBuffer;
364 This->lpLcl->lpDDCB->HELDDExeBuf.CreateExecuteBuffer = HelDdExeCreateExecuteBuffer;
365 This->lpLcl->lpDDCB->HELDDExeBuf.DestroyExecuteBuffer = HelDdExeDestroyExecuteBuffer;
366 This->lpLcl->lpDDCB->HELDDExeBuf.LockExecuteBuffer = HelDdExeLockExecuteBuffer;
367 This->lpLcl->lpDDCB->HELDDExeBuf.UnlockExecuteBuffer = HelDdExeUnlockExecuteBuffer;
375 StartDirectDrawHal(LPDIRECTDRAW iface
, BOOL reenable
)
377 LPDWORD mpFourCC
= NULL
;
379 BOOL newmode
= FALSE
;
380 LPDDSURFACEDESC mpTextures
;
381 D3DHAL_CALLBACKS mD3dCallbacks
;
382 D3DHAL_GLOBALDRIVERDATA mD3dDriverData
;
383 DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks
;
384 LPDDRAWI_DIRECTDRAW_INT This
= (LPDDRAWI_DIRECTDRAW_INT
)iface
;
385 DDHAL_GETDRIVERINFODATA DdGetDriverInfo
= { 0 };
389 RtlZeroMemory(&mHALInfo
, sizeof(DDHALINFO
));
390 RtlZeroMemory(&mD3dCallbacks
, sizeof(D3DHAL_CALLBACKS
));
391 RtlZeroMemory(&mD3dDriverData
, sizeof(D3DHAL_GLOBALDRIVERDATA
));
392 RtlZeroMemory(&mD3dBufferCallbacks
, sizeof(DDHAL_DDEXEBUFCALLBACKS
));
394 if (reenable
== FALSE
)
396 if (ddgbl
.lpDDCBtmp
== NULL
)
398 DxHeapMemAlloc(ddgbl
.lpDDCBtmp
, sizeof(DDHAL_CALLBACKS
));
399 if ( ddgbl
.lpDDCBtmp
== NULL
)
407 RtlZeroMemory(ddgbl
.lpDDCBtmp
,sizeof(DDHAL_CALLBACKS
));
411 * Startup DX HAL step one of three
413 if (!DdCreateDirectDrawObject(This
->lpLcl
->lpGbl
, (HDC
)This
->lpLcl
->hDC
))
415 DxHeapMemFree(ddgbl
.lpDDCBtmp
);
419 /* Some card disable the dx after it have been created so
420 * we are force reanble it
422 if (!DdReenableDirectDrawObject(This
->lpLcl
->lpGbl
, &newmode
))
424 DxHeapMemFree(ddgbl
.lpDDCBtmp
);
428 if (!DdQueryDirectDrawObject(This
->lpLcl
->lpGbl
,
430 &ddgbl
.lpDDCBtmp
->HALDD
,
431 &ddgbl
.lpDDCBtmp
->HALDDSurface
,
432 &ddgbl
.lpDDCBtmp
->HALDDPalette
,
435 &mD3dBufferCallbacks
,
440 DxHeapMemFree(This
->lpLcl
->lpGbl
->lpModeInfo
);
441 DxHeapMemFree(ddgbl
.lpDDCBtmp
);
442 // FIXME Close DX fristcall and second call
446 DX_STUB_str("Trying alloc FourCCC \n");
449 if (This
->lpLcl
->lpGbl
->lpdwFourCC
!= NULL
)
451 DxHeapMemFree(This
->lpLcl
->lpGbl
->lpdwFourCC
);
454 if (mHALInfo
.ddCaps
.dwNumFourCCCodes
> 0 )
457 DxHeapMemAlloc(mpFourCC
, sizeof(DWORD
) * (mHALInfo
.ddCaps
.dwNumFourCCCodes
+ 2));
459 if (mpFourCC
== NULL
)
461 DxHeapMemFree(ddgbl
.lpDDCBtmp
);
462 // FIXME Close DX fristcall and second call
467 DX_STUB_str("End Trying alloc FourCCC\n");
473 /* Alloc mpTextures */
475 DX_STUB_str("1 Here\n");
477 if (This
->lpLcl
->lpGbl
->texture
!= NULL
)
479 DxHeapMemFree(This
->lpLcl
->lpGbl
->texture
;
483 if (mD3dDriverData
.dwNumTextureFormats
> 0)
485 mpTextures
= (DDSURFACEDESC
*) DxHeapMemAlloc(sizeof(DDSURFACEDESC
) * mD3dDriverData
.dwNumTextureFormats
);
486 if (mpTextures
== NULL
)
488 DxHeapMemFree(mpFourCC
);
489 DxHeapMemFree(ddgbl
.lpDDCBtmp
);
490 // FIXME Close DX fristcall and second call
494 DX_STUB_str("2 Here\n");
501 /* Get all basic data from the driver */
502 if (!DdQueryDirectDrawObject(
505 &ddgbl
.lpDDCBtmp
->HALDD
,
506 &ddgbl
.lpDDCBtmp
->HALDDSurface
,
507 &ddgbl
.lpDDCBtmp
->HALDDPalette
,
510 &ddgbl
.lpDDCBtmp
->HALDDExeBuf
,
511 (DDSURFACEDESC
*)mpTextures
,
515 DxHeapMemFree(mpFourCC
);
516 DxHeapMemFree(mpTextures
);
517 DxHeapMemFree(ddgbl
.lpDDCBtmp
);
518 // FIXME Close DX fristcall and second call
522 memcpy(&ddgbl
.vmiData
, &mHALInfo
.vmiData
,sizeof(VIDMEMINFO
));
525 memcpy(&ddgbl
.ddCaps
, &mHALInfo
.ddCaps
,sizeof(DDCORECAPS
));
527 This
->lpLcl
->lpGbl
->dwNumFourCC
= mHALInfo
.ddCaps
.dwNumFourCCCodes
;
528 This
->lpLcl
->lpGbl
->lpdwFourCC
= mpFourCC
;
529 This
->lpLcl
->lpGbl
->dwMonitorFrequency
= mHALInfo
.dwMonitorFrequency
;
530 This
->lpLcl
->lpGbl
->dwModeIndex
= mHALInfo
.dwModeIndex
;
531 This
->lpLcl
->lpGbl
->dwNumModes
= mHALInfo
.dwNumModes
;
532 This
->lpLcl
->lpGbl
->lpModeInfo
= mHALInfo
.lpModeInfo
;
534 DX_STUB_str("Here\n");
536 /* FIXME convert mpTextures to DDHALMODEINFO */
537 // DxHeapMemFree( mpTextures);
539 /* FIXME D3D setup mD3dCallbacks and mD3dDriverData */
544 if (mHALInfo
.dwFlags
& DDHALINFO_GETDRIVERINFOSET
)
546 DdGetDriverInfo
.dwSize
= sizeof (DDHAL_GETDRIVERINFODATA
);
547 DdGetDriverInfo
.guidInfo
= GUID_MiscellaneousCallbacks
;
548 DdGetDriverInfo
.lpvData
= (PVOID
)&ddgbl
.lpDDCBtmp
->HALDDMiscellaneous
;
549 DdGetDriverInfo
.dwExpectedSize
= sizeof (DDHAL_DDMISCELLANEOUSCALLBACKS
);
551 if(mHALInfo
.GetDriverInfo (&DdGetDriverInfo
) == DDHAL_DRIVER_NOTHANDLED
|| DdGetDriverInfo
.ddRVal
!= DD_OK
)
553 DxHeapMemFree(mpFourCC
);
554 DxHeapMemFree(mpTextures
);
555 DxHeapMemFree(ddgbl
.lpDDCBtmp
);
556 // FIXME Close DX fristcall and second call
560 RtlZeroMemory(&DdGetDriverInfo
, sizeof(DDHAL_GETDRIVERINFODATA
));
561 DdGetDriverInfo
.dwSize
= sizeof (DDHAL_GETDRIVERINFODATA
);
562 DdGetDriverInfo
.guidInfo
= GUID_Miscellaneous2Callbacks
;
565 DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->HALDDMiscellaneous;
566 DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUS2CALLBACKS);
568 if(mHALInfo.GetDriverInfo (&DdGetDriverInfo) == DDHAL_DRIVER_NOTHANDLED || DdGetDriverInfo.ddRVal != DD_OK)
570 DxHeapMemFree(mpFourCC);
571 DxHeapMemFree(mpTextures);
572 DxHeapMemFree(ddgbl.lpDDCBtmp);
573 // FIXME Close DX fristcall and second call
576 DD_MISCELLANEOUS2CALLBACKS
580 PDD_ALPHABLT AlphaBlt; // unsuse acoding msdn and always set to NULL
581 PDD_CREATESURFACEEX CreateSurfaceEx;
582 PDD_GETDRIVERSTATE GetDriverState;
583 PDD_DESTROYDDLOCAL DestroyDDLocal;
585 DDHAL_MISC2CB32_CREATESURFACEEX
586 DDHAL_MISC2CB32_GETDRIVERSTATE
587 DDHAL_MISC2CB32_DESTROYDDLOCAL
591 if (mHALInfo
.dwFlags
& DDHALINFO_GETDRIVERINFO2
)
593 This
->lpLcl
->lpGbl
->dwFlags
= This
->lpLcl
->lpGbl
->dwFlags
| DDRAWI_DRIVERINFO2
;