Module: wine Branch: master Commit: a06e002e93b61d54048672461f0072abd28d7e45 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a06e002e93b61d54048672461f...
Author: Stefan Dösinger stefan@codeweavers.com Date: Fri Aug 3 22:48:42 2007 +0200
wined3d: Add a wined3d private WINED3DSBT_RECORDED.
---
dlls/d3d8/device.c | 6 ++++++ dlls/d3d9/stateblock.c | 6 ++++++ dlls/ddraw/device.c | 5 +++++ include/wine/wined3d_types.h | 1 + 4 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 0b2436d..74a0d13 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1165,6 +1165,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(LPDIRECT3DDEVICE8 if
TRACE("(%p) Relay\n", This);
+ if(Type != D3DSBT_ALL && Type != D3DSBT_PIXELSTATE && + Type != D3DSBT_VERTEXSTATE ) { + WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL\n"); + return D3DERR_INVALIDCALL; + } + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DStateBlock8Impl)); if (NULL == object) { *pToken = 0; diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c index 2cd79ea..33eda64 100644 --- a/dlls/d3d9/stateblock.c +++ b/dlls/d3d9/stateblock.c @@ -121,6 +121,12 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateStateBlock(LPDIRECT3DDEVICE9 iface, D3 HRESULT hrc = D3D_OK;
TRACE("(%p) Relay\n", This); + + if(Type != D3DSBT_ALL && Type != D3DSBT_PIXELSTATE && + Type != D3DSBT_VERTEXSTATE ) { + WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL\n"); + return D3DERR_INVALIDCALL; + }
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DStateBlock9Impl)); if (NULL == object) return E_OUTOFMEMORY; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 56e5cf3..3091017 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5070,6 +5070,11 @@ IDirect3DDeviceImpl_7_CreateStateBlock(IDirect3DDevice7 *iface, WARN("BlockHandle == NULL, returning DDERR_INVALIDPARAMS\n"); return DDERR_INVALIDPARAMS; } + if(Type != D3DSBT_ALL && Type != D3DSBT_PIXELSTATE && + Type != D3DSBT_VERTEXSTATE ) { + WARN("Unexpected stateblock type, returning DDERR_INVALIDPARAMS\n"); + return DDERR_INVALIDPARAMS; + }
EnterCriticalSection(&ddraw_cs); *BlockHandle = IDirect3DDeviceImpl_CreateHandle(This); diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index baebdc3..b7dc333 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -1208,6 +1208,7 @@ typedef enum _WINED3DSTATEBLOCKTYPE { WINED3DSBT_ALL = 1, WINED3DSBT_PIXELSTATE = 2, WINED3DSBT_VERTEXSTATE = 3, + WINED3DSBT_RECORDED = 4, /* WineD3D private */
WINED3DSBT_FORCE_DWORD = 0xffffffff } WINED3DSTATEBLOCKTYPE;