ReactOS 0.4.17-dev-573-g8315b8c
main.c
Go to the documentation of this file.
1/*
2 * oleacc tests
3 *
4 * Copyright 2008 Nikolay Sivov
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#define COBJMACROS
22
23#include "wine/test.h"
24#include <stdio.h>
25
26#include "initguid.h"
27#include <ole2.h>
28#include <commctrl.h>
29#include <oleacc.h>
30#include <servprov.h>
31
32#define DEFINE_EXPECT(func) \
33 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
34
35#define SET_EXPECT(func) \
36 do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
37
38#define CHECK_EXPECT2(func) \
39 do { \
40 ok(expect_ ##func, "unexpected call " #func "\n"); \
41 called_ ## func = TRUE; \
42 }while(0)
43
44#define CHECK_EXPECT(func) \
45 do { \
46 CHECK_EXPECT2(func); \
47 expect_ ## func = FALSE; \
48 }while(0)
49
50#define CHECK_CALLED(func) \
51 do { \
52 ok(called_ ## func, "expected " #func "\n"); \
53 expect_ ## func = called_ ## func = FALSE; \
54 }while(0)
55
56DEFINE_EXPECT(winproc_GETOBJECT);
57DEFINE_EXPECT(Accessible_QI_IEnumVARIANT);
63DEFINE_EXPECT(Accessible_child_get_accName);
64DEFINE_EXPECT(Accessible_child_get_accParent);
65DEFINE_EXPECT(Accessible_child_accNavigate);
66
67#define NAVDIR_INTERNAL_HWND 10
68DEFINE_GUID(SID_AccFromDAWrapper, 0x33f139ee, 0xe509, 0x47f7, 0xbf,0x39, 0x83,0x76,0x44,0xf7,0x45,0x76);
69
70static HANDLE (WINAPI *pGetProcessHandleFromHwnd)(HWND);
71
72static BOOL init(void)
73{
74 HMODULE oleacc = GetModuleHandleA("oleacc.dll");
75
76 pGetProcessHandleFromHwnd = (void*)GetProcAddress(oleacc, "GetProcessHandleFromHwnd");
77 if(!pGetProcessHandleFromHwnd) {
78 win_skip("GetProcessHandleFromHwnd not available\n");
79 return FALSE;
80 }
81
82 return TRUE;
83}
84
85static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
86{
87 IUnknown *unk1, *unk2;
88
89 if(iface1 == iface2)
90 return TRUE;
91
92 IUnknown_QueryInterface(iface1, &IID_IUnknown, (void**)&unk1);
93 IUnknown_Release(unk1);
94 IUnknown_QueryInterface(iface2, &IID_IUnknown, (void**)&unk2);
95 IUnknown_Release(unk2);
96 return unk1 == unk2;
97}
98
99static struct Accessible
100{
104
109
110static inline struct Accessible* impl_from_Accessible(IAccessible *iface)
111{
112 return CONTAINING_RECORD(iface, struct Accessible, IAccessible_iface);
113}
114
116 IAccessible *iface, REFIID riid, void **ppvObject)
117{
118 struct Accessible *This = impl_from_Accessible(iface);
119
122 IsEqualIID(riid, &IID_IAccessible)) {
123 IAccessible_AddRef(iface);
124 *ppvObject = iface;
125 return S_OK;
126 }
127
129 *ppvObject = &This->IOleWindow_iface;
130 IOleWindow_AddRef(&This->IOleWindow_iface);
131 return S_OK;
132 }
133
134 if(IsEqualIID(riid, &IID_IEnumVARIANT)) {
135 CHECK_EXPECT(Accessible_QI_IEnumVARIANT);
136 return E_NOINTERFACE;
137 }
138
139 return E_NOINTERFACE;
140}
141
143{
144 struct Accessible *This = impl_from_Accessible(iface);
145 return InterlockedIncrement(&This->ref);
146}
147
149{
150 struct Accessible *This = impl_from_Accessible(iface);
151 return InterlockedDecrement(&This->ref);
152}
153
155 IAccessible *iface, UINT *pctinfo)
156{
157 ok(0, "unexpected call\n");
158 return E_NOTIMPL;
159}
160
162 UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
163{
164 ok(0, "unexpected call\n");
165 return E_NOTIMPL;
166}
167
169 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
170{
171 ok(0, "unexpected call\n");
172 return E_NOTIMPL;
173}
174
176 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
177 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
178{
179 ok(0, "unexpected call\n");
180 return E_NOTIMPL;
181}
182
184 IAccessible *iface, IDispatch **ppdispParent)
185{
186 struct Accessible *This = impl_from_Accessible(iface);
187
188 if(This == &Accessible_child)
189 CHECK_EXPECT(Accessible_child_get_accParent);
190 else
192
193 if(This->parent)
194 {
195 return IAccessible_QueryInterface(This->parent, &IID_IDispatch,
196 (void **)ppdispParent);
197 }
198 *ppdispParent = NULL;
199 return S_FALSE;
200}
201
203 IAccessible *iface, LONG *pcountChildren)
204{
205 struct Accessible *This = impl_from_Accessible(iface);
206
207 ok(This == &Accessible, "unexpected call\n");
209 *pcountChildren = 1;
210 return S_OK;
211}
212
214 VARIANT varChildID, IDispatch **ppdispChild)
215{
216 struct Accessible *This = impl_from_Accessible(iface);
217
218 ok(This == &Accessible, "unexpected call\n");
220 ok(V_VT(&varChildID) == VT_I4, "V_VT(&varChildID) = %d\n", V_VT(&varChildID));
221
222 switch(V_I4(&varChildID))
223 {
224 case 1:
225 *ppdispChild = NULL;
226 return S_OK;
227 case 2:
228 *ppdispChild = NULL;
229 return S_FALSE;
230 case 3:
231 *ppdispChild = (IDispatch*)&Accessible_child.IAccessible_iface;
232 IDispatch_AddRef(*ppdispChild);
233 return S_OK;
234 case 4:
235 *ppdispChild = (IDispatch*)&Accessible_child.IAccessible_iface;
236 IDispatch_AddRef(*ppdispChild);
237 return S_FALSE;
238 default:
239 ok(0, "unexpected call\n");
240 return E_NOTIMPL;
241 }
242}
243
245 VARIANT varID, BSTR *pszName)
246{
247 struct Accessible *This = impl_from_Accessible(iface);
248
249 if(This == &Accessible_child)
250 CHECK_EXPECT(Accessible_child_get_accName);
251 else
253
254 ok(!pszName, "pszName != NULL\n");
255 return E_INVALIDARG;
256}
257
259 VARIANT varID, BSTR *pszValue)
260{
261 ok(0, "unexpected call\n");
262 return E_NOTIMPL;
263}
264
266 VARIANT varID, BSTR *pszDescription)
267{
268 ok(0, "unexpected call\n");
269 return E_NOTIMPL;
270}
271
273 VARIANT varID, VARIANT *pvarRole)
274{
275 ok(0, "unexpected call\n");
276 return E_NOTIMPL;
277}
278
280 VARIANT varID, VARIANT *pvarState)
281{
282 ok(0, "unexpected call\n");
283 return E_NOTIMPL;
284}
285
287 VARIANT varID, BSTR *pszHelp)
288{
289 ok(0, "unexpected call\n");
290 return E_NOTIMPL;
291}
292
294 BSTR *pszHelpFile, VARIANT varID, LONG *pidTopic)
295{
296 ok(0, "unexpected call\n");
297 return E_NOTIMPL;
298}
299
301 VARIANT varID, BSTR *pszKeyboardShortcut)
302{
303 ok(0, "unexpected call\n");
304 return E_NOTIMPL;
305}
306
308{
309 ok(0, "unexpected call\n");
310 return E_NOTIMPL;
311}
312
314 IAccessible *iface, VARIANT *pvarID)
315{
316 ok(0, "unexpected call\n");
317 return E_NOTIMPL;
318}
319
321 VARIANT varID, BSTR *pszDefaultAction)
322{
323 ok(0, "unexpected call\n");
324 return E_NOTIMPL;
325}
326
328 LONG flagsSelect, VARIANT varID)
329{
330 ok(0, "unexpected call\n");
331 return E_NOTIMPL;
332}
333
335 LONG *pyTop, LONG *pcxWidth, LONG *pcyHeight, VARIANT varID)
336{
337 ok(0, "unexpected call\n");
338 return E_NOTIMPL;
339}
340
342 LONG navDir, VARIANT varStart, VARIANT *pvarEnd)
343{
344 struct Accessible *This = impl_from_Accessible(iface);
345
346 if(This == &Accessible_child)
347 CHECK_EXPECT(Accessible_child_accNavigate);
348 else
350
351 /*
352 * Magic number value for retrieving an HWND. Used by DynamicAnnotation
353 * IAccessible wrapper.
354 */
355 if(navDir == NAVDIR_INTERNAL_HWND) {
356 V_VT(pvarEnd) = VT_I4;
357 V_I4(pvarEnd) = HandleToULong(This->acc_hwnd);
358 return V_I4(pvarEnd) ? S_OK : S_FALSE;
359 }
360
361 return E_NOTIMPL;
362}
363
365 LONG xLeft, LONG yTop, VARIANT *pvarID)
366{
367 ok(0, "unexpected call\n");
368 return E_NOTIMPL;
369}
370
372 IAccessible *iface, VARIANT varID)
373{
374 ok(0, "unexpected call\n");
375 return E_NOTIMPL;
376}
377
379 VARIANT varID, BSTR pszName)
380{
381 ok(0, "unexpected call\n");
382 return E_NOTIMPL;
383}
384
386 VARIANT varID, BSTR pszValue)
387{
388 ok(0, "unexpected call\n");
389 return E_NOTIMPL;
390}
391
392static IAccessibleVtbl AccessibleVtbl = {
421};
422
423static inline struct Accessible* impl_from_OleWindow(IOleWindow *iface)
424{
425 return CONTAINING_RECORD(iface, struct Accessible, IOleWindow_iface);
426}
427
429{
430 struct Accessible *This = impl_from_OleWindow(iface);
431 return IAccessible_QueryInterface(&This->IAccessible_iface, riid, obj);
432}
433
435{
436 struct Accessible *This = impl_from_OleWindow(iface);
437 return IAccessible_AddRef(&This->IAccessible_iface);
438}
439
441{
442 struct Accessible *This = impl_from_OleWindow(iface);
443 return IAccessible_Release(&This->IAccessible_iface);
444}
445
447{
448 struct Accessible *This = impl_from_OleWindow(iface);
449
450 *hwnd = This->ow_hwnd;
451 return *hwnd ? S_OK : E_FAIL;
452}
453
455{
456 ok(0, "unexpected call\n");
457 return E_NOTIMPL;
458}
459
460static const IOleWindowVtbl OleWindowVtbl = {
466};
467
468static struct Accessible Accessible =
469{
470 { &AccessibleVtbl },
471 { &OleWindowVtbl },
472 1,
473 NULL,
474 0, 0
475};
477{
478 { &AccessibleVtbl },
479 { &OleWindowVtbl },
480 1,
482 0, 0
483};
484
485static void test_getroletext(void)
486{
487 INT ret, role;
488 CHAR buf[2], *buff;
489 WCHAR bufW[2], *buffW;
490
491 /* wrong role number */
492 ret = GetRoleTextA(-1, NULL, 0);
493 ok(ret == 0, "GetRoleTextA doesn't return zero on wrong role number, got %d\n", ret);
494 buf[0] = '*';
495 ret = GetRoleTextA(-1, buf, 2);
496 ok(ret == 0, "GetRoleTextA doesn't return zero on wrong role number, got %d\n", ret);
497 ok(buf[0] == 0, "GetRoleTextA doesn't return NULL char on wrong role number\n");
498 buf[0] = '*';
499 ret = GetRoleTextA(-1, buf, 0);
500 ok(ret == 0, "GetRoleTextA doesn't return zero on wrong role number, got %d\n", ret);
501 ok(buf[0] == '*', "GetRoleTextA modified buffer on wrong role number\n");
502
503 ret = GetRoleTextW(-1, NULL, 0);
504 ok(ret == 0, "GetRoleTextW doesn't return zero on wrong role number, got %d\n", ret);
505 bufW[0] = '*';
506 ret = GetRoleTextW(-1, bufW, 2);
507 ok(ret == 0, "GetRoleTextW doesn't return zero on wrong role number, got %d\n", ret);
508 ok(bufW[0] == '\0', "GetRoleTextW doesn't return NULL char on wrong role number\n");
509 bufW[0] = '*';
510 ret = GetRoleTextW(-1, bufW, 0);
511 ok(ret == 0, "GetRoleTextW doesn't return zero on wrong role number, got %d\n", ret);
512
513 /* zero role number - not documented */
514 ret = GetRoleTextA(0, NULL, 0);
515 ok(ret > 0, "GetRoleTextA doesn't return (>0) for zero role number, got %d\n", ret);
516 ret = GetRoleTextW(0, NULL, 0);
517 ok(ret > 0, "GetRoleTextW doesn't return (>0) for zero role number, got %d\n", ret);
518
519 /* NULL buffer, return length */
520 ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, NULL, 0);
521 ok(ret > 0, "GetRoleTextA doesn't return length on NULL buffer, got %d\n", ret);
522 ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, NULL, 1);
523 ok(ret > 0, "GetRoleTextA doesn't return length on NULL buffer, got %d\n", ret);
524 ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, NULL, 0);
525 ok(ret > 0, "GetRoleTextW doesn't return length on NULL buffer, got %d\n", ret);
526 ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, NULL, 1);
527 ok(ret > 0, "GetRoleTextW doesn't return length on NULL buffer, got %d\n", ret);
528
529 /* use a smaller buffer */
530 bufW[0] = '*';
531 ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, buf, 0);
532 ok(!ret, "GetRoleTextA doesn't return 0, got %d\n", ret);
533 ok(buf[0] == '*', "GetRoleTextA modified buffer\n");
534 buffW = NULL;
535 ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, (WCHAR*)&buffW, 0);
536 ok(ret, "GetRoleTextW doesn't return length\n");
537 ok(buffW != NULL, "GetRoleTextW doesn't modify buffer\n");
538 buf[0] = '*';
539 ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, buf, 1);
540 ok(ret == 0, "GetRoleTextA returned wrong length\n");
541 ok(buf[0] == '\0', "GetRoleTextA returned not zero-length buffer\n");
542 buf[0] = '*';
543 ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, buf, 2);
544 ok(!ret, "GetRoleTextA returned wrong length, got %d, expected 0\n", ret);
545 ok(!buf[0] || broken(buf[0]!='*') /* WinXP */,
546 "GetRoleTextA returned not zero-length buffer : (%c)\n", buf[0]);
547
548 bufW[0] = '*';
549 ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, bufW, 1);
550 ok(ret == 0, "GetRoleTextW returned wrong length, got %d, expected 1\n", ret);
551 ok(bufW[0] == '\0', "GetRoleTextW returned not zero-length buffer\n");
552 bufW[1] = '*';
553 ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, bufW, 2);
554 ok(ret == 1, "GetRoleTextW returned wrong length, got %d, expected 1\n", ret);
555 ok(bufW[1] == '\0', "GetRoleTextW returned not zero-length buffer\n");
556
557 /* use bigger buffer */
558 ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, NULL, 0);
559 buff = HeapAlloc(GetProcessHeap(), 0, 2*ret);
560 buff[2*ret-1] = '*';
561 ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, buff, 2*ret);
562 ok(buff[2*ret-1] == '*', "GetRoleTextA shouldn't modify this part of buffer\n");
564
565 ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, NULL, 0);
566 buffW = HeapAlloc(GetProcessHeap(), 0, 2*ret*sizeof(WCHAR));
567 buffW[2*ret-1] = '*';
568 ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, buffW, 2*ret);
569 ok(buffW[2*ret-1] == '*', "GetRoleTextW shouldn't modify this part of buffer\n");
570 HeapFree(GetProcessHeap(), 0, buffW);
571
572 /* check returned length for all roles */
573 for(role = 0; role <= ROLE_SYSTEM_OUTLINEBUTTON; role++){
574 CHAR buff2[100];
575 WCHAR buff2W[100];
576
577 /* NT4 and W2K don't clear the buffer on a nonexistent role in the A-call */
578 memset(buff2, 0, sizeof(buff2));
579
580 ret = GetRoleTextA(role, NULL, 0);
581 ok(ret > 0, "Expected the role to be present\n");
582
583 GetRoleTextA(role, buff2, sizeof(buff2));
584 ok(ret == lstrlenA(buff2),
585 "GetRoleTextA: returned length doesn't match returned buffer for role %d\n", role);
586
587 /* Win98 and WinMe don't clear the buffer on a nonexistent role in the W-call */
588 memset(buff2W, 0, sizeof(buff2W));
589
590 ret = GetRoleTextW(role, NULL, 0);
591 GetRoleTextW(role, buff2W, ARRAY_SIZE(buff2W));
592 ok(ret == lstrlenW(buff2W),
593 "GetRoleTextW: returned length doesn't match returned buffer for role %d\n", role);
594 }
595}
596
597static void test_GetStateText(void)
598{
599 WCHAR buf[1024], buf2[1024];
600 char bufa[1024];
601 void *ptr;
602 UINT ret, ret2;
603 int i;
604
605 ret2 = GetStateTextW(0, NULL, 1024);
606 ok(ret2, "GetStateText failed\n");
607
608 ptr = NULL;
609 ret = GetStateTextW(0, (WCHAR*)&ptr, 0);
610 ok(ret == ret2, "got %d, expected %d\n", ret, ret2);
611 ok(ptr != NULL, "ptr was not changed\n");
612
613 ret = GetStateTextW(0, buf, 1024);
614 ok(ret == ret2, "got %d, expected %d\n", ret, ret2);
615 ok(!memcmp(buf, ptr, ret*sizeof(WCHAR)), "got %s, expected %s\n",
617
618 ret = GetStateTextW(0, buf, 1);
619 ok(!ret, "got %d, expected 0\n", ret);
620 ok(!buf[0], "buf[0] = '%c'\n", buf[0]);
621
622 for(i=0; i<31; i++) {
623 ret = GetStateTextW(1<<i, buf, 1024);
624 ok(ret, "%d) GetStateText failed\n", i);
625 }
626 ret = GetStateTextW(1u<<31, buf, 1024);
627 ok(!ret, "31) GetStateText succeeded: %d\n", ret);
628
629 ret = GetStateTextW(2, buf, 1024);
630 ok(ret, "GetStateText failed\n");
631 ret2 = GetStateTextW(3, buf2, 1024);
632 ok(ret2, "GetStateText failed\n");
633 ok(ret == ret2, "got %d, expected %d\n", ret2, ret);
634 ok(!memcmp(buf, buf2, ret*sizeof(WCHAR)),
635 "GetStateText(2,...) returned different data than GetStateText(3,...)\n");
636
637 ret2 = GetStateTextA(0, NULL, 1024);
638 ok(ret2, "GetStateText failed\n");
639
640 ptr = NULL;
641 ret = GetStateTextA(0, (CHAR*)&ptr, 0);
642 ok(!ret, "got %d\n", ret);
643 ok(ptr == NULL, "ptr was changed\n");
644
645 ret = GetStateTextA(0, NULL, 0);
646 ok(ret == ret2, "got %d, expected %d\n", ret, ret2);
647
648 ret = GetStateTextA(0, bufa, 1024);
649 ok(ret == ret2, "got %d, expected %d\n", ret, ret2);
650
651 ret = GetStateTextA(0, bufa, 1);
652 ok(!ret, "got %d, expected 0\n", ret);
653 ok(!bufa[0], "bufa[0] = '%c'\n", bufa[0]);
654
655 for(i=0; i<31; i++) {
656 ret = GetStateTextA(1<<i, bufa, 1024);
657 ok(ret, "%d) GetStateText failed\n", i);
658 }
659 ret = GetStateTextA(1u<<31, bufa, 1024);
660 ok(!ret, "31) GetStateText succeeded: %d\n", ret);
661}
662
663static LONG Object_ref = 1;
665{
667 *ppv = iface;
668 IUnknown_AddRef(iface);
669 return S_OK;
670 }
671 /* on Win7 AccessibleObjectFromEvent doesn't check return value */
672 *ppv = NULL;
673 return E_NOINTERFACE;
674}
675
677{
679}
680
682{
684}
685
686static IUnknownVtbl ObjectVtbl = {
690};
691
693
694static void test_LresultFromObject(const char *name)
695{
698 char cmdline[MAX_PATH];
699 IUnknown *unk;
701 LRESULT lres;
702
703 lres = LresultFromObject(NULL, 0, 0);
704 ok(lres == E_INVALIDARG, "got %Ix\n", lres);
705
706 hres = ObjectFromLresult(0, &IID_IUnknown, 0, (void**)&unk);
707 ok(hres == E_FAIL, "got %lx\n", hres);
708 hres = ObjectFromLresult(0x10000, &IID_IUnknown, 0, (void**)&unk);
709 ok(hres == E_FAIL, "got %lx\n", hres);
710
711 ok(Object_ref == 1, "Object_ref = %ld\n", Object_ref);
713 ok(SUCCEEDED(lres), "got %Ix\n", lres);
714 ok(Object_ref > 1, "Object_ref = %ld\n", Object_ref);
715
716 hres = ObjectFromLresult(lres, &IID_IUnknown, 0, (void**)&unk);
717 ok(hres == S_OK, "hres = %lx\n", hres);
718 ok(unk == &Object, "unk != &Object\n");
719 IUnknown_Release(unk);
720 ok(Object_ref == 1, "Object_ref = %ld\n", Object_ref);
721
723 ok(SUCCEEDED(lres), "got %Ix\n", lres);
724 ok(Object_ref > 1, "Object_ref = %ld\n", Object_ref);
725
726 sprintf(cmdline, "\"%s\" main ObjectFromLresult %s", name, wine_dbgstr_longlong(lres));
727 memset(&startup, 0, sizeof(startup));
728 startup.cb = sizeof(startup);
730 wait_child_process(proc.hProcess);
731 ok(Object_ref == 1, "Object_ref = %ld\n", Object_ref);
732}
733
735{
736 switch(msg) {
737 case WM_GETOBJECT:
738 if(lparam == OBJID_QUERYCLASSNAMEIDX) {
739 ok(!wparam, "wparam = %Ix\n", wparam);
740 return 0;
741 }
742
743 ok(wparam==0xffffffff, "wparam = %Ix\n", wparam);
745 return E_UNEXPECTED;
749 return 0;
750 if(lparam == 1)
752
753 ok(0, "unexpected (%Id)\n", lparam);
754 return 0;
755 }
756
758}
759
761{
762 WNDCLASSA cls;
763
764 memset(&cls, 0, sizeof(cls));
766 cls.lpszClassName = "oleacc_test";
768
769 return RegisterClassA(&cls);
770}
771
772static void unregister_window_class(void)
773{
774 UnregisterClassA("oleacc_test", NULL);
775}
776
778{
779 IUnknown *unk;
780 HRESULT hr;
781 HWND hwnd;
782
784 ok(hr == E_INVALIDARG, "got %lx\n", hr);
785
787 todo_wine ok(hr == S_OK, "got %lx\n", hr);
788 if(hr == S_OK) IUnknown_Release(unk);
789
790 hwnd = CreateWindowA("oleacc_test", "test", WS_OVERLAPPEDWINDOW,
791 0, 0, 0, 0, NULL, NULL, NULL, NULL);
792 ok(hwnd != NULL, "CreateWindow failed\n");
793
795 ok(hr == E_UNEXPECTED, "got %lx\n", hr);
796
797 ok(Object_ref == 1, "Object_ref = %ld\n", Object_ref);
799 ok(hr == S_OK, "got %lx\n", hr);
800 ok(Object_ref == 2, "Object_ref = %ld\n", Object_ref);
801 IUnknown_Release(unk);
802
804}
805
807{
808 IAccessible *acc, *acc2;
810 VARIANT cid;
811 HRESULT hr;
812 HWND hwnd;
813
814 hwnd = CreateWindowA("oleacc_test", "test", WS_OVERLAPPEDWINDOW,
815 0, 0, 0, 0, NULL, NULL, NULL, NULL);
816 ok(hwnd != NULL, "CreateWindow failed\n");
817
819 ok(hr == E_FAIL, "got %#lx\n", hr);
820
822 ok(hr == E_INVALIDARG, "got %#lx\n", hr);
823
824 acc = (IAccessible*)0xdeadbeef;
825 V_VT(&cid) = VT_UNKNOWN;
826 V_UNKNOWN(&cid) = (IUnknown*)0xdeadbeef;
828 ok(hr == E_NOINTERFACE || broken(hr == S_OK), "got %#lx\n", hr);
829 if (hr == S_OK)
830 IAccessible_Release(acc);
831 else
832 {
833 ok(acc == NULL, "Unexpected acc %p\n", acc);
834 ok(V_VT(&cid) == VT_EMPTY, "got %#x, expected %#x\n", V_VT(&cid), VT_I4);
835 }
836
838 ok(hr == E_UNEXPECTED, "got %#lx\n", hr);
839
841 hr = AccessibleObjectFromEvent(hwnd, 1, 1, &acc, &cid);
843 ok(hr == S_OK, "got %#lx\n", hr);
844 todo_wine ok(!iface_cmp((IUnknown*)acc, (IUnknown*)&Accessible), "acc == &Accessible\n");
845 /* Get &Accessible out of the Dynamic Annotation IAccessible wrapper. */
846 if (!iface_cmp((IUnknown*)acc, (IUnknown*)&Accessible))
847 {
848 hr = IAccessible_QueryInterface(acc, &IID_IServiceProvider, (void **)&sp);
849 ok(hr == S_OK, "got %#lx\n", hr);
850 ok(!!sp, "sp == NULL\n");
851
852 hr = IServiceProvider_QueryService(sp, &SID_AccFromDAWrapper, &IID_IAccessible,
853 (void**)&acc2);
854 ok(hr == S_OK, "got %#lx\n", hr);
855 ok(iface_cmp((IUnknown*)acc2, (IUnknown*)&Accessible), "acc != &Accessible\n");
856 IAccessible_Release(acc2);
857 IServiceProvider_Release(sp);
858 }
859
860 ok(V_VT(&cid) == VT_I4, "got %#x, expected %#x\n", V_VT(&cid), VT_I4);
861 ok(V_I4(&cid) == 1, "got %#lx, expected 1\n", V_I4(&cid));
864 V_I4(&cid) = 0;
865 hr = IAccessible_get_accName(acc, cid, NULL);
866 ok(hr == E_INVALIDARG, "get_accName returned %lx\n", hr);
869 IAccessible_Release(acc);
870
872 hr = AccessibleObjectFromEvent(hwnd, 1, 2, &acc, &cid);
874 ok(hr == S_OK, "got %#lx\n", hr);
875 todo_wine ok(!iface_cmp((IUnknown*)acc, (IUnknown*)&Accessible), "acc == &Accessible\n");
876 ok(V_VT(&cid) == VT_I4, "got %#x, expected %#x\n", V_VT(&cid), VT_I4);
877 ok(V_I4(&cid) == 2, "got %#lx, expected 2\n", V_I4(&cid));
880 V_I4(&cid) = 0;
881 hr = IAccessible_get_accName(acc, cid, NULL);
882 ok(hr == E_INVALIDARG, "get_accName returned %lx\n", hr);
885 IAccessible_Release(acc);
886
888 hr = AccessibleObjectFromEvent(hwnd, 1, 3, &acc, &cid);
890 ok(hr == S_OK, "got %#lx\n", hr);
891 todo_wine ok(!iface_cmp((IUnknown*)acc, (IUnknown*)&Accessible_child), "acc == &Accessible_child\n");
892 ok(V_VT(&cid) == VT_I4, "got %#x, expected %#x\n", V_VT(&cid), VT_I4);
893 ok(V_I4(&cid) == CHILDID_SELF, "got %#lx, expected %#x\n", V_I4(&cid), CHILDID_SELF);
894 SET_EXPECT(Accessible_child_get_accParent);
895 SET_EXPECT(Accessible_child_get_accName);
896 hr = IAccessible_get_accName(acc, cid, NULL);
897 ok(hr == E_INVALIDARG, "get_accName returned %lx\n", hr);
898 todo_wine CHECK_CALLED(Accessible_child_get_accParent);
899 CHECK_CALLED(Accessible_child_get_accName);
900 IAccessible_Release(acc);
901
903 hr = AccessibleObjectFromEvent(hwnd, 1, 4, &acc, &cid);
905 ok(hr == S_OK, "got %#lx\n", hr);
906 ok(acc == &Accessible_child.IAccessible_iface, "acc != &Accessible_child\n");
907 ok(V_VT(&cid) == VT_I4, "got %#x, expected %#x\n", V_VT(&cid), VT_I4);
908 ok(V_I4(&cid) == CHILDID_SELF, "got %#lx, expected %#x\n", V_I4(&cid), CHILDID_SELF);
909 SET_EXPECT(Accessible_child_get_accName);
910 hr = IAccessible_get_accName(acc, cid, NULL);
911 ok(hr == E_INVALIDARG, "get_accName returned %lx\n", hr);
912 CHECK_CALLED(Accessible_child_get_accName);
913 IAccessible_Release(acc);
914
916 ok(Accessible.ref == 1, "Accessible.ref = %ld\n", Accessible.ref);
917 ok(Accessible_child.ref == 1, "Accessible.ref = %ld\n", Accessible_child.ref);
918}
919
921{
922 HANDLE proc;
923 HWND hwnd;
924
925 proc = pGetProcessHandleFromHwnd(NULL);
926 ok(!proc, "proc = %p\n", proc);
927
928 hwnd = CreateWindowA("static", "", 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
929 ok(hwnd != NULL, "CreateWindow failed\n");
930
931 proc = pGetProcessHandleFromHwnd(hwnd);
932 ok(proc != NULL, "proc == NULL\n");
934
936}
937
939{
940 VARIANT children[3];
941 LONG count;
942 HRESULT hr;
943
944 count = -1;
945 hr = AccessibleChildren(NULL, 0, 0, children, &count);
946 ok(hr == E_INVALIDARG, "AccessibleChildren returned %lx\n", hr);
947 ok(count == -1, "count = %ld\n", count);
948 hr = AccessibleChildren(acc, 0, 0, NULL, &count);
949 ok(hr == E_INVALIDARG, "AccessibleChildren returned %lx\n", hr);
950 ok(count == -1, "count = %ld\n", count);
951 hr = AccessibleChildren(acc, 0, 0, children, NULL);
952 ok(hr == E_INVALIDARG, "AccessibleChildren returned %lx\n", hr);
953
954 if(acc == &Accessible.IAccessible_iface) {
955 SET_EXPECT(Accessible_QI_IEnumVARIANT);
957 }
958 hr = AccessibleChildren(acc, 0, 0, children, &count);
959 ok(hr == S_OK, "AccessibleChildren returned %lx\n", hr);
960 if(acc == &Accessible.IAccessible_iface) {
961 CHECK_CALLED(Accessible_QI_IEnumVARIANT);
963 }
964 ok(!count, "count = %ld\n", count);
965 count = -1;
966 if(acc == &Accessible.IAccessible_iface) {
967 SET_EXPECT(Accessible_QI_IEnumVARIANT);
969 }
970 hr = AccessibleChildren(acc, 5, 0, children, &count);
971 ok(hr == S_OK, "AccessibleChildren returned %lx\n", hr);
972 if(acc == &Accessible.IAccessible_iface) {
973 CHECK_CALLED(Accessible_QI_IEnumVARIANT);
975 }
976 ok(!count, "count = %ld\n", count);
977
978 memset(children, 0xfe, sizeof(children));
979 V_VT(children) = VT_DISPATCH;
980 if(acc == &Accessible.IAccessible_iface) {
981 SET_EXPECT(Accessible_QI_IEnumVARIANT);
984 }
985 hr = AccessibleChildren(acc, 0, 1, children, &count);
986 ok(hr == S_OK, "AccessibleChildren returned %lx\n", hr);
987 if(acc == &Accessible.IAccessible_iface) {
988 CHECK_CALLED(Accessible_QI_IEnumVARIANT);
991
992 ok(V_VT(children) == VT_I4, "V_VT(children) = %d\n", V_VT(children));
993 ok(V_I4(children) == 1, "V_I4(children) = %ld\n", V_I4(children));
994 }else {
995 ok(V_VT(children) == VT_DISPATCH, "V_VT(children) = %d\n", V_VT(children));
996 IDispatch_Release(V_DISPATCH(children));
997 }
998 ok(count == 1, "count = %ld\n", count);
999
1000 if(acc == &Accessible.IAccessible_iface) {
1001 SET_EXPECT(Accessible_QI_IEnumVARIANT);
1004 }
1005 hr = AccessibleChildren(acc, 0, 3, children, &count);
1006 ok(hr == S_FALSE, "AccessibleChildren returned %lx\n", hr);
1007 if(acc == &Accessible.IAccessible_iface) {
1008 CHECK_CALLED(Accessible_QI_IEnumVARIANT);
1011
1012 ok(V_VT(children) == VT_I4, "V_VT(children) = %d\n", V_VT(children));
1013 ok(V_I4(children) == 1, "V_I4(children) = %ld\n", V_I4(children));
1014
1015 ok(count == 1, "count = %ld\n", count);
1016 ok(V_VT(children+1) == VT_EMPTY, "V_VT(children+1) = %d\n", V_VT(children+1));
1017 }else {
1018 ok(V_VT(children) == VT_DISPATCH, "V_VT(children) = %d\n", V_VT(children));
1019 IDispatch_Release(V_DISPATCH(children));
1020
1021 ok(count == 2, "count = %ld\n", count);
1022 ok(V_VT(children+1) == VT_DISPATCH, "V_VT(children+1) = %d\n", V_VT(children+1));
1023 IDispatch_Release(V_DISPATCH(children+1));
1024 }
1025 ok(V_VT(children+2) == VT_EMPTY, "V_VT(children+2) = %d\n", V_VT(children+2));
1026
1027 ok(Accessible.ref == 1, "Accessible.ref = %ld\n", Accessible.ref);
1028 ok(Accessible_child.ref == 1, "Accessible.ref = %ld\n", Accessible_child.ref);
1029}
1030
1031#define check_acc_state(acc, state) _check_acc_state(__LINE__, acc, state)
1032static void _check_acc_state(unsigned line, IAccessible *acc, INT state)
1033{
1034 VARIANT vid, v;
1035 HRESULT hr;
1036
1037 V_VT(&vid) = VT_I4;
1038 V_I4(&vid) = CHILDID_SELF;
1039 hr = IAccessible_get_accState(acc, vid, &v);
1040 ok_(__FILE__, line)(hr == S_OK, "got %lx\n", hr);
1041 ok_(__FILE__, line)(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1042 ok_(__FILE__, line)(V_I4(&v) == state, "V_I4(&v) = %lx\n", V_I4(&v));
1043}
1044
1045#define check_acc_hwnd(unk, hwnd) _check_acc_hwnd(__LINE__, unk, hwnd)
1046static void _check_acc_hwnd(unsigned line, IUnknown *unk, HWND exp)
1047{
1048 IOleWindow *ow;
1049 HRESULT hr;
1050 HWND hwnd;
1051
1052 hr = IUnknown_QueryInterface(unk, &IID_IOleWindow, (void**)&ow);
1053 ok_(__FILE__, line)(hr == S_OK, "got %lx\n", hr);
1054 hr = IOleWindow_GetWindow(ow, &hwnd);
1055 ok_(__FILE__, line)(hr == S_OK, "got %lx\n", hr);
1056 ok_(__FILE__, line)(hwnd == exp, "hwnd = %p, expected %p\n", hwnd, exp);
1057 IOleWindow_Release(ow);
1058}
1059
1061{
1062 IAccessible *acc = param;
1063 IOleWindow *ow;
1064 HRESULT hr;
1065 HWND hwnd;
1066
1067 hr = IAccessible_QueryInterface(acc, &IID_IOleWindow, (void**)&ow);
1068 ok(hr == S_OK, "got %lx\n", hr);
1069 hr = IOleWindow_GetWindow(ow, &hwnd);
1070 ok(hr == S_OK, "got %lx\n", hr);
1071 IOleWindow_Release(ow);
1072
1075 return 0;
1076}
1077
1079{
1080 IAccessible *acc, *win;
1081 IDispatch *disp;
1082 IEnumVARIANT *ev;
1083 HWND chld, chld2, btn, hwnd, hwnd2;
1084 HRESULT hr;
1085 VARIANT vid, v;
1086 BSTR str;
1087 POINT pt;
1088 RECT rect;
1089 LONG l, left, top, width, height;
1090 ULONG fetched;
1091 HANDLE thread;
1092
1093 hwnd = CreateWindowA("oleacc_test", "wnd &t &junk", WS_OVERLAPPEDWINDOW,
1094 0, 0, 100, 100, NULL, NULL, NULL, NULL);
1095 ok(hwnd != NULL, "CreateWindow failed\n");
1096 chld = CreateWindowA("static", "static &t &junk", WS_CHILD | WS_VISIBLE,
1097 0, 0, 50, 50, hwnd, NULL, NULL, NULL);
1098 ok(chld != NULL, "CreateWindow failed\n");
1099 btn = CreateWindowA("BUTTON", "btn &t &junk", WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
1100 50, 0, 50, 50, hwnd, NULL, NULL, NULL);
1101 ok(btn != NULL, "CreateWindow failed\n");
1102 chld2 = CreateWindowA("static", "static &t &junk", WS_CHILD | WS_VISIBLE,
1103 0, 0, 50, 50, chld, NULL, NULL, NULL);
1104 ok(chld2 != NULL, "CreateWindow failed\n");
1105
1106 hr = CreateStdAccessibleObject(NULL, OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1107 ok(hr == E_FAIL, "got %lx\n", hr);
1108
1109
1110 /* Test the static message */
1111 hr = CreateStdAccessibleObject(chld, OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1112 ok(hr == S_OK, "got %lx\n", hr);
1113
1114 V_VT(&vid) = VT_I4;
1115 V_I4(&vid) = CHILDID_SELF;
1116 hr = IAccessible_get_accName(acc, vid, &str);
1117 ok(hr == S_OK, "got %lx\n", hr);
1118 ok(!lstrcmpW(str, L"static t &junk"), "name = %s\n", wine_dbgstr_w(str));
1120
1121 hr = IAccessible_get_accKeyboardShortcut(acc, vid, &str);
1122 ok(hr == S_OK, "got %lx\n", hr);
1123 ok(!lstrcmpW(str, L"Alt+t"), "str = %s\n", wine_dbgstr_w(str));
1125
1126 IAccessible_Release(acc);
1127
1128
1129 /* Test the button */
1130 hr = CreateStdAccessibleObject(btn, OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1131 ok(hr == S_OK, "got %lx\n", hr);
1132
1133 V_VT(&vid) = VT_I4;
1134 V_I4(&vid) = CHILDID_SELF;
1135 hr = IAccessible_get_accName(acc, vid, &str);
1136 ok(hr == S_OK, "got %lx\n", hr);
1137 ok(!lstrcmpW(str, L"btn t &junk"), "name = %s\n", wine_dbgstr_w(str));
1139
1140 hr = IAccessible_get_accKeyboardShortcut(acc, vid, &str);
1141 ok(hr == S_OK, "got %lx\n", hr);
1142 ok(!lstrcmpW(str, L"Alt+t"), "str = %s\n", wine_dbgstr_w(str));
1144
1145 IAccessible_Release(acc);
1146
1147
1148 /* Now we can test and destroy the top-level window */
1149 hr = CreateStdAccessibleObject(hwnd, OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1150 ok(hr == S_OK, "got %lx\n", hr);
1151
1153 hr = WindowFromAccessibleObject(acc, &hwnd2);
1154 ok(hr == S_OK, "got %lx\n", hr);
1155 ok(hwnd == hwnd2, "hwnd2 = %p, expected %p\n", hwnd2, hwnd);
1156
1157 hr = IAccessible_get_accChildCount(acc, &l);
1158 ok(hr == S_OK, "got %lx\n", hr);
1159 ok(l == 2, "l = %ld\n", l);
1160
1161 V_VT(&vid) = VT_I4;
1162 V_I4(&vid) = CHILDID_SELF;
1163 disp = (void*)0xdeadbeef;
1164 hr = IAccessible_get_accChild(acc, vid, &disp);
1165 ok(hr == E_INVALIDARG, "get_accChild returned %lx\n", hr);
1166 ok(disp == NULL, "disp = %p\n", disp);
1167
1168 V_I4(&vid) = 1;
1169 disp = (void*)0xdeadbeef;
1170 hr = IAccessible_get_accChild(acc, vid, &disp);
1171 ok(hr == E_INVALIDARG, "get_accChild returned %lx\n", hr);
1172 ok(disp == NULL, "disp = %p\n", disp);
1173
1174 /* Neither the parent nor any child windows have focus, VT_EMPTY. */
1175 hr = IAccessible_get_accFocus(acc, &v);
1176 ok(hr == S_OK, "hr %#lx\n", hr);
1177 ok(V_VT(&v) == VT_EMPTY, "V_VT(&v) = %d\n", V_VT(&v));
1178
1179 /* Set the focus to the parent window. */
1182 {
1183 skip("SetForegroundWindow failed\n");
1184 IAccessible_Release(acc);
1186 return;
1187 }
1188 hr = IAccessible_get_accFocus(acc, &v);
1189 ok(GetFocus() == hwnd, "test window has no focus\n");
1190 ok(hr == S_OK, "hr %#lx\n", hr);
1191 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1192 ok(V_I4(&v) == CHILDID_SELF, "V_I4(&v) = %ld\n", V_I4(&v));
1193
1194 /* Set focus to each child window. */
1195 SetFocus(btn);
1196 hr = IAccessible_get_accFocus(acc, &v);
1197 ok(GetFocus() == btn, "test window has no focus\n");
1198 ok(hr == S_OK, "hr %#lx\n", hr);
1199 ok(V_VT(&v) == VT_DISPATCH, "V_VT(&v) = %d\n", V_VT(&v));
1200 ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(&v) = %p\n", V_DISPATCH(&v));
1202
1203 hr = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IAccessible, (void**)&win);
1204 ok(hr == S_OK, "got %lx\n", hr);
1205 IDispatch_Release(V_DISPATCH(&v));
1206
1207 V_VT(&vid) = VT_I4;
1208 V_I4(&vid) = CHILDID_SELF;
1209 hr = IAccessible_get_accRole(win, vid, &v);
1210 todo_wine ok(hr == S_OK, "got %lx\n", hr);
1211 todo_wine ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1212 todo_wine ok(V_I4(&v) == ROLE_SYSTEM_WINDOW, "V_I4(&v) = %ld\n", V_I4(&v));
1213 IAccessible_Release(win);
1214
1215 SetFocus(chld);
1216 hr = IAccessible_get_accFocus(acc, &v);
1217 ok(hr == S_OK, "hr %#lx\n", hr);
1218 ok(V_VT(&v) == VT_DISPATCH, "V_VT(&v) = %d\n", V_VT(&v));
1219 ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(&v) = %p\n", V_DISPATCH(&v));
1221
1222 hr = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IAccessible, (void**)&win);
1223 ok(hr == S_OK, "got %lx\n", hr);
1224 IDispatch_Release(V_DISPATCH(&v));
1225
1226 hr = IAccessible_get_accRole(win, vid, &v);
1227 todo_wine ok(hr == S_OK, "got %lx\n", hr);
1228 todo_wine ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1229 todo_wine ok(V_I4(&v) == ROLE_SYSTEM_WINDOW, "V_I4(&v) = %ld\n", V_I4(&v));
1230 IAccessible_Release(win);
1231
1232 /* Child of a child, still works on parent HWND. */
1233 SetFocus(chld2);
1234 hr = IAccessible_get_accFocus(acc, &v);
1235 ok(hr == S_OK, "hr %#lx\n", hr);
1236 ok(V_VT(&v) == VT_DISPATCH, "V_VT(&v) = %d\n", V_VT(&v));
1237 ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(&v) = %p\n", V_DISPATCH(&v));
1238 check_acc_hwnd((IUnknown*)V_DISPATCH(&v), chld2);
1239
1240 hr = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IAccessible, (void**)&win);
1241 ok(hr == S_OK, "got %lx\n", hr);
1242 IDispatch_Release(V_DISPATCH(&v));
1243
1244 hr = IAccessible_get_accRole(win, vid, &v);
1245 todo_wine ok(hr == S_OK, "got %lx\n", hr);
1246 todo_wine ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1247 todo_wine ok(V_I4(&v) == ROLE_SYSTEM_WINDOW, "V_I4(&v) = %ld\n", V_I4(&v));
1248 IAccessible_Release(win);
1249
1251
1252 hr = IAccessible_QueryInterface(acc, &IID_IEnumVARIANT, (void**)&ev);
1253 ok(hr == S_OK, "got %lx\n", hr);
1254
1255 hr = IEnumVARIANT_Skip(ev, 100);
1256 ok(hr == S_FALSE, "Skip returned %lx\n", hr);
1257
1258 V_VT(&v) = VT_I4;
1259 fetched = 1;
1260 hr = IEnumVARIANT_Next(ev, 1, &v, &fetched);
1261 ok(hr == S_FALSE, "got %lx\n", hr);
1262 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1263 ok(fetched == 0, "fetched = %ld\n", fetched);
1264
1265 hr = IEnumVARIANT_Reset(ev);
1266 ok(hr == S_OK, "got %lx\n", hr);
1267
1268 V_VT(&v) = VT_I4;
1269 fetched = 2;
1270 hr = IEnumVARIANT_Next(ev, 1, &v, &fetched);
1271 ok(hr == S_OK, "got %lx\n", hr);
1272 ok(V_VT(&v) == VT_DISPATCH, "V_VT(&v) = %d\n", V_VT(&v));
1273 IDispatch_Release(V_DISPATCH(&v));
1274 ok(fetched == 1, "fetched = %ld\n", fetched);
1275 IEnumVARIANT_Release(ev);
1276
1278
1279 V_VT(&vid) = VT_I4;
1280 V_I4(&vid) = CHILDID_SELF;
1281 hr = IAccessible_get_accName(acc, vid, &str);
1282 ok(hr == S_OK, "got %lx\n", hr);
1283 /* Window names don't have keyboard shortcuts */
1284 todo_wine ok(!lstrcmpW(str, L"wnd &t &junk") ||
1285 broken(!lstrcmpW(str, L"wnd t &junk")), /* Windows < 10 1607 */
1286 "name = %s\n", wine_dbgstr_w(str));
1288
1289 hr = IAccessible_get_accKeyboardShortcut(acc, vid, &str);
1290 todo_wine ok(hr == S_FALSE || broken(hr == S_OK), "got %lx\n", hr);
1291 todo_wine ok(str == NULL || broken(!lstrcmpW(str, L"Alt+t")), "str = %s\n", wine_dbgstr_w(str));
1293
1294 V_I4(&vid) = 1;
1295 str = (void*)0xdeadbeef;
1296 hr = IAccessible_get_accName(acc, vid, &str);
1297 ok(hr == E_INVALIDARG, "got %lx\n", hr);
1298 ok(!str, "str != NULL\n");
1299 V_I4(&vid) = CHILDID_SELF;
1300
1301 str = (void*)0xdeadbeef;
1302 hr = IAccessible_get_accValue(acc, vid, &str);
1303 ok(hr == S_FALSE, "got %lx\n", hr);
1304 ok(!str, "str != NULL\n");
1305
1306 str = (void*)0xdeadbeef;
1307 hr = IAccessible_get_accDescription(acc, vid, &str);
1308 ok(hr == S_FALSE, "got %lx\n", hr);
1309 ok(!str, "str != NULL\n");
1310
1311 V_VT(&v) = VT_DISPATCH;
1312 V_DISPATCH(&v) = (void*)0xdeadbeef;
1313 hr = IAccessible_get_accRole(acc, vid, &v);
1314 ok(hr == S_OK, "got %lx\n", hr);
1315 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1316 ok(V_I4(&v) == ROLE_SYSTEM_CLIENT, "V_I4(&v) = %ld\n", V_I4(&v));
1317
1319 SetFocus(hwnd);
1320 if (GetForegroundWindow() != hwnd)
1321 {
1322 todo_wine ok(0, "incorrect foreground window\n");
1324 }
1330
1331 str = (void*)0xdeadbeef;
1332 hr = IAccessible_get_accHelp(acc, vid, &str);
1333 ok(hr == S_FALSE, "got %lx\n", hr);
1334 ok(!str, "str != NULL\n");
1335
1336 str = (void*)0xdeadbeef;
1337 hr = IAccessible_get_accDefaultAction(acc, vid, &str);
1338 ok(hr == S_FALSE, "got %lx\n", hr);
1339 ok(!str, "str != NULL\n");
1340
1341 pt.x = pt.y = 60;
1342 ok(ClientToScreen(hwnd, &pt), "ClientToScreen failed\n");
1343 hr = IAccessible_accHitTest(acc, pt.x, pt.y, &v);
1344 ok(hr == S_OK, "got %lx\n", hr);
1345 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1346 ok(V_I4(&v) == 0, "V_I4(&v) = %ld\n", V_I4(&v));
1347
1348 pt.x = pt.y = 25;
1349 ok(ClientToScreen(hwnd, &pt), "ClientToScreen failed\n");
1350 hr = IAccessible_accHitTest(acc, pt.x, pt.y, &v);
1351 ok(hr == S_OK, "got %lx\n", hr);
1352 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1353 ok(V_I4(&v) == 0, "V_I4(&v) = %ld\n", V_I4(&v));
1354
1356 pt.x = pt.y = 60;
1357 ok(ClientToScreen(hwnd, &pt), "ClientToScreen failed\n");
1358 hr = IAccessible_accHitTest(acc, pt.x, pt.y, &v);
1359 ok(hr == S_OK, "got %lx\n", hr);
1360 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1361 ok(V_I4(&v) == 0, "V_I4(&v) = %ld\n", V_I4(&v));
1362
1363 pt.x = pt.y = 25;
1364 ok(ClientToScreen(hwnd, &pt), "ClientToScreen failed\n");
1365 hr = IAccessible_accHitTest(acc, pt.x, pt.y, &v);
1366 ok(hr == S_OK, "got %lx\n", hr);
1367 ok(V_VT(&v) == VT_DISPATCH, "V_VT(&v) = %d\n", V_VT(&v));
1368 ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(&v) = %p\n", V_DISPATCH(&v));
1369 VariantClear(&v);
1370
1371 ShowWindow(chld, SW_HIDE);
1372 pt.x = pt.y = 25;
1373 ok(ClientToScreen(hwnd, &pt), "ClientToScreen failed\n");
1374 hr = IAccessible_accHitTest(acc, pt.x, pt.y, &v);
1375 ok(hr == S_OK, "got %lx\n", hr);
1376 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1377 ok(V_I4(&v) == 0, "V_I4(&v) = %ld\n", V_I4(&v));
1378
1379 hr = IAccessible_get_accParent(acc, &disp);
1380 ok(hr == S_OK, "got %lx\n", hr);
1381 ok(disp != NULL, "disp == NULL\n");
1382 IDispatch_Release(disp);
1383
1384 ok(GetClientRect(hwnd, &rect), "GetClientRect failed\n");
1385 pt.x = rect.left;
1386 pt.y = rect.top;
1387 MapWindowPoints(hwnd, NULL, &pt, 1);
1388 rect.left = pt.x;
1389 rect.top = pt.y;
1390 pt.x = rect.right;
1391 pt.y = rect.bottom;
1392 MapWindowPoints(hwnd, NULL, &pt, 1);
1393 hr = IAccessible_accLocation(acc, &left, &top, &width, &height, vid);
1394 ok(hr == S_OK, "got %lx\n", hr);
1395 ok(left == rect.left, "left = %ld, expected %ld\n", left, rect.left);
1396 ok(top == rect.top, "top = %ld, expected %ld\n", top, rect.top);
1397 ok(width == pt.x-rect.left, "width = %ld, expected %ld\n", width, pt.x-rect.left);
1398 ok(height == pt.y-rect.top, "height = %ld, expected %ld\n", height, pt.y-rect.top);
1399
1400 thread = CreateThread(NULL, 0, default_client_thread, (void *)acc, 0, NULL);
1402 {
1403 MSG msg;
1404 while(PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
1405 {
1408 }
1409 }
1411
1413
1414 hr = IAccessible_get_accChildCount(acc, &l);
1415 ok(hr == S_OK, "got %lx\n", hr);
1416 ok(l == 0, "l = %ld\n", l);
1417
1418 hr = IAccessible_get_accName(acc, vid, &str);
1419 ok(hr == E_INVALIDARG, "got %lx\n", hr);
1420
1421 hr = IAccessible_get_accValue(acc, vid, &str);
1422 ok(hr == S_FALSE, "got %lx\n", hr);
1423
1424 hr = IAccessible_get_accRole(acc, vid, &v);
1425 ok(hr == S_OK, "got %lx\n", hr);
1426 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1427 ok(V_I4(&v) == ROLE_SYSTEM_CLIENT, "V_I4(&v) = %ld\n", V_I4(&v));
1428
1429 hr = IAccessible_get_accState(acc, vid, &v);
1430 ok(hr == S_OK, "got %lx\n", hr);
1431 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1432 ok(V_I4(&v) == STATE_SYSTEM_INVISIBLE, "V_I4(&v) = %lx\n", V_I4(&v));
1433
1434 hr = IAccessible_get_accFocus(acc, &v);
1435 ok(hr == S_OK, "hr %#lx\n", hr);
1436 ok(V_VT(&v) == VT_EMPTY, "V_VT(&v) = %d\n", V_VT(&v));
1437
1438 hr = IAccessible_accHitTest(acc, 200, 200, &v);
1439 ok(hr == S_OK, "got %lx\n", hr);
1440 ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
1441 ok(V_I4(&v) == 0, "V_I4(&v) = %ld\n", V_I4(&v));
1442
1443 disp = (void*)0xdeadbeef;
1444 hr = IAccessible_get_accParent(acc, &disp);
1445 ok(hr == E_FAIL, "got %lx\n", hr);
1446 ok(disp == NULL, "disp = %p\n", disp);
1447
1448 hr = IAccessible_accLocation(acc, &left, &top, &width, &height, vid);
1449 ok(hr == S_OK, "got %lx\n", hr);
1450 ok(left == 0, "left = %ld\n", left);
1451 ok(top == 0, "top = %ld\n", top);
1452 ok(width == 0, "width = %ld\n", width);
1453 ok(height == 0, "height = %ld\n", height);
1454
1455 IAccessible_Release(acc);
1456}
1457
1459{
1460 HWND hwnd, child;
1461 IAccessible *acc;
1462 VARIANT cid, var;
1463 POINT point;
1464 HRESULT hr;
1465
1466 hwnd = CreateWindowA("oleacc_test", "test", WS_POPUP | WS_VISIBLE,
1467 0, 0, 400, 300, NULL, NULL, NULL, NULL);
1468 ok(hwnd != NULL, "CreateWindow failed\n");
1470 "SetWindowLongPtr failed\n");
1471
1472 point.x = point.y = 10;
1473 ok(ClientToScreen(hwnd, &point), "ClientToScreen failed\n");
1474
1475 if (WindowFromPoint(point) != hwnd)
1476 {
1477 win_skip("test window not returned from WindowFromPoint\n");
1479 return;
1480 }
1481
1483 ok(hr == E_INVALIDARG, "got %lx\n", hr);
1484
1486 ok(hr == E_INVALIDARG, "got %lx\n", hr);
1487
1488 V_VT(&cid) = VT_DISPATCH;
1489 V_DISPATCH(&cid) = (IDispatch*)0xdeadbeef;
1491 ok(hr == E_INVALIDARG, "got %lx\n", hr);
1492 ok(V_VT(&cid) == VT_DISPATCH, "got %#x, expected %#x\n", V_VT(&cid), VT_DISPATCH);
1493
1495 ok(hr == S_OK, "got %lx\n", hr);
1496 ok(V_VT(&cid) == VT_I4, "got %#x, expected %#x\n", V_VT(&cid), VT_I4);
1497 ok(V_I4(&cid) == CHILDID_SELF, "got %#lx, expected %#x\n", V_I4(&cid), CHILDID_SELF);
1499 hr = IAccessible_get_accRole(acc, cid, &var);
1500 ok(hr == S_OK, "got %lx\n", hr);
1501 ok(V_VT(&var) == VT_I4, "got %#x, expected %#x\n", V_VT(&var), VT_I4);
1502 ok(V_I4(&var) == ROLE_SYSTEM_CLIENT, "got %#lx, expected %#x\n",
1503 V_I4(&var), ROLE_SYSTEM_CLIENT);
1504 IAccessible_Release(acc);
1505
1506 child = CreateWindowA("edit", "edit", WS_CHILD | WS_VISIBLE,
1507 0, 0, 100, 100, hwnd, NULL, NULL, NULL);
1508 ok(child != NULL, "CreateWindow failed\n");
1509
1510 if (WindowFromPoint(point) != child)
1511 {
1512 win_skip("test window not returned from WindowFromPoint\n");
1514 return;
1515 }
1516
1518 ok(hr == S_OK, "got %lx\n", hr);
1519 ok(V_VT(&cid) == VT_I4, "got %#x, expected %#x\n", V_VT(&cid), VT_I4);
1520 ok(V_I4(&cid) == CHILDID_SELF, "got %#lx, expected %#x\n", V_I4(&cid), CHILDID_SELF);
1522 hr = IAccessible_get_accRole(acc, cid, &var);
1523 ok(hr == S_OK, "got %lx\n", hr);
1524 ok(V_VT(&var) == VT_I4, "got %#x, expected %#x\n", V_VT(&var), VT_I4);
1525 ok(V_I4(&var) == ROLE_SYSTEM_TEXT, "got %#lx, expected %#x\n",
1526 V_I4(&var), ROLE_SYSTEM_TEXT);
1527 IAccessible_Release(acc);
1528
1530}
1531
1532static void test_CAccPropServices(void)
1533{
1534 IAccPropServices *acc_prop_services;
1535 HRESULT hres;
1536
1537 hres = CoCreateInstance(&CLSID_CAccPropServices, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
1538 &IID_IAccPropServices, (void**)&acc_prop_services);
1539 ok(hres == S_OK, "Could not create CAccPropServices instance: %08lx\n", hres);
1540
1541 IAccPropServices_Release(acc_prop_services);
1542}
1543
1545{
1546 if (msg != WM_GETOBJECT)
1547 return 0;
1548
1549 CHECK_EXPECT(winproc_GETOBJECT);
1550 ok(!wparam, "wparam = %Ix\n", wparam);
1551 ok(lparam == OBJID_QUERYCLASSNAMEIDX, "lparam = %Ix\n", lparam);
1552 return 0;
1553}
1554
1555#define check_acc_proxy_service( acc ) \
1556 check_acc_proxy_service_( (acc), __LINE__)
1558{
1559 IServiceProvider *service = NULL;
1560 IUnknown *unk = NULL;
1561 HRESULT hr;
1562
1563 hr = IAccessible_QueryInterface(acc, &IID_IServiceProvider, (void **)&service);
1564 ok(hr == S_OK, "got %#lx\n", hr);
1565
1566 hr = IServiceProvider_QueryService(service, &IIS_IsOleaccProxy, &IID_IUnknown, (void **)&unk);
1567 ok(hr == S_OK, "got %#lx\n", hr);
1568 ok(!!unk, "unk == NULL\n");
1569 ok(iface_cmp(unk, (IUnknown*)acc), "unk != acc\n");
1570 IUnknown_Release(unk);
1571
1572 unk = (IUnknown*)0xdeadbeef;
1573 hr = IServiceProvider_QueryService(service, &IID_IUnknown, &IID_IUnknown, (void **)&unk);
1574 ok(hr == E_INVALIDARG, "got %#lx\n", hr);
1575 ok(!unk, "unk != NULL\n");
1576 IServiceProvider_Release(service);
1577}
1578
1580{
1581 static const struct {
1582 const WCHAR *class;
1583 BOOL window; /* uses default window accessibility object */
1584 BOOL client; /* uses default client accessibility object */
1585 } tests[] =
1586 {
1587 { WC_LISTBOXW },
1588 { L"#32768" },
1589 { WC_BUTTONW, TRUE },
1590 { WC_STATICW, TRUE },
1591 { WC_EDITW, TRUE },
1592 { WC_COMBOBOXW, TRUE },
1593 { L"#32770", TRUE },
1594 { L"#32769", TRUE },
1595 { WC_SCROLLBARW, TRUE },
1598 { PROGRESS_CLASSW, TRUE },
1599 { ANIMATE_CLASSW, TRUE },
1600 { WC_TABCONTROLW, TRUE },
1601 { HOTKEY_CLASSW, TRUE },
1602 { WC_HEADERW, TRUE },
1603 { TRACKBAR_CLASSW, TRUE },
1604 { WC_LISTVIEWW, TRUE },
1605 { UPDOWN_CLASSW, TRUE },
1606 { TOOLTIPS_CLASSW, TRUE },
1607 { WC_TREEVIEWW, TRUE },
1610 { WC_IPADDRESSW, TRUE }
1611 };
1612
1613 LRESULT (WINAPI *win_proc)(HWND, UINT, WPARAM, LPARAM);
1614 IAccessible *acc;
1615 HRESULT hr;
1616 HWND hwnd;
1617 int i;
1618
1619 for(i=0; i<ARRAY_SIZE(tests); i++)
1620 {
1621 winetest_push_context("class = %s", wine_dbgstr_w(tests[i].class));
1622 hwnd = CreateWindowW(tests[i].class, L"name", WS_OVERLAPPEDWINDOW,
1623 0, 0, 0, 0, NULL, NULL, NULL, NULL);
1624 ok(hwnd != NULL, "CreateWindow failed\n");
1626
1627 if (tests[i].client)
1628 SET_EXPECT(winproc_GETOBJECT);
1629 hr = CreateStdAccessibleObject(hwnd, OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1630 ok(hr == S_OK, "CreateStdAccessibleObject failed %lx\n", hr);
1631 if (tests[i].client)
1632 CHECK_CALLED(winproc_GETOBJECT);
1634 IAccessible_Release(acc);
1635
1636 if (tests[i].window)
1637 SET_EXPECT(winproc_GETOBJECT);
1638 hr = CreateStdAccessibleObject(hwnd, OBJID_WINDOW, &IID_IAccessible, (void**)&acc);
1639 ok(hr == S_OK, "CreateStdAccessibleObject failed %lx\n", hr);
1640 if (tests[i].window)
1641 CHECK_CALLED(winproc_GETOBJECT);
1643 IAccessible_Release(acc);
1644
1648 }
1649}
1650
1651typedef struct
1652{
1653 const WCHAR *name;
1654 const WCHAR *value;
1656
1658 const WCHAR *help;
1661
1670
1671#define check_acc_vals( acc, vals) \
1672 check_acc_vals_( (acc), (vals), __LINE__)
1673static void check_acc_vals_(IAccessible *acc, const acc_expected_vals *vals,
1674 int line)
1675{
1677 LONG child_count;
1678 VARIANT vid, var;
1679 IDispatch *disp;
1680 HRESULT hr;
1681 RECT rect;
1682 HWND hwnd;
1683 POINT pt;
1684 BSTR str;
1685
1686 V_VT(&vid) = VT_I4;
1687 V_I4(&vid) = CHILDID_SELF;
1688 hr = IAccessible_get_accName(acc, vid, &str);
1689 ok_(__FILE__, line) (hr == (vals->name ? S_OK : S_FALSE), "get_accName returned %#lx, expected %#lx\n",
1690 hr, (vals->name ? S_OK : S_FALSE));
1691 ok_(__FILE__, line) (!lstrcmpW(str, vals->name), "get_accName returned %s, expected %s\n",
1694
1695 hr = IAccessible_get_accValue(acc, vid, &str);
1696 ok_(__FILE__, line) (hr == vals->value_hr, "get_accValue returned %#lx, expected %#lx\n",
1697 hr, vals->value_hr);
1698 ok_(__FILE__, line) (!lstrcmpW(str, vals->value), "get_accValue returned %s, expected %s\n",
1701
1702 hr = IAccessible_get_accDescription(acc, vid, &str);
1703 ok_(__FILE__, line) (hr == (vals->description ? S_OK : S_FALSE), "get_accDescription returned %#lx, expected %#lx\n",
1704 hr, vals->help ? S_OK : S_FALSE);
1705 ok_(__FILE__, line) (!lstrcmpW(str, vals->description), "get_accDescription returned %s, expected %s\n",
1708
1709 hr = IAccessible_get_accHelp(acc, vid, &str);
1710 ok_(__FILE__, line) (hr == (vals->help ? S_OK : S_FALSE), "get_accHelp returned %#lx, expected %#lx\n",
1711 hr, vals->help ? S_OK : S_FALSE);
1712 ok_(__FILE__, line) (!lstrcmpW(str, vals->help), "get_accHelp returned %s, expected %s\n",
1715
1716 hr = IAccessible_get_accKeyboardShortcut(acc, vid, &str);
1717 ok_(__FILE__, line) (hr == (vals->kbd_shortcut ? S_OK : S_FALSE), "get_accKeyboardShortcut returned %#lx, expected %#lx\n",
1718 hr, vals->help ? S_OK : S_FALSE);
1719 ok_(__FILE__, line) (!lstrcmpW(str, vals->kbd_shortcut), "get_accKeyboardShortcut returned %s, expected %s\n",
1722
1723 hr = IAccessible_get_accDefaultAction(acc, vid, &str);
1724 ok_(__FILE__, line) (hr == (vals->default_action ? S_OK : S_FALSE), "get_accDefaultAction returned %#lx, expected %#lx\n",
1725 hr, vals->help ? S_OK : S_FALSE);
1726 ok_(__FILE__, line) (!lstrcmpW(str, vals->default_action), "get_accDefaultAction returned %s, expected %s\n",
1729
1730 V_VT(&var) = VT_DISPATCH;
1731 V_DISPATCH(&var) = (void*)0xdeadbeef;
1732 hr = IAccessible_get_accRole(acc, vid, &var);
1733 ok_(__FILE__, line) (hr == S_OK, "get_accRole returned %#lx\n", hr);
1734 ok_(__FILE__, line) (V_VT(&var) == VT_I4, "V_VT(&var) returned %d, expected %d\n", V_VT(&var), VT_I4);
1735 ok_(__FILE__, line) (V_I4(&var) == vals->role, "get_accRole returned %ld, expected %d\n",
1736 V_I4(&var), vals->role);
1737
1738 V_VT(&var) = VT_DISPATCH;
1739 V_DISPATCH(&var) = (void*)0xdeadbeef;
1740 hr = IAccessible_get_accState(acc, vid, &var);
1741 ok_(__FILE__, line) (hr == S_OK, "get_accState returned %#lx\n", hr);
1742 ok_(__FILE__, line) (V_VT(&var) == VT_I4, "V_VT(&var) returned %d, expected %d\n", V_VT(&var), VT_I4);
1743 ok_(__FILE__, line) (V_I4(&var) == vals->state, "get_accState returned %#lx, expected %#x\n",
1744 V_I4(&var), vals->state);
1745
1747 ok_(__FILE__, line) (hr == S_OK, "got %lx\n", hr);
1748 ok_(__FILE__, line) (GetClientRect(hwnd, &rect), "GetClientRect failed\n");
1749 pt.x = rect.left;
1750 pt.y = rect.top;
1751 MapWindowPoints(hwnd, NULL, &pt, 1);
1752 rect.left = pt.x;
1753 rect.top = pt.y;
1754 pt.x = rect.right;
1755 pt.y = rect.bottom;
1756 MapWindowPoints(hwnd, NULL, &pt, 1);
1757 hr = IAccessible_accLocation(acc, &left, &top, &width, &height, vid);
1758 ok_(__FILE__, line) (hr == S_OK, "got %lx\n", hr);
1759 ok_(__FILE__, line) (left == rect.left, "left = %ld, expected %ld\n", left, rect.left);
1760 ok_(__FILE__, line) (top == rect.top, "top = %ld, expected %ld\n", top, rect.top);
1761 ok_(__FILE__, line) (width == pt.x-rect.left, "width = %ld, expected %ld\n", width, pt.x-rect.left);
1762 ok_(__FILE__, line) (height == pt.y-rect.top, "height = %ld, expected %ld\n", height, pt.y-rect.top);
1763
1764 child_count = -1;
1765 hr = IAccessible_get_accChildCount(acc, &child_count);
1766 ok_(__FILE__, line) (hr == S_OK, "get_accChildCount returned %#lx\n", hr);
1767 ok_(__FILE__, line) (child_count == vals->child_count, "get_accChildCount returned %ld, expected %#lx\n",
1768 child_count, vals->child_count);
1769
1770 disp = (void *)0xdeadbeef;
1771 V_VT(&var) = VT_I4;
1772 V_I4(&var) = 1;
1773 hr = IAccessible_get_accChild(acc, var, &disp);
1774 ok_(__FILE__, line) (hr == (vals->valid_child ? S_OK : E_INVALIDARG), "get_accChild returned %#lx, expected %#lx\n",
1775 hr, (vals->valid_child ? S_OK : E_INVALIDARG));
1776 if (disp)
1777 {
1778 ok_(__FILE__, line) (vals->valid_child, "get_accChild unexpectedly returned a child\n");
1779 IDispatch_Release(disp);
1780 }
1781 else
1782 ok_(__FILE__, line) (!vals->valid_child, "get_accChild expected a valid child, none was returned\n");
1783
1784 disp = (void *)0xdeadbeef;
1785 hr = IAccessible_get_accParent(acc, &disp);
1786 ok_(__FILE__, line) (hr == S_OK, "get_accParent returned %#lx\n", hr);
1787 ok_(__FILE__, line) (disp != NULL, "get_accParent returned a NULL pareent\n");
1788 IDispatch_Release(disp);
1789
1790 V_VT(&var) = VT_EMPTY;
1791 hr = IAccessible_get_accFocus(acc, &var);
1792 ok_(__FILE__, line) (hr == S_OK, "get_accFocus returned %#lx\n", hr);
1793 ok_(__FILE__, line) (V_VT(&var) == vals->focus_vt, "get_accFocus returned V_VT(&var) %d, expected %d\n",
1794 V_VT(&var), vals->focus_vt);
1795 switch(vals->focus_vt)
1796 {
1797 case VT_I4:
1798 ok_(__FILE__, line) (V_I4(&var) == vals->focus_cid, "get_accFocus returned childID %ld, expected %d\n",
1799 V_I4(&var), vals->focus_cid);
1800 break;
1801
1802 case VT_DISPATCH:
1803 ok_(__FILE__, line) (V_DISPATCH(&var) != NULL, "get_accFocus returned NULL IDispatch\n");
1804 IDispatch_Release(V_DISPATCH(&var));
1805 break;
1806
1807 default:
1808 break;
1809 }
1810}
1811
1813 /* edit0, readonly edit, no label. */
1814 { .name = NULL,
1815 .value = L"edit0-test",
1816 .value_hr = S_OK,
1817 .description = NULL,
1818 .help = NULL,
1819 .kbd_shortcut = NULL,
1820 .default_action = NULL,
1821 .role = ROLE_SYSTEM_TEXT,
1823 .child_count = 0,
1824 .valid_child = FALSE,
1825 .valid_parent = TRUE,
1826 .focus_vt = VT_EMPTY,
1827 .focus_cid = 0, },
1828 /* edit1, ES_PASSWORD edit style. */
1829 { .name = L"label0:",
1830 .value = NULL,
1831 .value_hr = E_ACCESSDENIED,
1832 .description = NULL,
1833 .help = NULL,
1834 .kbd_shortcut = L"Alt+l",
1835 .default_action = NULL,
1836 .role = ROLE_SYSTEM_TEXT,
1838 .child_count = 0,
1839 .valid_child = FALSE,
1840 .valid_parent = TRUE,
1841 .focus_vt = VT_EMPTY,
1842 .focus_cid = 0, },
1843 /* edit2, multi-line edit. */
1844 { .name = L"label1:",
1845 .value = L"edit2-test\r\ntest-edit2\n",
1846 .value_hr = S_OK,
1847 .description = NULL,
1848 .help = NULL,
1849 .kbd_shortcut = L"Alt+e",
1850 .default_action = NULL,
1851 .role = ROLE_SYSTEM_TEXT,
1853 .child_count = 0,
1854 .valid_child = FALSE,
1855 .valid_parent = TRUE,
1856 .focus_vt = VT_I4,
1857 .focus_cid = CHILDID_SELF, },
1858 /* edit3, edit with child HWND. */
1859 { .name = L"label1:",
1860 .value = L"",
1861 .value_hr = S_OK,
1862 .description = NULL,
1863 .help = NULL,
1864 .kbd_shortcut = L"Alt+l",
1865 .default_action = NULL,
1866 .role = ROLE_SYSTEM_TEXT,
1867 .state = STATE_SYSTEM_FOCUSABLE,
1868 .child_count = 1,
1869 .valid_child = FALSE,
1870 .valid_parent = TRUE,
1871 .focus_vt = VT_DISPATCH,
1872 .focus_cid = 0, },
1873};
1874
1876{
1877 HWND hwnd, label0, label1, btn0, btn1;
1878 IAccessible *acc;
1879 HWND edit[4];
1880 HRESULT hr;
1881 VARIANT v;
1882 BSTR str;
1883
1884 hwnd = CreateWindowW(L"oleacc_test", L"edit_acc_test_win", WS_OVERLAPPEDWINDOW,
1885 0, 0, 220, 160, NULL, NULL, NULL, NULL);
1886 ok(!!hwnd, "CreateWindow failed\n");
1887
1888 edit[0] = CreateWindowW(L"EDIT", L"", WS_VISIBLE | WS_CHILD | ES_READONLY, 5, 5, 190, 20,
1889 hwnd, NULL, NULL, NULL);
1890 ok(!!edit[0], "Failed to create edit[0] hwnd\n");
1891
1892 label0 = CreateWindowW(L"STATIC", L"&label0:", WS_VISIBLE | WS_CHILD, 5, 30, 55, 20,
1893 hwnd, NULL, NULL, NULL);
1894 ok(!!label0, "Failed to create label0 hwnd\n");
1895
1896 edit[1] = CreateWindowW(L"EDIT", L"", WS_VISIBLE | WS_CHILD | ES_PASSWORD,
1897 65, 30, 130, 20, hwnd, NULL, NULL, NULL);
1898 ok(!!edit[1], "Failed to create edit[1] hwnd\n");
1899
1900 label1 = CreateWindowW(L"STATIC", L"lab&el1:", WS_VISIBLE | WS_CHILD, 5, 55, 45, 20,
1901 hwnd, NULL, NULL, NULL);
1902 ok(!!label1, "Failed to create label1 hwnd\n");
1903
1904 btn0 = CreateWindowW(L"BUTTON", L"but&ton0", WS_VISIBLE | WS_CHILD, 55, 55, 45, 20,
1905 hwnd, NULL, NULL, NULL);
1906 ok(!!btn0, "Failed to create btn0 hwnd\n");
1907
1908 edit[2] = CreateWindowW(L"EDIT", L"", WS_VISIBLE | WS_CHILD | ES_MULTILINE,
1909 105, 55, 90, 40, hwnd, NULL, NULL, NULL);
1910 ok(!!edit[2], "Failed to create edit[2] hwnd\n");
1911
1912 edit[3] = CreateWindowW(L"EDIT", L"", WS_VISIBLE | WS_CHILD, 5, 100, 190, 20,
1913 hwnd, NULL, NULL, NULL);
1914 ok(!!edit[3], "Failed to create edit[3] hwnd\n");
1915
1916 /* Button embedded within an edit control window. */
1917 btn1 = CreateWindowW(L"BUTTON", L"button1", WS_VISIBLE | WS_CHILD, 100, 5, 85, 10,
1918 edit[3], NULL, NULL, NULL);
1919 ok(!!btn1, "Failed to create btn1 hwnd\n");
1920
1921 hr = CreateStdAccessibleObject(edit[0], OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1922 ok(hr == S_OK, "got %lx\n", hr);
1923 V_VT(&v) = VT_I4;
1924 V_I4(&v) = CHILDID_SELF;
1925 str = SysAllocString(L"edit0-test");
1926 hr = IAccessible_put_accValue(acc, v, str);
1927 ok(hr == S_OK, "got %lx\n", hr);
1929 check_acc_vals(acc, &edit_acc_vals[0]);
1930 IAccessible_Release(acc);
1931
1932 hr = CreateStdAccessibleObject(edit[1], OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1933 ok(hr == S_OK, "got %lx\n", hr);
1934 str = SysAllocString(L"password");
1935 hr = IAccessible_put_accValue(acc, v, str);
1936 ok(hr == S_OK, "got %lx\n", hr);
1938 check_acc_vals(acc, &edit_acc_vals[1]);
1939 IAccessible_Release(acc);
1940
1942 {
1943 skip("SetForegroundWindow failed\n");
1945 return;
1946 }
1947 SetFocus(edit[2]);
1948 hr = CreateStdAccessibleObject(edit[2], OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1949 str = SysAllocString(L"edit2-test\r\ntest-edit2\n");
1950 hr = IAccessible_put_accValue(acc, v, str);
1951 ok(hr == S_OK, "got %lx\n", hr);
1953 check_acc_vals(acc, &edit_acc_vals[2]);
1954 IAccessible_Release(acc);
1955
1956 /*
1957 * Hiding a label with a keyboard shortcut makes get_accKeyboardShortcut
1958 * on the edit no longer return the labels shortcut, however get_accName
1959 * still returns the labels string.
1960 */
1961 ShowWindow(label1, SW_HIDE);
1962 SetFocus(btn1);
1963 hr = CreateStdAccessibleObject(edit[3], OBJID_CLIENT, &IID_IAccessible, (void**)&acc);
1964 ok(hr == S_OK, "got %lx\n", hr);
1965 check_acc_vals(acc, &edit_acc_vals[3]);
1966 IAccessible_Release(acc);
1967
1969}
1970
1972{
1973 HRESULT hr;
1974 HWND hwnd;
1975
1976 /* Successfully retrieve an HWND from the IOleWindow interface. */
1977 Accessible.ow_hwnd = (HWND)0xdeadf00d;
1978 hwnd = (HWND)0xdeadbeef;
1980 ok(hr == S_OK, "got %lx\n", hr);
1981 ok(hwnd == (HWND)0xdeadf00d, "hwnd != 0xdeadf00d!\n");
1982
1983 /* Successfully retrieve an HWND from IAccessible::accNavigate. */
1984 Accessible.acc_hwnd = (HWND)0xdeadf00d;
1986 hwnd = (HWND)0xdeadbeef;
1989 ok(hr == S_OK, "got %lx\n", hr);
1990 /* This value gets sign-extended on 64-bit. */
1991 ok(hwnd == IntToPtr(0xdeadf00d), "hwnd != 0xdeadf00d!\n");
1993
1994 /* Don't return an HWND from either method. */
1996 hwnd = (HWND)0xdeadbeef;
2000 /* Return value from IAccessible::get_accParent. */
2001 ok(hr == S_FALSE, "got %lx\n", hr);
2002 ok(!hwnd, "hwnd %p\n", hwnd);
2005
2006 /* Successfully retrieve an HWND from a parent IAccessible's IOleWindow interface. */
2007 Accessible.ow_hwnd = (HWND)0xdeadf00d;
2008 hwnd = (HWND)0xdeadbeef;
2009 SET_EXPECT(Accessible_child_accNavigate);
2010 SET_EXPECT(Accessible_child_get_accParent);
2011 hr = WindowFromAccessibleObject(&Accessible_child.IAccessible_iface, &hwnd);
2012 ok(hr == S_OK, "got %lx\n", hr);
2013 ok(hwnd == (HWND)0xdeadf00d, "hwnd != 0xdeadf00d!\n");
2014 CHECK_CALLED(Accessible_child_accNavigate);
2015 CHECK_CALLED(Accessible_child_get_accParent);
2016
2018 ok(Accessible.ref == 1, "Accessible.ref = %ld\n", Accessible.ref);
2019 ok(Accessible_child.ref == 1, "Accessible.ref = %ld\n", Accessible_child.ref);
2020}
2021
2023{
2024 int argc;
2025 char **argv;
2026
2027 if(!init())
2028 return;
2029
2031
2033 if(argc == 4 && !strcmp(argv[2], "ObjectFromLresult")) {
2034 IUnknown *unk;
2035 HRESULT hres;
2036 LRESULT lres;
2037
2038 lres = strtoll( argv[3], NULL, 16 );
2039 hres = ObjectFromLresult(lres, &IID_IUnknown, 0, (void**)&unk);
2040 ok(hres == S_OK, "hres = %lx\n", hres);
2041 IUnknown_Release(unk);
2042
2044 return;
2045 }
2046
2047 if(!register_window_class()) {
2048 skip("can't register test window class\n");
2049 return;
2050 }
2051
2064
2067
2071}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
static void startup(void)
static int state
Definition: maze.c:121
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define msg(x)
Definition: auth_time.c:54
#define ARRAY_SIZE(A)
Definition: main.h:20
static HANDLE thread
Definition: service.c:33
#define IntToPtr(i)
Definition: basetsd.h:83
#define HandleToULong(h)
Definition: basetsd.h:89
const GUID IID_IUnknown
r l[0]
Definition: byte_order.h:168
RECT rect
Definition: combotst.c:67
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
Definition: combase.c:2803
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
OLECHAR * BSTR
Definition: compat.h:2293
HANDLE HWND
Definition: compat.h:19
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_I4
Definition: compat.h:2298
@ VT_EMPTY
Definition: compat.h:2295
@ VT_DISPATCH
Definition: compat.h:2304
#define lstrlenW
Definition: compat.h:750
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
LCID lcid
Definition: locale.c:5660
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
Definition: process.c:686
MonoAssembly int argc
Definition: metahost.c:107
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
static __int64 strtoll(const char *ptr, char **endptr, int base)
Definition: stdlib.h:295
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
LRESULT WINAPI LresultFromObject(REFIID riid, WPARAM wParam, LPUNKNOWN pAcc)
Definition: main.c:181
HRESULT WINAPI AccessibleObjectFromWindow(HWND hwnd, DWORD dwObjectID, REFIID riid, void **ppvObject)
Definition: main.c:386
HRESULT WINAPI AccessibleObjectFromPoint(POINT point, IAccessible **acc, VARIANT *child_id)
Definition: main.c:280
HRESULT WINAPI ObjectFromLresult(LRESULT result, REFIID riid, WPARAM wParam, void **ppObject)
Definition: main.c:109
UINT WINAPI GetStateTextW(DWORD state_bit, WCHAR *state_str, UINT state_str_len)
Definition: main.c:607
UINT WINAPI GetStateTextA(DWORD state_bit, CHAR *state_str, UINT state_str_len)
Definition: main.c:637
HRESULT WINAPI AccessibleChildren(IAccessible *container, LONG start, LONG count, VARIANT *children, LONG *children_cnt)
Definition: main.c:669
UINT WINAPI GetRoleTextA(DWORD role, LPSTR lpRole, UINT rolemax)
Definition: main.c:559
#define NAVDIR_INTERNAL_HWND
Definition: main.c:38
HRESULT WINAPI WindowFromAccessibleObject(IAccessible *acc, HWND *phwnd)
Definition: main.c:409
HRESULT WINAPI AccessibleObjectFromEvent(HWND hwnd, DWORD object_id, DWORD child_id, IAccessible **acc_out, VARIANT *child_id_out)
Definition: main.c:345
HRESULT WINAPI CreateStdAccessibleObject(HWND hwnd, LONG idObject, REFIID riidInterface, void **ppvObject)
Definition: main.c:92
UINT WINAPI GetRoleTextW(DWORD role, LPWSTR lpRole, UINT rolemax)
Definition: main.c:539
#define pt(x, y)
Definition: drawing.c:79
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
int main()
Definition: test.c:6
#define INFINITE
Definition: serial.h:102
POINTL point
Definition: edittest.c:50
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLint left
Definition: glext.h:7726
GLfloat param
Definition: glext.h:5796
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
unsigned int UINT
Definition: sysinfo.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 wine_dbgstr_w
Definition: kernel32.h:34
static real win[4][36]
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define win_skip
Definition: minitest.h:67
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
Definition: test.h:537
#define todo_wine
Definition: minitest.h:80
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
static PVOID ptr
Definition: dispmode.c:27
static struct test_info tests[]
#define sprintf
Definition: sprintf.c:45
const char * var
Definition: shader.c:5666
HRESULT hres
Definition: protocol.c:465
static IHTMLWindow2 * window
Definition: events.c:77
static const WCHAR sp[]
Definition: suminfo.c:287
#define SET_EXPECT(func)
Definition: main.c:35
static struct Accessible * impl_from_OleWindow(IOleWindow *iface)
Definition: main.c:423
static void test_GetProcessHandleFromHwnd(void)
Definition: main.c:920
static HRESULT WINAPI Accessible_accHitTest(IAccessible *iface, LONG xLeft, LONG yTop, VARIANT *pvarID)
Definition: main.c:364
static LRESULT WINAPI test_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: main.c:734
static void _check_acc_hwnd(unsigned line, IUnknown *unk, HWND exp)
Definition: main.c:1046
static void check_acc_proxy_service_(IAccessible *acc, int line)
Definition: main.c:1557
static HRESULT WINAPI Accessible_get_accParent(IAccessible *iface, IDispatch **ppdispParent)
Definition: main.c:183
static ULONG WINAPI Object_AddRef(IUnknown *iface)
Definition: main.c:676
static void test_LresultFromObject(const char *name)
Definition: main.c:694
static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
Definition: main.c:85
static HRESULT WINAPI Accessible_get_accChildCount(IAccessible *iface, LONG *pcountChildren)
Definition: main.c:202
static HRESULT WINAPI Accessible_accLocation(IAccessible *iface, LONG *pxLeft, LONG *pyTop, LONG *pcxWidth, LONG *pcyHeight, VARIANT varID)
Definition: main.c:334
static BOOL register_window_class(void)
Definition: main.c:760
static void test_WindowFromAccessibleObject(void)
Definition: main.c:1971
#define CHECK_EXPECT(func)
Definition: main.c:44
static HRESULT WINAPI Accessible_get_accRole(IAccessible *iface, VARIANT varID, VARIANT *pvarRole)
Definition: main.c:272
#define DEFINE_EXPECT(func)
Definition: main.c:32
static DWORD WINAPI default_client_thread(LPVOID param)
Definition: main.c:1060
static ULONG WINAPI Object_Release(IUnknown *iface)
Definition: main.c:681
static struct Accessible Accessible
Definition: main.c:468
static HRESULT WINAPI Accessible_get_accState(IAccessible *iface, VARIANT varID, VARIANT *pvarState)
Definition: main.c:279
static HRESULT WINAPI Accessible_put_accName(IAccessible *iface, VARIANT varID, BSTR pszName)
Definition: main.c:378
static void test_default_edit_accessible_object(void)
Definition: main.c:1875
static HRESULT WINAPI Accessible_get_accHelpTopic(IAccessible *iface, BSTR *pszHelpFile, VARIANT varID, LONG *pidTopic)
Definition: main.c:293
static ULONG WINAPI OleWindow_AddRef(IOleWindow *iface)
Definition: main.c:434
static HRESULT WINAPI Accessible_get_accValue(IAccessible *iface, VARIANT varID, BSTR *pszValue)
Definition: main.c:258
static ULONG WINAPI Accessible_Release(IAccessible *iface)
Definition: main.c:148
static HRESULT WINAPI Accessible_get_accKeyboardShortcut(IAccessible *iface, VARIANT varID, BSTR *pszKeyboardShortcut)
Definition: main.c:300
static HRESULT WINAPI OleWindow_GetWindow(IOleWindow *iface, HWND *hwnd)
Definition: main.c:446
static HRESULT WINAPI Accessible_GetIDsOfNames(IAccessible *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: main.c:168
static HRESULT WINAPI Accessible_put_accValue(IAccessible *iface, VARIANT varID, BSTR pszValue)
Definition: main.c:385
static IAccessibleVtbl AccessibleVtbl
Definition: main.c:392
#define check_acc_state(acc, state)
Definition: main.c:1031
static void test_CAccPropServices(void)
Definition: main.c:1532
static const acc_expected_vals edit_acc_vals[]
Definition: main.c:1812
static HRESULT WINAPI Accessible_get_accFocus(IAccessible *iface, VARIANT *pvarID)
Definition: main.c:307
static HRESULT WINAPI Accessible_get_accName(IAccessible *iface, VARIANT varID, BSTR *pszName)
Definition: main.c:244
static ULONG WINAPI Accessible_AddRef(IAccessible *iface)
Definition: main.c:142
static IUnknownVtbl ObjectVtbl
Definition: main.c:686
static HRESULT WINAPI Object_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: main.c:664
static HRESULT WINAPI Accessible_GetTypeInfoCount(IAccessible *iface, UINT *pctinfo)
Definition: main.c:154
static void test_AccessibleObjectFromEvent(void)
Definition: main.c:806
static void test_default_client_accessible_object(void)
Definition: main.c:1078
static HRESULT WINAPI Accessible_get_accChild(IAccessible *iface, VARIANT varChildID, IDispatch **ppdispChild)
Definition: main.c:213
static HRESULT WINAPI Accessible_GetTypeInfo(IAccessible *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: main.c:161
static HRESULT WINAPI Accessible_QueryInterface(IAccessible *iface, REFIID riid, void **ppvObject)
Definition: main.c:115
static HRESULT WINAPI Accessible_accNavigate(IAccessible *iface, LONG navDir, VARIANT varStart, VARIANT *pvarEnd)
Definition: main.c:341
static struct Accessible Accessible_child
Definition: main.c:476
static void test_getroletext(void)
Definition: main.c:485
static HRESULT WINAPI Accessible_get_accHelp(IAccessible *iface, VARIANT varID, BSTR *pszHelp)
Definition: main.c:286
static HRESULT WINAPI Accessible_get_accDescription(IAccessible *iface, VARIANT varID, BSTR *pszDescription)
Definition: main.c:265
#define CHECK_CALLED(func)
Definition: main.c:50
static HRESULT WINAPI Accessible_get_accSelection(IAccessible *iface, VARIANT *pvarID)
Definition: main.c:313
static LONG Object_ref
Definition: main.c:663
static void test_AccessibleObjectFromPoint(void)
Definition: main.c:1458
static void test_CreateStdAccessibleObject_classes(void)
Definition: main.c:1579
static ULONG WINAPI OleWindow_Release(IOleWindow *iface)
Definition: main.c:440
static HRESULT WINAPI Accessible_get_accDefaultAction(IAccessible *iface, VARIANT varID, BSTR *pszDefaultAction)
Definition: main.c:320
static void test_AccessibleObjectFromWindow(void)
Definition: main.c:777
static HRESULT WINAPI Accessible_accSelect(IAccessible *iface, LONG flagsSelect, VARIANT varID)
Definition: main.c:327
static void _check_acc_state(unsigned line, IAccessible *acc, INT state)
Definition: main.c:1032
static LRESULT WINAPI test_query_class(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: main.c:1544
#define check_acc_hwnd(unk, hwnd)
Definition: main.c:1045
static void test_AccessibleChildren(IAccessible *acc)
Definition: main.c:938
static HRESULT WINAPI Accessible_accDoDefaultAction(IAccessible *iface, VARIANT varID)
Definition: main.c:371
#define check_acc_vals(acc, vals)
Definition: main.c:1671
static const IOleWindowVtbl OleWindowVtbl
Definition: main.c:460
static void check_acc_vals_(IAccessible *acc, const acc_expected_vals *vals, int line)
Definition: main.c:1673
static void unregister_window_class(void)
Definition: main.c:772
static struct Accessible * impl_from_Accessible(IAccessible *iface)
Definition: main.c:110
#define check_acc_proxy_service(acc)
Definition: main.c:1555
static void test_GetStateText(void)
Definition: main.c:597
static HRESULT WINAPI OleWindow_ContextSensitiveHelp(IOleWindow *iface, BOOL f_enter_mode)
Definition: main.c:454
static HRESULT WINAPI OleWindow_QueryInterface(IOleWindow *iface, REFIID riid, void **obj)
Definition: main.c:428
static HRESULT WINAPI Accessible_Invoke(IAccessible *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: main.c:175
static VARIANTARG static DISPID
Definition: ordinal.c:49
static DWORD unk1
Definition: cursoricon.c:1804
static HWND child
Definition: cursoricon.c:298
DWORD exp
Definition: msg.c:18625
#define argv
Definition: mplay32.c:18
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
@ COINIT_MULTITHREADED
Definition: objbase.h:280
#define LRESULT
Definition: ole.h:14
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
#define V_DISPATCH(A)
Definition: oleauto.h:239
const GUID IID_IOleWindow
const GUID IID_IDispatch
static HANDLE proc()
Definition: pdb.c:32
#define ES_PASSWORD
Definition: pedump.c:670
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define ES_READONLY
Definition: pedump.c:675
#define WS_TABSTOP
Definition: pedump.c:634
short WCHAR
Definition: pedump.c:58
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
char CHAR
Definition: pedump.c:57
#define ES_MULTILINE
Definition: pedump.c:667
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
#define WC_TABCONTROLW
Definition: commctrl.h:3940
#define UPDOWN_CLASSW
Definition: commctrl.h:2124
#define MONTHCAL_CLASSW
Definition: commctrl.h:4180
#define WC_BUTTONW
Definition: commctrl.h:4628
#define HOTKEY_CLASSW
Definition: commctrl.h:2241
#define PROGRESS_CLASSW
Definition: commctrl.h:2181
#define WC_LISTVIEWW
Definition: commctrl.h:2262
#define WC_EDITW
Definition: commctrl.h:4692
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define TRACKBAR_CLASSW
Definition: commctrl.h:2016
#define STATUSCLASSNAMEW
Definition: commctrl.h:1941
#define ANIMATE_CLASSW
Definition: commctrl.h:4146
#define WC_HEADERW
Definition: commctrl.h:624
#define WC_IPADDRESSW
Definition: commctrl.h:4477
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define WC_TREEVIEWW
Definition: commctrl.h:3248
#define DATETIMEPICK_CLASSW
Definition: commctrl.h:4327
#define WC_STATICW
Definition: commctrl.h:4685
#define WC_LISTBOXW
Definition: commctrl.h:4716
#define WC_SCROLLBARW
Definition: commctrl.h:4734
#define WC_COMBOBOXW
Definition: commctrl.h:4722
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
_In_opt_ LPCSTR _In_opt_ LPCSTR pszValue
Definition: shlwapi.h:783
#define wine_dbgstr_wn
Definition: testlist.c:2
const WCHAR * str
DWORD LCID
Definition: nls.h:13
int winetest_get_mainargs(char ***pargv)
#define wait_child_process
Definition: test.h:159
#define memset(x, y, z)
Definition: compat.h:39
static FILE * client
Definition: client.c:37
static const char *static const char const char DWORD void DWORD *static const char const char DWORD void DWORD *static const char DWORD DWORD void * buff
Definition: shcore.c:41
TCHAR * cmdline
Definition: stretchblt.cpp:32
HWND acc_hwnd
Definition: main.c:106
IAccessible * parent
Definition: main.c:105
IAccessible IAccessible_iface
Definition: main.c:101
HWND ow_hwnd
Definition: main.c:107
LONG ref
Definition: main.c:103
IOleWindow IOleWindow_iface
Definition: main.c:102
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
HINSTANCE hInstance
Definition: winuser.h:3275
LPCSTR lpszClassName
Definition: winuser.h:3280
WNDPROC lpfnWndProc
Definition: winuser.h:3272
BOOL valid_parent
Definition: main.c:1666
const WCHAR * name
Definition: main.c:1653
const WCHAR * help
Definition: main.c:1658
const WCHAR * kbd_shortcut
Definition: main.c:1659
const WCHAR * value
Definition: main.c:1654
BOOL valid_child
Definition: main.c:1665
HRESULT value_hr
Definition: main.c:1655
const WCHAR * description
Definition: main.c:1657
LONG child_count
Definition: main.c:1664
const WCHAR * default_action
Definition: main.c:1660
char * value
Definition: compiler.c:67
char * name
Definition: compiler.c:66
Definition: parser.c:49
Definition: name.c:39
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:626
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define OBJID_CURSOR
Definition: winable.h:24
#define OBJID_CLIENT
Definition: winable.h:19
#define OBJID_WINDOW
Definition: winable.h:15
#define CHILDID_SELF
Definition: winable.h:14
#define WAIT_OBJECT_0
Definition: winbase.h:383
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_ACCESSDENIED
Definition: winerror.h:4116
#define E_UNEXPECTED
Definition: winerror.h:3528
static int init
Definition: wintirpc.c:33
HWND WINAPI GetFocus(void)
Definition: window.c:1887
#define SetWindowLongPtrA
Definition: winuser.h:5511
#define SW_HIDE
Definition: winuser.h:779
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define STATE_SYSTEM_READONLY
Definition: winuser.h:2975
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define STATE_SYSTEM_FOCUSED
Definition: winuser.h:2971
#define QS_ALLINPUT
Definition: winuser.h:914
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define STATE_SYSTEM_FOCUSABLE
Definition: winuser.h:2989
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1207
#define STATE_SYSTEM_INVISIBLE
Definition: winuser.h:2984
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HWND WINAPI WindowFromPoint(_In_ POINT)
#define SW_SHOW
Definition: winuser.h:786
#define SetWindowLongPtrW
Definition: winuser.h:5512
BOOL WINAPI DestroyWindow(_In_ HWND)
#define STATE_SYSTEM_PROTECTED
Definition: winuser.h:2998