Dmitry Timoshkov : mstask: Implement better stub for ITask::GetExitCode().

Alexandre Julliard julliard at winehq.org
Fri Apr 20 17:55:42 CDT 2018


Module: wine
Branch: master
Commit: 23be14b1afda8ee4bd2821d0776e7d75b272a5de
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=23be14b1afda8ee4bd2821d0776e7d75b272a5de

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Apr 20 16:37:24 2018 +0800

mstask: Implement better stub for ITask::GetExitCode().

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mstask/task.c       | 10 +++++-----
 dlls/mstask/tests/task.c |  8 ++++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c
index 27f4766..ed0ef65 100644
--- a/dlls/mstask/task.c
+++ b/dlls/mstask/task.c
@@ -243,12 +243,12 @@ static HRESULT WINAPI MSTASK_ITask_GetStatus(ITask *iface, HRESULT *status)
     return S_OK;
 }
 
-static HRESULT WINAPI MSTASK_ITask_GetExitCode(
-        ITask* iface,
-        DWORD *pdwExitCode)
+static HRESULT WINAPI MSTASK_ITask_GetExitCode(ITask *iface, DWORD *exit_code)
 {
-    FIXME("(%p, %p): stub\n", iface, pdwExitCode);
-    return E_NOTIMPL;
+    FIXME("(%p, %p): stub\n", iface, exit_code);
+
+    *exit_code = 0;
+    return SCHED_S_TASK_HAS_NOT_RUN;
 }
 
 static HRESULT WINAPI MSTASK_ITask_SetComment(ITask *iface, LPCWSTR comment)
diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c
index 5952b53..6184604 100644
--- a/dlls/mstask/tests/task.c
+++ b/dlls/mstask/tests/task.c
@@ -565,6 +565,14 @@ static void test_task_state(void)
     ok(hr == S_OK, "got %#x\n", hr);
     ok(val == NORMAL_PRIORITY_CLASS, "got %#x\n", val);
 
+    if (0) /* crashes under Windows */
+        hr = ITask_GetExitCode(test_task, NULL);
+
+    val = 0xdeadbeef;
+    hr = ITask_GetExitCode(test_task, &val);
+    ok(hr == SCHED_S_TASK_HAS_NOT_RUN, "got %#x\n", hr);
+    ok(val == 0, "got %#x\n", val);
+
     cleanup_task();
 }
 




More information about the wine-cvs mailing list