Module: wine Branch: master Commit: 3014fb16179ff0e93d4d4a2e5fa86674228a6881 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3014fb16179ff0e93d4d4a2e5f...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon Sep 18 10:39:42 2017 +0300
shell32: Added remaining Application() properties.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/shell32/shelldispatch.c | 23 ++++++++++++++++------- dlls/shell32/tests/shelldispatch.c | 23 ++++++++++++++++++++++- 2 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c index c489eb6..24843f0 100644 --- a/dlls/shell32/shelldispatch.c +++ b/dlls/shell32/shelldispatch.c @@ -292,7 +292,10 @@ static HRESULT WINAPI FolderItemVerbImpl_Invoke(FolderItemVerb *iface,
static HRESULT WINAPI FolderItemVerbImpl_get_Application(FolderItemVerb *iface, IDispatch **disp) { - FIXME("(%p, %p)\n", iface, disp); + TRACE("(%p, %p)\n", iface, disp); + + if (disp) + *disp = NULL; return E_NOTIMPL; }
@@ -474,7 +477,10 @@ static HRESULT WINAPI FolderItemVerbsImpl_get_Count(FolderItemVerbs *iface, LONG
static HRESULT WINAPI FolderItemVerbsImpl_get_Application(FolderItemVerbs *iface, IDispatch **disp) { - FIXME("(%p, %p)\n", iface, disp); + TRACE("(%p, %p)\n", iface, disp); + + if (disp) + *disp = NULL; return E_NOTIMPL; }
@@ -1764,13 +1770,16 @@ static HRESULT WINAPI ShellDispatch_Invoke(IShellDispatch6 *iface, return hr; }
-static HRESULT WINAPI ShellDispatch_get_Application(IShellDispatch6 *iface, - IDispatch **ppid) +static HRESULT WINAPI ShellDispatch_get_Application(IShellDispatch6 *iface, IDispatch **disp) { - FIXME("(%p,%p)\n", iface, ppid); + TRACE("(%p,%p)\n", iface, disp);
- *ppid = NULL; - return E_NOTIMPL; + if (!disp) + return E_INVALIDARG; + + *disp = (IDispatch *)iface; + IDispatch_AddRef(*disp); + return S_OK; }
static HRESULT WINAPI ShellDispatch_get_Parent(IShellDispatch6 *iface, IDispatch **disp) diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c index fa7e8dc..a9c5549 100644 --- a/dlls/shell32/tests/shelldispatch.c +++ b/dlls/shell32/tests/shelldispatch.c @@ -131,6 +131,12 @@ static void test_namespace(void) ok(SUCCEEDED(r), "Failed to create ShellDispatch object: %#x.\n", r);
disp = NULL; + r = IShellDispatch_get_Application(sd, &disp); + ok(r == S_OK, "Failed to get application pointer, hr %#x.\n", r); + ok(disp == (IDispatch *)sd, "Unexpected application pointer %p.\n", disp); + IDispatch_Release(disp); + + disp = NULL; r = IShellDispatch_get_Parent(sd, &disp); ok(r == S_OK, "Failed to get Shell object parent, hr %#x.\n", r); ok(disp == (IDispatch *)sd, "Unexpected parent pointer %p.\n", disp); @@ -1226,7 +1232,7 @@ static void test_ParseName(void)
static void test_Verbs(void) { - FolderItemVerbs *verbs; + FolderItemVerbs *verbs, *verbs2; WCHAR pathW[MAX_PATH]; FolderItemVerb *verb; IShellDispatch *sd; @@ -1265,6 +1271,16 @@ if (0) { /* crashes on some systems */ hr = FolderItem_Verbs(item, &verbs); ok(hr == S_OK, "got 0x%08x\n", hr);
+ hr = FolderItem_Verbs(item, &verbs2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(verbs2 != verbs, "Unexpected verbs pointer.\n"); + FolderItemVerbs_Release(verbs2); + + disp = (void *)0xdeadbeef; + hr = FolderItemVerbs_get_Application(verbs, &disp); + ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + ok(disp == NULL, "Unexpected application pointer.\n"); + disp = (void *)0xdeadbeef; hr = FolderItemVerbs_get_Parent(verbs, &disp); ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); @@ -1303,6 +1319,11 @@ if (0) { /* crashes on winxp/win2k3 */ ok(hr == E_NOTIMPL, "got %#x.\n", hr); ok(disp == NULL, "Unexpected parent pointer %p.\n", disp);
+ disp = (void *)0xdeadbeef; + hr = FolderItemVerb_get_Application(verb, &disp); + ok(hr == E_NOTIMPL, "got %#x.\n", hr); + ok(disp == NULL, "Unexpected parent pointer %p.\n", disp); + SysFreeString(str); FolderItemVerb_Release(verb); }