Commit f608c5d2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wshom: Implement Arguments() property for a shortcut.

parent 67fc9fba
...@@ -394,15 +394,31 @@ static HRESULT WINAPI WshShortcut_get_FullName(IWshShortcut *iface, BSTR *name) ...@@ -394,15 +394,31 @@ static HRESULT WINAPI WshShortcut_get_FullName(IWshShortcut *iface, BSTR *name)
static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Arguments) static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Arguments)
{ {
WshShortcut *This = impl_from_IWshShortcut(iface); WshShortcut *This = impl_from_IWshShortcut(iface);
FIXME("(%p)->(%p): stub\n", This, Arguments); WCHAR buffW[INFOTIPSIZE];
return E_NOTIMPL; 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) static HRESULT WINAPI WshShortcut_put_Arguments(IWshShortcut *iface, BSTR Arguments)
{ {
WshShortcut *This = impl_from_IWshShortcut(iface); 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) static HRESULT WINAPI WshShortcut_get_Description(IWshShortcut *iface, BSTR *Description)
......
...@@ -40,8 +40,9 @@ static void test_wshshell(void) ...@@ -40,8 +40,9 @@ static void test_wshshell(void)
IDispatchEx *dispex; IDispatchEx *dispex;
IWshCollection *coll; IWshCollection *coll;
IDispatch *disp, *shortcut; IDispatch *disp, *shortcut;
IUnknown *shell, *unk; IUnknown *shell;
IFolderCollection *folders; IFolderCollection *folders;
IWshShortcut *shcut;
ITypeInfo *ti; ITypeInfo *ti;
HRESULT hr; HRESULT hr;
TYPEATTR *tattr; TYPEATTR *tattr;
...@@ -109,9 +110,13 @@ static void test_wshshell(void) ...@@ -109,9 +110,13 @@ static void test_wshshell(void)
hr = IWshShell3_CreateShortcut(sh3, str, &shortcut); hr = IWshShell3_CreateShortcut(sh3, str, &shortcut);
EXPECT_HR(hr, S_OK); EXPECT_HR(hr, S_OK);
SysFreeString(str); SysFreeString(str);
hr = IDispatch_QueryInterface(shortcut, &IID_IWshShortcut, (void**)&unk); hr = IDispatch_QueryInterface(shortcut, &IID_IWshShortcut, (void**)&shcut);
EXPECT_HR(hr, S_OK); 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); IDispatch_Release(shortcut);
/* ExpandEnvironmentStrings */ /* ExpandEnvironmentStrings */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment