[PATCH v4 3/3] shell32: Implement ShellLinkObject::get_Path.
Myah Caron
qsniyg at protonmail.com
Mon Sep 14 10:06:33 CDT 2020
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=49591
Signed-off-by: Myah Caron <qsniyg at protonmail.com>
---
v4: 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 9bc40fcc9c5..e07a9f690f0 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -735,9 +735,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 ae1cf086270..33ada2d80cc 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -1500,7 +1500,7 @@ static void test_ShellLinkObject(void)
str = NULL;
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, empty_path), "got %s (wanted %s)\n",
wine_dbgstr_w(str), wine_dbgstr_w(empty_path));
--
2.28.0
More information about the wine-devel
mailing list