From a06e002e93b61d54048672461f0072abd28d7e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 3 Aug 2007 22:48:42 +0200 Subject: [PATCH] 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(+) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 0b2436d261e..74a0d13cd28 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 2cd79ea83fa..33eda64b0f1 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 56e5cf32d3e..3091017bc75 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 baebdc37f4c..b7dc333fa6b 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;