Commit 60a3e010 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3dx9/effect: Reset output handle for next after last technique in FindNextValidTechnique().

parent 671eabdf
......@@ -3816,7 +3816,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D
}
}
*next_technique = get_technique_handle(&effect->techniques[0]);
*next_technique = NULL;
return S_FALSE;
}
......
......@@ -7892,9 +7892,9 @@ static void test_effect_find_next_valid_technique(void)
D3DPRESENT_PARAMETERS present_parameters = {0};
IDirect3DDevice9 *device;
D3DXTECHNIQUE_DESC desc;
D3DXHANDLE tech, tech2;
ID3DXEffect *effect;
IDirect3D9 *d3d;
D3DXHANDLE tech;
ULONG refcount;
HWND window;
HRESULT hr;
......@@ -7939,9 +7939,12 @@ static void test_effect_find_next_valid_technique(void)
ok(hr == D3D_OK, "Got result %#x.\n", hr);
ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
tech2 = tech;
hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2);
ok(hr == S_FALSE, "Got result %#x.\n", hr);
hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
ok(!tech2, "Unexpected technique handle %p.\n", tech2);
/* Test GetTechniqueDesc() with a NULL handle. */
hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc);
ok(hr == D3D_OK, "Got result %#x.\n", hr);
ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
......@@ -7957,9 +7960,10 @@ static void test_effect_find_next_valid_technique(void)
ok(hr == D3D_OK, "Got result %#x.\n", hr);
ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2);
ok(hr == S_FALSE, "Got result %#x.\n", hr);
hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
ok(!tech2, "Unexpected technique handle %p.\n", tech2);
hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc);
ok(hr == D3D_OK, "Got result %#x.\n", hr);
ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
......@@ -7985,8 +7989,9 @@ static void test_effect_find_next_valid_technique(void)
ok(hr == D3D_OK, "Got result %#x.\n", hr);
ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2);
ok(hr == S_FALSE, "Got result %#x.\n", hr);
ok(!tech2, "Unexpected technique handle %p.\n", tech2);
hr = effect->lpVtbl->FindNextValidTechnique(effect, "nope", &tech);
ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment