D3D8_GetCreationParameters fix

Andrei Barbu teval at myrealbox.com
Thu Jul 8 17:58:57 CDT 2004


It doesn't have to return that memory, DX functions work by taking
parameters they modify. In essence, that's the point, modifying
pParameters and returning D3D_OK

Andrei

On Thu, 2004-07-08 at 15:50, Marcus Meissner wrote:
> On Fri, Jul 09, 2004 at 04:39:31AM +0900, Mike McCormack wrote:
> > You probably want to use a Windows method to allocate memory here, such 
> > as HeapAlloc() or CoTaskMemAlloc, as the caller is not going to use 
> > free() to free the memory...
> 
> > Mike
> > 
> > Andrei Barbu wrote:
> > >Changelog:
> > >
> > >Fixes a memory access fault inside of D3D8_GetCreationParameters.
> > ...
> > > HRESULT  WINAPI  
> > > IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 iface, 
> > > D3DDEVICE_CREATION_PARAMETERS *pParameters) {
> > >     ICOM_THIS(IDirect3DDevice8Impl,iface);
> > >     TRACE("(%p) copying to %p\n", This, pParameters);    
> > >+
> > >+    pParameters = (D3DDEVICE_CREATION_PARAMETERS*) malloc( sizeof( 
> > >D3DDEVICE_CREATION_PARAMETERS ));
> > >     memcpy(pParameters, &This->CreateParms, 
> > >     sizeof(D3DDEVICE_CREATION_PARAMETERS));
> > >     return D3D_OK;
> > > }
>  
> Its also wrong, because the patch just overwrites the pParameters argument
> and does not return the allocated memory.
> 
> Ciao, Marcus
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20040708/f0e1f922/attachment.pgp


More information about the wine-devel mailing list