[PATCH 1/9] mstask: Implement IPersistFile::GetClassID().

Dmitry Timoshkov dmitry at baikal.ru
Fri Apr 20 03:37:04 CDT 2018


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/mstask/task.c                 | 10 +++++-----
 dlls/mstask/tests/task_scheduler.c |  8 ++++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c
index 34d1fa010e..c4e9f84a3f 100644
--- a/dlls/mstask/task.c
+++ b/dlls/mstask/task.c
@@ -703,12 +703,12 @@ static ULONG WINAPI MSTASK_IPersistFile_Release(
     return ref;
 }
 
-static HRESULT WINAPI MSTASK_IPersistFile_GetClassID(
-        IPersistFile* iface,
-        CLSID *pClassID)
+static HRESULT WINAPI MSTASK_IPersistFile_GetClassID(IPersistFile *iface, CLSID *clsid)
 {
-    FIXME("(%p, %p): stub\n", iface, pClassID);
-    return E_NOTIMPL;
+    TRACE("(%p, %p)\n", iface, clsid);
+
+    *clsid = CLSID_CTask;
+    return S_OK;
 }
 
 static HRESULT WINAPI MSTASK_IPersistFile_IsDirty(
diff --git a/dlls/mstask/tests/task_scheduler.c b/dlls/mstask/tests/task_scheduler.c
index e1e76e8c9c..ddbb66068f 100644
--- a/dlls/mstask/tests/task_scheduler.c
+++ b/dlls/mstask/tests/task_scheduler.c
@@ -278,6 +278,7 @@ static WCHAR *get_task_curfile(ITask *task)
     HRESULT hr;
     IPersistFile *pfile;
     WCHAR *curfile;
+    CLSID clsid;
 
     hr = ITask_QueryInterface(task, &IID_IPersistFile, (void **)&pfile);
     ok(hr == S_OK, "QueryInterface error %#x\n", hr);
@@ -288,6 +289,13 @@ todo_wine
 todo_wine
     ok(curfile && curfile[0] , "curfile should not be NULL\n");
 
+    if (0) /* crashes under Windows */
+        hr = IPersistFile_GetClassID(pfile, NULL);
+
+    hr = IPersistFile_GetClassID(pfile, &clsid);
+    ok(hr == S_OK, "GetClassID error %#x\n", hr);
+    ok(IsEqualCLSID(&clsid, &CLSID_CTask), "got %s\n", wine_dbgstr_guid(&clsid));
+
     IPersistFile_Release(pfile);
 
     return curfile;
-- 
2.16.3




More information about the wine-devel mailing list