mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +00:00
Implement IDirectDraw7::GetAvailableVidMem.
svn path=/trunk/; revision=26845
This commit is contained in:
parent
cc557fcbd2
commit
d49bca10c2
3 changed files with 57 additions and 38 deletions
|
@ -39,7 +39,6 @@ Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 iface,
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Main_DirectDraw_AddRef(iface);
|
Main_DirectDraw_AddRef(iface);
|
||||||
DX_STUB_str("DD_OK");
|
DX_STUB_str("DD_OK");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
|
@ -104,17 +103,11 @@ Main_DirectDraw_Release (LPDIRECTDRAW7 iface)
|
||||||
return This->dwIntRefCnt;
|
return This->dwIntRefCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* IMPLEMENT
|
|
||||||
* Status ok
|
|
||||||
*/
|
|
||||||
HRESULT
|
HRESULT
|
||||||
WINAPI
|
WINAPI
|
||||||
Main_DirectDraw_Compact(LPDIRECTDRAW7 iface)
|
Main_DirectDraw_Compact(LPDIRECTDRAW7 iface)
|
||||||
{
|
{
|
||||||
/* MSDN say not implement but my question what does it return then */
|
return DD_OK; // not implemented in ms ddraw
|
||||||
DX_WINDBG_trace();
|
|
||||||
return DD_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
|
@ -176,8 +169,41 @@ Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeig
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
HRESULT WINAPI
|
||||||
*/
|
Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||||
|
LPDWORD dwTotal, LPDWORD dwFree)
|
||||||
|
{
|
||||||
|
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||||
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
|
// There is no HEL implentation of this api
|
||||||
|
if (!(This->lpLcl->lpDDCB->cbDDMiscellaneousCallbacks.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY))
|
||||||
|
{
|
||||||
|
return DDERR_NODIRECTDRAWHW;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!dwTotal && !dwFree) || !ddscaps)
|
||||||
|
{
|
||||||
|
return DDERR_INVALIDPARAMS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DDHAL_GETAVAILDRIVERMEMORYDATA memdata;
|
||||||
|
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)
|
||||||
|
return DDERR_NODIRECTDRAWHW;
|
||||||
|
|
||||||
|
if (dwTotal)
|
||||||
|
*dwTotal = memdata.dwTotal;
|
||||||
|
|
||||||
|
if (dwFree)
|
||||||
|
*dwFree = memdata.dwFree;
|
||||||
|
|
||||||
|
return memdata.ddRVal;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
|
HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
|
||||||
LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter)
|
LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -155,17 +155,6 @@ Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
|
||||||
DX_STUB;
|
DX_STUB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Status: Implentation removed due to rewrite
|
|
||||||
*/
|
|
||||||
HRESULT WINAPI
|
|
||||||
Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
|
||||||
LPDWORD total, LPDWORD free)
|
|
||||||
{
|
|
||||||
DX_WINDBG_trace();
|
|
||||||
DX_STUB;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC hdc,
|
HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC hdc,
|
||||||
LPDIRECTDRAWSURFACE7 *lpDDS)
|
LPDIRECTDRAWSURFACE7 *lpDDS)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,6 @@ WCHAR classname[128];
|
||||||
WNDCLASSW wnd_class;
|
WNDCLASSW wnd_class;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
|
Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
|
||||||
REFIID id, BOOL ex)
|
REFIID id, BOOL ex)
|
||||||
|
@ -140,7 +139,6 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
||||||
|
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ddgbl.dwPDevice is not longer in use in windows 2000 and higher
|
* ddgbl.dwPDevice is not longer in use in windows 2000 and higher
|
||||||
* I am using it for device type
|
* I am using it for device type
|
||||||
|
@ -150,8 +148,6 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
||||||
* devicetypes = 4 :loading a guid drv from the register
|
* devicetypes = 4 :loading a guid drv from the register
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (reenable == FALSE)
|
if (reenable == FALSE)
|
||||||
{
|
{
|
||||||
if (This->lpLink == NULL)
|
if (This->lpLink == NULL)
|
||||||
|
@ -364,7 +360,6 @@ StartDirectDrawHel(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
{
|
{
|
||||||
|
|
||||||
LPDWORD mpFourCC;
|
LPDWORD mpFourCC;
|
||||||
DDHALINFO mHALInfo;
|
DDHALINFO mHALInfo;
|
||||||
BOOL newmode = FALSE;
|
BOOL newmode = FALSE;
|
||||||
|
@ -381,7 +376,6 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
RtlZeroMemory(&mD3dDriverData, sizeof(D3DHAL_GLOBALDRIVERDATA));
|
RtlZeroMemory(&mD3dDriverData, sizeof(D3DHAL_GLOBALDRIVERDATA));
|
||||||
RtlZeroMemory(&mD3dBufferCallbacks, sizeof(DDHAL_DDEXEBUFCALLBACKS));
|
RtlZeroMemory(&mD3dBufferCallbacks, sizeof(DDHAL_DDEXEBUFCALLBACKS));
|
||||||
|
|
||||||
|
|
||||||
if (reenable == FALSE)
|
if (reenable == FALSE)
|
||||||
{
|
{
|
||||||
if (ddgbl.lpDDCBtmp == NULL)
|
if (ddgbl.lpDDCBtmp == NULL)
|
||||||
|
@ -407,8 +401,6 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
return DD_FALSE;
|
return DD_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Some card disable the dx after it have been created so
|
/* Some card disable the dx after it have been created so
|
||||||
* we are force reanble it
|
* we are force reanble it
|
||||||
*/
|
*/
|
||||||
|
@ -459,14 +451,12 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
DxHeapMemFree(mpFourCC);
|
DxHeapMemFree(mpFourCC);
|
||||||
DxHeapMemFree(ddgbl.lpDDCBtmp);
|
DxHeapMemFree(ddgbl.lpDDCBtmp);
|
||||||
// FIXME Close DX fristcall and second call
|
// FIXME Close DX fristcall and second call
|
||||||
}
|
|
||||||
return DD_FALSE;
|
return DD_FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Get all basic data from the driver */
|
/* Get all basic data from the driver */
|
||||||
if (!DdQueryDirectDrawObject(
|
if (!DdQueryDirectDrawObject(This->lpLcl->lpGbl,
|
||||||
This->lpLcl->lpGbl,
|
|
||||||
&mHALInfo,
|
&mHALInfo,
|
||||||
&ddgbl.lpDDCBtmp->HALDD,
|
&ddgbl.lpDDCBtmp->HALDD,
|
||||||
&ddgbl.lpDDCBtmp->HALDDSurface,
|
&ddgbl.lpDDCBtmp->HALDDSurface,
|
||||||
|
@ -502,5 +492,19 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
DxHeapMemFree(mpTextures);
|
DxHeapMemFree(mpTextures);
|
||||||
|
|
||||||
/* FIXME D3D setup mD3dCallbacks and mD3dDriverData */
|
/* 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.dwExpectedSize)
|
||||||
|
{
|
||||||
|
DxHeapMemFree(mpFourCC);
|
||||||
|
DxHeapMemFree(mpTextures);
|
||||||
|
DxHeapMemFree(ddgbl.lpDDCBtmp);
|
||||||
|
// FIXME Close DX fristcall and second call
|
||||||
|
return DD_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue