mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
ddraw: Verify the viewport belongs to the device on execute buffer execution.
This commit is contained in:
parent
9edeb22c34
commit
d429aaa9e9
@ -515,8 +515,8 @@ HRESULT d3d_execute_buffer_init(IDirect3DExecuteBufferImpl *execute_buffer,
|
||||
IDirect3DDeviceImpl *device, D3DEXECUTEBUFFERDESC *desc) DECLSPEC_HIDDEN;
|
||||
|
||||
/* The execute function */
|
||||
void IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
|
||||
IDirect3DDeviceImpl *Device, IDirect3DViewportImpl *ViewportImpl) DECLSPEC_HIDDEN;
|
||||
HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *execute_buffer,
|
||||
IDirect3DDeviceImpl *device, IDirect3DViewportImpl *viewport) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DVertexBuffer
|
||||
|
@ -718,6 +718,7 @@ IDirect3DDeviceImpl_1_Execute(IDirect3DDevice *iface,
|
||||
IDirect3DDeviceImpl *This = device_from_device1(iface);
|
||||
IDirect3DExecuteBufferImpl *Direct3DExecuteBufferImpl = (IDirect3DExecuteBufferImpl *)ExecuteBuffer;
|
||||
IDirect3DViewportImpl *Direct3DViewportImpl = (IDirect3DViewportImpl *)Viewport;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, buffer %p, viewport %p, flags %#x.\n", iface, ExecuteBuffer, Viewport, Flags);
|
||||
|
||||
@ -726,10 +727,10 @@ IDirect3DDeviceImpl_1_Execute(IDirect3DDevice *iface,
|
||||
|
||||
/* Execute... */
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
IDirect3DExecuteBufferImpl_Execute(Direct3DExecuteBufferImpl, This, Direct3DViewportImpl);
|
||||
hr = d3d_execute_buffer_execute(Direct3DExecuteBufferImpl, This, Direct3DViewportImpl);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
|
||||
return D3D_OK;
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -68,10 +68,8 @@ static void _dump_D3DEXECUTEBUFFERDESC(const D3DEXECUTEBUFFERDESC *lpDesc) {
|
||||
* Viewport: Viewport for this operation
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
|
||||
IDirect3DDeviceImpl *lpDevice,
|
||||
IDirect3DViewportImpl *lpViewport)
|
||||
HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *This,
|
||||
IDirect3DDeviceImpl *lpDevice, IDirect3DViewportImpl *lpViewport)
|
||||
{
|
||||
/* DWORD bs = This->desc.dwBufferSize; */
|
||||
DWORD vs = This->data.dwVertexOffset;
|
||||
@ -81,10 +79,14 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
|
||||
|
||||
char *instr = (char *)This->desc.lpData + is;
|
||||
|
||||
/* Should check if the viewport was added or not to the device */
|
||||
if (lpViewport->active_device != lpDevice)
|
||||
{
|
||||
WARN("Viewport %p active device is %p.\n",
|
||||
lpViewport, lpViewport->active_device);
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
/* Activate the viewport */
|
||||
lpViewport->active_device = lpDevice;
|
||||
viewport_activate(lpViewport, FALSE);
|
||||
|
||||
TRACE("ExecuteData :\n");
|
||||
@ -551,7 +553,7 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
|
||||
}
|
||||
|
||||
end_of_buffer:
|
||||
;
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user