Implement Hal GetAvailableVidMem and is it working in windows
Modified: trunk/reactos/lib/ddraw/hal/ddraw.c
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
Modified: trunk/reactos/lib/ddraw/rosdraw.h
Modified: trunk/reactos/lib/ddraw/soft/ddraw.c
_____
Modified: trunk/reactos/lib/ddraw/hal/ddraw.c
--- trunk/reactos/lib/ddraw/hal/ddraw.c 2005-10-29 23:40:05 UTC (rev
18863)
+++ trunk/reactos/lib/ddraw/hal/ddraw.c 2005-10-30 01:06:56 UTC (rev
18864)
@@ -354,3 +354,33 @@
if(This->DirectDrawGlobal.lpD3DGlobalDriverData)
HeapFree(GetProcessHeap(), 0,
(PVOID)This->DirectDrawGlobal.lpD3DGlobalDriverData);
}
+
+
+HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface,
LPDDSCAPS2 ddscaps,
+ LPDWORD total, LPDWORD free)
+{
+ IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
+ DDHAL_GETAVAILDRIVERMEMORYDATA mem;
+
+ if
(!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags &
DDHAL_MISCCB32_GETAVAILDRIVERMEMORY))
+ {
+ return DDERR_NODRIVERSUPPORT;
+ }
+
+ mem.lpDD = &This->DirectDrawGlobal;
+ if
(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemo
ry(&mem) != DDHAL_DRIVER_HANDLED)
+ {
+ return DDERR_NODRIVERSUPPORT;
+ }
+
+
+ ddscaps->dwCaps = mem.DDSCaps.dwCaps;
+ ddscaps->dwCaps2 = mem.ddsCapsEx.dwCaps2;
+ ddscaps->dwCaps3 = mem.ddsCapsEx.dwCaps3;
+ ddscaps->dwCaps4 = mem.ddsCapsEx.dwCaps4;
+ *total = mem.dwTotal;
+ *free = mem.dwFree;
+
+ return mem.ddRVal;
+}
_____
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
--- trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-29 23:40:05 UTC
(rev 18863)
+++ trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-30 01:06:56 UTC
(rev 18864)
@@ -352,7 +352,8 @@
DDCOLORKEY ddckCKSrcOverlay;
DDCOLORKEY ddckCKSrcBlt;
*/
-
+
+
RtlCopyMemory(&pDDSD->ddpfPixelFormat,&This->DirectDrawGlobal.vmiData.dd
pfDisplay,sizeof(DDPIXELFORMAT));
RtlCopyMemory(&pDDSD->ddsCaps,&This->DirectDrawGlobal.ddCaps,sizeof(DDCO
RECAPS));
@@ -412,9 +413,18 @@
HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface,
LPDDSCAPS2 ddscaps,
LPDWORD total, LPDWORD free)
-{
-
- DX_STUB;
+{
+ DWORD ret;
+
+ if((ret = Hal_DirectDraw_GetAvailableVidMem
(iface,ddscaps,total,free)) == DD_OK)
+ return ret;
+
+ if((ret = Hel_DirectDraw_GetAvailableVidMem
(iface,ddscaps,total,free)) == DD_OK)
+ return ret;
+
+
+ return DDERR_NOTINITIALIZED;
+
}
HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC
hdc,
_____
Modified: trunk/reactos/lib/ddraw/rosdraw.h
--- trunk/reactos/lib/ddraw/rosdraw.h 2005-10-29 23:40:05 UTC (rev
18863)
+++ trunk/reactos/lib/ddraw/rosdraw.h 2005-10-30 01:06:56 UTC (rev
18864)
@@ -88,10 +88,18 @@
HRESULT Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface);
VOID Hal_DirectDraw_Release (LPDIRECTDRAW7 iface);
+HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface,
LPDDSCAPS2 ddscaps,
+ LPDWORD total, LPDWORD free);
+
+
HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface);
HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface);
VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface);
+HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface,
LPDDSCAPS2 ddscaps,
+ LPDWORD total, LPDWORD free);
+
+
/*********** Macros ***********/
#define DX_STUB \
_____
Modified: trunk/reactos/lib/ddraw/soft/ddraw.c
--- trunk/reactos/lib/ddraw/soft/ddraw.c 2005-10-29 23:40:05 UTC
(rev 18863)
+++ trunk/reactos/lib/ddraw/soft/ddraw.c 2005-10-30 01:06:56 UTC
(rev 18864)
@@ -24,3 +24,10 @@
VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface)
{
}
+
+
+HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface,
LPDDSCAPS2 ddscaps,
+ LPDWORD total, LPDWORD free)
+{
+ DX_STUB;
+}
Show replies by date