Author: greatlrd
Date: Sat Jun 2 18:01:43 2007
New Revision: 26966
URL:
http://svn.reactos.org/svn/reactos?rev=26966&view=rev
Log:
Fixing Getavil memory
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
trunk/reactos/dll/directx/ddraw/startup.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 2 18:01:43 2007
@@ -164,11 +164,12 @@
}
DDHAL_GETAVAILDRIVERMEMORYDATA memdata;
+ ZeroMemory(&memdata, sizeof(DDHAL_GETAVAILDRIVERMEMORYDATA));
memdata.lpDD = This->lpLcl->lpGbl;
memdata.ddRVal = DDERR_INVALIDPARAMS;
memcpy(&memdata.DDSCaps, ddscaps, sizeof(DDSCAPS2));
- if
(This->lpLcl->lpDDCB->cbDDMiscellaneousCallbacks.GetAvailDriverMemory(&memdata)
== DDHAL_DRIVER_NOTHANDLED)
+ if
(This->lpLcl->lpDDCB->HALDDMiscellaneous.GetAvailDriverMemory(&memdata) ==
DDHAL_DRIVER_NOTHANDLED)
return DDERR_NODIRECTDRAWHW;
if (dwTotal)
Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Sat Jun 2 18:01:43 2007
@@ -548,12 +548,15 @@
// DxHeapMemFree( mpTextures);
/* FIXME D3D setup mD3dCallbacks and mD3dDriverData */
- DDHAL_GETDRIVERINFODATA DdGetDriverInfo = { 0 };
- DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
- DdGetDriverInfo.guidInfo = GUID_MiscellaneousCallbacks;
- DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->cbDDMiscellaneousCallbacks;
- DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUSCALLBACKS);
- if(mHALInfo.GetDriverInfo (&DdGetDriverInfo) == DDHAL_DRIVER_NOTHANDLED ||
DdGetDriverInfo.ddRVal != DD_OK)
+ DDHAL_GETDRIVERINFODATA DdGetDriverInfo = { 0 };
+ DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
+ DdGetDriverInfo.guidInfo = GUID_MiscellaneousCallbacks;
+
+ DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->HALDDMiscellaneous;
+
+ DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUSCALLBACKS);
+
+ if(mHALInfo.GetDriverInfo (&DdGetDriverInfo) == DDHAL_DRIVER_NOTHANDLED ||
DdGetDriverInfo.ddRVal != DD_OK)
{
DxHeapMemFree(mpFourCC);
DxHeapMemFree(mpTextures);
@@ -562,6 +565,29 @@
return DD_FALSE;
}
+ /* try get the memory and show it */
+ if (ddgbl.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory)
+ {
+ DDHAL_GETAVAILDRIVERMEMORYDATA memdata;
+ char buffer[2048];
+
+ ZeroMemory(&memdata, sizeof(DDHAL_GETAVAILDRIVERMEMORYDATA));
+
+
+ DX_STUB_str("found GetAvailDriverMemory, testing \n");
+ memdata.lpDD = &ddgbl;
+ memdata.ddRVal = DDERR_GENERIC;
+ ddgbl.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&memdata);
+
+ sprintf ( buffer, "GetAvailDriverMemory : retval %ld, Graphice memory free
%ld Bytes, memory total %ld Bytes\n",memdata.ddRVal,memdata.dwFree,memdata.dwTotal);
+ OutputDebugStringA(buffer);
+
+
+
+
+ }
+
+
DX_STUB_str("Return DD_OK\n");
return DD_OK;
}