mirror of
https://github.com/reactos/reactos.git
synced 2024-08-02 17:40:58 +00:00
fixing some smaller bugs found by the regress test
svn path=/trunk/; revision=26816
This commit is contained in:
parent
1ddfd23075
commit
b527796afa
|
@ -82,6 +82,8 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
|
||||||
desc.dwFlags = desc.dwFlags & DDSD_ALL;
|
desc.dwFlags = desc.dwFlags & DDSD_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* more code will follow */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return DDERR_GENERIC;
|
return DDERR_GENERIC;
|
||||||
|
|
|
@ -40,11 +40,6 @@ DirectDrawCreate (LPGUID lpGUID,
|
||||||
*/
|
*/
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
/* check the pointer if it vaild to read from */
|
|
||||||
if (IsBadWritePtr( lplpDD, sizeof( LPVOID )) )
|
|
||||||
{
|
|
||||||
return DDERR_INVALIDPARAMS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check see if pUnkOuter is null or not */
|
/* check see if pUnkOuter is null or not */
|
||||||
if (pUnkOuter)
|
if (pUnkOuter)
|
||||||
|
@ -75,12 +70,6 @@ DirectDrawCreateEx(LPGUID lpGUID,
|
||||||
*/
|
*/
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
/* check the pointer if it vaild to read from */
|
|
||||||
if (IsBadWritePtr( lplpDD, sizeof( LPVOID )) )
|
|
||||||
{
|
|
||||||
return DDERR_INVALIDPARAMS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check see if pUnkOuter is null or not */
|
/* check see if pUnkOuter is null or not */
|
||||||
if (pUnkOuter)
|
if (pUnkOuter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,12 +25,21 @@ HRESULT WINAPI
|
||||||
Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
|
Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
|
||||||
REFIID id, BOOL ex)
|
REFIID id, BOOL ex)
|
||||||
{
|
{
|
||||||
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)*pIface;
|
LPDDRAWI_DIRECTDRAW_INT This;
|
||||||
|
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
if (This == NULL)
|
if ((IsBadReadPtr(pIface,sizeof(LPDIRECTDRAW))) ||
|
||||||
|
(IsBadWritePtr(pIface,sizeof(LPDIRECTDRAW))))
|
||||||
{
|
{
|
||||||
|
return DDERR_INVALIDPARAMS;
|
||||||
|
}
|
||||||
|
|
||||||
|
This = (LPDDRAWI_DIRECTDRAW_INT)*pIface;
|
||||||
|
|
||||||
|
if (IsBadReadPtr(This,sizeof(LPDIRECTDRAW)))
|
||||||
|
{
|
||||||
|
DX_STUB_str("1. no linking\n");
|
||||||
/* We do not have a DirectDraw interface, we need alloc it*/
|
/* We do not have a DirectDraw interface, we need alloc it*/
|
||||||
LPDDRAWI_DIRECTDRAW_INT memThis;
|
LPDDRAWI_DIRECTDRAW_INT memThis;
|
||||||
|
|
||||||
|
@ -47,6 +56,7 @@ Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
DX_STUB_str("2.linking\n");
|
||||||
/* We got the DirectDraw interface alloc and we need create the link */
|
/* We got the DirectDraw interface alloc and we need create the link */
|
||||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||||
newThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
|
newThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
@ -269,7 +279,7 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
||||||
This->lpLcl->hDD = This->lpLcl->lpGbl->hDD;
|
This->lpLcl->hDD = This->lpLcl->lpGbl->hDD;
|
||||||
ddgbl.hDD = This->lpLcl->lpGbl->hDD;
|
ddgbl.hDD = This->lpLcl->lpGbl->hDD;
|
||||||
|
|
||||||
DX_STUB_str("DD_OK");
|
DX_STUB_str("DD_OK\n");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,10 +384,13 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
|
|
||||||
if (reenable == FALSE)
|
if (reenable == FALSE)
|
||||||
{
|
{
|
||||||
ddgbl.lpDDCBtmp = DxHeapMemAlloc(sizeof(DDHAL_CALLBACKS));
|
if (ddgbl.lpDDCBtmp == NULL)
|
||||||
if ( ddgbl.lpDDCBtmp == NULL)
|
|
||||||
{
|
{
|
||||||
return DD_FALSE;
|
ddgbl.lpDDCBtmp = DxHeapMemAlloc(sizeof(DDHAL_CALLBACKS));
|
||||||
|
if ( ddgbl.lpDDCBtmp == NULL)
|
||||||
|
{
|
||||||
|
return DD_FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -425,7 +438,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
|
|
||||||
/* Alloc mpFourCC */
|
/* Alloc mpFourCC */
|
||||||
mpFourCC = NULL;
|
mpFourCC = NULL;
|
||||||
if (mHALInfo.ddCaps.dwNumFourCCCodes)
|
if (mHALInfo.ddCaps.dwNumFourCCCodes > 0 )
|
||||||
{
|
{
|
||||||
mpFourCC = (DWORD *) DxHeapMemAlloc(sizeof(DWORD) * mHALInfo.ddCaps.dwNumFourCCCodes);
|
mpFourCC = (DWORD *) DxHeapMemAlloc(sizeof(DWORD) * mHALInfo.ddCaps.dwNumFourCCCodes);
|
||||||
if (mpFourCC == NULL)
|
if (mpFourCC == NULL)
|
||||||
|
@ -438,8 +451,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
||||||
|
|
||||||
/* Alloc mpTextures */
|
/* Alloc mpTextures */
|
||||||
mpTextures = NULL;
|
mpTextures = NULL;
|
||||||
|
if (mD3dDriverData.dwNumTextureFormats > 0)
|
||||||
if (mD3dDriverData.dwNumTextureFormats)
|
|
||||||
{
|
{
|
||||||
mpTextures = (DDSURFACEDESC*) DxHeapMemAlloc(sizeof(DDSURFACEDESC) * mD3dDriverData.dwNumTextureFormats);
|
mpTextures = (DDSURFACEDESC*) DxHeapMemAlloc(sizeof(DDSURFACEDESC) * mD3dDriverData.dwNumTextureFormats);
|
||||||
if (mpTextures == NULL)
|
if (mpTextures == NULL)
|
||||||
|
|
Loading…
Reference in a new issue