-- v2: comctl32: Implement IOleWindow for SysLink. comctl32: Implement accChild for SysLink. comctl32: Implement get_accChildCount for SysLink. comctl32: Implement accLocation for SysLink. comctl32: Implement get_accDefaultAction for SysLink. comctl32: Implement acc_getName for SysLink. comctl32: Implement get_accState for SysLink controls. comctl32: Include only link items as IAccessible children.
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index d6398b125c1..cca9e67253e 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -205,6 +205,8 @@ static HRESULT Accessible_FindChild(SYSLINK_ACC *This, VARIANT childid, DOC_ITEM
LIST_FOR_EACH_ENTRY(current, &This->infoPtr->Items, DOC_ITEM, entry) { + if (current->Type != slLink) + continue; if (!--index) { *result = current;
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 42 +++++++++++++++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 6 ++--- 2 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index cca9e67253e..50a52152eed 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -278,8 +278,46 @@ static HRESULT WINAPI Accessible_get_accRole(IAccessible *iface, VARIANT childid
static HRESULT WINAPI Accessible_get_accState(IAccessible *iface, VARIANT childid, VARIANT *state) { - FIXME("%p\n", iface); - return E_NOTIMPL; + SYSLINK_ACC *This = impl_from_IAccessible(iface); + HRESULT hr; + DOC_ITEM* item; + GUITHREADINFO info; + BOOL focused = 0; + + TRACE("%p, %s\n", iface, debugstr_variant(&childid)); + + hr = Accessible_FindChild(This, childid, &item); + if (FAILED(hr)) + return hr; + + V_VT(state) = VT_I4; + V_I4(state) = 0; + + info.cbSize = sizeof(info); + if(GetGUIThreadInfo(0, &info) && info.hwndFocus == This->infoPtr->Self) + focused = 1; + + if (item) + { + V_I4(state) |= STATE_SYSTEM_FOCUSABLE|STATE_SYSTEM_LINKED; + if (focused && (item->u.Link.state & LIS_FOCUSED) == LIS_FOCUSED) + V_I4(state) |= STATE_SYSTEM_FOCUSED; + } + else + { + LONG style = GetWindowLongW(This->infoPtr->Self, GWL_STYLE); + + if (style & WS_DISABLED) + V_I4(state) |= STATE_SYSTEM_UNAVAILABLE; + else + V_I4(state) |= STATE_SYSTEM_FOCUSABLE; + if (!(style & WS_VISIBLE)) + V_I4(state) |= STATE_SYSTEM_INVISIBLE; + if (focused) + V_I4(state) |= STATE_SYSTEM_FOCUSED; + } + + return S_OK; }
static HRESULT WINAPI Accessible_get_accHelp(IAccessible *iface, VARIANT childid, BSTR *help) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 65909774d19..67df0a041e8 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -316,13 +316,13 @@ static void test_msaa(void) ok(V_VT(&varResult) == VT_I4, "accRole returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == ROLE_SYSTEM_CLIENT, "accRole returned %li\n", V_I4(&varResult));
-todo_wine { VariantClear(&varResult); hr = IAccessible_get_accState(acc, varChild, &varResult); ok(hr == S_OK, "accState failed, hr=%lx\n", hr); ok(V_VT(&varResult) == VT_I4, "accState returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == STATE_SYSTEM_FOCUSABLE, "accState returned %li\n", V_I4(&varResult));
+todo_wine { hr = IAccessible_get_accName(acc, varChild, &name); ok(hr == S_OK, "accName failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) { @@ -355,13 +355,13 @@ todo_wine { ok(V_VT(&varResult) == VT_I4, "accRole returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == ROLE_SYSTEM_LINK, "accRole returned %li\n", V_I4(&varResult));
-todo_wine { VariantClear(&varResult); hr = IAccessible_get_accState(acc, varChild, &varResult); ok(hr == S_OK, "accState failed, hr=%lx\n", hr); ok(V_VT(&varResult) == VT_I4, "accState returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == (STATE_SYSTEM_FOCUSABLE|STATE_SYSTEM_LINKED), "accState returned %li\n", V_I4(&varResult));
+todo_wine { hr = IAccessible_get_accName(acc, varChild, &name); ok(hr == S_OK, "accName failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) { @@ -401,13 +401,13 @@ todo_wine { ok(V_VT(&varResult) == VT_I4, "accRole returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == ROLE_SYSTEM_LINK, "accRole returned %li\n", V_I4(&varResult));
-todo_wine { VariantClear(&varResult); hr = IAccessible_get_accState(acc, varChild, &varResult); ok(hr == S_OK, "accState failed, hr=%lx\n", hr); ok(V_VT(&varResult) == VT_I4, "accState returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == (STATE_SYSTEM_FOCUSABLE|STATE_SYSTEM_LINKED), "accState returned %li\n", V_I4(&varResult));
+todo_wine { hr = IAccessible_get_accName(acc, varChild, &name); ok(hr == S_OK, "accName failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) {
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/Makefile.in | 2 +- dlls/comctl32/syslink.c | 48 +++++++++++++++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 6 ++--- 3 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in index 383faee35ad..954572964f5 100644 --- a/dlls/comctl32/Makefile.in +++ b/dlls/comctl32/Makefile.in @@ -1,7 +1,7 @@ EXTRADEFS = -D_COMCTL32_ MODULE = comctl32.dll IMPORTLIB = comctl32 -IMPORTS = uuid user32 gdi32 advapi32 imm32 kernelbase oleacc +IMPORTS = uuid user32 gdi32 advapi32 imm32 kernelbase oleacc oleaut32 DELAYIMPORTS = winmm uxtheme
SOURCES = \ diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 50a52152eed..1c08cb2c121 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -238,8 +238,52 @@ static HRESULT WINAPI Accessible_get_accChild(IAccessible *iface, VARIANT childi
static HRESULT WINAPI Accessible_get_accName(IAccessible *iface, VARIANT childid, BSTR *name) { - FIXME("%p\n", iface); - return E_NOTIMPL; + SYSLINK_ACC *This = impl_from_IAccessible(iface); + HRESULT hr; + DOC_ITEM* item; + BSTR result; + + TRACE("%p, %s\n", iface, debugstr_variant(&childid)); + + if (!name) + return E_POINTER; + + *name = NULL; + + hr = Accessible_FindChild(This, childid, &item); + if (FAILED(hr)) + return hr; + + if (item) + { + result = SysAllocString(item->Text); + if (!result) + return E_OUTOFMEMORY; + } + else + { + UINT total_length = 0, i; + + LIST_FOR_EACH_ENTRY(item, &This->infoPtr->Items, DOC_ITEM, entry) + { + total_length += item->nText; + } + + result = SysAllocStringLen(NULL, total_length); + if (!result) + return E_OUTOFMEMORY; + + i = 0; + LIST_FOR_EACH_ENTRY(item, &This->infoPtr->Items, DOC_ITEM, entry) + { + memcpy(&result[i], item->Text, item->nText * sizeof(*result)); + i += item->nText; + } + } + + *name = result; + + return S_OK; }
static HRESULT WINAPI Accessible_get_accValue(IAccessible *iface, VARIANT childid, BSTR *value) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 67df0a041e8..a0e95aaee55 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -322,7 +322,6 @@ static void test_msaa(void) ok(V_VT(&varResult) == VT_I4, "accState returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == STATE_SYSTEM_FOCUSABLE, "accState returned %li\n", V_I4(&varResult));
-todo_wine { hr = IAccessible_get_accName(acc, varChild, &name); ok(hr == S_OK, "accName failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) { @@ -331,6 +330,7 @@ todo_wine { SysFreeString(name); }
+todo_wine { hr = IAccessible_get_accDefaultAction(acc, varChild, &name); ok(hr == S_FALSE, "accDefaultAction failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) @@ -361,7 +361,6 @@ todo_wine { ok(V_VT(&varResult) == VT_I4, "accState returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == (STATE_SYSTEM_FOCUSABLE|STATE_SYSTEM_LINKED), "accState returned %li\n", V_I4(&varResult));
-todo_wine { hr = IAccessible_get_accName(acc, varChild, &name); ok(hr == S_OK, "accName failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) { @@ -370,6 +369,7 @@ todo_wine { SysFreeString(name); }
+todo_wine { hr = IAccessible_get_accDefaultAction(acc, varChild, &name); ok(hr == S_OK, "accDefaultAction failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) @@ -407,7 +407,6 @@ todo_wine { ok(V_VT(&varResult) == VT_I4, "accState returned vt=%x\n", V_VT(&varResult)); ok(V_I4(&varResult) == (STATE_SYSTEM_FOCUSABLE|STATE_SYSTEM_LINKED), "accState returned %li\n", V_I4(&varResult));
-todo_wine { hr = IAccessible_get_accName(acc, varChild, &name); ok(hr == S_OK, "accName failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) { @@ -416,6 +415,7 @@ todo_wine { SysFreeString(name); }
+todo_wine { hr = IAccessible_get_accDefaultAction(acc, varChild, &name); ok(hr == S_OK, "accDefaultAction failed, hr=%lx\n", hr); if (SUCCEEDED(hr))
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 28 ++++++++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 6 +++--- 2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 1c08cb2c121..77e16285287 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -396,8 +396,32 @@ static HRESULT WINAPI Accessible_get_accSelection(IAccessible *iface, VARIANT *c
static HRESULT WINAPI Accessible_get_accDefaultAction(IAccessible *iface, VARIANT childid, BSTR *action) { - FIXME("%p\n", iface); - return E_NOTIMPL; + SYSLINK_ACC *This = impl_from_IAccessible(iface); + HRESULT hr; + DOC_ITEM* item; + + TRACE("%p, %s\n", iface, debugstr_variant(&childid)); + + if (!action) + return E_POINTER; + + *action = NULL; + + hr = Accessible_FindChild(This, childid, &item); + if (FAILED(hr)) + return hr; + + if (item) + { + *action = SysAllocString(L"Click"); + if (!*action) + return E_OUTOFMEMORY; + return S_OK; + } + else + { + return S_FALSE; + } }
static HRESULT WINAPI Accessible_accSelect(IAccessible *iface, LONG flags, VARIANT childid) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index a0e95aaee55..91954096382 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -330,12 +330,12 @@ static void test_msaa(void) SysFreeString(name); }
-todo_wine { hr = IAccessible_get_accDefaultAction(acc, varChild, &name); ok(hr == S_FALSE, "accDefaultAction failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) ok(!name, "unexpected default action %s\n", debugstr_w(name));
+todo_wine { hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
@@ -369,7 +369,6 @@ todo_wine { SysFreeString(name); }
-todo_wine { hr = IAccessible_get_accDefaultAction(acc, varChild, &name); ok(hr == S_OK, "accDefaultAction failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) @@ -386,6 +385,7 @@ todo_wine { SysFreeString(name); }
+todo_wine { hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
@@ -415,7 +415,6 @@ todo_wine { SysFreeString(name); }
-todo_wine { hr = IAccessible_get_accDefaultAction(acc, varChild, &name); ok(hr == S_OK, "accDefaultAction failed, hr=%lx\n", hr); if (SUCCEEDED(hr)) @@ -432,6 +431,7 @@ todo_wine { SysFreeString(name); }
+todo_wine { hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 42 +++++++++++++++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 6 ++--- 2 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 77e16285287..7d2ed8674b8 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -432,8 +432,46 @@ static HRESULT WINAPI Accessible_accSelect(IAccessible *iface, LONG flags, VARIA
static HRESULT WINAPI Accessible_accLocation(IAccessible *iface, LONG *left, LONG *top, LONG *width, LONG *height, VARIANT childid) { - FIXME("%p\n", iface); - return E_NOTIMPL; + SYSLINK_ACC *This = impl_from_IAccessible(iface); + HRESULT hr; + DOC_ITEM* item; + RECT rc = {0}; + POINT point; + + TRACE("%p, %s\n", iface, debugstr_variant(&childid)); + + hr = Accessible_FindChild(This, childid, &item); + if (FAILED(hr)) + return hr; + + if (item) + { + int n = item->nText; + PDOC_TEXTBLOCK block = item->Blocks; + + while (n > 0) + { + UnionRect(&rc, &rc, &block->rc); + n -= block->nChars + block->nSkip; + block++; + } + } + else + { + GetClientRect(This->infoPtr->Self, &rc); + } + + point.x = rc.left; + point.y = rc.top; + MapWindowPoints(This->infoPtr->Self, NULL, &point, 1); + *left = point.x; + *top = point.y; + *width = rc.right - rc.left; + *height = rc.bottom - rc.top; + + TRACE("<-- (%li,%li,%li,%li)\n", *left, *top, *width, *height); + + return S_OK; }
static HRESULT WINAPI Accessible_accNavigate(IAccessible *iface, LONG dir, VARIANT start, VARIANT *end) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 91954096382..5eca972aa6d 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -335,10 +335,10 @@ static void test_msaa(void) if (SUCCEEDED(hr)) ok(!name, "unexpected default action %s\n", debugstr_w(name));
-todo_wine { hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
+todo_wine { hr = IAccessible_get_accChildCount(acc, &count); ok(hr == S_OK, "accChildCount failed, hr=%lx\n", hr); ok(count == 2, "accChildCount returned %li\n", count); @@ -385,10 +385,10 @@ todo_wine { SysFreeString(name); }
-todo_wine { hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
+todo_wine { /* child 2 */ V_I4(&varChild) = 2; hr = IAccessible_get_accChild(acc, varChild, &child); @@ -431,10 +431,10 @@ todo_wine { SysFreeString(name); }
-todo_wine { hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
+todo_wine { hr = IAccessible_QueryInterface(acc, &IID_IOleWindow, (void**)&ole_window); ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr); }
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 23 +++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 7d2ed8674b8..424d46acff9 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -226,8 +226,27 @@ static HRESULT WINAPI Accessible_get_accParent(IAccessible *iface, IDispatch** d
static HRESULT WINAPI Accessible_get_accChildCount(IAccessible *iface, LONG *count) { - FIXME("%p\n", iface); - return E_NOTIMPL; + SYSLINK_ACC *This = impl_from_IAccessible(iface); + DOC_ITEM *current; + LONG result = 0; + + TRACE("%p\n", iface); + + if (!This->infoPtr) + { + WARN("control was destroyed\n"); + return E_FAIL; + } + + LIST_FOR_EACH_ENTRY(current, &This->infoPtr->Items, DOC_ITEM, entry) + { + if (current->Type == slLink) + result++; + } + + *count = result; + + return S_OK; }
static HRESULT WINAPI Accessible_get_accChild(IAccessible *iface, VARIANT childid, IDispatch **disp) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 5eca972aa6d..55df8d8b59c 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -338,11 +338,11 @@ static void test_msaa(void) hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
-todo_wine { hr = IAccessible_get_accChildCount(acc, &count); ok(hr == S_OK, "accChildCount failed, hr=%lx\n", hr); ok(count == 2, "accChildCount returned %li\n", count);
+todo_wine { /* child 1 */ V_I4(&varChild) = 1; hr = IAccessible_get_accChild(acc, varChild, &child);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 18 ++++++++++++++++-- dlls/comctl32/tests/syslink.c | 4 ---- 2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 424d46acff9..657ce6d61bf 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -251,8 +251,22 @@ static HRESULT WINAPI Accessible_get_accChildCount(IAccessible *iface, LONG *cou
static HRESULT WINAPI Accessible_get_accChild(IAccessible *iface, VARIANT childid, IDispatch **disp) { - FIXME("%p\n", iface); - return E_NOTIMPL; + SYSLINK_ACC *This = impl_from_IAccessible(iface); + HRESULT hr; + DOC_ITEM* item; + + TRACE("%p, %s\n", iface, debugstr_variant(&childid)); + + *disp = NULL; + + hr = Accessible_FindChild(This, childid, &item); + if (FAILED(hr)) + return hr; + + if (item) + return S_FALSE; + else + return E_INVALIDARG; }
static HRESULT WINAPI Accessible_get_accName(IAccessible *iface, VARIANT childid, BSTR *name) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 55df8d8b59c..a6503d13506 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -342,13 +342,11 @@ static void test_msaa(void) ok(hr == S_OK, "accChildCount failed, hr=%lx\n", hr); ok(count == 2, "accChildCount returned %li\n", count);
-todo_wine { /* child 1 */ V_I4(&varChild) = 1; hr = IAccessible_get_accChild(acc, varChild, &child); ok(hr == S_FALSE, "accChild hr=%lx\n", hr); ok(!child, "accChild returned IDispatch\n"); -}
hr = IAccessible_get_accRole(acc, varChild, &varResult); ok(hr == S_OK, "accRole failed, hr=%lx\n", hr); @@ -388,13 +386,11 @@ todo_wine { hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
-todo_wine { /* child 2 */ V_I4(&varChild) = 2; hr = IAccessible_get_accChild(acc, varChild, &child); ok(hr == S_FALSE, "accChild hr=%lx\n", hr); ok(!child, "accChild returned IDispatch\n"); -}
hr = IAccessible_get_accRole(acc, varChild, &varResult); ok(hr == S_OK, "accRole failed, hr=%lx\n", hr);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/syslink.c | 56 +++++++++++++++++++++++++++++++++++ dlls/comctl32/tests/syslink.c | 2 -- 2 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 657ce6d61bf..d0bfaf164fc 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -79,6 +79,7 @@ typedef struct SYSLINK_INFO SYSLINK_INFO; typedef struct { IAccessible IAccessible_iface; + IOleWindow IOleWindow_iface; struct SYSLINK_INFO *infoPtr; LONG refcount; } SYSLINK_ACC; @@ -113,6 +114,11 @@ static inline SYSLINK_ACC *impl_from_IAccessible(IAccessible *iface) return CONTAINING_RECORD(iface, SYSLINK_ACC, IAccessible_iface); }
+static inline SYSLINK_ACC *impl_from_IOleWindow(IOleWindow *iface) +{ + return CONTAINING_RECORD(iface, SYSLINK_ACC, IOleWindow_iface); +} + static HRESULT WINAPI Accessible_QueryInterface(IAccessible *iface, REFIID iid, void **ppv) { SYSLINK_ACC *This = impl_from_IAccessible(iface); @@ -125,6 +131,10 @@ static HRESULT WINAPI Accessible_QueryInterface(IAccessible *iface, REFIID iid, { *ppv = &This->IAccessible_iface; } + else if (IsEqualIID(&IID_IOleWindow, iid)) + { + *ppv = &This->IOleWindow_iface; + } else { *ppv = NULL; @@ -568,6 +578,51 @@ static const IAccessibleVtbl Accessible_Vtbl = { Accessible_put_accValue };
+static HRESULT WINAPI Accessible_Window_QueryInterface(IOleWindow *iface, REFIID iid, void **ppv) +{ + SYSLINK_ACC *This = impl_from_IOleWindow(iface); + return IAccessible_QueryInterface(&This->IAccessible_iface, iid, ppv); +} + +static ULONG WINAPI Accessible_Window_AddRef(IOleWindow *iface) +{ + SYSLINK_ACC *This = impl_from_IOleWindow(iface); + return IAccessible_AddRef(&This->IAccessible_iface); +} + +static ULONG WINAPI Accessible_Window_Release(IOleWindow *iface) +{ + SYSLINK_ACC *This = impl_from_IOleWindow(iface); + return IAccessible_Release(&This->IAccessible_iface); +} + +static HRESULT WINAPI Accessible_GetWindow(IOleWindow *iface, HWND *hwnd) +{ + SYSLINK_ACC *This = impl_from_IOleWindow(iface); + + TRACE("%p\n", This); + + if (!This->infoPtr) + return E_FAIL; + + *hwnd = This->infoPtr->Self; + return S_OK; +} + +static HRESULT WINAPI Accessible_ContextSensitiveHelp(IOleWindow *This, BOOL fEnterMode) +{ + FIXME("%p\b", This); + return E_NOTIMPL; +} + +static const IOleWindowVtbl Accessible_Window_Vtbl = { + Accessible_Window_QueryInterface, + Accessible_Window_AddRef, + Accessible_Window_Release, + Accessible_GetWindow, + Accessible_ContextSensitiveHelp +}; + static void Accessible_Create(SYSLINK_INFO* infoPtr) { SYSLINK_ACC *This; @@ -576,6 +631,7 @@ static void Accessible_Create(SYSLINK_INFO* infoPtr) if (!This) return;
This->IAccessible_iface.lpVtbl = &Accessible_Vtbl; + This->IOleWindow_iface.lpVtbl = &Accessible_Window_Vtbl; This->infoPtr = infoPtr; This->refcount = 1; infoPtr->AccessibleImpl = This; diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index a6503d13506..c25263f6f97 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -430,10 +430,8 @@ static void test_msaa(void) hr = IAccessible_accLocation(acc, &left, &top, &width, &height, varChild); ok(hr == S_OK, "accLocation failed, hr=%lx\n", hr);
-todo_wine { hr = IAccessible_QueryInterface(acc, &IID_IOleWindow, (void**)&ole_window); ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr); -}
if (SUCCEEDED(hr)) { hr = IOleWindow_GetWindow(ole_window, &ret_hwnd);
This merge request was approved by Connor McAdams.