Commit a4c4574b authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

taskschd: Implement ITaskFolder::get_Name.

parent 3003ee9b
......@@ -115,8 +115,23 @@ static HRESULT WINAPI TaskFolder_Invoke(ITaskFolder *iface, DISPID dispid, REFII
static HRESULT WINAPI TaskFolder_get_Name(ITaskFolder *iface, BSTR *name)
{
FIXME("%p,%p: stub\n", iface, name);
return E_NOTIMPL;
TaskFolder *folder = impl_from_ITaskFolder(iface);
const WCHAR *p_name;
TRACE("%p,%p\n", iface, name);
if (!name) return E_POINTER;
p_name = strrchrW(folder->path, '\\');
if (!p_name)
p_name = folder->path;
else
if (p_name[1] != 0) p_name++;
*name = SysAllocString(p_name);
if (!*name) return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT reg_open_folder(const WCHAR *path, HKEY *hfolder)
......
......@@ -169,17 +169,12 @@ todo_wine
ok(hr == S_OK, "GetFolder error %#x\n", hr);
hr = ITaskFolder_get_Name(folder, NULL);
todo_wine
ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr);
hr = ITaskFolder_get_Name(folder, &bstr);
todo_wine
ok (hr == S_OK, "get_Name error %#x\n", hr);
if (hr == S_OK)
{
ok(!lstrcmpW(bstr, bslash), "expected '\\', got %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
}
hr = ITaskFolder_get_Path(folder, NULL);
ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr);
......
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