From 8c808f3ee90966a86c0f9ca17e78b1fbe4662378 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 15 May 2014 17:53:13 +0200 Subject: [PATCH] oleacc: Add IOleWindow interface stub to default client accessible object. --- dlls/oleacc/client.c | 58 +++++++++++++++++++++++++++++++++++++++++++++--- dlls/oleacc/tests/main.c | 5 +++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 8a48b36af7f..8c3f0111ee9 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -27,6 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(oleacc); typedef struct { IAccessible IAccessible_iface; + IOleWindow IOleWindow_iface; LONG ref; @@ -48,11 +49,16 @@ static HRESULT WINAPI Client_QueryInterface(IAccessible *iface, REFIID riid, voi IsEqualIID(riid, &IID_IDispatch) || IsEqualIID(riid, &IID_IUnknown)) { *ppv = iface; - IAccessible_AddRef(iface); - return S_OK; + }else if(IsEqualIID(riid, &IID_IOleWindow)) { + *ppv = &This->IOleWindow_iface; + }else { + WARN("no interface: %s\n", debugstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; } - return E_NOINTERFACE; + IAccessible_AddRef(iface); + return S_OK; } static ULONG WINAPI Client_AddRef(IAccessible *iface) @@ -439,6 +445,51 @@ static const IAccessibleVtbl ClientVtbl = { Client_put_accValue }; +static inline Client* impl_from_Client_OleWindow(IOleWindow *iface) +{ + return CONTAINING_RECORD(iface, Client, IOleWindow_iface); +} + +static HRESULT WINAPI Client_OleWindow_QueryInterface(IOleWindow *iface, REFIID riid, void **ppv) +{ + Client *This = impl_from_Client_OleWindow(iface); + return IAccessible_QueryInterface(&This->IAccessible_iface, riid, ppv); +} + +static ULONG WINAPI Client_OleWindow_AddRef(IOleWindow *iface) +{ + Client *This = impl_from_Client_OleWindow(iface); + return IAccessible_AddRef(&This->IAccessible_iface); +} + +static ULONG WINAPI Client_OleWindow_Release(IOleWindow *iface) +{ + Client *This = impl_from_Client_OleWindow(iface); + return IAccessible_Release(&This->IAccessible_iface); +} + +static HRESULT WINAPI Client_OleWindow_GetWindow(IOleWindow *iface, HWND *phwnd) +{ + Client *This = impl_from_Client_OleWindow(iface); + FIXME("(%p)->(%p)\n", This, phwnd); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_OleWindow_ContextSensitiveHelp(IOleWindow *iface, BOOL fEnterMode) +{ + Client *This = impl_from_Client_OleWindow(iface); + FIXME("(%p)->(%x)\n", This, fEnterMode); + return E_NOTIMPL; +} + +static const IOleWindowVtbl ClientOleWindowVtbl = { + Client_OleWindow_QueryInterface, + Client_OleWindow_AddRef, + Client_OleWindow_Release, + Client_OleWindow_GetWindow, + Client_OleWindow_ContextSensitiveHelp +}; + HRESULT create_client_object(HWND hwnd, const IID *iid, void **obj) { Client *client; @@ -452,6 +503,7 @@ HRESULT create_client_object(HWND hwnd, const IID *iid, void **obj) return E_OUTOFMEMORY; client->IAccessible_iface.lpVtbl = &ClientVtbl; + client->IOleWindow_iface.lpVtbl = &ClientOleWindowVtbl; client->ref = 1; client->hwnd = hwnd; diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c index d76dc79482b..3783d36f441 100644 --- a/dlls/oleacc/tests/main.c +++ b/dlls/oleacc/tests/main.c @@ -383,6 +383,7 @@ static void test_default_client_accessible_object(void) IAccessible *acc; IDispatch *disp; + IOleWindow *ow; HWND chld, hwnd; HRESULT hr; VARIANT vid, v; @@ -404,6 +405,10 @@ static void test_default_client_accessible_object(void) hr = CreateStdAccessibleObject(hwnd, OBJID_CLIENT, &IID_IAccessible, (void**)&acc); ok(hr == S_OK, "got %x\n", hr); + hr = IAccessible_QueryInterface(acc, &IID_IOleWindow, (void**)&ow); + ok(hr == S_OK, "got %x\n", hr); + IOleWindow_Release(ow); + hr = IAccessible_get_accChildCount(acc, &l); ok(hr == S_OK, "got %x\n", hr); ok(l == 1, "l = %d\n", l); -- 2.11.4.GIT