Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46012
Signed-off-by: Patrick Hibbs hibbsncc1701@gmail.com
From: Patrick Hibbs hibbsncc1701@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46012
Signed-off-by: Patrick Hibbs hibbsncc1701@gmail.com --- dlls/d3dx9_36/effect.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 7719edd4f25..f82d69d1acd 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -4442,10 +4442,26 @@ static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface, IDirect3DDevic static HRESULT WINAPI d3dx_effect_SetRawValue(ID3DXEffect *iface, D3DXHANDLE parameter, const void *data, UINT byte_offset, UINT bytes) { - FIXME("iface %p, parameter %p, data %p, byte_offset %u, bytes %u stub!\n", + struct d3dx_effect *src = impl_from_ID3DXEffect( iface ); + struct d3dx_parameter *param = get_valid_parameter( src, parameter ); + void *raw = NULL; + + TRACE("iface %p, parameter %p, data %p, byte_offset %u, bytes %u.\n", iface, parameter, data, byte_offset, bytes);
- return E_NOTIMPL; + if (!src) + { + WARN("Invalid variable.\n"); + return E_FAIL; + } + + if (!data || !param || !(raw = param_get_data_and_dirtify( src, param, + byte_offset + bytes, TRUE ))) + return D3DERR_INVALIDCALL; + + memcpy( raw, data, bytes ); + + return S_OK; } #endif
It would be nice to have some tests for this, checking that your implementation matches native behavior for both normal and edge cases (e.g. for the latter, what happens when data or param are NULL). You can probably use the last couple of tests at the end of d3dx9_36/tests/effect.c as reference.
Also nitpick, the prefix in the commit subject should be "d3dx9:".