This patch add a pointer of the object itself just after each VTable as shown below : object { VTable1 pointer to object VTable2 pointer to object .......................... VTableN pointer to object private data } The benefits are : - the object is retreived directly and it no more necessary to known the interface used - increase functions sharing and reduce interface thunks usage This patch is a part of the D3D restructuration. Modified files : dlls/ddraw d3d_private.h d3dexecutebuffer.c d3dlight.c d3dmaterial.c d3dtexture.c d3dviewport.c ddcomimpl.h dlls/ddraw/d3ddevice main.c mesa.c dlls/ddraw/dclipper main.c dlls/ddraw/ddraw hal.c main.c user.c dlls/ddraw/direct3d main.c mesa.c dlls/ddraw/dpalette main.c hal.c dlls/ddraw/durface dib.c main.c gamma.c hal.c Changelog : Enhance ddraw COM macros by adding a pointer to the object itself after each VTable and make use of them. Christian Costa titan.costa@wanadoo.fr
Index: d3d_private.h =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3d_private.h,v retrieving revision 1.9 diff -u -r1.9 d3d_private.h --- d3d_private.h 16 Oct 2002 18:57:52 -0000 1.9 +++ d3d_private.h 28 Oct 2002 21:56:44 -0000 @@ -53,7 +53,7 @@ struct IDirect3DImpl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3D); + ICOM_VFIELD_MULTI(IDirect3D); DWORD ref; /* IDirect3D fields */ IDirectDrawImpl* ddraw; @@ -66,7 +66,7 @@ struct IDirect3D2Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3D2); + ICOM_VFIELD_MULTI(IDirect3D2); DWORD ref; /* IDirect3D2 fields */ IDirectDrawImpl* ddraw; @@ -76,7 +76,7 @@ struct IDirect3D3Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3D3); + ICOM_VFIELD_MULTI(IDirect3D3); DWORD ref; /* IDirect3D2 fields */ IDirectDrawImpl* ddraw; @@ -84,7 +84,6 @@ /* IDirect3D3 fields */ }; - extern HRESULT WINAPI IDirect3DImpl_QueryInterface( LPDIRECT3D iface,REFIID refiid,LPVOID *obj ); @@ -136,7 +135,7 @@ struct IDirect3DLightImpl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3DLight); + ICOM_VFIELD_MULTI(IDirect3DLight); DWORD ref; /* IDirect3DLight fields */ union { @@ -163,7 +162,7 @@ struct IDirect3DMaterial2Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3DMaterial2); + ICOM_VFIELD_MULTI(IDirect3DMaterial2); DWORD ref; /* IDirect3DMaterial2 fields */ union { @@ -188,7 +187,7 @@ struct IDirect3DTexture2Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3DTexture2); + ICOM_VFIELD_MULTI(IDirect3DTexture2); DWORD ref; /* IDirect3DTexture2 fields */ void* D3Ddevice; /* (void *) to use the same pointer @@ -228,7 +227,7 @@ struct IDirect3DViewport2Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3DViewport2); + ICOM_VFIELD_MULTI(IDirect3DViewport2); DWORD ref; /* IDirect3DViewport2 fields */ union { @@ -321,7 +320,7 @@ struct IDirect3DExecuteBufferImpl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3DExecuteBuffer); + ICOM_VFIELD_MULTI(IDirect3DExecuteBuffer); DWORD ref; /* IDirect3DExecuteBuffer fields */ IDirect3DDeviceImpl* d3ddev; @@ -350,7 +349,7 @@ struct IDirect3DDeviceImpl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3DDevice); + ICOM_VFIELD_MULTI(IDirect3DDevice); DWORD ref; /* IDirect3DDevice fields */ IDirect3DImpl* d3d; @@ -370,7 +369,7 @@ struct IDirect3DDevice2Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirect3DDevice2); + ICOM_VFIELD_MULTI(IDirect3DDevice2); DWORD ref; /* IDirect3DDevice fields */ IDirect3D2Impl* d3d; Index: d3dexecutebuffer.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3dexecutebuffer.c,v retrieving revision 1.11 diff -u -r1.11 d3dexecutebuffer.c --- d3dexecutebuffer.c 29 Sep 2002 18:01:13 -0000 1.11 +++ d3dexecutebuffer.c 28 Oct 2002 21:56:46 -0000 @@ -186,8 +186,8 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, LPDIRECT3DDEVICE dev, LPDIRECT3DVIEWPORT vp) { - IDirect3DExecuteBufferImpl* ilpBuff=(IDirect3DExecuteBufferImpl*)lpBuff; - IDirect3DViewport2Impl* ivp=(IDirect3DViewport2Impl*)vp; + IDirect3DExecuteBufferImpl* ilpBuff=ICOM_OBJECT(IDirect3DExecuteBufferImpl,lpBuff); + IDirect3DViewport2Impl* ivp=ICOM_OBJECT(IDirect3DViewport2Impl,vp); /* DWORD bs = ilpBuff->desc.dwBufferSize; */ DWORD vs = ilpBuff->data.dwVertexOffset; /* DWORD vc = ilpBuff->data.dwVertexCount; */ @@ -195,12 +195,12 @@ /* DWORD il = ilpBuff->data.dwInstructionLength; */ void *instr = ilpBuff->desc.lpData + is; - D3DDPRIVATE((IDirect3DDeviceImpl*)dev); + D3DDPRIVATE(ICOM_OBJECT(IDirect3DDeviceImpl,dev)); /* Should check if the viewport was added or not to the device */ /* Activate the viewport */ - ivp->device.active_device1 = (IDirect3DDeviceImpl*)dev; + ivp->device.active_device1 = ICOM_OBJECT(IDirect3DDeviceImpl,dev); ivp->activate(ivp); TRACE("ExecuteData : \n"); @@ -422,7 +422,7 @@ /* Handle the state transform */ switch (ci->u1.dlstLightStateType) { case D3DLIGHTSTATE_MATERIAL: { - IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) ci->u2.dwArg[0]; + IDirect3DMaterial2Impl* mat = ICOM_OBJECT(IDirect3DMaterial2Impl,ci->u2.dwArg[0]); TRACE(" MATERIAL\n"); if (mat != NULL) { @@ -690,7 +690,7 @@ eb = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DExecuteBufferImpl)); eb->ref = 1; - ICOM_VTBL(eb) = &executebuffer_vtable; + ICOM_INIT_INTERFACE(eb,IDirect3DExecuteBuffer,executebuffer_vtable); eb->d3ddev = d3ddev; /* Initializes memory */ @@ -730,7 +730,7 @@ REFIID riid, LPVOID* ppvObj) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); @@ -741,7 +741,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_AddRef(LPDIRECT3DEXECUTEBUFFER iface) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -751,7 +751,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_Release(LPDIRECT3DEXECUTEBUFFER iface) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -772,7 +772,7 @@ LPDIRECT3DDEVICE lpDirect3DDevice, LPD3DEXECUTEBUFFERDESC lpDesc) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpDirect3DDevice, lpDesc); return DD_OK; @@ -781,7 +781,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Lock(LPDIRECT3DEXECUTEBUFFER iface, LPD3DEXECUTEBUFFERDESC lpDesc) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); TRACE("(%p)->(%p)\n", This, lpDesc); /* Copies the buffer description */ @@ -792,7 +792,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Unlock(LPDIRECT3DEXECUTEBUFFER iface) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); TRACE("(%p)->()\n", This); return DD_OK; @@ -801,7 +801,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_SetExecuteData(LPDIRECT3DEXECUTEBUFFER iface, LPD3DEXECUTEDATA lpData) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); DWORD nbvert; TRACE("(%p)->(%p)\n", This, lpData); @@ -827,7 +827,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_GetExecuteData(LPDIRECT3DEXECUTEBUFFER iface, LPD3DEXECUTEDATA lpData) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); TRACE("(%p)->(%p): stub\n", This, lpData); *lpData = This->data; @@ -841,7 +841,7 @@ LPVOID lpUserArg, DWORD dwReserved) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); TRACE("(%p)->(%p,%p,%p,%lu)\n", This, lpdwOffset, lpFunc, lpUserArg, dwReserved); return DD_OK; @@ -850,7 +850,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Optimize(LPDIRECT3DEXECUTEBUFFER iface, DWORD dwReserved) { - ICOM_THIS(IDirect3DExecuteBufferImpl,iface); + ICOM_THIS_MULTI(IDirect3DExecuteBufferImpl,iface); TRACE("(%p)->(%lu)\n", This, dwReserved); return DD_OK; Index: d3dlight.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3dlight.c,v retrieving revision 1.8 diff -u -r1.8 d3dlight.c --- d3dlight.c 26 Sep 2002 03:20:23 -0000 1.8 +++ d3dlight.c 28 Oct 2002 21:56:46 -0000 @@ -113,7 +113,7 @@ light = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLightImpl)); light->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dl_private)); light->ref = 1; - ICOM_VTBL(light) = &light_vtable; + ICOM_INIT_INTERFACE(light,IDirect3DLight,light_vtable); light->d3d.d3d2 = d3d2; light->type = D3D_2; @@ -132,7 +132,7 @@ light = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLightImpl)); light->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dl_private)); light->ref = 1; - ICOM_VTBL(light) = &light_vtable; + ICOM_INIT_INTERFACE(light,IDirect3DLight,light_vtable); light->d3d.d3d1 = d3d1; light->type = D3D_1; @@ -153,7 +153,7 @@ REFIID riid, LPVOID* ppvObj) { - ICOM_THIS(IDirect3DLightImpl,iface); + ICOM_THIS_MULTI(IDirect3DLightImpl,iface); FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); @@ -164,7 +164,7 @@ static ULONG WINAPI IDirect3DLightImpl_AddRef(LPDIRECT3DLIGHT iface) { - ICOM_THIS(IDirect3DLightImpl,iface); + ICOM_THIS_MULTI(IDirect3DLightImpl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -174,7 +174,7 @@ static ULONG WINAPI IDirect3DLightImpl_Release(LPDIRECT3DLIGHT iface) { - ICOM_THIS(IDirect3DLightImpl,iface); + ICOM_THIS_MULTI(IDirect3DLightImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -195,7 +195,7 @@ static HRESULT WINAPI IDirect3DLightImpl_GetLight(LPDIRECT3DLIGHT iface, LPD3DLIGHT lpLight) { - ICOM_THIS(IDirect3DLightImpl,iface); + ICOM_THIS_MULTI(IDirect3DLightImpl,iface); TRACE("(%p)->(%p)\n", This, lpLight); if (TRACE_ON(ddraw)) dump_light(lpLight); @@ -216,7 +216,7 @@ static HRESULT WINAPI IDirect3DLightImpl_SetLight(LPDIRECT3DLIGHT iface, LPD3DLIGHT lpLight) { - ICOM_THIS(IDirect3DLightImpl,iface); + ICOM_THIS_MULTI(IDirect3DLightImpl,iface); TRACE("(%p)->(%p)\n", This, lpLight); if (TRACE_ON(ddraw)) dump_light(lpLight); @@ -243,7 +243,7 @@ LPDIRECT3D lpDirect3D) { - ICOM_THIS(IDirect3DLightImpl,iface); + ICOM_THIS_MULTI(IDirect3DLightImpl,iface); TRACE("(%p)->(%p)\n", This, lpDirect3D); return DDERR_ALREADYINITIALIZED; Index: d3dmaterial.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3dmaterial.c,v retrieving revision 1.9 diff -u -r1.9 d3dmaterial.c --- d3dmaterial.c 31 May 2002 23:25:45 -0000 1.9 +++ d3dmaterial.c 28 Oct 2002 21:56:49 -0000 @@ -82,7 +82,7 @@ mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2Impl)); mat->ref = 1; - ICOM_VTBL(mat) = &material2_vtable; + ICOM_INIT_INTERFACE(mat,IDirect3DMaterial2,material2_vtable); mat->use_d3d2 = 1; mat->d3d.d3d2 = d3d2; @@ -98,7 +98,7 @@ mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2Impl)); mat->ref = 1; - ICOM_VTBL(mat) = (ICOM_VTABLE(IDirect3DMaterial2)*)&material_vtable; + ICOM_INIT_INTERFACE(mat,IDirect3DMaterial2,*((ICOM_VTABLE(IDirect3DMaterial2)*)&material_vtable)); mat->use_d3d2 = 0; mat->d3d.d3d1 = d3d1; @@ -116,7 +116,7 @@ REFIID riid, LPVOID* ppvObj) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); @@ -127,7 +127,7 @@ static ULONG WINAPI IDirect3DMaterial2Impl_AddRef(LPDIRECT3DMATERIAL2 iface) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -137,7 +137,7 @@ static ULONG WINAPI IDirect3DMaterial2Impl_Release(LPDIRECT3DMATERIAL2 iface) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -157,7 +157,7 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_GetMaterial(LPDIRECT3DMATERIAL2 iface, LPD3DMATERIAL lpMat) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); TRACE("(%p)->(%p)\n", This, lpMat); if (TRACE_ON(ddraw)) dump_material(lpMat); @@ -171,7 +171,7 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_SetMaterial(LPDIRECT3DMATERIAL2 iface, LPD3DMATERIAL lpMat) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); TRACE("(%p)->(%p)\n", This, lpMat); if (TRACE_ON(ddraw)) dump_material(lpMat); @@ -187,13 +187,13 @@ LPD3DMATERIALHANDLE lpMatHandle) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpD3DDevice2, lpMatHandle); if (This->use_d3d2) - This->device.active_device2 = (IDirect3DDevice2Impl*)lpD3DDevice2; + This->device.active_device2 = ICOM_OBJECT(IDirect3DDevice2Impl,lpD3DDevice2); else - This->device.active_device1 = (IDirect3DDeviceImpl*)lpD3DDevice2; + This->device.active_device1 = ICOM_OBJECT(IDirect3DDeviceImpl,lpD3DDevice2); *lpMatHandle = (DWORD) This; /* lpD3DDevice2->store_material(This); */ @@ -202,7 +202,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Reserve(LPDIRECT3DMATERIAL iface) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); FIXME("(%p)->(): stub\n", This); return DDERR_INVALIDPARAMS; @@ -210,7 +210,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Unreserve(LPDIRECT3DMATERIAL iface) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); FIXME("(%p)->(): stub\n", This); return DDERR_INVALIDPARAMS; @@ -220,7 +220,7 @@ LPDIRECT3D lpDirect3D) { - ICOM_THIS(IDirect3DMaterial2Impl,iface); + ICOM_THIS_MULTI(IDirect3DMaterial2Impl,iface); TRACE("(%p)->(%p)\n", This, lpDirect3D); return DDERR_ALREADYINITIALIZED; Index: d3dtexture.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3dtexture.c,v retrieving revision 1.15 diff -u -r1.15 d3dtexture.c --- d3dtexture.c 16 Oct 2002 18:57:52 -0000 1.15 +++ d3dtexture.c 28 Oct 2002 21:56:49 -0000 @@ -121,7 +121,7 @@ tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl)); tex->ref = 1; - ICOM_VTBL(tex) = &mesa_texture2_vtable; + ICOM_INIT_INTERFACE(tex,IDirect3DTexture2,mesa_texture2_vtable); tex->surface = surf; tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private)); @@ -138,7 +138,7 @@ tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl)); tex->ref = 1; - ICOM_VTBL(tex) = (ICOM_VTABLE(IDirect3DTexture2)*)&mesa_texture_vtable; + ICOM_INIT_INTERFACE(tex,IDirect3DTexture2,*((ICOM_VTABLE(IDirect3DTexture2)*)&mesa_texture_vtable)); tex->surface = surf; tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private)); @@ -244,7 +244,7 @@ REFIID riid, LPVOID* ppvObj) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); @@ -255,7 +255,7 @@ ULONG WINAPI IDirect3DTexture2Impl_AddRef(LPDIRECT3DTEXTURE2 iface) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -265,7 +265,7 @@ ULONG WINAPI IDirect3DTexture2Impl_Release(LPDIRECT3DTEXTURE2 iface) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); D3DTPRIVATE(This); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); @@ -290,9 +290,9 @@ LPDIRECT3DDEVICE lpD3DDevice, LPD3DTEXTUREHANDLE lpHandle) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); D3DTPRIVATE(This); - IDirect3DDeviceImpl* ilpD3DDevice=(IDirect3DDeviceImpl*)lpD3DDevice; + IDirect3DDeviceImpl* ilpD3DDevice=ICOM_OBJECT(IDirect3DDeviceImpl,lpD3DDevice); FIXME("(%p)->(%p,%p): stub\n", This, ilpD3DDevice, lpHandle); *lpHandle = (D3DTEXTUREHANDLE) This; @@ -310,7 +310,7 @@ if (ilpD3DDevice->current_texture) IDirect3DTexture2Impl_Release((LPDIRECT3DTEXTURE2)ilpD3DDevice->current_texture); IDirect3DTexture2Impl_AddRef((LPDIRECT3DTEXTURE2)iface); - ilpD3DDevice->current_texture = (IDirect3DTexture2Impl*)iface; + ilpD3DDevice->current_texture = ICOM_OBJECT(IDirect3DTexture2Impl,iface); TRACE("OpenGL texture handle is : %d\n", dtpriv->tex_name); @@ -321,7 +321,7 @@ LPDIRECT3DDEVICE lpD3DDevice, LPDIRECTDRAWSURFACE lpSurface) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); TRACE("(%p)->(%p,%p)\n", This, lpD3DDevice, lpSurface); return DDERR_ALREADYINITIALIZED; @@ -329,7 +329,7 @@ HRESULT WINAPI IDirect3DTextureImpl_Unload(LPDIRECT3DTEXTURE iface) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); FIXME("(%p)->(): stub\n", This); return D3D_OK; @@ -340,9 +340,9 @@ LPDIRECT3DDEVICE2 lpD3DDevice2, LPD3DTEXTUREHANDLE lpHandle) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); D3DTPRIVATE(This); - IDirect3DDevice2Impl* ilpD3DDevice2=(IDirect3DDevice2Impl*)lpD3DDevice2; + IDirect3DDevice2Impl* ilpD3DDevice2=ICOM_OBJECT(IDirect3DDevice2Impl,lpD3DDevice2); TRACE("(%p)->(%p,%p)\n", This, ilpD3DDevice2, lpHandle); /* For 32 bits OSes, handles = pointers */ @@ -361,7 +361,7 @@ if (ilpD3DDevice2->current_texture) IDirect3DTexture2Impl_Release((LPDIRECT3DTEXTURE2)ilpD3DDevice2->current_texture); IDirect3DTexture2Impl_AddRef(iface); - ilpD3DDevice2->current_texture = (IDirect3DTexture2Impl*)iface; + ilpD3DDevice2->current_texture = ICOM_OBJECT(IDirect3DTexture2Impl,iface); TRACE("OpenGL texture handle is : %d\n", dtpriv->tex_name); @@ -372,7 +372,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_PaletteChanged( LPDIRECT3DTEXTURE2 iface, DWORD dwStart, DWORD dwCount ) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); FIXME("(%p)->(%8ld,%8ld): stub\n", This, dwStart, dwCount); return D3D_OK; @@ -383,9 +383,9 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( LPDIRECT3DTEXTURE2 iface, LPDIRECT3DTEXTURE2 lpD3DTexture2 ) { - ICOM_THIS(IDirect3DTexture2Impl,iface); + ICOM_THIS_MULTI(IDirect3DTexture2Impl,iface); D3DTPRIVATE(This); - IDirect3DTexture2Impl* ilpD3DTexture2=(IDirect3DTexture2Impl*)lpD3DTexture2; + IDirect3DTexture2Impl* ilpD3DTexture2=ICOM_OBJECT(IDirect3DTexture2Impl,lpD3DTexture2); DDSURFACEDESC *src_d, *dst_d; static void (*ptr_ColorTableEXT) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) = NULL; Index: d3dviewport.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3dviewport.c,v retrieving revision 1.9 diff -u -r1.9 d3dviewport.c --- d3dviewport.c 29 Sep 2002 18:00:43 -0000 1.9 +++ d3dviewport.c 28 Oct 2002 21:56:49 -0000 @@ -63,7 +63,7 @@ vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl)); vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private)); vp->ref = 1; - ICOM_VTBL(vp) = &viewport2_vtable; + ICOM_INIT_INTERFACE(vp,IDirect3DViewport2,viewport2_vtable); vp->d3d.d3d2 = d3d2; vp->use_d3d2 = 1; @@ -84,7 +84,7 @@ vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl)); vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private)); vp->ref = 1; - ICOM_VTBL(vp) = &viewport2_vtable; + ICOM_INIT_INTERFACE(vp,IDirect3DViewport2,viewport2_vtable); vp->d3d.d3d1 = d3d1; vp->use_d3d2 = 0; @@ -106,7 +106,7 @@ REFIID riid, LPVOID* ppvObj) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); @@ -117,7 +117,7 @@ ULONG WINAPI IDirect3DViewport2Impl_AddRef(LPDIRECT3DVIEWPORT2 iface) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -127,7 +127,7 @@ ULONG WINAPI IDirect3DViewport2Impl_Release(LPDIRECT3DVIEWPORT2 iface) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -143,7 +143,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_Initialize(LPDIRECT3DVIEWPORT2 iface, LPDIRECT3D d3d) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, d3d); return DD_OK; @@ -152,7 +152,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetViewport(LPDIRECT3DVIEWPORT2 iface, LPD3DVIEWPORT lpvp) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpvp); if (This->use_vp2 != 0) @@ -166,7 +166,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport(LPDIRECT3DVIEWPORT2 iface, LPD3DVIEWPORT lpvp) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpvp); This->use_vp2 = 0; @@ -193,7 +193,7 @@ DWORD dwFlags, LPDWORD lpOffScreen) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%8ld,%p,%08lx,%p): stub\n", This, dwVertexCount, lpData, dwFlags, lpOffScreen); @@ -204,7 +204,7 @@ DWORD dwElementCount, LPD3DLIGHTDATA lpData) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%8ld,%p): stub\n", This, dwElementCount, lpData); return DD_OK; @@ -213,7 +213,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetBackground(LPDIRECT3DVIEWPORT2 iface, D3DMATERIALHANDLE hMat) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%08lx): stub\n", This, (DWORD) hMat); return DD_OK; @@ -223,7 +223,7 @@ LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lphMat, lpValid); return DD_OK; @@ -232,7 +232,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetBackgroundDepth(LPDIRECT3DVIEWPORT2 iface, LPDIRECTDRAWSURFACE lpDDSurface) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpDDSurface); return DD_OK; @@ -242,7 +242,7 @@ LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lplpDDSurface, lpValid); return DD_OK; @@ -253,7 +253,7 @@ LPD3DRECT lpRects, DWORD dwFlags) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); GLboolean ztest; FIXME("(%p)->(%8ld,%p,%08lx): stub\n", This, dwCount, lpRects, dwFlags); @@ -280,8 +280,8 @@ HRESULT WINAPI IDirect3DViewport2Impl_AddLight(LPDIRECT3DVIEWPORT2 iface, LPDIRECT3DLIGHT lpLight) { - ICOM_THIS(IDirect3DViewport2Impl,iface); - IDirect3DLightImpl* ilpLight=(IDirect3DLightImpl*)lpLight; + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); + IDirect3DLightImpl* ilpLight=ICOM_OBJECT(IDirect3DLightImpl,lpLight); FIXME("(%p)->(%p): stub\n", This, ilpLight); /* Add the light in the 'linked' chain */ @@ -310,7 +310,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_DeleteLight(LPDIRECT3DVIEWPORT2 iface, LPDIRECT3DLIGHT lpLight) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); IDirect3DLightImpl** currentlplpLight; TRACE("(%p)->(%p): stub\n", This, lpLight); @@ -331,7 +331,7 @@ LPDIRECT3DLIGHT* lplpLight, DWORD dwFlags) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p,%p,%08lx): stub\n", This, lpLight, lplpLight, dwFlags); return DD_OK; @@ -341,7 +341,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetViewport2(LPDIRECT3DVIEWPORT2 iface, LPD3DVIEWPORT2 lpViewport2) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); TRACE("(%p)->(%p)\n", This, lpViewport2); if (This->use_vp2 != 1) @@ -355,7 +355,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport2(LPDIRECT3DVIEWPORT2 iface, LPD3DVIEWPORT2 lpViewport2) { - ICOM_THIS(IDirect3DViewport2Impl,iface); + ICOM_THIS_MULTI(IDirect3DViewport2Impl,iface); TRACE("(%p)->(%p)\n", This, lpViewport2); TRACE("dwSize = %ld dwX = %ld dwY = %ld\n", Index: ddcomimpl.h =================================================================== RCS file: /home/wine/wine/dlls/ddraw/ddcomimpl.h,v retrieving revision 1.2 diff -u -r1.2 ddcomimpl.h --- ddcomimpl.h 9 Mar 2002 23:29:35 -0000 1.2 +++ ddcomimpl.h 28 Oct 2002 21:56:49 -0000 @@ -17,37 +17,47 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifndef _DDCOMIMPL_H_ +#define _DDCOMIMPL_H_ + #include <stddef.h> +#define INTERFACE(iface) \ + struct { \ + iface interface; \ + LPVOID object; \ + } + +typedef INTERFACE(LPVOID) Interface; + /* Generates the name for a vtable pointer for a given interface. */ /* The canonical name for a single interface is "lpVtbl". */ #define ICOM_VFIELD_MULTI_NAME2(iface) ITF_##iface #define ICOM_VFIELD_MULTI_NAME(iface) ICOM_VFIELD_MULTI_NAME2(iface) -/* Declares a vtable pointer field in an implementation. */ #define ICOM_VFIELD_MULTI(iface) \ - iface ICOM_VFIELD_MULTI_NAME(iface) - -/* Returns the offset of a vtable pointer within an implementation object. */ -#define ICOM_VFIELD_OFFSET(impltype, iface) \ - offsetof(impltype, ICOM_VFIELD_MULTI_NAME(iface)) + INTERFACE(iface) ICOM_VFIELD_MULTI_NAME(iface) /* Given an interface pointer, returns the implementation pointer. */ -#define ICOM_OBJECT(impltype, ifacename, ifaceptr) \ - (impltype*)((ifaceptr) == NULL ? NULL \ - : (char*)(ifaceptr) - ICOM_VFIELD_OFFSET(impltype,ifacename)) - -#define ICOM_THIS_FROM(impltype, ifacename, ifaceptr) \ - impltype* This = ICOM_OBJECT(impltype, ifacename, ifaceptr) - +#define ICOM_OBJECT(impltype, ifaceptr) \ + (impltype*)(((LPVOID)ifaceptr) == NULL ? NULL \ + : ((Interface*)(ifaceptr))->object) + +#define ICOM_THIS_MULTI(impltype, ifaceptr) \ + impltype* This = ICOM_OBJECT(impltype, ifaceptr) + /* Given an object and interface name, returns a pointer to that interface. */ #define ICOM_INTERFACE(implobj, iface) \ - (&((implobj)->ICOM_VFIELD_MULTI_NAME(iface))) + (&((implobj)->ICOM_VFIELD_MULTI_NAME(iface)).interface) #define ICOM_INIT_INTERFACE(implobj, ifacename, vtblname) \ do { \ - (implobj)->ICOM_VFIELD_MULTI_NAME(ifacename).lpVtbl = &(vtblname); \ + (implobj)->ICOM_VFIELD_MULTI_NAME(ifacename).interface.lpVtbl = &(vtblname); \ + (implobj)->ICOM_VFIELD_MULTI_NAME(ifacename).object = implobj; \ } while (0) -#define COM_INTERFACE_CAST(impltype, ifnamefrom, ifnameto, ifaceptr) \ - ICOM_INTERFACE(ICOM_OBJECT(impltype, ifnamefrom, ifaceptr), ifnameto) +#define COM_INTERFACE_CAST(impltype, ifnamefrom, ifnameto, ifaceptr) \ + ICOM_INTERFACE(ICOM_OBJECT(impltype, ifaceptr), ifnameto) + +#endif /* _DDCOMIMPL_H_ */ + Index: d3ddevice/main.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3ddevice/main.c,v retrieving revision 1.12 diff -u -r1.12 main.c --- d3ddevice/main.c 16 Oct 2002 18:57:52 -0000 1.12 +++ d3ddevice/main.c 28 Oct 2002 21:56:50 -0000 @@ -40,14 +40,14 @@ HRESULT WINAPI IDirect3DDevice2Impl_QueryInterface( LPDIRECT3DDEVICE2 iface, REFIID riid, LPVOID* ppvObj ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); return S_OK; } ULONG WINAPI IDirect3DDevice2Impl_AddRef(LPDIRECT3DDEVICE2 iface) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -57,7 +57,7 @@ ULONG WINAPI IDirect3DDevice2Impl_Release(LPDIRECT3DDEVICE2 iface) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -77,7 +77,7 @@ LPDIRECT3DDEVICE2 iface, LPD3DDEVICEDESC lpdescsoft, LPD3DDEVICEDESC lpdeschard ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p,%p), stub!\n", This, lpdescsoft, lpdeschard); return DD_OK; } @@ -87,13 +87,15 @@ HRESULT WINAPI IDirect3DDevice2Impl_SwapTextureHandles( LPDIRECT3DDEVICE2 iface,LPDIRECT3DTEXTURE2 lpD3DTex1,LPDIRECT3DTEXTURE2 lpD3DTex2 ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); + IDirect3DTexture2Impl* Impl1 = ICOM_OBJECT(IDirect3DTexture2Impl,lpD3DTex1); + IDirect3DTexture2Impl* Impl2 = ICOM_OBJECT(IDirect3DTexture2Impl,lpD3DTex2); IDirect3DTexture2Impl tmp; TRACE("(%p)->(%p,%p)\n", This, lpD3DTex1, lpD3DTex2); - tmp = *(IDirect3DTexture2Impl*)lpD3DTex1; - *(IDirect3DTexture2Impl*)lpD3DTex1 = *(IDirect3DTexture2Impl*)lpD3DTex2; - *(IDirect3DTexture2Impl*)lpD3DTex2 = tmp; + tmp = *Impl1; + *Impl1 = *Impl2; + *Impl2 = tmp; return DD_OK; } @@ -101,7 +103,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetStats( LPDIRECT3DDEVICE2 iface, LPD3DSTATS lpstats) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpstats); return DD_OK; @@ -110,7 +112,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_AddViewport( LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); IDirect3DViewport2Impl* ilpvp=(IDirect3DViewport2Impl*)lpvp; TRACE("(%p)->(%p)\n", This, ilpvp); @@ -124,8 +126,8 @@ HRESULT WINAPI IDirect3DDevice2Impl_DeleteViewport( LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp) { - ICOM_THIS(IDirect3DDevice2Impl,iface); - IDirect3DViewport2Impl* ilpvp=(IDirect3DViewport2Impl*)lpvp; + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); + IDirect3DViewport2Impl* ilpvp=ICOM_OBJECT(IDirect3DViewport2Impl,lpvp); IDirect3DViewport2Impl *cur, *prev; TRACE("(%p)->(%p)\n", This, lpvp); @@ -151,8 +153,8 @@ LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp, LPDIRECT3DVIEWPORT2* lplpvp, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); - IDirect3DViewport2Impl* ilpvp=(IDirect3DViewport2Impl*)lpvp; + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); + IDirect3DViewport2Impl* ilpvp=ICOM_OBJECT(IDirect3DViewport2Impl,lpvp); IDirect3DViewport2Impl** ilplpvp=(IDirect3DViewport2Impl**)lplpvp; TRACE("(%p)->(%p,%p,%08lx)\n", This, lpvp, lpvp, dwFlags); @@ -178,7 +180,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_EnumTextureFormats( LPDIRECT3DDEVICE2 iface, LPD3DENUMTEXTUREFORMATSCALLBACK cb, LPVOID context ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p,%p), stub!\n", This, cb, context); return DD_OK; /* no texture formats in stub implementation */ @@ -188,7 +190,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_BeginScene(LPDIRECT3DDEVICE2 iface) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(), stub!\n", This); @@ -199,7 +201,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_EndScene(LPDIRECT3DDEVICE2 iface) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(): stub\n", This); return DD_OK; } @@ -207,7 +209,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetDirect3D( LPDIRECT3DDEVICE2 iface, LPDIRECT3D2 *lpd3d2 ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); TRACE("(%p)->(%p)\n", This, lpd3d2); *lpd3d2 = (LPDIRECT3D2)This->d3d; return DD_OK; @@ -217,8 +219,8 @@ HRESULT WINAPI IDirect3DDevice2Impl_SetCurrentViewport( LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); - IDirect3DViewport2Impl* ilpvp=(IDirect3DViewport2Impl*)lpvp; + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); + IDirect3DViewport2Impl* ilpvp=ICOM_OBJECT(IDirect3DViewport2Impl,lpvp); TRACE("(%p)->(%p)\n", This, ilpvp); /* Should check if the viewport was added or not */ @@ -238,7 +240,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetCurrentViewport( LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 *lplpvp ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lplpvp); /* Returns the current viewport */ @@ -250,7 +252,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_SetRenderTarget( LPDIRECT3DDEVICE2 iface, LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p,%08lx): stub\n", This, lpdds, dwFlags); return DD_OK; @@ -259,7 +261,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetRenderTarget( LPDIRECT3DDEVICE2 iface, LPDIRECTDRAWSURFACE *lplpdds ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); TRACE("(%p)->(%p)\n", This, lplpdds); /* Returns the current rendering target (the surface on wich we render) */ @@ -272,7 +274,7 @@ LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%d,%08lx): stub\n", This, d3dp, d3dv, dwFlags); return DD_OK; @@ -282,7 +284,7 @@ LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv, LPVOID lpvert, DWORD numvert, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%d,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvert, numvert, dwFlags); return DD_OK; @@ -291,14 +293,14 @@ HRESULT WINAPI IDirect3DDevice2Impl_Vertex( LPDIRECT3DDEVICE2 iface,LPVOID lpvert ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpvert); return DD_OK; } HRESULT WINAPI IDirect3DDevice2Impl_Index(LPDIRECT3DDEVICE2 iface, WORD index) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d): stub\n", This, index); return DD_OK; @@ -307,7 +309,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_End(LPDIRECT3DDEVICE2 iface,DWORD dwFlags) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%08lx): stub\n", This, dwFlags); return DD_OK; @@ -316,7 +318,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetRenderState( LPDIRECT3DDEVICE2 iface, D3DRENDERSTATETYPE d3drs, LPDWORD lprstate ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%p): stub\n", This, d3drs, lprstate); return DD_OK; @@ -326,7 +328,7 @@ LPDIRECT3DDEVICE2 iface, D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%ld)\n", This, dwRenderStateType, dwRenderState); @@ -336,7 +338,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetLightState( LPDIRECT3DDEVICE2 iface, D3DLIGHTSTATETYPE d3dls, LPDWORD lplstate ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%p): stub\n", This, d3dls, lplstate); return DD_OK; @@ -348,7 +350,7 @@ LPDIRECT3DDEVICE2 iface, D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%08lx): stub\n", This, dwLightStateType, dwLightState); return DD_OK; } @@ -356,7 +358,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_SetTransform( LPDIRECT3DDEVICE2 iface, D3DTRANSFORMSTATETYPE d3dts, LPD3DMATRIX lpmatrix ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%p),stub!\n",This,d3dts,lpmatrix); return DD_OK; } @@ -366,7 +368,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetTransform( LPDIRECT3DDEVICE2 iface, D3DTRANSFORMSTATETYPE d3dts, LPD3DMATRIX lpmatrix ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%p): stub\n", This, d3dts, lpmatrix); return DD_OK; @@ -377,7 +379,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_MultiplyTransform( LPDIRECT3DDEVICE2 iface, D3DTRANSFORMSTATETYPE d3dts, LPD3DMATRIX lpmatrix ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%p): stub\n", This, d3dts, lpmatrix); return DD_OK; @@ -387,7 +389,7 @@ LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv, LPVOID lpvertex, DWORD vertcount, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%d,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, dwFlags); @@ -399,7 +401,7 @@ LPVOID lpvertex, DWORD vertcount, LPWORD lpindexes, DWORD indexcount, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%d,%p,%ld,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, lpindexes, indexcount, dwFlags); return D3D_OK; } @@ -407,7 +409,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_SetClipStatus( LPDIRECT3DDEVICE2 iface, LPD3DCLIPSTATUS lpcs ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpcs); return DD_OK; @@ -416,7 +418,7 @@ HRESULT WINAPI IDirect3DDevice2Impl_GetClipStatus( LPDIRECT3DDEVICE2 iface, LPD3DCLIPSTATUS lpcs ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpcs); return DD_OK; @@ -428,14 +430,14 @@ HRESULT WINAPI IDirect3DDeviceImpl_QueryInterface( LPDIRECT3DDEVICE iface, REFIID riid, LPVOID* ppvObj ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); return S_OK; } ULONG WINAPI IDirect3DDeviceImpl_AddRef(LPDIRECT3DDEVICE iface) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -443,7 +445,7 @@ ULONG WINAPI IDirect3DDeviceImpl_Release(LPDIRECT3DDEVICE iface) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -461,7 +463,7 @@ LPDIRECT3DDEVICE iface, LPDIRECT3D lpd3d, LPGUID lpGUID, LPD3DDEVICEDESC lpd3ddvdesc ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%p,%p,%p): stub\n", This, lpd3d,lpGUID, lpd3ddvdesc); return DDERR_ALREADYINITIALIZED; @@ -472,7 +474,7 @@ LPDIRECT3DDEVICE iface, LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DSWDevDesc ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpD3DHWDevDesc, lpD3DSWDevDesc); return DD_OK; @@ -483,14 +485,16 @@ LPDIRECT3DDEVICE iface, LPDIRECT3DTEXTURE lpD3DTex1, LPDIRECT3DTEXTURE lpD3DTex2 ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); + IDirect3DTexture2Impl* Impl1 = ICOM_OBJECT(IDirect3DTexture2Impl,lpD3DTex1); + IDirect3DTexture2Impl* Impl2 = ICOM_OBJECT(IDirect3DTexture2Impl,lpD3DTex2); IDirect3DTexture2Impl tmp; TRACE("(%p)->(%p,%p)\n", This, lpD3DTex1, lpD3DTex2); - tmp = *(IDirect3DTexture2Impl*)lpD3DTex1; - *(IDirect3DTexture2Impl*)lpD3DTex1 = *(IDirect3DTexture2Impl*)lpD3DTex2; - *(IDirect3DTexture2Impl*)lpD3DTex2 = tmp; - + tmp = *Impl1; + *Impl1 = *Impl2; + *Impl2 = tmp; + return DD_OK; } @@ -498,7 +502,7 @@ LPDIRECT3DDEVICE iface, LPD3DEXECUTEBUFFERDESC lpDesc, LPDIRECT3DEXECUTEBUFFER *lplpDirect3DExecuteBuffer, IUnknown *pUnkOuter ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%p,%p,%p): stub\n", This, lpDesc, lplpDirect3DExecuteBuffer, pUnkOuter); return DD_OK; } @@ -506,7 +510,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_GetStats( LPDIRECT3DDEVICE iface, LPD3DSTATS lpD3DStats ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%p): stub\n", This, lpD3DStats); return DD_OK; @@ -517,7 +521,7 @@ LPDIRECT3DDEVICE iface, LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%p,%p,%08ld)\n", This, lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags); /* Put this as the default context */ @@ -531,8 +535,8 @@ HRESULT WINAPI IDirect3DDeviceImpl_AddViewport( LPDIRECT3DDEVICE iface, LPDIRECT3DVIEWPORT lpvp ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); - IDirect3DViewport2Impl* ilpvp=(IDirect3DViewport2Impl*)lpvp; + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); + IDirect3DViewport2Impl* ilpvp=ICOM_OBJECT(IDirect3DViewport2Impl,lpvp); TRACE("(%p)->(%p)\n", This, ilpvp); /* Adds this viewport to the viewport list */ @@ -547,8 +551,8 @@ HRESULT WINAPI IDirect3DDeviceImpl_DeleteViewport( LPDIRECT3DDEVICE iface, LPDIRECT3DVIEWPORT lpvp ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); - IDirect3DViewport2Impl* ilpvp=(IDirect3DViewport2Impl*)lpvp; + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); + IDirect3DViewport2Impl* ilpvp=ICOM_OBJECT(IDirect3DViewport2Impl,lpvp); IDirect3DViewport2Impl *cur, *prev; TRACE("(%p)->(%p)\n", This, lpvp); @@ -574,8 +578,8 @@ LPDIRECT3DDEVICE iface, LPDIRECT3DVIEWPORT lpvp, LPDIRECT3DVIEWPORT* lplpvp, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); - IDirect3DViewport2Impl* ilpvp=(IDirect3DViewport2Impl*)lpvp; + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); + IDirect3DViewport2Impl* ilpvp=ICOM_OBJECT(IDirect3DViewport2Impl,lpvp); IDirect3DViewport2Impl** ilplpvp=(IDirect3DViewport2Impl**)lplpvp; TRACE("(%p)->(%p,%p,%08lx)\n", This, ilpvp, ilplpvp, dwFlags); @@ -602,7 +606,7 @@ LPDIRECT3DDEVICE iface, LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags, LPD3DRECT lpRect ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%p,%p,%08lx,%p): stub\n", This, lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags, lpRect); return DD_OK; } @@ -610,7 +614,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_GetPickRecords( LPDIRECT3DDEVICE iface, LPDWORD lpCount, LPD3DPICKRECORD lpD3DPickRec ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpCount, lpD3DPickRec); return DD_OK; @@ -621,7 +625,7 @@ LPDIRECT3DDEVICE iface,LPD3DENUMTEXTUREFORMATSCALLBACK lpd3dEnumTextureProc, LPVOID lpArg ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpd3dEnumTextureProc, lpArg); return D3D_OK; } @@ -631,7 +635,7 @@ LPDIRECT3DDEVICE iface, LPD3DMATRIXHANDLE lpD3DMatHandle ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%p)\n", This, lpD3DMatHandle); *lpD3DMatHandle = (D3DMATRIXHANDLE) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(D3DMATRIX)); @@ -644,7 +648,7 @@ LPDIRECT3DDEVICE iface, D3DMATRIXHANDLE d3dMatHandle, const LPD3DMATRIX lpD3DMatrix) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%08lx,%p)\n", This, d3dMatHandle, lpD3DMatrix); dump_mat(lpD3DMatrix); @@ -656,7 +660,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_GetMatrix( LPDIRECT3DDEVICE iface,D3DMATRIXHANDLE D3DMatHandle,LPD3DMATRIX lpD3DMatrix ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%08lx,%p)\n", This, D3DMatHandle, lpD3DMatrix); *lpD3DMatrix = *((D3DMATRIX *) D3DMatHandle); @@ -668,7 +672,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_DeleteMatrix( LPDIRECT3DDEVICE iface, D3DMATRIXHANDLE d3dMatHandle ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%08lx)\n", This, d3dMatHandle); HeapFree(GetProcessHeap(),0, (void *) d3dMatHandle); return DD_OK; @@ -677,7 +681,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(): stub\n", This); return DD_OK; } @@ -686,7 +690,7 @@ Will make a common function ... */ HRESULT WINAPI IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(): stub\n", This); return DD_OK; } @@ -694,7 +698,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_GetDirect3D( LPDIRECT3DDEVICE iface, LPDIRECT3D *lpDirect3D ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(%p): stub\n", This, lpDirect3D); return DD_OK; Index: d3ddevice/mesa.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3ddevice/mesa.c,v retrieving revision 1.22 diff -u -r1.22 mesa.c --- d3ddevice/mesa.c 18 Oct 2002 23:48:59 -0000 1.22 +++ d3ddevice/mesa.c 28 Oct 2002 21:56:53 -0000 @@ -232,7 +232,7 @@ (*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private)); odev = (mesa_d3dd_private*)(*device)->private; (*device)->ref = 1; - ICOM_VTBL(*device) = &OpenGL_vtable; + ICOM_INIT_INTERFACE(*device,IDirect3DDevice2,OpenGL_vtable); (*device)->d3d = d3d; (*device)->surface = surface; (*device)->viewport_list = NULL; @@ -317,7 +317,7 @@ */ static ULONG WINAPI MESA_IDirect3DDevice2Impl_Release(LPDIRECT3DDEVICE2 iface) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -338,7 +338,7 @@ LPDIRECT3DDEVICE2 iface, LPD3DDEVICEDESC lpdescsoft, LPD3DDEVICEDESC lpdeschard ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpdescsoft, lpdeschard); fill_opengl_caps(lpdescsoft, lpdeschard); return DD_OK; @@ -449,7 +449,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_EnumTextureFormats( LPDIRECT3DDEVICE2 iface, LPD3DENUMTEXTUREFORMATSCALLBACK cb, LPVOID context ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, cb, context); return enum_texture_format_OpenGL(cb, context); @@ -458,7 +458,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_BeginScene( LPDIRECT3DDEVICE2 iface ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(): stub\n", This); @@ -469,7 +469,7 @@ } HRESULT WINAPI MESA_IDirect3DDevice2Impl_EndScene(LPDIRECT3DDEVICE2 iface) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(): stub\n", This); @@ -482,7 +482,7 @@ LPDIRECT3DDEVICE2 iface, D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); D3DDPRIVATE(This); TRACE("(%p)->(%d,%ld)\n", This, dwRenderStateType, dwRenderState); @@ -497,12 +497,12 @@ LPDIRECT3DDEVICE2 iface, D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%08lx): stub\n", This, dwLightStateType, dwLightState); switch (dwLightStateType) { case D3DLIGHTSTATE_MATERIAL: { /* 1 */ - IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) dwLightState; + IDirect3DMaterial2Impl* mat = ICOM_OBJECT(IDirect3DMaterial2Impl,dwLightState); if (mat != NULL) { ENTER_GL(); @@ -544,7 +544,7 @@ LPDIRECT3DDEVICE2 iface, D3DTRANSFORMSTATETYPE d3dts, LPD3DMATRIX lpmatrix ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); D3DDPRIVATE(This); FIXME("(%p)->(%d,%p): stub\n", This, d3dts, lpmatrix); @@ -775,7 +775,7 @@ LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv, LPVOID lpvertex, DWORD vertcount, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); D3DDPRIVATE(This); int vx_index; @@ -793,7 +793,7 @@ LPVOID lpvertex, DWORD vertcount, LPWORD lpindexes, DWORD indexcount, DWORD dwFlags ) { - ICOM_THIS(IDirect3DDevice2Impl,iface); + ICOM_THIS_MULTI(IDirect3DDevice2Impl,iface); D3DDPRIVATE(This); int vx_index; @@ -810,7 +810,7 @@ LPDIRECT3DDEVICE iface, LPD3DEXECUTEBUFFERDESC lpDesc, LPDIRECT3DEXECUTEBUFFER *lplpDirect3DExecuteBuffer, IUnknown *pUnkOuter ) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%p,%p,%p)\n", This, lpDesc, lplpDirect3DExecuteBuffer, pUnkOuter); *lplpDirect3DExecuteBuffer = d3dexecutebuffer_create(This, lpDesc); return DD_OK; @@ -898,7 +898,7 @@ (*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private)); odev = (mesa_d3dd_private*)(*device)->private; (*device)->ref = 1; - ICOM_VTBL(*device) = &OpenGL_vtable_dx3; + ICOM_INIT_INTERFACE(*device,IDirect3DDevice,OpenGL_vtable_dx3); (*device)->d3d = NULL; (*device)->surface = surface; @@ -961,7 +961,7 @@ glClearColor(0.0, 0.0, 0.0, 0.0); glColor3f(1.0, 1.0, 1.0); LEAVE_GL(); - fill_device_capabilities((IDirectDrawImpl *) surface->ddraw_owner); + fill_device_capabilities(ICOM_OBJECT(IDirectDrawImpl,surface->ddraw_owner)); return 1; } @@ -972,7 +972,7 @@ static ULONG WINAPI MESA_IDirect3DDeviceImpl_Release(LPDIRECT3DDEVICE iface) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -991,7 +991,7 @@ LPDIRECT3DDEVICE iface,LPD3DENUMTEXTUREFORMATSCALLBACK lpd3dEnumTextureProc, LPVOID lpArg) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lpd3dEnumTextureProc, lpArg); return enum_texture_format_OpenGL(lpd3dEnumTextureProc, lpArg); @@ -1000,7 +1000,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); /* OpenGL_IDirect3DDevice *odev = (OpenGL_IDirect3DDevice *) This; */ FIXME("(%p)->(): stub\n", This); @@ -1016,7 +1016,7 @@ Will make a common function ... */ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface) { - ICOM_THIS(IDirect3DDeviceImpl,iface); + ICOM_THIS_MULTI(IDirect3DDeviceImpl,iface); FIXME("(%p)->(): stub\n", This); Index: dclipper/main.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dclipper/main.c,v retrieving revision 1.8 diff -u -r1.8 main.c --- dclipper/main.c 31 May 2002 23:25:45 -0000 1.8 +++ dclipper/main.c 28 Oct 2002 21:56:53 -0000 @@ -82,7 +82,7 @@ HRESULT WINAPI Main_DirectDrawClipper_SetHwnd( LPDIRECTDRAWCLIPPER iface, DWORD dwFlags, HWND hWnd ) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); TRACE("(%p)->SetHwnd(0x%08lx,0x%08lx)\n",This,dwFlags,(DWORD)hWnd); if( dwFlags ) { @@ -109,7 +109,7 @@ } ULONG WINAPI Main_DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (--This->ref == 0) @@ -123,7 +123,7 @@ HRESULT WINAPI Main_DirectDrawClipper_GetClipList( LPDIRECTDRAWCLIPPER iface,LPRECT prcClip,LPRGNDATA lprgn,LPDWORD pdwSize ) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); static int warned = 0; if (warned++ < 10) FIXME("(%p,%p,%p,%p),stub!\n",This,prcClip,lprgn,pdwSize); @@ -134,7 +134,7 @@ HRESULT WINAPI Main_DirectDrawClipper_SetClipList( LPDIRECTDRAWCLIPPER iface,LPRGNDATA lprgn,DWORD pdwSize ) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); FIXME("(%p,%p,%ld),stub!\n",This,lprgn,pdwSize); return DD_OK; } @@ -142,7 +142,7 @@ HRESULT WINAPI Main_DirectDrawClipper_QueryInterface( LPDIRECTDRAWCLIPPER iface, REFIID riid, LPVOID* ppvObj ) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); if (IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IDirectDrawClipper, riid)) @@ -159,7 +159,7 @@ ULONG WINAPI Main_DirectDrawClipper_AddRef( LPDIRECTDRAWCLIPPER iface ) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); TRACE("(%p)->() incrementing from %lu.\n", This, This->ref ); return ++This->ref; } @@ -167,7 +167,7 @@ HRESULT WINAPI Main_DirectDrawClipper_GetHWnd( LPDIRECTDRAWCLIPPER iface, HWND* hWndPtr ) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); FIXME("(%p)->(%p),stub!\n",This,hWndPtr); *hWndPtr = This->hWnd; @@ -179,12 +179,12 @@ LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags ) { IDirectDrawImpl* pOwner; - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); FIXME("(%p)->(%p,0x%08lx),stub!\n",This,lpDD,dwFlags); if (This->ddraw_owner != NULL) return DDERR_ALREADYINITIALIZED; - pOwner = ICOM_OBJECT(IDirectDrawImpl, IDirectDraw, lpDD); + pOwner = ICOM_OBJECT(IDirectDrawImpl, lpDD); This->ddraw_owner = pOwner; Main_DirectDraw_AddClipper(pOwner, This); @@ -194,7 +194,7 @@ HRESULT WINAPI Main_DirectDrawClipper_IsClipListChanged( LPDIRECTDRAWCLIPPER iface, BOOL* lpbChanged ) { - ICOM_THIS(IDirectDrawClipperImpl,iface); + ICOM_THIS_MULTI(IDirectDrawClipperImpl,iface); FIXME("(%p)->(%p),stub!\n",This,lpbChanged); /* XXX What is safest? */ Index: ddraw/hal.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/ddraw/hal.c,v retrieving revision 1.7 diff -u -r1.7 hal.c --- ddraw/hal.c 6 Aug 2002 23:49:46 -0000 1.7 +++ ddraw/hal.c 28 Oct 2002 21:56:54 -0000 @@ -480,7 +480,7 @@ HRESULT WINAPI HAL_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface) { - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); HRESULT hr; TRACE("(%p)\n", iface); @@ -501,7 +501,7 @@ DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) { - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); HRESULT hr; @@ -523,7 +523,7 @@ LPDWORD pCodes) { int i; - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); if (*pNumCodes) *pNumCodes=dd_gbl.dwNumFourCC; if (pCodes && dd_gbl.dwNumFourCC) Index: ddraw/main.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/ddraw/main.c,v retrieving revision 1.25 diff -u -r1.25 main.c --- ddraw/main.c 18 Oct 2002 23:48:59 -0000 1.25 +++ ddraw/main.c 28 Oct 2002 21:56:56 -0000 @@ -110,7 +110,7 @@ /* There is no Main_DirectDraw_Create. */ ULONG WINAPI Main_DirectDraw_AddRef(LPDIRECTDRAW7 iface) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->() incrementing from %lu.\n", This, This->ref ); return ++This->ref; @@ -118,7 +118,7 @@ ULONG WINAPI Main_DirectDraw_Release(LPDIRECTDRAW7 iface) { ULONG ref; - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); ref = --This->ref; @@ -143,7 +143,7 @@ HRESULT WINAPI Main_DirectDraw_QueryInterface( LPDIRECTDRAW7 iface,REFIID refiid,LPVOID *obj ) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(refiid), obj); if ( IsEqualGUID( &IID_IUnknown, refiid ) @@ -200,7 +200,7 @@ LPDIRECTDRAWCLIPPER *ppClipper, IUnknown *pUnkOuter) { - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); HRESULT hr; TRACE("(%p)->(0x%lx, %p, %p)\n", iface, dwFlags, ppClipper, pUnkOuter); @@ -227,7 +227,7 @@ LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN pUnknown) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); LPDIRECTDRAWPALETTE pPalette; HRESULT hr; @@ -414,8 +414,7 @@ ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_VISIBLE | DDSCAPS_PRIMARYSURFACE | DDSCAPS_BACKBUFFER); - primary = ICOM_OBJECT(IDirectDrawSurfaceImpl,IDirectDrawSurface7, - *ppSurf); + primary = ICOM_OBJECT(IDirectDrawSurfaceImpl, *ppSurf); pPrev = *ppSurf; IDirectDrawSurface7_AddRef(pPrev); @@ -490,7 +489,7 @@ IUnknown *pUnkOuter) { HRESULT hr; - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); TRACE("(%p)->(%p,%p,%p)\n",This,pDDSD,ppSurf,pUnkOuter); if (TRACE_ON(ddraw)) { @@ -558,10 +557,9 @@ Main_DirectDraw_DuplicateSurface(LPDIRECTDRAW7 iface, LPDIRECTDRAWSURFACE7 src, LPDIRECTDRAWSURFACE7* dst) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); - IDirectDrawSurfaceImpl *pSrc = ICOM_OBJECT(IDirectDrawSurfaceImpl, - IDirectDrawSurface7, src); + IDirectDrawSurfaceImpl *pSrc = ICOM_OBJECT(IDirectDrawSurfaceImpl, src); TRACE("(%p)->(%p,%p)\n",This,src,dst); @@ -745,7 +743,7 @@ LPDDSURFACEDESC2 lpDDSD2, LPVOID context, LPDDENUMSURFACESCALLBACK7 callback) { - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); TRACE("(%p)->(0x%lx, %p, %p, %p)\n", iface, dwFlags, lpDDSD2, context, callback); @@ -774,7 +772,7 @@ HRESULT WINAPI Main_DirectDraw_EvaluateMode(LPDIRECTDRAW7 iface,DWORD a,DWORD* b) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); FIXME("(%p)->() stub\n", This); return DD_OK; @@ -783,7 +781,7 @@ HRESULT WINAPI Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->()\n",This); return DD_OK; } @@ -792,7 +790,7 @@ Main_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, LPDDCAPS pHELCaps) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p,%p,%p), stub\n",This,pDriverCaps,pHELCaps); if (pDriverCaps != NULL) { DD_STRUCT_COPY_BYSIZE(pDriverCaps,&This->caps); @@ -819,7 +817,7 @@ Main_DirectDraw_GetFourCCCodes(LPDIRECTDRAW7 iface, LPDWORD pNumCodes, LPDWORD pCodes) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); if (*pNumCodes) { *pNumCodes=0; } @@ -831,7 +829,7 @@ Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7 iface, LPDIRECTDRAWSURFACE7 *lplpGDIDDSSurface) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->(%p)\n", This, lplpGDIDDSSurface); TRACE("returning primary (%p)\n", This->primary_surface); *lplpGDIDDSSurface = ICOM_INTERFACE(This->primary_surface, IDirectDrawSurface7); @@ -843,7 +841,7 @@ HRESULT WINAPI Main_DirectDraw_GetMonitorFrequency(LPDIRECTDRAW7 iface,LPDWORD freq) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); FIXME("(%p)->(%p) returns 60 Hz always\n",This,freq); *freq = 60*100; /* 60 Hz */ return DD_OK; @@ -852,7 +850,7 @@ HRESULT WINAPI Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); FIXME("(%p)->(%p)\n", This, lpdwScanLine); *lpdwScanLine = 1; @@ -864,7 +862,7 @@ Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); FIXME("(%p)->(%08ld,%p)\n", This, (DWORD) hdc, lpDDS); return DD_OK; @@ -873,7 +871,7 @@ HRESULT WINAPI Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL status) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->(%p)\n",This,status); *status = TRUE; return DD_OK; @@ -892,7 +890,7 @@ HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW7 iface) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); IDirectDrawSurfaceImpl* surf; TRACE("(%p)->()\n", This); @@ -918,7 +916,7 @@ Main_DirectDraw_SetCooperativeLevel(LPDIRECTDRAW7 iface, HWND hwnd, DWORD cooplevel) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); FIXME("(%p)->(%08lx,%08lx)\n",This,(DWORD)hwnd,cooplevel); DDRAW_dump_cooperativelevel(cooplevel); @@ -980,7 +978,7 @@ short screenX; short screenY; - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->SetDisplayMode(%ld,%ld)\n",This,dwWidth,dwHeight); @@ -1013,7 +1011,7 @@ HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)\n",This); if (!(This->cooperative_level & DDSCL_EXCLUSIVE)) @@ -1038,7 +1036,7 @@ Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags, HANDLE h) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); FIXME("(%p)->(flags=0x%08lx,handle=%p)\n",This,dwFlags,h); return DD_OK; } @@ -1046,7 +1044,7 @@ HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->GetDisplayMode(%p)\n",This,pDDSD); pDDSD->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_PIXELFORMAT|DDSD_REFRESHRATE; @@ -1064,7 +1062,7 @@ Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, LPDWORD total, LPDWORD free) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->(%p,%p,%p)\n", This,ddscaps,total,free); /* We have 16 MB videomemory */ @@ -1074,7 +1072,7 @@ } HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); TRACE("(%p)->(): stub\n", This); return DD_OK; @@ -1084,7 +1082,7 @@ Main_DirectDraw_StartModeTest(LPDIRECTDRAW7 iface, LPSIZE pModes, DWORD dwNumModes, DWORD dwFlags) { - ICOM_THIS(IDirectDrawImpl,iface); + ICOM_THIS_MULTI(IDirectDrawImpl,iface); FIXME("(%p)->() stub\n", This); return DD_OK; @@ -1274,7 +1272,7 @@ Uninit_DirectDraw_Initialize(LPDIRECTDRAW7 iface, LPGUID pDeviceGuid) { const ddraw_driver* driver; - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); TRACE("(%p)->(%p)\n", iface, pDeviceGuid); Index: ddraw/user.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/ddraw/user.c,v retrieving revision 1.11 diff -u -r1.11 user.c --- ddraw/user.c 19 Oct 2002 17:16:00 -0000 1.11 +++ ddraw/user.c 28 Oct 2002 21:56:57 -0000 @@ -489,7 +489,7 @@ #undef FX_CAPS #undef ROPS - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); TRACE("(%p)->(%p,%p)\n",This,pDriverCaps,pHELCaps); @@ -530,7 +530,7 @@ DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) { - ICOM_THIS(IDirectDrawImpl, iface); + ICOM_THIS_MULTI(IDirectDrawImpl, iface); const DDPIXELFORMAT* pixelformat; LONG pitch; Index: direct3d/main.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/direct3d/main.c,v retrieving revision 1.8 diff -u -r1.8 main.c --- direct3d/main.c 17 Aug 2002 00:43:16 -0000 1.8 +++ direct3d/main.c 28 Oct 2002 21:56:58 -0000 @@ -44,7 +44,7 @@ HRESULT WINAPI IDirect3DImpl_QueryInterface( LPDIRECT3D iface,REFIID refiid,LPVOID *obj ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); /* FIXME: Not sure if this is correct */ TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(refiid),obj); @@ -71,7 +71,7 @@ d3d->ref = 1; d3d->ddraw = This->ddraw; IDirect3D_AddRef(iface); - ICOM_VTBL(d3d) = &d3d2vt; + ICOM_INIT_INTERFACE(d3d,IDirect3D2,d3d2vt); *obj = d3d; TRACE(" Creating IDirect3D2 interface (%p)\n", *obj); return S_OK; @@ -81,7 +81,7 @@ } ULONG WINAPI IDirect3DImpl_AddRef(LPDIRECT3D iface) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); TRACE("(%p)->() incrementing from %lu.\n", This, This->ref ); return ++(This->ref); @@ -89,7 +89,7 @@ ULONG WINAPI IDirect3DImpl_Release(LPDIRECT3D iface) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -101,7 +101,7 @@ } HRESULT WINAPI IDirect3DImpl_Initialize(LPDIRECT3D iface,REFIID refiid) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); /* FIXME: Not sure if this is correct */ FIXME("(%p)->(%s):stub.\n",This,debugstr_guid(refiid)); return DDERR_ALREADYINITIALIZED; @@ -110,7 +110,7 @@ HRESULT WINAPI IDirect3DImpl_EnumDevices( LPDIRECT3D iface, LPD3DENUMDEVICESCALLBACK cb, LPVOID context ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); FIXME("(%p)->(%p,%p),stub!\n",This,cb,context); return DD_OK; } @@ -118,7 +118,7 @@ HRESULT WINAPI IDirect3DImpl_CreateLight( LPDIRECT3D iface, LPDIRECT3DLIGHT *lplight, IUnknown *lpunk ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lplight, lpunk); return E_FAIL; } @@ -126,7 +126,7 @@ HRESULT WINAPI IDirect3DImpl_CreateMaterial( LPDIRECT3D iface, LPDIRECT3DMATERIAL *lpmaterial, IUnknown *lpunk ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpmaterial, lpunk); return E_FAIL; } @@ -134,7 +134,7 @@ HRESULT WINAPI IDirect3DImpl_CreateViewport( LPDIRECT3D iface, LPDIRECT3DVIEWPORT *lpviewport, IUnknown *lpunk ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpviewport, lpunk); return E_FAIL; @@ -144,7 +144,7 @@ LPDIRECT3D iface, LPD3DFINDDEVICESEARCH lpfinddevsrc, LPD3DFINDDEVICERESULT lpfinddevrst) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpfinddevsrc, lpfinddevrst); return DD_OK; } @@ -170,7 +170,7 @@ */ HRESULT WINAPI IDirect3D2Impl_QueryInterface( LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); /* FIXME: Not sure if this is correct */ @@ -201,7 +201,7 @@ d3d->ref = 1; d3d->ddraw = This->ddraw; IDirect3D2_AddRef(iface); - ICOM_VTBL(d3d) = &d3dvt; + ICOM_INIT_INTERFACE(d3d,IDirect3D,d3dvt); *obj = d3d; TRACE(" Creating IDirect3D interface (%p)\n", *obj); return S_OK; @@ -211,14 +211,14 @@ } ULONG WINAPI IDirect3D2Impl_AddRef(LPDIRECT3D2 iface) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); TRACE("(%p)->() incrementing from %lu.\n", This, This->ref ); return ++(This->ref); } ULONG WINAPI IDirect3D2Impl_Release(LPDIRECT3D2 iface) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -232,7 +232,7 @@ HRESULT WINAPI IDirect3D2Impl_EnumDevices( LPDIRECT3D2 iface,LPD3DENUMDEVICESCALLBACK cb, LPVOID context ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%p,%p),stub!\n",This,cb,context); return DD_OK; } @@ -240,7 +240,7 @@ HRESULT WINAPI IDirect3D2Impl_CreateLight( LPDIRECT3D2 iface, LPDIRECT3DLIGHT *lplight, IUnknown *lpunk ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lplight, lpunk); return E_FAIL; } @@ -248,7 +248,7 @@ HRESULT WINAPI IDirect3D2Impl_CreateMaterial( LPDIRECT3D2 iface, LPDIRECT3DMATERIAL2 *lpmaterial, IUnknown *lpunk ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpmaterial, lpunk); return E_FAIL; } @@ -256,7 +256,7 @@ HRESULT WINAPI IDirect3D2Impl_CreateViewport( LPDIRECT3D2 iface, LPDIRECT3DVIEWPORT2 *lpviewport, IUnknown *lpunk ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpviewport, lpunk); return E_FAIL; } @@ -265,7 +265,7 @@ LPDIRECT3D2 iface, LPD3DFINDDEVICESEARCH lpfinddevsrc, LPD3DFINDDEVICERESULT lpfinddevrst) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpfinddevsrc, lpfinddevrst); return DD_OK; } @@ -274,7 +274,7 @@ LPDIRECT3D2 iface, REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE2 *device) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%s,%p,%p): stub\n",This,debugstr_guid(rguid),surface,device); return DDERR_INVALIDPARAMS; } Index: direct3d/mesa.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/direct3d/mesa.c,v retrieving revision 1.12 diff -u -r1.12 mesa.c --- direct3d/mesa.c 17 Aug 2002 00:43:16 -0000 1.12 +++ direct3d/mesa.c 28 Oct 2002 21:56:59 -0000 @@ -44,7 +44,7 @@ static HRESULT WINAPI MESA_IDirect3DImpl_QueryInterface( LPDIRECT3D iface,REFIID refiid,LPVOID *obj ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); /* FIXME: Not sure if this is correct */ TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(refiid),obj); @@ -71,7 +71,7 @@ d3d->ref = 1; d3d->ddraw = This->ddraw; IDirect3D_AddRef(iface); - ICOM_VTBL(d3d) = &mesa_d3d2vt; + ICOM_INIT_INTERFACE(d3d,IDirect3D2,mesa_d3d2vt); *obj = d3d; TRACE(" Creating IDirect3D2 interface (%p)\n", *obj); return S_OK; @@ -82,7 +82,7 @@ static ULONG WINAPI MESA_IDirect3DImpl_Release(LPDIRECT3D iface) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -96,7 +96,7 @@ static HRESULT WINAPI MESA_IDirect3DImpl_EnumDevices( LPDIRECT3D iface, LPD3DENUMDEVICESCALLBACK cb, LPVOID context ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); FIXME("(%p)->(%p,%p),stub!\n",This,cb,context); /* Call functions defined in d3ddevices.c */ @@ -109,7 +109,7 @@ static HRESULT WINAPI MESA_IDirect3DImpl_CreateLight( LPDIRECT3D iface, LPDIRECT3DLIGHT *lplight, IUnknown *lpunk ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lplight, lpunk); /* Call the creation function that is located in d3dlight.c */ @@ -121,7 +121,7 @@ static HRESULT WINAPI MESA_IDirect3DImpl_CreateMaterial( LPDIRECT3D iface, LPDIRECT3DMATERIAL *lpmaterial, IUnknown *lpunk ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lpmaterial, lpunk); /* Call the creation function that is located in d3dviewport.c */ *lpmaterial = d3dmaterial_create(This); @@ -131,7 +131,7 @@ static HRESULT WINAPI MESA_IDirect3DImpl_CreateViewport( LPDIRECT3D iface, LPDIRECT3DVIEWPORT *lpviewport, IUnknown *lpunk ) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lpviewport, lpunk); /* Call the creation function that is located in d3dviewport.c */ @@ -144,7 +144,7 @@ LPDIRECT3D iface, LPD3DFINDDEVICESEARCH lpfinddevsrc, LPD3DFINDDEVICERESULT lpfinddevrst) { - ICOM_THIS(IDirect3DImpl,iface); + ICOM_THIS_MULTI(IDirect3DImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpfinddevsrc, lpfinddevrst); return D3D_OK; @@ -169,7 +169,7 @@ */ static HRESULT WINAPI MESA_IDirect3D2Impl_QueryInterface( LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); /* FIXME: Not sure if this is correct */ @@ -200,7 +200,7 @@ d3d->ref = 1; d3d->ddraw = This->ddraw; IDirect3D2_AddRef(iface); - ICOM_VTBL(d3d) = &mesa_d3dvt; + ICOM_INIT_INTERFACE(d3d,IDirect3D,mesa_d3dvt); *obj = d3d; TRACE(" Creating IDirect3D interface (%p)\n", *obj); return S_OK; @@ -210,7 +210,7 @@ } static ULONG WINAPI MESA_IDirect3D2Impl_Release(LPDIRECT3D2 iface) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { @@ -224,7 +224,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_EnumDevices( LPDIRECT3D2 iface,LPD3DENUMDEVICESCALLBACK cb, LPVOID context ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%p,%p),stub!\n",This,cb,context); /* Call functions defined in d3ddevices.c */ @@ -236,7 +236,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_CreateLight( LPDIRECT3D2 iface, LPDIRECT3DLIGHT *lplight, IUnknown *lpunk ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lplight, lpunk); /* Call the creation function that is located in d3dlight.c */ @@ -248,7 +248,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_CreateMaterial( LPDIRECT3D2 iface, LPDIRECT3DMATERIAL2 *lpmaterial, IUnknown *lpunk ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lpmaterial, lpunk); /* Call the creation function that is located in d3dviewport.c */ @@ -260,7 +260,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_CreateViewport( LPDIRECT3D2 iface, LPDIRECT3DVIEWPORT2 *lpviewport, IUnknown *lpunk ) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lpviewport, lpunk); /* Call the creation function that is located in d3dviewport.c */ @@ -273,7 +273,7 @@ LPDIRECT3D2 iface, LPD3DFINDDEVICESEARCH lpfinddevsrc, LPD3DFINDDEVICERESULT lpfinddevrst) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpfinddevsrc, lpfinddevrst); return D3D_OK; } @@ -282,11 +282,11 @@ LPDIRECT3D2 iface, REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE2 *device) { - ICOM_THIS(IDirect3D2Impl,iface); + ICOM_THIS_MULTI(IDirect3D2Impl,iface); FIXME("(%p)->(%s,%p,%p): stub\n",This,debugstr_guid(rguid),surface,device); - if (is_OpenGL(rguid, (IDirectDrawSurfaceImpl*)surface, (IDirect3DDevice2Impl**)device, This)) { + if (is_OpenGL(rguid, ICOM_OBJECT(IDirectDrawSurfaceImpl,surface), (IDirect3DDevice2Impl**)device, This)) { IDirect3D2_AddRef(iface); return D3D_OK; } @@ -369,10 +369,10 @@ d3d = HeapAlloc(GetProcessHeap(),0,sizeof(*d3d)); d3d->ref = 1; - d3d->ddraw = (IDirectDrawImpl *) ddraw; + d3d->ddraw = ICOM_OBJECT(IDirectDrawImpl,ddraw); d3d->private = NULL; /* unused for now */ IDirectDraw_AddRef((LPDIRECTDRAW)ddraw); - ICOM_VTBL(d3d) = &mesa_d3dvt; + ICOM_INIT_INTERFACE(d3d,IDirect3D,mesa_d3dvt); *obj = (LPUNKNOWN)d3d; TRACE(" Created IDirect3D interface (%p)\n", *obj); @@ -384,10 +384,10 @@ d3d = HeapAlloc(GetProcessHeap(),0,sizeof(*d3d)); d3d->ref = 1; - d3d->ddraw = (IDirectDrawImpl *) ddraw; + d3d->ddraw = ICOM_OBJECT(IDirectDrawImpl,ddraw); d3d->private = NULL; /* unused for now */ IDirectDraw_AddRef((LPDIRECTDRAW)ddraw); - ICOM_VTBL(d3d) = &mesa_d3d2vt; + ICOM_INIT_INTERFACE(d3d,IDirect3D2,mesa_d3d2vt); *obj = (LPUNKNOWN)d3d; TRACE(" Creating IDirect3D2 interface (%p)\n", *obj); @@ -399,11 +399,11 @@ d3d = HeapAlloc(GetProcessHeap(),0,sizeof(*d3d)); d3d->ref = 1; - d3d->ddraw = (IDirectDrawImpl *) ddraw; + d3d->ddraw = ICOM_OBJECT(IDirectDrawImpl,ddraw); d3d->private = NULL; /* unused for now */ IDirectDraw_AddRef((LPDIRECTDRAW)ddraw); - ICOM_VTBL(d3d) = &mesa_d3d3vt; + ICOM_INIT_INTERFACE(d3d,IDirect3D3,mesa_d3d3vt); *obj = (LPUNKNOWN)d3d; TRACE(" Creating IDirect3D3 interface (%p)\n", *obj); Index: dpalette/hal.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dpalette/hal.c,v retrieving revision 1.2 diff -u -r1.2 hal.c --- dpalette/hal.c 9 Mar 2002 23:29:36 -0000 1.2 +++ dpalette/hal.c 28 Oct 2002 21:56:59 -0000 @@ -89,7 +89,7 @@ DWORD dwStart, DWORD dwCount, LPPALETTEENTRY palent) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); LPDDRAWI_DIRECTDRAW_GBL dd_gbl = This->local.lpDD_lcl->lpGbl; DDHAL_SETENTRIESDATA data; Index: dpalette/main.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dpalette/main.c,v retrieving revision 1.7 diff -u -r1.7 main.c --- dpalette/main.c 10 Jul 2002 03:05:43 -0000 1.7 +++ dpalette/main.c 28 Oct 2002 21:56:59 -0000 @@ -110,7 +110,7 @@ DWORD dwStart, DWORD dwCount, LPPALETTEENTRY palent) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); TRACE("(%p)->GetEntries(%08lx,%ld,%ld,%p)\n",This,dwFlags,dwStart,dwCount, palent); @@ -138,7 +138,7 @@ DWORD dwStart, DWORD dwCount, LPPALETTEENTRY palent) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); TRACE("(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",This,dwFlags,dwStart,dwCount, palent); @@ -162,8 +162,7 @@ LPDIRECTDRAWSURFACE7 psurf = NULL; IDirectDraw7_GetGDISurface(ICOM_INTERFACE(This->ddraw_owner,IDirectDraw7), &psurf); if (psurf) { - IDirectDrawSurfaceImpl *surf = ICOM_OBJECT(IDirectDrawSurfaceImpl, - IDirectDrawSurface7, psurf); + IDirectDrawSurfaceImpl *surf = ICOM_OBJECT(IDirectDrawSurfaceImpl, psurf); surf->update_palette(surf, This, dwStart, dwCount, palent); IDirectDrawSurface7_Release(psurf); } @@ -207,7 +206,7 @@ ULONG WINAPI Main_DirectDrawPalette_Release(LPDIRECTDRAWPALETTE iface) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--This->ref) @@ -220,7 +219,7 @@ } ULONG WINAPI Main_DirectDrawPalette_AddRef(LPDIRECTDRAWPALETTE iface) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); TRACE("(%p)->() incrementing from %lu.\n", This, This->ref ); return ++This->ref; } @@ -230,7 +229,7 @@ LPDIRECTDRAW ddraw, DWORD dwFlags, LPPALETTEENTRY palent) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); TRACE("(%p)->(%p,%ld,%p)\n", This, ddraw, dwFlags, palent); return DDERR_ALREADYINITIALIZED; } @@ -238,7 +237,7 @@ HRESULT WINAPI Main_DirectDrawPalette_GetCaps(LPDIRECTDRAWPALETTE iface, LPDWORD lpdwCaps) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); TRACE("(%p)->(%p)\n",This,lpdwCaps); *lpdwCaps = This->global.dwFlags; @@ -250,7 +249,7 @@ Main_DirectDrawPalette_QueryInterface(LPDIRECTDRAWPALETTE iface, REFIID refiid, LPVOID *obj) { - ICOM_THIS(IDirectDrawPaletteImpl,iface); + ICOM_THIS_MULTI(IDirectDrawPaletteImpl,iface); TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(refiid),obj); if (IsEqualGUID(refiid, &IID_IUnknown) Index: dsurface/dib.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dsurface/dib.c,v retrieving revision 1.17 diff -u -r1.17 dib.c --- dsurface/dib.c 18 Oct 2002 23:48:59 -0000 1.17 +++ dsurface/dib.c 28 Oct 2002 21:57:02 -0000 @@ -344,7 +344,7 @@ LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx) { - ICOM_THIS(IDirectDrawSurfaceImpl,iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl,iface); RECT xdst,xsrc; DDSURFACEDESC2 ddesc,sdesc; HRESULT ret = DD_OK; @@ -775,7 +775,7 @@ DWORD dsty, LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD trans) { - ICOM_THIS(IDirectDrawSurfaceImpl,iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl,iface); int bpp, w, h, x, y; DDSURFACEDESC2 ddesc,sdesc; HRESULT ret = DD_OK; @@ -1038,8 +1038,7 @@ &back_caps, &tgt); if (!FAILED(hr)) { - IDirectDrawSurfaceImpl* target = ICOM_OBJECT(IDirectDrawSurfaceImpl, - IDirectDrawSurface7,tgt); + IDirectDrawSurfaceImpl* target = ICOM_OBJECT(IDirectDrawSurfaceImpl,tgt); IDirectDrawSurface7_Release(tgt); target->get_dc(target, &dc); SetDIBColorTable(dc, dwStart, dwCount, col); @@ -1056,7 +1055,7 @@ DIB_DirectDrawSurface_SetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD, DWORD dwFlags) { - ICOM_THIS(IDirectDrawSurfaceImpl,iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl,iface); DIB_PRIV_VAR(priv, This); HRESULT hr = DD_OK; DWORD flags = pDDSD->dwFlags; Index: dsurface/gamma.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dsurface/gamma.c,v retrieving revision 1.3 diff -u -r1.3 gamma.c --- dsurface/gamma.c 31 May 2002 23:25:46 -0000 1.3 +++ dsurface/gamma.c 28 Oct 2002 21:57:02 -0000 @@ -57,7 +57,7 @@ static HRESULT WINAPI DirectDrawGammaControl_GetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) { - ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawGammaControl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%08lx,%p)\n", iface,dwFlags,lpGammaRamp); return This->get_gamma_ramp(This, dwFlags, lpGammaRamp); } @@ -65,7 +65,7 @@ static HRESULT WINAPI DirectDrawGammaControl_SetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) { - ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawGammaControl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%08lx,%p)\n", iface,dwFlags,lpGammaRamp); return This->set_gamma_ramp(This, dwFlags, lpGammaRamp); } Index: dsurface/main.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dsurface/main.c,v retrieving revision 1.31 diff -u -r1.31 main.c --- dsurface/main.c 18 Oct 2002 23:48:59 -0000 1.31 +++ dsurface/main.c 28 Oct 2002 21:57:04 -0000 @@ -110,7 +110,7 @@ ULONG WINAPI Main_DirectDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); if (--This->ref == 0) { @@ -125,7 +125,7 @@ ULONG WINAPI Main_DirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); return ++This->ref; } @@ -134,7 +134,7 @@ Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid, LPVOID* ppObj) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppObj); if (IsEqualGUID(&IID_IUnknown, riid) @@ -278,9 +278,8 @@ Main_DirectDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWSURFACE7 pAttach) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); - IDirectDrawSurfaceImpl* surf = ICOM_OBJECT(IDirectDrawSurfaceImpl, - IDirectDrawSurface7, pAttach); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); + IDirectDrawSurfaceImpl* surf = ICOM_OBJECT(IDirectDrawSurfaceImpl, pAttach); TRACE("(%p)->(%p)\n",This,pAttach); @@ -346,7 +345,7 @@ HRESULT WINAPI Main_DirectDrawSurface_ChangeUniquenessValue(LPDIRECTDRAWSURFACE7 iface) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); volatile IDirectDrawSurfaceImpl* vThis = This; TRACE("(%p)\n",This); @@ -375,9 +374,8 @@ DWORD dwFlags, LPDIRECTDRAWSURFACE7 pAttach) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); - IDirectDrawSurfaceImpl* surf = ICOM_OBJECT(IDirectDrawSurfaceImpl, - IDirectDrawSurface7, pAttach); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); + IDirectDrawSurfaceImpl* surf = ICOM_OBJECT(IDirectDrawSurfaceImpl, pAttach); TRACE("(%p)->(%08lx,%p)\n",This,dwFlags,pAttach); @@ -411,7 +409,7 @@ LPVOID context, LPDDENUMSURFACESCALLBACK7 cb) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); IDirectDrawSurfaceImpl* surf; TRACE("(%p)->(%p,%p)\n",This,context,cb); @@ -473,7 +471,7 @@ Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWSURFACE7 override, DWORD dwFlags) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); IDirectDrawSurfaceImpl* target; HRESULT hr; @@ -499,8 +497,7 @@ hr = IDirectDrawSurface7_GetAttachedSurface(iface, &back_caps, &tgt); if (FAILED(hr)) return DDERR_NOTFLIPPABLE; /* unchecked */ - target = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, - tgt); + target = ICOM_OBJECT(IDirectDrawSurfaceImpl, tgt); IDirectDrawSurface7_Release(tgt); } else @@ -514,8 +511,7 @@ /* Verify that override is on this flip chain. We assume that * surf is the head of the flipping chain, because it's the front * buffer. */ - target = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, - override); + target = ICOM_OBJECT(IDirectDrawSurfaceImpl, override); /* Either target is (indirectly) attached to This or This is * (indirectly) attached to target. */ @@ -554,7 +550,7 @@ HRESULT WINAPI Main_DirectDrawSurface_FreePrivateData(LPDIRECTDRAWSURFACE7 iface, REFGUID tag) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); PrivateData *data; data = find_private_data(This, tag); @@ -583,7 +579,7 @@ LPDDSCAPS2 pCaps, LPDIRECTDRAWSURFACE7* ppSurface) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); IDirectDrawSurfaceImpl* surf; IDirectDrawSurfaceImpl* found = NULL; @@ -643,7 +639,7 @@ HRESULT WINAPI Main_DirectDrawSurface_GetCaps(LPDIRECTDRAWSURFACE7 iface, LPDDSCAPS2 pCaps) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pCaps); *pCaps = This->surface_desc.ddsCaps; @@ -654,7 +650,7 @@ Main_DirectDrawSurface_GetClipper(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWCLIPPER* ppClipper) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,ppClipper); if (This->clipper == NULL) @@ -674,7 +670,7 @@ * isn't there? That's like saying that an int isn't there. (Which MS * has done in other docs.) */ - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%08lx,%p)\n",This,dwFlags,pCKey); switch (dwFlags) @@ -708,7 +704,7 @@ { DDSURFACEDESC2 ddsd; HRESULT hr; - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,phDC); CHECK_LOST(This); @@ -749,7 +745,7 @@ HRESULT WINAPI Main_DirectDrawSurface_GetDDInterface(LPDIRECTDRAWSURFACE7 iface, LPVOID* pDD) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pDD); *pDD = ICOM_INTERFACE(This->ddraw_owner, IDirectDraw7); @@ -777,7 +773,7 @@ HRESULT WINAPI Main_DirectDrawSurface_GetLOD(LPDIRECTDRAWSURFACE7 iface, LPDWORD pdwMaxLOD) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pdwMaxLOD); CHECK_TEXTURE(This); @@ -797,7 +793,7 @@ Main_DirectDrawSurface_GetPalette(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWPALETTE* ppPalette) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,ppPalette); if (This->palette == NULL) @@ -814,7 +810,7 @@ LPDDPIXELFORMAT pDDPixelFormat) { /* What is DDERR_INVALIDSURFACETYPE for here? */ - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pDDPixelFormat); DD_STRUCT_COPY_BYSIZE(pDDPixelFormat,&This->surface_desc.u4.ddpfPixelFormat); @@ -825,7 +821,7 @@ Main_DirectDrawSurface_GetPriority(LPDIRECTDRAWSURFACE7 iface, LPDWORD pdwPriority) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pdwPriority); CHECK_TEXTURE(This); @@ -839,7 +835,7 @@ REFGUID tag, LPVOID pBuffer, LPDWORD pcbBufferSize) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); PrivateData* data; data = find_private_data(This, tag); @@ -873,7 +869,7 @@ Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pDDSD); if ((pDDSD->dwSize < sizeof(DDSURFACEDESC)) || @@ -893,7 +889,7 @@ Main_DirectDrawSurface_GetUniquenessValue(LPDIRECTDRAWSURFACE7 iface, LPDWORD pValue) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pValue); *pValue = This->uniqueness_value; @@ -911,7 +907,7 @@ HRESULT WINAPI Main_DirectDrawSurface_IsLost(LPDIRECTDRAWSURFACE7 iface) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p) is%s lost\n",This, (This->lost ? "" : " not")); return This->lost ? DDERR_SURFACELOST : DD_OK; @@ -924,7 +920,7 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2 pDDSD, DWORD flags, HANDLE h) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->Lock(%p,%p,%08lx,%08lx)\n",This,prect,pDDSD,flags,(DWORD)h); @@ -983,7 +979,7 @@ Main_DirectDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface, HDC hDC) { HRESULT hr; - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,hDC); @@ -1007,7 +1003,7 @@ Main_DirectDrawSurface_SetClipper(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWCLIPPER pDDClipper) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pDDClipper); if (pDDClipper == ICOM_INTERFACE(This->clipper, IDirectDrawClipper)) @@ -1017,8 +1013,7 @@ IDirectDrawClipper_Release(ICOM_INTERFACE(This->clipper, IDirectDrawClipper)); - This->clipper = ICOM_OBJECT(IDirectDrawClipperImpl, IDirectDrawClipper, - pDDClipper); + This->clipper = ICOM_OBJECT(IDirectDrawClipperImpl, pDDClipper); if (pDDClipper != NULL) IDirectDrawClipper_AddRef(pDDClipper); @@ -1029,7 +1024,7 @@ Main_DirectDrawSurface_SetColorKey(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags, LPDDCOLORKEY pCKey) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%08lx,%p)\n",This,dwFlags,pCKey); if (pCKey == NULL) @@ -1067,7 +1062,7 @@ HRESULT WINAPI Main_DirectDrawSurface_SetLOD(LPDIRECTDRAWSURFACE7 iface, DWORD dwMaxLOD) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%08lx)\n",This,dwMaxLOD); CHECK_TEXTURE(This); @@ -1087,7 +1082,7 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWPALETTE pPalette) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pPalette); if (pPalette == ICOM_INTERFACE(This->palette, IDirectDrawPalette)) @@ -1100,8 +1095,7 @@ IDirectDrawPalette)); } - This->palette = ICOM_OBJECT(IDirectDrawPaletteImpl, IDirectDrawPalette, - pPalette); + This->palette = ICOM_OBJECT(IDirectDrawPaletteImpl, pPalette); if (pPalette != NULL) { IDirectDrawPalette_AddRef(pPalette); if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) @@ -1117,7 +1111,7 @@ Main_DirectDrawSurface_SetPriority(LPDIRECTDRAWSURFACE7 iface, DWORD dwPriority) { - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%08lx)\n",This,dwPriority); CHECK_TEXTURE(This); @@ -1134,7 +1128,7 @@ DWORD cbSize, DWORD dwFlags) { PrivateData* data; - ICOM_THIS(IDirectDrawSurfaceImpl, iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); data = find_private_data(This, tag); if (data == NULL) @@ -1187,7 +1181,7 @@ HRESULT WINAPI Main_DirectDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect) { - ICOM_THIS(IDirectDrawSurfaceImpl,iface); + ICOM_THIS_MULTI(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->Unlock(%p)\n",This,pRect);