[PATCH 3/4] shell32: Implement FolderItem::get_GetLink.

Myah Caron qsniyg at protonmail.com
Sun Sep 13 15:34:41 CDT 2020


Signed-off-by: Myah Caron <qsniyg at protonmail.com>
---
 dlls/shell32/shelldispatch.c       | 17 +++++++++++++++--
 dlls/shell32/tests/shelldispatch.c |  4 ++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index f4947c815f1..3dcfe0ce626 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -1109,10 +1109,23 @@ static HRESULT WINAPI FolderItemImpl_get_Path(FolderItem2 *iface, BSTR *path)
 static HRESULT WINAPI FolderItemImpl_get_GetLink(FolderItem2 *iface,
         IDispatch **ppid)
 {
-    FIXME("(%p,%p)\n", iface, ppid);
+    IShellLinkDual2 *link;
+    HRESULT hr;
+    FolderItemImpl *This = impl_from_FolderItem(iface);
+
+    TRACE("(%p,%p)\n", iface, ppid);

     *ppid = NULL;
-    return E_NOTIMPL;
+
+    if (!(This->attributes & SFGAO_LINK))
+        return E_NOTIMPL;
+
+    hr = ShellLinkObject_Constructor(This, &link);
+    if (hr != S_OK)
+        return hr;
+
+    *ppid = (IDispatch*)link;
+    return S_OK;
 }

 static HRESULT WINAPI FolderItemImpl_get_GetFolder(FolderItem2 *iface,
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index 3c1c473dede..622a3a95f9c 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -1490,8 +1490,8 @@ static void test_ShellLinkObject(void)

     dispatch = (IDispatch*)0xdeadbeef;
     hr = FolderItem_get_GetLink(item, &dispatch);
-    todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
-    todo_wine ok(dispatch && dispatch != (IDispatch*)0xdeadbeef, "got %p\n", dispatch);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(dispatch && dispatch != (IDispatch*)0xdeadbeef, "got %p\n", dispatch);

     if (dispatch) {
         sld = (IShellLinkDual2*)dispatch;
--
2.28.0





More information about the wine-devel mailing list