Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/mstask/task.c | 15 ++++++++++----- dlls/mstask/tests/task_scheduler.c | 4 ---- 2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 8c9d479d55..a7fe199a3c 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -1069,12 +1069,17 @@ static HRESULT WINAPI MSTASK_IPersistFile_SaveCompleted( return E_NOTIMPL; }
-static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile( - IPersistFile* iface, - LPOLESTR *ppszFileName) +static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *file_name) { - FIXME("(%p, %p): stub\n", iface, ppszFileName); - return E_NOTIMPL; + TaskImpl *This = impl_from_IPersistFile(iface); + + TRACE("(%p, %p)\n", iface, file_name); + + *file_name = CoTaskMemAlloc((strlenW(This->task_name) + 1) * sizeof(WCHAR)); + if (!*file_name) return E_OUTOFMEMORY; + + strcpyW(*file_name, This->task_name); + return S_OK; }
static const ITaskVtbl MSTASK_ITaskVtbl = diff --git a/dlls/mstask/tests/task_scheduler.c b/dlls/mstask/tests/task_scheduler.c index ddbb66068f..fbee5ecb66 100644 --- a/dlls/mstask/tests/task_scheduler.c +++ b/dlls/mstask/tests/task_scheduler.c @@ -284,9 +284,7 @@ static WCHAR *get_task_curfile(ITask *task) ok(hr == S_OK, "QueryInterface error %#x\n", hr); curfile = NULL; hr = IPersistFile_GetCurFile(pfile, &curfile); -todo_wine ok(hr == S_OK, "GetCurFile error %#x\n", hr); -todo_wine ok(curfile && curfile[0] , "curfile should not be NULL\n");
if (0) /* crashes under Windows */ @@ -326,7 +324,6 @@ static void test_task_storage(void)
curfile = get_task_curfile(task); ok(!file_exists(curfile), "curfile should not exist\n"); -todo_wine ok(!lstrcmpW(curfile, task_full_name), "name is wrong %s\n", wine_dbgstr_w(curfile));
hr = ITaskScheduler_NewWorkItem(scheduler, Task1, &CLSID_CTask, &IID_ITask, (IUnknown **)&task2); @@ -335,7 +332,6 @@ todo_wine
curfile2 = get_task_curfile(task); ok(!file_exists(curfile2), "curfile2 should not exist\n"); -todo_wine ok(!lstrcmpW(curfile2, task_full_name), "name is wrong %s\n", wine_dbgstr_w(curfile2));
CoTaskMemFree(curfile);