Commit 0520531c authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Partially implement UiaGetRuntimeId.

Add RuntimeId support for HUIANODEs associated with an HWND. Signed-off-by: 's avatarConnor McAdams <cmcadams@codeweavers.com>
parent cf9d7ee4
...@@ -653,3 +653,57 @@ HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIAN ...@@ -653,3 +653,57 @@ HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIAN
return S_OK; return S_OK;
} }
#define UIA_RUNTIME_ID_PREFIX 42
static HRESULT write_runtime_id_base(SAFEARRAY *sa, HWND hwnd)
{
const int rt_id[2] = { UIA_RUNTIME_ID_PREFIX, HandleToUlong(hwnd) };
HRESULT hr;
LONG idx;
for (idx = 0; idx < ARRAY_SIZE(rt_id); idx++)
{
hr = SafeArrayPutElement(sa, &idx, (void *)&rt_id[idx]);
if (FAILED(hr))
return hr;
}
return S_OK;
}
/***********************************************************************
* UiaGetRuntimeId (uiautomationcore.@)
*/
HRESULT WINAPI UiaGetRuntimeId(HUIANODE huianode, SAFEARRAY **runtime_id)
{
struct uia_node *node = unsafe_impl_from_IWineUiaNode((IWineUiaNode *)huianode);
HRESULT hr;
FIXME("(%p, %p): partial stub\n", huianode, runtime_id);
if (!node || !runtime_id)
return E_INVALIDARG;
*runtime_id = NULL;
/* Provide an HWND based runtime ID if the node has an HWND. */
if (node->hwnd)
{
SAFEARRAY *sa;
if (!(sa = SafeArrayCreateVector(VT_I4, 0, 2)))
return E_FAIL;
hr = write_runtime_id_base(sa, node->hwnd);
if (FAILED(hr))
{
SafeArrayDestroy(sa);
return hr;
}
*runtime_id = sa;
return S_OK;
}
return E_NOTIMPL;
}
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
@ stdcall UiaGetReservedMixedAttributeValue(ptr) @ stdcall UiaGetReservedMixedAttributeValue(ptr)
@ stdcall UiaGetReservedNotSupportedValue(ptr) @ stdcall UiaGetReservedNotSupportedValue(ptr)
@ stub UiaGetRootNode @ stub UiaGetRootNode
@ stub UiaGetRuntimeId @ stdcall UiaGetRuntimeId(ptr ptr)
@ stub UiaGetUpdatedCache @ stub UiaGetUpdatedCache
@ stub UiaHPatternObjectFromVariant @ stub UiaHPatternObjectFromVariant
@ stub UiaHTextRangeFromVariant @ stub UiaHTextRangeFromVariant
......
...@@ -395,6 +395,7 @@ HRESULT WINAPI UiaProviderFromIAccessible(IAccessible *acc, long child_id, DWORD ...@@ -395,6 +395,7 @@ HRESULT WINAPI UiaProviderFromIAccessible(IAccessible *acc, long child_id, DWORD
HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIANT *out_val); HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIANT *out_val);
HRESULT WINAPI UiaNodeFromProvider(IRawElementProviderSimple *elprov, HUIANODE *huianode); HRESULT WINAPI UiaNodeFromProvider(IRawElementProviderSimple *elprov, HUIANODE *huianode);
BOOL WINAPI UiaNodeRelease(HUIANODE huianode); BOOL WINAPI UiaNodeRelease(HUIANODE huianode);
HRESULT WINAPI UiaGetRuntimeId(HUIANODE huianode, SAFEARRAY **runtime_id);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
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