mstask: Store creator using IRegistrationInfo.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6ff9f7e870
commit
8f81fa82d5
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue