Dmitry Timoshkov : mstask: Implement IPersistFile::GetCurFile().
Alexandre Julliard
julliard at winehq.org
Wed Apr 25 15:11:15 CDT 2018
Module: wine
Branch: master
Commit: ce0d9956f5d968752efaa7a09df8fecb2bb81f81
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ce0d9956f5d968752efaa7a09df8fecb2bb81f81
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Wed Apr 25 11:34:34 2018 +0800
mstask: Implement IPersistFile::GetCurFile().
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 8c9d479..a7fe199 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 ddbb660..fbee5ec 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);
More information about the wine-cvs
mailing list