Dmitry Timoshkov : mstask: Implement ITask::GetPriority().

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


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

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

mstask: Implement ITask::GetPriority().

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.c | 10 +++++++++-
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c
index c2cd14e..27f4766 100644
--- a/dlls/mstask/task.c
+++ b/dlls/mstask/task.c
@@ -41,7 +41,7 @@ typedef struct
     LPWSTR task_name;
     HRESULT status;
     WORD idle_minutes, deadline_minutes;
-    DWORD maxRunTime;
+    DWORD priority, maxRunTime;
     LPWSTR accountName;
 } TaskImpl;
 
@@ -626,12 +626,14 @@ static HRESULT WINAPI MSTASK_ITask_SetPriority(
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI MSTASK_ITask_GetPriority(
-        ITask* iface,
-        DWORD *pdwPriority)
+static HRESULT WINAPI MSTASK_ITask_GetPriority(ITask *iface, DWORD *priority)
 {
-    FIXME("(%p, %p): stub\n", iface, pdwPriority);
-    return E_NOTIMPL;
+    TaskImpl *This = impl_from_ITask(iface);
+
+    TRACE("(%p, %p)\n", iface, priority);
+
+    *priority = This->priority;
+    return S_OK;
 }
 
 static HRESULT WINAPI MSTASK_ITask_SetTaskFlags(
@@ -845,6 +847,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *task_name, ITask **t
     This->status = SCHED_S_TASK_NOT_SCHEDULED;
     This->idle_minutes = 10;
     This->deadline_minutes = 60;
+    This->priority = NORMAL_PRIORITY_CLASS;
     This->accountName = NULL;
 
     /* Default time is 3 days = 259200000 ms */
diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c
index 55e4913..5952b53 100644
--- a/dlls/mstask/tests/task.c
+++ b/dlls/mstask/tests/task.c
@@ -501,7 +501,7 @@ static void test_task_state(void)
 {
     BOOL setup;
     HRESULT hr, status;
-    DWORD flags;
+    DWORD flags, val;
     WORD val1, val2;
 
     setup = setup_task();
@@ -557,6 +557,14 @@ static void test_task_state(void)
     ok(val1 == 10, "got %u\n", val1);
     ok(val2 == 60, "got %u\n", val2);
 
+    if (0) /* crashes under Windows */
+        hr = ITask_GetPriority(test_task, NULL);
+
+    val = 0xdeadbeef;
+    hr = ITask_GetPriority(test_task, &val);
+    ok(hr == S_OK, "got %#x\n", hr);
+    ok(val == NORMAL_PRIORITY_CLASS, "got %#x\n", val);
+
     cleanup_task();
 }
 




More information about the wine-cvs mailing list