Piotr Caban : oleacc: Add Client_get_accParent implementation.

Alexandre Julliard julliard at winehq.org
Fri May 9 13:32:36 CDT 2014


Module: wine
Branch: master
Commit: 40bdbda82559062caa335b282883b50ce4f8a7fa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=40bdbda82559062caa335b282883b50ce4f8a7fa

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri May  9 13:59:58 2014 +0200

oleacc: Add Client_get_accParent implementation.

---

 dlls/oleacc/client.c     |    7 +++++--
 dlls/oleacc/tests/main.c |   13 +++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c
index d557de9..b2c734a 100644
--- a/dlls/oleacc/client.c
+++ b/dlls/oleacc/client.c
@@ -113,8 +113,11 @@ static HRESULT WINAPI Client_Invoke(IAccessible *iface, DISPID dispIdMember,
 static HRESULT WINAPI Client_get_accParent(IAccessible *iface, IDispatch **ppdispParent)
 {
     Client *This = impl_from_Client(iface);
-    FIXME("(%p)->(%p)\n", This, ppdispParent);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, ppdispParent);
+
+    return AccessibleObjectFromWindow(This->hwnd, OBJID_WINDOW,
+            &IID_IDispatch, (void**)ppdispParent);
 }
 
 static HRESULT WINAPI Client_get_accChildCount(IAccessible *iface, LONG *pcountChildren)
diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c
index 62fe3f8..3fb23da 100644
--- a/dlls/oleacc/tests/main.c
+++ b/dlls/oleacc/tests/main.c
@@ -225,6 +225,8 @@ static LRESULT WINAPI test_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
             return E_UNEXPECTED;
         if(lparam == (DWORD)OBJID_CLIENT)
             return LresultFromObject(&IID_IUnknown, wparam, &Object);
+        if(lparam == (DWORD)OBJID_WINDOW)
+            return 0;
 
         ok(0, "unexpected (%ld)\n", lparam);
         return 0;
@@ -311,6 +313,7 @@ static void test_default_client_accessible_object(void)
     static const WCHAR shortcutW[] = {'A','l','t','+','t',0};
 
     IAccessible *acc;
+    IDispatch *disp;
     HWND chld, hwnd;
     HRESULT hr;
     VARIANT vid, v;
@@ -427,6 +430,11 @@ static void test_default_client_accessible_object(void)
     ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
     ok(V_I4(&v) == 0, "V_I4(&v) = %d\n", V_I4(&v));
 
+    hr = IAccessible_get_accParent(acc, &disp);
+    ok(hr == S_OK, "got %x\n", hr);
+    ok(disp != NULL, "disp == NULL\n");
+    IDispatch_Release(disp);
+
     DestroyWindow(hwnd);
 
     hr = IAccessible_get_accChildCount(acc, &l);
@@ -454,6 +462,11 @@ static void test_default_client_accessible_object(void)
     ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v));
     ok(V_I4(&v) == 0, "V_I4(&v) = %d\n", V_I4(&v));
 
+    disp = (void*)0xdeadbeef;
+    hr = IAccessible_get_accParent(acc, &disp);
+    ok(hr == E_FAIL, "got %x\n", hr);
+    ok(disp == NULL, "disp = %p\n", disp);
+
     IAccessible_Release(acc);
 }
 




More information about the wine-cvs mailing list