And this is the correct patch.
Sorry about that, ignore the above.

The above actually allocated the memory, this just returns that the op.
didn't succeed which is the correct thing to do. Chessmaster seems to be
happy too.

On Thu, 2004-07-08 at 15:38, Andrei Barbu wrote:
> Changelog:
> 
> Fixes a memory access fault inside of D3D8_GetCreationParameters.
> 
> 
Index: device.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/device.c,v
retrieving revision 1.112
diff -u -r1.112 device.c
--- device.c	14 Jun 2004 16:57:41 -0000	1.112
+++ device.c	8 Jul 2004 22:33:54 -0000
@@ -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