Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/taskschd/task.c | 9 ++++----- dlls/taskschd/tests/scheduler.c | 7 +++++++ 2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 19546c0d71..933d833016 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -581,15 +581,14 @@ static HRESULT WINAPI RegistrationInfo_get_Description(IRegistrationInfo *iface, static HRESULT WINAPI RegistrationInfo_put_Description(IRegistrationInfo *iface, BSTR description) { registration_info *reginfo = impl_from_IRegistrationInfo(iface); + WCHAR *str = NULL;
TRACE("%p,%s\n", iface, debugstr_w(description));
- if (!description) return E_INVALIDARG; - + if (description && !(str = heap_strdupW(description))) return E_OUTOFMEMORY; heap_free(reginfo->description); - reginfo->description = heap_strdupW(description); - /* FIXME: update XML on the server side */ - return reginfo->description ? S_OK : E_OUTOFMEMORY; + reginfo->description = str; + return S_OK; }
static HRESULT WINAPI RegistrationInfo_get_Author(IRegistrationInfo *iface, BSTR *author) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index c0f691a53d..82f3315099 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1602,6 +1602,13 @@ todo_wine ok(hr == S_OK, "get_Description error %#x\n", hr); ok(!lstrcmpW(bstr, Task1), "expected Task1, got %s\n", wine_dbgstr_w(bstr)); SysFreeString(bstr); + hr = IRegistrationInfo_put_Description(reginfo, NULL); + ok(hr == S_OK, "put_Description error %#x\n", hr); + bstr = (BSTR)0xdeadbeef; + hr = IRegistrationInfo_get_Description(reginfo, &bstr); + ok(hr == S_OK, "get_Description error %#x\n", hr); + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + hr = IRegistrationInfo_get_Author(reginfo, &bstr); ok(hr == S_OK, "get_Author error %#x\n", hr); ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr));