Commit 2e04dd1c authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

mstask: Implement ITask::GetPriority().

parent d08a101a
...@@ -41,7 +41,7 @@ typedef struct ...@@ -41,7 +41,7 @@ typedef struct
LPWSTR task_name; LPWSTR task_name;
HRESULT status; HRESULT status;
WORD idle_minutes, deadline_minutes; WORD idle_minutes, deadline_minutes;
DWORD maxRunTime; DWORD priority, maxRunTime;
LPWSTR accountName; LPWSTR accountName;
} TaskImpl; } TaskImpl;
...@@ -626,12 +626,14 @@ static HRESULT WINAPI MSTASK_ITask_SetPriority( ...@@ -626,12 +626,14 @@ static HRESULT WINAPI MSTASK_ITask_SetPriority(
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI MSTASK_ITask_GetPriority( static HRESULT WINAPI MSTASK_ITask_GetPriority(ITask *iface, DWORD *priority)
ITask* iface,
DWORD *pdwPriority)
{ {
FIXME("(%p, %p): stub\n", iface, pdwPriority); TaskImpl *This = impl_from_ITask(iface);
return E_NOTIMPL;
TRACE("(%p, %p)\n", iface, priority);
*priority = This->priority;
return S_OK;
} }
static HRESULT WINAPI MSTASK_ITask_SetTaskFlags( static HRESULT WINAPI MSTASK_ITask_SetTaskFlags(
...@@ -845,6 +847,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *task_name, ITask **t ...@@ -845,6 +847,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *task_name, ITask **t
This->status = SCHED_S_TASK_NOT_SCHEDULED; This->status = SCHED_S_TASK_NOT_SCHEDULED;
This->idle_minutes = 10; This->idle_minutes = 10;
This->deadline_minutes = 60; This->deadline_minutes = 60;
This->priority = NORMAL_PRIORITY_CLASS;
This->accountName = NULL; This->accountName = NULL;
/* Default time is 3 days = 259200000 ms */ /* Default time is 3 days = 259200000 ms */
......
...@@ -501,7 +501,7 @@ static void test_task_state(void) ...@@ -501,7 +501,7 @@ static void test_task_state(void)
{ {
BOOL setup; BOOL setup;
HRESULT hr, status; HRESULT hr, status;
DWORD flags; DWORD flags, val;
WORD val1, val2; WORD val1, val2;
setup = setup_task(); setup = setup_task();
...@@ -557,6 +557,14 @@ static void test_task_state(void) ...@@ -557,6 +557,14 @@ static void test_task_state(void)
ok(val1 == 10, "got %u\n", val1); ok(val1 == 10, "got %u\n", val1);
ok(val2 == 60, "got %u\n", val2); 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(); cleanup_task();
} }
......
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