Dmitry Timoshkov : mstask: Store comment using IRegistrationInfo.
Alexandre Julliard
julliard at winehq.org
Mon Apr 2 16:32:52 CDT 2018
Module: wine
Branch: master
Commit: 6ff9f7e8700be0fb9924128c400501cc3b984a91
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6ff9f7e8700be0fb9924128c400501cc3b984a91
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Mon Apr 2 13:27:07 2018 +0800
mstask: Store comment using IRegistrationInfo.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mstask/task.c | 41 ++++++++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 13 deletions(-)
diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c
index 5a40236..d04666d 100644
--- a/dlls/mstask/task.c
+++ b/dlls/mstask/task.c
@@ -248,41 +248,56 @@ static HRESULT WINAPI MSTASK_ITask_GetExitCode(
static HRESULT WINAPI MSTASK_ITask_SetComment(ITask *iface, LPCWSTR comment)
{
TaskImpl *This = impl_from_ITask(iface);
+ IRegistrationInfo *info;
+ HRESULT hr;
TRACE("(%p, %s)\n", iface, debugstr_w(comment));
if (!comment || !comment[0])
comment = NULL;
- return IExecAction_put_Id(This->action, (BSTR)comment);
+ hr = ITaskDefinition_get_RegistrationInfo(This->task, &info);
+ if (hr == S_OK)
+ {
+ hr = IRegistrationInfo_put_Description(info, (BSTR)comment);
+ IRegistrationInfo_Release(info);
+ }
+ return hr;
}
static HRESULT WINAPI MSTASK_ITask_GetComment(ITask *iface, LPWSTR *comment)
{
TaskImpl *This = impl_from_ITask(iface);
+ IRegistrationInfo *info;
HRESULT hr;
- BSTR id;
+ BSTR description;
DWORD len;
TRACE("(%p, %p)\n", iface, comment);
- hr = IExecAction_get_Id(This->action, &id);
+ hr = ITaskDefinition_get_RegistrationInfo(This->task, &info);
if (hr != S_OK) return hr;
- len = id ? lstrlenW(id) + 1 : 1;
- *comment = CoTaskMemAlloc(len * sizeof(WCHAR));
- if (*comment)
+ hr = IRegistrationInfo_get_Description(info, &description);
+ if (hr == S_OK)
{
- if (!id)
- *comment[0] = 0;
+ len = description ? lstrlenW(description) + 1 : 1;
+ *comment = CoTaskMemAlloc(len * sizeof(WCHAR));
+ if (*comment)
+ {
+ if (!description)
+ *comment[0] = 0;
+ else
+ lstrcpyW(*comment, description);
+ hr = S_OK;
+ }
else
- lstrcpyW(*comment, id);
- hr = S_OK;
+ hr = E_OUTOFMEMORY;
+
+ SysFreeString(description);
}
- else
- hr = E_OUTOFMEMORY;
- SysFreeString(id);
+ IRegistrationInfo_Release(info);
return hr;
}
More information about the wine-cvs
mailing list