[PATCH 4/4] shell32: Implement ShellLinkObject::get_Path.
Myah Caron
qsniyg at protonmail.com
Sun Sep 13 15:35:14 CDT 2020
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=49591
Signed-off-by: Myah Caron <qsniyg at protonmail.com>
---
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 622a3a95f9c..153584fe292 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -1498,7 +1498,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) {
GetFullPathNameW(L"winetest_empty_file.txt", MAX_PATH, tempW, NULL);
ok(!wcscmp(str, tempW), "got %s\n", wine_dbgstr_w(str));
--
2.28.0
More information about the wine-devel
mailing list