MSDN says that if it's given an invalid pointer it should return
D3DERR_INVALIDCALL, so that's what it does now.

MSDN:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/d3d/interfaces/idirect3ddevice9/GetCreationParameters.asp

So I'm guessing this is right now.

I don't have a windows computer to check this against, but it does
comply with the docs.

Andrei

On Fri, 2004-07-09 at 11:19, Mike McCormack wrote:
> This patch is better than the first one, but...
> 
> Windows doesn't usually check pointers like this.  Can you try testing 
> the Windows implementation of IDirect3DDevice8->GetCreationParameters() 
> to see whether it crashes when passed an invalid pointer such as NULL or 
> 0x00000001?  It may be that the invalid pointer is coming from somewhere 
> else in Wine's code, so you may be just hiding another bug.
> 
> Mike
> 
> Andrei Barbu wrote:
> > And this is the correct patch.
> 
> > @@ -380,6 +381,12 @@
> >  HRESULT  WINAPI  IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 
> > iface, D3DDEVICE_CREATION_PARAMETERS *pParameters) {
> >      ICOM_THIS(IDirect3DDevice8Impl,iface);
> >      TRACE("(%p) copying to %p\n", This, pParameters);    
> > +
> > +    if( IsBadWritePtr( pParameters , sizeof( D3DDEVICE_CREATION_PARAMETERS ) ) )
> > +    {
> > +   WARN("(%p) : bad pointer in device caps (%p)\n", This, pParameters);
> > +   return D3DERR_INVALIDCALL;
> > +    }
> >      memcpy(pParameters, &This->CreateParms, 
> > sizeof(D3DDEVICE_CREATION_PARAMETERS));
> >      return D3D_OK;
> >  }
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to