Nikolay Sivov : wshom: Implement Arguments() property for a shortcut.

Alexandre Julliard julliard at winehq.org
Tue Feb 4 13:55:05 CST 2014


Module: wine
Branch: master
Commit: f608c5d2ae7ee0dc82fbf2bae9ae82b7f8dbe5ee
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f608c5d2ae7ee0dc82fbf2bae9ae82b7f8dbe5ee

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Feb  4 10:24:30 2014 +0400

wshom: Implement Arguments() property for a shortcut.

---

 dlls/wshom.ocx/shell.c       |   24 ++++++++++++++++++++----
 dlls/wshom.ocx/tests/wshom.c |   11 ++++++++---
 2 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/dlls/wshom.ocx/shell.c b/dlls/wshom.ocx/shell.c
index 385d2a3..2dc2bbe 100644
--- a/dlls/wshom.ocx/shell.c
+++ b/dlls/wshom.ocx/shell.c
@@ -394,15 +394,31 @@ static HRESULT WINAPI WshShortcut_get_FullName(IWshShortcut *iface, BSTR *name)
 static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Arguments)
 {
     WshShortcut *This = impl_from_IWshShortcut(iface);
-    FIXME("(%p)->(%p): stub\n", This, Arguments);
-    return E_NOTIMPL;
+    WCHAR buffW[INFOTIPSIZE];
+    HRESULT hr;
+
+    TRACE("(%p)->(%p)\n", This, Arguments);
+
+    if (!Arguments)
+        return E_POINTER;
+
+    *Arguments = NULL;
+
+    hr = IShellLinkW_GetArguments(This->link, buffW, sizeof(buffW)/sizeof(WCHAR));
+    if (FAILED(hr))
+        return hr;
+
+    *Arguments = SysAllocString(buffW);
+    return S_OK;
 }
 
 static HRESULT WINAPI WshShortcut_put_Arguments(IWshShortcut *iface, BSTR Arguments)
 {
     WshShortcut *This = impl_from_IWshShortcut(iface);
-    FIXME("(%p)->(%s): stub\n", This, debugstr_w(Arguments));
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(Arguments));
+
+    return IShellLinkW_SetArguments(This->link, Arguments);
 }
 
 static HRESULT WINAPI WshShortcut_get_Description(IWshShortcut *iface, BSTR *Description)
diff --git a/dlls/wshom.ocx/tests/wshom.c b/dlls/wshom.ocx/tests/wshom.c
index 50adb90..0e01304 100644
--- a/dlls/wshom.ocx/tests/wshom.c
+++ b/dlls/wshom.ocx/tests/wshom.c
@@ -40,8 +40,9 @@ static void test_wshshell(void)
     IDispatchEx *dispex;
     IWshCollection *coll;
     IDispatch *disp, *shortcut;
-    IUnknown *shell, *unk;
+    IUnknown *shell;
     IFolderCollection *folders;
+    IWshShortcut *shcut;
     ITypeInfo *ti;
     HRESULT hr;
     TYPEATTR *tattr;
@@ -109,9 +110,13 @@ static void test_wshshell(void)
     hr = IWshShell3_CreateShortcut(sh3, str, &shortcut);
     EXPECT_HR(hr, S_OK);
     SysFreeString(str);
-    hr = IDispatch_QueryInterface(shortcut, &IID_IWshShortcut, (void**)&unk);
+    hr = IDispatch_QueryInterface(shortcut, &IID_IWshShortcut, (void**)&shcut);
     EXPECT_HR(hr, S_OK);
-    IUnknown_Release(unk);
+
+    hr = IWshShortcut_get_Arguments(shcut, NULL);
+    ok(hr == E_POINTER, "got 0x%08x\n", hr);
+
+    IWshShortcut_Release(shcut);
     IDispatch_Release(shortcut);
 
     /* ExpandEnvironmentStrings */




More information about the wine-cvs mailing list