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 e8a76f8a5ae..f218dc0096e 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)) { @@ -394,13 +394,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 | 43 +++++++++++++++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 6 ++--- 3 files changed, 45 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..d7cbfcbfcc8 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -238,8 +238,47 @@ 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)); + + 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 f218dc0096e..c36108976b7 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)) @@ -400,7 +400,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)) { @@ -409,6 +408,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 | 24 ++++++++++++++++++++++-- dlls/comctl32/tests/syslink.c | 6 +++--- 2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index d7cbfcbfcc8..75224a1d363 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -391,8 +391,28 @@ 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)); + + 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 + { + *action = NULL; + 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 c36108976b7..b30c35fabba 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)) @@ -379,6 +378,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);
@@ -408,7 +408,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)) @@ -418,6 +417,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 75224a1d363..d256f9d6196 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -423,8 +423,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 b30c35fabba..26bd4e28c7d 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); @@ -378,10 +378,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); @@ -417,10 +417,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 d256f9d6196..b560ea1696d 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 26bd4e28c7d..5cec85287d3 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 b560ea1696d..268365007f1 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 5cec85287d3..fdfbb822ac6 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); @@ -381,13 +379,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 268365007f1..2ce7b0cb5f6 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; @@ -559,6 +569,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; @@ -567,6 +622,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 fdfbb822ac6..07a01349527 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -416,10 +416,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);
Connor McAdams (@cmcadams) commented about dlls/comctl32/syslink.c:
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));
Adding a `NULL` check for name and clearing it to `NULL` in case of failure would probably be useful here to avoid potentially returning an uninitialized variable upon failure.
Connor McAdams (@cmcadams) commented about dlls/comctl32/syslink.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));
Same thing as `get_accName` WRT checking for `NULL` on action and initializing it to `NULL`.
Aside from the `BSTR` method argument initialization comments I made, this looks fine to me.