ReactOS 0.4.16-dev-2491-g3dc6630
uia_com_client.c
Go to the documentation of this file.
1/*
2 * Copyright 2022 Connor McAdams for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "uia_private.h"
20
21#include "wine/debug.h"
22
24
25static HRESULT get_uia_condition_struct_from_iface(IUIAutomationCondition *condition, struct UiaCondition **cond_struct);
26
27/*
28 * IUIAutomationOrCondition interface.
29 */
31 IUIAutomationOrCondition IUIAutomationOrCondition_iface;
33
34 IUIAutomationCondition **child_ifaces;
36
38};
39
40static inline struct uia_or_condition *impl_from_IUIAutomationOrCondition(IUIAutomationOrCondition *iface)
41{
43}
44
45static HRESULT WINAPI uia_or_condition_QueryInterface(IUIAutomationOrCondition *iface, REFIID riid, void **ppv)
46{
47 *ppv = NULL;
48 if (IsEqualIID(riid, &IID_IUIAutomationOrCondition) || IsEqualIID(riid, &IID_IUIAutomationCondition) ||
50 *ppv = iface;
51 else
52 return E_NOINTERFACE;
53
54 IUIAutomationOrCondition_AddRef(iface);
55 return S_OK;
56}
57
58static ULONG WINAPI uia_or_condition_AddRef(IUIAutomationOrCondition *iface)
59{
62
63 TRACE("%p, refcount %ld\n", uia_or_condition, ref);
64 return ref;
65}
66
67static ULONG WINAPI uia_or_condition_Release(IUIAutomationOrCondition *iface)
68{
71
72 TRACE("%p, refcount %ld\n", uia_or_condition, ref);
73
74 if (!ref)
75 {
77 {
78 int i;
79
80 for (i = 0; i < uia_or_condition->child_count; i++)
81 {
83 IUIAutomationCondition_Release(uia_or_condition->child_ifaces[i]);
84 }
85 }
86
88 free(uia_or_condition->condition.ppConditions);
90 }
91
92 return ref;
93}
94
95static HRESULT WINAPI uia_or_condition_get_ChildCount(IUIAutomationOrCondition *iface, int *child_count)
96{
98
99 TRACE("%p, %p\n", iface, child_count);
100
101 if (!child_count)
102 return E_POINTER;
103
105
106 return S_OK;
107}
108
109static HRESULT WINAPI uia_or_condition_GetChildrenAsNativeArray(IUIAutomationOrCondition *iface,
110 IUIAutomationCondition ***out_children, int *out_children_count)
111{
113 IUIAutomationCondition **children;
114 int i;
115
116 TRACE("%p, %p, %p\n", iface, out_children, out_children_count);
117
118 if (!out_children)
119 return E_POINTER;
120
121 *out_children = NULL;
122
123 if (!out_children_count)
124 return E_POINTER;
125
126 if (!(children = CoTaskMemAlloc(uia_or_condition->child_count * sizeof(*children))))
127 return E_OUTOFMEMORY;
128
129 for (i = 0; i < uia_or_condition->child_count; i++)
130 {
131 children[i] = uia_or_condition->child_ifaces[i];
132 IUIAutomationCondition_AddRef(uia_or_condition->child_ifaces[i]);
133 }
134
135 *out_children = children;
136 *out_children_count = uia_or_condition->child_count;
137
138 return S_OK;
139}
140
141static HRESULT WINAPI uia_or_condition_GetChildren(IUIAutomationOrCondition *iface, SAFEARRAY **out_children)
142{
143 FIXME("%p, %p: stub\n", iface, out_children);
144 return E_NOTIMPL;
145}
146
147static const IUIAutomationOrConditionVtbl uia_or_condition_vtbl = {
154};
155
156static HRESULT create_uia_or_condition_iface(IUIAutomationCondition **out_cond, IUIAutomationCondition **in_conds,
157 int in_cond_count)
158{
160 int i;
161
162 if (!out_cond)
163 return E_POINTER;
164
165 *out_cond = NULL;
166
168 if (!uia_or_condition)
169 return E_OUTOFMEMORY;
170
173
174 uia_or_condition->child_ifaces = calloc(in_cond_count, sizeof(*in_conds));
176 {
177 IUIAutomationOrCondition_Release(&uia_or_condition->IUIAutomationOrCondition_iface);
178 return E_OUTOFMEMORY;
179 }
180
181 uia_or_condition->condition.ppConditions = calloc(in_cond_count, sizeof(*uia_or_condition->condition.ppConditions));
182 if (!uia_or_condition->condition.ppConditions)
183 {
184 IUIAutomationOrCondition_Release(&uia_or_condition->IUIAutomationOrCondition_iface);
185 return E_OUTOFMEMORY;
186 }
187
189 uia_or_condition->child_count = uia_or_condition->condition.cConditions = in_cond_count;
190 for (i = 0; i < in_cond_count; i++)
191 {
192 HRESULT hr;
193
195 if (FAILED(hr))
196 {
197 IUIAutomationOrCondition_Release(&uia_or_condition->IUIAutomationOrCondition_iface);
198 return hr;
199 }
200
201 uia_or_condition->child_ifaces[i] = in_conds[i];
202 IUIAutomationCondition_AddRef(in_conds[i]);
203 }
204
205 *out_cond = (IUIAutomationCondition *)&uia_or_condition->IUIAutomationOrCondition_iface;
206 return S_OK;
207}
208
209/*
210 * IUIAutomationNotCondition interface.
211 */
213 IUIAutomationNotCondition IUIAutomationNotCondition_iface;
215
216 IUIAutomationCondition *child_iface;
218};
219
220static inline struct uia_not_condition *impl_from_IUIAutomationNotCondition(IUIAutomationNotCondition *iface)
221{
223}
224
225static HRESULT WINAPI uia_not_condition_QueryInterface(IUIAutomationNotCondition *iface, REFIID riid, void **ppv)
226{
227 *ppv = NULL;
228 if (IsEqualIID(riid, &IID_IUIAutomationNotCondition) || IsEqualIID(riid, &IID_IUIAutomationCondition) ||
230 *ppv = iface;
231 else
232 return E_NOINTERFACE;
233
234 IUIAutomationNotCondition_AddRef(iface);
235 return S_OK;
236}
237
238static ULONG WINAPI uia_not_condition_AddRef(IUIAutomationNotCondition *iface)
239{
242
243 TRACE("%p, refcount %ld\n", uia_not_condition, ref);
244 return ref;
245}
246
247static ULONG WINAPI uia_not_condition_Release(IUIAutomationNotCondition *iface)
248{
251
252 TRACE("%p, refcount %ld\n", uia_not_condition, ref);
253 if (!ref)
254 {
255 IUIAutomationCondition_Release(uia_not_condition->child_iface);
257 }
258
259 return ref;
260}
261
262static HRESULT WINAPI uia_not_condition_GetChild(IUIAutomationNotCondition *iface, IUIAutomationCondition **child)
263{
265
266 TRACE("%p, %p\n", iface, child);
267
268 if (!child)
269 return E_POINTER;
270
271 IUIAutomationCondition_AddRef(uia_not_condition->child_iface);
273
274 return S_OK;
275}
276
277static const IUIAutomationNotConditionVtbl uia_not_condition_vtbl = {
282};
283
284static HRESULT create_uia_not_condition_iface(IUIAutomationCondition **out_cond, IUIAutomationCondition *in_cond)
285{
287 struct UiaCondition *cond_struct;
288 HRESULT hr;
289
290 if (!out_cond)
291 return E_POINTER;
292
293 *out_cond = NULL;
294 hr = get_uia_condition_struct_from_iface(in_cond, &cond_struct);
295 if (FAILED(hr))
296 return hr;
297
300 return E_OUTOFMEMORY;
301
304 uia_not_condition->condition.pConditions = cond_struct;
307 IUIAutomationCondition_AddRef(in_cond);
308
309 *out_cond = (IUIAutomationCondition *)&uia_not_condition->IUIAutomationNotCondition_iface;
310 return S_OK;
311}
312
313/*
314 * IUIAutomationPropertyCondition interface.
315 */
317 IUIAutomationPropertyCondition IUIAutomationPropertyCondition_iface;
319
321};
322
323static inline struct uia_property_condition *impl_from_IUIAutomationPropertyCondition(IUIAutomationPropertyCondition *iface)
324{
326}
327
328static HRESULT WINAPI uia_property_condition_QueryInterface(IUIAutomationPropertyCondition *iface, REFIID riid, void **ppv)
329{
330 *ppv = NULL;
331 if (IsEqualIID(riid, &IID_IUIAutomationPropertyCondition) || IsEqualIID(riid, &IID_IUIAutomationCondition) ||
333 *ppv = iface;
334 else
335 return E_NOINTERFACE;
336
337 IUIAutomationPropertyCondition_AddRef(iface);
338 return S_OK;
339}
340
341static ULONG WINAPI uia_property_condition_AddRef(IUIAutomationPropertyCondition *iface)
342{
345
346 TRACE("%p, refcount %ld\n", uia_property_condition, ref);
347 return ref;
348}
349
350static ULONG WINAPI uia_property_condition_Release(IUIAutomationPropertyCondition *iface)
351{
354
355 TRACE("%p, refcount %ld\n", uia_property_condition, ref);
356
357 if (!ref)
358 {
361 }
362
363 return ref;
364}
365
366static HRESULT WINAPI uia_property_condition_get_PropertyId(IUIAutomationPropertyCondition *iface, PROPERTYID *prop_id)
367{
369
370 TRACE("%p, %p\n", iface, prop_id);
371
372 if (!prop_id)
373 return E_POINTER;
374
375 *prop_id = uia_property_condition->condition.PropertyId;
376
377 return S_OK;
378}
379
380static HRESULT WINAPI uia_property_condition_get_PropertyValue(IUIAutomationPropertyCondition *iface, VARIANT *val)
381{
383
384 TRACE("%p, %p\n", iface, val);
385
386 if (!val)
387 return E_POINTER;
388
390
391 return S_OK;
392}
393
394static HRESULT WINAPI uia_property_condition_get_PropertyConditionFlags(IUIAutomationPropertyCondition *iface,
396{
398
399 TRACE("%p, %p\n", iface, flags);
400
401 if (!flags)
402 return E_POINTER;
403
405
406 return S_OK;
407}
408
409static const IUIAutomationPropertyConditionVtbl uia_property_condition_vtbl = {
416};
417
418static HRESULT create_uia_property_condition_iface(IUIAutomationCondition **out_cond, PROPERTYID prop_id, VARIANT val,
419 enum PropertyConditionFlags prop_flags)
420{
421 const struct uia_prop_info *prop_info = uia_prop_info_from_id(prop_id);
423
424 if (!out_cond)
425 return E_POINTER;
426
427 *out_cond = NULL;
428 if (!prop_info)
429 return E_INVALIDARG;
430
431 switch (prop_info->type)
432 {
433 case UIAutomationType_Bool:
434 if (V_VT(&val) != VT_BOOL)
435 return E_INVALIDARG;
436 break;
437
438 case UIAutomationType_IntArray:
439 if (V_VT(&val) != (VT_I4 | VT_ARRAY))
440 return E_INVALIDARG;
441 break;
442
443 default:
444 FIXME("Property condition evaluation for property type %#x unimplemented\n", prop_info->type);
445 return E_NOTIMPL;
446 }
447
450 return E_OUTOFMEMORY;
451
454 uia_property_condition->condition.PropertyId = prop_id;
456 uia_property_condition->condition.Flags = prop_flags;
458
459 *out_cond = (IUIAutomationCondition *)&uia_property_condition->IUIAutomationPropertyCondition_iface;
460 return S_OK;
461}
462
463/*
464 * IUIAutomationBoolCondition interface.
465 */
467 IUIAutomationBoolCondition IUIAutomationBoolCondition_iface;
469
471};
472
473static inline struct uia_bool_condition *impl_from_IUIAutomationBoolCondition(IUIAutomationBoolCondition *iface)
474{
476}
477
478static HRESULT WINAPI uia_bool_condition_QueryInterface(IUIAutomationBoolCondition *iface, REFIID riid, void **ppv)
479{
480 *ppv = NULL;
481 if (IsEqualIID(riid, &IID_IUIAutomationBoolCondition) || IsEqualIID(riid, &IID_IUIAutomationCondition) ||
483 *ppv = iface;
484 else
485 return E_NOINTERFACE;
486
487 IUIAutomationBoolCondition_AddRef(iface);
488 return S_OK;
489}
490
491static ULONG WINAPI uia_bool_condition_AddRef(IUIAutomationBoolCondition *iface)
492{
495
496 TRACE("%p, refcount %ld\n", uia_bool_condition, ref);
497 return ref;
498}
499
500static ULONG WINAPI uia_bool_condition_Release(IUIAutomationBoolCondition *iface)
501{
504
505 TRACE("%p, refcount %ld\n", uia_bool_condition, ref);
506 if (!ref)
508
509 return ref;
510}
511
512static HRESULT WINAPI uia_bool_condition_get_BooleanValue(IUIAutomationBoolCondition *iface, BOOL *ret_val)
513{
515
516 TRACE("%p, %p\n", iface, ret_val);
517
518 if (!ret_val)
519 return E_POINTER;
520
521 if (uia_bool_condition->condition.ConditionType == ConditionType_True)
522 *ret_val = TRUE;
523 else
524 *ret_val = FALSE;
525
526 return S_OK;
527}
528
529static const IUIAutomationBoolConditionVtbl uia_bool_condition_vtbl = {
534};
535
536static HRESULT create_uia_bool_condition_iface(IUIAutomationCondition **out_cond, enum ConditionType cond_type)
537{
539
540 if (!out_cond)
541 return E_POINTER;
542
545 return E_OUTOFMEMORY;
546
548 uia_bool_condition->condition.ConditionType = cond_type;
550
551 *out_cond = (IUIAutomationCondition *)&uia_bool_condition->IUIAutomationBoolCondition_iface;
552 return S_OK;
553}
554
555static HRESULT get_uia_condition_struct_from_iface(IUIAutomationCondition *condition, struct UiaCondition **cond_struct)
556{
557 *cond_struct = NULL;
558 if (!condition)
559 return E_POINTER;
560
561 if (condition->lpVtbl == (IUIAutomationConditionVtbl *)&uia_bool_condition_vtbl)
562 {
563 struct uia_bool_condition *cond;
564
565 cond = impl_from_IUIAutomationBoolCondition((IUIAutomationBoolCondition *)condition);
566 *cond_struct = &cond->condition;
567 }
568 else if (condition->lpVtbl == (IUIAutomationConditionVtbl *)&uia_property_condition_vtbl)
569 {
570 struct uia_property_condition *cond;
571
572 cond = impl_from_IUIAutomationPropertyCondition((IUIAutomationPropertyCondition *)condition);
573 *cond_struct = (struct UiaCondition *)&cond->condition;
574 }
575 else if (condition->lpVtbl == (IUIAutomationConditionVtbl *)&uia_not_condition_vtbl)
576 {
577 struct uia_not_condition *cond;
578
579 cond = impl_from_IUIAutomationNotCondition((IUIAutomationNotCondition *)condition);
580 *cond_struct = (struct UiaCondition *)&cond->condition;
581 }
582 else if (condition->lpVtbl == (IUIAutomationConditionVtbl *)&uia_or_condition_vtbl)
583 {
584 struct uia_or_condition *cond;
585
586 cond = impl_from_IUIAutomationOrCondition((IUIAutomationOrCondition *)condition);
587 *cond_struct = (struct UiaCondition *)&cond->condition;
588 }
589 else
590 return E_FAIL;
591
592 return S_OK;
593}
594
595static HRESULT create_control_view_condition_iface(IUIAutomationCondition **out_condition)
596{
597 IUIAutomationCondition *prop_cond, *not_cond;
598 HRESULT hr;
599 VARIANT v;
600
601 if (!out_condition)
602 return E_POINTER;
603
604 *out_condition = NULL;
605
606 VariantInit(&v);
607 V_VT(&v) = VT_BOOL;
608 V_BOOL(&v) = VARIANT_FALSE;
609 hr = create_uia_property_condition_iface(&prop_cond, UIA_IsControlElementPropertyId, v, PropertyConditionFlags_None);
610 if (FAILED(hr))
611 return hr;
612
613 hr = create_uia_not_condition_iface(&not_cond, prop_cond);
614 if (FAILED(hr))
615 {
616 IUIAutomationCondition_Release(prop_cond);
617 return hr;
618 }
619
620 *out_condition = not_cond;
621
622 return S_OK;
623}
624
625/*
626 * IUIAutomationCacheRequest interface.
627 */
629 IUIAutomationCacheRequest IUIAutomationCacheRequest_iface;
631
632 IUIAutomationCondition *view_condition;
634
638};
639
640static inline struct uia_cache_request *impl_from_IUIAutomationCacheRequest(IUIAutomationCacheRequest *iface)
641{
643}
644
645static HRESULT WINAPI uia_cache_request_QueryInterface(IUIAutomationCacheRequest *iface, REFIID riid, void **ppv)
646{
647 *ppv = NULL;
648 if (IsEqualIID(riid, &IID_IUIAutomationCacheRequest) || IsEqualIID(riid, &IID_IUnknown))
649 *ppv = iface;
650 else
651 return E_NOINTERFACE;
652
653 IUIAutomationCacheRequest_AddRef(iface);
654 return S_OK;
655}
656
657static ULONG WINAPI uia_cache_request_AddRef(IUIAutomationCacheRequest *iface)
658{
661
662 TRACE("%p, refcount %ld\n", uia_cache_request, ref);
663 return ref;
664}
665
666static ULONG WINAPI uia_cache_request_Release(IUIAutomationCacheRequest *iface)
667{
670
671 TRACE("%p, refcount %ld\n", uia_cache_request, ref);
672
673 if (!ref)
674 {
675 IUIAutomationCondition_Release(uia_cache_request->view_condition);
678 }
679
680 return ref;
681}
682
683static HRESULT WINAPI uia_cache_request_AddProperty(IUIAutomationCacheRequest *iface, PROPERTYID prop_id)
684{
686 const struct uia_prop_info *prop_info = uia_prop_info_from_id(prop_id);
687 int i;
688
689 TRACE("%p, %d\n", iface, prop_id);
690
691 if (!prop_info)
692 return E_INVALIDARG;
693
694 /* Don't add a duplicate property to the cache request. */
695 for (i = 0; i < uia_cache_request->prop_ids_count; i++)
696 {
698 return S_OK;
699 }
700
703 return E_OUTOFMEMORY;
704
707
710
711 return S_OK;
712}
713
714static HRESULT WINAPI uia_cache_request_AddPattern(IUIAutomationCacheRequest *iface, PATTERNID pattern_id)
715{
716 FIXME("%p, %d: stub\n", iface, pattern_id);
717 return E_NOTIMPL;
718}
719
720static HRESULT WINAPI uia_cache_request_Clone(IUIAutomationCacheRequest *iface, IUIAutomationCacheRequest **out_req)
721{
722 FIXME("%p, %p: stub\n", iface, out_req);
723 return E_NOTIMPL;
724}
725
726static HRESULT WINAPI uia_cache_request_get_TreeScope(IUIAutomationCacheRequest *iface, enum TreeScope *scope)
727{
729
730 TRACE("%p, %p\n", iface, scope);
731
732 if (!scope)
733 return E_POINTER;
734
735 *scope = uia_cache_request->cache_req.Scope;
736
737 return S_OK;
738}
739
740static HRESULT WINAPI uia_cache_request_put_TreeScope(IUIAutomationCacheRequest *iface, enum TreeScope scope)
741{
743
744 TRACE("%p, %#x\n", iface, scope);
745
746 if (!scope || (scope & ~TreeScope_Subtree))
747 return E_INVALIDARG;
748
749 if ((scope & TreeScope_Children) || (scope & TreeScope_Descendants))
750 {
751 FIXME("Unimplemented TreeScope %#x\n", scope);
752 return E_NOTIMPL;
753 }
754
755 uia_cache_request->cache_req.Scope = scope;
756
757 return S_OK;
758}
759
760static HRESULT WINAPI uia_cache_request_get_TreeFilter(IUIAutomationCacheRequest *iface,
761 IUIAutomationCondition **filter)
762{
764
765 TRACE("%p, %p\n", iface, filter);
766
767 if (!filter)
768 return E_POINTER;
769
770 IUIAutomationCondition_AddRef(uia_cache_request->view_condition);
772
773 return S_OK;
774}
775
776static HRESULT WINAPI uia_cache_request_put_TreeFilter(IUIAutomationCacheRequest *iface, IUIAutomationCondition *filter)
777{
779 struct UiaCondition *cond_struct;
780 HRESULT hr;
781
782 TRACE("%p, %p\n", iface, filter);
783
784 if (!filter)
785 return E_POINTER;
786
788 if (FAILED(hr))
789 return hr;
790
791 uia_cache_request->cache_req.pViewCondition = cond_struct;
792 IUIAutomationCondition_Release(uia_cache_request->view_condition);
794 IUIAutomationCondition_AddRef(filter);
795
796 return S_OK;
797}
798
799static HRESULT WINAPI uia_cache_request_get_AutomationElementMode(IUIAutomationCacheRequest *iface,
801{
803
804 TRACE("%p, %p\n", iface, mode);
805
806 if (!mode)
807 return E_POINTER;
808
809 *mode = uia_cache_request->cache_req.automationElementMode;
810
811 return S_OK;
812}
813
814static HRESULT WINAPI uia_cache_request_put_AutomationElementMode(IUIAutomationCacheRequest *iface,
816{
818
819 TRACE("%p, %d\n", iface, mode);
820
822 return E_INVALIDARG;
823
825 {
826 FIXME("AutomationElementMode_None unsupported\n");
827 return E_NOTIMPL;
828 }
829
830 uia_cache_request->cache_req.automationElementMode = mode;
831
832 return S_OK;
833}
834
835static const IUIAutomationCacheRequestVtbl uia_cache_request_vtbl = {
848};
849
850static HRESULT create_uia_cache_request_iface(IUIAutomationCacheRequest **out_cache_req)
851{
853 IUIAutomationCondition *view_condition;
854 HRESULT hr;
855
856 if (!out_cache_req)
857 return E_POINTER;
858
859 *out_cache_req = NULL;
861 if (FAILED(hr))
862 return hr;
863
866 {
867 IUIAutomationCondition_Release(view_condition);
868 return E_OUTOFMEMORY;
869 }
870
873
878
880 return S_OK;
881}
882
883static HRESULT get_uia_cache_request_struct_from_iface(IUIAutomationCacheRequest *cache_request,
884 struct UiaCacheRequest **cache_req_struct)
885{
886 struct uia_cache_request *cache_req_data;
887
888 *cache_req_struct = NULL;
889 if (!cache_request)
890 return E_POINTER;
891
892 if (cache_request->lpVtbl != &uia_cache_request_vtbl)
893 return E_FAIL;
894
895 cache_req_data = impl_from_IUIAutomationCacheRequest(cache_request);
896 *cache_req_struct = &cache_req_data->cache_req;
897
898 return S_OK;
899}
900
901/*
902 * COM API UI Automation event related functions.
903 */
905{
908
911
914{
917 0, 0, { (DWORD_PTR)(__FILE__ ": com_event_handlers_cs") }
918};
920
922{
925
927};
928
929static int uia_com_event_handler_event_id_compare(const void *key, const struct rb_entry *entry)
930{
932 int event_id = *((int *)key);
933
934 return (event_entry->event_id > event_id) - (event_entry->event_id < event_id);
935}
936
941};
942
944{
946
950
952
955};
956
957static int uia_com_event_handler_id_compare(const void *key, const struct rb_entry *entry)
958{
961
962 if (event_id->event_id != map_entry->event_id)
963 return (event_id->event_id > map_entry->event_id) - (event_id->event_id < map_entry->event_id);
964 else if (event_id->handler_iface != map_entry->handler_iface)
965 return (event_id->handler_iface > map_entry->handler_iface) - (event_id->handler_iface < map_entry->handler_iface);
966 else if (event_id->runtime_id && map_entry->runtime_id)
967 return uia_compare_safearrays(event_id->runtime_id, map_entry->runtime_id, UIAutomationType_IntArray);
968 else
969 return (event_id->runtime_id > map_entry->runtime_id) - (event_id->runtime_id < map_entry->runtime_id);
970}
971
974 HUIAEVENT event;
976
980};
981
983{
984 struct uia_node *node = impl_from_IWineUiaNode((IWineUiaNode *)user_data);
985 VARIANT v, v2;
986 HRESULT hr;
987
988 /* Only match desktop events. */
989 if (!event->desktop_subtree_event)
990 return S_OK;
991
992 VariantInit(&v);
993 VariantInit(&v2);
994
996 if (FAILED(hr))
997 {
998 WARN("Failed to create new node lres with hr %#lx\n", hr);
999 return hr;
1000 }
1001
1002 if (V_VT(&v) == VT_I4)
1003 {
1004 hr = IWineUiaEvent_raise_event(&event->IWineUiaEvent_iface, v, v2);
1005 if (FAILED(hr))
1006 {
1007 WARN("raise_event failed with hr %#lx\n", hr);
1009 }
1010 }
1011 VariantClear(&v);
1012
1013 return hr;
1014}
1015
1017{
1018 HRESULT hr;
1019
1020 hr = uia_event_advise_node((struct uia_event *)event->event, node);
1021 if (FAILED(hr))
1022 {
1023 WARN("uia_event_advise_node failed with hr %#lx\n", hr);
1024 goto exit;
1025 }
1026
1027 hr = uia_hwnd_map_add_hwnd(&event->focus_hwnd_map, hwnd);
1028 if (FAILED(hr))
1029 WARN("Failed to add hwnd for focus winevent, hr %#lx\n", hr);
1030
1031exit:
1032 return SUCCEEDED(hr);
1033}
1034
1036{
1038 HRESULT hr;
1039 VARIANT v;
1040
1042 {
1043 struct uia_com_event *event;
1044
1046 {
1047 if (uia_hwnd_map_check_hwnd(&event->focus_hwnd_map, hwnd) ||
1049 continue;
1050
1052 if (V_VT(&v) == VT_I4)
1053 {
1054 HUIANODE focus_node = NULL;
1055
1057 if (SUCCEEDED(hr))
1058 {
1059 hr = uia_event_for_each(UIA_AutomationFocusChangedEventId, uia_com_focus_win_event_callback,
1060 (void *)focus_node, TRUE);
1061 if (FAILED(hr))
1062 WARN("uia_event_for_each on focus_node failed with hr %#lx\n", hr);
1063 }
1064 UiaNodeRelease(focus_node);
1065 }
1066 VariantClear(&v);
1067 }
1068 }
1069
1070 VariantInit(&v);
1071 hr = UiaGetPropertyValue(node, UIA_HasKeyboardFocusPropertyId, &v);
1072 if (SUCCEEDED(hr) && (V_VT(&v) == VT_BOOL && V_BOOL(&v) == VARIANT_TRUE))
1073 {
1074 hr = uia_event_for_each(UIA_AutomationFocusChangedEventId, uia_com_focus_win_event_callback, (void *)node, TRUE);
1075 if (FAILED(hr))
1076 WARN("uia_event_for_each failed with hr %#lx\n", hr);
1077 }
1078
1079 VariantClear(&v);
1080}
1081
1083{
1084 struct uia_event_args args = { { EventArgsType_Simple, UIA_AutomationFocusChangedEventId }, 0 };
1085 HUIANODE node = (HUIANODE)user_data;
1086
1087 /* Only match desktop events. */
1088 if (!event->desktop_subtree_event)
1089 return S_OK;
1090
1091 return uia_event_invoke(node, NULL, &args, event);
1092}
1093
1095{
1096 IRawElementProviderFragmentRoot *elroot;
1097 IRawElementProviderFragment *elfrag;
1098 IRawElementProviderSimple *elprov;
1099 HRESULT hr;
1100 VARIANT v;
1101
1102 hr = create_msaa_provider_from_hwnd(hwnd, child_id, &elprov);
1103 if (FAILED(hr))
1104 {
1105 WARN("create_msaa_provider_from_hwnd failed with hr %#lx\n", hr);
1106 return;
1107 }
1108
1109 hr = IRawElementProviderSimple_QueryInterface(elprov, &IID_IRawElementProviderFragmentRoot, (void **)&elroot);
1110 if (FAILED(hr))
1111 goto exit;
1112
1113 hr = IRawElementProviderFragmentRoot_GetFocus(elroot, &elfrag);
1114 IRawElementProviderFragmentRoot_Release(elroot);
1115 if (FAILED(hr))
1116 goto exit;
1117
1118 if (elfrag)
1119 {
1120 IRawElementProviderSimple *elprov2;
1121
1122 hr = IRawElementProviderFragment_QueryInterface(elfrag, &IID_IRawElementProviderSimple, (void **)&elprov2);
1123 IRawElementProviderFragment_Release(elfrag);
1124 if (FAILED(hr))
1125 goto exit;
1126
1127 IRawElementProviderSimple_Release(elprov);
1128 elprov = elprov2;
1129 }
1130
1131 VariantInit(&v);
1132 hr = IRawElementProviderSimple_GetPropertyValue(elprov, UIA_HasKeyboardFocusPropertyId, &v);
1133 if (FAILED(hr))
1134 goto exit;
1135
1136 if (V_VT(&v) == VT_BOOL && V_BOOL(&v) == VARIANT_TRUE)
1137 {
1138 HUIANODE node;
1139
1140 hr = create_uia_node_from_elprov(elprov, &node, TRUE, 0);
1141 if (SUCCEEDED(hr))
1142 {
1143 hr = uia_event_for_each(UIA_AutomationFocusChangedEventId, uia_com_focus_win_event_msaa_callback, (void *)node, TRUE);
1144 if (FAILED(hr))
1145 WARN("uia_event_for_each failed with hr %#lx\n", hr);
1147 }
1148 }
1149
1150exit:
1151 IRawElementProviderSimple_Release(elprov);
1152}
1153
1155{
1156 LONG handler_count;
1157
1158 TRACE("%ld, %p, %ld, %ld, %ld, %ld\n", event_id, hwnd, obj_id, child_id, thread_id, event_time);
1159
1161 handler_count = com_event_handlers.handler_count;
1163
1164 if (!handler_count)
1165 return S_OK;
1166
1167 switch (event_id)
1168 {
1169 case EVENT_OBJECT_SHOW:
1170 {
1172 SAFEARRAY *rt_id = NULL;
1173 HUIANODE node;
1174 HRESULT hr;
1175
1176 if (obj_id != OBJID_WINDOW || !uia_hwnd_is_visible(hwnd))
1177 break;
1178
1180 if (FAILED(hr))
1181 return hr;
1182
1183 hr = UiaGetRuntimeId(node, &rt_id);
1184 if (FAILED(hr))
1185 {
1187 return hr;
1188 }
1189
1191
1193 {
1194 struct uia_com_event *event;
1195
1196 /*
1197 * Focus change event handlers only listen for EVENT_OBJECT_SHOW
1198 * on the desktop HWND.
1199 */
1200 if ((entry->event_id == UIA_AutomationFocusChangedEventId) && (hwnd != GetDesktopWindow()))
1201 continue;
1202
1204 {
1206 if (FAILED(hr))
1207 WARN("uia_event_check_node_within_scope failed with hr %#lx\n", hr);
1208 else if (hr == S_OK)
1209 {
1210 hr = uia_event_advise_node((struct uia_event *)event->event, node);
1211 if (FAILED(hr))
1212 WARN("uia_event_advise_node failed with hr %#lx\n", hr);
1213 }
1214 }
1215 }
1216
1218
1220 break;
1221 }
1222
1223 case EVENT_OBJECT_FOCUS:
1224 {
1225 static const int uia_event_id = UIA_AutomationFocusChangedEventId;
1226 struct rb_entry *rb_entry;
1227 HRESULT hr;
1228
1229 if (obj_id != OBJID_CLIENT)
1230 break;
1231
1233
1234 if ((rb_entry = rb_get(&com_event_handlers.handler_event_id_map, &uia_event_id)))
1235 {
1236 struct uia_event_handler_event_id_map_entry *event_id_map;
1237 HUIANODE node = NULL;
1238
1241 if (SUCCEEDED(hr))
1243 else
1245
1247 }
1248
1250 break;
1251 }
1252
1253 case EVENT_OBJECT_DESTROY:
1254 {
1255 static const int uia_event_id = UIA_AutomationFocusChangedEventId;
1256 struct rb_entry *rb_entry;
1257
1258 if (obj_id != OBJID_WINDOW)
1259 break;
1260
1262
1263 if ((rb_entry = rb_get(&com_event_handlers.handler_event_id_map, &uia_event_id)))
1264 {
1265 struct uia_event_handler_event_id_map_entry *event_id_map;
1267
1271 {
1272 struct uia_com_event *event;
1273
1275 {
1276 uia_hwnd_map_remove_hwnd(&event->focus_hwnd_map, hwnd);
1277 }
1278 }
1279 }
1280
1282 break;
1283 }
1284
1285 default:
1286 break;
1287 }
1288
1289 return S_OK;
1290}
1291
1293{
1294 struct uia_event_handler_event_id_map_entry *event_id_map;
1295 struct rb_entry *rb_entry;
1296
1297 if ((rb_entry = rb_get(&com_event_handlers.handler_event_id_map, &event_map->event_id)))
1299 else
1300 {
1301 if (!(event_id_map = calloc(1, sizeof(*event_id_map))))
1302 return E_OUTOFMEMORY;
1303
1304 event_id_map->event_id = event_map->event_id;
1305 list_init(&event_id_map->handlers_list);
1306 rb_put(&com_event_handlers.handler_event_id_map, &event_map->event_id, &event_id_map->entry);
1307 }
1308
1309 list_add_tail(&event_id_map->handlers_list, &event_map->handler_event_id_map_list_entry);
1310 event_map->handler_event_id_map = event_id_map;
1311
1312 return S_OK;
1313}
1314
1315static HRESULT uia_event_handlers_add_handler(IUnknown *handler_iface, SAFEARRAY *runtime_id, int event_id,
1316 struct uia_com_event *event)
1317{
1319 struct uia_event_handler_map_entry *event_map;
1320 struct rb_entry *rb_entry;
1321 HRESULT hr = S_OK;
1322
1324
1325 if (!com_event_handlers.handler_count)
1326 {
1329 }
1330
1331 if ((rb_entry = rb_get(&com_event_handlers.handler_map, &event_ident)))
1333 else
1334 {
1335 if (!(event_map = calloc(1, sizeof(*event_map))))
1336 {
1337 hr = E_OUTOFMEMORY;
1338 goto exit;
1339 }
1340
1341 hr = SafeArrayCopy(runtime_id, &event_map->runtime_id);
1342 if (FAILED(hr))
1343 {
1344 free(event_map);
1345 goto exit;
1346 }
1347
1348 event_map->event_id = event_id;
1350 if (FAILED(hr))
1351 {
1352 SafeArrayDestroy(event_map->runtime_id);
1353 free(event_map);
1354 goto exit;
1355 }
1356
1357 event_map->handler_iface = handler_iface;
1358 IUnknown_AddRef(event_map->handler_iface);
1359
1360 list_init(&event_map->handlers_list);
1361 rb_put(&com_event_handlers.handler_map, &event_ident, &event_map->entry);
1362 }
1363
1364 list_add_tail(&event_map->handlers_list, &event->event_handler_map_list_entry);
1365 event->handler_map = event_map;
1366 com_event_handlers.handler_count++;
1367 if (event_id == UIA_AutomationFocusChangedEventId)
1368 {
1369 GUITHREADINFO info = { sizeof(info) };
1370
1371 if (GetGUIThreadInfo(0, &info) && info.hwndFocus)
1372 {
1373 HUIANODE node = NULL;
1374
1378 }
1379 }
1380
1381exit:
1383
1384 return hr;
1385}
1386
1388{
1389 list_remove(&event->event_handler_map_list_entry);
1390 uia_hwnd_map_destroy(&event->focus_hwnd_map);
1391 if (event->event)
1392 UiaRemoveEvent(event->event);
1393 if (event->git_cookie)
1395 free(event);
1396}
1397
1399{
1400 struct uia_com_event *event, *event2;
1401
1403 {
1405 com_event_handlers.handler_count--;
1406 }
1407
1408 list_remove(&entry->handler_event_id_map_list_entry);
1409 if (list_empty(&entry->handler_event_id_map->handlers_list))
1410 {
1411 rb_remove(&com_event_handlers.handler_event_id_map, &entry->handler_event_id_map->entry);
1412 free(entry->handler_event_id_map);
1413 }
1414
1415 rb_remove(&com_event_handlers.handler_map, &entry->entry);
1416 IUnknown_Release(entry->handler_iface);
1417 SafeArrayDestroy(entry->runtime_id);
1418 free(entry);
1419}
1420
1421static void uia_event_handlers_remove_handlers(IUnknown *handler_iface, SAFEARRAY *runtime_id, int event_id)
1422{
1424 struct rb_entry *rb_entry;
1425
1427
1428 if (com_event_handlers.handler_count && (rb_entry = rb_get(&com_event_handlers.handler_map, &event_ident)))
1430
1432}
1433
1434static HRESULT create_uia_element_from_cache_req(IUIAutomationElement **iface, BOOL from_cui8,
1435 struct UiaCacheRequest *cache_req, LONG start_idx, SAFEARRAY *req_data, BSTR tree_struct);
1437 SAFEARRAY *cache_req, BSTR tree_struct)
1438{
1439 struct uia_com_event *com_event = (struct uia_com_event *)event->u.clientside.callback_data;
1440 IUIAutomationElement *elem;
1441 BSTR tree_struct2;
1442 HRESULT hr;
1443
1444 /* Nothing matches the cache request view condition, do nothing. */
1445 if (!cache_req)
1446 return S_OK;
1447
1448 /* create_uia_element_from_cache_req frees the passed in BSTR. */
1449 tree_struct2 = SysAllocString(tree_struct);
1450 hr = create_uia_element_from_cache_req(&elem, com_event->from_cui8, &event->u.clientside.cache_req, 0, cache_req,
1451 tree_struct2);
1452 if (FAILED(hr))
1453 return hr;
1454
1455 switch (event->event_id)
1456 {
1457 case UIA_AutomationFocusChangedEventId:
1458 {
1459 IUIAutomationFocusChangedEventHandler *handler;
1460
1461 hr = get_interface_in_git(&IID_IUIAutomationFocusChangedEventHandler, com_event->git_cookie, (IUnknown **)&handler);
1462 if (SUCCEEDED(hr))
1463 {
1464 hr = IUIAutomationFocusChangedEventHandler_HandleFocusChangedEvent(handler, elem);
1465 IUIAutomationFocusChangedEventHandler_Release(handler);
1466 }
1467 break;
1468 }
1469
1470 default:
1471 {
1472 IUIAutomationEventHandler *handler;
1473
1474 hr = get_interface_in_git(&IID_IUIAutomationEventHandler, com_event->git_cookie, (IUnknown **)&handler);
1475 if (SUCCEEDED(hr))
1476 {
1477 hr = IUIAutomationEventHandler_HandleAutomationEvent(handler, elem, event->event_id);
1478 IUIAutomationEventHandler_Release(handler);
1479 }
1480 break;
1481 }
1482 }
1483 IUIAutomationElement_Release(elem);
1484
1485 return hr;
1486}
1487
1488/*
1489 * IUIAutomationElementArray interface.
1490 */
1492 IUIAutomationElementArray IUIAutomationElementArray_iface;
1494
1495 IUIAutomationElement **elements;
1497};
1498
1499static inline struct uia_element_array *impl_from_IUIAutomationElementArray(IUIAutomationElementArray *iface)
1500{
1502}
1503
1504static HRESULT WINAPI uia_element_array_QueryInterface(IUIAutomationElementArray *iface, REFIID riid, void **ppv)
1505{
1506 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IUIAutomationElementArray))
1507 *ppv = iface;
1508 else
1509 return E_NOINTERFACE;
1510
1511 IUIAutomationElementArray_AddRef(iface);
1512 return S_OK;
1513}
1514
1515static ULONG WINAPI uia_element_array_AddRef(IUIAutomationElementArray *iface)
1516{
1519
1520 TRACE("%p, refcount %ld\n", element, ref);
1521 return ref;
1522}
1523
1524static ULONG WINAPI uia_element_array_Release(IUIAutomationElementArray *iface)
1525{
1526 struct uia_element_array *element_arr = impl_from_IUIAutomationElementArray(iface);
1527 ULONG ref = InterlockedDecrement(&element_arr->ref);
1528
1529 TRACE("%p, refcount %ld\n", element_arr, ref);
1530 if (!ref)
1531 {
1532 if (element_arr->elements_count)
1533 {
1534 int i;
1535
1536 for (i = 0; i < element_arr->elements_count; i++)
1537 {
1538 if (element_arr->elements[i])
1539 IUIAutomationElement_Release(element_arr->elements[i]);
1540 }
1541 }
1542 free(element_arr->elements);
1543 free(element_arr);
1544 }
1545
1546 return ref;
1547}
1548
1549static HRESULT WINAPI uia_element_array_get_Length(IUIAutomationElementArray *iface, int *out_length)
1550{
1551 struct uia_element_array *element_arr = impl_from_IUIAutomationElementArray(iface);
1552
1553 TRACE("%p, %p\n", iface, out_length);
1554
1555 if (!out_length)
1556 return E_POINTER;
1557
1558 *out_length = element_arr->elements_count;
1559
1560 return S_OK;
1561}
1562
1563static HRESULT WINAPI uia_element_array_GetElement(IUIAutomationElementArray *iface, int idx,
1564 IUIAutomationElement **out_elem)
1565{
1566 struct uia_element_array *element_arr = impl_from_IUIAutomationElementArray(iface);
1567
1568 TRACE("%p, %p\n", iface, out_elem);
1569
1570 if (!out_elem)
1571 return E_POINTER;
1572
1573 if ((idx < 0) || (idx >= element_arr->elements_count))
1574 return E_INVALIDARG;
1575
1576 *out_elem = element_arr->elements[idx];
1577 IUIAutomationElement_AddRef(element_arr->elements[idx]);
1578
1579 return S_OK;
1580}
1581
1582static const IUIAutomationElementArrayVtbl uia_element_array_vtbl = {
1588};
1589
1590static HRESULT create_uia_element_array_iface(IUIAutomationElementArray **iface, int elements_count)
1591{
1592 struct uia_element_array *element_arr = calloc(1, sizeof(*element_arr));
1593
1594 *iface = NULL;
1595 if (!element_arr)
1596 return E_OUTOFMEMORY;
1597
1599 element_arr->ref = 1;
1600 element_arr->elements_count = elements_count;
1601 if (!(element_arr->elements = calloc(elements_count, sizeof(*element_arr->elements))))
1602 {
1603 free(element_arr);
1604 return E_OUTOFMEMORY;
1605 }
1606
1607 *iface = &element_arr->IUIAutomationElementArray_iface;
1608 return S_OK;
1609}
1610
1614};
1615
1616/*
1617 * IUIAutomationElement interface.
1618 */
1620 IUIAutomationElement9 IUIAutomationElement9_iface;
1622
1624 HUIANODE node;
1625
1628
1630};
1631
1632static inline struct uia_element *impl_from_IUIAutomationElement9(IUIAutomationElement9 *iface)
1633{
1635}
1636
1637static HRESULT WINAPI uia_element_QueryInterface(IUIAutomationElement9 *iface, REFIID riid, void **ppv)
1638{
1640
1641 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IUIAutomationElement) || (element->from_cui8 &&
1642 (IsEqualIID(riid, &IID_IUIAutomationElement2) || IsEqualIID(riid, &IID_IUIAutomationElement3) ||
1643 IsEqualIID(riid, &IID_IUIAutomationElement4) || IsEqualIID(riid, &IID_IUIAutomationElement5) ||
1644 IsEqualIID(riid, &IID_IUIAutomationElement6) || IsEqualIID(riid, &IID_IUIAutomationElement7) ||
1645 IsEqualIID(riid, &IID_IUIAutomationElement8) || IsEqualIID(riid, &IID_IUIAutomationElement9))))
1646 *ppv = iface;
1647 else if (IsEqualIID(riid, &IID_IMarshal))
1648 return IUnknown_QueryInterface(element->marshal, riid, ppv);
1649 else
1650 return E_NOINTERFACE;
1651
1652 IUIAutomationElement9_AddRef(iface);
1653 return S_OK;
1654}
1655
1656static ULONG WINAPI uia_element_AddRef(IUIAutomationElement9 *iface)
1657{
1660
1661 TRACE("%p, refcount %ld\n", element, ref);
1662 return ref;
1663}
1664
1665static ULONG WINAPI uia_element_Release(IUIAutomationElement9 *iface)
1666{
1669
1670 TRACE("%p, refcount %ld\n", element, ref);
1671 if (!ref)
1672 {
1673 if (element->cached_props_count)
1674 {
1675 int i;
1676
1677 for (i = 0; i < element->cached_props_count; i++)
1678 VariantClear(&element->cached_props[i].prop_val);
1679 }
1680
1681 IUnknown_Release(element->marshal);
1682 free(element->cached_props);
1683 UiaNodeRelease(element->node);
1684 free(element);
1685 }
1686
1687 return ref;
1688}
1689
1690static HRESULT WINAPI uia_element_SetFocus(IUIAutomationElement9 *iface)
1691{
1692 FIXME("%p: stub\n", iface);
1693 return E_NOTIMPL;
1694}
1695
1696static HRESULT WINAPI uia_element_GetRuntimeId(IUIAutomationElement9 *iface, SAFEARRAY **runtime_id)
1697{
1698 FIXME("%p: stub\n", iface);
1699 return E_NOTIMPL;
1700}
1701
1702static HRESULT WINAPI uia_element_FindFirst(IUIAutomationElement9 *iface, enum TreeScope scope,
1703 IUIAutomationCondition *condition, IUIAutomationElement **found)
1704{
1705 IUIAutomationCacheRequest *cache_req;
1706 HRESULT hr;
1707
1708 TRACE("%p, %#x, %p, %p\n", iface, scope, condition, found);
1709
1710 if (!found)
1711 return E_POINTER;
1712
1713 *found = NULL;
1714 hr = create_uia_cache_request_iface(&cache_req);
1715 if (FAILED(hr))
1716 return hr;
1717
1718 hr = IUIAutomationElement9_FindFirstBuildCache(iface, scope, condition, cache_req, found);
1719 IUIAutomationCacheRequest_Release(cache_req);
1720
1721 return hr;
1722}
1723
1724static HRESULT WINAPI uia_element_FindAll(IUIAutomationElement9 *iface, enum TreeScope scope,
1725 IUIAutomationCondition *condition, IUIAutomationElementArray **found)
1726{
1727 IUIAutomationCacheRequest *cache_req;
1728 HRESULT hr;
1729
1730 TRACE("%p, %#x, %p, %p\n", iface, scope, condition, found);
1731
1732 if (!found)
1733 return E_POINTER;
1734
1735 *found = NULL;
1736 hr = create_uia_cache_request_iface(&cache_req);
1737 if (FAILED(hr))
1738 return hr;
1739
1740 hr = IUIAutomationElement9_FindAllBuildCache(iface, scope, condition, cache_req, found);
1741 IUIAutomationCacheRequest_Release(cache_req);
1742
1743 return hr;
1744}
1745
1746static HRESULT set_find_params_struct(struct UiaFindParams *params, IUIAutomationCondition *cond, int scope,
1747 BOOL find_first)
1748{
1749 HRESULT hr;
1750
1751 hr = get_uia_condition_struct_from_iface(cond, &params->pFindCondition);
1752 if (FAILED(hr))
1753 return hr;
1754
1755 if (!scope || (scope & (~TreeScope_Subtree)))
1756 return E_INVALIDARG;
1757
1758 params->FindFirst = find_first;
1759 if (scope & TreeScope_Element)
1760 params->ExcludeRoot = FALSE;
1761 else
1762 params->ExcludeRoot = TRUE;
1763
1764 if (scope & TreeScope_Descendants)
1765 params->MaxDepth = -1;
1766 else if (scope & TreeScope_Children)
1767 params->MaxDepth = 1;
1768 else
1769 params->MaxDepth = 0;
1770
1771 return S_OK;
1772}
1773
1774static HRESULT WINAPI uia_element_FindFirstBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope,
1775 IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **found)
1776{
1778 LONG lbound_offsets, lbound_tree_structs, elems_count, offset_idx;
1779 struct UiaFindParams find_params = { 0 };
1780 struct UiaCacheRequest *cache_req_struct;
1781 SAFEARRAY *sa, *tree_structs, *offsets;
1782 IUIAutomationElement *elem;
1783 BSTR tree_struct_str;
1784 HRESULT hr;
1785
1786 TRACE("%p, %#x, %p, %p, %p\n", iface, scope, condition, cache_req, found);
1787
1788 if (!found)
1789 return E_POINTER;
1790
1791 *found = elem = NULL;
1792 hr = get_uia_cache_request_struct_from_iface(cache_req, &cache_req_struct);
1793 if (FAILED(hr))
1794 return hr;
1795
1796 hr = set_find_params_struct(&find_params, condition, scope, TRUE);
1797 if (FAILED(hr))
1798 return hr;
1799
1800 sa = offsets = tree_structs = NULL;
1801 hr = UiaFind(element->node, &find_params, cache_req_struct, &sa, &offsets, &tree_structs);
1802 if (FAILED(hr) || !sa)
1803 goto exit;
1804
1805 hr = get_safearray_bounds(tree_structs, &lbound_tree_structs, &elems_count);
1806 if (FAILED(hr))
1807 goto exit;
1808
1809 hr = SafeArrayGetElement(tree_structs, &lbound_tree_structs, &tree_struct_str);
1810 if (FAILED(hr))
1811 goto exit;
1812
1813 hr = get_safearray_bounds(offsets, &lbound_offsets, &elems_count);
1814 if (FAILED(hr))
1815 goto exit;
1816
1817 hr = SafeArrayGetElement(offsets, &lbound_offsets, &offset_idx);
1818 if (FAILED(hr))
1819 goto exit;
1820
1821 hr = create_uia_element_from_cache_req(&elem, element->from_cui8, cache_req_struct, offset_idx, sa, tree_struct_str);
1822 if (SUCCEEDED(hr))
1823 *found = elem;
1824
1825exit:
1826 SafeArrayDestroy(tree_structs);
1829
1830 return hr;
1831}
1832
1833static HRESULT WINAPI uia_element_FindAllBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope,
1834 IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req, IUIAutomationElementArray **found)
1835{
1837 LONG lbound_offsets, lbound_tree_structs, elems_count;
1838 struct uia_element_array *element_array_data;
1839 struct UiaFindParams find_params = { 0 };
1840 struct UiaCacheRequest *cache_req_struct;
1841 SAFEARRAY *sa, *tree_structs, *offsets;
1842 IUIAutomationElementArray *array;
1843 HRESULT hr;
1844 int i;
1845
1846 TRACE("%p, %#x, %p, %p, %p\n", iface, scope, condition, cache_req, found);
1847
1848 if (!found)
1849 return E_POINTER;
1850
1851 *found = array = NULL;
1852 hr = get_uia_cache_request_struct_from_iface(cache_req, &cache_req_struct);
1853 if (FAILED(hr))
1854 return hr;
1855
1856 hr = set_find_params_struct(&find_params, condition, scope, FALSE);
1857 if (FAILED(hr))
1858 return hr;
1859
1860 sa = offsets = tree_structs = NULL;
1861 hr = UiaFind(element->node, &find_params, cache_req_struct, &sa, &offsets, &tree_structs);
1862 if (FAILED(hr) || !sa)
1863 goto exit;
1864
1865 hr = get_safearray_bounds(tree_structs, &lbound_tree_structs, &elems_count);
1866 if (FAILED(hr))
1867 goto exit;
1868
1869 hr = get_safearray_bounds(offsets, &lbound_offsets, &elems_count);
1870 if (FAILED(hr))
1871 goto exit;
1872
1873 hr = create_uia_element_array_iface(&array, elems_count);
1874 if (FAILED(hr))
1875 goto exit;
1876
1877 element_array_data = impl_from_IUIAutomationElementArray(array);
1878 for (i = 0; i < elems_count; i++)
1879 {
1880 BSTR tree_struct_str;
1881 LONG offset_idx, idx;
1882
1883 idx = lbound_offsets + i;
1884 hr = SafeArrayGetElement(offsets, &idx, &offset_idx);
1885 if (FAILED(hr))
1886 goto exit;
1887
1888 idx = lbound_tree_structs + i;
1889 hr = SafeArrayGetElement(tree_structs, &idx, &tree_struct_str);
1890 if (FAILED(hr))
1891 goto exit;
1892
1893 hr = create_uia_element_from_cache_req(&element_array_data->elements[i], element->from_cui8,
1894 cache_req_struct, offset_idx, sa, tree_struct_str);
1895 if (FAILED(hr))
1896 goto exit;
1897 }
1898
1899 *found = array;
1900
1901exit:
1902 if (FAILED(hr) && array)
1903 IUIAutomationElementArray_Release(array);
1904
1905 SafeArrayDestroy(tree_structs);
1908
1909 return hr;
1910}
1911
1912static HRESULT WINAPI uia_element_BuildUpdatedCache(IUIAutomationElement9 *iface, IUIAutomationCacheRequest *cache_req,
1913 IUIAutomationElement **updated_elem)
1914{
1916 struct UiaCacheRequest *cache_req_struct;
1917 IUIAutomationElement *cache_elem;
1918 BSTR tree_struct;
1919 SAFEARRAY *sa;
1920 HRESULT hr;
1921
1922 TRACE("%p, %p, %p\n", iface, cache_req, updated_elem);
1923
1924 if (!updated_elem)
1925 return E_POINTER;
1926
1927 *updated_elem = NULL;
1928 hr = get_uia_cache_request_struct_from_iface(cache_req, &cache_req_struct);
1929 if (FAILED(hr))
1930 return hr;
1931
1932 hr = UiaGetUpdatedCache(element->node, cache_req_struct, NormalizeState_None, NULL, &sa, &tree_struct);
1933 if (FAILED(hr))
1934 return hr;
1935
1936 hr = create_uia_element_from_cache_req(&cache_elem, element->from_cui8, cache_req_struct, 0, sa, tree_struct);
1937 if (SUCCEEDED(hr))
1938 *updated_elem = cache_elem;
1939
1941 return S_OK;
1942}
1943
1944static HRESULT WINAPI uia_element_GetCurrentPropertyValue(IUIAutomationElement9 *iface, PROPERTYID prop_id,
1945 VARIANT *ret_val)
1946{
1947 FIXME("%p: stub\n", iface);
1948 return E_NOTIMPL;
1949}
1950
1951static HRESULT create_uia_element(IUIAutomationElement **iface, BOOL from_cui8, HUIANODE node);
1953{
1954 HUIANODE node;
1955 HRESULT hr;
1956
1957 /* ReservedNotSupported interface, just return it. */
1958 if (V_VT(var) == VT_UNKNOWN)
1959 return S_OK;
1960
1961 if (prop_type & UIAutomationType_Array)
1962 {
1963 struct uia_element_array *elem_arr_data;
1964 IUIAutomationElementArray *elem_arr;
1965 LONG idx, lbound, elems, i;
1966
1967 hr = get_safearray_bounds(V_ARRAY(var), &lbound, &elems);
1968 if (FAILED(hr))
1969 {
1971 return hr;
1972 }
1973
1974 hr = create_uia_element_array_iface(&elem_arr, elems);
1975 if (FAILED(hr))
1976 {
1978 return hr;
1979 }
1980
1981 elem_arr_data = impl_from_IUIAutomationElementArray(elem_arr);
1982 for (i = 0; i < elems; i++)
1983 {
1984 idx = lbound + i;
1986 if (FAILED(hr))
1987 break;
1988
1989 hr = create_uia_element(&elem_arr_data->elements[i], from_cui8, node);
1990 if (FAILED(hr))
1991 {
1993 break;
1994 }
1995 }
1996
1998 if (SUCCEEDED(hr))
1999 {
2000 V_VT(var) = VT_UNKNOWN;
2001 V_UNKNOWN(var) = (IUnknown *)elem_arr;
2002 }
2003 else
2004 IUIAutomationElementArray_Release(elem_arr);
2005 }
2006 else
2007 {
2008 IUIAutomationElement *out_elem;
2009
2012 if (FAILED(hr))
2013 return hr;
2014
2015 hr = create_uia_element(&out_elem, from_cui8, node);
2016 if (SUCCEEDED(hr))
2017 {
2018 V_VT(var) = VT_UNKNOWN;
2019 V_UNKNOWN(var) = (IUnknown *)out_elem;
2020 }
2021 else
2023 }
2024
2025 return hr;
2026}
2027
2028static HRESULT WINAPI uia_element_GetCurrentPropertyValueEx(IUIAutomationElement9 *iface, PROPERTYID prop_id,
2029 BOOL ignore_default, VARIANT *ret_val)
2030{
2031 const struct uia_prop_info *prop_info = uia_prop_info_from_id(prop_id);
2033 HRESULT hr;
2034
2035 TRACE("%p, %d, %d, %p\n", iface, prop_id, ignore_default, ret_val);
2036
2037 if (!ret_val)
2038 return E_POINTER;
2039
2040 VariantInit(ret_val);
2041 if (!prop_info)
2042 return E_INVALIDARG;
2043
2044 if (!ignore_default)
2045 FIXME("Default values currently unimplemented\n");
2046
2047 hr = UiaGetPropertyValue(element->node, prop_id, ret_val);
2048 if (FAILED(hr))
2049 return hr;
2050
2051 if ((prop_info->type == UIAutomationType_Element) || (prop_info->type == UIAutomationType_ElementArray))
2052 hr = get_element_variant_from_node_variant(ret_val, element->from_cui8, prop_info->type);
2053
2054 return hr;
2055}
2056
2057static HRESULT WINAPI uia_element_GetCachedPropertyValue(IUIAutomationElement9 *iface, PROPERTYID prop_id,
2058 VARIANT *ret_val)
2059{
2060 FIXME("%p: stub\n", iface);
2061 return E_NOTIMPL;
2062}
2063
2064static int __cdecl uia_cached_property_id_compare(const void *a, const void *b)
2065{
2066 const PROPERTYID *prop_id = a;
2067 const struct uia_cache_property *cache_prop = b;
2068
2069 return ((*prop_id) > cache_prop->prop_id) - ((*prop_id) < cache_prop->prop_id);
2070}
2071
2073 BOOL ignore_default, VARIANT *ret_val)
2074{
2076 struct uia_cache_property *cache_prop = NULL;
2077
2078 TRACE("%p, %d, %d, %p\n", iface, prop_id, ignore_default, ret_val);
2079
2080 if (!ret_val)
2081 return E_POINTER;
2082
2083 VariantInit(ret_val);
2084 if (!uia_prop_info_from_id(prop_id) || !element->cached_props)
2085 return E_INVALIDARG;
2086
2087 if (!ignore_default)
2088 FIXME("Default values currently unimplemented\n");
2089
2090 if (!(cache_prop = bsearch(&prop_id, element->cached_props, element->cached_props_count, sizeof(*cache_prop),
2092 return E_INVALIDARG;
2093
2094 VariantCopy(ret_val, &cache_prop->prop_val);
2095 return S_OK;
2096}
2097
2098static HRESULT WINAPI uia_element_GetCurrentPatternAs(IUIAutomationElement9 *iface, PATTERNID pattern_id,
2099 REFIID riid, void **out_pattern)
2100{
2101 FIXME("%p: stub\n", iface);
2102 return E_NOTIMPL;
2103}
2104
2105static HRESULT WINAPI uia_element_GetCachedPatternAs(IUIAutomationElement9 *iface, PATTERNID pattern_id,
2106 REFIID riid, void **out_pattern)
2107{
2108 FIXME("%p: stub\n", iface);
2109 return E_NOTIMPL;
2110}
2111
2112static HRESULT WINAPI uia_element_GetCurrentPattern(IUIAutomationElement9 *iface, PATTERNID pattern_id,
2113 IUnknown **out_pattern)
2114{
2115 FIXME("%p: stub\n", iface);
2116 return E_NOTIMPL;
2117}
2118
2119static HRESULT WINAPI uia_element_GetCachedPattern(IUIAutomationElement9 *iface, PATTERNID pattern_id,
2120 IUnknown **patternObject)
2121{
2122 FIXME("%p: stub\n", iface);
2123 return E_NOTIMPL;
2124}
2125
2126static HRESULT WINAPI uia_element_GetCachedParent(IUIAutomationElement9 *iface, IUIAutomationElement **parent)
2127{
2128 FIXME("%p: stub\n", iface);
2129 return E_NOTIMPL;
2130}
2131
2132static HRESULT WINAPI uia_element_GetCachedChildren(IUIAutomationElement9 *iface,
2133 IUIAutomationElementArray **children)
2134{
2135 FIXME("%p: stub\n", iface);
2136 return E_NOTIMPL;
2137}
2138
2139static HRESULT WINAPI uia_element_get_CurrentProcessId(IUIAutomationElement9 *iface, int *ret_val)
2140{
2141 FIXME("%p: stub\n", iface);
2142 return E_NOTIMPL;
2143}
2144
2146{
2147 const struct uia_control_type_info *info = NULL;
2148
2149 *ret_val = UIA_CustomControlTypeId;
2150 if (V_VT(v) != VT_I4)
2151 return;
2152
2154 *ret_val = info->control_type_id;
2155 else
2156 WARN("Provider returned invalid control type ID %ld\n", V_I4(v));
2157}
2158
2159static HRESULT WINAPI uia_element_get_CurrentControlType(IUIAutomationElement9 *iface, CONTROLTYPEID *ret_val)
2160{
2162 HRESULT hr;
2163 VARIANT v;
2164
2165 TRACE("%p, %p\n", iface, ret_val);
2166
2167 VariantInit(&v);
2168 hr = UiaGetPropertyValue(element->node, UIA_ControlTypePropertyId, &v);
2169 uia_elem_get_control_type(&v, ret_val);
2170 VariantClear(&v);
2171
2172 return hr;
2173}
2174
2175static HRESULT WINAPI uia_element_get_CurrentLocalizedControlType(IUIAutomationElement9 *iface, BSTR *ret_val)
2176{
2177 FIXME("%p: stub\n", iface);
2178 return E_NOTIMPL;
2179}
2180
2181static HRESULT WINAPI uia_element_get_CurrentName(IUIAutomationElement9 *iface, BSTR *ret_val)
2182{
2184 HRESULT hr;
2185 VARIANT v;
2186
2187 TRACE("%p, %p\n", iface, ret_val);
2188
2189 VariantInit(&v);
2190 hr = UiaGetPropertyValue(element->node, UIA_NamePropertyId, &v);
2191 if (SUCCEEDED(hr) && V_VT(&v) == VT_BSTR && V_BSTR(&v))
2192 *ret_val = SysAllocString(V_BSTR(&v));
2193 else
2194 *ret_val = SysAllocString(L"");
2195
2196 VariantClear(&v);
2197 return hr;
2198}
2199
2200static HRESULT WINAPI uia_element_get_CurrentAcceleratorKey(IUIAutomationElement9 *iface, BSTR *ret_val)
2201{
2202 FIXME("%p: stub\n", iface);
2203 return E_NOTIMPL;
2204}
2205
2206static HRESULT WINAPI uia_element_get_CurrentAccessKey(IUIAutomationElement9 *iface, BSTR *ret_val)
2207{
2208 FIXME("%p: stub\n", iface);
2209 return E_NOTIMPL;
2210}
2211
2212static HRESULT WINAPI uia_element_get_CurrentHasKeyboardFocus(IUIAutomationElement9 *iface, BOOL *ret_val)
2213{
2214 FIXME("%p: stub\n", iface);
2215 return E_NOTIMPL;
2216}
2217
2218static HRESULT WINAPI uia_element_get_CurrentIsKeyboardFocusable(IUIAutomationElement9 *iface, BOOL *ret_val)
2219{
2220 FIXME("%p: stub\n", iface);
2221 return E_NOTIMPL;
2222}
2223
2224static HRESULT WINAPI uia_element_get_CurrentIsEnabled(IUIAutomationElement9 *iface, BOOL *ret_val)
2225{
2226 FIXME("%p: stub\n", iface);
2227 return E_NOTIMPL;
2228}
2229
2230static HRESULT WINAPI uia_element_get_CurrentAutomationId(IUIAutomationElement9 *iface, BSTR *ret_val)
2231{
2232 FIXME("%p: stub\n", iface);
2233 return E_NOTIMPL;
2234}
2235
2236static HRESULT WINAPI uia_element_get_CurrentClassName(IUIAutomationElement9 *iface, BSTR *ret_val)
2237{
2238 FIXME("%p: stub\n", iface);
2239 return E_NOTIMPL;
2240}
2241
2242static HRESULT WINAPI uia_element_get_CurrentHelpText(IUIAutomationElement9 *iface, BSTR *ret_val)
2243{
2244 FIXME("%p: stub\n", iface);
2245 return E_NOTIMPL;
2246}
2247
2248static HRESULT WINAPI uia_element_get_CurrentCulture(IUIAutomationElement9 *iface, int *ret_val)
2249{
2250 FIXME("%p: stub\n", iface);
2251 return E_NOTIMPL;
2252}
2253
2254static HRESULT WINAPI uia_element_get_CurrentIsControlElement(IUIAutomationElement9 *iface, BOOL *ret_val)
2255{
2256 FIXME("%p: stub\n", iface);
2257 return E_NOTIMPL;
2258}
2259
2260static HRESULT WINAPI uia_element_get_CurrentIsContentElement(IUIAutomationElement9 *iface, BOOL *ret_val)
2261{
2262 FIXME("%p: stub\n", iface);
2263 return E_NOTIMPL;
2264}
2265
2266static HRESULT WINAPI uia_element_get_CurrentIsPassword(IUIAutomationElement9 *iface, BOOL *ret_val)
2267{
2268 FIXME("%p: stub\n", iface);
2269 return E_NOTIMPL;
2270}
2271
2272static HRESULT WINAPI uia_element_get_CurrentNativeWindowHandle(IUIAutomationElement9 *iface, UIA_HWND *ret_val)
2273{
2274 FIXME("%p: stub\n", iface);
2275 return E_NOTIMPL;
2276}
2277
2278static HRESULT WINAPI uia_element_get_CurrentItemType(IUIAutomationElement9 *iface, BSTR *ret_val)
2279{
2280 FIXME("%p: stub\n", iface);
2281 return E_NOTIMPL;
2282}
2283
2284static HRESULT WINAPI uia_element_get_CurrentIsOffscreen(IUIAutomationElement9 *iface, BOOL *ret_val)
2285{
2286 FIXME("%p: stub\n", iface);
2287 return E_NOTIMPL;
2288}
2289
2290static HRESULT WINAPI uia_element_get_CurrentOrientation(IUIAutomationElement9 *iface, enum OrientationType *ret_val)
2291{
2292 FIXME("%p: stub\n", iface);
2293 return E_NOTIMPL;
2294}
2295
2296static HRESULT WINAPI uia_element_get_CurrentFrameworkId(IUIAutomationElement9 *iface, BSTR *ret_val)
2297{
2298 FIXME("%p: stub\n", iface);
2299 return E_NOTIMPL;
2300}
2301
2302static HRESULT WINAPI uia_element_get_CurrentIsRequiredForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
2303{
2304 FIXME("%p: stub\n", iface);
2305 return E_NOTIMPL;
2306}
2307
2308static HRESULT WINAPI uia_element_get_CurrentItemStatus(IUIAutomationElement9 *iface, BSTR *ret_val)
2309{
2310 FIXME("%p: stub\n", iface);
2311 return E_NOTIMPL;
2312}
2313
2315{
2316 double *vals;
2317 HRESULT hr;
2318
2319 memset(ret_val, 0, sizeof(*ret_val));
2320 if (V_VT(v) != (VT_R8 | VT_ARRAY))
2321 return;
2322
2323 hr = SafeArrayAccessData(V_ARRAY(v), (void **)&vals);
2324 if (FAILED(hr))
2325 {
2326 WARN("SafeArrayAccessData failed with hr %#lx\n", hr);
2327 return;
2328 }
2329
2330 ret_val->left = vals[0];
2331 ret_val->top = vals[1];
2332 ret_val->right = ret_val->left + vals[2];
2333 ret_val->bottom = ret_val->top + vals[3];
2334
2336 if (FAILED(hr))
2337 WARN("SafeArrayUnaccessData failed with hr %#lx\n", hr);
2338}
2339
2340static HRESULT WINAPI uia_element_get_CurrentBoundingRectangle(IUIAutomationElement9 *iface, RECT *ret_val)
2341{
2343 HRESULT hr;
2344 VARIANT v;
2345
2346 TRACE("%p, %p\n", element, ret_val);
2347
2348 VariantInit(&v);
2349 hr = UiaGetPropertyValue(element->node, UIA_BoundingRectanglePropertyId, &v);
2350 uia_variant_rect_to_rect(&v, ret_val);
2351
2352 VariantClear(&v);
2353 return hr;
2354}
2355
2356static HRESULT WINAPI uia_element_get_CurrentLabeledBy(IUIAutomationElement9 *iface, IUIAutomationElement **ret_val)
2357{
2358 FIXME("%p: stub\n", iface);
2359 return E_NOTIMPL;
2360}
2361
2362static HRESULT WINAPI uia_element_get_CurrentAriaRole(IUIAutomationElement9 *iface, BSTR *ret_val)
2363{
2364 FIXME("%p: stub\n", iface);
2365 return E_NOTIMPL;
2366}
2367
2368static HRESULT WINAPI uia_element_get_CurrentAriaProperties(IUIAutomationElement9 *iface, BSTR *ret_val)
2369{
2370 FIXME("%p: stub\n", iface);
2371 return E_NOTIMPL;
2372}
2373
2374static HRESULT WINAPI uia_element_get_CurrentIsDataValidForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
2375{
2376 FIXME("%p: stub\n", iface);
2377 return E_NOTIMPL;
2378}
2379
2380static HRESULT WINAPI uia_element_get_CurrentControllerFor(IUIAutomationElement9 *iface,
2381 IUIAutomationElementArray **ret_val)
2382{
2383 FIXME("%p: stub\n", iface);
2384 return E_NOTIMPL;
2385}
2386
2387static HRESULT WINAPI uia_element_get_CurrentDescribedBy(IUIAutomationElement9 *iface,
2388 IUIAutomationElementArray **ret_val)
2389{
2390 FIXME("%p: stub\n", iface);
2391 return E_NOTIMPL;
2392}
2393
2394static HRESULT WINAPI uia_element_get_CurrentFlowsTo(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
2395{
2396 FIXME("%p: stub\n", iface);
2397 return E_NOTIMPL;
2398}
2399
2400static HRESULT WINAPI uia_element_get_CurrentProviderDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
2401{
2402 FIXME("%p: stub\n", iface);
2403 return E_NOTIMPL;
2404}
2405
2406static HRESULT WINAPI uia_element_get_CachedProcessId(IUIAutomationElement9 *iface, int *ret_val)
2407{
2408 FIXME("%p: stub\n", iface);
2409 return E_NOTIMPL;
2410}
2411
2412static HRESULT WINAPI uia_element_get_CachedControlType(IUIAutomationElement9 *iface, CONTROLTYPEID *ret_val)
2413{
2415 const int prop_id = UIA_ControlTypePropertyId;
2416 struct uia_cache_property *cache_prop = NULL;
2417
2418 TRACE("%p, %p\n", iface, ret_val);
2419
2420 if (!ret_val)
2421 return E_POINTER;
2422
2423 if (!(cache_prop = bsearch(&prop_id, element->cached_props, element->cached_props_count, sizeof(*cache_prop),
2425 return E_INVALIDARG;
2426
2427 uia_elem_get_control_type(&cache_prop->prop_val, ret_val);
2428 return S_OK;
2429}
2430
2431static HRESULT WINAPI uia_element_get_CachedLocalizedControlType(IUIAutomationElement9 *iface, BSTR *ret_val)
2432{
2433 FIXME("%p: stub\n", iface);
2434 return E_NOTIMPL;
2435}
2436
2437static HRESULT WINAPI uia_element_get_CachedName(IUIAutomationElement9 *iface, BSTR *ret_val)
2438{
2440 struct uia_cache_property *cache_prop = NULL;
2441 const int prop_id = UIA_NamePropertyId;
2442
2443 TRACE("%p, %p\n", iface, ret_val);
2444
2445 if (!ret_val)
2446 return E_POINTER;
2447
2448 if (!(cache_prop = bsearch(&prop_id, element->cached_props, element->cached_props_count, sizeof(*cache_prop),
2450 return E_INVALIDARG;
2451
2452 if ((V_VT(&cache_prop->prop_val) == VT_BSTR) && V_BSTR(&cache_prop->prop_val))
2453 *ret_val = SysAllocString(V_BSTR(&cache_prop->prop_val));
2454 else
2455 *ret_val = SysAllocString(L"");
2456
2457 return S_OK;
2458}
2459
2460static HRESULT WINAPI uia_element_get_CachedAcceleratorKey(IUIAutomationElement9 *iface, BSTR *ret_val)
2461{
2462 FIXME("%p: stub\n", iface);
2463 return E_NOTIMPL;
2464}
2465
2466static HRESULT WINAPI uia_element_get_CachedAccessKey(IUIAutomationElement9 *iface, BSTR *ret_val)
2467{
2468 FIXME("%p: stub\n", iface);
2469 return E_NOTIMPL;
2470}
2471
2472static HRESULT WINAPI uia_element_get_CachedHasKeyboardFocus(IUIAutomationElement9 *iface, BOOL *ret_val)
2473{
2475 const int prop_id = UIA_HasKeyboardFocusPropertyId;
2476 struct uia_cache_property *cache_prop = NULL;
2477
2478 TRACE("%p, %p\n", iface, ret_val);
2479
2480 if (!ret_val)
2481 return E_POINTER;
2482
2483 if (!(cache_prop = bsearch(&prop_id, element->cached_props, element->cached_props_count, sizeof(*cache_prop),
2485 return E_INVALIDARG;
2486
2487 *ret_val = ((V_VT(&cache_prop->prop_val) == VT_BOOL) && (V_BOOL(&cache_prop->prop_val) == VARIANT_TRUE));
2488 return S_OK;
2489}
2490
2491static HRESULT WINAPI uia_element_get_CachedIsKeyboardFocusable(IUIAutomationElement9 *iface, BOOL *ret_val)
2492{
2494 const int prop_id = UIA_IsKeyboardFocusablePropertyId;
2495 struct uia_cache_property *cache_prop = NULL;
2496
2497 TRACE("%p, %p\n", iface, ret_val);
2498
2499 if (!ret_val)
2500 return E_POINTER;
2501
2502 if (!(cache_prop = bsearch(&prop_id, element->cached_props, element->cached_props_count, sizeof(*cache_prop),
2504 return E_INVALIDARG;
2505
2506 *ret_val = ((V_VT(&cache_prop->prop_val) == VT_BOOL) && (V_BOOL(&cache_prop->prop_val) == VARIANT_TRUE));
2507 return S_OK;
2508}
2509
2510static HRESULT WINAPI uia_element_get_CachedIsEnabled(IUIAutomationElement9 *iface, BOOL *ret_val)
2511{
2512 FIXME("%p: stub\n", iface);
2513 return E_NOTIMPL;
2514}
2515
2516static HRESULT WINAPI uia_element_get_CachedAutomationId(IUIAutomationElement9 *iface, BSTR *ret_val)
2517{
2518 FIXME("%p: stub\n", iface);
2519 return E_NOTIMPL;
2520}
2521
2522static HRESULT WINAPI uia_element_get_CachedClassName(IUIAutomationElement9 *iface, BSTR *ret_val)
2523{
2524 FIXME("%p: stub\n", iface);
2525 return E_NOTIMPL;
2526}
2527
2528static HRESULT WINAPI uia_element_get_CachedHelpText(IUIAutomationElement9 *iface, BSTR *ret_val)
2529{
2530 FIXME("%p: stub\n", iface);
2531 return E_NOTIMPL;
2532}
2533
2534static HRESULT WINAPI uia_element_get_CachedCulture(IUIAutomationElement9 *iface, int *ret_val)
2535{
2536 FIXME("%p: stub\n", iface);
2537 return E_NOTIMPL;
2538}
2539
2540static HRESULT WINAPI uia_element_get_CachedIsControlElement(IUIAutomationElement9 *iface, BOOL *ret_val)
2541{
2542 FIXME("%p: stub\n", iface);
2543 return E_NOTIMPL;
2544}
2545
2546static HRESULT WINAPI uia_element_get_CachedIsContentElement(IUIAutomationElement9 *iface, BOOL *ret_val)
2547{
2548 FIXME("%p: stub\n", iface);
2549 return E_NOTIMPL;
2550}
2551
2552static HRESULT WINAPI uia_element_get_CachedIsPassword(IUIAutomationElement9 *iface, BOOL *ret_val)
2553{
2554 FIXME("%p: stub\n", iface);
2555 return E_NOTIMPL;
2556}
2557
2558static HRESULT WINAPI uia_element_get_CachedNativeWindowHandle(IUIAutomationElement9 *iface, UIA_HWND *ret_val)
2559{
2560 FIXME("%p: stub\n", iface);
2561 return E_NOTIMPL;
2562}
2563
2564static HRESULT WINAPI uia_element_get_CachedItemType(IUIAutomationElement9 *iface, BSTR *ret_val)
2565{
2566 FIXME("%p: stub\n", iface);
2567 return E_NOTIMPL;
2568}
2569
2570static HRESULT WINAPI uia_element_get_CachedIsOffscreen(IUIAutomationElement9 *iface, BOOL *ret_val)
2571{
2572 FIXME("%p: stub\n", iface);
2573 return E_NOTIMPL;
2574}
2575
2576static HRESULT WINAPI uia_element_get_CachedOrientation(IUIAutomationElement9 *iface,
2577 enum OrientationType *ret_val)
2578{
2579 FIXME("%p: stub\n", iface);
2580 return E_NOTIMPL;
2581}
2582
2583static HRESULT WINAPI uia_element_get_CachedFrameworkId(IUIAutomationElement9 *iface, BSTR *ret_val)
2584{
2585 FIXME("%p: stub\n", iface);
2586 return E_NOTIMPL;
2587}
2588
2589static HRESULT WINAPI uia_element_get_CachedIsRequiredForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
2590{
2591 FIXME("%p: stub\n", iface);
2592 return E_NOTIMPL;
2593}
2594
2595static HRESULT WINAPI uia_element_get_CachedItemStatus(IUIAutomationElement9 *iface, BSTR *ret_val)
2596{
2597 FIXME("%p: stub\n", iface);
2598 return E_NOTIMPL;
2599}
2600
2601static HRESULT WINAPI uia_element_get_CachedBoundingRectangle(IUIAutomationElement9 *iface, RECT *ret_val)
2602{
2604 const int prop_id = UIA_BoundingRectanglePropertyId;
2605 struct uia_cache_property *cache_prop = NULL;
2606
2607 TRACE("%p, %p\n", iface, ret_val);
2608
2609 if (!ret_val)
2610 return E_POINTER;
2611
2612 if (!(cache_prop = bsearch(&prop_id, element->cached_props, element->cached_props_count, sizeof(*cache_prop),
2614 return E_INVALIDARG;
2615
2616 uia_variant_rect_to_rect(&cache_prop->prop_val, ret_val);
2617 return S_OK;
2618}
2619
2620static HRESULT WINAPI uia_element_get_CachedLabeledBy(IUIAutomationElement9 *iface, IUIAutomationElement **ret_val)
2621{
2622 FIXME("%p: stub\n", iface);
2623 return E_NOTIMPL;
2624}
2625
2626static HRESULT WINAPI uia_element_get_CachedAriaRole(IUIAutomationElement9 *iface, BSTR *ret_val)
2627{
2628 FIXME("%p: stub\n", iface);
2629 return E_NOTIMPL;
2630}
2631
2632static HRESULT WINAPI uia_element_get_CachedAriaProperties(IUIAutomationElement9 *iface, BSTR *ret_val)
2633{
2634 FIXME("%p: stub\n", iface);
2635 return E_NOTIMPL;
2636}
2637
2638static HRESULT WINAPI uia_element_get_CachedIsDataValidForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
2639{
2640 FIXME("%p: stub\n", iface);
2641 return E_NOTIMPL;
2642}
2643
2644static HRESULT WINAPI uia_element_get_CachedControllerFor(IUIAutomationElement9 *iface,
2645 IUIAutomationElementArray **ret_val)
2646{
2647 FIXME("%p: stub\n", iface);
2648 return E_NOTIMPL;
2649}
2650
2651static HRESULT WINAPI uia_element_get_CachedDescribedBy(IUIAutomationElement9 *iface,
2652 IUIAutomationElementArray **ret_val)
2653{
2654 FIXME("%p: stub\n", iface);
2655 return E_NOTIMPL;
2656}
2657
2658static HRESULT WINAPI uia_element_get_CachedFlowsTo(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
2659{
2660 FIXME("%p: stub\n", iface);
2661 return E_NOTIMPL;
2662}
2663
2664static HRESULT WINAPI uia_element_get_CachedProviderDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
2665{
2666 FIXME("%p: stub\n", iface);
2667 return E_NOTIMPL;
2668}
2669
2670static HRESULT WINAPI uia_element_GetClickablePoint(IUIAutomationElement9 *iface, POINT *clickable, BOOL *got_clickable)
2671{
2672 FIXME("%p: stub\n", iface);
2673 return E_NOTIMPL;
2674}
2675
2676static HRESULT WINAPI uia_element_get_CurrentOptimizeForVisualContent(IUIAutomationElement9 *iface, BOOL *ret_val)
2677{
2678 FIXME("%p: stub\n", iface);
2679 return E_NOTIMPL;
2680}
2681
2682static HRESULT WINAPI uia_element_get_CachedOptimizeForVisualContent(IUIAutomationElement9 *iface, BOOL *ret_val)
2683{
2684 FIXME("%p: stub\n", iface);
2685 return E_NOTIMPL;
2686}
2687
2688static HRESULT WINAPI uia_element_get_CurrentLiveSetting(IUIAutomationElement9 *iface, enum LiveSetting *ret_val)
2689{
2690 FIXME("%p: stub\n", iface);
2691 return E_NOTIMPL;
2692}
2693
2694static HRESULT WINAPI uia_element_get_CachedLiveSetting(IUIAutomationElement9 *iface, enum LiveSetting *ret_val)
2695{
2696 FIXME("%p: stub\n", iface);
2697 return E_NOTIMPL;
2698}
2699
2700static HRESULT WINAPI uia_element_get_CurrentFlowsFrom(IUIAutomationElement9 *iface,
2701 IUIAutomationElementArray **ret_val)
2702{
2703 FIXME("%p: stub\n", iface);
2704 return E_NOTIMPL;
2705}
2706
2707static HRESULT WINAPI uia_element_get_CachedFlowsFrom(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
2708{
2709 FIXME("%p: stub\n", iface);
2710 return E_NOTIMPL;
2711}
2712
2713static HRESULT WINAPI uia_element_ShowContextMenu(IUIAutomationElement9 *iface)
2714{
2715 FIXME("%p: stub\n", iface);
2716 return E_NOTIMPL;
2717}
2718
2719static HRESULT WINAPI uia_element_get_CurrentIsPeripheral(IUIAutomationElement9 *iface, BOOL *ret_val)
2720{
2721 FIXME("%p: stub\n", iface);
2722 return E_NOTIMPL;
2723}
2724
2725static HRESULT WINAPI uia_element_get_CachedIsPeripheral(IUIAutomationElement9 *iface, BOOL *ret_val)
2726{
2727 FIXME("%p: stub\n", iface);
2728 return E_NOTIMPL;
2729}
2730
2731static HRESULT WINAPI uia_element_get_CurrentPositionInSet(IUIAutomationElement9 *iface, int *ret_val)
2732{
2733 FIXME("%p: stub\n", iface);
2734 return E_NOTIMPL;
2735}
2736
2737static HRESULT WINAPI uia_element_get_CurrentSizeOfSet(IUIAutomationElement9 *iface, int *ret_val)
2738{
2739 FIXME("%p: stub\n", iface);
2740 return E_NOTIMPL;
2741}
2742
2743static HRESULT WINAPI uia_element_get_CurrentLevel(IUIAutomationElement9 *iface, int *ret_val)
2744{
2745 FIXME("%p: stub\n", iface);
2746 return E_NOTIMPL;
2747}
2748
2749static HRESULT WINAPI uia_element_get_CurrentAnnotationTypes(IUIAutomationElement9 *iface, SAFEARRAY **ret_val)
2750{
2751 FIXME("%p: stub\n", iface);
2752 return E_NOTIMPL;
2753}
2754
2755static HRESULT WINAPI uia_element_get_CurrentAnnotationObjects(IUIAutomationElement9 *iface,
2756 IUIAutomationElementArray **ret_val)
2757{
2758 FIXME("%p: stub\n", iface);
2759 return E_NOTIMPL;
2760}
2761
2762static HRESULT WINAPI uia_element_get_CachedPositionInSet(IUIAutomationElement9 *iface, int *ret_val)
2763{
2764 FIXME("%p: stub\n", iface);
2765 return E_NOTIMPL;
2766}
2767
2768static HRESULT WINAPI uia_element_get_CachedSizeOfSet(IUIAutomationElement9 *iface, int *ret_val)
2769{
2770 FIXME("%p: stub\n", iface);
2771 return E_NOTIMPL;
2772}
2773
2774static HRESULT WINAPI uia_element_get_CachedLevel(IUIAutomationElement9 *iface, int *ret_val)
2775{
2776 FIXME("%p: stub\n", iface);
2777 return E_NOTIMPL;
2778}
2779
2780static HRESULT WINAPI uia_element_get_CachedAnnotationTypes(IUIAutomationElement9 *iface, SAFEARRAY **ret_val)
2781{
2782 FIXME("%p: stub\n", iface);
2783 return E_NOTIMPL;
2784}
2785
2786static HRESULT WINAPI uia_element_get_CachedAnnotationObjects(IUIAutomationElement9 *iface,
2787 IUIAutomationElementArray **ret_val)
2788{
2789 FIXME("%p: stub\n", iface);
2790 return E_NOTIMPL;
2791}
2792
2793static HRESULT WINAPI uia_element_get_CurrentLandmarkType(IUIAutomationElement9 *iface, LANDMARKTYPEID *ret_val)
2794{
2795 FIXME("%p: stub\n", iface);
2796 return E_NOTIMPL;
2797}
2798
2799static HRESULT WINAPI uia_element_get_CurrentLocalizedLandmarkType(IUIAutomationElement9 *iface, BSTR *ret_val)
2800{
2801 FIXME("%p: stub\n", iface);
2802 return E_NOTIMPL;
2803}
2804
2805static HRESULT WINAPI uia_element_get_CachedLandmarkType(IUIAutomationElement9 *iface, LANDMARKTYPEID *ret_val)
2806{
2807 FIXME("%p: stub\n", iface);
2808 return E_NOTIMPL;
2809}
2810
2811static HRESULT WINAPI uia_element_get_CachedLocalizedLandmarkType(IUIAutomationElement9 *iface, BSTR *ret_val)
2812{
2813 FIXME("%p: stub\n", iface);
2814 return E_NOTIMPL;
2815}
2816
2817static HRESULT WINAPI uia_element_get_CurrentFullDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
2818{
2819 FIXME("%p: stub\n", iface);
2820 return E_NOTIMPL;
2821}
2822
2823static HRESULT WINAPI uia_element_get_CachedFullDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
2824{
2825 FIXME("%p: stub\n", iface);
2826 return E_NOTIMPL;
2827}
2828
2829static HRESULT WINAPI uia_element_FindFirstWithOptions(IUIAutomationElement9 *iface, enum TreeScope scope,
2830 IUIAutomationCondition *condition, enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root,
2831 IUIAutomationElement **found)
2832{
2833 FIXME("%p: stub\n", iface);
2834 return E_NOTIMPL;
2835}
2836
2837static HRESULT WINAPI uia_element_FindAllWithOptions(IUIAutomationElement9 *iface, enum TreeScope scope,
2838 IUIAutomationCondition *condition, enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root,
2839 IUIAutomationElementArray **found)
2840{
2841 FIXME("%p: stub\n", iface);
2842 return E_NOTIMPL;
2843}
2844
2845static HRESULT WINAPI uia_element_FindFirstWithOptionsBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope,
2846 IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req,
2847 enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root, IUIAutomationElement **found)
2848{
2849 FIXME("%p: stub\n", iface);
2850 return E_NOTIMPL;
2851}
2852
2853static HRESULT WINAPI uia_element_FindAllWithOptionsBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope,
2854 IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req,
2855 enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root, IUIAutomationElementArray **found)
2856{
2857 FIXME("%p: stub\n", iface);
2858 return E_NOTIMPL;
2859}
2860
2861static HRESULT WINAPI uia_element_GetCurrentMetadataValue(IUIAutomationElement9 *iface, int target_id,
2862 METADATAID metadata_id, VARIANT *ret_val)
2863{
2864 FIXME("%p: stub\n", iface);
2865 return E_NOTIMPL;
2866}
2867
2868static HRESULT WINAPI uia_element_get_CurrentHeadingLevel(IUIAutomationElement9 *iface, HEADINGLEVELID *ret_val)
2869{
2870 FIXME("%p: stub\n", iface);
2871 return E_NOTIMPL;
2872}
2873
2874static HRESULT WINAPI uia_element_get_CachedHeadingLevel(IUIAutomationElement9 *iface, HEADINGLEVELID *ret_val)
2875{
2876 FIXME("%p: stub\n", iface);
2877 return E_NOTIMPL;
2878}
2879
2880static HRESULT WINAPI uia_element_get_CurrentIsDialog(IUIAutomationElement9 *iface, BOOL *ret_val)
2881{
2882 FIXME("%p: stub\n", iface);
2883 return E_NOTIMPL;
2884}
2885
2886static HRESULT WINAPI uia_element_get_CachedIsDialog(IUIAutomationElement9 *iface, BOOL *ret_val)
2887{
2888 FIXME("%p: stub\n", iface);
2889 return E_NOTIMPL;
2890}
2891
2892static const IUIAutomationElement9Vtbl uia_element_vtbl = {
3012};
3013
3014static HRESULT create_uia_element(IUIAutomationElement **iface, BOOL from_cui8, HUIANODE node)
3015{
3016 struct uia_element *element = calloc(1, sizeof(*element));
3017 HRESULT hr;
3018
3019 *iface = NULL;
3020 if (!element)
3021 return E_OUTOFMEMORY;
3022
3023 element->IUIAutomationElement9_iface.lpVtbl = &uia_element_vtbl;
3024 element->ref = 1;
3025 element->from_cui8 = from_cui8;
3026 element->node = node;
3027
3028 hr = CoCreateFreeThreadedMarshaler((IUnknown *)&element->IUIAutomationElement9_iface, &element->marshal);
3029 if (FAILED(hr))
3030 {
3031 free(element);
3032 return hr;
3033 }
3034
3035 *iface = (IUIAutomationElement *)&element->IUIAutomationElement9_iface;
3036 return S_OK;
3037}
3038
3039static int __cdecl uia_compare_cache_props(const void *a, const void *b)
3040{
3041 struct uia_cache_property *prop1 = (struct uia_cache_property *)a;
3042 struct uia_cache_property *prop2 = (struct uia_cache_property *)b;
3043
3044 return (prop1->prop_id > prop2->prop_id) - (prop1->prop_id < prop2->prop_id);
3045}
3046
3047static HRESULT create_uia_element_from_cache_req(IUIAutomationElement **iface, BOOL from_cui8,
3048 struct UiaCacheRequest *cache_req, LONG start_idx, SAFEARRAY *req_data, BSTR tree_struct)
3049{
3050 IUIAutomationElement *element = NULL;
3051 struct uia_element *elem_data;
3052 HUIANODE node;
3053 LONG idx[2];
3054 HRESULT hr;
3055 VARIANT v;
3056
3057 *iface = NULL;
3058
3059 VariantInit(&v);
3060 idx[0] = start_idx;
3061 idx[1] = 0;
3062 hr = SafeArrayGetElement(req_data, idx, &v);
3063 if (FAILED(hr))
3064 goto exit;
3065
3067 if (FAILED(hr))
3068 goto exit;
3069 VariantClear(&v);
3070
3072 if (FAILED(hr))
3073 goto exit;
3074
3075 elem_data = impl_from_IUIAutomationElement9((IUIAutomationElement9 *)element);
3076 if (cache_req->cProperties)
3077 {
3078 LONG i;
3079
3080 elem_data->cached_props = calloc(cache_req->cProperties, sizeof(*elem_data->cached_props));
3081 if (!elem_data->cached_props)
3082 {
3083 hr = E_OUTOFMEMORY;
3084 goto exit;
3085 }
3086
3087 elem_data->cached_props_count = cache_req->cProperties;
3088 for (i = 0; i < cache_req->cProperties; i++)
3089 {
3090 const struct uia_prop_info *prop_info = uia_prop_info_from_id(cache_req->pProperties[i]);
3091
3092 elem_data->cached_props[i].prop_id = prop_info->prop_id;
3093
3094 idx[0] = start_idx;
3095 idx[1] = 1 + i;
3096 hr = SafeArrayGetElement(req_data, idx, &elem_data->cached_props[i].prop_val);
3097 if (FAILED(hr))
3098 goto exit;
3099
3100 if ((prop_info->type == UIAutomationType_Element) || (prop_info->type == UIAutomationType_ElementArray))
3101 {
3102 hr = get_element_variant_from_node_variant(&elem_data->cached_props[i].prop_val, from_cui8,
3103 prop_info->type);
3104 if (FAILED(hr))
3105 goto exit;
3106 }
3107 }
3108
3109 /*
3110 * Sort the array of cached properties by property ID so that we can
3111 * access the values with bsearch.
3112 */
3113 qsort(elem_data->cached_props, elem_data->cached_props_count, sizeof(*elem_data->cached_props),
3115 }
3116
3117 *iface = element;
3118
3119exit:
3120 if (FAILED(hr))
3121 {
3122 WARN("Failed to create element from cache request, hr %#lx\n", hr);
3123 if (element)
3124 IUIAutomationElement_Release(element);
3125 }
3126
3127 SysFreeString(tree_struct);
3128 return hr;
3129}
3130
3131/*
3132 * IUIAutomationTreeWalker interface.
3133 */
3135 IUIAutomationTreeWalker IUIAutomationTreeWalker_iface;
3137
3138 IUIAutomationCacheRequest *default_cache_req;
3139 IUIAutomationCondition *nav_cond;
3141};
3142
3143static inline struct uia_tree_walker *impl_from_IUIAutomationTreeWalker(IUIAutomationTreeWalker *iface)
3144{
3146}
3147
3148static HRESULT WINAPI uia_tree_walker_QueryInterface(IUIAutomationTreeWalker *iface, REFIID riid, void **ppv)
3149{
3150 if (IsEqualIID(riid, &IID_IUIAutomationTreeWalker) || IsEqualIID(riid, &IID_IUnknown))
3151 *ppv = iface;
3152 else
3153 return E_NOINTERFACE;
3154
3155 IUIAutomationTreeWalker_AddRef(iface);
3156 return S_OK;
3157}
3158
3159static ULONG WINAPI uia_tree_walker_AddRef(IUIAutomationTreeWalker *iface)
3160{
3161 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3162 ULONG ref = InterlockedIncrement(&tree_walker->ref);
3163
3164 TRACE("%p, refcount %ld\n", tree_walker, ref);
3165 return ref;
3166}
3167
3168static ULONG WINAPI uia_tree_walker_Release(IUIAutomationTreeWalker *iface)
3169{
3170 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3171 ULONG ref = InterlockedDecrement(&tree_walker->ref);
3172
3173 TRACE("%p, refcount %ld\n", tree_walker, ref);
3174 if (!ref)
3175 {
3176 if (tree_walker->default_cache_req)
3177 IUIAutomationCacheRequest_Release(tree_walker->default_cache_req);
3178 IUIAutomationCondition_Release(tree_walker->nav_cond);
3179 free(tree_walker);
3180 }
3181
3182 return ref;
3183}
3184
3185static HRESULT WINAPI uia_tree_walker_GetParentElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem,
3186 IUIAutomationElement **parent)
3187{
3188 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3189
3190 TRACE("%p, %p, %p\n", iface, elem, parent);
3191
3192 return IUIAutomationTreeWalker_GetParentElementBuildCache(iface, elem, tree_walker->default_cache_req, parent);
3193}
3194
3195static HRESULT WINAPI uia_tree_walker_GetFirstChildElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem,
3196 IUIAutomationElement **first)
3197{
3198 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3199
3200 TRACE("%p, %p, %p\n", iface, elem, first);
3201
3202 return IUIAutomationTreeWalker_GetFirstChildElementBuildCache(iface, elem, tree_walker->default_cache_req, first);
3203}
3204
3205static HRESULT WINAPI uia_tree_walker_GetLastChildElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem,
3206 IUIAutomationElement **last)
3207{
3208 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3209
3210 TRACE("%p, %p, %p\n", iface, elem, last);
3211
3212 return IUIAutomationTreeWalker_GetLastChildElementBuildCache(iface, elem, tree_walker->default_cache_req, last);
3213}
3214
3215static HRESULT WINAPI uia_tree_walker_GetNextSiblingElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem,
3216 IUIAutomationElement **next)
3217{
3218 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3219
3220 TRACE("%p, %p, %p\n", iface, elem, next);
3221
3222 return IUIAutomationTreeWalker_GetNextSiblingElementBuildCache(iface, elem, tree_walker->default_cache_req, next);
3223}
3224
3225static HRESULT WINAPI uia_tree_walker_GetPreviousSiblingElement(IUIAutomationTreeWalker *iface,
3226 IUIAutomationElement *elem, IUIAutomationElement **prev)
3227{
3228 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3229
3230 TRACE("%p, %p, %p\n", iface, elem, prev);
3231
3232 return IUIAutomationTreeWalker_GetPreviousSiblingElementBuildCache(iface, elem, tree_walker->default_cache_req, prev);
3233}
3234
3235static HRESULT WINAPI uia_tree_walker_NormalizeElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem,
3236 IUIAutomationElement **normalized)
3237{
3238 FIXME("%p, %p, %p: stub\n", iface, elem, normalized);
3239 return E_NOTIMPL;
3240}
3241
3242static HRESULT uia_tree_walker_navigate(IUIAutomationTreeWalker *walker, IUIAutomationCacheRequest *cache_req,
3243 IUIAutomationElement *start_elem, int nav_dir, IUIAutomationElement **out_elem)
3244{
3245 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(walker);
3246 struct UiaCacheRequest *cache_req_struct;
3247 struct uia_element *element;
3248 BSTR tree_struct = NULL;
3249 SAFEARRAY *sa = NULL;
3250 HRESULT hr;
3251
3252 if (!out_elem)
3253 return E_POINTER;
3254
3255 *out_elem = NULL;
3256 if (!start_elem)
3257 return E_POINTER;
3258
3259 hr = get_uia_cache_request_struct_from_iface(cache_req, &cache_req_struct);
3260 if (FAILED(hr))
3261 return hr;
3262
3263 element = impl_from_IUIAutomationElement9((IUIAutomationElement9 *)start_elem);
3264 hr = UiaNavigate(element->node, nav_dir, tree_walker->cond_struct, cache_req_struct, &sa, &tree_struct);
3265 if (SUCCEEDED(hr) && sa)
3266 {
3267 hr = create_uia_element_from_cache_req(out_elem, element->from_cui8, cache_req_struct, 0, sa, tree_struct);
3268 tree_struct = NULL;
3269 }
3270
3271 SysFreeString(tree_struct);
3273 return hr;
3274}
3275
3276static HRESULT WINAPI uia_tree_walker_GetParentElementBuildCache(IUIAutomationTreeWalker *iface,
3277 IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **parent)
3278{
3279 TRACE("%p, %p, %p, %p\n", iface, elem, cache_req, parent);
3280
3282}
3283
3285 IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **first)
3286{
3287 TRACE("%p, %p, %p, %p\n", iface, elem, cache_req, first);
3288
3290}
3291
3293 IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **last)
3294{
3295 TRACE("%p, %p, %p, %p\n", iface, elem, cache_req, last);
3296
3298}
3299
3301 IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **next)
3302{
3303 TRACE("%p, %p, %p, %p\n", iface, elem, cache_req, next);
3304
3306}
3307
3309 IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **prev)
3310{
3311 TRACE("%p, %p, %p, %p\n", iface, elem, cache_req, prev);
3312
3313 return uia_tree_walker_navigate(iface, cache_req, elem, NavigateDirection_PreviousSibling, prev);
3314}
3315
3316static HRESULT WINAPI uia_tree_walker_NormalizeElementBuildCache(IUIAutomationTreeWalker *iface,
3317 IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **normalized)
3318{
3319 FIXME("%p, %p, %p, %p: stub\n", iface, elem, cache_req, normalized);
3320 return E_NOTIMPL;
3321}
3322
3323static HRESULT WINAPI uia_tree_walker_get_Condition(IUIAutomationTreeWalker *iface,
3324 IUIAutomationCondition **condition)
3325{
3326 struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
3327
3328 TRACE("%p, %p\n", iface, condition);
3329
3330 if (!condition)
3331 return E_POINTER;
3332
3333 IUIAutomationCondition_AddRef(tree_walker->nav_cond);
3334 *condition = tree_walker->nav_cond;
3335
3336 return S_OK;
3337}
3338
3339static const IUIAutomationTreeWalkerVtbl uia_tree_walker_vtbl = {
3356};
3357
3358static HRESULT create_uia_tree_walker(IUIAutomationTreeWalker **out_tree_walker, IUIAutomationCondition *nav_cond)
3359{
3360 struct uia_tree_walker *tree_walker;
3361 struct UiaCondition *cond_struct;
3362 HRESULT hr;
3363
3364 if (!out_tree_walker)
3365 return E_POINTER;
3366
3367 *out_tree_walker = NULL;
3368 hr = get_uia_condition_struct_from_iface(nav_cond, &cond_struct);
3369 if (FAILED(hr))
3370 return hr;
3371
3372 tree_walker = calloc(1, sizeof(*tree_walker));
3373 if (!tree_walker)
3374 return E_OUTOFMEMORY;
3375
3377 tree_walker->ref = 1;
3378 tree_walker->nav_cond = nav_cond;
3379 IUIAutomationCondition_AddRef(nav_cond);
3380 tree_walker->cond_struct = cond_struct;
3381
3383 if (FAILED(hr))
3384 {
3385 IUIAutomationTreeWalker_Release(&tree_walker->IUIAutomationTreeWalker_iface);
3386 return hr;
3387 }
3388
3389 *out_tree_walker = &tree_walker->IUIAutomationTreeWalker_iface;
3390 return S_OK;
3391}
3392
3393/*
3394 * IUIAutomation interface.
3395 */
3397 IUIAutomation6 IUIAutomation6_iface;
3399
3401};
3402
3403static inline struct uia_iface *impl_from_IUIAutomation6(IUIAutomation6 *iface)
3404{
3405 return CONTAINING_RECORD(iface, struct uia_iface, IUIAutomation6_iface);
3406}
3407
3408static HRESULT WINAPI uia_iface_QueryInterface(IUIAutomation6 *iface, REFIID riid, void **ppv)
3409{
3411
3412 *ppv = NULL;
3413 if (IsEqualIID(riid, &IID_IUIAutomation) || IsEqualIID(riid, &IID_IUnknown))
3414 *ppv = iface;
3415 else if (uia_iface->is_cui8 &&
3416 (IsEqualIID(riid, &IID_IUIAutomation2) ||
3417 IsEqualIID(riid, &IID_IUIAutomation3) ||
3418 IsEqualIID(riid, &IID_IUIAutomation4) ||
3419 IsEqualIID(riid, &IID_IUIAutomation5) ||
3420 IsEqualIID(riid, &IID_IUIAutomation6)))
3421 *ppv = iface;
3422 else
3423 return E_NOINTERFACE;
3424
3425 IUIAutomation6_AddRef(iface);
3426 return S_OK;
3427}
3428
3429static ULONG WINAPI uia_iface_AddRef(IUIAutomation6 *iface)
3430{
3433
3434 TRACE("%p, refcount %ld\n", uia_iface, ref);
3435 return ref;
3436}
3437
3438static ULONG WINAPI uia_iface_Release(IUIAutomation6 *iface)
3439{
3442
3443 TRACE("%p, refcount %ld\n", uia_iface, ref);
3444 if (!ref)
3445 free(uia_iface);
3446 return ref;
3447}
3448
3449static HRESULT WINAPI uia_iface_CompareElements(IUIAutomation6 *iface, IUIAutomationElement *elem1,
3450 IUIAutomationElement *elem2, BOOL *match)
3451{
3452 FIXME("%p, %p, %p, %p: stub\n", iface, elem1, elem2, match);
3453 return E_NOTIMPL;
3454}
3455
3456static HRESULT WINAPI uia_iface_CompareRuntimeIds(IUIAutomation6 *iface, SAFEARRAY *rt_id1, SAFEARRAY *rt_id2,
3457 BOOL *match)
3458{
3459 FIXME("%p, %p, %p, %p: stub\n", iface, rt_id1, rt_id2, match);
3460 return E_NOTIMPL;
3461}
3462
3463static HRESULT WINAPI uia_iface_GetRootElement(IUIAutomation6 *iface, IUIAutomationElement **root)
3464{
3466 HUIANODE node;
3467 HRESULT hr;
3468
3469 TRACE("%p, %p\n", iface, root);
3470
3471 if (!root)
3472 return E_POINTER;
3473
3474 *root = NULL;
3476 if (FAILED(hr))
3477 return hr;
3478
3480}
3481
3482static HRESULT WINAPI uia_iface_ElementFromHandle(IUIAutomation6 *iface, UIA_HWND hwnd, IUIAutomationElement **out_elem)
3483{
3485 HUIANODE node;
3486 HRESULT hr;
3487
3488 TRACE("%p, %p, %p\n", iface, hwnd, out_elem);
3489
3491 if (FAILED(hr))
3492 return hr;
3493
3494 return create_uia_element(out_elem, uia_iface->is_cui8, node);
3495}
3496
3497static HRESULT WINAPI uia_iface_ElementFromPoint(IUIAutomation6 *iface, POINT pt, IUIAutomationElement **out_elem)
3498{
3499 FIXME("%p, %s, %p: stub\n", iface, wine_dbgstr_point(&pt), out_elem);
3500 return E_NOTIMPL;
3501}
3502
3503static HRESULT uia_get_focused_element(IUIAutomation6 *iface, IUIAutomationCacheRequest *cache_req,
3504 BOOL use_default_cache_req, IUIAutomationElement **out_elem)
3505{
3507 struct UiaCacheRequest *cache_req_struct;
3508 BSTR tree_struct;
3509 SAFEARRAY *sa;
3510 HRESULT hr;
3511
3512 if (!out_elem)
3513 return E_POINTER;
3514
3515 *out_elem = NULL;
3516 if (use_default_cache_req)
3517 {
3518 hr = create_uia_cache_request_iface(&cache_req);
3519 if (FAILED(hr))
3520 return hr;
3521 }
3522
3523 hr = get_uia_cache_request_struct_from_iface(cache_req, &cache_req_struct);
3524 if (FAILED(hr))
3525 goto exit;
3526
3527 hr = UiaNodeFromFocus(cache_req_struct, &sa, &tree_struct);
3528 if (SUCCEEDED(hr))
3529 {
3530 if (!sa)
3531 {
3532 /*
3533 * Failure to get a focused element returns E_FAIL from the BuildCache
3534 * method, but UIA_E_ELEMENTNOTAVAILABLE from the default cache
3535 * request method.
3536 */
3537 hr = use_default_cache_req ? UIA_E_ELEMENTNOTAVAILABLE : E_FAIL;
3538 SysFreeString(tree_struct);
3539 goto exit;
3540 }
3541
3542 hr = create_uia_element_from_cache_req(out_elem, uia_iface->is_cui8, cache_req_struct, 0, sa, tree_struct);
3544 }
3545
3546exit:
3547 if (use_default_cache_req)
3548 IUIAutomationCacheRequest_Release(cache_req);
3549
3550 return hr;
3551}
3552
3553static HRESULT WINAPI uia_iface_GetFocusedElement(IUIAutomation6 *iface, IUIAutomationElement **out_elem)
3554{
3555 TRACE("%p, %p\n", iface, out_elem);
3556
3557 return uia_get_focused_element(iface, NULL, TRUE, out_elem);
3558}
3559
3560static HRESULT WINAPI uia_iface_GetRootElementBuildCache(IUIAutomation6 *iface, IUIAutomationCacheRequest *cache_req,
3561 IUIAutomationElement **out_root)
3562{
3563 FIXME("%p, %p, %p: stub\n", iface, cache_req, out_root);
3564 return E_NOTIMPL;
3565}
3566
3568 IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
3569{
3570 FIXME("%p, %p, %p, %p: stub\n", iface, hwnd, cache_req, out_elem);
3571 return E_NOTIMPL;
3572}
3573
3575 IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
3576{
3577 FIXME("%p, %s, %p, %p: stub\n", iface, wine_dbgstr_point(&pt), cache_req, out_elem);
3578 return E_NOTIMPL;
3579}
3580
3582 IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
3583{
3584 TRACE("%p, %p, %p\n", iface, cache_req, out_elem);
3585
3586 return uia_get_focused_element(iface, cache_req, FALSE, out_elem);
3587}
3588
3589static HRESULT WINAPI uia_iface_CreateTreeWalker(IUIAutomation6 *iface, IUIAutomationCondition *cond,
3590 IUIAutomationTreeWalker **out_walker)
3591{
3592 TRACE("%p, %p, %p\n", iface, cond, out_walker);
3593
3594 return create_uia_tree_walker(out_walker, cond);
3595}
3596
3597static HRESULT WINAPI uia_iface_get_ControlViewWalker(IUIAutomation6 *iface, IUIAutomationTreeWalker **out_walker)
3598{
3599 FIXME("%p, %p: stub\n", iface, out_walker);
3600 return E_NOTIMPL;
3601}
3602
3603static HRESULT WINAPI uia_iface_get_ContentViewWalker(IUIAutomation6 *iface, IUIAutomationTreeWalker **out_walker)
3604{
3605 FIXME("%p, %p: stub\n", iface, out_walker);
3606 return E_NOTIMPL;
3607}
3608
3609static HRESULT WINAPI uia_iface_get_RawViewWalker(IUIAutomation6 *iface, IUIAutomationTreeWalker **out_walker)
3610{
3611 FIXME("%p, %p: stub\n", iface, out_walker);
3612 return E_NOTIMPL;
3613}
3614
3615static HRESULT WINAPI uia_iface_get_RawViewCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
3616{
3617 TRACE("%p, %p\n", iface, out_condition);
3618
3620}
3621
3622static HRESULT WINAPI uia_iface_get_ControlViewCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
3623{
3624 TRACE("%p, %p\n", iface, out_condition);
3625
3626 return create_control_view_condition_iface(out_condition);
3627}
3628
3629static HRESULT WINAPI uia_iface_get_ContentViewCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
3630{
3631 FIXME("%p, %p: stub\n", iface, out_condition);
3632 return E_NOTIMPL;
3633}
3634
3635static HRESULT WINAPI uia_iface_CreateCacheRequest(IUIAutomation6 *iface, IUIAutomationCacheRequest **out_cache_req)
3636{
3637 HRESULT hr;
3638
3639 TRACE("%p, %p\n", iface, out_cache_req);
3640
3641 hr = create_uia_cache_request_iface(out_cache_req);
3642 if (FAILED(hr))
3643 return hr;
3644
3645 hr = IUIAutomationCacheRequest_AddProperty(*out_cache_req, UIA_RuntimeIdPropertyId);
3646 if (FAILED(hr))
3647 {
3648 IUIAutomationCacheRequest_Release(*out_cache_req);
3649 *out_cache_req = NULL;
3650 }
3651
3652 return hr;
3653}
3654
3655static HRESULT WINAPI uia_iface_CreateTrueCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
3656{
3657 TRACE("%p, %p\n", iface, out_condition);
3658
3660}
3661
3662static HRESULT WINAPI uia_iface_CreateFalseCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
3663{
3664 TRACE("%p, %p\n", iface, out_condition);
3665
3667}
3668
3670 IUIAutomationCondition **out_condition)
3671{
3672 TRACE("%p, %d, %s, %p\n", iface, prop_id, debugstr_variant(&val), out_condition);
3673
3675}
3676
3678 enum PropertyConditionFlags flags, IUIAutomationCondition **out_condition)
3679{
3680 FIXME("%p, %d, %s, %#x, %p: stub\n", iface, prop_id, debugstr_variant(&val), flags, out_condition);
3681 return E_NOTIMPL;
3682}
3683
3684static HRESULT WINAPI uia_iface_CreateAndCondition(IUIAutomation6 *iface, IUIAutomationCondition *cond1,
3685 IUIAutomationCondition *cond2, IUIAutomationCondition **out_condition)
3686{
3687 FIXME("%p, %p, %p, %p: stub\n", iface, cond1, cond2, out_condition);
3688 return E_NOTIMPL;
3689}
3690
3692 IUIAutomationCondition **out_condition)
3693{
3694 FIXME("%p, %p, %p: stub\n", iface, conds, out_condition);
3695 return E_NOTIMPL;
3696}
3697
3698static HRESULT WINAPI uia_iface_CreateAndConditionFromNativeArray(IUIAutomation6 *iface, IUIAutomationCondition **conds,
3699 int conds_count, IUIAutomationCondition **out_condition)
3700{
3701 FIXME("%p, %p, %d, %p: stub\n", iface, conds, conds_count, out_condition);
3702 return E_NOTIMPL;
3703}
3704
3705static HRESULT WINAPI uia_iface_CreateOrCondition(IUIAutomation6 *iface, IUIAutomationCondition *cond1,
3706 IUIAutomationCondition *cond2, IUIAutomationCondition **out_condition)
3707{
3708 IUIAutomationCondition *cond_arr[2] = { cond1, cond2 };
3709
3710 TRACE("%p, %p, %p, %p\n", iface, cond1, cond2, out_condition);
3711
3712 return create_uia_or_condition_iface(out_condition, cond_arr, ARRAY_SIZE(cond_arr));
3713}
3714
3716 IUIAutomationCondition **out_condition)
3717{
3718 FIXME("%p, %p, %p: stub\n", iface, conds, out_condition);
3719 return E_NOTIMPL;
3720}
3721
3722static HRESULT WINAPI uia_iface_CreateOrConditionFromNativeArray(IUIAutomation6 *iface, IUIAutomationCondition **conds,
3723 int conds_count, IUIAutomationCondition **out_condition)
3724{
3725 FIXME("%p, %p, %d, %p: stub\n", iface, conds, conds_count, out_condition);
3726 return E_NOTIMPL;
3727}
3728
3729static HRESULT WINAPI uia_iface_CreateNotCondition(IUIAutomation6 *iface, IUIAutomationCondition *cond,
3730 IUIAutomationCondition **out_condition)
3731{
3732 TRACE("%p, %p, %p\n", iface, cond, out_condition);
3733
3734 return create_uia_not_condition_iface(out_condition, cond);
3735}
3736
3737static HRESULT uia_add_com_event_handler(IUIAutomation6 *iface, EVENTID event_id, IUIAutomationElement *elem,
3738 enum TreeScope scope, IUIAutomationCacheRequest *cache_req, REFIID handler_riid, IUnknown *handler_unk)
3739{
3740 struct UiaCacheRequest *cache_req_struct;
3741 struct uia_com_event *com_event = NULL;
3742 SAFEARRAY *runtime_id = NULL;
3743 struct uia_element *element;
3744 IUnknown *handler_iface;
3745 HRESULT hr;
3746
3747 element = impl_from_IUIAutomationElement9((IUIAutomationElement9 *)elem);
3748 hr = UiaGetRuntimeId(element->node, &runtime_id);
3749 if (FAILED(hr))
3750 return hr;
3751
3752 if (!cache_req)
3753 {
3754 hr = create_uia_cache_request_iface(&cache_req);
3755 if (FAILED(hr))
3756 goto exit;
3757 }
3758 else
3759 IUIAutomationCacheRequest_AddRef(cache_req);
3760
3761 hr = get_uia_cache_request_struct_from_iface(cache_req, &cache_req_struct);
3762 if (FAILED(hr))
3763 goto exit;
3764
3765 if (!(com_event = calloc(1, sizeof(*com_event))))
3766 {
3767 hr = E_OUTOFMEMORY;
3768 goto exit;
3769 }
3770
3771 com_event->from_cui8 = element->from_cui8;
3773 uia_hwnd_map_init(&com_event->focus_hwnd_map);
3774
3775 hr = IUnknown_QueryInterface(handler_unk, handler_riid, (void **)&handler_iface);
3776 if (FAILED(hr))
3777 goto exit;
3778
3779 hr = register_interface_in_git(handler_iface, handler_riid, &com_event->git_cookie);
3780 IUnknown_Release(handler_iface);
3781 if (FAILED(hr))
3782 goto exit;
3783
3784 hr = uia_add_clientside_event(element->node, event_id, scope, NULL, 0, cache_req_struct, runtime_id,
3785 uia_com_event_callback, (void *)com_event, &com_event->event);
3786 if (FAILED(hr))
3787 goto exit;
3788
3789 if (!uia_clientside_event_start_event_thread((struct uia_event *)com_event->event))
3790 WARN("Failed to start event thread, WinEvents may not be delivered.\n");
3791
3792 hr = uia_event_handlers_add_handler(handler_unk, runtime_id, event_id, com_event);
3793
3794exit:
3795 if (FAILED(hr) && com_event)
3796 uia_event_handler_destroy(com_event);
3797 if (cache_req)
3798 IUIAutomationCacheRequest_Release(cache_req);
3799 SafeArrayDestroy(runtime_id);
3800
3801 return hr;
3802}
3803
3804static HRESULT WINAPI uia_iface_AddAutomationEventHandler(IUIAutomation6 *iface, EVENTID event_id,
3805 IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req,
3806 IUIAutomationEventHandler *handler)
3807{
3808 IUnknown *handler_unk;
3809 HRESULT hr;
3810
3811 TRACE("%p, %d, %p, %#x, %p, %p\n", iface, event_id, elem, scope, cache_req, handler);
3812
3813 if (!elem || !handler)
3814 return E_POINTER;
3815
3816 if (event_id == UIA_AutomationFocusChangedEventId)
3817 return E_INVALIDARG;
3818
3819 hr = IUIAutomationEventHandler_QueryInterface(handler, &IID_IUnknown, (void **)&handler_unk);
3820 if (FAILED(hr))
3821 return hr;
3822
3823 hr = uia_add_com_event_handler(iface, event_id, elem, scope, cache_req, &IID_IUIAutomationEventHandler, handler_unk);
3824 IUnknown_Release(handler_unk);
3825
3826 return hr;
3827}
3828
3829static HRESULT uia_remove_com_event_handler(EVENTID event_id, IUIAutomationElement *elem, IUnknown *handler_unk)
3830{
3831 struct uia_element *element;
3832 SAFEARRAY *runtime_id;
3833 HRESULT hr;
3834
3835 element = impl_from_IUIAutomationElement9((IUIAutomationElement9 *)elem);
3836 hr = UiaGetRuntimeId(element->node, &runtime_id);
3837 if (FAILED(hr) || !runtime_id)
3838 return hr;
3839
3840 uia_event_handlers_remove_handlers(handler_unk, runtime_id, event_id);
3841 SafeArrayDestroy(runtime_id);
3842
3843 return S_OK;
3844}
3845
3846static HRESULT WINAPI uia_iface_RemoveAutomationEventHandler(IUIAutomation6 *iface, EVENTID event_id,
3847 IUIAutomationElement *elem, IUIAutomationEventHandler *handler)
3848{
3849 IUnknown *handler_unk;
3850 HRESULT hr;
3851
3852 TRACE("%p, %d, %p, %p\n", iface, event_id, elem, handler);
3853
3854 if (!elem || !handler)
3855 return S_OK;
3856
3857 hr = IUIAutomationEventHandler_QueryInterface(handler, &IID_IUnknown, (void **)&handler_unk);
3858 if (FAILED(hr))
3859 return hr;
3860
3861 hr = uia_remove_com_event_handler(event_id, elem, handler_unk);
3862 IUnknown_Release(handler_unk);
3863
3864 return hr;
3865}
3866
3868 IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req,
3869 IUIAutomationPropertyChangedEventHandler *handler, PROPERTYID *props, int props_count)
3870{
3871 FIXME("%p, %p, %#x, %p, %p, %p, %d: stub\n", iface, elem, scope, cache_req, handler, props, props_count);
3872 return E_NOTIMPL;
3873}
3874
3876 IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req,
3877 IUIAutomationPropertyChangedEventHandler *handler, SAFEARRAY *props)
3878{
3879 FIXME("%p, %p, %#x, %p, %p, %p: stub\n", iface, elem, scope, cache_req, handler, props);
3880 return E_NOTIMPL;
3881}
3882
3884 IUIAutomationElement *elem, IUIAutomationPropertyChangedEventHandler *handler)
3885{
3886 FIXME("%p, %p, %p: stub\n", iface, elem, handler);
3887 return E_NOTIMPL;
3888}
3889
3891 IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req,
3892 IUIAutomationStructureChangedEventHandler *handler)
3893{
3894 FIXME("%p, %p, %#x, %p, %p: stub\n", iface, elem, scope, cache_req, handler);
3895 return E_NOTIMPL;
3896}
3897
3899 IUIAutomationElement *elem, IUIAutomationStructureChangedEventHandler *handler)
3900{
3901 FIXME("%p, %p, %p: stub\n", iface, elem, handler);
3902 return E_NOTIMPL;
3903}
3904
3906 IUIAutomationCacheRequest *cache_req, IUIAutomationFocusChangedEventHandler *handler)
3907{
3908 IUIAutomationElement *elem;
3909 IUnknown *handler_unk;
3910 HRESULT hr;
3911
3912 TRACE("%p, %p, %p\n", iface, cache_req, handler);
3913
3914 if (!handler)
3915 return E_POINTER;
3916
3917 hr = IUIAutomationFocusChangedEventHandler_QueryInterface(handler, &IID_IUnknown, (void **)&handler_unk);
3918 if (FAILED(hr))
3919 return hr;
3920
3921 hr = IUIAutomation6_GetRootElement(iface, &elem);
3922 if (FAILED(hr))
3923 {
3924 IUnknown_Release(handler_unk);
3925 return hr;
3926 }
3927
3928 hr = uia_add_com_event_handler(iface, UIA_AutomationFocusChangedEventId, elem, TreeScope_Subtree, cache_req,
3929 &IID_IUIAutomationFocusChangedEventHandler, handler_unk);
3930 IUIAutomationElement_Release(elem);
3931 IUnknown_Release(handler_unk);
3932
3933 return hr;
3934}
3935
3937 IUIAutomationFocusChangedEventHandler *handler)
3938{
3939 IUIAutomationElement *elem;
3940 IUnknown *handler_unk;
3941 HRESULT hr;
3942
3943 TRACE("%p, %p\n", iface, handler);
3944
3945 hr = IUIAutomationFocusChangedEventHandler_QueryInterface(handler, &IID_IUnknown, (void **)&handler_unk);
3946 if (FAILED(hr))
3947 return hr;
3948
3949 hr = IUIAutomation6_GetRootElement(iface, &elem);
3950 if (FAILED(hr))
3951 {
3952 IUnknown_Release(handler_unk);
3953 return hr;
3954 }
3955
3956 hr = uia_remove_com_event_handler(UIA_AutomationFocusChangedEventId, elem, handler_unk);
3957 IUIAutomationElement_Release(elem);
3958 IUnknown_Release(handler_unk);
3959
3960 return hr;
3961}
3962
3964{
3966
3967 TRACE("%p\n", iface);
3968
3970 if (!com_event_handlers.handler_count)
3971 goto exit;
3972
3974 {
3976 }
3977
3978exit:
3980
3981 return S_OK;
3982}
3983
3984static HRESULT WINAPI uia_iface_IntNativeArrayToSafeArray(IUIAutomation6 *iface, int *arr, int arr_count,
3985 SAFEARRAY **out_sa)
3986{
3987 HRESULT hr = S_OK;
3988 SAFEARRAY *sa;
3989 int *sa_arr;
3990
3991 TRACE("%p, %p, %d, %p\n", iface, arr, arr_count, out_sa);
3992
3993 if (!out_sa || !arr || !arr_count)
3994 return E_INVALIDARG;
3995
3996 *out_sa = NULL;
3997 if (!(sa = SafeArrayCreateVector(VT_I4, 0, arr_count)))
3998 return E_OUTOFMEMORY;
3999
4000 hr = SafeArrayAccessData(sa, (void **)&sa_arr);
4001 if (FAILED(hr))
4002 goto exit;
4003
4004 memcpy(sa_arr, arr, sizeof(*arr) * arr_count);
4006 if (SUCCEEDED(hr))
4007 *out_sa = sa;
4008
4009exit:
4010 if (FAILED(hr))
4012
4013 return hr;
4014}
4015
4016static HRESULT WINAPI uia_iface_IntSafeArrayToNativeArray(IUIAutomation6 *iface, SAFEARRAY *sa, int **out_arr,
4017 int *out_arr_count)
4018{
4019 LONG lbound, elems;
4020 int *arr, *sa_arr;
4021 VARTYPE vt;
4022 HRESULT hr;
4023
4024 TRACE("%p, %p, %p, %p\n", iface, sa, out_arr, out_arr_count);
4025
4026 if (!sa || !out_arr || !out_arr_count)
4027 return E_INVALIDARG;
4028
4029 *out_arr = NULL;
4031 if (FAILED(hr))
4032 return hr;
4033
4034 if (vt != VT_I4)
4035 return E_INVALIDARG;
4036
4037 hr = get_safearray_bounds(sa, &lbound, &elems);
4038 if (FAILED(hr))
4039 return hr;
4040
4041 if (!(arr = CoTaskMemAlloc(elems * sizeof(*arr))))
4042 return E_OUTOFMEMORY;
4043
4044 hr = SafeArrayAccessData(sa, (void **)&sa_arr);
4045 if (FAILED(hr))
4046 goto exit;
4047
4048 memcpy(arr, sa_arr, sizeof(*arr) * elems);
4050 if (FAILED(hr))
4051 goto exit;
4052
4053 *out_arr = arr;
4054 *out_arr_count = elems;
4055
4056exit:
4057 if (FAILED(hr))
4058 CoTaskMemFree(arr);
4059
4060 return hr;
4061}
4062
4063static HRESULT WINAPI uia_iface_RectToVariant(IUIAutomation6 *iface, RECT rect, VARIANT *out_var)
4064{
4065 FIXME("%p, %s, %p: stub\n", iface, wine_dbgstr_rect(&rect), out_var);
4066 return E_NOTIMPL;
4067}
4068
4069static HRESULT WINAPI uia_iface_VariantToRect(IUIAutomation6 *iface, VARIANT var, RECT *out_rect)
4070{
4071 FIXME("%p, %s, %p: stub\n", iface, debugstr_variant(&var), out_rect);
4072 return E_NOTIMPL;
4073}
4074
4075static HRESULT WINAPI uia_iface_SafeArrayToRectNativeArray(IUIAutomation6 *iface, SAFEARRAY *sa, RECT **out_rect_arr,
4076 int *out_rect_arr_count)
4077{
4078 FIXME("%p, %p, %p, %p: stub\n", iface, sa, out_rect_arr, out_rect_arr_count);
4079 return E_NOTIMPL;
4080}
4081
4082static HRESULT WINAPI uia_iface_CreateProxyFactoryEntry(IUIAutomation6 *iface, IUIAutomationProxyFactory *factory,
4083 IUIAutomationProxyFactoryEntry **out_entry)
4084{
4085 FIXME("%p, %p, %p: stub\n", iface, factory, out_entry);
4086 return E_NOTIMPL;
4087}
4088
4090 IUIAutomationProxyFactoryMapping **out_factory_map)
4091{
4092 FIXME("%p, %p: stub\n", iface, out_factory_map);
4093 return E_NOTIMPL;
4094}
4095
4096static HRESULT WINAPI uia_iface_GetPropertyProgrammaticName(IUIAutomation6 *iface, PROPERTYID prop_id, BSTR *out_name)
4097{
4098 FIXME("%p, %d, %p: stub\n", iface, prop_id, out_name);
4099 return E_NOTIMPL;
4100}
4101
4102static HRESULT WINAPI uia_iface_GetPatternProgrammaticName(IUIAutomation6 *iface, PATTERNID pattern_id, BSTR *out_name)
4103{
4104 FIXME("%p, %d, %p: stub\n", iface, pattern_id, out_name);
4105 return E_NOTIMPL;
4106}
4107
4108static HRESULT WINAPI uia_iface_PollForPotentialSupportedPatterns(IUIAutomation6 *iface, IUIAutomationElement *elem,
4109 SAFEARRAY **out_pattern_ids, SAFEARRAY **out_pattern_names)
4110{
4111 FIXME("%p, %p, %p, %p: stub\n", iface, elem, out_pattern_ids, out_pattern_names);
4112 return E_NOTIMPL;
4113}
4114
4115static HRESULT WINAPI uia_iface_PollForPotentialSupportedProperties(IUIAutomation6 *iface, IUIAutomationElement *elem,
4116 SAFEARRAY **out_prop_ids, SAFEARRAY **out_prop_names)
4117{
4118 FIXME("%p, %p, %p, %p: stub\n", iface, elem, out_prop_ids, out_prop_names);
4119 return E_NOTIMPL;
4120}
4121
4122static HRESULT WINAPI uia_iface_CheckNotSupported(IUIAutomation6 *iface, VARIANT in_val, BOOL *match)
4123{
4124 IUnknown *unk;
4125
4126 TRACE("%p, %s, %p\n", iface, debugstr_variant(&in_val), match);
4127
4128 *match = FALSE;
4130 if (V_VT(&in_val) == VT_UNKNOWN && (V_UNKNOWN(&in_val) == unk))
4131 *match = TRUE;
4132
4133 return S_OK;
4134}
4135
4136static HRESULT WINAPI uia_iface_get_ReservedNotSupportedValue(IUIAutomation6 *iface, IUnknown **out_unk)
4137{
4138 TRACE("%p, %p\n", iface, out_unk);
4139
4140 return UiaGetReservedNotSupportedValue(out_unk);
4141}
4142
4144{
4145 TRACE("%p, %p\n", iface, out_unk);
4146
4147 return UiaGetReservedMixedAttributeValue(out_unk);
4148}
4149
4150static HRESULT WINAPI uia_iface_ElementFromIAccessible(IUIAutomation6 *iface, IAccessible *acc, int cid,
4151 IUIAutomationElement **out_elem)
4152{
4153 FIXME("%p, %p, %d, %p: stub\n", iface, acc, cid, out_elem);
4154 return E_NOTIMPL;
4155}
4156
4158 IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
4159{
4160 FIXME("%p, %p, %d, %p, %p: stub\n", iface, acc, cid, cache_req, out_elem);
4161 return E_NOTIMPL;
4162}
4163
4164/* IUIAutomation2 methods */
4165static HRESULT WINAPI uia_iface_get_AutoSetFocus(IUIAutomation6 *iface, BOOL *out_auto_set_focus)
4166{
4167 FIXME("%p, %p: stub\n", iface, out_auto_set_focus);
4168 return E_NOTIMPL;
4169}
4170
4171static HRESULT WINAPI uia_iface_put_AutoSetFocus(IUIAutomation6 *iface, BOOL auto_set_focus)
4172{
4173 FIXME("%p, %d: stub\n", iface, auto_set_focus);
4174 return E_NOTIMPL;
4175}
4176
4177static HRESULT WINAPI uia_iface_get_ConnectionTimeout(IUIAutomation6 *iface, DWORD *out_timeout)
4178{
4179 FIXME("%p, %p: stub\n", iface, out_timeout);
4180 return E_NOTIMPL;
4181}
4182
4184{
4185 FIXME("%p, %ld: stub\n", iface, timeout);
4186 return E_NOTIMPL;
4187}
4188
4189static HRESULT WINAPI uia_iface_get_TransactionTimeout(IUIAutomation6 *iface, DWORD *out_timeout)
4190{
4191 FIXME("%p, %p: stub\n", iface, out_timeout);
4192 return E_NOTIMPL;
4193}
4194
4196{
4197 FIXME("%p, %ld: stub\n", iface, timeout);
4198 return E_NOTIMPL;
4199}
4200
4201/* IUIAutomation3 methods */
4202static HRESULT WINAPI uia_iface_AddTextEditTextChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem,
4203 enum TreeScope scope, enum TextEditChangeType change_type, IUIAutomationCacheRequest *cache_req,
4204 IUIAutomationTextEditTextChangedEventHandler *handler)
4205{
4206 FIXME("%p, %p, %#x, %d, %p, %p: stub\n", iface, elem, scope, change_type, cache_req, handler);
4207 return E_NOTIMPL;
4208}
4209
4210static HRESULT WINAPI uia_iface_RemoveTextEditTextChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem,
4211 IUIAutomationTextEditTextChangedEventHandler *handler)
4212{
4213 FIXME("%p, %p, %p: stub\n", iface, elem, handler);
4214 return E_NOTIMPL;
4215}
4216
4217/* IUIAutomation4 methods */
4218static HRESULT WINAPI uia_iface_AddChangesEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem,
4219 enum TreeScope scope, int *change_types, int change_types_count, IUIAutomationCacheRequest *cache_req,
4220 IUIAutomationChangesEventHandler *handler)
4221{
4222 FIXME("%p, %p, %#x, %p, %d, %p, %p: stub\n", iface, elem, scope, change_types, change_types_count, cache_req,
4223 handler);
4224 return E_NOTIMPL;
4225}
4226
4227static HRESULT WINAPI uia_iface_RemoveChangesEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem,
4228 IUIAutomationChangesEventHandler *handler)
4229{
4230 FIXME("%p, %p, %p: stub\n", iface, elem, handler);
4231 return E_NOTIMPL;
4232}
4233
4234/* IUIAutomation5 methods */
4235static HRESULT WINAPI uia_iface_AddNotificationEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem,
4236 enum TreeScope scope, IUIAutomationCacheRequest *cache_req, IUIAutomationNotificationEventHandler *handler)
4237{
4238 FIXME("%p, %p, %#x, %p, %p: stub\n", iface, elem, scope, cache_req, handler);
4239 return E_NOTIMPL;
4240}
4241
4242static HRESULT WINAPI uia_iface_RemoveNotificationEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem,
4243 IUIAutomationNotificationEventHandler *handler)
4244{
4245 FIXME("%p, %p, %p: stub\n", iface, elem, handler);
4246 return E_NOTIMPL;
4247}
4248
4249/* IUIAutomation6 methods */
4251 IUIAutomationEventHandlerGroup **out_handler_group)
4252{
4253 FIXME("%p, %p: stub\n", iface, out_handler_group);
4254 return E_NOTIMPL;
4255}
4256
4257static HRESULT WINAPI uia_iface_AddEventHandlerGroup(IUIAutomation6 *iface, IUIAutomationElement *elem,
4258 IUIAutomationEventHandlerGroup *handler_group)
4259{
4260 FIXME("%p, %p, %p: stub\n", iface, elem, handler_group);
4261 return E_NOTIMPL;
4262}
4263
4264static HRESULT WINAPI uia_iface_RemoveEventHandlerGroup(IUIAutomation6 *iface, IUIAutomationElement *elem,
4265 IUIAutomationEventHandlerGroup *handler_group)
4266{
4267 FIXME("%p, %p, %p: stub\n", iface, elem, handler_group);
4268 return E_NOTIMPL;
4269}
4270
4272 enum ConnectionRecoveryBehaviorOptions *out_conn_recovery_opts)
4273{
4274 FIXME("%p, %p: stub\n", iface, out_conn_recovery_opts);
4275 return E_NOTIMPL;
4276}
4277
4279 enum ConnectionRecoveryBehaviorOptions conn_recovery_opts)
4280{
4281 FIXME("%p, %#x: stub\n", iface, conn_recovery_opts);
4282 return E_NOTIMPL;
4283}
4284
4285static HRESULT WINAPI uia_iface_get_CoalesceEvents(IUIAutomation6 *iface,
4286 enum CoalesceEventsOptions *out_coalesce_events_opts)
4287{
4288 FIXME("%p, %p: stub\n", iface, out_coalesce_events_opts);
4289 return E_NOTIMPL;
4290}
4291
4292static HRESULT WINAPI uia_iface_put_CoalesceEvents(IUIAutomation6 *iface,
4293 enum CoalesceEventsOptions coalesce_events_opts)
4294{
4295 FIXME("%p, %#x: stub\n", iface, coalesce_events_opts);
4296 return E_NOTIMPL;
4297}
4298
4300 IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req,
4301 IUIAutomationActiveTextPositionChangedEventHandler *handler)
4302{
4303 FIXME("%p, %p, %#x, %p, %p: stub\n", iface, elem, scope, cache_req, handler);
4304 return E_NOTIMPL;
4305}
4306
4308 IUIAutomationElement *elem, IUIAutomationActiveTextPositionChangedEventHandler *handler)
4309{
4310 FIXME("%p, %p, %p\n", iface, elem, handler);
4311 return E_NOTIMPL;
4312}
4313
4314static const IUIAutomation6Vtbl uia_iface_vtbl = {
4318 /* IUIAutomation methods */
4374 /* IUIAutomation2 methods */
4381 /* IUIAutomation3 methods */
4384 /* IUIAutomation4 methods */
4387 /* IUIAutomation5 methods */
4390 /* IUIAutomation6 methods */
4400};
4401
4403{
4404 struct uia_iface *uia;
4405
4406 uia = calloc(1, sizeof(*uia));
4407 if (!uia)
4408 return E_OUTOFMEMORY;
4409
4410 uia->IUIAutomation6_iface.lpVtbl = &uia_iface_vtbl;
4411 uia->is_cui8 = is_cui8;
4412 uia->ref = 1;
4413
4414 *iface = (IUnknown *)&uia->IUIAutomation6_iface;
4415 return S_OK;
4416}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
Definition: list.h:37
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:573
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
HRESULT WINAPI CoCreateFreeThreadedMarshaler(IUnknown *outer, IUnknown **marshaler)
Definition: marshal.c:417
OLECHAR * BSTR
Definition: compat.h:2293
unsigned short VARTYPE
Definition: compat.h:2254
@ VT_BSTR
Definition: compat.h:2303
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_ARRAY
Definition: compat.h:2341
@ VT_R8
Definition: compat.h:2300
@ VT_I4
Definition: compat.h:2298
@ VT_BOOL
Definition: compat.h:2306
static void * user_data
Definition: metahost.c:106
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:91
#define __cdecl
Definition: corecrt.h:121
_ACRTIMP void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *))
HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData)
Definition: safearray.c:947
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
HRESULT WINAPI SafeArrayCopy(SAFEARRAY *psa, SAFEARRAY **ppsaOut)
Definition: safearray.c:1379
SAFEARRAY *WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
Definition: safearray.c:677
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
HRESULT WINAPI SafeArrayGetVartype(SAFEARRAY *psa, VARTYPE *pvt)
Definition: safearray.c:1534
static const char * debugstr_variant(const VARIANT *var)
Definition: dom.c:505
#define pt(x, y)
Definition: drawing.c:79
#define L(x)
Definition: resources.c:13
r parent
Definition: btrfs.c:3010
#define rb_entry(ptr, type, member)
Definition: rbtree.h:130
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static const FxOffsetAndName offsets[]
const GLdouble * v
Definition: gl.h:2040
struct _cl_event * event
Definition: glext.h:7739
GLenum condition
Definition: glext.h:9255
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum mode
Definition: glext.h:6217
GLenum const GLfloat * params
Definition: glext.h:5645
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
GLbitfield flags
Definition: glext.h:7161
const GLint * first
Definition: glext.h:5794
GLint GLenum GLboolean normalized
Definition: glext.h:6117
GLuint GLfloat * val
Definition: glext.h:7180
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const char cursor[]
Definition: icontest.c:13
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static TfClientId cid
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
if(dx< 0)
Definition: linetemp.h:194
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const char * var
Definition: shader.c:5666
static UINT UINT last
Definition: font.c:45
static size_t elem
Definition: string.c:71
static DWORD thread_id
Definition: protocol.c:159
static HWND child
Definition: cursoricon.c:298
static HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvider *caller)
Definition: dispex.c:914
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
static unsigned __int64 next
Definition: rand_nt.c:6
#define calloc
Definition: rosglue.h:14
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:26
#define RB_FOR_EACH_ENTRY_DESTRUCTOR(elem, elem2, tree, type, field)
Definition: rbtree.h:160
static int rb_put(struct rb_tree *tree, const void *key, struct rb_entry *entry)
Definition: rbtree.h:204
static struct rb_entry * rb_get(const struct rb_tree *tree, const void *key)
Definition: rbtree.h:192
#define RB_FOR_EACH_ENTRY(elem, tree, type, field)
Definition: rbtree.h:148
static void rb_remove(struct rb_tree *tree, struct rb_entry *entry)
Definition: rbtree.h:272
static void rb_init(struct rb_tree *tree, rb_compare_func_t compare)
Definition: rbtree.h:173
#define exit(n)
Definition: config.h:202
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
PROPERTYID * pProperties
Definition: match.c:390
Definition: undname.c:54
Definition: main.c:439
Definition: copy.c:22
Definition: match.c:28
Definition: rbtree.h:30
Definition: rbtree.h:40
Definition: send.c:48
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
Definition: dhcpd.h:248
IUIAutomationBoolCondition IUIAutomationBoolCondition_iface
struct UiaCondition condition
IUIAutomationCondition * view_condition
struct UiaCacheRequest cache_req
IUIAutomationCacheRequest IUIAutomationCacheRequest_iface
struct rb_tree handler_map
struct rb_tree handler_event_id_map
HUIAEVENT event
struct rb_tree focus_hwnd_map
struct uia_event_handler_map_entry * handler_map
struct list event_handler_map_list_entry
IUIAutomationElement ** elements
IUIAutomationElementArray IUIAutomationElementArray_iface
IUIAutomationElement9 IUIAutomationElement9_iface
IUnknown * marshal
struct uia_cache_property * cached_props
struct rb_entry entry
int event_id
struct list handlers_list
struct list handlers_list
int event_id
struct uia_event_handler_event_id_map_entry * handler_event_id_map
IUnknown * handler_iface
SAFEARRAY * runtime_id
struct rb_entry entry
struct list handler_event_id_map_list_entry
IUIAutomation6 IUIAutomation6_iface
IUIAutomationNotCondition IUIAutomationNotCondition_iface
IUIAutomationCondition * child_iface
struct UiaNotCondition condition
struct UiaAndOrCondition condition
IUIAutomationOrCondition IUIAutomationOrCondition_iface
IUIAutomationCondition ** child_ifaces
IUIAutomationPropertyCondition IUIAutomationPropertyCondition_iface
struct UiaPropertyCondition condition
IUIAutomationCacheRequest * default_cache_req
struct UiaCondition * cond_struct
IUIAutomationTreeWalker IUIAutomationTreeWalker_iface
IUIAutomationCondition * nav_cond
#define bsearch
#define DWORD_PTR
Definition: treelist.c:76
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI UiaGetRuntimeId(HUIANODE huianode, SAFEARRAY **runtime_id)
Definition: uia_client.c:3045
HRESULT WINAPI UiaGetUpdatedCache(HUIANODE huianode, struct UiaCacheRequest *cache_req, enum NormalizeState normalize_state, struct UiaCondition *normalize_cond, SAFEARRAY **out_req, BSTR *tree_struct)
Definition: uia_client.c:3450
HRESULT WINAPI UiaFind(HUIANODE huianode, struct UiaFindParams *find_params, struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, SAFEARRAY **out_offsets, SAFEARRAY **out_tree_structs)
Definition: uia_client.c:3642
HRESULT WINAPI UiaNodeFromFocus(struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, BSTR *tree_struct)
Definition: uia_client.c:2834
HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIANT *out_val)
Definition: uia_client.c:2909
BOOL WINAPI UiaNodeRelease(HUIANODE huianode)
Definition: uia_client.c:2876
HRESULT WINAPI UiaNavigate(HUIANODE huianode, enum NavigateDirection dir, struct UiaCondition *nav_condition, struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, BSTR *tree_struct)
Definition: uia_client.c:3567
HRESULT WINAPI UiaGetRootNode(HUIANODE *huianode)
Definition: uia_client.c:2771
HRESULT create_uia_node_from_hwnd(HWND hwnd, HUIANODE *out_node, int node_flags)
Definition: uia_client.c:2721
HRESULT WINAPI UiaHUiaNodeFromVariant(VARIANT *in_val, HUIANODE *huianode)
Definition: uia_client.c:3097
HRESULT WINAPI UiaNodeFromHandle(HWND hwnd, HUIANODE *huianode)
Definition: uia_client.c:2761
HRESULT uia_node_from_lresult(LRESULT lr, HUIANODE *huianode, int node_flags)
Definition: uia_client.c:2642
HRESULT create_node_from_node_provider(IWineUiaNode *node, int idx, LONG flags, VARIANT *ret_val)
Definition: uia_client.c:397
void uia_node_lresult_release(LRESULT lr)
Definition: uia_client.c:2683
HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE *out_node, BOOL get_hwnd_providers, int node_flags)
Definition: uia_client.c:2049
HRESULT get_focus_from_node_provider(IWineUiaNode *node, int idx, LONG flags, VARIANT *ret_val)
Definition: uia_client.c:350
static HRESULT WINAPI uia_element_get_CurrentIsDialog(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_GetCurrentPattern(IUIAutomationElement9 *iface, PATTERNID pattern_id, IUnknown **out_pattern)
static HRESULT WINAPI uia_iface_RemoveActiveTextPositionChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationActiveTextPositionChangedEventHandler *handler)
static HRESULT create_uia_bool_condition_iface(IUIAutomationCondition **out_cond, enum ConditionType cond_type)
static HRESULT WINAPI uia_element_get_CurrentHelpText(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_iface_CreateEventHandlerGroup(IUIAutomation6 *iface, IUIAutomationEventHandlerGroup **out_handler_group)
static HRESULT WINAPI uia_element_get_CurrentCulture(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_iface_GetFocusedElement(IUIAutomation6 *iface, IUIAutomationElement **out_elem)
static HRESULT uia_tree_walker_navigate(IUIAutomationTreeWalker *walker, IUIAutomationCacheRequest *cache_req, IUIAutomationElement *start_elem, int nav_dir, IUIAutomationElement **out_elem)
static HRESULT WINAPI uia_iface_GetRootElement(IUIAutomation6 *iface, IUIAutomationElement **root)
static HRESULT WINAPI uia_property_condition_QueryInterface(IUIAutomationPropertyCondition *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_element_get_CurrentOrientation(IUIAutomationElement9 *iface, enum OrientationType *ret_val)
static struct uia_iface * impl_from_IUIAutomation6(IUIAutomation6 *iface)
static HRESULT WINAPI uia_tree_walker_GetNextSiblingElementBuildCache(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **next)
static HRESULT WINAPI uia_iface_RemoveAutomationEventHandler(IUIAutomation6 *iface, EVENTID event_id, IUIAutomationElement *elem, IUIAutomationEventHandler *handler)
static HRESULT WINAPI uia_element_FindFirstBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **found)
static HRESULT WINAPI uia_element_get_CurrentAutomationId(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_GetCurrentPatternAs(IUIAutomationElement9 *iface, PATTERNID pattern_id, REFIID riid, void **out_pattern)
static HRESULT WINAPI uia_tree_walker_GetParentElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationElement **parent)
static HRESULT WINAPI uia_element_get_CachedBoundingRectangle(IUIAutomationElement9 *iface, RECT *ret_val)
static HRESULT WINAPI uia_element_get_CachedFlowsTo(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT create_uia_element(IUIAutomationElement **iface, BOOL from_cui8, HUIANODE node)
static HRESULT WINAPI uia_iface_ElementFromPointBuildCache(IUIAutomation6 *iface, POINT pt, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
static HRESULT WINAPI uia_element_get_CachedLabeledBy(IUIAutomationElement9 *iface, IUIAutomationElement **ret_val)
static HRESULT WINAPI uia_iface_ElementFromPoint(IUIAutomation6 *iface, POINT pt, IUIAutomationElement **out_elem)
static HRESULT WINAPI uia_iface_AddPropertyChangedEventHandlerNativeArray(IUIAutomation6 *iface, IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req, IUIAutomationPropertyChangedEventHandler *handler, PROPERTYID *props, int props_count)
static CRITICAL_SECTION_DEBUG com_event_handlers_cs_debug
static HRESULT WINAPI uia_element_get_CachedFlowsFrom(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT get_uia_cache_request_struct_from_iface(IUIAutomationCacheRequest *cache_request, struct UiaCacheRequest **cache_req_struct)
static int __cdecl uia_compare_cache_props(const void *a, const void *b)
static ULONG WINAPI uia_cache_request_AddRef(IUIAutomationCacheRequest *iface)
static HRESULT WINAPI uia_element_get_CurrentItemStatus(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_QueryInterface(IUIAutomationElement9 *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_element_get_CurrentIsControlElement(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CurrentIsContentElement(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_GetCachedChildren(IUIAutomationElement9 *iface, IUIAutomationElementArray **children)
static HRESULT WINAPI uia_element_get_CurrentDescribedBy(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static ULONG WINAPI uia_tree_walker_AddRef(IUIAutomationTreeWalker *iface)
static HRESULT WINAPI uia_element_array_get_Length(IUIAutomationElementArray *iface, int *out_length)
static HRESULT WINAPI uia_element_get_CachedAnnotationObjects(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT WINAPI uia_tree_walker_GetParentElementBuildCache(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **parent)
static HRESULT WINAPI uia_iface_RemoveFocusChangedEventHandler(IUIAutomation6 *iface, IUIAutomationFocusChangedEventHandler *handler)
static HRESULT WINAPI uia_element_SetFocus(IUIAutomationElement9 *iface)
static HRESULT WINAPI uia_element_get_CurrentControllerFor(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT WINAPI uia_element_get_CurrentAnnotationObjects(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT create_uia_property_condition_iface(IUIAutomationCondition **out_cond, PROPERTYID prop_id, VARIANT val, enum PropertyConditionFlags prop_flags)
static void uia_event_handlers_remove_handlers(IUnknown *handler_iface, SAFEARRAY *runtime_id, int event_id)
static HRESULT WINAPI uia_element_GetCurrentPropertyValue(IUIAutomationElement9 *iface, PROPERTYID prop_id, VARIANT *ret_val)
static HRESULT WINAPI uia_element_get_CachedIsPeripheral(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_tree_walker_GetFirstChildElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationElement **first)
static HRESULT WINAPI uia_iface_AddActiveTextPositionChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req, IUIAutomationActiveTextPositionChangedEventHandler *handler)
static HRESULT WINAPI uia_iface_GetFocusedElementBuildCache(IUIAutomation6 *iface, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
static HRESULT WINAPI uia_element_get_CurrentIsPassword(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT uia_com_focus_win_event_msaa_callback(struct uia_event *event, void *user_data)
static HRESULT WINAPI uia_iface_CreateAndConditionFromNativeArray(IUIAutomation6 *iface, IUIAutomationCondition **conds, int conds_count, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_element_FindFirstWithOptionsBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req, enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root, IUIAutomationElement **found)
static ULONG WINAPI uia_iface_AddRef(IUIAutomation6 *iface)
static HRESULT WINAPI uia_element_get_CachedClassName(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CurrentIsEnabled(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CachedCulture(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_iface_GetPatternProgrammaticName(IUIAutomation6 *iface, PATTERNID pattern_id, BSTR *out_name)
static HRESULT WINAPI uia_iface_AddTextEditTextChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, enum TreeScope scope, enum TextEditChangeType change_type, IUIAutomationCacheRequest *cache_req, IUIAutomationTextEditTextChangedEventHandler *handler)
static HRESULT WINAPI uia_element_get_CachedIsRequiredForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_IntNativeArrayToSafeArray(IUIAutomation6 *iface, int *arr, int arr_count, SAFEARRAY **out_sa)
static HRESULT WINAPI uia_element_GetCachedPatternAs(IUIAutomationElement9 *iface, PATTERNID pattern_id, REFIID riid, void **out_pattern)
static HRESULT WINAPI uia_cache_request_get_TreeScope(IUIAutomationCacheRequest *iface, enum TreeScope *scope)
static HRESULT WINAPI uia_element_FindAllWithOptionsBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req, enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root, IUIAutomationElementArray **found)
static HRESULT WINAPI uia_element_get_CachedProviderDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_iface_CreateTreeWalker(IUIAutomation6 *iface, IUIAutomationCondition *cond, IUIAutomationTreeWalker **out_walker)
static int uia_com_event_handler_event_id_compare(const void *key, const struct rb_entry *entry)
static HRESULT WINAPI uia_element_get_CurrentAriaRole(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CachedHeadingLevel(IUIAutomationElement9 *iface, HEADINGLEVELID *ret_val)
static HRESULT WINAPI uia_element_get_CachedAcceleratorKey(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_GetRuntimeId(IUIAutomationElement9 *iface, SAFEARRAY **runtime_id)
static const IUIAutomationElement9Vtbl uia_element_vtbl
static HRESULT WINAPI uia_iface_CreateOrConditionFromNativeArray(IUIAutomation6 *iface, IUIAutomationCondition **conds, int conds_count, IUIAutomationCondition **out_condition)
static HRESULT create_control_view_condition_iface(IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_iface_RemoveTextEditTextChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationTextEditTextChangedEventHandler *handler)
static HRESULT WINAPI uia_element_get_CurrentControlType(IUIAutomationElement9 *iface, CONTROLTYPEID *ret_val)
static HRESULT WINAPI uia_tree_walker_GetNextSiblingElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationElement **next)
static HRESULT WINAPI uia_iface_GetRootElementBuildCache(IUIAutomation6 *iface, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_root)
static ULONG WINAPI uia_iface_Release(IUIAutomation6 *iface)
static HRESULT WINAPI uia_iface_CreateProxyFactoryEntry(IUIAutomation6 *iface, IUIAutomationProxyFactory *factory, IUIAutomationProxyFactoryEntry **out_entry)
static HRESULT uia_com_event_callback(struct uia_event *event, struct uia_event_args *args, SAFEARRAY *cache_req, BSTR tree_struct)
static HRESULT WINAPI uia_iface_CompareElements(IUIAutomation6 *iface, IUIAutomationElement *elem1, IUIAutomationElement *elem2, BOOL *match)
static HRESULT WINAPI uia_element_get_CachedAnnotationTypes(IUIAutomationElement9 *iface, SAFEARRAY **ret_val)
static ULONG WINAPI uia_element_AddRef(IUIAutomationElement9 *iface)
static HRESULT WINAPI uia_iface_AddNotificationEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req, IUIAutomationNotificationEventHandler *handler)
static HRESULT WINAPI uia_iface_VariantToRect(IUIAutomation6 *iface, VARIANT var, RECT *out_rect)
static HRESULT WINAPI uia_or_condition_get_ChildCount(IUIAutomationOrCondition *iface, int *child_count)
static HRESULT WINAPI uia_cache_request_put_TreeScope(IUIAutomationCacheRequest *iface, enum TreeScope scope)
static HRESULT WINAPI uia_element_get_CurrentFrameworkId(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_iface_get_ReservedNotSupportedValue(IUIAutomation6 *iface, IUnknown **out_unk)
static HRESULT create_uia_or_condition_iface(IUIAutomationCondition **out_cond, IUIAutomationCondition **in_conds, int in_cond_count)
static HRESULT WINAPI uia_element_GetCachedPropertyValueEx(IUIAutomationElement9 *iface, PROPERTYID prop_id, BOOL ignore_default, VARIANT *ret_val)
static ULONG WINAPI uia_element_Release(IUIAutomationElement9 *iface)
static HRESULT WINAPI uia_iface_AddChangesEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, enum TreeScope scope, int *change_types, int change_types_count, IUIAutomationCacheRequest *cache_req, IUIAutomationChangesEventHandler *handler)
static ULONG WINAPI uia_element_array_Release(IUIAutomationElementArray *iface)
static HRESULT WINAPI uia_element_GetCurrentPropertyValueEx(IUIAutomationElement9 *iface, PROPERTYID prop_id, BOOL ignore_default, VARIANT *ret_val)
static struct uia_tree_walker * impl_from_IUIAutomationTreeWalker(IUIAutomationTreeWalker *iface)
static HRESULT WINAPI uia_element_GetCachedParent(IUIAutomationElement9 *iface, IUIAutomationElement **parent)
static HRESULT WINAPI uia_element_get_CachedOrientation(IUIAutomationElement9 *iface, enum OrientationType *ret_val)
static HRESULT WINAPI uia_element_get_CachedControllerFor(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT WINAPI uia_cache_request_get_TreeFilter(IUIAutomationCacheRequest *iface, IUIAutomationCondition **filter)
static struct uia_cache_request * impl_from_IUIAutomationCacheRequest(IUIAutomationCacheRequest *iface)
static ULONG WINAPI uia_bool_condition_Release(IUIAutomationBoolCondition *iface)
static HRESULT WINAPI uia_element_get_CurrentIsDataValidForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_get_ControlViewWalker(IUIAutomation6 *iface, IUIAutomationTreeWalker **out_walker)
static HRESULT WINAPI uia_tree_walker_NormalizeElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationElement **normalized)
static HRESULT WINAPI uia_iface_CreatePropertyConditionEx(IUIAutomation6 *iface, PROPERTYID prop_id, VARIANT val, enum PropertyConditionFlags flags, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_element_FindFirst(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, IUIAutomationElement **found)
static HRESULT WINAPI uia_element_get_CachedIsOffscreen(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_property_condition_get_PropertyValue(IUIAutomationPropertyCondition *iface, VARIANT *val)
static HRESULT WINAPI uia_element_get_CurrentProviderDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CurrentBoundingRectangle(IUIAutomationElement9 *iface, RECT *ret_val)
static HRESULT WINAPI uia_or_condition_GetChildren(IUIAutomationOrCondition *iface, SAFEARRAY **out_children)
static HRESULT WINAPI uia_cache_request_AddPattern(IUIAutomationCacheRequest *iface, PATTERNID pattern_id)
static HRESULT WINAPI uia_element_get_CachedHasKeyboardFocus(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CurrentIsOffscreen(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_get_AutoSetFocus(IUIAutomation6 *iface, BOOL *out_auto_set_focus)
static HRESULT WINAPI uia_iface_get_ConnectionRecoveryBehavior(IUIAutomation6 *iface, enum ConnectionRecoveryBehaviorOptions *out_conn_recovery_opts)
static HRESULT WINAPI uia_tree_walker_GetPreviousSiblingElementBuildCache(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **prev)
static HRESULT WINAPI uia_iface_get_RawViewWalker(IUIAutomation6 *iface, IUIAutomationTreeWalker **out_walker)
static HRESULT WINAPI uia_iface_ElementFromHandleBuildCache(IUIAutomation6 *iface, UIA_HWND hwnd, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
static int __cdecl uia_cached_property_id_compare(const void *a, const void *b)
static HRESULT WINAPI uia_element_get_CachedControlType(IUIAutomationElement9 *iface, CONTROLTYPEID *ret_val)
static HRESULT WINAPI uia_element_get_CachedIsDialog(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CachedHelpText(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CurrentFlowsTo(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT create_uia_element_from_cache_req(IUIAutomationElement **iface, BOOL from_cui8, struct UiaCacheRequest *cache_req, LONG start_idx, SAFEARRAY *req_data, BSTR tree_struct)
static HRESULT WINAPI uia_element_get_CurrentFullDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CachedFullDescription(IUIAutomationElement9 *iface, BSTR *ret_val)
HRESULT create_uia_iface(IUnknown **iface, BOOL is_cui8)
static struct uia_bool_condition * impl_from_IUIAutomationBoolCondition(IUIAutomationBoolCondition *iface)
static HRESULT set_find_params_struct(struct UiaFindParams *params, IUIAutomationCondition *cond, int scope, BOOL find_first)
static HRESULT WINAPI uia_iface_ElementFromHandle(IUIAutomation6 *iface, UIA_HWND hwnd, IUIAutomationElement **out_elem)
static HRESULT WINAPI uia_tree_walker_get_Condition(IUIAutomationTreeWalker *iface, IUIAutomationCondition **condition)
static const IUIAutomationPropertyConditionVtbl uia_property_condition_vtbl
static HRESULT WINAPI uia_element_get_CurrentSizeOfSet(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT uia_event_handlers_add_handler(IUnknown *handler_iface, SAFEARRAY *runtime_id, int event_id, struct uia_com_event *event)
static HRESULT WINAPI uia_iface_RemoveNotificationEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationNotificationEventHandler *handler)
static HRESULT WINAPI uia_cache_request_get_AutomationElementMode(IUIAutomationCacheRequest *iface, enum AutomationElementMode *mode)
static HRESULT WINAPI uia_cache_request_put_TreeFilter(IUIAutomationCacheRequest *iface, IUIAutomationCondition *filter)
static ULONG WINAPI uia_or_condition_AddRef(IUIAutomationOrCondition *iface)
static HRESULT WINAPI uia_element_get_CachedIsEnabled(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_cache_request_put_AutomationElementMode(IUIAutomationCacheRequest *iface, enum AutomationElementMode mode)
static HRESULT WINAPI uia_element_BuildUpdatedCache(IUIAutomationElement9 *iface, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **updated_elem)
static HRESULT WINAPI uia_element_get_CurrentPositionInSet(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_cache_request_Clone(IUIAutomationCacheRequest *iface, IUIAutomationCacheRequest **out_req)
static HRESULT WINAPI uia_element_get_CachedOptimizeForVisualContent(IUIAutomationElement9 *iface, BOOL *ret_val)
static const IUIAutomationBoolConditionVtbl uia_bool_condition_vtbl
static HRESULT WINAPI uia_iface_get_ProxyFactoryMapping(IUIAutomation6 *iface, IUIAutomationProxyFactoryMapping **out_factory_map)
static void uia_event_handler_map_entry_destroy(struct uia_event_handler_map_entry *entry)
static HRESULT WINAPI uia_iface_PollForPotentialSupportedPatterns(IUIAutomation6 *iface, IUIAutomationElement *elem, SAFEARRAY **out_pattern_ids, SAFEARRAY **out_pattern_names)
static HRESULT WINAPI uia_element_FindFirstWithOptions(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root, IUIAutomationElement **found)
static ULONG WINAPI uia_not_condition_AddRef(IUIAutomationNotCondition *iface)
static struct uia_element * impl_from_IUIAutomationElement9(IUIAutomationElement9 *iface)
static HRESULT WINAPI uia_iface_AddStructureChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req, IUIAutomationStructureChangedEventHandler *handler)
static int uia_com_event_handler_id_compare(const void *key, const struct rb_entry *entry)
static struct uia_or_condition * impl_from_IUIAutomationOrCondition(IUIAutomationOrCondition *iface)
static HRESULT get_element_variant_from_node_variant(VARIANT *var, BOOL from_cui8, int prop_type)
static HRESULT WINAPI uia_element_get_CurrentLabeledBy(IUIAutomationElement9 *iface, IUIAutomationElement **ret_val)
static HRESULT WINAPI uia_iface_AddEventHandlerGroup(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationEventHandlerGroup *handler_group)
static ULONG WINAPI uia_tree_walker_Release(IUIAutomationTreeWalker *iface)
static HRESULT WINAPI uia_element_get_CurrentIsRequiredForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CachedLocalizedControlType(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_iface_IntSafeArrayToNativeArray(IUIAutomation6 *iface, SAFEARRAY *sa, int **out_arr, int *out_arr_count)
static HRESULT WINAPI uia_element_get_CurrentItemType(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_iface_CreateAndCondition(IUIAutomation6 *iface, IUIAutomationCondition *cond1, IUIAutomationCondition *cond2, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_iface_CreateOrCondition(IUIAutomation6 *iface, IUIAutomationCondition *cond1, IUIAutomationCondition *cond2, IUIAutomationCondition **out_condition)
static const IUIAutomationTreeWalkerVtbl uia_tree_walker_vtbl
static HRESULT WINAPI uia_iface_CreateAndConditionFromArray(IUIAutomation6 *iface, SAFEARRAY *conds, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_element_get_CachedLandmarkType(IUIAutomationElement9 *iface, LANDMARKTYPEID *ret_val)
static HRESULT WINAPI uia_iface_CreateFalseCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_element_get_CachedIsDataValidForForm(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CurrentProcessId(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_iface_CreateNotCondition(IUIAutomation6 *iface, IUIAutomationCondition *cond, IUIAutomationCondition **out_condition)
static HRESULT create_uia_cache_request_iface(IUIAutomationCacheRequest **out_cache_req)
static HRESULT WINAPI uia_not_condition_GetChild(IUIAutomationNotCondition *iface, IUIAutomationCondition **child)
static ULONG WINAPI uia_property_condition_AddRef(IUIAutomationPropertyCondition *iface)
static const IUIAutomation6Vtbl uia_iface_vtbl
static HRESULT WINAPI uia_iface_put_ConnectionRecoveryBehavior(IUIAutomation6 *iface, enum ConnectionRecoveryBehaviorOptions conn_recovery_opts)
static HRESULT WINAPI uia_element_get_CachedAutomationId(IUIAutomationElement9 *iface, BSTR *ret_val)
static struct uia_com_event_handlers com_event_handlers
static HRESULT WINAPI uia_iface_put_ConnectionTimeout(IUIAutomation6 *iface, DWORD timeout)
static HRESULT WINAPI uia_element_GetCurrentMetadataValue(IUIAutomationElement9 *iface, int target_id, METADATAID metadata_id, VARIANT *ret_val)
static HRESULT WINAPI uia_property_condition_get_PropertyConditionFlags(IUIAutomationPropertyCondition *iface, enum PropertyConditionFlags *flags)
static HRESULT WINAPI uia_element_FindAll(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, IUIAutomationElementArray **found)
static HRESULT WINAPI uia_element_get_CachedNativeWindowHandle(IUIAutomationElement9 *iface, UIA_HWND *ret_val)
static HRESULT WINAPI uia_element_array_GetElement(IUIAutomationElementArray *iface, int idx, IUIAutomationElement **out_elem)
static HRESULT uia_com_focus_win_event_callback(struct uia_event *event, void *user_data)
static HRESULT WINAPI uia_tree_walker_NormalizeElementBuildCache(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **normalized)
static HRESULT WINAPI uia_iface_RectToVariant(IUIAutomation6 *iface, RECT rect, VARIANT *out_var)
static HRESULT WINAPI uia_iface_SafeArrayToRectNativeArray(IUIAutomation6 *iface, SAFEARRAY *sa, RECT **out_rect_arr, int *out_rect_arr_count)
static HRESULT WINAPI uia_element_get_CurrentClassName(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CurrentAccessKey(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_ShowContextMenu(IUIAutomationElement9 *iface)
HRESULT uia_com_win_event_callback(DWORD event_id, HWND hwnd, LONG obj_id, LONG child_id, DWORD thread_id, DWORD event_time)
static HRESULT WINAPI uia_element_get_CachedLocalizedLandmarkType(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_tree_walker_GetFirstChildElementBuildCache(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **first)
static HRESULT WINAPI uia_property_condition_get_PropertyId(IUIAutomationPropertyCondition *iface, PROPERTYID *prop_id)
static HRESULT WINAPI uia_element_get_CurrentLiveSetting(IUIAutomationElement9 *iface, enum LiveSetting *ret_val)
static HRESULT WINAPI uia_iface_GetPropertyProgrammaticName(IUIAutomation6 *iface, PROPERTYID prop_id, BSTR *out_name)
static HRESULT WINAPI uia_element_get_CurrentLandmarkType(IUIAutomationElement9 *iface, LANDMARKTYPEID *ret_val)
static const IUIAutomationOrConditionVtbl uia_or_condition_vtbl
static HRESULT WINAPI uia_element_GetCachedPropertyValue(IUIAutomationElement9 *iface, PROPERTYID prop_id, VARIANT *ret_val)
static const IUIAutomationNotConditionVtbl uia_not_condition_vtbl
static HRESULT WINAPI uia_element_get_CurrentAcceleratorKey(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT create_uia_tree_walker(IUIAutomationTreeWalker **out_tree_walker, IUIAutomationCondition *nav_cond)
static HRESULT WINAPI uia_element_get_CachedLevel(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_cache_request_QueryInterface(IUIAutomationCacheRequest *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_iface_CreateOrConditionFromArray(IUIAutomation6 *iface, SAFEARRAY *conds, IUIAutomationCondition **out_condition)
static HRESULT create_uia_element_array_iface(IUIAutomationElementArray **iface, int elements_count)
static HRESULT WINAPI uia_iface_put_TransactionTimeout(IUIAutomation6 *iface, DWORD timeout)
static HRESULT WINAPI uia_cache_request_AddProperty(IUIAutomationCacheRequest *iface, PROPERTYID prop_id)
static HRESULT uia_add_com_event_handler(IUIAutomation6 *iface, EVENTID event_id, IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req, REFIID handler_riid, IUnknown *handler_unk)
static HRESULT WINAPI uia_element_get_CachedIsPassword(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_get_TransactionTimeout(IUIAutomation6 *iface, DWORD *out_timeout)
static HRESULT WINAPI uia_iface_AddFocusChangedEventHandler(IUIAutomation6 *iface, IUIAutomationCacheRequest *cache_req, IUIAutomationFocusChangedEventHandler *handler)
static struct uia_element_array * impl_from_IUIAutomationElementArray(IUIAutomationElementArray *iface)
static HRESULT uia_event_handlers_add_handler_to_event_id_map(struct uia_event_handler_map_entry *event_map)
static HRESULT WINAPI uia_iface_RemoveChangesEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationChangesEventHandler *handler)
static HRESULT uia_remove_com_event_handler(EVENTID event_id, IUIAutomationElement *elem, IUnknown *handler_unk)
static HRESULT WINAPI uia_element_get_CurrentLocalizedControlType(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CurrentLocalizedLandmarkType(IUIAutomationElement9 *iface, BSTR *ret_val)
static ULONG WINAPI uia_or_condition_Release(IUIAutomationOrCondition *iface)
static HRESULT WINAPI uia_element_get_CachedProcessId(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_element_get_CurrentName(IUIAutomationElement9 *iface, BSTR *ret_val)
static BOOL uia_com_focus_handler_advise_node(struct uia_com_event *event, HUIANODE node, HWND hwnd)
static HRESULT WINAPI uia_element_get_CachedFrameworkId(IUIAutomationElement9 *iface, BSTR *ret_val)
static const IUIAutomationCacheRequestVtbl uia_cache_request_vtbl
static HRESULT WINAPI uia_iface_CheckNotSupported(IUIAutomation6 *iface, VARIANT in_val, BOOL *match)
static struct uia_property_condition * impl_from_IUIAutomationPropertyCondition(IUIAutomationPropertyCondition *iface)
static HRESULT WINAPI uia_element_get_CachedSizeOfSet(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_iface_AddPropertyChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req, IUIAutomationPropertyChangedEventHandler *handler, SAFEARRAY *props)
static HRESULT WINAPI uia_element_FindAllWithOptions(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, enum TreeTraversalOptions traversal_opts, IUIAutomationElement *root, IUIAutomationElementArray **found)
static HRESULT WINAPI uia_iface_put_AutoSetFocus(IUIAutomation6 *iface, BOOL auto_set_focus)
static HRESULT WINAPI uia_element_get_CachedIsControlElement(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_get_RawViewCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_element_get_CachedItemType(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CachedItemStatus(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CachedDescribedBy(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT WINAPI uia_iface_PollForPotentialSupportedProperties(IUIAutomation6 *iface, IUIAutomationElement *elem, SAFEARRAY **out_prop_ids, SAFEARRAY **out_prop_names)
static HRESULT WINAPI uia_iface_get_ReservedMixedAttributeValue(IUIAutomation6 *iface, IUnknown **out_unk)
static HRESULT WINAPI uia_element_array_QueryInterface(IUIAutomationElementArray *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_bool_condition_QueryInterface(IUIAutomationBoolCondition *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_element_get_CurrentNativeWindowHandle(IUIAutomationElement9 *iface, UIA_HWND *ret_val)
static HRESULT WINAPI uia_iface_get_ControlViewCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_iface_get_CoalesceEvents(IUIAutomation6 *iface, enum CoalesceEventsOptions *out_coalesce_events_opts)
static HRESULT WINAPI uia_or_condition_GetChildrenAsNativeArray(IUIAutomationOrCondition *iface, IUIAutomationCondition ***out_children, int *out_children_count)
static HRESULT WINAPI uia_element_get_CurrentHasKeyboardFocus(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_tree_walker_GetPreviousSiblingElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationElement **prev)
static HRESULT WINAPI uia_tree_walker_QueryInterface(IUIAutomationTreeWalker *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_element_get_CurrentOptimizeForVisualContent(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CachedPositionInSet(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_iface_get_ConnectionTimeout(IUIAutomation6 *iface, DWORD *out_timeout)
static void uia_variant_rect_to_rect(VARIANT *v, RECT *ret_val)
static void uia_com_focus_win_event_handler(HUIANODE node, HWND hwnd, struct uia_event_handler_event_id_map_entry *event_id_map)
static HRESULT WINAPI uia_element_GetClickablePoint(IUIAutomationElement9 *iface, POINT *clickable, BOOL *got_clickable)
static HRESULT get_uia_condition_struct_from_iface(IUIAutomationCondition *condition, struct UiaCondition **cond_struct)
static void uia_com_focus_win_event_msaa_handler(HWND hwnd, LONG child_id)
static HRESULT WINAPI uia_element_get_CachedAccessKey(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_not_condition_QueryInterface(IUIAutomationNotCondition *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_iface_get_ContentViewWalker(IUIAutomation6 *iface, IUIAutomationTreeWalker **out_walker)
static HRESULT WINAPI uia_element_get_CurrentIsKeyboardFocusable(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_QueryInterface(IUIAutomation6 *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_iface_RemovePropertyChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationPropertyChangedEventHandler *handler)
static HRESULT WINAPI uia_element_get_CachedName(IUIAutomationElement9 *iface, BSTR *ret_val)
static void uia_elem_get_control_type(VARIANT *v, CONTROLTYPEID *ret_val)
static HRESULT WINAPI uia_element_get_CachedLiveSetting(IUIAutomationElement9 *iface, enum LiveSetting *ret_val)
static HRESULT WINAPI uia_element_get_CurrentAriaProperties(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_iface_RemoveStructureChangedEventHandler(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationStructureChangedEventHandler *handler)
static HRESULT uia_get_focused_element(IUIAutomation6 *iface, IUIAutomationCacheRequest *cache_req, BOOL use_default_cache_req, IUIAutomationElement **out_elem)
static HRESULT WINAPI uia_iface_CreateCacheRequest(IUIAutomation6 *iface, IUIAutomationCacheRequest **out_cache_req)
static HRESULT WINAPI uia_iface_CreateTrueCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_tree_walker_GetLastChildElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationElement **last)
static ULONG WINAPI uia_property_condition_Release(IUIAutomationPropertyCondition *iface)
static ULONG WINAPI uia_cache_request_Release(IUIAutomationCacheRequest *iface)
static ULONG WINAPI uia_bool_condition_AddRef(IUIAutomationBoolCondition *iface)
static HRESULT WINAPI uia_iface_put_CoalesceEvents(IUIAutomation6 *iface, enum CoalesceEventsOptions coalesce_events_opts)
static const IUIAutomationElementArrayVtbl uia_element_array_vtbl
static HRESULT WINAPI uia_iface_RemoveEventHandlerGroup(IUIAutomation6 *iface, IUIAutomationElement *elem, IUIAutomationEventHandlerGroup *handler_group)
static HRESULT WINAPI uia_or_condition_QueryInterface(IUIAutomationOrCondition *iface, REFIID riid, void **ppv)
static HRESULT WINAPI uia_tree_walker_GetLastChildElementBuildCache(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **last)
static HRESULT WINAPI uia_element_get_CachedIsKeyboardFocusable(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_ElementFromIAccessible(IUIAutomation6 *iface, IAccessible *acc, int cid, IUIAutomationElement **out_elem)
static ULONG WINAPI uia_element_array_AddRef(IUIAutomationElementArray *iface)
static HRESULT WINAPI uia_iface_AddAutomationEventHandler(IUIAutomation6 *iface, EVENTID event_id, IUIAutomationElement *elem, enum TreeScope scope, IUIAutomationCacheRequest *cache_req, IUIAutomationEventHandler *handler)
static struct uia_not_condition * impl_from_IUIAutomationNotCondition(IUIAutomationNotCondition *iface)
static ULONG WINAPI uia_not_condition_Release(IUIAutomationNotCondition *iface)
static void uia_event_handler_destroy(struct uia_com_event *event)
static HRESULT create_uia_not_condition_iface(IUIAutomationCondition **out_cond, IUIAutomationCondition *in_cond)
static HRESULT WINAPI uia_element_get_CurrentHeadingLevel(IUIAutomationElement9 *iface, HEADINGLEVELID *ret_val)
static HRESULT WINAPI uia_element_get_CachedAriaRole(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_get_CachedAriaProperties(IUIAutomationElement9 *iface, BSTR *ret_val)
static HRESULT WINAPI uia_element_FindAllBuildCache(IUIAutomationElement9 *iface, enum TreeScope scope, IUIAutomationCondition *condition, IUIAutomationCacheRequest *cache_req, IUIAutomationElementArray **found)
static CRITICAL_SECTION com_event_handlers_cs
static HRESULT WINAPI uia_iface_CompareRuntimeIds(IUIAutomation6 *iface, SAFEARRAY *rt_id1, SAFEARRAY *rt_id2, BOOL *match)
static HRESULT WINAPI uia_iface_CreatePropertyCondition(IUIAutomation6 *iface, PROPERTYID prop_id, VARIANT val, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_element_get_CurrentFlowsFrom(IUIAutomationElement9 *iface, IUIAutomationElementArray **ret_val)
static HRESULT WINAPI uia_element_GetCachedPattern(IUIAutomationElement9 *iface, PATTERNID pattern_id, IUnknown **patternObject)
static HRESULT WINAPI uia_bool_condition_get_BooleanValue(IUIAutomationBoolCondition *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CurrentLevel(IUIAutomationElement9 *iface, int *ret_val)
static HRESULT WINAPI uia_element_get_CachedIsContentElement(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_element_get_CurrentAnnotationTypes(IUIAutomationElement9 *iface, SAFEARRAY **ret_val)
static HRESULT WINAPI uia_iface_get_ContentViewCondition(IUIAutomation6 *iface, IUIAutomationCondition **out_condition)
static HRESULT WINAPI uia_element_get_CurrentIsPeripheral(IUIAutomationElement9 *iface, BOOL *ret_val)
static HRESULT WINAPI uia_iface_RemoveAllEventHandlers(IUIAutomation6 *iface)
static HRESULT WINAPI uia_iface_ElementFromIAccessibleBuildCache(IUIAutomation6 *iface, IAccessible *acc, int cid, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **out_elem)
HRESULT uia_add_clientside_event(HUIANODE huianode, EVENTID event_id, enum TreeScope scope, PROPERTYID *prop_ids, int prop_ids_count, struct UiaCacheRequest *cache_req, SAFEARRAY *rt_id, UiaWineEventCallback *cback, void *cback_data, HUIAEVENT *huiaevent)
Definition: uia_event.c:1628
HRESULT uia_event_check_node_within_event_scope(struct uia_event *event, HUIANODE node, SAFEARRAY *rt_id, HUIANODE *clientside_nav_node_out)
Definition: uia_event.c:1814
HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent)
Definition: uia_event.c:1712
BOOL uia_clientside_event_start_event_thread(struct uia_event *event)
Definition: uia_event.c:988
HRESULT create_msaa_provider_from_hwnd(HWND hwnd, int in_child_id, IRawElementProviderSimple **ret_elprov)
Definition: uia_event.c:677
HRESULT uia_event_advise_node(struct uia_event *event, HUIANODE node)
Definition: uia_event.c:1577
HRESULT uia_event_for_each(int event_id, UiaWineEventForEachCallback *callback, void *user_data, BOOL clientside_only)
Definition: uia_event.c:255
HRESULT uia_event_invoke(HUIANODE node, HUIANODE nav_start_node, struct uia_event_args *args, struct uia_event *event)
Definition: uia_event.c:1738
const struct uia_control_type_info * uia_control_type_info_from_id(CONTROLTYPEID control_type_id)
Definition: uia_ids.c:616
const struct uia_prop_info * uia_prop_info_from_id(PROPERTYID prop_id)
Definition: uia_ids.c:332
HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
Definition: uia_main.c:274
HRESULT WINAPI UiaGetReservedNotSupportedValue(IUnknown **value)
Definition: uia_main.c:289
BOOL uia_hwnd_is_visible(HWND hwnd)
Definition: uia_utils.c:391
void uia_hwnd_map_init(struct rb_tree *hwnd_map)
Definition: uia_utils.c:479
HRESULT register_interface_in_git(IUnknown *iface, REFIID riid, DWORD *ret_cookie)
Definition: uia_utils.c:40
HRESULT get_interface_in_git(REFIID riid, DWORD git_cookie, IUnknown **ret_iface)
Definition: uia_utils.c:79
@ NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS
Definition: uia_private.h:59
BOOL uia_hwnd_map_check_hwnd(struct rb_tree *hwnd_map, HWND hwnd)
Definition: uia_utils.c:437
HRESULT uia_hwnd_map_add_hwnd(struct rb_tree *hwnd_map, HWND hwnd)
Definition: uia_utils.c:442
HRESULT get_safearray_bounds(SAFEARRAY *sa, LONG *lbound, LONG *elems)
Definition: uia_utils.c:319
void uia_hwnd_map_destroy(struct rb_tree *hwnd_map)
Definition: uia_utils.c:484
void uia_hwnd_map_remove_hwnd(struct rb_tree *hwnd_map, HWND hwnd)
Definition: uia_utils.c:462
static struct uia_node * impl_from_IWineUiaNode(IWineUiaNode *iface)
Definition: uia_private.h:87
HRESULT unregister_interface_in_git(DWORD git_cookie)
Definition: uia_utils.c:63
@ PROV_METHOD_FLAG_RETURN_NODE_LRES
Definition: uia_private.h:214
int uia_compare_safearrays(SAFEARRAY *sa1, SAFEARRAY *sa2, int prop_type)
Definition: uia_utils.c:334
static BOOL uia_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
Definition: uia_private.h:186
AutomationElementMode
@ AutomationElementMode_Full
@ AutomationElementMode_None
TreeTraversalOptions
CoalesceEventsOptions
ConnectionRecoveryBehaviorOptions
PropertyConditionFlags
@ PropertyConditionFlags_None
@ TreeScope_Descendants
@ TreeScope_Children
@ TreeScope_Subtree
@ TreeScope_Element
OrientationType
int PATTERNID
int EVENTID
int LANDMARKTYPEID
int PROPERTYID
int CONTROLTYPEID
TextEditChangeType
@ NavigateDirection_NextSibling
@ NavigateDirection_PreviousSibling
@ NavigateDirection_Parent
@ NavigateDirection_LastChild
@ NavigateDirection_FirstChild
int METADATAID
int HEADINGLEVELID
#define UIA_E_ELEMENTNOTAVAILABLE
@ NormalizeState_None
@ ConditionType_Not
@ ConditionType_True
@ ConditionType_Or
@ ConditionType_Property
@ ConditionType_False
@ EventArgsType_Simple
Definition: dlist.c:348
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:748
static const WCHAR props[]
Definition: wbemdisp.c:288
#define OBJID_CLIENT
Definition: winable.h:19
BOOL WINAPI GetGUIThreadInfo(DWORD, LPGUITHREADINFO)
Definition: ntwrapper.h:398
#define OBJID_WINDOW
Definition: winable.h:15
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628