Commit 15d352c5 authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Implement IUIAutomation::RemoveAllEventHandlers.

parent 4cc7525a
...@@ -13217,8 +13217,8 @@ static void test_IUIAutomationEventHandler(IUIAutomation *uia_iface, IUIAutomati ...@@ -13217,8 +13217,8 @@ static void test_IUIAutomationEventHandler(IUIAutomation *uia_iface, IUIAutomati
ok(AutomationEventHandler.ref > 1, "Unexpected refcnt %ld\n", AutomationEventHandler.ref); ok(AutomationEventHandler.ref > 1, "Unexpected refcnt %ld\n", AutomationEventHandler.ref);
hr = IUIAutomation_RemoveAllEventHandlers(uia_iface); hr = IUIAutomation_RemoveAllEventHandlers(uia_iface);
todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine ok(AutomationEventHandler.ref == 1, "Unexpected refcnt %ld\n", AutomationEventHandler.ref); ok(AutomationEventHandler.ref == 1, "Unexpected refcnt %ld\n", AutomationEventHandler.ref);
IUIAutomationElement_Release(elem2); IUIAutomationElement_Release(elem2);
} }
......
...@@ -3261,8 +3261,36 @@ static HRESULT WINAPI uia_iface_RemoveFocusChangedEventHandler(IUIAutomation6 *i ...@@ -3261,8 +3261,36 @@ static HRESULT WINAPI uia_iface_RemoveFocusChangedEventHandler(IUIAutomation6 *i
static HRESULT WINAPI uia_iface_RemoveAllEventHandlers(IUIAutomation6 *iface) static HRESULT WINAPI uia_iface_RemoveAllEventHandlers(IUIAutomation6 *iface)
{ {
FIXME("%p: stub\n", iface); struct uia_event_handler_map_entry *entry, *cursor;
return E_NOTIMPL;
TRACE("%p\n", iface);
EnterCriticalSection(&com_event_handlers_cs);
if (!com_event_handlers.handler_count)
goto exit;
RB_FOR_EACH_ENTRY_DESTRUCTOR(entry, cursor, &com_event_handlers.handler_map, struct uia_event_handler_map_entry, entry)
{
struct uia_com_event *event, *event2;
LIST_FOR_EACH_ENTRY_SAFE(event, event2, &entry->handlers_list, struct uia_com_event, event_handler_map_list_entry)
{
list_remove(&event->event_handler_map_list_entry);
IUnknown_Release(event->handler_iface);
com_event_handlers.handler_count--;
heap_free(event);
}
rb_remove(&com_event_handlers.handler_map, &entry->entry);
IUnknown_Release(entry->handler_iface);
SafeArrayDestroy(entry->runtime_id);
heap_free(entry);
}
exit:
LeaveCriticalSection(&com_event_handlers_cs);
return S_OK;
} }
static HRESULT WINAPI uia_iface_IntNativeArrayToSafeArray(IUIAutomation6 *iface, int *arr, int arr_count, static HRESULT WINAPI uia_iface_IntNativeArrayToSafeArray(IUIAutomation6 *iface, int *arr, int arr_count,
......
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