Dmitry Timoshkov : mstask: Store creator using IRegistrationInfo.
Module: wine Branch: master Commit: 8f81fa82d53c92023e766e353f1a0e8dc34dcece URL: https://source.winehq.org/git/wine.git/?a=commit;h=8f81fa82d53c92023e766e353... Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 2 13:27:10 2018 +0800 mstask: Store creator using IRegistrationInfo. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 60 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index d04666d..34d1fa0 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -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(
participants (1)
-
Alexandre Julliard