Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1f86e2c6
Commit
1f86e2c6
authored
Aug 08, 2022
by
Connor McAdams
Committed by
Alexandre Julliard
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Implement UiaHUiaNodeFromVariant.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
dadfd3d4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
129 additions
and
1 deletion
+129
-1
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+90
-0
uia_client.c
dlls/uiautomationcore/uia_client.c
+37
-0
uiautomationcore.spec
dlls/uiautomationcore/uiautomationcore.spec
+1
-1
uiautomationcoreapi.h
include/uiautomationcoreapi.h
+1
-0
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
1f86e2c6
...
...
@@ -4835,6 +4835,95 @@ static void test_UiaGetRuntimeId(void)
CoUninitialize
();
}
static
LONG
Object_ref
=
1
;
static
HRESULT
WINAPI
Object_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
ppv
=
iface
;
IUnknown_AddRef
(
iface
);
return
S_OK
;
}
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
Object_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
Object_ref
);
}
static
ULONG
WINAPI
Object_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
Object_ref
);
}
static
IUnknownVtbl
ObjectVtbl
=
{
Object_QueryInterface
,
Object_AddRef
,
Object_Release
};
static
IUnknown
Object
=
{
&
ObjectVtbl
};
static
void
test_UiaHUiaNodeFromVariant
(
void
)
{
HUIANODE
node
;
HRESULT
hr
;
VARIANT
v
;
hr
=
UiaHUiaNodeFromVariant
(
NULL
,
&
node
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
node
=
(
void
*
)
0xdeadbeef
;
V_VT
(
&
v
)
=
VT_R8
;
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
node
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
node
,
"node != NULL
\n
"
);
node
=
(
void
*
)
0xdeadbeef
;
V_VT
(
&
v
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
v
)
=
&
Object
;
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
node
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
node
==
(
void
*
)
&
Object
,
"node != NULL
\n
"
);
ok
(
Object_ref
==
2
,
"Unexpected Object_ref %ld
\n
"
,
Object_ref
);
VariantClear
(
&
v
);
#ifdef _WIN64
node
=
(
void
*
)
0xdeadbeef
;
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
0xbeefdead
;
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
node
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
node
,
"node != NULL
\n
"
);
node
=
(
void
*
)
0xdeadbeef
;
V_VT
(
&
v
)
=
VT_I8
;
V_I8
(
&
v
)
=
0xbeefdead
;
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
node
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
node
==
(
void
*
)
V_I8
(
&
v
),
"node != V_I8
\n
"
);
#else
node
=
(
void
*
)
0xdeadbeef
;
V_VT
(
&
v
)
=
VT_I8
;
V_I8
(
&
v
)
=
0xbeefdead
;
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
node
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
node
,
"node != NULL
\n
"
);
node
=
(
void
*
)
0xdeadbeef
;
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
0xbeefdead
;
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
node
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
node
==
(
void
*
)
V_I4
(
&
v
),
"node != V_I8
\n
"
);
#endif
}
START_TEST
(
uiautomation
)
{
HMODULE
uia_dll
=
LoadLibraryA
(
"uiautomationcore.dll"
);
...
...
@@ -4857,6 +4946,7 @@ START_TEST(uiautomation)
test_UiaNodeFromProvider
();
test_UiaGetPropertyValue
();
test_UiaGetRuntimeId
();
test_UiaHUiaNodeFromVariant
();
if
(
uia_dll
)
{
pUiaProviderFromIAccessible
=
(
void
*
)
GetProcAddress
(
uia_dll
,
"UiaProviderFromIAccessible"
);
...
...
dlls/uiautomationcore/uia_client.c
View file @
1f86e2c6
...
...
@@ -979,3 +979,40 @@ HRESULT WINAPI UiaGetRuntimeId(HUIANODE huianode, SAFEARRAY **runtime_id)
return
S_OK
;
}
/***********************************************************************
* UiaHUiaNodeFromVariant (uiautomationcore.@)
*/
HRESULT
WINAPI
UiaHUiaNodeFromVariant
(
VARIANT
*
in_val
,
HUIANODE
*
huianode
)
{
const
VARTYPE
expected_vt
=
sizeof
(
void
*
)
==
8
?
VT_I8
:
VT_I4
;
TRACE
(
"(%p, %p)
\n
"
,
in_val
,
huianode
);
if
(
!
in_val
||
!
huianode
)
return
E_INVALIDARG
;
*
huianode
=
NULL
;
if
((
V_VT
(
in_val
)
!=
expected_vt
)
&&
(
V_VT
(
in_val
)
!=
VT_UNKNOWN
))
{
WARN
(
"Invalid vt %d
\n
"
,
V_VT
(
in_val
));
return
E_INVALIDARG
;
}
if
(
V_VT
(
in_val
)
==
VT_UNKNOWN
)
{
if
(
V_UNKNOWN
(
in_val
))
IUnknown_AddRef
(
V_UNKNOWN
(
in_val
));
*
huianode
=
(
HUIANODE
)
V_UNKNOWN
(
in_val
);
}
else
{
#ifdef _WIN64
*
huianode
=
(
HUIANODE
)
V_I8
(
in_val
);
#else
*
huianode
=
(
HUIANODE
)
V_I4
(
in_val
);
#endif
}
return
S_OK
;
}
dlls/uiautomationcore/uiautomationcore.spec
View file @
1f86e2c6
...
...
@@ -70,7 +70,7 @@
@ stub UiaGetUpdatedCache
@ stub UiaHPatternObjectFromVariant
@ stub UiaHTextRangeFromVariant
@ st
ub UiaHUiaNodeFromVariant
@ st
dcall UiaHUiaNodeFromVariant(ptr ptr)
@ stub UiaHasServerSideProvider
@ stdcall UiaHostProviderFromHwnd(long ptr)
#@ stub UiaIAccessibleFromProvider
...
...
include/uiautomationcoreapi.h
View file @
1f86e2c6
...
...
@@ -396,6 +396,7 @@ HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIAN
HRESULT
WINAPI
UiaNodeFromProvider
(
IRawElementProviderSimple
*
elprov
,
HUIANODE
*
huianode
);
BOOL
WINAPI
UiaNodeRelease
(
HUIANODE
huianode
);
HRESULT
WINAPI
UiaGetRuntimeId
(
HUIANODE
huianode
,
SAFEARRAY
**
runtime_id
);
HRESULT
WINAPI
UiaHUiaNodeFromVariant
(
VARIANT
*
in_val
,
HUIANODE
*
huianode
);
#ifdef __cplusplus
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment