Author: greatlrd
Date: Sat Jun 9 00:55:48 2007
New Revision: 27081
URL:
http://svn.reactos.org/svn/reactos?rev=27081&view=rev
Log:
rename Main_DirectDraw_GetAvailableVidMem to Main_DirectDraw_GetAvailableVidMem4
Fixing smaller bugs in Main_DirectDraw_GetAvailableVidMem4, complete works simluare now to
ms version of this api
Implement Main_DirectDraw_GetAvailableVidMem for directdraw2 and directdraw3
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
trunk/reactos/dll/directx/ddraw/Surface/surface.h
trunk/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sat Jun 9 00:55:48 2007
@@ -173,7 +173,29 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
+Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW2 iface, LPDDSCAPS ddscaps, LPDWORD
dwTotal, LPDWORD dwFree)
+{
+ DDSCAPS2 myddscaps;
+ HRESULT retValue = DD_OK;
+
+ ZeroMemory(&myddscaps, sizeof(DDSCAPS2));
+
+ _SEH_TRY
+ {
+ myddscaps.dwCaps = ddscaps->dwCaps;
+ retValue = Main_DirectDraw_GetAvailableVidMem4((LPDIRECTDRAW7)iface,
&myddscaps, dwTotal, dwFree);
+ }
+ _SEH_HANDLE
+ {
+ retValue = DDERR_INVALIDPARAMS;
+ }
+ _SEH_END;
+
+ return retValue;
+}
+
+HRESULT WINAPI
+Main_DirectDraw_GetAvailableVidMem4(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
LPDWORD dwTotal, LPDWORD dwFree)
{
HRESULT retVal = DD_OK;
@@ -218,15 +240,14 @@
_SEH_LEAVE;
}
- /* fixme
- if ( ddscaps->dwCaps3 & (DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX |
DDSCAPS_FLIP |
- DDSCAPS_FRONTBUFFER | DDSCAPS_PALETTE |
DDSCAPS_SYSTEMMEMORY |
- DDSCAPS_VISIBLE | DDSCAPS_WRITEONLY |
DDSCAPS_OWNDC))
- {
- retVal = DDERR_INVALIDPARAMS;
+ if ( ddscaps->dwCaps3 & ~( DDSCAPS3_MULTISAMPLE_QUALITY_MASK |
DDSCAPS3_MULTISAMPLE_MASK |
+ DDSCAPS3_RESERVED1 |
DDSCAPS3_RESERVED2 |
+ DDSCAPS3_LIGHTWEIGHTMIPMAP |
DDSCAPS3_AUTOGENMIPMAP |
+ DDSCAPS3_DMAP))
+ {
+ retVal = DDERR_INVALIDCAPS;
_SEH_LEAVE;
}
- */
if ( ddscaps->dwCaps4)
{
@@ -246,6 +267,12 @@
if
(This->lpLcl->lpDDCB->HALDDMiscellaneous.GetAvailDriverMemory(&memdata) ==
DDHAL_DRIVER_NOTHANDLED)
{
retVal = DDERR_NODIRECTDRAWHW;
+
+ if (dwTotal)
+ *dwTotal = 0;
+
+ if (dwFree)
+ *dwFree = 0;
}
else
{
@@ -410,7 +437,7 @@
Main_DirectDraw_SetCooperativeLevel,
Main_DirectDraw_SetDisplayMode,
Main_DirectDraw_WaitForVerticalBlank,
- Main_DirectDraw_GetAvailableVidMem,
+ Main_DirectDraw_GetAvailableVidMem4,
Main_DirectDraw_GetSurfaceFromDC,
Main_DirectDraw_RestoreAllSurfaces,
Main_DirectDraw_TestCooperativeLevel,
Modified: trunk/reactos/dll/directx/ddraw/Surface/surface.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/surface.h (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/surface.h Sat Jun 9 00:55:48 2007
@@ -53,7 +53,8 @@
HRESULT WINAPI Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
LPDDSURFACEDESC2 pDDSD);
HRESULT WINAPI Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
LPDDSURFACEDESC2 pDDSD, LPVOID context, LPDDENUMMODESCALLBACK2 callback);
HRESULT WINAPI Main_DDrawSurface_SetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
DDSURFACEDESC2 *DDSD, DWORD Flags);
-HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2
ddscaps, LPDWORD total, LPDWORD free);
+HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW2 iface, LPDDSCAPS ddscaps,
LPDWORD total, LPDWORD free);
+HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem4(LPDIRECTDRAW7 iface, LPDDSCAPS2
ddscaps, LPDWORD total, LPDWORD free);
// hel callbacks
DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver);
Modified: trunk/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/thunks/d…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c (original)
+++ trunk/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c Sat Jun 9 00:55:48 2007
@@ -775,36 +775,9 @@
return Main_DirectDraw_WaitForVerticalBlank((LPDIRECTDRAW7) iface, dwFlags, hEvent);
}
-HRESULT WINAPI
-ThunkDirectDraw2_GetAvailableVidMem(LPDIRECTDRAW2 iface, LPDDSCAPS pCaps, LPDWORD
pdwTotal, LPDWORD pdwFree)
-{
- HRESULT retValue = DDERR_GENERIC;
-
- DX_WINDBG_trace();
-
- if (pCaps != NULL)
- {
- DDSCAPS2 pCaps2;
- ZeroMemory(&pCaps2,sizeof(DDSCAPS2));
- memcpy(&pCaps2, pCaps, sizeof(DDSCAPS));
- retValue = Main_DirectDraw_GetAvailableVidMem((LPDIRECTDRAW7) iface, &pCaps2,
pdwTotal, pdwFree);
- memcpy(pCaps, &pCaps2, sizeof(DDSCAPS));
- }
- else
- {
- retValue = Main_DirectDraw_GetAvailableVidMem((LPDIRECTDRAW7) iface, NULL, pdwTotal,
pdwFree);
- }
-
- return retValue;
-}
-
-HRESULT WINAPI
-ThunkDirectDraw4_GetAvailableVidMem(LPDIRECTDRAW4 iface, LPDDSCAPS2 pCaps, LPDWORD
pdwTotal, LPDWORD pdwFree)
-{
- DX_WINDBG_trace();
-
- return Main_DirectDraw_GetAvailableVidMem((LPDIRECTDRAW7) iface, pCaps, pdwTotal,
pdwFree);
-}
+
+
+
HRESULT WINAPI
ThunkDirectDraw4_GetSurfaceFromDC(LPDIRECTDRAW4 iface, HDC hdc, LPDIRECTDRAWSURFACE4
*pSurf)