taskschd: Implement IRegisteredTask::get_Name.

This commit is contained in:
Dmitry Timoshkov 2014-04-08 15:49:28 +09:00 committed by Alexandre Julliard
parent 5c5d17e8f3
commit d79cce769a
2 changed files with 22 additions and 8 deletions

View File

@ -117,8 +117,23 @@ static HRESULT WINAPI regtask_Invoke(IRegisteredTask *iface, DISPID dispid, REFI
static HRESULT WINAPI regtask_get_Name(IRegisteredTask *iface, BSTR *name)
{
FIXME("%p,%p: stub\n", iface, name);
return E_NOTIMPL;
RegisteredTask *regtask = impl_from_IRegisteredTask(iface);
const WCHAR *p_name;
TRACE("%p,%p\n", iface, name);
if (!name) return E_POINTER;
p_name = strrchrW(regtask->path, '\\');
if (!p_name)
p_name = regtask->path;
else
if (p_name[1] != 0) p_name++;
*name = SysAllocString(p_name);
if (!*name) return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI regtask_get_Path(IRegisteredTask *iface, BSTR *path)

View File

@ -805,22 +805,21 @@ todo_wine
}
hr = IRegisteredTask_get_Name(task1, NULL);
todo_wine
ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr);
hr = IRegisteredTask_get_Name(task1, &bstr);
todo_wine
ok(hr == S_OK, "get_Name error %#x\n", hr);
ok(!lstrcmpW(bstr, Task1), "expected Task1, got %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
hr = IRegisteredTask_get_Path(task1, &bstr);
todo_wine
ok(hr == S_OK, "get_Path error %#x\n", hr);
/* FIXME: Remove once implemented */
if (hr != S_OK)
{
ITaskFolder_DeleteTask(root, Wine_Task1, 0);
goto failed;
}
ok(!lstrcmpW(bstr, Task1), "expected Task1, got %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
hr = IRegisteredTask_get_Path(task1, &bstr);
ok(hr == S_OK, "get_Path error %#x\n", hr);
ok(!lstrcmpW(bstr, Wine_Task1), "expected \\Wine\\Task1, got %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
hr = IRegisteredTask_get_State(task1, &state);