*/
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 */
if (pUnkOuter)
*/
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 */
if (pUnkOuter)
{
Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
REFIID id, BOOL ex)
{
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)*pIface;
+ LPDDRAWI_DIRECTDRAW_INT This;
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*/
LPDDRAWI_DIRECTDRAW_INT memThis;
}
else
{
+ DX_STUB_str("2.linking\n");
/* We got the DirectDraw interface alloc and we need create the link */
LPDDRAWI_DIRECTDRAW_INT newThis;
newThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
This->lpLcl->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;
}
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
/* Alloc mpFourCC */
mpFourCC = NULL;
- if (mHALInfo.ddCaps.dwNumFourCCCodes)
+ if (mHALInfo.ddCaps.dwNumFourCCCodes > 0 )
{
mpFourCC = (DWORD *) DxHeapMemAlloc(sizeof(DWORD) * mHALInfo.ddCaps.dwNumFourCCCodes);
if (mpFourCC == NULL)
/* Alloc mpTextures */
mpTextures = NULL;
-
- if (mD3dDriverData.dwNumTextureFormats)
+ if (mD3dDriverData.dwNumTextureFormats > 0)
{
mpTextures = (DDSURFACEDESC*) DxHeapMemAlloc(sizeof(DDSURFACEDESC) * mD3dDriverData.dwNumTextureFormats);
if (mpTextures == NULL)