Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 13 ++++++++----- dlls/d3d10/tests/effect.c | 9 +++------ 2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 9436d0277f2..ebcb5f4145b 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3258,7 +3258,7 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, const char *name) { - struct d3d10_effect *This = impl_from_ID3D10Effect(iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); @@ -3269,9 +3269,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB return &null_variable.ID3D10EffectVariable_iface; }
- for (i = 0; i < This->local_buffer_count; ++i) + for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &This->local_buffers[i]; + struct d3d10_effect_variable *l = &effect->local_buffers[i]; unsigned int j;
for (j = 0; j < l->type->member_count; ++j) @@ -3286,9 +3286,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB } }
- for (i = 0; i < This->local_variable_count; ++i) + for (i = 0; i < effect->local_variable_count; ++i) { - struct d3d10_effect_variable *v = &This->local_variables[i]; + struct d3d10_effect_variable *v = &effect->local_variables[i];
if (v->name && !strcmp(v->name, name)) { @@ -3297,6 +3297,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB } }
+ if (effect->pool) + return effect->pool->lpVtbl->GetVariableByName(effect->pool, name); + WARN("Invalid name specified\n");
return &null_variable.ID3D10EffectVariable_iface; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 3243e7b2713..9fbf8b9e865 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6671,13 +6671,10 @@ todo_wine
v = child_effect->lpVtbl->GetVariableByName(child_effect, "s_texture"); hr = v->lpVtbl->GetDesc(v, &var_desc); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(!strcmp(var_desc.Name, "s_texture"), "Unexpected name %s.\n", var_desc.Name); - ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); - } + ok(!strcmp(var_desc.Name, "s_texture"), "Unexpected name %s.\n", var_desc.Name); +todo_wine + ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableBySemantic(child_effect, "COLOR0"); hr = v->lpVtbl->GetDesc(v, &var_desc);