3 * COPYRIGHT: See COPYING in the top level directory
5 * FILE: lib/ddraw/hal/ddraw.c
6 * PURPOSE: DirectDraw HAL Implementation
7 * PROGRAMMER: Magnus Olsen, Maarten Bosma
14 HRESULT
Hal_DirectDraw_Initialize (LPDIRECTDRAW7 iface
)
16 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
18 /* point to it self */
19 This
->DirectDrawGlobal
.lp16DD
= &This
->DirectDrawGlobal
;
22 if(!DdCreateDirectDrawObject (&This
->DirectDrawGlobal
, This
->hdc
))
23 return DDERR_INVALIDPARAMS
;
26 /* alloc all the space */
27 This
->DirectDrawGlobal
.lpDDCBtmp
= (LPDDHAL_CALLBACKS
)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DDHAL_CALLBACKS
));
28 This
->DirectDrawGlobal
.lpD3DHALCallbacks
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
, sizeof(D3DHAL_CALLBACKS
));
29 This
->DirectDrawGlobal
.lpD3DGlobalDriverData
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(D3DHAL_GLOBALDRIVERDATA
));
31 /* Fill in some info */
32 This
->HalInfo
.lpD3DGlobalDriverData
= This
->DirectDrawGlobal
.lpD3DGlobalDriverData
;
33 This
->HalInfo
.lpD3DHALCallbacks
= This
->DirectDrawGlobal
.lpD3DHALCallbacks
;
34 This
->HalInfo
.lpDDCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
;
35 This
->HalInfo
.lpDDExeBufCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDExeBuf
;
36 This
->HalInfo
.lpDDPaletteCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDPalette
;
37 This
->HalInfo
.lpDDSurfaceCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDSurface
;
39 /* query all kinds of infos from the driver */
40 if(!DdQueryDirectDrawObject (
41 &This
->DirectDrawGlobal
,
43 This
->HalInfo
.lpDDCallbacks
,
44 This
->HalInfo
.lpDDSurfaceCallbacks
,
45 This
->HalInfo
.lpDDPaletteCallbacks
,
46 (LPD3DHAL_CALLBACKS
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
,
47 (LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
,
48 This
->HalInfo
.lpDDExeBufCallbacks
,
53 OutputDebugString(L
"First DdQueryDirectDrawObject failed");
57 This
->HalInfo
.vmiData
.pvmList
= HeapAlloc(GetProcessHeap(), 0, sizeof(VIDMEM
) * This
->HalInfo
.vmiData
.dwNumHeaps
);
58 This
->DirectDrawGlobal
.lpdwFourCC
= HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD
) * This
->HalInfo
.ddCaps
.dwNumFourCCCodes
);
59 ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
= HeapAlloc(GetProcessHeap(), 0, sizeof(DDSURFACEDESC
) * ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->dwNumTextureFormats
);
61 if(!DdQueryDirectDrawObject (
62 &This
->DirectDrawGlobal
,
64 This
->HalInfo
.lpDDCallbacks
,
65 This
->HalInfo
.lpDDSurfaceCallbacks
,
66 This
->HalInfo
.lpDDPaletteCallbacks
,
67 (LPD3DHAL_CALLBACKS
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
,
68 (LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
,
69 This
->HalInfo
.lpDDExeBufCallbacks
,
70 ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
,
71 This
->DirectDrawGlobal
.lpdwFourCC
,
72 This
->HalInfo
.vmiData
.pvmList
75 OutputDebugString(L
"Second DdQueryDirectDrawObject failed");
79 /* Copy HalInfo to DirectDrawGlobal (Not complete)*/
81 RtlCopyMemory(&This
->DirectDrawGlobal
.vmiData
,&This
->HalInfo
.vmiData
,sizeof(VIDMEMINFO
));
82 RtlCopyMemory(&This
->DirectDrawGlobal
.ddCaps
,&This
->HalInfo
.ddCaps
,sizeof(DDCORECAPS
));
83 This
->DirectDrawGlobal
.dwMonitorFrequency
= This
->HalInfo
.dwMonitorFrequency
;
85 This
->DirectDrawGlobal
.dwModeIndex
= This
->HalInfo
.dwModeIndex
;
86 This
->DirectDrawGlobal
.dwNumModes
= This
->HalInfo
.dwNumModes
;
87 This
->DirectDrawGlobal
.lpModeInfo
= This
->HalInfo
.lpModeInfo
;
90 /* Unsure which of these two for lpPDevice
91 This->DirectDrawGlobal.dwPDevice = This->HalInfo.lpPDevice;
92 This->lpDriverHandle = This->HalInfo.lpPDevice;
95 This
->DirectDrawGlobal
.hInstance
= This
->HalInfo
.hInstance
;
97 RtlCopyMemory(&This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDExeBuf
,&This
->HalInfo
.lpDDExeBufCallbacks
,sizeof(DDHAL_DDEXEBUFCALLBACKS
));
101 /************************************************************************/
102 /* Set up the rest of the callbacks all callbacks we get back from */
103 /* gdi32.dll is user mode */
104 /************************************************************************/
106 /* Todo add a check see if HalInfo.GetDriverInfo is supported or not */
108 /* Do not trust msdn what it say about dwContext it is not in use for
109 windows nt, it is in use for all os, and it always pont to
110 DirectDrawGlobal.hDD */
112 /* FIXME add all callback that have been commect out to gpl */
113 /* FIXME free the memmor that being alloc when ddraw.dll exists */
114 /* FIXME add check for DriverInfo if the handle or not */
116 DDHAL_GETDRIVERINFODATA DriverInfo
;
117 memset(&DriverInfo
,0, sizeof(DDHAL_GETDRIVERINFODATA
));
118 DriverInfo
.dwSize
= sizeof(DDHAL_GETDRIVERINFODATA
);
119 DriverInfo
.dwContext
= This
->DirectDrawGlobal
.hDD
;
122 /* Get ColorControlCallbacks */
123 DriverInfo
.guidInfo
= GUID_ColorControlCallbacks
;
124 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDColorControl
;
125 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDCOLORCONTROLCALLBACKS
);
126 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
129 /* Get the GUID_D3DCallbacks callback */
131 /* Problem with include files
132 DDHAL_DDMISCELLANEOUSCALLBACKS misc;
133 DriverInfo.guidInfo = GUID_D3DCallbacks;
134 DriverInfo.lpvData = &misc;
135 DriverInfo.dwExpectedSize = sizeof();
136 This->HalInfo.GetDriverInfo( &DriverInfo);*/
138 /* Get the D3DCallbacks2 */
139 This
->DirectDrawGlobal
.lpD3DHALCallbacks2
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), 0, sizeof(D3DHAL_CALLBACKS2
));
140 DriverInfo
.guidInfo
= GUID_D3DCallbacks2
;
141 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpD3DHALCallbacks2
;
142 DriverInfo
.dwExpectedSize
= sizeof(D3DHAL_CALLBACKS2
);
143 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
146 /* Get the D3DCallbacks3 */
147 This
->DirectDrawGlobal
.lpD3DHALCallbacks
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), 0, sizeof(D3DHAL_CALLBACKS3
));
148 DriverInfo
.guidInfo
= GUID_D3DCallbacks3
;
149 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
;
150 DriverInfo
.dwExpectedSize
= sizeof(D3DHAL_CALLBACKS3
);
151 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
154 /* Get the misc callback */
155 /* Problem with include files
156 DriverInfo.guidInfo = GUID_D3DCaps;
157 DriverInfo.lpvData = &misc;
158 DriverInfo.dwExpectedSize = sizeof();
159 This->HalInfo.GetDriverInfo( &DriverInfo);
162 /* Get the D3DExtendedCaps */
164 This
->DirectDrawGlobal
.lpD3DExtendedCaps
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), 0, sizeof(D3DHAL_D3DEXTENDEDCAPS
));
165 DriverInfo
.guidInfo
= GUID_D3DExtendedCaps
;
166 DriverInfo
.lpvData
= (PVOID
) This
->DirectDrawGlobal
.lpD3DExtendedCaps
;
167 DriverInfo
.dwExpectedSize
= sizeof(D3DHAL_D3DEXTENDEDCAPS
);
168 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
171 /* Get the D3DParseUnknownCommandCallback */
172 /* D3dDrawPrimitives2 callback where should it be fill in
173 DriverInfo.guidInfo = GUID_D3DParseUnknownCommandCallback;
174 DriverInfo.lpvData = &misc;
175 DriverInfo.dwExpectedSize = sizeof();
176 This->HalInfo.GetDriverInfo( &DriverInfo);
179 /* Get the GetHeapAlignment */
180 /* where should it be fill in
181 DriverInfo.guidInfo = GUID_GetHeapAlignment;
182 DriverInfo.lpvData = &misc;
183 DriverInfo.dwExpectedSize = sizeof();
184 This->HalInfo.GetDriverInfo( &DriverInfo);
188 /* Get the KernelCallbacks */
189 DriverInfo
.guidInfo
= GUID_KernelCallbacks
;
190 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDKernel
;
191 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDKERNELCALLBACKS
);
192 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
195 /* Get the KernelCaps */
196 This
->DirectDrawGlobal
.lpDDKernelCaps
= (LPDDKERNELCAPS
)HeapAlloc(GetProcessHeap(), 0, sizeof(DDHAL_DDKERNELCALLBACKS
));
197 DriverInfo
.guidInfo
= GUID_KernelCaps
;
198 DriverInfo
.lpvData
= (PVOID
) This
->DirectDrawGlobal
.lpDDKernelCaps
;
199 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDKERNELCALLBACKS
);
200 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
203 /* Get the MiscellaneousCallbacks */
204 DriverInfo
.guidInfo
= GUID_MiscellaneousCallbacks
;
205 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
;
206 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS
);
207 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
210 /* Get the Miscellaneous2Callbacks */
211 /* Not in the DDRAWI_DIRECTDRAW_GBL we map it up as private
212 Contain CreatesurfaceEx and other nice callbacks */
213 DriverInfo
.guidInfo
= GUID_Miscellaneous2Callbacks
;
214 DriverInfo
.lpvData
= &This
->Misc2Callback
;
215 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS
);
216 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
219 /* Get the MotionCompCallbacks */
220 DriverInfo
.guidInfo
= GUID_MotionCompCallbacks
;
221 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMotionComp
;
222 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDMOTIONCOMPCALLBACKS
);
223 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
226 /* Get the NonLocalVidMemCaps */
227 This
->DirectDrawGlobal
.lpddNLVCaps
= (LPDDNONLOCALVIDMEMCAPS
)HeapAlloc(GetProcessHeap(), 0, sizeof(DDNONLOCALVIDMEMCAPS
));
228 DriverInfo
.guidInfo
= GUID_NonLocalVidMemCaps
;
229 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpddNLVCaps
;
230 DriverInfo
.dwExpectedSize
= sizeof(DDNONLOCALVIDMEMCAPS
);
231 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
234 /* Get the NTCallbacks */
236 DriverInfo.guidInfo = GUID_NTCallbacks;
237 DriverInfo.lpvData = &misc;
238 DriverInfo.dwExpectedSize = sizeof();
239 This->HalInfo.GetDriverInfo( &DriverInfo);
242 /* Get the NTPrivateDriverCaps */
244 DriverInfo.guidInfo = GUID_NTPrivateDriverCaps;
245 DriverInfo.lpvData = &misc;
246 DriverInfo.dwExpectedSize = sizeof();
247 This->HalInfo.GetDriverInfo( &DriverInfo);
250 /* Get the UpdateNonLocalHeap */
252 DriverInfo.guidInfo = GUID_UpdateNonLocalHeap;
253 DriverInfo.lpvData = &misc;
254 DriverInfo.dwExpectedSize = sizeof();
255 This->HalInfo.GetDriverInfo( &DriverInfo);
258 /* Get the VideoPortCallbacks */
259 DriverInfo
.guidInfo
= GUID_VideoPortCallbacks
;
260 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDVideoPort
;
261 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDVIDEOPORTCALLBACKS
);
262 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
265 /* Get the VideoPortCaps */
266 This
->DirectDrawGlobal
.lpDDVideoPortCaps
= (LPDDVIDEOPORTCAPS
)HeapAlloc(GetProcessHeap(), 0, sizeof(DDVIDEOPORTCAPS
));
267 DriverInfo
.guidInfo
= GUID_VideoPortCaps
;
268 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpDDVideoPortCaps
;
269 DriverInfo
.dwExpectedSize
= sizeof(DDVIDEOPORTCAPS
);
270 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
273 /* Get the ZPixelFormats */
274 This
->DirectDrawGlobal
.lpZPixelFormats
= HeapAlloc(GetProcessHeap(), 0, sizeof(DDPIXELFORMAT
) * This
->DirectDrawGlobal
.dwNumZPixelFormats
);
275 DriverInfo
.guidInfo
= GUID_ZPixelFormats
;
276 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpZPixelFormats
;
277 DriverInfo
.dwExpectedSize
= sizeof(DDPIXELFORMAT
);
278 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
282 /* Setup some info from the callbacks we got */
284 /* FIXME do more callbacks and fill the gpl struct */
286 DDHAL_GETAVAILDRIVERMEMORYDATA mem
;
287 mem
.lpDD
= &This
->DirectDrawGlobal
;
289 This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
.GetAvailDriverMemory(&mem
);
291 This
->DirectDrawGlobal
.ddCaps
.dwVidMemFree
= mem
.dwFree
;
292 This
->DirectDrawGlobal
.ddCaps
.dwVidMemTotal
= mem
.dwTotal
;
294 /* Now all setup for HAL is done and we hopply do not have forget anything */
299 HRESULT
Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface
)
301 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
303 DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode
;
305 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_SETEXCLUSIVEMODE
))
307 return DDERR_NODRIVERSUPPORT
;
310 SetExclusiveMode
.lpDD
= &This
->DirectDrawGlobal
;
311 SetExclusiveMode
.ddRVal
= DDERR_NOTPALETTIZED
;
312 SetExclusiveMode
.dwEnterExcl
= This
->cooperative_level
;
314 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.SetExclusiveMode(&SetExclusiveMode
) != DDHAL_DRIVER_HANDLED
)
316 return DDERR_NODRIVERSUPPORT
;
319 return SetExclusiveMode
.ddRVal
;
323 VOID
Hal_DirectDraw_Release (LPDIRECTDRAW7 iface
)
325 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
327 DdDeleteDirectDrawObject (&This
->DirectDrawGlobal
);
329 if(This
->HalInfo
.vmiData
.pvmList
)
330 HeapFree(GetProcessHeap(), 0, This
->HalInfo
.vmiData
.pvmList
);
331 if(This
->DirectDrawGlobal
.lpdwFourCC
)
332 HeapFree(GetProcessHeap(), 0, This
->DirectDrawGlobal
.lpdwFourCC
);
333 if(This
->DirectDrawGlobal
.lpZPixelFormats
)
334 HeapFree(GetProcessHeap(), 0, This
->DirectDrawGlobal
.lpZPixelFormats
);
335 if(((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
)
336 HeapFree(GetProcessHeap(), 0, ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
);
338 if(This
->DirectDrawGlobal
.lpDDCBtmp
)
339 HeapFree(GetProcessHeap(), 0, This
->DirectDrawGlobal
.lpDDCBtmp
);
340 if(This
->DirectDrawGlobal
.lpD3DHALCallbacks
)
341 HeapFree(GetProcessHeap(), 0, (PVOID
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
);
342 if(This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)
343 HeapFree(GetProcessHeap(), 0, (PVOID
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
);
347 HRESULT
Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface
, LPDDSCAPS2 ddscaps
,
348 LPDWORD total
, LPDWORD free
)
350 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
352 DDHAL_GETAVAILDRIVERMEMORYDATA mem
;
354 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
.dwFlags
& DDHAL_MISCCB32_GETAVAILDRIVERMEMORY
))
356 return DDERR_NODRIVERSUPPORT
;
359 mem
.lpDD
= &This
->DirectDrawGlobal
;
360 mem
.ddRVal
= DDERR_NOTPALETTIZED
;
362 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
.GetAvailDriverMemory(&mem
) != DDHAL_DRIVER_HANDLED
)
364 return DDERR_NODRIVERSUPPORT
;
367 ddscaps
->dwCaps
= mem
.DDSCaps
.dwCaps
;
368 ddscaps
->dwCaps2
= mem
.ddsCapsEx
.dwCaps2
;
369 ddscaps
->dwCaps3
= mem
.ddsCapsEx
.dwCaps3
;
370 ddscaps
->dwCaps4
= mem
.ddsCapsEx
.dwCaps4
;
371 *total
= mem
.dwTotal
;
377 HRESULT
Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface
, DWORD dwFlags
,HANDLE h
)
380 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
382 DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData
;
384 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_WAITFORVERTICALBLANK
))
386 return DDERR_NODRIVERSUPPORT
;
389 WaitVectorData
.lpDD
= &This
->DirectDrawGlobal
;
390 WaitVectorData
.dwFlags
= dwFlags
;
391 WaitVectorData
.hEvent
= (DWORD
)h
;
392 WaitVectorData
.ddRVal
= DDERR_NOTPALETTIZED
;
394 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.WaitForVerticalBlank(&WaitVectorData
) != DDHAL_DRIVER_HANDLED
)
396 return DDERR_NODRIVERSUPPORT
;
399 return WaitVectorData
.ddRVal
;
402 HRESULT
Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface
, LPDWORD lpdwScanLine
)
404 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
406 DDHAL_GETSCANLINEDATA GetScan
;
408 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_GETSCANLINE
))
410 return DDERR_NODRIVERSUPPORT
;
413 GetScan
.lpDD
= &This
->DirectDrawGlobal
;
414 GetScan
.ddRVal
= DDERR_NOTPALETTIZED
;
416 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.GetScanLine(&GetScan
) != DDHAL_DRIVER_HANDLED
)
418 return DDERR_NODRIVERSUPPORT
;
421 *lpdwScanLine
= GetScan
.ddRVal
;
422 return GetScan
.ddRVal
;
425 HRESULT
Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface
)
427 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
429 DDHAL_FLIPTOGDISURFACEDATA FlipGdi
;
431 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_FLIPTOGDISURFACE
))
433 return DDERR_NODRIVERSUPPORT
;
436 FlipGdi
.lpDD
= &This
->DirectDrawGlobal
;
437 FlipGdi
.ddRVal
= DDERR_NOTPALETTIZED
;
439 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.FlipToGDISurface(&FlipGdi
) != DDHAL_DRIVER_HANDLED
)
441 return DDERR_NODRIVERSUPPORT
;
444 /* FIXME where should FlipGdi.dwToGDI be fill in */
445 return FlipGdi
.ddRVal
;
448 HRESULT
Hal_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface
, DWORD dwWidth
, DWORD dwHeight
,
449 DWORD dwBPP
, DWORD dwRefreshRate
, DWORD dwFlags
)
451 DDHAL_SETMODEDATA mode
;
453 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
455 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_SETMODE
))
457 return DDERR_NODRIVERSUPPORT
;
460 mode
.lpDD
= &This
->DirectDrawGlobal
;
461 mode
.ddRVal
= DDERR_NODRIVERSUPPORT
;
463 /* FIXME : add search for which mode.ModeIndex we should use */
464 /* FIXME : fill the mode.inexcl; */
465 /* FIXME : fill the mode.useRefreshRate; */
468 if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.SetMode(&mode) != DDHAL_DRIVER_HANDLED)
470 return DDERR_NODRIVERSUPPORT;
474 /* return mode.ddRVal */