Commit 89111704 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d2d1: Fix GetPropertyNameLength() return value.

parent d05cfdd7
...@@ -2130,7 +2130,7 @@ static UINT32 STDMETHODCALLTYPE d2d_effect_properties_GetPropertyNameLength(ID2D ...@@ -2130,7 +2130,7 @@ static UINT32 STDMETHODCALLTYPE d2d_effect_properties_GetPropertyNameLength(ID2D
if (!(prop = d2d_effect_properties_get_property_by_index(properties, index))) if (!(prop = d2d_effect_properties_get_property_by_index(properties, index)))
return D2DERR_INVALID_PROPERTY; return D2DERR_INVALID_PROPERTY;
return wcslen(prop->name) + 1; return wcslen(prop->name);
} }
static D2D1_PROPERTY_TYPE STDMETHODCALLTYPE d2d_effect_properties_GetType(ID2D1Properties *iface, static D2D1_PROPERTY_TYPE STDMETHODCALLTYPE d2d_effect_properties_GetType(ID2D1Properties *iface,
......
...@@ -10862,6 +10862,7 @@ static void check_system_properties_(unsigned int line, ID2D1Effect *effect) ...@@ -10862,6 +10862,7 @@ static void check_system_properties_(unsigned int line, ID2D1Effect *effect)
UINT i, value_size, str_size; UINT i, value_size, str_size;
WCHAR name[32], buffer[256]; WCHAR name[32], buffer[256];
D2D1_PROPERTY_TYPE type; D2D1_PROPERTY_TYPE type;
UINT32 count;
HRESULT hr; HRESULT hr;
static const struct system_property_test static const struct system_property_test
...@@ -10898,7 +10899,7 @@ static void check_system_properties_(unsigned int line, ID2D1Effect *effect) ...@@ -10898,7 +10899,7 @@ static void check_system_properties_(unsigned int line, ID2D1Effect *effect)
winetest_push_context("Property %u", i); winetest_push_context("Property %u", i);
name[0] = 0; name[0] = 0;
hr = ID2D1Effect_GetPropertyName(effect, test->index, name, sizeof(name)); hr = ID2D1Effect_GetPropertyName(effect, test->index, name, ARRAY_SIZE(name));
ok_(__FILE__, line)(hr == S_OK, "Failed to get property name, hr %#lx\n", hr); ok_(__FILE__, line)(hr == S_OK, "Failed to get property name, hr %#lx\n", hr);
if (hr == D2DERR_INVALID_PROPERTY) if (hr == D2DERR_INVALID_PROPERTY)
{ {
...@@ -10907,6 +10908,16 @@ static void check_system_properties_(unsigned int line, ID2D1Effect *effect) ...@@ -10907,6 +10908,16 @@ static void check_system_properties_(unsigned int line, ID2D1Effect *effect)
} }
ok_(__FILE__, line)(!wcscmp(name, test->name), "Got unexpected property name %s, expected %s.\n", ok_(__FILE__, line)(!wcscmp(name, test->name), "Got unexpected property name %s, expected %s.\n",
debugstr_w(name), debugstr_w(test->name)); debugstr_w(name), debugstr_w(test->name));
count = ID2D1Effect_GetPropertyNameLength(effect, test->index);
ok_(__FILE__, line)(wcslen(name) == count, "Got unexpected property name length %u.\n", count);
name[0] = 0;
hr = ID2D1Effect_GetPropertyName(effect, test->index, name, count);
ok_(__FILE__, line)(hr == D2DERR_INSUFFICIENT_BUFFER, "Failed to get property name, hr %#lx\n", hr);
name[0] = 0;
hr = ID2D1Effect_GetPropertyName(effect, test->index, name, count + 1);
ok_(__FILE__, line)(hr == S_OK, "Failed to get property name, hr %#lx\n", hr);
type = ID2D1Effect_GetType(effect, test->index); type = ID2D1Effect_GetType(effect, test->index);
ok_(__FILE__, line)(type == test->type, "Got unexpected property type %#x, expected %#x.\n", ok_(__FILE__, line)(type == test->type, "Got unexpected property type %#x, expected %#x.\n",
...@@ -14750,7 +14761,6 @@ static void test_get_effect_properties(BOOL d3d11) ...@@ -14750,7 +14761,6 @@ static void test_get_effect_properties(BOOL d3d11)
ok(!wcscmp(buffW, L"Rect"), "Unexpected name %s.\n", debugstr_w(buffW)); ok(!wcscmp(buffW, L"Rect"), "Unexpected name %s.\n", debugstr_w(buffW));
count = ID2D1Properties_GetPropertyNameLength(properties, 0); count = ID2D1Properties_GetPropertyNameLength(properties, 0);
todo_wine
ok(count == 4, "Unexpected name length %u.\n", count); ok(count == 4, "Unexpected name length %u.\n", count);
type = ID2D1Properties_GetType(properties, 0); type = ID2D1Properties_GetType(properties, 0);
......
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