[PATCH 05/10] d3dx9: Implement d3dx_effect_DeleteParameterBlock().
Matteo Bruni
matteo.mystral at gmail.com
Tue Nov 12 12:51:38 CST 2019
On Thu, Nov 7, 2019 at 10:19 PM Paul Gofman <gofmanp at gmail.com> wrote:
> @@ -4121,11 +4129,27 @@ static HRESULT WINAPI d3dx_effect_ApplyParameterBlock(ID3DXEffect *iface, D3DXHA
> #if D3DX_SDK_VERSION >= 26
> static HRESULT WINAPI d3dx_effect_DeleteParameterBlock(ID3DXEffect *iface, D3DXHANDLE parameter_block)
> {
Any idea what is the behavior with version < 26? Was the allocated
memory just dropped on the floor?
> - struct d3dx_effect *This = impl_from_ID3DXEffect(iface);
> + struct d3dx_parameter_block *block = get_valid_parameter_block(parameter_block);
> + struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
> + struct d3dx_parameter_block *b;
>
> - FIXME("(%p)->(%p): stub\n", This, parameter_block);
> + TRACE("iface %p, parameter_block %p.\n", iface, parameter_block);
>
> - return E_NOTIMPL;
> + if (!block)
> + return D3DERR_INVALIDCALL;
> +
> + LIST_FOR_EACH_ENTRY(b, &effect->parameter_block_list, struct d3dx_parameter_block, entry)
> + {
> + if (b == block)
> + {
> + list_remove(&b->entry);
> + free_parameter_block(b);
> + return D3D_OK;
> + }
> + }
> +
> + WARN("Block is not found in issued block list, not freeing memory.\n");
> + return D3DERR_INVALIDCALL;
> }
> #endif
What happens if the parameter block is currently active?
More information about the wine-devel
mailing list