[PATCH v2 4/4] shell32: Implement ShellLinkObject::get_Path.

Myah Caron qsniyg at protonmail.com
Sun Sep 13 16:28:33 CDT 2020


Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=49591
Signed-off-by: Myah Caron <qsniyg at protonmail.com>
---
v2: no change.

 dlls/shell32/shelldispatch.c       | 15 +++++++++++++--
 dlls/shell32/tests/shelldispatch.c |  2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index 3dcfe0ce626..df0e22191c4 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -738,9 +738,20 @@ static HRESULT WINAPI ShellLinkObject_Invoke(IShellLinkDual2 *iface, DISPID disp

 static HRESULT WINAPI ShellLinkObject_get_Path(IShellLinkDual2 *iface, BSTR *pbs)
 {
-    FIXME("(%p, %p)\n", iface, pbs);
+    ShellLinkObjectImpl *This = impl_from_IShellLinkDual(iface);
+    WCHAR path[MAX_PATH];
+    HRESULT hr;

-    return E_NOTIMPL;
+    TRACE("(%p, %p)\n", iface, pbs);
+
+    *pbs = NULL;
+
+    hr = IShellLinkW_GetPath(This->shell_link, path, MAX_PATH, NULL, 0);
+    if (hr != S_OK)
+        return hr;
+
+    *pbs = SysAllocString(path);
+    return hr;
 }

 static HRESULT WINAPI ShellLinkObject_put_Path(IShellLinkDual2 *iface, BSTR bs)
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index 3c3497abe7f..287f5be3ffc 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -1499,7 +1499,7 @@ static void test_ShellLinkObject(void)

         str = (BSTR)0xdeadbeef;
         hr = IShellLinkDual2_get_Path(sld, &str);
-        todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
         if (hr == S_OK) {
             ok(!wcscmp(str, tempW), "got %s (wanted %s)\n",
                wine_dbgstr_w(str), wine_dbgstr_w(tempW));
--
2.28.0





More information about the wine-devel mailing list