Commit ce0d9956 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

mstask: Implement IPersistFile::GetCurFile().

parent caafc3c6
...@@ -1069,12 +1069,17 @@ static HRESULT WINAPI MSTASK_IPersistFile_SaveCompleted( ...@@ -1069,12 +1069,17 @@ static HRESULT WINAPI MSTASK_IPersistFile_SaveCompleted(
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile( static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *file_name)
IPersistFile* iface,
LPOLESTR *ppszFileName)
{ {
FIXME("(%p, %p): stub\n", iface, ppszFileName); TaskImpl *This = impl_from_IPersistFile(iface);
return E_NOTIMPL;
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 = static const ITaskVtbl MSTASK_ITaskVtbl =
......
...@@ -284,9 +284,7 @@ static WCHAR *get_task_curfile(ITask *task) ...@@ -284,9 +284,7 @@ static WCHAR *get_task_curfile(ITask *task)
ok(hr == S_OK, "QueryInterface error %#x\n", hr); ok(hr == S_OK, "QueryInterface error %#x\n", hr);
curfile = NULL; curfile = NULL;
hr = IPersistFile_GetCurFile(pfile, &curfile); hr = IPersistFile_GetCurFile(pfile, &curfile);
todo_wine
ok(hr == S_OK, "GetCurFile error %#x\n", hr); ok(hr == S_OK, "GetCurFile error %#x\n", hr);
todo_wine
ok(curfile && curfile[0] , "curfile should not be NULL\n"); ok(curfile && curfile[0] , "curfile should not be NULL\n");
if (0) /* crashes under Windows */ if (0) /* crashes under Windows */
...@@ -326,7 +324,6 @@ static void test_task_storage(void) ...@@ -326,7 +324,6 @@ static void test_task_storage(void)
curfile = get_task_curfile(task); curfile = get_task_curfile(task);
ok(!file_exists(curfile), "curfile should not exist\n"); 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)); 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); hr = ITaskScheduler_NewWorkItem(scheduler, Task1, &CLSID_CTask, &IID_ITask, (IUnknown **)&task2);
...@@ -335,7 +332,6 @@ todo_wine ...@@ -335,7 +332,6 @@ todo_wine
curfile2 = get_task_curfile(task); curfile2 = get_task_curfile(task);
ok(!file_exists(curfile2), "curfile2 should not exist\n"); 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)); ok(!lstrcmpW(curfile2, task_full_name), "name is wrong %s\n", wine_dbgstr_w(curfile2));
CoTaskMemFree(curfile); CoTaskMemFree(curfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment