From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/uiautomationcore/tests/uiautomation.c | 5 ++--- dlls/uiautomationcore/uia_provider.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 009864d10c7..beb34fb400f 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -12347,9 +12347,8 @@ static void test_node_hwnd_provider_(HUIANODE node, HWND hwnd, const char *file, GetClassNameW(hwnd, buf, ARRAY_SIZE(buf)); hr = UiaGetPropertyValue(node, UIA_ClassNamePropertyId, &v); ok_(file, line)(hr == S_OK, "Unexpected hr %#lx\n", hr); - todo_wine ok_(file, line)(V_VT(&v) == VT_BSTR, "Unexpected VT %d\n", V_VT(&v)); - if (V_VT(&v) == VT_BSTR) - ok(!lstrcmpW(V_BSTR(&v), buf), "Unexpected BSTR %s\n", wine_dbgstr_w(V_BSTR(&v))); + ok_(file, line)(V_VT(&v) == VT_BSTR, "Unexpected VT %d\n", V_VT(&v)); + ok(!lstrcmpW(V_BSTR(&v), buf), "Unexpected BSTR %s\n", wine_dbgstr_w(V_BSTR(&v))); VariantClear(&v); winetest_pop_context();
diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 1f5cce7ffed..74930728362 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1317,6 +1317,21 @@ static HRESULT WINAPI base_hwnd_provider_GetPropertyValue(IRawElementProviderSim break; }
+ case UIA_ClassNamePropertyId: + { + WCHAR buf[256] = { 0 }; + + SetLastError(NOERROR); + if (!GetClassNameW(base_hwnd_prov->hwnd, buf, ARRAY_SIZE(buf))) + hr = uia_get_hr_for_last_error(); + else + { + V_VT(ret_val) = VT_BSTR; + V_BSTR(ret_val) = SysAllocString(buf); + } + break; + } + default: break; }