Commit 8f81fa82 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

mstask: Store creator using IRegistrationInfo.

parent 6ff9f7e8
......@@ -301,20 +301,60 @@ static HRESULT WINAPI MSTASK_ITask_GetComment(ITask *iface, LPWSTR *comment)
return hr;
}
static HRESULT WINAPI MSTASK_ITask_SetCreator(
ITask* iface,
LPCWSTR pwszCreator)
static HRESULT WINAPI MSTASK_ITask_SetCreator(ITask *iface, LPCWSTR creator)
{
FIXME("(%p, %p): stub\n", iface, pwszCreator);
return E_NOTIMPL;
TaskImpl *This = impl_from_ITask(iface);
IRegistrationInfo *info;
HRESULT hr;
TRACE("(%p, %s)\n", iface, debugstr_w(creator));
if (!creator || !creator[0])
creator = NULL;
hr = ITaskDefinition_get_RegistrationInfo(This->task, &info);
if (hr == S_OK)
{
hr = IRegistrationInfo_put_Author(info, (BSTR)creator);
IRegistrationInfo_Release(info);
}
return hr;
}
static HRESULT WINAPI MSTASK_ITask_GetCreator(
ITask* iface,
LPWSTR *ppwszCreator)
static HRESULT WINAPI MSTASK_ITask_GetCreator(ITask *iface, LPWSTR *creator)
{
FIXME("(%p, %p): stub\n", iface, ppwszCreator);
return E_NOTIMPL;
TaskImpl *This = impl_from_ITask(iface);
IRegistrationInfo *info;
HRESULT hr;
BSTR author;
DWORD len;
TRACE("(%p, %p)\n", iface, creator);
hr = ITaskDefinition_get_RegistrationInfo(This->task, &info);
if (hr != S_OK) return hr;
hr = IRegistrationInfo_get_Author(info, &author);
if (hr == S_OK)
{
len = author ? lstrlenW(author) + 1 : 1;
*creator = CoTaskMemAlloc(len * sizeof(WCHAR));
if (*creator)
{
if (!author)
*creator[0] = 0;
else
lstrcpyW(*creator, author);
hr = S_OK;
}
else
hr = E_OUTOFMEMORY;
SysFreeString(author);
}
IRegistrationInfo_Release(info);
return hr;
}
static HRESULT WINAPI MSTASK_ITask_SetWorkItemData(
......
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