From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/uiautomationcore/tests/uiautomation.c | 18 ++++---- dlls/uiautomationcore/uia_client.c | 42 ++++++++++++++++++- dlls/uiautomationcore/uia_ids.c | 48 ++++++++++++++-------- 3 files changed, 82 insertions(+), 26 deletions(-)
diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index d6ebad03e3a..dfd9f9b38df 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -4100,9 +4100,7 @@ static void check_uia_prop_val(PROPERTYID prop_id, enum UIAutomationType type, V break;
case UIAutomationType_Int: - todo_wine ok(V_VT(v) == VT_I4, "Unexpected VT %d\n", V_VT(v)); - if (V_VT(v) != VT_I4) - break; + ok(V_VT(v) == VT_I4, "Unexpected VT %d\n", V_VT(v));
if (prop_id == UIA_NativeWindowHandlePropertyId) ok(ULongToHandle(V_I4(v)) == Provider.hwnd, "Unexpected I4 %#lx\n", V_I4(v)); @@ -4112,9 +4110,7 @@ static void check_uia_prop_val(PROPERTYID prop_id, enum UIAutomationType type, V break;
case UIAutomationType_IntArray: - todo_wine ok(V_VT(v) == (VT_ARRAY | VT_I4), "Unexpected VT %d\n", V_VT(v)); - if (V_VT(v) != (VT_ARRAY | VT_I4)) - break; + ok(V_VT(v) == (VT_ARRAY | VT_I4), "Unexpected VT %d\n", V_VT(v));
for (idx = 0; idx < ARRAY_SIZE(uia_i4_arr_prop_val); idx++) { @@ -4319,7 +4315,10 @@ static void test_UiaGetPropertyValue(void) } winetest_push_context("prop_id %d", prop_id); hr = UiaGetPropertyValue(node, prop_id, &v); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == E_NOTIMPL) + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + else + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); check_uia_prop_val(prop_id, elem_prop->type, &v);
/* @@ -4330,7 +4329,10 @@ static void test_UiaGetPropertyValue(void) { Provider.ret_invalid_prop_type = TRUE; hr = UiaGetPropertyValue(node, prop_id, &v); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (hr == E_NOTIMPL) + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + else + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { ok_method_sequence(get_prop_invalid_type_seq, NULL); diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 7e710a25642..eae532d7b6c 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -153,8 +153,46 @@ static ULONG WINAPI uia_provider_Release(IWineUiaProvider *iface) static HRESULT WINAPI uia_provider_get_prop_val(IWineUiaProvider *iface, const struct uia_prop_info *prop_info, VARIANT *ret_val) { - FIXME("%p, %p, %p: stub\n", iface, prop_info, ret_val); - return E_NOTIMPL; + struct uia_provider *prov = impl_from_IWineUiaProvider(iface); + HRESULT hr; + VARIANT v; + + TRACE("%p, %p, %p\n", iface, prop_info, ret_val); + + VariantInit(&v); + hr = IRawElementProviderSimple_GetPropertyValue(prov->elprov, prop_info->prop_id, &v); + if (FAILED(hr)) + goto exit; + + switch (prop_info->type) + { + case UIAutomationType_Int: + if (V_VT(&v) != VT_I4) + { + WARN("Invalid vt %d for UIAutomationType_Int\n", V_VT(&v)); + goto exit; + } + *ret_val = v; + break; + + case UIAutomationType_IntArray: + if (V_VT(&v) != (VT_I4 | VT_ARRAY)) + { + WARN("Invalid vt %d for UIAutomationType_IntArray\n", V_VT(&v)); + goto exit; + } + *ret_val = v; + break; + + default: + break; + } + +exit: + if (V_VT(ret_val) == VT_EMPTY) + VariantClear(&v); + + return S_OK; }
static const IWineUiaProviderVtbl uia_provider_vtbl = { diff --git a/dlls/uiautomationcore/uia_ids.c b/dlls/uiautomationcore/uia_ids.c index 8c6f1386fba..864925f0936 100644 --- a/dlls/uiautomationcore/uia_ids.c +++ b/dlls/uiautomationcore/uia_ids.c @@ -59,9 +59,11 @@ static const struct uia_prop_info default_uia_properties[] = { { &Window_CanMinimize_Property_GUID, UIA_WindowCanMinimizePropertyId, }, { &RangeValue_LargeChange_Property_GUID, UIA_RangeValueLargeChangePropertyId, }, { &Selection2_CurrentSelectedItem_Property_GUID, UIA_Selection2CurrentSelectedItemPropertyId, }, - { &Culture_Property_GUID, UIA_CulturePropertyId, }, + { &Culture_Property_GUID, UIA_CulturePropertyId, + UIAutomationType_Int, }, { &LegacyIAccessible_DefaultAction_Property_GUID, UIA_LegacyIAccessibleDefaultActionPropertyId, }, - { &Level_Property_GUID, UIA_LevelPropertyId, }, + { &Level_Property_GUID, UIA_LevelPropertyId, + UIAutomationType_Int, }, { &IsKeyboardFocusable_Property_GUID, UIA_IsKeyboardFocusablePropertyId, }, { &GridItem_Row_Property_GUID, UIA_GridItemRowPropertyId, }, { &IsSpreadsheetItemPatternAvailable_Property_GUID, UIA_IsSpreadsheetItemPatternAvailablePropertyId, }, @@ -80,8 +82,10 @@ static const struct uia_prop_info default_uia_properties[] = { { &IsInvokePatternAvailable_Property_GUID, UIA_IsInvokePatternAvailablePropertyId, }, { &HasKeyboardFocus_Property_GUID, UIA_HasKeyboardFocusPropertyId, }, { &ClickablePoint_Property_GUID, UIA_ClickablePointPropertyId, }, - { &NewNativeWindowHandle_Property_GUID, UIA_NativeWindowHandlePropertyId, }, - { &SizeOfSet_Property_GUID, UIA_SizeOfSetPropertyId, }, + { &NewNativeWindowHandle_Property_GUID, UIA_NativeWindowHandlePropertyId, + UIAutomationType_Int, }, + { &SizeOfSet_Property_GUID, UIA_SizeOfSetPropertyId, + UIAutomationType_Int, }, { &LegacyIAccessible_Name_Property_GUID, UIA_LegacyIAccessibleNamePropertyId, }, { &Window_CanMaximize_Property_GUID, UIA_WindowCanMaximizePropertyId, }, { &Scroll_HorizontallyScrollable_Property_GUID, UIA_ScrollHorizontallyScrollablePropertyId, }, @@ -103,7 +107,8 @@ static const struct uia_prop_info default_uia_properties[] = { { &Toggle_ToggleState_Property_GUID, UIA_ToggleToggleStatePropertyId, }, { &IsTogglePatternAvailable_Property_GUID, UIA_IsTogglePatternAvailablePropertyId, }, { &LegacyIAccessible_State_Property_GUID, UIA_LegacyIAccessibleStatePropertyId, }, - { &PositionInSet_Property_GUID, UIA_PositionInSetPropertyId, }, + { &PositionInSet_Property_GUID, UIA_PositionInSetPropertyId, + UIAutomationType_Int, }, { &RangeValue_IsReadOnly_Property_GUID, UIA_RangeValueIsReadOnlyPropertyId, }, { &Drag_DropEffects_Property_GUID, UIA_DragDropEffectsPropertyId, }, { &RangeValue_SmallChange_Property_GUID, UIA_RangeValueSmallChangePropertyId, }, @@ -116,16 +121,20 @@ static const struct uia_prop_info default_uia_properties[] = { { &Window_WindowVisualState_Property_GUID, UIA_WindowWindowVisualStatePropertyId, }, { &IsOffscreen_Property_GUID, UIA_IsOffscreenPropertyId, }, { &Annotation_Author_Property_GUID, UIA_AnnotationAuthorPropertyId, }, - { &Orientation_Property_GUID, UIA_OrientationPropertyId, }, + { &Orientation_Property_GUID, UIA_OrientationPropertyId, + UIAutomationType_Int, }, { &Value_Value_Property_GUID, UIA_ValueValuePropertyId, }, - { &VisualEffects_Property_GUID, UIA_VisualEffectsPropertyId, }, + { &VisualEffects_Property_GUID, UIA_VisualEffectsPropertyId, + UIAutomationType_Int, }, { &Selection2_FirstSelectedItem_Property_GUID, UIA_Selection2FirstSelectedItemPropertyId, }, { &IsGridPatternAvailable_Property_GUID, UIA_IsGridPatternAvailablePropertyId, }, { &SelectionItem_SelectionContainer_Property_GUID, UIA_SelectionItemSelectionContainerPropertyId, }, - { &HeadingLevel_Property_GUID, UIA_HeadingLevelPropertyId, }, + { &HeadingLevel_Property_GUID, UIA_HeadingLevelPropertyId, + UIAutomationType_Int, }, { &DropTarget_DropTargetEffect_Property_GUID, UIA_DropTargetDropTargetEffectPropertyId, }, { &Grid_ColumnCount_Property_GUID, UIA_GridColumnCountPropertyId, }, - { &AnnotationTypes_Property_GUID, UIA_AnnotationTypesPropertyId, }, + { &AnnotationTypes_Property_GUID, UIA_AnnotationTypesPropertyId, + UIAutomationType_IntArray, }, { &IsPeripheral_Property_GUID, UIA_IsPeripheralPropertyId, }, { &Transform2_ZoomMaximum_Property_GUID, UIA_Transform2ZoomMaximumPropertyId, }, { &Drag_DropEffect_Property_GUID, UIA_DragDropEffectPropertyId, }, @@ -142,7 +151,8 @@ static const struct uia_prop_info default_uia_properties[] = { { &ControllerFor_Property_GUID, UIA_ControllerForPropertyId, }, { &ProviderDescription_Property_GUID, UIA_ProviderDescriptionPropertyId, }, { &AriaProperties_Property_GUID, UIA_AriaPropertiesPropertyId, }, - { &LiveSetting_Property_GUID, UIA_LiveSettingPropertyId, }, + { &LiveSetting_Property_GUID, UIA_LiveSettingPropertyId, + UIAutomationType_Int, }, { &Selection2_LastSelectedItem_Property_GUID, UIA_Selection2LastSelectedItemPropertyId, }, { &Transform2_CanZoom_Property_GUID, UIA_Transform2CanZoomPropertyId, }, { &Window_IsModal_Property_GUID, UIA_WindowIsModalPropertyId, }, @@ -150,7 +160,8 @@ static const struct uia_prop_info default_uia_properties[] = { { &AriaRole_Property_GUID, UIA_AriaRolePropertyId, }, { &Scroll_VerticallyScrollable_Property_GUID, UIA_ScrollVerticallyScrollablePropertyId, }, { &RangeValue_Value_Property_GUID, UIA_RangeValueValuePropertyId, }, - { &ProcessId_Property_GUID, UIA_ProcessIdPropertyId, }, + { &ProcessId_Property_GUID, UIA_ProcessIdPropertyId, + UIAutomationType_Int, }, { &Scroll_VerticalScrollPercent_Property_GUID, UIA_ScrollVerticalScrollPercentPropertyId, }, { &IsObjectModelPatternAvailable_Property_GUID, UIA_IsObjectModelPatternAvailablePropertyId, }, { &IsDialog_Property_GUID, UIA_IsDialogPropertyId, }, @@ -177,7 +188,8 @@ static const struct uia_prop_info default_uia_properties[] = { { &DescribedBy_Property_GUID, UIA_DescribedByPropertyId, }, { &IsSelectionPatternAvailable_Property_GUID, UIA_IsSelectionPatternAvailablePropertyId, }, { &Grid_RowCount_Property_GUID, UIA_GridRowCountPropertyId, }, - { &OutlineColor_Property_GUID, UIA_OutlineColorPropertyId, }, + { &OutlineColor_Property_GUID, UIA_OutlineColorPropertyId, + UIAutomationType_IntArray, }, { &Table_RowOrColumnMajor_Property_GUID, UIA_TableRowOrColumnMajorPropertyId, }, { &IsDockPatternAvailable_Property_GUID, UIA_IsDockPatternAvailablePropertyId, }, { &IsSynchronizedInputPatternAvailable_Property_GUID,UIA_IsSynchronizedInputPatternAvailablePropertyId, }, @@ -186,7 +198,8 @@ static const struct uia_prop_info default_uia_properties[] = { { &AnnotationObjects_Property_GUID, UIA_AnnotationObjectsPropertyId, }, { &IsRequiredForForm_Property_GUID, UIA_IsRequiredForFormPropertyId, }, { &SpreadsheetItem_AnnotationTypes_Property_GUID, UIA_SpreadsheetItemAnnotationTypesPropertyId, }, - { &FillColor_Property_GUID, UIA_FillColorPropertyId, }, + { &FillColor_Property_GUID, UIA_FillColorPropertyId, + UIAutomationType_Int, }, { &IsStylesPatternAvailable_Property_GUID, UIA_IsStylesPatternAvailablePropertyId, }, { &Window_IsTopmost_Property_GUID, UIA_WindowIsTopmostPropertyId, }, { &IsCustomNavigationPatternAvailable_Property_GUID, UIA_IsCustomNavigationPatternAvailablePropertyId, }, @@ -194,11 +207,14 @@ static const struct uia_prop_info default_uia_properties[] = { { &AcceleratorKey_Property_GUID, UIA_AcceleratorKeyPropertyId, }, { &IsTextChildPatternAvailable_Property_GUID, UIA_IsTextChildPatternAvailablePropertyId, }, { &LegacyIAccessible_Selection_Property_GUID, UIA_LegacyIAccessibleSelectionPropertyId, }, - { &FillType_Property_GUID, UIA_FillTypePropertyId, }, - { &ControlType_Property_GUID, UIA_ControlTypePropertyId, }, + { &FillType_Property_GUID, UIA_FillTypePropertyId, + UIAutomationType_Int, }, + { &ControlType_Property_GUID, UIA_ControlTypePropertyId, + UIAutomationType_Int, }, { &IsMultipleViewPatternAvailable_Property_GUID, UIA_IsMultipleViewPatternAvailablePropertyId, }, { &DropTarget_DropTargetEffects_Property_GUID, UIA_DropTargetDropTargetEffectsPropertyId, }, - { &LandmarkType_Property_GUID, UIA_LandmarkTypePropertyId, }, + { &LandmarkType_Property_GUID, UIA_LandmarkTypePropertyId, + UIAutomationType_Int, }, { &Drag_IsGrabbed_Property_GUID, UIA_DragIsGrabbedPropertyId, }, { &GridItem_ColumnSpan_Property_GUID, UIA_GridItemColumnSpanPropertyId, }, { &Styles_Shape_Property_GUID, UIA_StylesShapePropertyId, },