Commit 1518851b authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Clone UiaCacheRequest structure passed to UiaAddEvent.

parent 8c41311a
......@@ -194,6 +194,7 @@ static ULONG WINAPI uia_event_Release(IWineUiaEvent *iface)
assert(!event->event_map_entry);
SafeArrayDestroy(event->runtime_id);
uia_cache_request_destroy(&event->cache_req);
for (i = 0; i < event->event_advisers_count; i++)
IWineUiaEventAdviser_Release(event->event_advisers[i]);
heap_free(event->event_advisers);
......@@ -457,6 +458,10 @@ HRESULT WINAPI UiaAddEvent(HUIANODE huianode, EVENTID event_id, UiaEventCallback
return hr;
}
hr = uia_cache_request_clone(&event->cache_req, cache_req);
if (FAILED(hr))
goto exit;
hr = attach_event_to_uia_node(huianode, event);
if (FAILED(hr))
goto exit;
......
......@@ -110,6 +110,7 @@ struct uia_event
struct uia_event_map_entry *event_map_entry;
LONG event_defunct;
struct UiaCacheRequest cache_req;
UiaEventCallback *cback;
};
......@@ -186,6 +187,8 @@ HRESULT create_msaa_provider(IAccessible *acc, long child_id, HWND hwnd, BOOL kn
HRESULT register_interface_in_git(IUnknown *iface, REFIID riid, DWORD *ret_cookie) DECLSPEC_HIDDEN;
HRESULT unregister_interface_in_git(DWORD git_cookie) DECLSPEC_HIDDEN;
HRESULT get_interface_in_git(REFIID riid, DWORD git_cookie, IUnknown **ret_iface) DECLSPEC_HIDDEN;
void uia_cache_request_destroy(struct UiaCacheRequest *cache_req) DECLSPEC_HIDDEN;
HRESULT uia_cache_request_clone(struct UiaCacheRequest *dst, struct UiaCacheRequest *src) DECLSPEC_HIDDEN;
HRESULT get_safearray_dim_bounds(SAFEARRAY *sa, UINT dim, LONG *lbound, LONG *elems) DECLSPEC_HIDDEN;
HRESULT get_safearray_bounds(SAFEARRAY *sa, LONG *lbound, LONG *elems) DECLSPEC_HIDDEN;
int uia_compare_safearrays(SAFEARRAY *sa1, SAFEARRAY *sa2, int prop_type) DECLSPEC_HIDDEN;
......@@ -98,6 +98,48 @@ HRESULT get_interface_in_git(REFIID riid, DWORD git_cookie, IUnknown **ret_iface
return S_OK;
}
/*
* UiaCacheRequest cloning functions.
*/
void uia_cache_request_destroy(struct UiaCacheRequest *cache_req)
{
heap_free(cache_req->pProperties);
heap_free(cache_req->pPatterns);
}
HRESULT uia_cache_request_clone(struct UiaCacheRequest *dst, struct UiaCacheRequest *src)
{
FIXME("Cache request condition cloning currently unimplemented\n");
dst->Scope = src->Scope;
dst->automationElementMode = src->automationElementMode;
if (src->cProperties)
{
if (!(dst->pProperties = heap_alloc_zero(sizeof(*dst->pProperties) * src->cProperties)))
{
uia_cache_request_destroy(dst);
return E_OUTOFMEMORY;
}
dst->cProperties = src->cProperties;
memcpy(dst->pProperties, src->pProperties, sizeof(*dst->pProperties) * dst->cProperties);
}
if (src->cPatterns)
{
if (!(dst->pPatterns = heap_alloc_zero(sizeof(*dst->pPatterns) * src->cPatterns)))
{
uia_cache_request_destroy(dst);
return E_OUTOFMEMORY;
}
dst->cPatterns = src->cPatterns;
memcpy(dst->pPatterns, src->pPatterns, sizeof(*dst->pPatterns) * dst->cPatterns);
}
return S_OK;
}
HRESULT get_safearray_dim_bounds(SAFEARRAY *sa, UINT dim, LONG *lbound, LONG *elems)
{
LONG ubound;
......
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